@aloudata/aloudata-design 1.9.17 → 1.10.1

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.
Files changed (123) hide show
  1. package/dist/Checkbox/style/index.less +35 -9
  2. package/dist/ConfigProvider/getUserList.d.ts +13 -1
  3. package/dist/ConfigProvider/getUserList.js +5 -0
  4. package/dist/Icon/components/DragLine.d.ts +11 -0
  5. package/dist/Icon/components/DragLine.js +35 -0
  6. package/dist/Icon/index.d.ts +1 -0
  7. package/dist/Icon/index.js +1 -0
  8. package/dist/Icon/svg/drag-line.svg +5 -0
  9. package/dist/MemberPicker/components/MemberSelection.d.ts +1 -1
  10. package/dist/MemberPicker/components/MemberSelection.js +8 -3
  11. package/dist/MemberPicker/components/MultipleOption.d.ts +5 -2
  12. package/dist/MemberPicker/components/MultipleOption.js +20 -5
  13. package/dist/MemberPicker/components/NickLabel.d.ts +3 -3
  14. package/dist/MemberPicker/components/NickLabel.js +6 -6
  15. package/dist/MemberPicker/components/Panel.d.ts +7 -4
  16. package/dist/MemberPicker/components/Panel.js +70 -20
  17. package/dist/MemberPicker/components/PanelWrapper.d.ts +14 -0
  18. package/dist/MemberPicker/components/PanelWrapper.js +126 -0
  19. package/dist/MemberPicker/components/SelectedMemberTags.d.ts +3 -2
  20. package/dist/MemberPicker/components/SelectedMemberTags.js +8 -5
  21. package/dist/MemberPicker/components/SelectorFooter.js +1 -1
  22. package/dist/MemberPicker/components/SingleOption.d.ts +3 -2
  23. package/dist/MemberPicker/components/SingleOption.js +7 -4
  24. package/dist/MemberPicker/components/UserGroupSelection.d.ts +14 -0
  25. package/dist/MemberPicker/components/UserGroupSelection.js +130 -0
  26. package/dist/MemberPicker/index.d.ts +2 -0
  27. package/dist/MemberPicker/index.js +28 -17
  28. package/dist/MemberPicker/interface.d.ts +11 -5
  29. package/dist/MemberPicker/interface.js +6 -1
  30. package/dist/MemberPicker/style/index.less +18 -3
  31. package/dist/MemberPicker/utils/getUsersWithUserId.d.ts +4 -0
  32. package/dist/MemberPicker/utils/getUsersWithUserId.js +23 -2
  33. package/dist/MemberPicker/utils/index.d.ts +6 -0
  34. package/dist/MemberPicker/utils/index.js +16 -0
  35. package/dist/Radio/style/index.less +1 -1
  36. package/dist/ScrollArea/index.d.ts +1 -0
  37. package/dist/ScrollArea/index.js +6 -3
  38. package/dist/Table/components/Cell.d.ts +7 -0
  39. package/dist/Table/components/Cell.js +20 -0
  40. package/dist/Table/components/Header.d.ts +6 -0
  41. package/dist/Table/components/Header.js +19 -0
  42. package/dist/{AldTable → Table}/helper.d.ts +9 -2
  43. package/dist/Table/helper.js +121 -0
  44. package/dist/Table/hooks/useScroll.d.ts +26 -0
  45. package/dist/Table/hooks/useScroll.js +57 -0
  46. package/dist/Table/index.d.ts +3 -1
  47. package/dist/Table/index.js +176 -1
  48. package/dist/Table/style/index.less +106 -203
  49. package/dist/{AldTable → Table}/types.d.ts +5 -4
  50. package/dist/Tree/DirectoryTree.d.ts +20 -0
  51. package/dist/Tree/DirectoryTree.js +175 -0
  52. package/dist/Tree/Tree.d.ts +136 -0
  53. package/dist/Tree/Tree.js +131 -0
  54. package/dist/Tree/demo/basic/index.js +3 -2
  55. package/dist/Tree/demo/drag/index.d.ts +3 -0
  56. package/dist/Tree/demo/drag/index.js +124 -0
  57. package/dist/Tree/index.d.ts +19 -13
  58. package/dist/Tree/index.js +7 -17
  59. package/dist/Tree/style/checkbox.less +226 -0
  60. package/dist/Tree/style/directory.less +68 -0
  61. package/dist/Tree/style/index.less +74 -29
  62. package/dist/Tree/style/mixin.less +333 -0
  63. package/dist/Tree/style/reset.less +11 -0
  64. package/dist/Tree/style/rtl.less +68 -0
  65. package/dist/Tree/style/var.less +42 -0
  66. package/dist/Tree/utils/dictUtil.d.ts +9 -0
  67. package/dist/Tree/utils/dictUtil.js +74 -0
  68. package/dist/Tree/utils/dropIndicator.d.ts +9 -0
  69. package/dist/Tree/utils/dropIndicator.js +35 -0
  70. package/dist/Tree/utils/iconUtil.d.ts +5 -0
  71. package/dist/Tree/utils/iconUtil.js +63 -0
  72. package/dist/_utils/motion.d.ts +8 -0
  73. package/dist/_utils/motion.js +52 -0
  74. package/dist/_utils/reactNode.d.ts +8 -0
  75. package/dist/_utils/reactNode.js +15 -0
  76. package/dist/_utils/type.d.ts +9 -0
  77. package/dist/_utils/type.js +20 -0
  78. package/dist/index.d.ts +11 -13
  79. package/dist/index.js +6 -7
  80. package/dist/style/color/bezierEasing.less +110 -0
  81. package/dist/style/color/colorPalette.less +84 -0
  82. package/dist/style/color/colors.less +162 -0
  83. package/dist/style/color/tinyColor.less +1184 -0
  84. package/dist/style/core/index.less +2 -0
  85. package/dist/style/core/motion/fade.less +34 -0
  86. package/dist/style/core/motion/move.less +129 -0
  87. package/dist/style/core/motion/other.less +48 -0
  88. package/dist/style/core/motion/slide.less +131 -0
  89. package/dist/style/core/motion/zoom.less +179 -0
  90. package/dist/style/core/motion.less +22 -0
  91. package/dist/style/index.less +2 -0
  92. package/dist/style/mixins/index.less +1 -0
  93. package/dist/style/mixins/motion.less +33 -0
  94. package/dist/style/themes/default/default.less +24 -0
  95. package/dist/style/themes/default/index.less +1 -0
  96. package/package.json +2 -3
  97. package/dist/AldTable/helper.js +0 -109
  98. package/dist/AldTable/index.d.ts +0 -4
  99. package/dist/AldTable/index.js +0 -151
  100. package/dist/AldTable/style/index.d.ts +0 -2
  101. package/dist/AldTable/style/index.js +0 -2
  102. package/dist/AldTable/style/index.less +0 -136
  103. package/dist/Table/Table.d.ts +0 -6
  104. package/dist/Table/Table.js +0 -360
  105. package/dist/Table/components/Empty/index.d.ts +0 -3
  106. package/dist/Table/components/Empty/index.js +0 -14
  107. package/dist/Table/components/Loading/index.d.ts +0 -3
  108. package/dist/Table/components/Loading/index.js +0 -12
  109. package/dist/Table/components/TableBodyRowList/index.d.ts +0 -13
  110. package/dist/Table/components/TableBodyRowList/index.js +0 -75
  111. package/dist/Table/components/TableHead/index.d.ts +0 -23
  112. package/dist/Table/components/TableHead/index.js +0 -229
  113. package/dist/Table/constant.d.ts +0 -0
  114. package/dist/Table/constant.js +0 -0
  115. package/dist/Table/hooks/useFrame.d.ts +0 -7
  116. package/dist/Table/hooks/useFrame.js +0 -75
  117. package/dist/Table/interface.d.ts +0 -42
  118. package/dist/Table/interface.js +0 -1
  119. package/dist/Table/react-table-config.d.ts +0 -122
  120. package/dist/Table/style/variable.less +0 -4
  121. package/dist/Table/utils.d.ts +0 -15
  122. package/dist/Table/utils.js +0 -122
  123. /package/dist/{AldTable → Table}/types.js +0 -0
