@kdcloudjs/kdesign 1.8.30 → 1.8.32

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 (157) hide show
  1. package/dist/kdesign-complete.less +798 -83
  2. package/dist/kdesign.css +578 -7
  3. package/dist/kdesign.css.map +1 -1
  4. package/dist/kdesign.js +166 -93
  5. package/dist/kdesign.js.map +1 -1
  6. package/dist/kdesign.min.css +3 -3
  7. package/dist/kdesign.min.js +5 -5
  8. package/dist/kdesign.min.js.map +1 -1
  9. package/es/anchor/anchor.js +7 -5
  10. package/es/anchor/style/index.css +14 -0
  11. package/es/anchor/style/index.less +15 -0
  12. package/es/button/button.js +4 -2
  13. package/es/button/group.js +5 -3
  14. package/es/button/style/index.css +32 -0
  15. package/es/button/style/index.less +42 -1
  16. package/es/checkbox/checkbox.js +5 -3
  17. package/es/checkbox/group.js +4 -2
  18. package/es/checkbox/style/index.css +38 -1
  19. package/es/checkbox/style/index.less +56 -15
  20. package/es/city-picker/city-picker.js +32 -14
  21. package/es/city-picker/option.js +7 -2
  22. package/es/city-picker/style/index.css +54 -0
  23. package/es/city-picker/style/index.less +67 -0
  24. package/es/collapse/collapse.js +4 -2
  25. package/es/collapse/style/index.css +24 -0
  26. package/es/collapse/style/index.less +26 -0
  27. package/es/color-picker/color-picker.js +6 -4
  28. package/es/color-picker/style/index.css +129 -4
  29. package/es/color-picker/style/index.less +174 -29
  30. package/es/config-provider/compDefaultProps.d.ts +0 -1
  31. package/es/config-provider/compDefaultProps.js +0 -5
  32. package/es/dropdown/dropdown.js +5 -2
  33. package/es/dropdown/menu.js +4 -2
  34. package/es/dropdown/style/index.css +3 -0
  35. package/es/dropdown/style/index.less +4 -0
  36. package/es/image/preview.js +6 -4
  37. package/es/image/style/index.css +11 -0
  38. package/es/image/style/index.less +20 -4
  39. package/es/input/ClearableLabeledInput.d.ts +1 -0
  40. package/es/input/ClearableLabeledInput.js +6 -4
  41. package/es/input/TextArea.js +7 -4
  42. package/es/input/input.js +6 -3
  43. package/es/input/style/index.css +48 -0
  44. package/es/input/style/index.less +55 -0
  45. package/es/link/link.js +4 -2
  46. package/es/link/style/index.css +11 -0
  47. package/es/link/style/index.less +14 -0
  48. package/es/menu/menu.js +4 -2
  49. package/es/menu/menuItem.js +5 -3
  50. package/es/menu/style/index.css +10 -0
  51. package/es/menu/style/index.less +33 -22
  52. package/es/menu/subMenu.js +6 -4
  53. package/es/modal/modal.js +4 -2
  54. package/es/modal/style/index.css +7 -0
  55. package/es/modal/style/index.less +14 -0
  56. package/es/qr-code/qr-code.js +4 -2
  57. package/es/qr-code/style/index.css +3 -0
  58. package/es/qr-code/style/index.less +7 -3
  59. package/es/radio/group.js +4 -2
  60. package/es/radio/radio.js +4 -2
  61. package/es/radio/style/index.css +38 -0
  62. package/es/radio/style/index.less +46 -0
  63. package/es/select/option.js +4 -2
  64. package/es/select/select.js +8 -6
  65. package/es/select/style/index.css +61 -0
  66. package/es/select/style/index.less +87 -0
  67. package/es/steps/Steps.js +4 -2
  68. package/es/steps/style/index.css +35 -0
  69. package/es/steps/style/index.less +59 -5
  70. package/es/switch/style/index.css +9 -0
  71. package/es/switch/style/index.less +9 -2
  72. package/es/switch/switch.js +4 -2
  73. package/es/tag/style/index.css +7 -0
  74. package/es/tag/style/index.less +8 -0
  75. package/es/tag/tag.js +4 -2
  76. package/es/tree/style/index.css +19 -0
  77. package/es/tree/style/index.less +27 -0
  78. package/es/tree/tree.js +4 -2
  79. package/es/tree/treeNode.js +3 -2
  80. package/es/upload/style/index.css +24 -1
  81. package/es/upload/style/index.less +40 -2
  82. package/es/upload/upload.js +4 -2
  83. package/lib/anchor/anchor.js +7 -5
  84. package/lib/anchor/style/index.css +14 -0
  85. package/lib/anchor/style/index.less +15 -0
  86. package/lib/button/button.js +4 -2
  87. package/lib/button/group.js +5 -3
  88. package/lib/button/style/index.css +32 -0
  89. package/lib/button/style/index.less +42 -1
  90. package/lib/checkbox/checkbox.js +5 -3
  91. package/lib/checkbox/group.js +4 -2
  92. package/lib/checkbox/style/index.css +38 -1
  93. package/lib/checkbox/style/index.less +56 -15
  94. package/lib/city-picker/city-picker.js +32 -14
  95. package/lib/city-picker/option.js +7 -2
  96. package/lib/city-picker/style/index.css +54 -0
  97. package/lib/city-picker/style/index.less +67 -0
  98. package/lib/collapse/collapse.js +4 -2
  99. package/lib/collapse/style/index.css +24 -0
  100. package/lib/collapse/style/index.less +26 -0
  101. package/lib/color-picker/color-picker.js +6 -4
  102. package/lib/color-picker/style/index.css +129 -4
  103. package/lib/color-picker/style/index.less +174 -29
  104. package/lib/config-provider/compDefaultProps.d.ts +0 -1
  105. package/lib/config-provider/compDefaultProps.js +0 -5
  106. package/lib/dropdown/dropdown.js +5 -2
  107. package/lib/dropdown/menu.js +4 -2
  108. package/lib/dropdown/style/index.css +3 -0
  109. package/lib/dropdown/style/index.less +4 -0
  110. package/lib/image/preview.js +6 -4
  111. package/lib/image/style/index.css +11 -0
  112. package/lib/image/style/index.less +20 -4
  113. package/lib/input/ClearableLabeledInput.d.ts +1 -0
  114. package/lib/input/ClearableLabeledInput.js +6 -4
  115. package/lib/input/TextArea.js +7 -4
  116. package/lib/input/input.js +6 -3
  117. package/lib/input/style/index.css +48 -0
  118. package/lib/input/style/index.less +55 -0
  119. package/lib/link/link.js +4 -2
  120. package/lib/link/style/index.css +11 -0
  121. package/lib/link/style/index.less +14 -0
  122. package/lib/menu/menu.js +4 -2
  123. package/lib/menu/menuItem.js +5 -3
  124. package/lib/menu/style/index.css +10 -0
  125. package/lib/menu/style/index.less +33 -22
  126. package/lib/menu/subMenu.js +6 -4
  127. package/lib/modal/modal.js +4 -2
  128. package/lib/modal/style/index.css +7 -0
  129. package/lib/modal/style/index.less +14 -0
  130. package/lib/qr-code/qr-code.js +4 -2
  131. package/lib/qr-code/style/index.css +3 -0
  132. package/lib/qr-code/style/index.less +7 -3
  133. package/lib/radio/group.js +4 -2
  134. package/lib/radio/radio.js +4 -2
  135. package/lib/radio/style/index.css +38 -0
  136. package/lib/radio/style/index.less +46 -0
  137. package/lib/select/option.js +4 -2
  138. package/lib/select/select.js +8 -6
  139. package/lib/select/style/index.css +61 -0
  140. package/lib/select/style/index.less +87 -0
  141. package/lib/steps/Steps.js +4 -2
  142. package/lib/steps/style/index.css +35 -0
  143. package/lib/steps/style/index.less +59 -5
  144. package/lib/switch/style/index.css +9 -0
  145. package/lib/switch/style/index.less +9 -2
  146. package/lib/switch/switch.js +4 -2
  147. package/lib/tag/style/index.css +7 -0
  148. package/lib/tag/style/index.less +8 -0
  149. package/lib/tag/tag.js +4 -2
  150. package/lib/tree/style/index.css +19 -0
  151. package/lib/tree/style/index.less +27 -0
  152. package/lib/tree/tree.js +4 -2
  153. package/lib/tree/treeNode.js +3 -2
  154. package/lib/upload/style/index.css +24 -1
  155. package/lib/upload/style/index.less +40 -2
  156. package/lib/upload/upload.js +4 -2
  157. package/package.json +1 -1
