@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
@@ -21,7 +21,8 @@ var Dropdown = React.forwardRef(function (props, ref) {
21
21
  var _React$useContext = React.useContext(ConfigContext),
22
22
  getPrefixCls = _React$useContext.getPrefixCls,
23
23
  pkgPrefixCls = _React$useContext.prefixCls,
24
- userDefaultProps = _React$useContext.compDefaultProps;
24
+ userDefaultProps = _React$useContext.compDefaultProps,
25
+ direction = _React$useContext.direction;
25
26
  var allProps = getCompProps('Dropdown', userDefaultProps, props);
26
27
  var menu = allProps.menu,
27
28
  disabled = allProps.disabled,
@@ -31,6 +32,7 @@ var Dropdown = React.forwardRef(function (props, ref) {
31
32
  defaultVisible = allProps.defaultVisible,
32
33
  onVisibleChange = allProps.onVisibleChange,
33
34
  trigger = allProps.trigger,
35
+ placement = allProps.placement,
34
36
  customPrefixcls = allProps.prefixCls,
35
37
  menuAnimation = allProps.menuAnimation,
36
38
  popperStyle = allProps.popperStyle;
@@ -132,7 +134,8 @@ var Dropdown = React.forwardRef(function (props, ref) {
132
134
  popperStyle: innerAnimation ? popperStyle : _extends({
133
135
  animation: 'none'
134
136
  }, popperStyle),
135
- onVisibleChange: handleVisibleChange
137
+ onVisibleChange: handleVisibleChange,
138
+ placement: placement || (direction === 'rtl' ? 'bottomRight' : 'bottomLeft')
136
139
  });
137
140
  return usePopper(child, menuElement, popperProps);
138
141
  });
@@ -18,7 +18,8 @@ var Menu = React.forwardRef(function (props, ref) {
18
18
  var _React$useContext = React.useContext(ConfigContext),
19
19
  getPrefixCls = _React$useContext.getPrefixCls,
20
20
  pkgPrefixCls = _React$useContext.prefixCls,
21
- userDefaultProps = _React$useContext.compDefaultProps;
21
+ userDefaultProps = _React$useContext.compDefaultProps,
22
+ direction = _React$useContext.direction;
22
23
  var _a = getCompProps('DropdownMenu', userDefaultProps, props),
23
24
  customPrefixcls = _a.prefixCls,
24
25
  children = _a.children,
@@ -27,6 +28,7 @@ var Menu = React.forwardRef(function (props, ref) {
27
28
  className = _a.className,
28
29
  restProps = __rest(_a, ["prefixCls", "children", "selectable", "selectedKey", "className"]);
29
30
  var prefixCls = getPrefixCls(pkgPrefixCls, 'dropdown-menu', customPrefixcls);
31
+ var rtlCls = direction === 'rtl' ? "".concat(prefixCls, "-rtl") : null;
30
32
  var cloneItem = function cloneItem(item, index) {
31
33
  if (!React.isValidElement(item)) {
32
34
  return item;
@@ -40,7 +42,7 @@ var Menu = React.forwardRef(function (props, ref) {
40
42
  });
41
43
  };
42
44
  return React.createElement("ul", _extends({
43
- className: classNames(prefixCls, className),
45
+ className: classNames(prefixCls, rtlCls, className),
44
46
  role: "menu"
45
47
  }, restProps, {
46
48
  ref: ref
@@ -267,3 +267,6 @@
267
267
  -webkit-line-clamp: 2;
268
268
  -webkit-box-orient: vertical;
269
269
  }
270
+ .kd-dropdown .kd-dropdown-menu-rtl {
271
+ direction: rtl;
272
+ }
@@ -110,4 +110,8 @@
110
110
  }
111
111
  }
112
112
  }
113
+
114
+ .@{dropdown-prefix-cls}-menu-rtl {
115
+ direction: rtl;
116
+ }
113
117
  }
@@ -17,7 +17,8 @@ var Preview = function Preview(props) {
17
17
  getPrefixCls = _React$useContext.getPrefixCls,
18
18
  pkgPrefixCls = _React$useContext.prefixCls,
19
19
  userDefaultProps = _React$useContext.compDefaultProps,
20
- locale = _React$useContext.locale;
20
+ locale = _React$useContext.locale,
21
+ direction = _React$useContext.direction;
21
22
  var allProps = getCompProps('Image', userDefaultProps, props);
22
23
  var imageLangMsg = locale.getCompLangMsg({
23
24
  componentName: 'Image'
@@ -34,6 +35,7 @@ var Preview = function Preview(props) {
34
35
  operations = allProps.operations,
35
36
  customPrefixcls = allProps.prefixCls;
36
37
  var prefixCls = getPrefixCls(pkgPrefixCls, 'image', customPrefixcls);
38
+ var rtlCls = direction === 'rtl' ? "".concat(prefixCls, "-rtl") : null;
37
39
  var _React$useState = React.useState(visible),
38
40
  _React$useState2 = _slicedToArray(_React$useState, 2),
39
41
  show = _React$useState2[0],
@@ -106,7 +108,7 @@ var Preview = function Preview(props) {
106
108
  }
107
109
  };
108
110
  var peviewContainer = React.createElement("div", {
109
- className: classNames("".concat(prefixCls, "-preview"), props.className, {
111
+ className: classNames("".concat(prefixCls, "-preview"), rtlCls, props.className, {
110
112
  show: show
111
113
  }),
112
114
  style: _extends({}, props.style)
@@ -124,7 +126,7 @@ var Preview = function Preview(props) {
124
126
  }, React.createElement("img", _extends({}, previewImgProps)))), React.createElement("div", {
125
127
  className: "".concat(prefixCls, "-preview-action")
126
128
  }, props.type !== 'upload' && length && React.createElement(Icon, {
127
- type: "arrow-left",
129
+ type: direction === 'rtl' ? 'arrow-right' : 'arrow-left',
128
130
  className: classNames({
129
131
  disabled: current <= 0
130
132
  }),
@@ -142,7 +144,7 @@ var Preview = function Preview(props) {
142
144
  }),
143
145
  onClick: handleZoomIn
144
146
  }), props.type !== 'upload' && operations, props.type !== 'upload' && length && React.createElement(Icon, {
145
- type: "arrow-right",
147
+ type: direction === 'rtl' ? 'arrow-left' : 'arrow-right',
146
148
  className: classNames({
147
149
  disabled: current >= length - 1
148
150
  }),
@@ -331,3 +331,14 @@
331
331
  margin-right: 2px;
332
332
  font-size: 18px;
333
333
  }
334
+ .kd-image-rtl {
335
+ direction: rtl;
336
+ }
337
+ .kd-image-rtl .kd-image-preview-close {
338
+ left: 18px;
339
+ right: auto;
340
+ }
341
+ .kd-image-rtl .kd-image-preview-action i:not(:first-child) {
342
+ margin-right: 20px;
343
+ margin-left: 0;
344
+ }
@@ -44,7 +44,7 @@
44
44
  transition: all 0.2s ease-out;
45
45
  background-color: @image-action-background-color;
46
46
 
47
- >* {
47
+ > * {
48
48
  color: @image-icon-color;
49
49
  cursor: pointer;
50
50
  display: inline-block;
@@ -67,14 +67,14 @@
67
67
  opacity: 0;
68
68
  transform: scale(0.15);
69
69
  visibility: hidden;
70
- transition: all 0.2s cubic-bezier(0.4,0,1,0.6);
70
+ transition: all 0.2s cubic-bezier(0.4, 0, 1, 0.6);
71
71
  -webkit-overflow-scrolling: touch;
72
72
 
73
73
  &.show {
74
74
  opacity: 1;
75
75
  transform: scale(1);
76
76
  visibility: visible;
77
- transition: all 0.2s cubic-bezier(0,.4,.4,1);
77
+ transition: all 0.2s cubic-bezier(0, 0.4, 0.4, 1);
78
78
  }
79
79
 
80
80
  &-mask {
@@ -208,7 +208,7 @@
208
208
  position: absolute;
209
209
  right: 40px;
210
210
 
211
- >* {
211
+ > * {
212
212
  display: inline-block;
213
213
  margin-left: 20px;
214
214
  cursor: pointer;
@@ -221,3 +221,19 @@
221
221
  }
222
222
  }
223
223
  }
224
+
225
+ .@{image-prefix-cls}-rtl {
226
+ direction: rtl;
227
+ .@{image-preview-prefix-cls}-close {
228
+ left: 18px;
229
+ right: auto;
230
+ }
231
+ .@{image-preview-prefix-cls}-action {
232
+ i {
233
+ &:not(:first-child) {
234
+ margin-right: 20px;
235
+ margin-left: 0;
236
+ }
237
+ }
238
+ }
239
+ }
@@ -23,6 +23,7 @@ interface ClearableInputProps {
23
23
  numberMark?: React.ReactNode;
24
24
  inputCount?: React.ReactNode;
25
25
  status?: 'error';
26
+ direction?: 'ltr' | 'rtl';
26
27
  }
27
28
  declare const ClearableInput: React.FC<ClearableInputProps>;
28
29
  export default ClearableInput;
@@ -29,12 +29,14 @@ var ClearableInput = function ClearableInput(props) {
29
29
  numberMark = props.numberMark,
30
30
  inputCount = props.inputCount,
31
31
  count = props.count,
32
- status = props.status;
32
+ status = props.status,
33
+ direction = props.direction;
33
34
  var fixRef = useRef(null);
34
35
  var _useState = useState(false),
35
36
  _useState2 = _slicedToArray(_useState, 2),
36
37
  isMouseEnter = _useState2[0],
37
38
  setIsMouseEnter = _useState2[1];
39
+ var rtlCls = direction === 'rtl' ? "".concat(prefixCls, "-rtl") : null;
38
40
  var mouseEnterHandle = function mouseEnterHandle() {
39
41
  setIsMouseEnter(true);
40
42
  };
@@ -88,7 +90,7 @@ var ClearableInput = function ClearableInput(props) {
88
90
  className: "".concat(prefixCls, "-prefix"),
89
91
  onMouseDown: mouseDownHandle
90
92
  }, prefix) : null;
91
- var inputWrapperClasses = classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper"), true), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-focused"), focused && !disabled), _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-wrapper-size-")).call(_context, size), size), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-borderless"), borderType === 'none'), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-underline"), borderType === 'underline'), _defineProperty(_classNames2, "".concat(prefixCls, "-error"), status === 'error'), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-disabled"), disabled), _classNames2), _defineProperty({}, className, className && !addonBefore && !addonAfter));
93
+ var inputWrapperClasses = classNames(rtlCls, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper"), true), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-focused"), focused && !disabled), _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-wrapper-size-")).call(_context, size), size), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-borderless"), borderType === 'none'), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-underline"), borderType === 'underline'), _defineProperty(_classNames2, "".concat(prefixCls, "-error"), status === 'error'), _defineProperty(_classNames2, "".concat(prefixCls, "-wrapper-disabled"), disabled), _classNames2), _defineProperty({}, className, className && !addonBefore && !addonAfter));
92
94
  return React.createElement("span", {
93
95
  className: inputWrapperClasses,
94
96
  ref: fixRef,
@@ -112,7 +114,7 @@ var ClearableInput = function ClearableInput(props) {
112
114
  var addonAfterNode = addonAfter ? React.createElement("span", {
113
115
  className: addonClassName
114
116
  }, addonAfter) : null;
115
- var inputGroupClasses = classNames(className, (_classNames5 = {}, _defineProperty(_classNames5, "".concat(prefixCls, "-group"), true), _defineProperty(_classNames5, _concatInstanceProperty(_context2 = "".concat(prefixCls, "-group-size-")).call(_context2, size), size), _classNames5));
117
+ var inputGroupClasses = classNames(className, rtlCls, (_classNames5 = {}, _defineProperty(_classNames5, "".concat(prefixCls, "-group"), true), _defineProperty(_classNames5, _concatInstanceProperty(_context2 = "".concat(prefixCls, "-group-size-")).call(_context2, size), size), _classNames5));
116
118
  return React.createElement("span", {
117
119
  className: "".concat(prefixCls, "-group-wrapper")
118
120
  }, React.createElement("span", {
@@ -146,7 +148,7 @@ var ClearableInput = function ClearableInput(props) {
146
148
  delete wrapperStyle[key];
147
149
  }
148
150
  }
149
- var textAreaWrapperClasses = classNames(className, _defineProperty({}, "".concat(prefixCls, "-wrapper-textarea"), true));
151
+ var textAreaWrapperClasses = classNames(className, rtlCls, _defineProperty({}, "".concat(prefixCls, "-wrapper-textarea"), true));
150
152
  return React.createElement("span", {
151
153
  className: textAreaWrapperClasses,
152
154
  style: wrapperStyle,
@@ -27,7 +27,8 @@ var InternalTextarea = function InternalTextarea(props, ref) {
27
27
  var _useContext = useContext(ConfigContext),
28
28
  getPrefixCls = _useContext.getPrefixCls,
29
29
  prefixCls = _useContext.prefixCls,
30
- userDefaultProps = _useContext.compDefaultProps;
30
+ userDefaultProps = _useContext.compDefaultProps,
31
+ direction = _useContext.direction;
31
32
  var textAreaProps = getCompProps('TextArea', userDefaultProps, props);
32
33
  var _useState = useState({}),
33
34
  _useState2 = _slicedToArray(_useState, 2),
@@ -58,6 +59,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
58
59
  addonBefore = textAreaProps.addonBefore,
59
60
  others = __rest(textAreaProps, ["value", "allowClear", "borderType", "defaultValue", "count", "countPosition", "autoSize", "className", "prefixCls", "canResize", "maxLength", "disabled", "onBlur", "onFocus", "onChange", "placeholder", "style", "size", "status", "prefix", "suffix", "addonAfter", "addonBefore"]);
60
61
  var textAreaPrefixCls = getPrefixCls(prefixCls, 'input', customPrefixcls);
62
+ var rtlCls = direction === 'rtl' ? "".concat(textAreaPrefixCls, "-rtl") : null;
61
63
  devWarning(BorderTypes.indexOf(borderType) === -1, 'textarea', "cannot found textarea borderType '".concat(borderType, "'"));
62
64
  var _useMergedState = useMergedState('', {
63
65
  value: propsValue,
@@ -179,7 +181,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
179
181
  ref: textareaRef,
180
182
  disabled: disabled,
181
183
  style: _extends({}, textareaStyles, hadCount || !!allowClear ? otherStyles : style),
182
- className: classNames("".concat(prefixCls, "-textarea"), (_classNames2 = {}, _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), _defineProperty(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), _defineProperty(_classNames2, "".concat(prefixCls, "-error"), status === 'error' || numberMarkError), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), _defineProperty({}, className, className && !allowClear && !hadCount)),
184
+ className: classNames("".concat(prefixCls, "-textarea"), rtlCls, (_classNames2 = {}, _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), _defineProperty(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), _defineProperty(_classNames2, "".concat(prefixCls, "-error"), status === 'error' || numberMarkError), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), _defineProperty({}, className, className && !allowClear && !hadCount)),
183
185
  onChange: handleChange,
184
186
  onFocus: !disabled ? handleFocus : undefined,
185
187
  onBlur: !disabled ? handleBlur : undefined,
@@ -189,7 +191,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
189
191
  }, others));
190
192
  return hadCount ? React.createElement("span", {
191
193
  style: wrapperStyle,
192
- className: _concatInstanceProperty(_context2 = "".concat(prefixCls, "-countWrapper ")).call(_context2, className && !allowClear ? className : '')
194
+ className: classNames(rtlCls, _concatInstanceProperty(_context2 = "".concat(prefixCls, "-countWrapper ")).call(_context2, className && !allowClear ? className : ''))
193
195
  }, textarea, renderNumberMark()) : textarea;
194
196
  };
195
197
  return React.createElement(ClearableInput, _extends({}, textAreaProps, {
@@ -203,7 +205,8 @@ var InternalTextarea = function InternalTextarea(props, ref) {
203
205
  inputType: "text",
204
206
  prefixCls: textAreaPrefixCls,
205
207
  element: renderTextArea(textAreaPrefixCls),
206
- numberMark: renderNumberMark()
208
+ numberMark: renderNumberMark(),
209
+ direction: direction
207
210
  }));
208
211
  };
209
212
  var TextArea = React.forwardRef(InternalTextarea);
package/es/input/input.js CHANGED
@@ -32,7 +32,8 @@ var InternalInput = function InternalInput(props, ref) {
32
32
  var _useContext = useContext(ConfigContext),
33
33
  getPrefixCls = _useContext.getPrefixCls,
34
34
  prefixCls = _useContext.prefixCls,
35
- userDefaultProps = _useContext.compDefaultProps;
35
+ userDefaultProps = _useContext.compDefaultProps,
36
+ direction = _useContext.direction;
36
37
  var inputProps = getCompProps('Input', userDefaultProps, props);
37
38
  var type = inputProps.type,
38
39
  size = inputProps.size,
@@ -75,7 +76,8 @@ var InternalInput = function InternalInput(props, ref) {
75
76
  setShowNumberMark = _useState4[1];
76
77
  var inputRef = useRef();
77
78
  var inputPrefixCls = getPrefixCls(prefixCls, 'input', customPrefixcls);
78
- var inputClasses = classNames(inputPrefixCls, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(inputPrefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames, "".concat(inputPrefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames, "".concat(inputPrefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames, "".concat(inputPrefixCls, "-error"), status === 'error'), _defineProperty(_classNames, "".concat(inputPrefixCls, "-disabled"), disabled), _classNames), _defineProperty({}, className, className && !hasPrefixSuffix(inputProps) && !addonBefore && !addonAfter));
79
+ var rtlCls = direction === 'rtl' ? "".concat(inputPrefixCls, "-rtl") : null;
80
+ var inputClasses = classNames(inputPrefixCls, rtlCls, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(inputPrefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames, "".concat(inputPrefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames, "".concat(inputPrefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames, "".concat(inputPrefixCls, "-error"), status === 'error'), _defineProperty(_classNames, "".concat(inputPrefixCls, "-disabled"), disabled), _classNames), _defineProperty({}, className, className && !hasPrefixSuffix(inputProps) && !addonBefore && !addonAfter));
79
81
  var handleFocus = function handleFocus(event) {
80
82
  setFocused(true);
81
83
  onFocus && onFocus(event);
@@ -176,7 +178,8 @@ var InternalInput = function InternalInput(props, ref) {
176
178
  element: renderInput(),
177
179
  focused: focused,
178
180
  count: count,
179
- inputCount: renderCount()
181
+ inputCount: renderCount(),
182
+ direction: direction
180
183
  }));
181
184
  };
182
185
  var Input = React.forwardRef(InternalInput);
@@ -632,3 +632,51 @@ textarea {
632
632
  .kd-input-error:not(.kd-input-disabled):not(.kd-input-wrapper-disabled):not( .kd-input-group-addon-disabled) {
633
633
  border-color: var(--kd-c-input-color-error, var(--kd-g-color-error, #fb2323));
634
634
  }
635
+ .kd-input-rtl {
636
+ direction: rtl;
637
+ }
638
+ .kd-input-rtl.kd-input-group .kd-input-group-addon:first-child {
639
+ border-top-left-radius: 0;
640
+ border-bottom-left-radius: 0;
641
+ border-top-right-radius: var(--kd-c-input-radius-border, var(--kd-g-radius-border, 2px));
642
+ border-bottom-right-radius: var(--kd-c-input-radius-border, var(--kd-g-radius-border, 2px));
643
+ border-left: none;
644
+ border-right: 1px solid var(--kd-c-input-color-border-disabled, var(--kd-g-color-border-strong, #d9d9d9));
645
+ }
646
+ .kd-input-rtl.kd-input-group .kd-input-group-addon:last-child {
647
+ border-top-right-radius: 0;
648
+ border-bottom-right-radius: 0;
649
+ border-top-left-radius: var(--kd-c-input-radius-border, var(--kd-g-radius-border, 2px));
650
+ border-bottom-left-radius: var(--kd-c-input-radius-border, var(--kd-g-radius-border, 2px));
651
+ border-right: none;
652
+ border-left: 1px solid var(--kd-c-input-color-border-disabled, var(--kd-g-color-border-strong, #d9d9d9));
653
+ }
654
+ .kd-input-rtl.kd-input-wrapper .kd-input-prefix {
655
+ margin-right: 0;
656
+ margin-left: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
657
+ }
658
+ .kd-input-rtl.kd-input-wrapper .kd-input-suffix {
659
+ margin-left: 0;
660
+ margin-right: calc(var(--kd-c-input-spacing-padding-vertical-small, 3px) * 2);
661
+ }
662
+ .kd-input-rtl.kd-input-wrapper .kd-input-clear-icon-rightSpace {
663
+ margin-left: 4px;
664
+ margin-right: 0;
665
+ }
666
+ .kd-input-rtl .kd-input-textarea-mark {
667
+ right: auto;
668
+ left: 2px;
669
+ }
670
+ .kd-input-rtl .kd-input-textarea-mark-inner {
671
+ top: auto;
672
+ left: 8px;
673
+ right: auto;
674
+ }
675
+ .kd-input-rtl .kd-input-textarea-clear-icon {
676
+ left: 8px;
677
+ right: auto;
678
+ }
679
+ .kd-input-rtl.kd-input-allowClear-spacing {
680
+ padding-right: var(--kd-c-input-spacing-padding-horizontal-small, 9px);
681
+ padding-left: 20px;
682
+ }
@@ -313,3 +313,58 @@ textarea {
313
313
  border-color: @input-error-color;
314
314
  }
315
315
  }
316
+
317
+ .@{input-prefix-cls}-rtl {
318
+ direction: rtl;
319
+ &.@{input-prefix-cls}-group {
320
+ .@{input-prefix-cls}-group-addon {
321
+ &:first-child {
322
+ border-top-left-radius: 0;
323
+ border-bottom-left-radius: 0;
324
+ border-top-right-radius: @input-border-radius-inner;
325
+ border-bottom-right-radius: @input-border-radius-inner;
326
+ border-left: none;
327
+ border-right: 1px solid @input-border-color-disabled-inner;
328
+ }
329
+ &:last-child {
330
+ border-top-right-radius: 0;
331
+ border-bottom-right-radius: 0;
332
+ border-top-left-radius: @input-border-radius-inner;
333
+ border-bottom-left-radius: @input-border-radius-inner;
334
+ border-right: none;
335
+ border-left: 1px solid @input-border-color-disabled-inner;
336
+ }
337
+ }
338
+ }
339
+ &.@{input-prefix-cls}-wrapper {
340
+ .@{input-prefix-cls}-prefix {
341
+ margin-right: 0;
342
+ margin-left: calc(@input-small-padding-vertical-inner * 2);
343
+ }
344
+ .@{input-prefix-cls}-suffix {
345
+ margin-left: 0;
346
+ margin-right: calc(@input-small-padding-vertical-inner * 2);
347
+ }
348
+ .@{input-prefix-cls}-clear-icon-rightSpace {
349
+ margin-left: 4px;
350
+ margin-right: 0;
351
+ }
352
+ }
353
+ .@{input-prefix-cls}-textarea-mark {
354
+ right: auto;
355
+ left: 2px;
356
+ &-inner {
357
+ top: auto;
358
+ left: 8px;
359
+ right: auto;
360
+ }
361
+ }
362
+ .@{input-prefix-cls}-textarea-clear-icon {
363
+ left: 8px;
364
+ right: auto;
365
+ }
366
+ &.@{input-prefix-cls}-allowClear-spacing {
367
+ padding-right: @input-small-padding-horizontal-inner;
368
+ padding-left: 20px;
369
+ }
370
+ }
package/es/link/link.js CHANGED
@@ -21,7 +21,8 @@ var InternalLink = function InternalLink(props, ref) {
21
21
  var _useContext = useContext(ConfigContext),
22
22
  getPrefixCls = _useContext.getPrefixCls,
23
23
  prefixCls = _useContext.prefixCls,
24
- userDefaultProps = _useContext.compDefaultProps;
24
+ userDefaultProps = _useContext.compDefaultProps,
25
+ direction = _useContext.direction;
25
26
  var linkProps = getCompProps('Link', userDefaultProps, props);
26
27
  var size = linkProps.size,
27
28
  style = linkProps.style,
@@ -38,7 +39,8 @@ var InternalLink = function InternalLink(props, ref) {
38
39
  others = __rest(linkProps, ["size", "style", "className", "target", "href", "underscore", "children", "prefix", "suffix", "disabled", "onClick", "prefixCls"]);
39
40
  var linkRef = ref || React.createRef();
40
41
  var linkPrefixCls = getPrefixCls(prefixCls, 'link', customPrefixcls);
41
- var wrapperClasses = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(linkPrefixCls), true), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(linkPrefixCls, "-size-")).call(_context, size), size), _classNames));
42
+ var rtlCls = direction === 'rtl' ? "".concat(linkPrefixCls, "-rtl") : null;
43
+ var wrapperClasses = classNames(rtlCls, (_classNames = {}, _defineProperty(_classNames, "".concat(linkPrefixCls), true), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(linkPrefixCls, "-size-")).call(_context, size), size), _classNames));
42
44
  var linkClasses = classNames(className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(linkPrefixCls, "-text"), true), _defineProperty(_classNames2, "".concat(linkPrefixCls, "-underscore"), underscore), _defineProperty(_classNames2, "".concat(linkPrefixCls, "-disabled"), disabled), _classNames2));
43
45
  var handleClick = function handleClick(e) {
44
46
  disabled && e.preventDefault();
@@ -155,3 +155,14 @@
155
155
  display: inline-block;
156
156
  margin-left: var(--kd-c-link-suffix-horizontal, 4px);
157
157
  }
158
+ .kd-link-rtl {
159
+ direction: rtl;
160
+ }
161
+ .kd-link-rtl .kd-link-prefix {
162
+ margin-right: 0;
163
+ margin-left: var(--kd-c-link-prefix-horizontal, 4px);
164
+ }
165
+ .kd-link-rtl .kd-link-suffix {
166
+ margin-left: 0;
167
+ margin-right: var(--kd-c-link-suffix-horizontal, 4px);
168
+ }
@@ -59,3 +59,17 @@
59
59
  margin-left: @link-suffix-horizontal;
60
60
  }
61
61
  }
62
+
63
+ .@{link-prefix-cls}-rtl {
64
+ direction: rtl;
65
+ .@{link-prefix-cls} {
66
+ &-prefix {
67
+ margin-right: 0;
68
+ margin-left: @link-prefix-horizontal;
69
+ }
70
+ &-suffix {
71
+ margin-left: 0;
72
+ margin-right: @link-suffix-horizontal;
73
+ }
74
+ }
75
+ }
package/es/menu/menu.js CHANGED
@@ -32,7 +32,8 @@ var Menu = function Menu(props) {
32
32
  var _useContext = useContext(ConfigContext),
33
33
  getPrefixCls = _useContext.getPrefixCls,
34
34
  pkgPrefixCls = _useContext.prefixCls,
35
- userDefaultProps = _useContext.compDefaultProps;
35
+ userDefaultProps = _useContext.compDefaultProps,
36
+ direction = _useContext.direction;
36
37
  var userSelectedKey = props.selectedKey,
37
38
  userOpenKeys = props.openKeys;
38
39
  var _b = getCompProps('Menu', userDefaultProps, props),
@@ -51,6 +52,7 @@ var Menu = function Menu(props) {
51
52
  defaultOpenKeys = _b.defaultOpenKeys,
52
53
  restProps = __rest(_b, ["prefixCls", "mode", "inlineIndent", "forceSubMenuRender", "additionalTools", "onClick", "onOpenChange", "children", "className", "theme", "collapsed", "accordion", "defaultOpenKeys"]);
53
54
  var prefixCls = getPrefixCls(pkgPrefixCls, 'menu', customPrefixcls);
55
+ var rtlCls = direction === 'rtl' ? "".concat(prefixCls, "-rtl") : null;
54
56
  devWarning(['inline', 'vertical', undefined].indexOf(mode) === -1, 'menu', "cannot found menu mode '".concat(mode, "'"));
55
57
  devWarning(mode !== 'inline' && accordion !== undefined, 'menu', "'accordion' is valid only in mode='inline'");
56
58
  var _useState = useState(''),
@@ -169,7 +171,7 @@ var Menu = function Menu(props) {
169
171
  onMouseEnter: handleMouseEnterMenu
170
172
  };
171
173
  return React.createElement("div", _extends({
172
- className: classNames(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-inline"), mode === 'inline'), _defineProperty(_classNames, "".concat(prefixCls, "-vertical"), mode !== 'inline'), _defineProperty(_classNames, "".concat(prefixCls, "-collapsed"), collapsed), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(prefixCls, "-")).call(_context2, theme === 'light' ? 'light' : 'dark'), true), _classNames)),
174
+ className: classNames(prefixCls, rtlCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-inline"), mode === 'inline'), _defineProperty(_classNames, "".concat(prefixCls, "-vertical"), mode !== 'inline'), _defineProperty(_classNames, "".concat(prefixCls, "-collapsed"), collapsed), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(prefixCls, "-")).call(_context2, theme === 'light' ? 'light' : 'dark'), true), _classNames)),
173
175
  role: "menu",
174
176
  style: style
175
177
  }, mouseEvent), children && renderMenu(), additionalTools);
@@ -23,7 +23,8 @@ var InternalMenuItem = function InternalMenuItem(props, ref) {
23
23
  var _React$useContext = React.useContext(ConfigContext),
24
24
  getPrefixCls = _React$useContext.getPrefixCls,
25
25
  pkgPrefixCls = _React$useContext.prefixCls,
26
- userDefaultProps = _React$useContext.compDefaultProps;
26
+ userDefaultProps = _React$useContext.compDefaultProps,
27
+ direction = _React$useContext.direction;
27
28
  var _a = getCompProps('MenuItem', userDefaultProps, props),
28
29
  customPrefixcls = _a.prefixCls,
29
30
  icon = _a.icon,
@@ -97,9 +98,10 @@ var InternalMenuItem = function InternalMenuItem(props, ref) {
97
98
  onMouseLeave: handleOnMouseLeave,
98
99
  onMouseEnter: handleOnMouseEnter
99
100
  };
101
+ var isRtl = direction === 'rtl';
100
102
  var titleStyle = {
101
- paddingLeft: "".concat(getPaddingLeft(), "px"),
102
- paddingRight: mode !== 'inline' && level > 1 ? "".concat(DEFAUTL_PADDING, "px") : 0
103
+ paddingLeft: isRtl ? mode !== 'inline' && level > 1 ? "".concat(DEFAUTL_PADDING, "px") : 0 : "".concat(getPaddingLeft(), "px"),
104
+ paddingRight: isRtl ? "".concat(getPaddingLeft(), "px") : mode !== 'inline' && level > 1 ? "".concat(DEFAUTL_PADDING, "px") : 0
103
105
  };
104
106
  var renderTitle = function renderTitle() {
105
107
  if (!icon && collapsed && level === 1 && typeof children === 'string') {
@@ -627,3 +627,13 @@
627
627
  color: var(--kd-c-menu-light-color-text-active, var(--kd-g-color-theme, #5582f3));
628
628
  border: none;
629
629
  }
630
+ .kd-menu-rtl {
631
+ direction: rtl;
632
+ }
633
+ .kd-menu-rtl .kd-menu-submenu {
634
+ direction: rtl;
635
+ }
636
+ .kd-menu-rtl .kd-menu-submenu .kd-menu-submenu-title .kd-menu-submenu-arrow {
637
+ margin-left: 0;
638
+ margin-right: auto;
639
+ }