@@ -0,0 +1,333 @@
1
+ @tree-prefix-cls: ~'@{ald-prefix}-tree';
2
+ @select-tree-prefix-cls: ~'@{ald-prefix}-select-tree';
3
+ @tree-motion: ~'@{ald-prefix}-motion-collapse';
4
+ @tree-node-padding: (@padding-xs / 2);
5
+ // @deprecated: kept for customization usages, recommend using @tree-node-highlight-color instead.
6
+ @tree-node-hightlight-color: inherit;
7
+ @tree-node-highlight-color: @tree-node-hightlight-color;
8
+ .antTreeSwitcherIcon(@type: 'tree-default-open-icon') {
9
+ .@{tree-prefix-cls}-switcher-icon,
10
+ .@{select-tree-prefix-cls}-switcher-icon {
11
+ display: inline-block;
12
+ font-size: 10px;
13
+ vertical-align: baseline;
14
+
15
+ svg {
16
+ transition: transform 0.3s;
17
+ }
18
+ }
19
+ }
20
+
21
+ .drop-indicator() {
22
+ .@{tree-prefix-cls}-drop-indicator {
23
+ position: absolute;
24
+ // it should displayed over the following node
25
+ z-index: 1;
26
+ height: 2px;
27
+ background-color: @primary-color;
28
+ border-radius: 1px;
29
+ pointer-events: none;
30
+
31
+ &::after {
32
+ position: absolute;
33
+ top: -3px;
34
+ left: -6px;
35
+ width: 8px;
36
+ height: 8px;
37
+ background-color: transparent;
38
+ border: 2px solid @primary-color;
39
+ border-radius: 50%;
40
+ content: '';
41
+ }
42
+ }
43
+ }
44
+
45
+ .antTreeFn(@custom-tree-prefix-cls) {
46
+ @custom-tree-node-prefix-cls: ~'@{custom-tree-prefix-cls}-treenode';
47
+ .reset-component();
48
+
49
+ background: transparent;
50
+ border-radius: 2px;
51
+ transition: background-color 0.3s;
52
+
53
+ &-focused:not(:hover):not(&-active-focused) {
54
+ background: @primary-1;
55
+ }
56
+
57
+ // =================== Virtual List ===================
58
+ &-list-holder-inner {
59
+ align-items: flex-start;
60
+ }
61
+
62
+ &.@{custom-tree-prefix-cls}-block-node {
63
+ .@{custom-tree-prefix-cls}-list-holder-inner {
64
+ align-items: stretch;
65
+
66
+ // >>> Title
67
+ .@{custom-tree-prefix-cls}-node-content-wrapper {
68
+ flex: auto;
69
+ }
70
+
71
+ // >>> Drag
72
+ .@{custom-tree-node-prefix-cls}.dragging {
73
+ position: relative;
74
+
75
+ &::after {
76
+ position: absolute;
77
+ inset: 0 0 @tree-node-padding 0;
78
+ border: 1px solid @primary-color;
79
+ opacity: 0;
80
+ animation: ant-tree-node-fx-do-not-use 0.3s;
81
+ animation-play-state: running;
82
+ animation-fill-mode: forwards;
83
+ content: '';
84
+ pointer-events: none;
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ // ===================== TreeNode =====================
91
+ .@{custom-tree-node-prefix-cls} {
92
+ display: flex;
93
+ align-items: flex-start;
94
+ padding: 0 0 @tree-node-padding 0;
95
+ outline: none;
96
+ // Disabled
97
+ &-disabled {
98
+ // >>> Title
99
+ .@{custom-tree-prefix-cls}-node-content-wrapper {
100
+ color: @disabled-color;
101
+ cursor: not-allowed;
102
+
103
+ &:hover {
104
+ background: transparent;
105
+ }
106
+ }
107
+ }
108
+
109
+ &-active .@{custom-tree-prefix-cls}-node-content-wrapper {
110
+ background: @tree-node-hover-bg;
111
+ }
112
+
113
+ &:not(&-disabled).filter-node .@{custom-tree-prefix-cls}-title {
114
+ color: @tree-node-highlight-color;
115
+ font-weight: 500;
116
+ }
117
+
118
+ &-draggable {
119
+ .@{custom-tree-prefix-cls}-draggable-icon {
120
+ width: @tree-title-height;
121
+ line-height: @tree-title-height;
122
+ text-align: center;
123
+ visibility: visible;
124
+ opacity: 0.2;
125
+ transition: opacity @animation-duration-slow;
126
+
127
+ .@{custom-tree-node-prefix-cls}:hover & {
128
+ opacity: 0.45;
129
+ }
130
+ }
131
+
132
+ &.@{custom-tree-node-prefix-cls}-disabled {
133
+ .@{custom-tree-prefix-cls}-draggable-icon {
134
+ visibility: hidden;
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ // >>> Indent
141
+ &-indent {
142
+ align-self: stretch;
143
+ white-space: nowrap;
144
+ user-select: none;
145
+
146
+ &-unit {
147
+ display: inline-block;
148
+ width: @tree-title-height;
149
+ }
150
+ }
151
+
152
+ // >>> Drag Handler
153
+ &-draggable-icon {
154
+ visibility: hidden;
155
+ }
156
+
157
+ // >>> Switcher
158
+ &-switcher {
159
+ .antTreeSwitcherIcon();
160
+
161
+ position: relative;
162
+ flex: none;
163
+ align-self: stretch;
164
+ width: @tree-title-height;
165
+ margin: 0;
166
+ line-height: @tree-title-height;
167
+ text-align: center;
168
+ cursor: pointer;
169
+ user-select: none;
170
+
171
+ &-noop {
172
+ cursor: default;
173
+ }
174
+
175
+ &_close {
176
+ .@{custom-tree-prefix-cls}-switcher-icon {
177
+ svg {
178
+ transform: rotate(-90deg);
179
+ }
180
+ }
181
+ }
182
+
183
+ &-loading-icon {
184
+ color: @primary-color;
185
+ }
186
+
187
+ &-leaf-line {
188
+ position: relative;
189
+ z-index: 1;
190
+ display: inline-block;
191
+ width: 100%;
192
+ height: 100%;
193
+ // https://github.com/ant-design/ant-design/issues/31884
194
+ &::before {
195
+ position: absolute;
196
+ top: 0;
197
+ right: 12px;
198
+ bottom: -@tree-node-padding;
199
+ margin-left: -1px;
200
+ border-right: 1px solid @normal-color;
201
+ content: ' ';
202
+ }
203
+
204
+ &::after {
205
+ position: absolute;
206
+ width: @tree-title-height - 14px;
207
+ height: @tree-title-height - 10px;
208
+ border-bottom: 1px solid @normal-color;
209
+ content: ' ';
210
+ }
211
+ }
212
+ }
213
+
214
+ // >>> Checkbox
215
+ &-checkbox {
216
+ top: initial;
217
+ margin: ((@tree-title-height - @checkbox-size) / 2) 8px 0 0;
218
+ }
219
+
220
+ // >>> Title
221
+ & &-node-content-wrapper {
222
+ position: relative;
223
+ z-index: auto;
224
+ min-height: @tree-title-height;
225
+ margin: 0;
226
+ padding: 0 4px;
227
+ color: inherit;
228
+ line-height: @tree-title-height;
229
+ background: transparent;
230
+ border-radius: @border-radius-base;
231
+ cursor: pointer;
232
+ transition: all 0.3s, border 0s, line-height 0s, box-shadow 0s;
233
+
234
+ &:hover {
235
+ background-color: @tree-node-hover-bg;
236
+ }
237
+
238
+ &.@{custom-tree-prefix-cls}-node-selected {
239
+ background-color: @tree-node-selected-bg;
240
+ }
241
+
242
+ // Icon
243
+ .@{custom-tree-prefix-cls}-iconEle {
244
+ display: inline-block;
245
+ width: @tree-title-height;
246
+ height: @tree-title-height;
247
+ line-height: @tree-title-height;
248
+ text-align: center;
249
+ vertical-align: top;
250
+
251
+ &:empty {
252
+ display: none;
253
+ }
254
+ }
255
+ }
256
+
257
+ // https://github.com/ant-design/ant-design/issues/28217
258
+ &-unselectable &-node-content-wrapper:hover {
259
+ background-color: transparent;
260
+ }
261
+
262
+ // ==================== Draggable =====================
263
+ &-node-content-wrapper {
264
+ line-height: @tree-title-height;
265
+ user-select: none;
266
+
267
+ .drop-indicator();
268
+ }
269
+
270
+ .@{custom-tree-node-prefix-cls}.drop-container {
271
+ > [draggable] {
272
+ box-shadow: 0 0 0 2px @primary-color;
273
+ }
274
+ }
275
+
276
+ // ==================== Show Line =====================
277
+ &-show-line {
278
+ // ================ Indent lines ================
279
+ .@{custom-tree-prefix-cls}-indent {
280
+ &-unit {
281
+ position: relative;
282
+ height: 100%;
283
+
284
+ &::before {
285
+ position: absolute;
286
+ top: 0;
287
+ right: (@tree-title-height / 2);
288
+ bottom: -@tree-node-padding;
289
+ border-right: 1px solid @border-color-base;
290
+ content: '';
291
+ }
292
+
293
+ &-end {
294
+ &::before {
295
+ display: none;
296
+ }
297
+ }
298
+ }
299
+ }
300
+
301
+ // ============== Cover Background ==============
302
+ .@{custom-tree-prefix-cls}-switcher {
303
+ background: @component-background;
304
+
305
+ &-line-icon {
306
+ // https://github.com/ant-design/ant-design/issues/32813
307
+ vertical-align: -0.15em;
308
+ }
309
+ }
310
+ }
311
+
312
+ .@{custom-tree-node-prefix-cls}-leaf-last {
313
+ .@{custom-tree-prefix-cls}-switcher {
314
+ &-leaf-line {
315
+ &::before {
316
+ top: auto !important;
317
+ bottom: auto !important;
318
+ height: @tree-title-height - 10px !important;
319
+ }
320
+ }
321
+ }
322
+ }
323
+ }
324
+
325
+ @keyframes ant-tree-node-fx-do-not-use {
326
+ 0% {
327
+ opacity: 0;
328
+ }
329
+
330
+ 100% {
331
+ opacity: 1;
332
+ }
333
+ }
@@ -0,0 +1,11 @@
1
+ .reset-component() {
2
+ box-sizing: border-box;
3
+ margin: 0;
4
+ padding: 0;
5
+ color: @text-color;
6
+ font-size: @font-size-base;
7
+ font-variant: @font-variant-base;
8
+ line-height: @line-height-base;
9
+ list-style: none;
10
+ font-feature-settings: @font-feature-settings-base;
11
+ }
@@ -0,0 +1,68 @@
1
+ @tree-prefix-cls: ~'@{ald-prefix}-tree';
2
+ @select-tree-prefix-cls: ~'@{ald-prefix}-select-tree';
3
+ @tree-node-prefix-cls: ~'@{tree-prefix-cls}-treenode';
4
+
5
+ .@{tree-prefix-cls} {
6
+ &-rtl {
7
+ direction: rtl;
8
+ .@{tree-prefix-cls}-node-content-wrapper[draggable='true'] {
9
+ .@{tree-prefix-cls}-drop-indicator {
10
+ &::after {
11
+ right: -6px;
12
+ left: unset;
13
+ }
14
+ }
15
+ }
16
+ }
17
+
18
+ // ===================== TreeNode =====================
19
+ .@{tree-node-prefix-cls} {
20
+ &-rtl {
21
+ direction: rtl;
22
+ }
23
+ }
24
+
25
+ // >>> Switcher
26
+ &-switcher {
27
+ &_close {
28
+ .@{tree-prefix-cls}-switcher-icon {
29
+ svg {
30
+ .@{tree-prefix-cls}-rtl & {
31
+ transform: rotate(90deg);
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
37
+ // ==================== Show Line =====================
38
+ &-show-line {
39
+ // ================ Indent lines ================
40
+ .@{tree-prefix-cls}-indent {
41
+ &-unit {
42
+ &::before {
43
+ .@{tree-prefix-cls}-rtl& {
44
+ right: auto;
45
+ left: -(@tree-title-height / 2) - 1px;
46
+ border-right: none;
47
+ border-left: 1px solid @border-color-base;
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ // >>> Checkbox
54
+ &-checkbox {
55
+ .@{tree-prefix-cls}-rtl & {
56
+ margin: ((@tree-title-height - @checkbox-size) / 2) 0 0 8px;
57
+ }
58
+ }
59
+ }
60
+
61
+ .@{select-tree-prefix-cls} {
62
+ // >>> Checkbox
63
+ &-checkbox {
64
+ .@{tree-prefix-cls}-select-dropdown-rtl & {
65
+ margin: ((@tree-title-height - @checkbox-size) / 2) 0 0 8px;
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,42 @@
1
+ @import '../../style/color/colorPalette.less';
2
+ @padding-xs: 4px; // small items
3
+ @item-hover-bg: fade(#fff, 8%);
4
+ @tree-directory-selected-color: #fff;
5
+ @tree-directory-selected-bg: @BG40;
6
+ @tree-title-height: 16px;
7
+ @border-color-base: #434343; // base border outline a component
8
+
9
+ @checkbox-size: 16px;
10
+ @text-color: fade(#000, 85%);
11
+ @font-size-base: 12px;
12
+ @primary-color: @B40;
13
+ @component-background: #141414;
14
+ @border-radius-sm: 2px;
15
+ @border-width-base: 1px;
16
+ @border-style-base: solid;
17
+ @primary-1: mix(
18
+ color(~`colorPalette('@{primary-color}', 8) `),
19
+ @component-background,
20
+ 15%
21
+ );
22
+ @primary-2: color(~`colorPalette('@{primary-color}', 2) `);
23
+ @font-variant-base: tabular-nums;
24
+ @line-height-base: 1.6667;
25
+ @font-feature-settings-base: 'tnum';
26
+ @disabled-color: fade(#fff, 30%);
27
+ @tree-node-hover-bg: #f5f5f5;
28
+ @animation-duration-slow: 0.3s; // Modal
29
+ @normal-color: #d9d9d9;
30
+ @border-radius-base: 2px;
31
+ @tree-node-selected-bg: @primary-2;
32
+ @checkbox-color: @primary-color;
33
+ @checkbox-border-radius: @border-radius-sm;
34
+ @checkbox-check-bg: transparent;
35
+ @checkbox-border-width: @border-width-base;
36
+ @checkbox-check-color: #fff;
37
+ @ease-in-back: cubic-bezier(0.71, -0.46, 0.88, 0.6);
38
+ @ease-out-back: cubic-bezier(0.12, 0.4, 0.29, 1.46);
39
+ @input-disabled-bg: @disabled-bg;
40
+ @checkbox-group-item-margin-right: 6px;
41
+ @background-color-base: fade(#fff, 8%); // Default grey background color
42
+ @disabled-bg: @background-color-base;
@@ -0,0 +1,9 @@
1
+ import type { DataNode, Key } from 'rc-tree/lib/interface';
2
+ /** 计算选中范围,只考虑expanded情况以优化性能 */
3
+ export declare function calcRangeKeys({ treeData, expandedKeys, startKey, endKey, }: {
4
+ treeData: DataNode[];
5
+ expandedKeys: Key[];
6
+ startKey?: Key;
7
+ endKey?: Key;
8
+ }): Key[];
9
+ export declare function convertDirectoryKeysToNodes(treeData: DataNode[], keys: Key[]): DataNode[];
@@ -0,0 +1,74 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ 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); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
7
+ var Record = /*#__PURE__*/function (Record) {
8
+ Record[Record["None"] = 0] = "None";
9
+ Record[Record["Start"] = 1] = "Start";
10
+ Record[Record["End"] = 2] = "End";
11
+ return Record;
12
+ }(Record || {});
13
+ function traverseNodesKey(treeData, callback) {
14
+ function processNode(dataNode) {
15
+ var key = dataNode.key,
16
+ children = dataNode.children;
17
+ if (callback(key, dataNode) !== false) {
18
+ traverseNodesKey(children || [], callback);
19
+ }
20
+ }
21
+ treeData.forEach(processNode);
22
+ }
23
+
24
+ /** 计算选中范围,只考虑expanded情况以优化性能 */
25
+ export function calcRangeKeys(_ref) {
26
+ var treeData = _ref.treeData,
27
+ expandedKeys = _ref.expandedKeys,
28
+ startKey = _ref.startKey,
29
+ endKey = _ref.endKey;
30
+ var keys = [];
31
+ var record = Record.None;
32
+ if (startKey && startKey === endKey) {
33
+ return [startKey];
34
+ }
35
+ if (!startKey || !endKey) {
36
+ return [];
37
+ }
38
+ function matchKey(key) {
39
+ return key === startKey || key === endKey;
40
+ }
41
+ traverseNodesKey(treeData, function (key) {
42
+ if (record === Record.End) {
43
+ return false;
44
+ }
45
+ if (matchKey(key)) {
46
+ // Match test
47
+ keys.push(key);
48
+ if (record === Record.None) {
49
+ record = Record.Start;
50
+ } else if (record === Record.Start) {
51
+ record = Record.End;
52
+ return false;
53
+ }
54
+ } else if (record === Record.Start) {
55
+ // Append selection
56
+ keys.push(key);
57
+ }
58
+ return expandedKeys.includes(key);
59
+ });
60
+ return keys;
61
+ }
62
+ export function convertDirectoryKeysToNodes(treeData, keys) {
63
+ var restKeys = _toConsumableArray(keys);
64
+ var nodes = [];
65
+ traverseNodesKey(treeData, function (key, node) {
66
+ var index = restKeys.indexOf(key);
67
+ if (index !== -1) {
68
+ nodes.push(node);
69
+ restKeys.splice(index, 1);
70
+ }
71
+ return !!restKeys.length;
72
+ });
73
+ return nodes;
74
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export declare const offset = 4;
3
+ export default function dropIndicatorRender(props: {
4
+ dropPosition: -1 | 0 | 1;
5
+ dropLevelOffset: number;
6
+ indent: number;
7
+ prefixCls: string;
8
+ direction: 'ltr' | 'rtl';
9
+ }): React.JSX.Element;
@@ -0,0 +1,35 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import React from 'react';
6
+ export var offset = 4;
7
+ export default function dropIndicatorRender(props) {
8
+ var _style;
9
+ var dropPosition = props.dropPosition,
10
+ dropLevelOffset = props.dropLevelOffset,
11
+ prefixCls = props.prefixCls,
12
+ indent = props.indent,
13
+ _props$direction = props.direction,
14
+ direction = _props$direction === void 0 ? 'ltr' : _props$direction;
15
+ var startPosition = direction === 'ltr' ? 'left' : 'right';
16
+ var endPosition = direction === 'ltr' ? 'right' : 'left';
17
+ var style = (_style = {}, _defineProperty(_style, startPosition, -dropLevelOffset * indent + offset), _defineProperty(_style, endPosition, 0), _style);
18
+ switch (dropPosition) {
19
+ case -1:
20
+ style.top = -3;
21
+ break;
22
+ case 1:
23
+ style.bottom = -3;
24
+ break;
25
+ default:
26
+ // dropPosition === 0
27
+ style.bottom = -3;
28
+ style[startPosition] = indent + offset;
29
+ break;
30
+ }
31
+ return /*#__PURE__*/React.createElement("div", {
32
+ style: style,
33
+ className: "".concat(prefixCls, "-drop-indicator")
34
+ });
35
+ }
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import type { AldTreeNodeProps, SwitcherIcon, TreeLeafIcon } from '../Tree';
3
+ export default function renderSwitcherIcon(prefixCls: string, switcherIcon: SwitcherIcon, showLine: boolean | {
4
+ showLeafIcon: boolean | TreeLeafIcon;
5
+ } | undefined, treeNodeProps: AldTreeNodeProps): React.ReactNode;
@@ -0,0 +1,63 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ import CaretDownFilled from '@ant-design/icons/CaretDownFilled';
3
+ import FileOutlined from '@ant-design/icons/FileOutlined';
4
+ import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
5
+ import MinusSquareOutlined from '@ant-design/icons/MinusSquareOutlined';
6
+ import PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined';
7
+ import classNames from 'classnames';
8
+ import * as React from 'react';
9
+ import { cloneElement, isValidElement } from "../../_utils/reactNode";
10
+ export default function renderSwitcherIcon(prefixCls, switcherIcon, showLine, treeNodeProps) {
11
+ var isLeaf = treeNodeProps.isLeaf,
12
+ expanded = treeNodeProps.expanded,
13
+ loading = treeNodeProps.loading;
14
+ if (loading) {
15
+ return /*#__PURE__*/React.createElement(LoadingOutlined, {
16
+ className: "".concat(prefixCls, "-switcher-loading-icon")
17
+ });
18
+ }
19
+ var showLeafIcon;
20
+ if (showLine && _typeof(showLine) === 'object') {
21
+ showLeafIcon = showLine.showLeafIcon;
22
+ }
23
+ if (isLeaf) {
24
+ if (!showLine) {
25
+ return null;
26
+ }
27
+ if (typeof showLeafIcon !== 'boolean' && !!showLeafIcon) {
28
+ var leafIcon = typeof showLeafIcon === 'function' ? showLeafIcon(treeNodeProps) : showLeafIcon;
29
+ var leafCls = "".concat(prefixCls, "-switcher-line-custom-icon");
30
+ if (isValidElement(leafIcon)) {
31
+ return cloneElement(leafIcon, {
32
+ className: classNames(leafIcon.props.className || '', leafCls)
33
+ });
34
+ }
35
+ return leafIcon;
36
+ }
37
+ return showLeafIcon ? /*#__PURE__*/React.createElement(FileOutlined, {
38
+ className: "".concat(prefixCls, "-switcher-line-icon")
39
+ }) : /*#__PURE__*/React.createElement("span", {
40
+ className: "".concat(prefixCls, "-switcher-leaf-line")
41
+ });
42
+ }
43
+ var switcherCls = "".concat(prefixCls, "-switcher-icon");
44
+ var switcher = typeof switcherIcon === 'function' ? switcherIcon(treeNodeProps) : switcherIcon;
45
+ if (isValidElement(switcher)) {
46
+ return cloneElement(switcher, {
47
+ className: classNames(switcher.props.className || '', switcherCls)
48
+ });
49
+ }
50
+ if (switcher) {
51
+ return switcher;
52
+ }
53
+ if (showLine) {
54
+ return expanded ? /*#__PURE__*/React.createElement(MinusSquareOutlined, {
55
+ className: "".concat(prefixCls, "-switcher-line-icon")
56
+ }) : /*#__PURE__*/React.createElement(PlusSquareOutlined, {
57
+ className: "".concat(prefixCls, "-switcher-line-icon")
58
+ });
59
+ }
60
+ return /*#__PURE__*/React.createElement(CaretDownFilled, {
61
+ className: switcherCls
62
+ });
63
+ }
@@ -0,0 +1,8 @@
1
+ import type { CSSMotionProps } from 'rc-motion';
2
+ declare const collapseMotion: CSSMotionProps;
3
+ declare const SelectPlacements: ["bottomLeft", "bottomRight", "topLeft", "topRight"];
4
+ export type SelectCommonPlacement = (typeof SelectPlacements)[number];
5
+ declare const getTransitionDirection: (placement: SelectCommonPlacement | undefined) => "slide-down" | "slide-up";
6
+ declare const getTransitionName: (rootPrefixCls: string, motion: string, transitionName?: string) => string;
7
+ export { getTransitionName, getTransitionDirection };
8
+ export default collapseMotion;