package/es/steps/Steps.js CHANGED
@@ -24,7 +24,8 @@ var Steps = function Steps(props) {
24
24
  var _useContext = useContext(ConfigContext),
25
25
  getPrefixCls = _useContext.getPrefixCls,
26
26
  prefixCls = _useContext.prefixCls,
27
- userDefaultProps = _useContext.compDefaultProps;
27
+ userDefaultProps = _useContext.compDefaultProps,
28
+ rtlDirection = _useContext.direction;
28
29
  var stepsProps = getCompProps('Steps', userDefaultProps, props);
29
30
  var direction = stepsProps.direction,
30
31
  initial = stepsProps.initial,
@@ -46,7 +47,8 @@ var Steps = function Steps(props) {
46
47
  devWarning(Statuses.indexOf(status) === -1, 'steps', "cannot found steps status '".concat(status, "'"));
47
48
  devWarning(LabelPlacements.indexOf(labelPlacement) === -1, 'steps', "cannot found steps labelPlacement '".concat(labelPlacement, "'"));
48
49
  var stepsPrefixCls = getPrefixCls(prefixCls, 'steps', customPrefixcls);
49
- var stepsClassName = classNames(stepsPrefixCls, _concatInstanceProperty(_context = "".concat(stepsPrefixCls, "-")).call(_context, direction), className, (_classNames = {}, _defineProperty(_classNames, "".concat(stepsPrefixCls, "-leftLable"), labelPlacement === 'left'), _defineProperty(_classNames, "".concat(stepsPrefixCls, "-rightLable"), labelPlacement === 'right'), _defineProperty(_classNames, "".concat(stepsPrefixCls, "-bottomLable"), labelPlacement === 'bottom'), _defineProperty(_classNames, "".concat(stepsPrefixCls, "-topLable"), labelPlacement === 'top'), _classNames));
50
+ var rtlCls = rtlDirection === 'rtl' ? "".concat(stepsPrefixCls, "-rtl") : null;
51
+ var stepsClassName = classNames(stepsPrefixCls, rtlCls, _concatInstanceProperty(_context = "".concat(stepsPrefixCls, "-")).call(_context, direction), className, (_classNames = {}, _defineProperty(_classNames, "".concat(stepsPrefixCls, "-leftLable"), labelPlacement === 'left'), _defineProperty(_classNames, "".concat(stepsPrefixCls, "-rightLable"), labelPlacement === 'right'), _defineProperty(_classNames, "".concat(stepsPrefixCls, "-bottomLable"), labelPlacement === 'bottom'), _defineProperty(_classNames, "".concat(stepsPrefixCls, "-topLable"), labelPlacement === 'top'), _classNames));
50
52
  var onStepClick = function onStepClick(next) {
51
53
  if (canClickCurrentStep || onChange && current !== next) {
52
54
  onChange(next);
@@ -337,3 +337,38 @@
337
337
  text-align: left;
338
338
  margin-top: 1px;
339
339
  }
340
+ .kd-steps-rtl {
341
+ direction: rtl;
342
+ }
343
+ .kd-steps-rtl .kd-steps-item:first-child .kd-steps-item-iconContainer::before {
344
+ display: none;
345
+ }
346
+ .kd-steps-rtl.kd-steps-horizontal:first-child {
347
+ padding-right: 0;
348
+ }
349
+ .kd-steps-rtl.kd-steps-horizontal:last-child {
350
+ padding-right: 0;
351
+ padding-left: 0;
352
+ }
353
+ .kd-steps-rtl.kd-steps-horizontal .kd-steps-item .kd-steps-item-container .kd-steps-item-iconContainer::after {
354
+ display: none;
355
+ }
356
+ .kd-steps-rtl.kd-steps-horizontal .kd-steps-item .kd-steps-item-container .kd-steps-item-iconContainer::before {
357
+ content: '';
358
+ width: calc(100% + 35px);
359
+ height: var(--kd-c-steps-line-sizing-height, 1px);
360
+ border-bottom: 1px dashed var(--kd-c-steps-color-wait, #999);
361
+ border-left: 1px dashed var(--kd-c-steps-color-wait, #999);
362
+ position: absolute;
363
+ left: 50%;
364
+ top: calc(50% - var(--kd-c-steps-line-sizing-height, 1px) / 2);
365
+ -webkit-transition: width var(--kd-c-steps-motion-duration, var(--kd-g-duration, 0.3s)) cubic-bezier(0.48, 0.04, 0.52, 0.96), background-color var(--kd-c-steps-motion-duration, var(--kd-g-duration, 0.3s)) cubic-bezier(0.48, 0.04, 0.52, 0.96);
366
+ transition: width var(--kd-c-steps-motion-duration, var(--kd-g-duration, 0.3s)) cubic-bezier(0.48, 0.04, 0.52, 0.96), background-color var(--kd-c-steps-motion-duration, var(--kd-g-duration, 0.3s)) cubic-bezier(0.48, 0.04, 0.52, 0.96);
367
+ }
368
+ .kd-steps-rtl.kd-steps-vertical .kd-steps-item-iconContainer {
369
+ margin-left: 4px;
370
+ margin-right: 0;
371
+ }
372
+ .kd-steps-rtl.kd-steps-vertical .kd-steps-item-content {
373
+ text-align: right;
374
+ }
@@ -30,7 +30,6 @@
30
30
  background-color: @steps-color-white;
31
31
  }
32
32
  }
33
-
34
33
  }
35
34
 
36
35
  &-clickable&-wait {
@@ -60,7 +59,7 @@
60
59
 
61
60
  &:hover {
62
61
  .@{steps-prefix-cls}-item-title {
63
- color: @steps-color-completed
62
+ color: @steps-color-completed;
64
63
  }
65
64
  }
66
65
  }
@@ -85,7 +84,8 @@
85
84
  position: absolute;
86
85
  left: 50%;
87
86
  top: calc(50% - @steps-line-sizing-height / 2);
88
- transition: width @steps-duration-promptly cubic-bezier(0.48, 0.04, 0.52, 0.96), background-color @steps-duration-promptly cubic-bezier(0.48, 0.04, 0.52, 0.96)
87
+ transition: width @steps-duration-promptly cubic-bezier(0.48, 0.04, 0.52, 0.96),
88
+ background-color @steps-duration-promptly cubic-bezier(0.48, 0.04, 0.52, 0.96);
89
89
  }
90
90
 
91
91
  &:last-child {
@@ -144,7 +144,8 @@
144
144
  border-color: @steps-color-hover;
145
145
  }
146
146
 
147
- .@{steps-prefix-cls}-item-title, .@{steps-prefix-cls}-item-description {
147
+ .@{steps-prefix-cls}-item-title,
148
+ .@{steps-prefix-cls}-item-description {
148
149
  color: @steps-color-hover;
149
150
  }
150
151
  }
@@ -173,7 +174,6 @@
173
174
  }
