Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web_component
submodule
Commits
76435779
Commit
76435779
authored
Aug 10, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update dragResize dir and fixed ui
parent
4d970a83
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
7 deletions
+31
-7
DragFixed.tsx
components/apolloTable/component/DragFixed.tsx
+6
-2
DragResized.less
components/apolloTable/component/DragResized.less
+4
-1
DragResized.tsx
components/apolloTable/component/DragResized.tsx
+14
-2
RightDragFixed.tsx
components/apolloTable/component/RightDragFixed.tsx
+6
-2
Table.tsx
components/apolloTable/component/Table.tsx
+1
-0
No files found.
components/apolloTable/component/DragFixed.tsx
View file @
76435779
...
...
@@ -36,6 +36,10 @@ const DragFixed = (props: any) => {
const
onMouseMoveWrap
=
(
e
:
any
)
=>
{
// 滑块位置跟随鼠标上下移动
const
handleWrapRect
=
handleWrap
.
getBoundingClientRect
();
if
(
e
.
clientY
<
handleWrapRect
.
y
)
{
return
;
}
handle
.
style
.
top
=
`
${
e
.
clientY
}
px`
;
};
...
...
@@ -51,7 +55,7 @@ const DragFixed = (props: any) => {
onResizeStart
();
}
const
originLeft
=
container
.
getBoundingClientRect
().
x
||
0
;
handleWrap
.
style
.
top
=
0
;
//
handleWrap.style.top = 0;
handleWrap
.
style
.
left
=
`
${
e
.
x
-
originLeft
}
px`
;
};
...
...
@@ -95,7 +99,7 @@ const DragFixed = (props: any) => {
dividerWrap
.
style
.
display
=
'none'
;
// 滑块wrap移除hovered样式
handleWrap
.
classList
.
remove
(
styles
.
hovered
);
handleWrap
.
style
.
top
=
`
${
initTop
}
px`
;
//
handleWrap.style.top = `${initTop}px`;
handleWrap
.
style
.
left
=
fixedWidth
;
// 滑块隐藏
handle
.
style
.
opacity
=
0
;
...
...
components/apolloTable/component/DragResized.less
View file @
76435779
...
...
@@ -5,10 +5,13 @@
width: 2px;
height: 100%;
bottom: 0;
right:
-1
px;
right:
0
px;
cursor: ew-resize;
z-index: 1;
background: #ececec;
&.right{
left: 0px;
}
&:hover {
background-color: rgb(33, 150, 243);
}
...
...
components/apolloTable/component/DragResized.tsx
View file @
76435779
import
React
from
'react'
;
import
classNames
from
'classnames'
;
import
{
ResizableBox
}
from
'react-resizable'
;
import
{
getCache
,
saveCache
}
from
'../utils/cache'
;
import
styles
from
'./DragResized.less'
;
const
DragResized
=
(
props
:
any
)
=>
{
const
{
style
,
columnName
,
tableId
,
canResized
,
onDragResized
,
onDragResizedCb
,
cachedFeAttr
,
columns
}
=
props
;
const
{
style
,
columnName
,
tableId
,
canResized
,
onDragResized
,
onDragResizedCb
,
cachedFeAttr
,
columns
,
position
,
}
=
props
;
if
(
!
canResized
)
{
return
<
div
style=
{
style
}
>
{
props
.
children
}
</
div
>;
}
...
...
@@ -65,7 +76,7 @@ const DragResized = (props: any) => {
height=
{
style
.
height
}
handle=
{
<
span
className=
{
styles
.
handleWidth
}
className=
{
position
===
'right'
?
classNames
(
styles
.
handleWidth
,
styles
.
right
)
:
styles
.
handleWidth
}
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
}
}
...
...
@@ -76,6 +87,7 @@ const DragResized = (props: any) => {
onResize=
{
onResizeWidth
}
onResizeStop=
{
onResizeWidthStop
}
draggableOpts=
{
{
enableUserSelectHack
:
false
}
}
resizeHandles=
{
position
===
'right'
?
[
'w'
]
:
[
'e'
]
}
>
{
props
.
children
}
</
ResizableBox
>
...
...
components/apolloTable/component/RightDragFixed.tsx
View file @
76435779
...
...
@@ -37,6 +37,10 @@ const DragFixed = (props: any) => {
const
onMouseMoveWrap
=
(
e
:
any
)
=>
{
// 滑块位置跟随鼠标上下移动
const
handleWrapRect
=
handleWrap
.
getBoundingClientRect
();
if
(
e
.
clientY
<
handleWrapRect
.
y
)
{
return
;
}
handle
.
style
.
top
=
`
${
e
.
clientY
}
px`
;
};
...
...
@@ -52,7 +56,7 @@ const DragFixed = (props: any) => {
onResizeStart
();
}
const
originLeft
=
container
.
getBoundingClientRect
().
x
||
0
;
handleWrap
.
style
.
top
=
0
;
//
handleWrap.style.top = 0;
handleWrap
.
style
.
left
=
`
${
e
.
x
-
originLeft
}
px`
;
};
...
...
@@ -101,7 +105,7 @@ const DragFixed = (props: any) => {
dividerWrap
.
style
.
display
=
'none'
;
// 滑块wrap移除hovered样式
handleWrap
.
classList
.
remove
(
styles
.
hovered
);
handleWrap
.
style
.
top
=
`
${
initTop
}
px`
;
//
handleWrap.style.top = `${initTop}px`;
handleWrap
.
style
.
left
=
fixedWidth
;
// 滑块隐藏
handle
.
style
.
opacity
=
0
;
...
...
components/apolloTable/component/Table.tsx
View file @
76435779
...
...
@@ -270,6 +270,7 @@ export default class AirTable extends Component<TableProps, TableState> {
cachedFeAttr=
{
cachedFeAttr
}
onDragResizedCb=
{
this
.
onDragResizedCb
}
columns=
{
formatColumns
}
position=
{
position
}
>
<
DragSorted
columnName=
{
columnName
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment