@qsxy/element-plus-react 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert/Alert.d.ts +7 -0
- package/dist/Alert/Alert.js +98 -0
- package/dist/Alert/index.d.ts +2 -0
- package/dist/Alert/index.js +1 -0
- package/dist/Alert/typings.d.ts +45 -0
- package/dist/Alert/typings.js +1 -0
- package/dist/Calendar/Calendar.js +12 -3
- package/dist/Calendar/Footer.js +4 -2
- package/dist/Calendar/QuarterPanel.d.ts +4 -0
- package/dist/Calendar/QuarterPanel.js +109 -0
- package/dist/Calendar/WeekPanel.js +1 -1
- package/dist/Calendar/typings.d.ts +1 -1
- package/dist/Card/Card.js +13 -6
- package/dist/Card/typings.d.ts +1 -1
- package/dist/Cascader/Cascader.js +1 -1
- package/dist/Cascader/useCascader.d.ts +0 -14
- package/dist/Cascader/useCascader.js +33 -32
- package/dist/Checkbox/Checkbox.js +3 -2
- package/dist/ConfigProvider/ConfigProvider.js +2 -24
- package/dist/ConfigProvider/ConfigProviderContext.js +1 -1
- package/dist/ConfigProvider/typings.d.ts +1 -1
- package/dist/Container/Main.d.ts +1 -1
- package/dist/Container/typings.d.ts +1 -1
- package/dist/DatePicker/DatePicker.js +38 -12
- package/dist/DatePicker/DateRangePicker.js +27 -9
- package/dist/DatePicker/main.js +1 -1
- package/dist/DatePicker/typings.d.ts +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +2 -2
- package/dist/Dialog/Dialog.js +5 -12
- package/dist/Input/Input.js +190 -149
- package/dist/Input/InputRange.js +1 -1
- package/dist/Input/TextArea.js +87 -12
- package/dist/Input/typings.d.ts +56 -5
- package/dist/Input/useComposition.d.ts +23 -0
- package/dist/Input/useComposition.js +63 -0
- package/dist/Input/utils.d.ts +7 -0
- package/dist/Input/utils.js +95 -0
- package/dist/InputNumber/InputNumber.js +351 -141
- package/dist/InputNumber/typings.d.ts +16 -2
- package/dist/Loading/Loading.js +5 -2
- package/dist/Menu/Menu.js +25 -1
- package/dist/Menu/MenuItem.js +4 -2
- package/dist/Menu/SubMenu.js +2 -2
- package/dist/Menu/SubMenuCollapseTransition.js +14 -9
- package/dist/Menu/typings.d.ts +2 -1
- package/dist/Message/Message.js +51 -23
- package/dist/Message/index.js +8 -10
- package/dist/Message/typings.d.ts +8 -5
- package/dist/MessageBox/MessageBox.js +52 -30
- package/dist/MessageBox/index.d.ts +2 -1
- package/dist/MessageBox/index.js +4 -2
- package/dist/MessageBox/typings.d.ts +3 -0
- package/dist/Notification/Notification.js +26 -19
- package/dist/Select/Option.js +30 -14
- package/dist/Select/SelectContext.d.ts +5 -5
- package/dist/Select/SelectContext.js +2 -1
- package/dist/Select/SelectCore.d.ts +2 -2
- package/dist/Select/SelectCore.js +172 -449
- package/dist/Select/SelectDropdown.js +85 -155
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/typings.d.ts +52 -22
- package/dist/Select/useSelect.d.ts +128 -0
- package/dist/Select/useSelect.js +524 -0
- package/dist/Space/Space.d.ts +4 -0
- package/dist/Space/Space.js +128 -0
- package/dist/Space/SpaceItem.d.ts +7 -0
- package/dist/Space/SpaceItem.js +14 -0
- package/dist/Space/index.d.ts +3 -0
- package/dist/Space/index.js +2 -0
- package/dist/Space/typings.d.ts +26 -0
- package/dist/Space/typings.js +1 -0
- package/dist/Space/useSpace.d.ts +7 -0
- package/dist/Space/useSpace.js +104 -0
- package/dist/Statistic/Statistic.d.ts +4 -0
- package/dist/Statistic/Statistic.js +92 -0
- package/dist/Statistic/index.d.ts +2 -0
- package/dist/Statistic/index.js +1 -0
- package/dist/Statistic/typings.d.ts +28 -0
- package/dist/Statistic/typings.js +1 -0
- package/dist/Switch/Switch.js +2 -2
- package/dist/Table/Table.js +3 -0
- package/dist/Table/typings.d.ts +2 -0
- package/dist/Table/util.js +6 -5
- package/dist/Tag/Tag.js +22 -17
- package/dist/Tag/typings.d.ts +1 -1
- package/dist/Text/Text.d.ts +4 -0
- package/dist/Text/Text.js +84 -0
- package/dist/Text/index.d.ts +2 -0
- package/dist/Text/index.js +1 -0
- package/dist/Text/typings.d.ts +15 -0
- package/dist/Text/typings.js +1 -0
- package/dist/TimePicker/TimePicker.js +2 -2
- package/dist/Tree/CollapseTransition.d.ts +7 -0
- package/dist/Tree/CollapseTransition.js +60 -0
- package/dist/Tree/Tree.d.ts +3 -140
- package/dist/Tree/Tree.js +350 -77
- package/dist/Tree/TreeContext.d.ts +9 -0
- package/dist/Tree/TreeContext.js +14 -0
- package/dist/Tree/TreeNode.d.ts +5 -3
- package/dist/Tree/TreeNode.js +321 -331
- package/dist/Tree/TreeNodeContent.d.ts +9 -0
- package/dist/Tree/TreeNodeContent.js +22 -0
- package/dist/Tree/index.d.ts +3 -8
- package/dist/Tree/index.js +1 -4
- package/dist/Tree/model/node.d.ts +62 -0
- package/dist/Tree/model/node.js +601 -0
- package/dist/Tree/model/tree-store.d.ts +52 -0
- package/dist/Tree/model/tree-store.js +510 -0
- package/dist/Tree/model/useDragNode.d.ts +30 -0
- package/dist/Tree/model/useDragNode.js +293 -0
- package/dist/Tree/model/useKeydown.d.ts +0 -0
- package/dist/Tree/model/useKeydown.js +104 -0
- package/dist/Tree/model/useNodeExpandEventBroadcast.d.ts +15 -0
- package/dist/Tree/model/useNodeExpandEventBroadcast.js +54 -0
- package/dist/Tree/model/util.d.ts +7 -0
- package/dist/Tree/model/util.js +24 -0
- package/dist/Tree/typings.d.ts +225 -114
- package/dist/TreeSelect/TreeSelect.d.ts +2 -10
- package/dist/TreeSelect/TreeSelect.js +90 -566
- package/dist/TreeSelect/TreeSelectOption.d.ts +6 -0
- package/dist/TreeSelect/TreeSelectOption.js +62 -0
- package/dist/TreeSelect/cacheOptions.d.ts +9 -0
- package/dist/TreeSelect/cacheOptions.js +22 -0
- package/dist/TreeSelect/index.d.ts +0 -1
- package/dist/TreeSelect/typings.d.ts +11 -63
- package/dist/TreeSelect/useSelect.d.ts +125 -0
- package/dist/TreeSelect/useSelect.js +104 -0
- package/dist/TreeSelect/useTree.d.ts +130 -0
- package/dist/TreeSelect/useTree.js +285 -0
- package/dist/TreeSelect/utils.d.ts +10 -0
- package/dist/TreeSelect/utils.js +38 -0
- package/dist/Upload/UploadContent.js +2 -0
- package/dist/Upload/ajax.js +3 -0
- package/dist/Upload/typings.d.ts +4 -0
- package/dist/Util/aria.d.ts +25 -0
- package/dist/Util/aria.js +118 -0
- package/dist/Util/base.d.ts +5 -0
- package/dist/Util/base.js +140 -1
- package/dist/config/Constants.d.ts +3 -0
- package/dist/config/Constants.js +8 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/popperPropsUtils.js +1 -1
- package/dist/hooks/treePropsUtils.d.ts +3 -3
- package/dist/hooks/treePropsUtils.js +2 -2
- package/dist/hooks/useCalcInputWidth.d.ts +8 -0
- package/dist/{Tree/useUnmount.js → hooks/useCalcInputWidth.js} +23 -27
- package/dist/hooks/useComposition.d.ts +16 -0
- package/dist/hooks/useComposition.js +39 -0
- package/dist/hooks/useConfigProvider.d.ts +27 -0
- package/dist/hooks/useConfigProvider.js +78 -0
- package/dist/hooks/useCursor.d.ts +2 -0
- package/dist/hooks/useCursor.js +52 -0
- package/dist/hooks/useFocusController.d.ts +27 -0
- package/dist/hooks/useFocusController.js +72 -0
- package/dist/hooks/useResizeObserver.js +6 -6
- package/dist/index.css +1 -1
- package/dist/index.d.ts +18 -11
- package/dist/index.js +11 -5
- package/dist/locale/en.d.ts +15 -0
- package/dist/locale/en.js +15 -0
- package/dist/locale/zhCn.d.ts +15 -0
- package/dist/locale/zhCn.js +15 -0
- package/package.json +1 -1
- package/theme-chalk/alert.scss +115 -0
- package/theme-chalk/aside.scss +8 -8
- package/theme-chalk/button-group.scss +80 -80
- package/theme-chalk/button.scss +304 -304
- package/theme-chalk/calendar/date-table.scss +164 -164
- package/theme-chalk/calendar/index.scss +1 -0
- package/theme-chalk/calendar/quarter-table.scss +78 -0
- package/theme-chalk/checkbox.scss +34 -0
- package/theme-chalk/color/index.scss +20 -20
- package/theme-chalk/common/transition.scss +142 -142
- package/theme-chalk/common/var.scss +1 -1
- package/theme-chalk/container.scss +14 -14
- package/theme-chalk/dark/css-vars.scss +39 -39
- package/theme-chalk/dark/var.scss +225 -225
- package/theme-chalk/date-picker.scss +12 -12
- package/theme-chalk/drawer.scss +1 -0
- package/theme-chalk/footer.scss +12 -12
- package/theme-chalk/header.scss +12 -12
- package/theme-chalk/index.scss +4 -0
- package/theme-chalk/input/input-range.scss +2 -1
- package/theme-chalk/input/input.scss +298 -437
- package/theme-chalk/input/input.scss--bak +578 -0
- package/theme-chalk/input-number.bak +172 -0
- package/theme-chalk/input-number.scss +192 -172
- package/theme-chalk/link.scss +87 -87
- package/theme-chalk/main.scss +14 -14
- package/theme-chalk/menu.scss +353 -353
- package/theme-chalk/message.scss +104 -178
- package/theme-chalk/mixins/_button.scss +224 -224
- package/theme-chalk/mixins/_col.scss +33 -33
- package/theme-chalk/mixins/_var.scss +67 -67
- package/theme-chalk/mixins/config.scss +5 -5
- package/theme-chalk/mixins/function.scss +99 -99
- package/theme-chalk/mixins/mixins.scss +240 -240
- package/theme-chalk/mixins/utils.scss +39 -39
- package/theme-chalk/notification.bak +156 -0
- package/theme-chalk/notification.scss +109 -156
- package/theme-chalk/popper.scss +104 -104
- package/theme-chalk/radio-button.scss +169 -169
- package/theme-chalk/select/index.scss +222 -191
- package/theme-chalk/select/index.scss--bak +247 -0
- package/theme-chalk/select/option-group.scss +2 -2
- package/theme-chalk/select/option.scss +2 -2
- package/theme-chalk/select/select-dropdown.scss +2 -2
- package/theme-chalk/space.scss +20 -0
- package/theme-chalk/statistic.scss +35 -0
- package/theme-chalk/switch.scss +300 -300
- package/theme-chalk/tag.scss +150 -172
- package/theme-chalk/tag.scss--bak +203 -0
- package/theme-chalk/text.scss +48 -0
- package/theme-chalk/transition.scss +34 -4
- package/theme-chalk/tree-select.scss +41 -25
- package/theme-chalk/tree.scss +136 -0
- package/theme-chalk/var.scss +83 -83
- package/dist/Tree/DirectoryTree.d.ts +0 -15
- package/dist/Tree/DirectoryTree.js +0 -183
- package/dist/Tree/DropIndicator.d.ts +0 -8
- package/dist/Tree/DropIndicator.js +0 -34
- package/dist/Tree/Indent.d.ts +0 -9
- package/dist/Tree/Indent.js +0 -25
- package/dist/Tree/MotionTreeNode.d.ts +0 -14
- package/dist/Tree/MotionTreeNode.js +0 -125
- package/dist/Tree/NodeList.d.ts +0 -50
- package/dist/Tree/NodeList.js +0 -301
- package/dist/Tree/RCTree.d.ts +0 -248
- package/dist/Tree/RCTree.js +0 -1216
- package/dist/Tree/contextTypes.d.ts +0 -69
- package/dist/Tree/contextTypes.js +0 -9
- package/dist/Tree/typings.tsx--bak +0 -245
- package/dist/Tree/useUnmount.d.ts +0 -5
- package/dist/Tree/util.d.ts +0 -51
- package/dist/Tree/util.js +0 -303
- package/dist/Tree/utils/conductUtil.d.ts +0 -17
- package/dist/Tree/utils/conductUtil.js +0 -209
- package/dist/Tree/utils/dictUtil.d.ts +0 -13
- package/dist/Tree/utils/dictUtil.js +0 -75
- package/dist/Tree/utils/diffUtil.d.ts +0 -7
- package/dist/Tree/utils/diffUtil.js +0 -48
- package/dist/Tree/utils/dropIndicator.d.ts +0 -11
- package/dist/Tree/utils/dropIndicator.js +0 -36
- package/dist/Tree/utils/iconUtil.d.ts +0 -5
- package/dist/Tree/utils/iconUtil.js +0 -62
- package/dist/Tree/utils/keyUtil.d.ts +0 -2
- package/dist/Tree/utils/keyUtil.js +0 -3
- package/dist/Tree/utils/motion.d.ts +0 -10
- package/dist/Tree/utils/motion.js +0 -54
- package/dist/Tree/utils/pickAttrs.d.ts +0 -11
- package/dist/Tree/utils/pickAttrs.js +0 -51
- package/dist/Tree/utils/treeUtil.d.ts +0 -86
- package/dist/Tree/utils/treeUtil.js +0 -364
- package/dist/TreeSelect/Utils.d.ts +0 -3
- package/dist/TreeSelect/Utils.js +0 -20
|
@@ -1,25 +1,41 @@
|
|
|
1
|
-
@use '
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
@use 'mixins/mixins' as *;
|
|
2
|
+
@use 'mixins/var' as *;
|
|
3
|
+
@use 'common/var' as *;
|
|
4
|
+
|
|
5
|
+
@include b(tree-select) {
|
|
6
|
+
@include set-component-css-var('tree', $tree);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@include b(tree-select) {
|
|
10
|
+
@include e(popper) {
|
|
11
|
+
// padding-left same with select option
|
|
12
|
+
.#{$namespace}-tree-node__expand-icon {
|
|
13
|
+
margin-left: 8px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// remove icon when show checkbox
|
|
17
|
+
.#{$namespace}-tree-node.is-checked
|
|
18
|
+
> .#{$namespace}-tree-node__content
|
|
19
|
+
.#{$namespace}-select-dropdown__item.selected::after {
|
|
20
|
+
content: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.#{$namespace}-select-dropdown__list
|
|
24
|
+
> .#{$namespace}-select-dropdown__item {
|
|
25
|
+
padding-left: 32px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.#{$namespace}-select-dropdown__item {
|
|
29
|
+
flex: 1;
|
|
30
|
+
background: transparent !important;
|
|
31
|
+
|
|
32
|
+
// padding-left move to `el-tree-node__expand-icon`
|
|
33
|
+
padding-left: 0;
|
|
34
|
+
|
|
35
|
+
// fix: select height > tree node height
|
|
36
|
+
// https://github.com/yujinpan/el-select-tree/pull/33
|
|
37
|
+
height: 20px;
|
|
38
|
+
line-height: 20px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
@use './mixins/mixins' as *;
|
|
2
|
+
@use './mixins/var' as *;
|
|
3
|
+
@use './common/var' as *;
|
|
4
|
+
@use './common/transition';
|
|
5
|
+
|
|
6
|
+
@include b(tree) {
|
|
7
|
+
@include set-component-css-var('tree', $tree);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@include b(tree) {
|
|
11
|
+
position: relative;
|
|
12
|
+
cursor: default;
|
|
13
|
+
background: getCssVar('fill-color', 'blank');
|
|
14
|
+
color: getCssVar('tree-text-color');
|
|
15
|
+
font-size: getCssVar('font-size', 'base');
|
|
16
|
+
|
|
17
|
+
@include e(empty-block) {
|
|
18
|
+
position: relative;
|
|
19
|
+
min-height: 60px;
|
|
20
|
+
text-align: center;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@include e(empty-text) {
|
|
26
|
+
position: absolute;
|
|
27
|
+
left: 50%;
|
|
28
|
+
top: 50%;
|
|
29
|
+
transform: translate(-50%, -50%);
|
|
30
|
+
color: getCssVar('text-color', 'secondary');
|
|
31
|
+
font-size: getCssVar('font-size', 'base');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@include e(drop-indicator) {
|
|
35
|
+
position: absolute;
|
|
36
|
+
left: 0;
|
|
37
|
+
right: 0;
|
|
38
|
+
height: 1px;
|
|
39
|
+
background-color: getCssVar('color-primary');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@include b(tree-node) {
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
outline: none;
|
|
46
|
+
&:focus {
|
|
47
|
+
/* focus */
|
|
48
|
+
> .#{$namespace}-tree-node__content {
|
|
49
|
+
background-color: getCssVar('tree-node-hover-bg-color');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@include when(drop-inner) {
|
|
54
|
+
> .#{$namespace}-tree-node__content .#{$namespace}-tree-node__label {
|
|
55
|
+
background-color: getCssVar('color-primary');
|
|
56
|
+
color: #fff;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@include when(hidden) {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include e(content) {
|
|
65
|
+
@include css-var-from-global('checkbox-height', 'tree-node-content-height');
|
|
66
|
+
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
height: getCssVar('tree-node-content-height');
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
|
|
72
|
+
& > .#{$namespace}-tree-node__expand-icon {
|
|
73
|
+
padding: 6px;
|
|
74
|
+
box-sizing: content-box;
|
|
75
|
+
}
|
|
76
|
+
& > label.#{$namespace}-checkbox {
|
|
77
|
+
margin-right: 8px;
|
|
78
|
+
}
|
|
79
|
+
&:hover {
|
|
80
|
+
background-color: getCssVar('tree-node-hover-bg-color');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.#{$namespace}-tree.is-dragging & {
|
|
84
|
+
cursor: move;
|
|
85
|
+
|
|
86
|
+
& * {
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.#{$namespace}-tree.is-dragging.is-drop-not-allow & {
|
|
92
|
+
cursor: not-allowed;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@include e(expand-icon) {
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
color: getCssVar('tree-expand-icon-color');
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
|
|
101
|
+
transform: rotate(0deg);
|
|
102
|
+
transition: transform getCssVar('transition-duration') ease-in-out;
|
|
103
|
+
|
|
104
|
+
&.expanded {
|
|
105
|
+
transform: rotate(90deg);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&.is-leaf {
|
|
109
|
+
color: transparent;
|
|
110
|
+
cursor: default;
|
|
111
|
+
visibility: hidden;
|
|
112
|
+
}
|
|
113
|
+
&.is-hidden {
|
|
114
|
+
visibility: hidden;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@include e(loading-icon) {
|
|
119
|
+
margin-right: 8px;
|
|
120
|
+
font-size: getCssVar('font-size', 'base');
|
|
121
|
+
color: getCssVar('tree-expand-icon-color');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
& > .#{$namespace}-tree-node__children {
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
background-color: transparent;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&.is-expanded > .#{$namespace}-tree-node__children {
|
|
130
|
+
display: block;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.#{$namespace}-tree--highlight-current .#{$namespace}-tree-node.is-current > .#{$namespace}-tree-node__content {
|
|
135
|
+
background-color: getCssVar('color-primary-light-9');
|
|
136
|
+
}
|
package/theme-chalk/var.scss
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
// CSS3 var
|
|
2
|
-
@use 'common/var' as *;
|
|
3
|
-
@use 'mixins/var' as *;
|
|
4
|
-
@use 'mixins/mixins' as *;
|
|
5
|
-
|
|
6
|
-
// for better performance do not dynamically change the root variable if you really
|
|
7
|
-
// do not need that, since this could introduce recalculation overhead for rendering.
|
|
8
|
-
// https://lisilinhart.info/posts/css-variables-performance/
|
|
9
|
-
|
|
10
|
-
// common
|
|
11
|
-
:root {
|
|
12
|
-
@include set-css-var-value('color-white', $color-white);
|
|
13
|
-
@include set-css-var-value('color-black', $color-black);
|
|
14
|
-
|
|
15
|
-
// get rgb
|
|
16
|
-
@each $type in (primary, success, warning, danger, error, info) {
|
|
17
|
-
@include set-css-color-rgb($type);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Typography
|
|
21
|
-
@include set-component-css-var('font-size', $font-size);
|
|
22
|
-
@include set-component-css-var('font-family', $font-family);
|
|
23
|
-
|
|
24
|
-
@include set-css-var-value('font-weight-primary', 500);
|
|
25
|
-
@include set-css-var-value('font-line-height-primary', 24px);
|
|
26
|
-
|
|
27
|
-
// z-index --el-index-#{$type}
|
|
28
|
-
@include set-component-css-var('index', $z-index);
|
|
29
|
-
|
|
30
|
-
// --el-border-radius-#{$type}
|
|
31
|
-
@include set-component-css-var('border-radius', $border-radius);
|
|
32
|
-
|
|
33
|
-
// Transition
|
|
34
|
-
// refer to this website to get the bezier motion function detail
|
|
35
|
-
// https://cubic-bezier.com/#p1,p2,p3,p4 (change px as your function parameter)
|
|
36
|
-
@include set-component-css-var('transition-duration', $transition-duration);
|
|
37
|
-
|
|
38
|
-
@include set-component-css-var('transition-function', $transition-function);
|
|
39
|
-
@include set-component-css-var('transition', $transition);
|
|
40
|
-
|
|
41
|
-
// common component size
|
|
42
|
-
@include set-component-css-var('component-size', $common-component-size);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// for light
|
|
46
|
-
:root {
|
|
47
|
-
color-scheme: light;
|
|
48
|
-
|
|
49
|
-
// --el-color-#{$type}
|
|
50
|
-
// --el-color-#{$type}-light-{$i}
|
|
51
|
-
@each $type in (primary, success, warning, danger, error, info) {
|
|
52
|
-
@include set-css-color-type($colors, $type);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// color-scheme
|
|
56
|
-
// Background --el-bg-color-#{$type}
|
|
57
|
-
@include set-component-css-var('bg-color', $bg-color);
|
|
58
|
-
// --el-text-color-#{$type}
|
|
59
|
-
@include set-component-css-var('text-color', $text-color);
|
|
60
|
-
// --el-border-color-#{$type}
|
|
61
|
-
@include set-component-css-var('border-color', $border-color);
|
|
62
|
-
// Fill --el-fill-color-#{$type}
|
|
63
|
-
@include set-component-css-var('fill-color', $fill-color);
|
|
64
|
-
|
|
65
|
-
// Box-shadow
|
|
66
|
-
// --el-box-shadow-#{$type}
|
|
67
|
-
@include set-component-css-var('box-shadow', $box-shadow);
|
|
68
|
-
// Disable base
|
|
69
|
-
@include set-component-css-var('disabled', $disabled);
|
|
70
|
-
|
|
71
|
-
// overlay & mask
|
|
72
|
-
@include set-component-css-var('overlay-color', $overlay-color);
|
|
73
|
-
@include set-component-css-var('mask-color', $mask-color);
|
|
74
|
-
|
|
75
|
-
// Border
|
|
76
|
-
@include set-css-var-value('border-width', $border-width);
|
|
77
|
-
@include set-css-var-value('border-style', $border-style);
|
|
78
|
-
@include set-css-var-value('border-color-hover', $border-color-hover);
|
|
79
|
-
@include set-css-var-value('border', getCssVar('border-width') getCssVar('border-style') getCssVar('border-color'));
|
|
80
|
-
|
|
81
|
-
// Svg
|
|
82
|
-
@include css-var-from-global('svg-monochrome-grey', 'border-color');
|
|
83
|
-
}
|
|
1
|
+
// CSS3 var
|
|
2
|
+
@use 'common/var' as *;
|
|
3
|
+
@use 'mixins/var' as *;
|
|
4
|
+
@use 'mixins/mixins' as *;
|
|
5
|
+
|
|
6
|
+
// for better performance do not dynamically change the root variable if you really
|
|
7
|
+
// do not need that, since this could introduce recalculation overhead for rendering.
|
|
8
|
+
// https://lisilinhart.info/posts/css-variables-performance/
|
|
9
|
+
|
|
10
|
+
// common
|
|
11
|
+
:root {
|
|
12
|
+
@include set-css-var-value('color-white', $color-white);
|
|
13
|
+
@include set-css-var-value('color-black', $color-black);
|
|
14
|
+
|
|
15
|
+
// get rgb
|
|
16
|
+
@each $type in (primary, success, warning, danger, error, info) {
|
|
17
|
+
@include set-css-color-rgb($type);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Typography
|
|
21
|
+
@include set-component-css-var('font-size', $font-size);
|
|
22
|
+
@include set-component-css-var('font-family', $font-family);
|
|
23
|
+
|
|
24
|
+
@include set-css-var-value('font-weight-primary', 500);
|
|
25
|
+
@include set-css-var-value('font-line-height-primary', 24px);
|
|
26
|
+
|
|
27
|
+
// z-index --el-index-#{$type}
|
|
28
|
+
@include set-component-css-var('index', $z-index);
|
|
29
|
+
|
|
30
|
+
// --el-border-radius-#{$type}
|
|
31
|
+
@include set-component-css-var('border-radius', $border-radius);
|
|
32
|
+
|
|
33
|
+
// Transition
|
|
34
|
+
// refer to this website to get the bezier motion function detail
|
|
35
|
+
// https://cubic-bezier.com/#p1,p2,p3,p4 (change px as your function parameter)
|
|
36
|
+
@include set-component-css-var('transition-duration', $transition-duration);
|
|
37
|
+
|
|
38
|
+
@include set-component-css-var('transition-function', $transition-function);
|
|
39
|
+
@include set-component-css-var('transition', $transition);
|
|
40
|
+
|
|
41
|
+
// common component size
|
|
42
|
+
@include set-component-css-var('component-size', $common-component-size);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// for light
|
|
46
|
+
:root {
|
|
47
|
+
color-scheme: light;
|
|
48
|
+
|
|
49
|
+
// --el-color-#{$type}
|
|
50
|
+
// --el-color-#{$type}-light-{$i}
|
|
51
|
+
@each $type in (primary, success, warning, danger, error, info) {
|
|
52
|
+
@include set-css-color-type($colors, $type);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// color-scheme
|
|
56
|
+
// Background --el-bg-color-#{$type}
|
|
57
|
+
@include set-component-css-var('bg-color', $bg-color);
|
|
58
|
+
// --el-text-color-#{$type}
|
|
59
|
+
@include set-component-css-var('text-color', $text-color);
|
|
60
|
+
// --el-border-color-#{$type}
|
|
61
|
+
@include set-component-css-var('border-color', $border-color);
|
|
62
|
+
// Fill --el-fill-color-#{$type}
|
|
63
|
+
@include set-component-css-var('fill-color', $fill-color);
|
|
64
|
+
|
|
65
|
+
// Box-shadow
|
|
66
|
+
// --el-box-shadow-#{$type}
|
|
67
|
+
@include set-component-css-var('box-shadow', $box-shadow);
|
|
68
|
+
// Disable base
|
|
69
|
+
@include set-component-css-var('disabled', $disabled);
|
|
70
|
+
|
|
71
|
+
// overlay & mask
|
|
72
|
+
@include set-component-css-var('overlay-color', $overlay-color);
|
|
73
|
+
@include set-component-css-var('mask-color', $mask-color);
|
|
74
|
+
|
|
75
|
+
// Border
|
|
76
|
+
@include set-css-var-value('border-width', $border-width);
|
|
77
|
+
@include set-css-var-value('border-style', $border-style);
|
|
78
|
+
@include set-css-var-value('border-color-hover', $border-color-hover);
|
|
79
|
+
@include set-css-var-value('border', getCssVar('border-width') getCssVar('border-style') getCssVar('border-color'));
|
|
80
|
+
|
|
81
|
+
// Svg
|
|
82
|
+
@include css-var-from-global('svg-monochrome-grey', 'border-color');
|
|
83
|
+
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import RcTree from './RCTree';
|
|
3
|
-
import { TreeProps } from './Tree';
|
|
4
|
-
import { BasicDataNode, DataNode, Key } from './typings';
|
|
5
|
-
export type ExpandAction = false | 'click' | 'doubleClick';
|
|
6
|
-
export interface DirectoryTreeProps<T extends BasicDataNode = DataNode> extends TreeProps<T> {
|
|
7
|
-
expandAction?: ExpandAction;
|
|
8
|
-
}
|
|
9
|
-
type DirectoryTreeCompoundedComponent = (<T extends BasicDataNode | DataNode = DataNode>(props: React.PropsWithChildren<DirectoryTreeProps<T>> & React.RefAttributes<RcTree>) => React.ReactElement) & Pick<React.FC, 'displayName'>;
|
|
10
|
-
export interface DirectoryTreeState {
|
|
11
|
-
expandedKeys?: Key[];
|
|
12
|
-
selectedKeys?: Key[];
|
|
13
|
-
}
|
|
14
|
-
declare const ForwardDirectoryTree: DirectoryTreeCompoundedComponent;
|
|
15
|
-
export default ForwardDirectoryTree;
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"],
|
|
3
|
-
_excluded2 = ["className", "showIcon", "expandAction"];
|
|
4
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
19
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
|
-
import classNames from 'classnames';
|
|
23
|
-
import * as React from 'react';
|
|
24
|
-
import Icon from "../Icon/Icon";
|
|
25
|
-
import Tree from "./Tree";
|
|
26
|
-
import { conductExpandParent } from "./util";
|
|
27
|
-
import { calcRangeKeys, convertDirectoryKeysToNodes } from "./utils/dictUtil";
|
|
28
|
-
import { convertDataToEntities, convertTreeToData } from "./utils/treeUtil";
|
|
29
|
-
function getIcon(props) {
|
|
30
|
-
var isLeaf = props.isLeaf,
|
|
31
|
-
expanded = props.expanded;
|
|
32
|
-
if (isLeaf) {
|
|
33
|
-
return /*#__PURE__*/React.createElement(Icon, {
|
|
34
|
-
name: "file-lines",
|
|
35
|
-
prefix: "far"
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return expanded ? /*#__PURE__*/React.createElement(Icon, {
|
|
39
|
-
name: "folder-open",
|
|
40
|
-
prefix: "far"
|
|
41
|
-
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
42
|
-
name: "folder-closed",
|
|
43
|
-
prefix: "fas"
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function getTreeData(_ref) {
|
|
47
|
-
var treeData = _ref.treeData,
|
|
48
|
-
children = _ref.children;
|
|
49
|
-
return treeData || convertTreeToData(children);
|
|
50
|
-
}
|
|
51
|
-
var DirectoryTree = function DirectoryTree(_ref2, ref) {
|
|
52
|
-
var defaultExpandAll = _ref2.defaultExpandAll,
|
|
53
|
-
defaultExpandParent = _ref2.defaultExpandParent,
|
|
54
|
-
defaultExpandedKeys = _ref2.defaultExpandedKeys,
|
|
55
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
56
|
-
// Shift click usage
|
|
57
|
-
var lastSelectedKey = React.useRef(null);
|
|
58
|
-
var cachedSelectedKeys = React.useRef(null);
|
|
59
|
-
var getInitExpandedKeys = function getInitExpandedKeys() {
|
|
60
|
-
var _convertDataToEntitie = convertDataToEntities(getTreeData(props)),
|
|
61
|
-
keyEntities = _convertDataToEntitie.keyEntities;
|
|
62
|
-
var initExpandedKeys;
|
|
63
|
-
|
|
64
|
-
// Expanded keys
|
|
65
|
-
if (defaultExpandAll) {
|
|
66
|
-
initExpandedKeys = Object.keys(keyEntities);
|
|
67
|
-
} else if (defaultExpandParent) {
|
|
68
|
-
initExpandedKeys = conductExpandParent(props.expandedKeys || defaultExpandedKeys || [], keyEntities);
|
|
69
|
-
} else {
|
|
70
|
-
initExpandedKeys = props.expandedKeys || defaultExpandedKeys || [];
|
|
71
|
-
}
|
|
72
|
-
return initExpandedKeys;
|
|
73
|
-
};
|
|
74
|
-
var _React$useState = React.useState(props.selectedKeys || props.defaultSelectedKeys || []),
|
|
75
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
76
|
-
selectedKeys = _React$useState2[0],
|
|
77
|
-
setSelectedKeys = _React$useState2[1];
|
|
78
|
-
var _React$useState3 = React.useState(function () {
|
|
79
|
-
return getInitExpandedKeys();
|
|
80
|
-
}),
|
|
81
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
82
|
-
expandedKeys = _React$useState4[0],
|
|
83
|
-
setExpandedKeys = _React$useState4[1];
|
|
84
|
-
React.useEffect(function () {
|
|
85
|
-
if ('selectedKeys' in props) {
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
87
|
-
setSelectedKeys(props.selectedKeys);
|
|
88
|
-
}
|
|
89
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
90
|
-
}, [props.selectedKeys]);
|
|
91
|
-
React.useEffect(function () {
|
|
92
|
-
if ('expandedKeys' in props) {
|
|
93
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
94
|
-
setExpandedKeys(props.expandedKeys);
|
|
95
|
-
}
|
|
96
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
97
|
-
}, [props.expandedKeys]);
|
|
98
|
-
var onExpand = function onExpand(keys, info) {
|
|
99
|
-
var _props$onExpand;
|
|
100
|
-
if (!('expandedKeys' in props)) {
|
|
101
|
-
setExpandedKeys(keys);
|
|
102
|
-
}
|
|
103
|
-
// Call origin function
|
|
104
|
-
return (_props$onExpand = props.onExpand) === null || _props$onExpand === void 0 ? void 0 : _props$onExpand.call(props, keys, info);
|
|
105
|
-
};
|
|
106
|
-
var onSelect = function onSelect(keys, event) {
|
|
107
|
-
var _props$onSelect;
|
|
108
|
-
var multiple = props.multiple,
|
|
109
|
-
fieldNames = props.fieldNames;
|
|
110
|
-
var node = event.node,
|
|
111
|
-
nativeEvent = event.nativeEvent;
|
|
112
|
-
var _node$key = node.key,
|
|
113
|
-
key = _node$key === void 0 ? '' : _node$key;
|
|
114
|
-
var treeData = getTreeData(props);
|
|
115
|
-
// const newState: DirectoryTreeState = {};
|
|
116
|
-
|
|
117
|
-
// We need wrap this event since some value is not same
|
|
118
|
-
var newEvent = _objectSpread(_objectSpread({}, event), {}, {
|
|
119
|
-
selected: true // Directory selected always true
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// Windows / Mac single pick
|
|
123
|
-
var ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
|
|
124
|
-
var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
125
|
-
|
|
126
|
-
// Generate new selected keys
|
|
127
|
-
var newSelectedKeys;
|
|
128
|
-
if (multiple && ctrlPick) {
|
|
129
|
-
// Control click
|
|
130
|
-
newSelectedKeys = keys;
|
|
131
|
-
lastSelectedKey.current = key;
|
|
132
|
-
cachedSelectedKeys.current = newSelectedKeys;
|
|
133
|
-
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
|
|
134
|
-
} else if (multiple && shiftPick) {
|
|
135
|
-
// Shift click
|
|
136
|
-
newSelectedKeys = Array.from(new Set([].concat(_toConsumableArray(cachedSelectedKeys.current || []), _toConsumableArray(calcRangeKeys({
|
|
137
|
-
treeData: treeData,
|
|
138
|
-
expandedKeys: expandedKeys,
|
|
139
|
-
startKey: key,
|
|
140
|
-
endKey: lastSelectedKey.current,
|
|
141
|
-
fieldNames: fieldNames
|
|
142
|
-
})))));
|
|
143
|
-
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
|
|
144
|
-
} else {
|
|
145
|
-
// Single click
|
|
146
|
-
newSelectedKeys = [key];
|
|
147
|
-
lastSelectedKey.current = key;
|
|
148
|
-
cachedSelectedKeys.current = newSelectedKeys;
|
|
149
|
-
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
|
|
150
|
-
}
|
|
151
|
-
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 || _props$onSelect.call(props, newSelectedKeys, newEvent);
|
|
152
|
-
if (!('selectedKeys' in props)) {
|
|
153
|
-
setSelectedKeys(newSelectedKeys);
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
var className = props.className,
|
|
157
|
-
_props$showIcon = props.showIcon,
|
|
158
|
-
showIcon = _props$showIcon === void 0 ? true : _props$showIcon,
|
|
159
|
-
_props$expandAction = props.expandAction,
|
|
160
|
-
expandAction = _props$expandAction === void 0 ? 'click' : _props$expandAction,
|
|
161
|
-
otherProps = _objectWithoutProperties(props, _excluded2);
|
|
162
|
-
var prefixCls = 'el-tree';
|
|
163
|
-
var connectClassName = classNames("".concat(prefixCls, "-directory"), className);
|
|
164
|
-
return /*#__PURE__*/React.createElement(Tree, _extends({
|
|
165
|
-
icon: getIcon,
|
|
166
|
-
ref: ref,
|
|
167
|
-
blockNode: true
|
|
168
|
-
}, otherProps, {
|
|
169
|
-
showIcon: showIcon,
|
|
170
|
-
expandAction: expandAction,
|
|
171
|
-
prefixCls: prefixCls,
|
|
172
|
-
className: connectClassName,
|
|
173
|
-
expandedKeys: expandedKeys,
|
|
174
|
-
selectedKeys: selectedKeys,
|
|
175
|
-
onSelect: onSelect,
|
|
176
|
-
onExpand: onExpand
|
|
177
|
-
}));
|
|
178
|
-
};
|
|
179
|
-
var ForwardDirectoryTree = /*#__PURE__*/React.forwardRef(DirectoryTree);
|
|
180
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
181
|
-
ForwardDirectoryTree.displayName = 'DirectoryTree';
|
|
182
|
-
}
|
|
183
|
-
export default ForwardDirectoryTree;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
var DropIndicator = function DropIndicator(props) {
|
|
3
|
-
var dropPosition = props.dropPosition,
|
|
4
|
-
dropLevelOffset = props.dropLevelOffset,
|
|
5
|
-
indent = props.indent;
|
|
6
|
-
var style = {
|
|
7
|
-
pointerEvents: 'none',
|
|
8
|
-
position: 'absolute',
|
|
9
|
-
right: 0,
|
|
10
|
-
backgroundColor: 'red',
|
|
11
|
-
height: 2
|
|
12
|
-
};
|
|
13
|
-
switch (dropPosition) {
|
|
14
|
-
case -1:
|
|
15
|
-
style.top = 0;
|
|
16
|
-
style.left = -dropLevelOffset * indent;
|
|
17
|
-
break;
|
|
18
|
-
case 1:
|
|
19
|
-
style.bottom = 0;
|
|
20
|
-
style.left = -dropLevelOffset * indent;
|
|
21
|
-
break;
|
|
22
|
-
case 0:
|
|
23
|
-
style.bottom = 0;
|
|
24
|
-
style.left = indent;
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
-
style: style
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
32
|
-
DropIndicator.displayName = 'DropIndicator';
|
|
33
|
-
}
|
|
34
|
-
export default DropIndicator;
|
package/dist/Tree/Indent.d.ts
DELETED
package/dist/Tree/Indent.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
-
import classNames from 'classnames';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
var Indent = function Indent(_ref) {
|
|
8
|
-
var prefixCls = _ref.prefixCls,
|
|
9
|
-
level = _ref.level,
|
|
10
|
-
isStart = _ref.isStart,
|
|
11
|
-
isEnd = _ref.isEnd;
|
|
12
|
-
var baseClassName = "".concat(prefixCls, "-indent-unit");
|
|
13
|
-
var list = [];
|
|
14
|
-
for (var i = 0; i < level; i += 1) {
|
|
15
|
-
list.push( /*#__PURE__*/React.createElement("span", {
|
|
16
|
-
key: i,
|
|
17
|
-
className: classNames(baseClassName, _defineProperty(_defineProperty({}, "".concat(baseClassName, "-start"), isStart[i]), "".concat(baseClassName, "-end"), isEnd[i]))
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
21
|
-
"aria-hidden": "true",
|
|
22
|
-
className: "".concat(prefixCls, "-indent")
|
|
23
|
-
}, list);
|
|
24
|
-
};
|
|
25
|
-
export default /*#__PURE__*/React.memo(Indent);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { FlattenNode, TreeNodeProps } from './typings';
|
|
3
|
-
import { type TreeNodeRequiredProps } from './utils/treeUtil';
|
|
4
|
-
interface MotionTreeNodeProps extends Omit<TreeNodeProps, 'domRef'> {
|
|
5
|
-
active: boolean;
|
|
6
|
-
motion?: any;
|
|
7
|
-
motionNodes?: FlattenNode[];
|
|
8
|
-
onMotionStart: () => void;
|
|
9
|
-
onMotionEnd: () => void;
|
|
10
|
-
motionType?: 'show' | 'hide';
|
|
11
|
-
treeNodeRequiredProps: TreeNodeRequiredProps;
|
|
12
|
-
}
|
|
13
|
-
declare const MotionTreeNode: React.ForwardRefExoticComponent<MotionTreeNodeProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
export default MotionTreeNode;
|