174
175
  }
175
176
 
176
-
177
177
  &-error {
178
178
  .@{steps-prefix-cls}-icon {
179
179
  color: @steps-color-error;
@@ -261,3 +261,57 @@
261
261
  }
262
262
  }
263
263
  }
264
+
265
+ .@{steps-prefix-cls}-rtl {
266
+ direction: rtl;
267
+ .@{steps-prefix-cls}-item:first-child {
268
+ .@{steps-prefix-cls}-item-iconContainer {
269
+ &::before {
270
+ display: none;
271
+ }
272
+ }
273
+ }
274
+ &.@{steps-prefix-cls}-horizontal {
275
+ &:first-child {
276
+ padding-right: 0;
277
+ }
278
+
279
+ &:last-child {
280
+ padding-right: 0;
281
+ padding-left: 0;
282
+ }
283
+ .@{steps-prefix-cls}-item {
284
+ .@{steps-prefix-cls}-item-container {
285
+ .@{steps-prefix-cls}-item-iconContainer {
286
+ &::after {
287
+ display: none;
288
+ }
289
+ &::before {
290
+ content: '';
291
+ width: ~'calc(100% + 35px)';
292
+ height: @steps-line-sizing-height;
293
+ border-bottom: 1px dashed @steps-color-wait;
294
+ border-left: 1px dashed @steps-color-wait;
295
+ position: absolute;
296
+ left: 50%;
297
+ top: calc(50% - @steps-line-sizing-height / 2);
298
+ transition: width @steps-duration-promptly cubic-bezier(0.48, 0.04, 0.52, 0.96),
299
+ background-color @steps-duration-promptly cubic-bezier(0.48, 0.04, 0.52, 0.96);
300
+
301
+ }
302
+ }
303
+ }
304
+ }
305
+ }
306
+ &.@{steps-prefix-cls}-vertical {
307
+ .@{steps-prefix-cls}-item {
308
+ &-iconContainer {
309
+ margin-left: 4px;
310
+ margin-right: 0;
311
+ }
312
+ &-content {
313
+ text-align: right;
314
+ }
315
+ }
316
+ }
317
+ }
@@ -217,3 +217,12 @@
217
217
  .kd-switch-size-large .kd-switch-inner {
218
218
  margin: var(--kd-c-switch-inner-spacing-margin-large, 0 5px 0 21px);
219
219
  }
220
+ .kd-switch-rtl {
221
+ direction: rtl;
222
+ -webkit-transform: rotateY(180deg);
223
+ transform: rotateY(180deg);
224
+ }
225
+ .kd-switch-rtl .kd-switch-inner {
226
+ -webkit-transform: rotateY(180deg);
227
+ transform: rotateY(180deg);
228
+ }
@@ -4,7 +4,6 @@
4
4
  @switch-prefix-cls: ~'@{kd-prefix}-switch';
5
5
  @icon-prefix-cls: ~'@{kd-prefix}icon';
6
6
 
7
-
8
7
  .@{switch-prefix-cls} {
9
8
  .switch;
10
9
 
@@ -25,7 +24,7 @@
25
24
 
26
25
  .@{icon-prefix-cls}-loadding-circle {
27
26
  animation: loadingcircle 1s infinite;
28
- animation-timing-function: cubic-bezier(0.42, 0.00, 0.58, 1.00);
27
+ animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
29
28
  font-size: @switch-small-font-size;
30
29
  line-height: 1;
31
30
  vertical-align: baseline;
@@ -80,3 +79,11 @@
80
79
  }
81
80
  }
82
81
  }
82
+
83
+ .@{switch-prefix-cls}-rtl {
84
+ direction: rtl;
85
+ transform: rotateY(180deg);
86
+ .@{switch-prefix-cls}-inner {
87
+ transform: rotateY(180deg);
88
+ }
89
+ }
@@ -24,7 +24,8 @@ var Switch = function Switch(props) {
24
24
  var _useContext = useContext(ConfigContext),
25
25
  getPrefixCls = _useContext.getPrefixCls,
26
26
  prefixCls = _useContext.prefixCls,
27
- userDefaultProps = _useContext.compDefaultProps;
27
+ userDefaultProps = _useContext.compDefaultProps,
28
+ direction = _useContext.direction;
28
29
  var switchProps = getCompProps('Switch', userDefaultProps, props);
29
30
  var size = switchProps.size,
30
31
  className = switchProps.className,
@@ -46,6 +47,7 @@ var Switch = function Switch(props) {
46
47
  newChecked = _useMergedState2[0],
47
48
  setChecked = _useMergedState2[1];
48
49
  var switchPrefixCls = getPrefixCls(prefixCls, 'switch', customPrefixcls);
50
+ var rtlCls = direction === 'rtl' ? "".concat(switchPrefixCls, "-rtl") : null;
49
51
  var handleClick = function handleClick(e) {
50
52
  var newV = triggerChange(!newChecked, e);
51
53
  onClick && onClick(newV, e);
@@ -60,7 +62,7 @@ var Switch = function Switch(props) {
60
62
  }
61
63
  return afterChangedChecked;
62
64
  }
63
- var switchClasses = classNames(switchPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(switchPrefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames, "".concat(switchPrefixCls, "-disabled"), disabled || loading), _defineProperty(_classNames, "".concat(switchPrefixCls, "-loading"), loading), _defineProperty(_classNames, "".concat(switchPrefixCls, "-checked"), newChecked), _classNames));
65
+ var switchClasses = classNames(switchPrefixCls, rtlCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(switchPrefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames, "".concat(switchPrefixCls, "-disabled"), disabled || loading), _defineProperty(_classNames, "".concat(switchPrefixCls, "-loading"), loading), _defineProperty(_classNames, "".concat(switchPrefixCls, "-checked"), newChecked), _classNames));
64
66
  var loadingIcon = loading ? React.createElement("span", {
65
67
  className: "".concat(switchPrefixCls, "-loading-icon")
66
68
  }, React.createElement(Icon, {
@@ -519,3 +519,10 @@
519
519
  cursor: pointer;
520
520
  font-size: 12px;
521
521
  }
522
+ .kd-tag-rtl {
523
+ direction: rtl;
524
+ }
525
+ .kd-tag-rtl .kd-tag-closeWrapper {
526
+ margin-right: 4px;
527
+ margin-left: 0;
528
+ }
@@ -131,3 +131,11 @@
131
131
  font-size: 12px;
132
132
  }
133
133
  }
134
+
135
+ .@{tag-prefix-cls}-rtl {
136
+ direction: rtl;
137
+ .@{tag-prefix-cls}-closeWrapper {
138
+ margin-right: 4px;
139
+ margin-left: 0;
140
+ }
141
+ }
package/es/tag/tag.js CHANGED
@@ -25,7 +25,8 @@ var InteranalTag = function InteranalTag(props, ref) {
25
25
  var _useContext = useContext(ConfigContext),
26
26
  getPrefixCls = _useContext.getPrefixCls,
27
27
  prefixCls = _useContext.prefixCls,
28
- userDefaultProps = _useContext.compDefaultProps;
28
+ userDefaultProps = _useContext.compDefaultProps,
29
+ direction = _useContext.direction;
29
30
  var tagProps = getCompProps('Tag', userDefaultProps, props);
30
31
  var className = tagProps.className,
31
32
  clickable = tagProps.clickable,
@@ -45,6 +46,7 @@ var InteranalTag = function InteranalTag(props, ref) {
45
46
  devWarning(TagTypes.indexOf(type) === -1, 'tag', "cannot found tag type '".concat(type, "'"));
46
47
  devWarning(TagSizes.indexOf(size) === -1, 'tag', "cannot found tag size '".concat(size, "'"));
47
48
  var tagPrefixCls = getPrefixCls(prefixCls, 'tag', customPrefixcls);
49
+ var rtlCls = direction === 'rtl' ? "".concat(tagPrefixCls, "-rtl") : null;
48
50
  var handleClick = function handleClick(e) {
49
51
  if (!clickable) return;
50
52
  onClick && onClick(e);
@@ -72,7 +74,7 @@ var InteranalTag = function InteranalTag(props, ref) {
72
74
  }, child);
73
75
  };
74
76
  var isPresetColor = ['process', 'success', 'warning', 'error', 'end', 'expired'].indexOf(color) > -1;
75
- var tagClasses = classNames(tagPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(tagPrefixCls, "-shape-")).call(_context, type), type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(tagPrefixCls, "-")).call(_context2, color), isPresetColor), _defineProperty(_classNames, "".concat(tagPrefixCls, "-has-color"), !isPresetColor && color && type === 'attribute'), _defineProperty(_classNames, "".concat(tagPrefixCls, "-clickable"), clickable), _defineProperty(_classNames, "".concat(tagPrefixCls, "-closable"), closable), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(tagPrefixCls, "-size-")).call(_context3, size), size), _defineProperty(_classNames, "".concat(tagPrefixCls, "-closable-disabled"), type === 'edit' && disabled), _classNames));
77
+ var tagClasses = classNames(tagPrefixCls, rtlCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(tagPrefixCls, "-shape-")).call(_context, type), type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(tagPrefixCls, "-")).call(_context2, color), isPresetColor), _defineProperty(_classNames, "".concat(tagPrefixCls, "-has-color"), !isPresetColor && color && type === 'attribute'), _defineProperty(_classNames, "".concat(tagPrefixCls, "-clickable"), clickable), _defineProperty(_classNames, "".concat(tagPrefixCls, "-closable"), closable), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(tagPrefixCls, "-size-")).call(_context3, size), size), _defineProperty(_classNames, "".concat(tagPrefixCls, "-closable-disabled"), type === 'edit' && disabled), _classNames));
76
78
  var tagColorStyle = !isPresetColor && color && type === 'attribute' ? {
77
79
  backgroundColor: color
78
80
  } : {};
@@ -373,3 +373,22 @@
373
373
  -ms-flex-align: center;
374
374
  align-items: center;
375
375
  }
376
+ .kd-tree-rtl {
377
+ direction: rtl;
378
+ }
379
+ .kd-tree-rtl .kd-tree-root .kd-tree-node-item .kd-tree-node-root .kd-tree-node-indent {
380
+ margin-right: 0;
381
+ margin-left: 6px;
382
+ }
383
+ .kd-tree-rtl .kd-tree-root .kd-tree-node-item .kd-tree-node-root .kd-tree-node-title-wrap {
384
+ padding-right: 4px;
385
+ padding-left: 0;
386
+ }
387
+ .kd-tree-rtl .kd-tree-root .kd-tree-node-item .kd-tree-node-root .kd-tree-node-title-wrap .kd-checkbox-default-margin {
388
+ margin-right: 0;
389
+ margin-left: 4px;
390
+ }
391
+ .kd-tree-rtl .kd-tree-root .kd-tree-node-item .kd-tree-node-root .kd-tree-node-animation-expand {
392
+ -webkit-transform: rotate(-90deg);
393
+ transform: rotate(-90deg);
394
+ }
@@ -200,3 +200,30 @@
200
200
  align-items: center;
201
201
  }
202
202
  }
203
+ .@{tree-prefix-cls}-rtl {
204
+ direction: rtl;
205
+ .@{tree-prefix-cls}-root {
206
+ .@{tree-node-prefix-cls}-item {
207
+ .@{tree-node-prefix-cls}-root {
208
+ .@{tree-node-prefix-cls}-indent {
209
+ margin-right: 0;
210
+ margin-left: 6px;
211
+ }
212
+ .@{tree-node-prefix-cls}-title-wrap {
213
+ padding-right: 4px;
214
+ padding-left: 0;
215
+ .@{kd-prefix}-checkbox {
216
+ &-default-margin {
217
+ margin-right: 0;
218
+ margin-left: 4px;
219
+ }
220
+ }
221
+ }
222
+ .@{tree-node-prefix-cls}-animation-expand {
223
+ transform: rotate(-90deg);
224
+ }
225
+ }
226
+ }
227
+ }
228
+ }
229
+
package/es/tree/tree.js CHANGED
@@ -31,7 +31,8 @@ var InternalTree = React.forwardRef(function (props, ref) {
31
31
  var _useContext = useContext(ConfigContext),
32
32
  getPrefixCls = _useContext.getPrefixCls,
33
33
  prefixCls = _useContext.prefixCls,
34
- userDefaultProps = _useContext.compDefaultProps;
34
+ userDefaultProps = _useContext.compDefaultProps,
35
+ direction = _useContext.direction;
35
36
  var TreeProps = getCompProps('Tree', userDefaultProps, props);
36
37
  var customPrefixcls = TreeProps.prefixCls,
37
38
  treeData = TreeProps.treeData,
@@ -80,7 +81,8 @@ var InternalTree = React.forwardRef(function (props, ref) {
80
81
  renderExtra = TreeProps.renderExtra,
81
82
  others = __rest(TreeProps, ["prefixCls", "treeData", "virtual", "showIcon", "switcherIcon", "icon", "checkable", "checkStrictly", "disabled", "draggable", "scrollToKey", "expandedKeys", "checkedKeys", "defaultExpandRoot", "defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys", "defaultCheckedKeys", "defaultSelectedKeys", "height", "onCheck", "onExpand", "onDragStart", "onDragOver", "onDragLeave", "onDragEnter", "onDragEnd", "onDrop", "onSelect", "selectedKeys", "setTreeNodeStyle", "setTreeNodeClassName", "estimatedItemSize", "style", "className", "filterTreeNode", "filterValue", "expandOnClickNode", "onlyExpandOnClickIcon", "loadData", "notFoundContent", "showLine", "expandOnFilterNode", "renderExtra"]);
82
83
  var treePrefixCls = getPrefixCls(prefixCls, 'tree', customPrefixcls);
83
- var treeNodeClassName = classNames(className, (_classNames = {}, _defineProperty(_classNames, "".concat(treePrefixCls), true), _defineProperty(_classNames, "".concat(treePrefixCls, "-show-line"), showLine), _classNames));
84
+ var rtlCls = direction === 'rtl' ? "".concat(treePrefixCls, "-rtl") : null;
85
+ var treeNodeClassName = classNames(className, rtlCls, (_classNames = {}, _defineProperty(_classNames, "".concat(treePrefixCls), true), _defineProperty(_classNames, "".concat(treePrefixCls, "-show-line"), showLine), _classNames));
84
86
  var treeRootClassName = "".concat(treePrefixCls, "-root");
85
87
  var estimatedItemSize = innerEstimatedItemSize;
86
88
  var _React$useMemo = React.useMemo(function () {
@@ -23,7 +23,8 @@ var TreeNode = React.forwardRef(function (props) {
23
23
  var _useContext = useContext(ConfigContext),
24
24
  getPrefixCls = _useContext.getPrefixCls,
25
25
  prefixCls = _useContext.prefixCls,
26
- userDefaultProps = _useContext.compDefaultProps;
26
+ userDefaultProps = _useContext.compDefaultProps,
27
+ direction = _useContext.direction;
27
28
  var TreeNodeProps = getCompProps('TreeNode', userDefaultProps, props);
28
29
  var nodeKey = TreeNodeProps.nodeKey,
29
30
  customPrefixcls = TreeNodeProps.prefixCls,
@@ -176,7 +177,7 @@ var TreeNode = React.forwardRef(function (props) {
176
177
  className: classNames("".concat(treeNodePrefixCls, "-icon"), (_classNames3 = {}, _defineProperty(_classNames3, "".concat(treeNodePrefixCls, "-animation-expand"), expandState), _defineProperty(_classNames3, "".concat(treeNodePrefixCls, "-animation-collapse"), !expandState), _defineProperty(_classNames3, "".concat(treeNodePrefixCls, "-icon-hover"), !expandOnClickNode), _classNames3)),
177
178
  onClick: expandOnClickNode ? onlyExpandOnClickIcon ? handleExpandIconClick : undefined : handleExpandIconClick
178
179
  }, renderIcon(switcherIcon || React.createElement(Icon, {
179
- type: "arrow-right-solid"
180
+ type: "arrow-".concat(direction === 'rtl' ? 'left' : 'right', "-solid")
180
181
  })));
181
182
  } else {
182
183
  return React.createElement("span", {
@@ -164,7 +164,7 @@
164
164
  opacity: 0;
165
165
  overflow: hidden;
166
166
  }
167
- .kd-upload-input input[type="file"] {
167
+ .kd-upload-input input[type='file'] {
168
168
  position: absolute;
169
169
  top: -20%;
170
170
  left: 0;
@@ -386,3 +386,26 @@
386
386
  color: var(--kd-c-upload-panel-button-color, #0E5FD8);
387
387
  font-size: var(--kd-c-upload-picture-action-font-size, var(--kd-g-font-size-small, 12px));
388
388
  }
389
+ .kd-upload-rtl {
390
+ direction: rtl;
391
+ }
392
+ .kd-upload-rtl.kd-upload .kd-upload-text-list-item-name {
393
+ margin: 0 var(--kd-c-upload-text-list-item-name-padding-left, 4px) 0 var(--kd-c-upload-text-list-item-name-padding-right, 8px);
394
+ }
395
+ .kd-upload-rtl.kd-upload .kd-upload-text-list-item-action {
396
+ left: 0;
397
+ right: auto;
398
+ -webkit-transform: translateX(-5px);
399
+ transform: translateX(-5px);
400
+ }
401
+ .kd-upload-rtl.kd-upload .kd-upload-text-list-item-action a:not(:first-child) {
402
+ margin-right: 20px;
403
+ margin-left: 0;
404
+ }
405
+ .kd-upload-rtl.kd-upload .kd-upload-picture-list-item {
406
+ margin: 0 0 28px 28px;
407
+ }
408
+ .kd-upload-rtl.kd-upload .kd-upload-picture-list-item-error a:not(:first-child) {
409
+ margin-right: 10px;
410
+ margin-left: auto;
411
+ }
@@ -46,7 +46,7 @@
46
46
  opacity: 0;
47
47
  overflow: hidden;
48
48
 
49
- input[type="file"] {
49
+ input[type='file'] {
50
50
  position: absolute;
51
51
  top: -20%;
52
52
  left: 0;
@@ -94,7 +94,8 @@
94
94
  font-size: @upload-font-size;
95
95
  }
96
96
 
97
- &-name,&-icon {
97
+ &-name,
98
+ &-icon {
98
99
  cursor: pointer;
99
100
  }
100
101
 
@@ -239,3 +240,40 @@
239
240
  }
240
241
  }
241
242
  }
243
+
244
+ .@{upload-prefix-cls}-rtl {
245
+ direction: rtl;
246
+ &.@{upload-prefix-cls} {
247
+ .@{upload-prefix-text-list-cls} {
248
+ &-item {
249
+ &-name {
250
+ margin: 0 @upload-text-list-item-name-padding-left 0 @upload-text-list-item-name-padding-right;
251
+ }
252
+ &-action {
253
+ left: 0;
254
+ right: auto;
255
+ transform: translateX(-5px);
256
+ a {
257
+ &:not(:first-child) {
258
+ margin-right: 20px;
259
+ margin-left: 0;
260
+ }
261
+ }
262
+ }
263
+ }
264
+ }
265
+ .@{upload-prefix-picture-list-cls} {
266
+ &-item {
267
+ margin: 0 0 28px 28px;
268
+ &-error {
269
+ a {
270
+ &:not(:first-child) {
271
+ margin-right: 10px;
272
+ margin-left: auto;
273
+ }
274
+ }
275
+ }
276
+ }
277
+ }
278
+ }
279
+ }
@@ -77,7 +77,8 @@ var InternalUpload = function InternalUpload(props, ref) {
77
77
  var _useContext = useContext(ConfigContext),
78
78
  getPrefixCls = _useContext.getPrefixCls,
79
79
  pkgPrefixCls = _useContext.prefixCls,
80
- userDefaultProps = _useContext.compDefaultProps;
80
+ userDefaultProps = _useContext.compDefaultProps,
81
+ direction = _useContext.direction;
81
82
  var inputRef = useRef(null);
82
83
  var allProps = getCompProps('Upload', userDefaultProps, props);
83
84
  var type = allProps.type,
@@ -313,6 +314,7 @@ var InternalUpload = function InternalUpload(props, ref) {
313
314
  }
314
315
  };
315
316
  var prefixCls = getPrefixCls(pkgPrefixCls, 'upload', customPrefixcls);
317
+ var rtlCls = direction === 'rtl' ? "".concat(prefixCls, "-rtl") : null;
316
318
  var inputFileProps = {
317
319
  accept: accept,
318
320
  onClick: onClick,
@@ -386,7 +388,7 @@ var InternalUpload = function InternalUpload(props, ref) {
386
388
  };
387
389
  });
388
390
  return React.createElement("div", {
389
- className: classNames(prefixCls, {
391
+ className: classNames(prefixCls, rtlCls, {
390
392
  disabled: disabled
391
393
  }, className),
392
394
  style: style
@@ -118,7 +118,8 @@ var InternalAnchor = function InternalAnchor(props, ref) {
118
118
  var _useContext = (0, _react.useContext)(_ConfigContext.default),
119
119
  getPrefixCls = _useContext.getPrefixCls,
120
120
  prefixCls = _useContext.prefixCls,
121
- userDefaultProps = _useContext.compDefaultProps;
121
+ userDefaultProps = _useContext.compDefaultProps,
122
+ direction = _useContext.direction;
122
123
  var anchorProps = (0, _utils.getCompProps)('Anchor', userDefaultProps, props);
123
124
  var customPrefixcls = anchorProps.prefixCls,
124
125
  className = anchorProps.className,
@@ -141,6 +142,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
141
142
  dropdownStyle = anchorProps.dropdownStyle,
142
143
  onVisibleChange = anchorProps.onVisibleChange;
143
144
  var anchorPrefixCls = getPrefixCls(prefixCls, 'anchor', customPrefixcls);
145
+ var rtlCls = direction === 'rtl' ? "".concat(anchorPrefixCls, "-rtl") : null;
144
146
  (0, _devwarning.default)(AnchorTypes.indexOf(type) === -1, 'anchor', "cannot found anchor type '".concat(type, "'"));
145
147
  var _useState = (0, _react.useState)(null),
146
148
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -192,7 +194,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
192
194
  var anchorRef = ref || normalRef;
193
195
  var linksWidthRef = _react.default.useRef([]);
194
196
  var animating = _react.default.useRef(false);
195
- var wrapperClass = (0, _classnames.default)(className, (0, _defineProperty2.default)({}, "".concat(anchorPrefixCls, "-wrapper"), true));
197
+ var wrapperClass = (0, _classnames.default)(className, rtlCls, (0, _defineProperty2.default)({}, "".concat(anchorPrefixCls, "-wrapper"), true));
196
198
  var anchorMenuClass = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(anchorPrefixCls, "-menu"), true));
197
199
  var anchorAdvancedClass = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(anchorPrefixCls, "-advanced"), true));
198
200
  var inkClass = (0, _classnames.default)("".concat(anchorPrefixCls, "-line-slider"), {
@@ -431,7 +433,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
431
433
  className: leftClasses,
432
434
  onClick: handleLeft
433
435
  }, _react.default.createElement(_index.Icon, {
434
- type: "arrow-left"
436
+ type: "".concat(direction === 'rtl' ? 'arrow-right' : 'arrow-left')
435
437
  }));
436
438
  };
437
439
  var findCurrentLinkPosition = function findCurrentLinkPosition(linksWidth, boxWidth, position) {
@@ -461,12 +463,12 @@ var InternalAnchor = function InternalAnchor(props, ref) {
461
463
  className: rightClasses,
462
464
  onClick: handleRight
463
465
  }, _react.default.createElement(_index.Icon, {
464
- type: "arrow-right"
466
+ type: "".concat(direction === 'rtl' ? 'arrow-left' : 'arrow-right')
465
467
  }));
466
468
  };
467
469
  var anchorMenuContent = _react.default.createElement("div", {
468
470
  ref: anchorRef,
469
- className: "".concat(anchorPrefixCls, "-menu-wrapper"),
471
+ className: (0, _classnames.default)("".concat(anchorPrefixCls, "-menu-wrapper"), rtlCls),
470
472
  style: (0, _extends2.default)({
471
473
  width: '100%'
472
474
  }, style)
@@ -297,3 +297,17 @@
297
297
  -webkit-transition: all calc(var(--kd-c-anchor-duration-duration, var(--kd-g-duration, 0.3s)) - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
298
298
  transition: all calc(var(--kd-c-anchor-duration-duration, var(--kd-g-duration, 0.3s)) - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
299
299
  }
300
+ .kd-anchor-rtl {
301
+ direction: rtl;
302
+ }
303
+ .kd-anchor-rtl .kd-anchor {
304
+ padding-right: var(--kd-c-anchor-spacing-horizontal, 7px);
305
+ padding-left: 0;
306
+ }
307
+ .kd-anchor-rtl .kd-anchor-line {
308
+ right: var(--kd-c-anchor-spacing-horizontal, 7px);
309
+ left: auto;
310
+ }
311
+ .kd-anchor-rtl .kd-anchor-link {
312
+ text-align: right;
313
+ }
@@ -198,3 +198,18 @@
198
198
  transition: all calc(@anchor-transition-duration - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
199
199
  }
200
200
  }
201
+
202
+ .@{anchor-prefix-cls}-rtl {
203
+ direction: rtl;
204
+ .@{anchor-prefix-cls} {
205
+ padding-right: @anchor-link-left;
206
+ padding-left: 0;
207
+ &-line {
208
+ right: @anchor-link-left;
209
+ left: auto;
210
+ }
211
+ &-link {
212
+ text-align: right;
213
+ }
214
+ }
215
+ }
@@ -44,7 +44,8 @@ var InternalButton = function InternalButton(props, ref) {
44
44
  var _useContext = (0, _react.useContext)(_ConfigContext.default),
45
45
  getPrefixCls = _useContext.getPrefixCls,
46
46
  prefixCls = _useContext.prefixCls,
47
- userDefaultProps = _useContext.compDefaultProps;
47
+ userDefaultProps = _useContext.compDefaultProps,
48
+ direction = _useContext.direction;
48
49
  var buttonProps = (0, _utils.getCompProps)('Button', userDefaultProps, props);
49
50
  var type = buttonProps.type,
50
51
  iconPlace = buttonProps.iconPlace,
@@ -65,6 +66,7 @@ var InternalButton = function InternalButton(props, ref) {
65
66
  others = __rest(buttonProps, ["type", "iconPlace", "children", "className", "prefixCls", "size", "loading", "shape", "bordered", "onClick", "icon", "ghost", "block", "disabled", "htmlType"]);
66
67
  (0, _devwarning.default)(ButtonTypes.indexOf(type) === -1, 'button', "cannot found button type '".concat(type, "'"));
67
68
  var btnPrefixCls = getPrefixCls(prefixCls, 'btn', customPrefixcls);
69
+ var rtlCls = direction === 'rtl' ? "".concat(btnPrefixCls, "-rtl") : null;
68
70
  var handleClick = function handleClick(e) {
69
71
  if (loading || disabled) {
70
72
  return;
@@ -94,7 +96,7 @@ var InternalButton = function InternalButton(props, ref) {
94
96
  return child;
95
97
  };
96
98
  var isTextBtn = type === 'text';
97
- var btnClasses = (0, _classnames.default)(btnPrefixCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(btnPrefixCls, "-")).call(_context, type), type), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context2 = "".concat(btnPrefixCls, "-size-")).call(_context2, size), size), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context3 = "".concat(btnPrefixCls, "-shape-")).call(_context3, shape), shape && !isTextBtn), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-no-border"), !bordered), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-background-ghost"), ghost && !disabled), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-loading"), loading && !isTextBtn), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-block"), block && !shape), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-icon-only"), !children && children !== 0 && icon), _classNames));
99
+ var btnClasses = (0, _classnames.default)(btnPrefixCls, rtlCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(btnPrefixCls, "-")).call(_context, type), type), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context2 = "".concat(btnPrefixCls, "-size-")).call(_context2, size), size), (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context3 = "".concat(btnPrefixCls, "-shape-")).call(_context3, shape), shape && !isTextBtn), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-no-border"), !bordered), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-background-ghost"), ghost && !disabled), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-loading"), loading && !isTextBtn), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-block"), block && !shape), (0, _defineProperty2.default)(_classNames, "".concat(btnPrefixCls, "-icon-only"), !children && children !== 0 && icon), _classNames));
98
100
  var iconWrapperClassName = (0, _concat.default)(_context4 = "".concat(btnPrefixCls, "-iconWrapper-")).call(_context4, iconPlace === 'left' ? 'left' : 'right');
99
101
  var iconNode = icon && !loading ? _react.default.createElement("span", {
100
102
  className: iconWrapperClassName
@@ -30,7 +30,8 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
30
30
  var _useContext = (0, _react.useContext)(_ConfigContext.default),
31
31
  getPrefixCls = _useContext.getPrefixCls,
32
32
  prefixCls = _useContext.prefixCls,
33
- userDefaultProps = _useContext.compDefaultProps;
33
+ userDefaultProps = _useContext.compDefaultProps,
34
+ direction = _useContext.direction;
34
35
  var buttonGoupProps = (0, _utils.getCompProps)('ButtonGroup', userDefaultProps, props);
35
36
  var style = buttonGoupProps.style,
36
37
  className = buttonGoupProps.className,
@@ -54,6 +55,7 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
54
55
  var triggerRef = _react.default.useRef(null);
55
56
  var isBsicType = type === 'basic';
56
57
  var btnGroupPrefixCls = getPrefixCls(prefixCls, 'btn-group', customPrefixcls);
58
+ var rtlCls = direction === 'rtl' ? "".concat(btnGroupPrefixCls, "-rtl") : null;
57
59
  var btnGroupClasses = (0, _classnames.default)("".concat(btnGroupPrefixCls), className, (0, _defineProperty2.default)({}, (0, _concat.default)(_context = "".concat(btnGroupPrefixCls, "-")).call(_context, type), type));
58
60
  var renderTriggerButton = (0, _react.useCallback)(function () {
59
61
  var _toArray = (0, _reactChildren.toArray)(icon),
@@ -121,11 +123,11 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
121
123
  onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(visible);
122
124
  };
123
125
  var popperProps = (0, _extends2.default)((0, _extends2.default)({
124
- placement: 'bottomLeft',
126
+ placement: direction === 'rtl' ? 'bottomRight' : 'bottomLeft',
125
127
  trigger: 'click',
126
128
  gap: 0
127
129
  }, buttonGoupProps), {
128
- prefixCls: btnGroupPrefixCls,
130
+ prefixCls: (0, _classnames.default)(btnGroupPrefixCls, rtlCls),
129
131
  defaultVisible: optionShow,
130
132
  visible: optionShow,
131
133
  onVisibleChange: handleVisibleChange,