@kdcloudjs/kdesign 1.8.29 → 1.8.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kdesign-complete.less +897 -83
- package/dist/kdesign.css +650 -7
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +188 -109
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +3 -3
- package/dist/kdesign.min.js +5 -5
- package/dist/kdesign.min.js.map +1 -1
- package/es/anchor/anchor.js +7 -5
- package/es/anchor/style/index.css +14 -0
- package/es/anchor/style/index.less +15 -0
- package/es/button/button.js +4 -2
- package/es/button/group.js +5 -3
- package/es/button/style/index.css +32 -0
- package/es/button/style/index.less +42 -1
- package/es/checkbox/checkbox.js +5 -3
- package/es/checkbox/group.js +4 -2
- package/es/checkbox/style/index.css +38 -1
- package/es/checkbox/style/index.less +56 -15
- package/es/city-picker/city-picker.js +32 -14
- package/es/city-picker/option.js +7 -2
- package/es/city-picker/style/index.css +54 -0
- package/es/city-picker/style/index.less +67 -0
- package/es/collapse/collapse.js +4 -2
- package/es/collapse/style/index.css +24 -0
- package/es/collapse/style/index.less +26 -0
- package/es/color-picker/color-picker.js +6 -4
- package/es/color-picker/style/index.css +129 -4
- package/es/color-picker/style/index.less +174 -29
- package/es/config-provider/ConfigContext.d.ts +4 -0
- package/es/config-provider/ConfigContext.js +2 -0
- package/es/config-provider/compDefaultProps.d.ts +0 -1
- package/es/config-provider/compDefaultProps.js +0 -5
- package/es/config-provider/defaultConfig.d.ts +1 -0
- package/es/config-provider/defaultConfig.js +2 -1
- package/es/dropdown/dropdown.js +4 -2
- package/es/dropdown/menu.js +4 -2
- package/es/dropdown/style/index.css +3 -0
- package/es/dropdown/style/index.less +4 -0
- package/es/image/preview.js +6 -4
- package/es/image/style/index.css +11 -0
- package/es/image/style/index.less +20 -4
- package/es/input/ClearableLabeledInput.d.ts +1 -0
- package/es/input/ClearableLabeledInput.js +6 -4
- package/es/input/TextArea.js +7 -4
- package/es/input/input.js +6 -3
- package/es/input/style/index.css +48 -0
- package/es/input/style/index.less +55 -0
- package/es/link/link.js +4 -2
- package/es/link/style/index.css +11 -0
- package/es/link/style/index.less +14 -0
- package/es/menu/menu.js +4 -2
- package/es/menu/menuItem.js +5 -3
- package/es/menu/style/index.css +10 -0
- package/es/menu/style/index.less +33 -22
- package/es/menu/subMenu.js +6 -4
- package/es/modal/modal.js +4 -2
- package/es/modal/style/index.css +7 -0
- package/es/modal/style/index.less +14 -0
- package/es/pagination/pagination.js +16 -13
- package/es/pagination/style/index.css +72 -0
- package/es/pagination/style/index.less +99 -0
- package/es/qr-code/qr-code.js +4 -2
- package/es/qr-code/style/index.css +3 -0
- package/es/qr-code/style/index.less +7 -3
- package/es/radio/group.js +4 -2
- package/es/radio/radio.js +4 -2
- package/es/radio/style/index.css +38 -0
- package/es/radio/style/index.less +46 -0
- package/es/select/option.js +4 -2
- package/es/select/select.js +8 -6
- package/es/select/style/index.css +61 -0
- package/es/select/style/index.less +87 -0
- package/es/steps/Steps.js +4 -2
- package/es/steps/style/index.css +35 -0
- package/es/steps/style/index.less +59 -5
- package/es/switch/style/index.css +9 -0
- package/es/switch/style/index.less +9 -2
- package/es/switch/switch.js +4 -2
- package/es/tag/style/index.css +7 -0
- package/es/tag/style/index.less +8 -0
- package/es/tag/tag.js +4 -2
- package/es/tree/style/index.css +19 -0
- package/es/tree/style/index.less +27 -0
- package/es/tree/tree.js +4 -2
- package/es/tree/treeNode.js +3 -2
- package/es/upload/style/index.css +24 -1
- package/es/upload/style/index.less +40 -2
- package/es/upload/upload.js +4 -2
- package/lib/anchor/anchor.js +7 -5
- package/lib/anchor/style/index.css +14 -0
- package/lib/anchor/style/index.less +15 -0
- package/lib/button/button.js +4 -2
- package/lib/button/group.js +5 -3
- package/lib/button/style/index.css +32 -0
- package/lib/button/style/index.less +42 -1
- package/lib/checkbox/checkbox.js +5 -3
- package/lib/checkbox/group.js +4 -2
- package/lib/checkbox/style/index.css +38 -1
- package/lib/checkbox/style/index.less +56 -15
- package/lib/city-picker/city-picker.js +32 -14
- package/lib/city-picker/option.js +7 -2
- package/lib/city-picker/style/index.css +54 -0
- package/lib/city-picker/style/index.less +67 -0
- package/lib/collapse/collapse.js +4 -2
- package/lib/collapse/style/index.css +24 -0
- package/lib/collapse/style/index.less +26 -0
- package/lib/color-picker/color-picker.js +6 -4
- package/lib/color-picker/style/index.css +129 -4
- package/lib/color-picker/style/index.less +174 -29
- package/lib/config-provider/ConfigContext.d.ts +4 -0
- package/lib/config-provider/ConfigContext.js +4 -1
- package/lib/config-provider/compDefaultProps.d.ts +0 -1
- package/lib/config-provider/compDefaultProps.js +0 -5
- package/lib/config-provider/defaultConfig.d.ts +1 -0
- package/lib/config-provider/defaultConfig.js +2 -1
- package/lib/dropdown/dropdown.js +4 -2
- package/lib/dropdown/menu.js +4 -2
- package/lib/dropdown/style/index.css +3 -0
- package/lib/dropdown/style/index.less +4 -0
- package/lib/image/preview.js +6 -4
- package/lib/image/style/index.css +11 -0
- package/lib/image/style/index.less +20 -4
- package/lib/input/ClearableLabeledInput.d.ts +1 -0
- package/lib/input/ClearableLabeledInput.js +6 -4
- package/lib/input/TextArea.js +7 -4
- package/lib/input/input.js +6 -3
- package/lib/input/style/index.css +48 -0
- package/lib/input/style/index.less +55 -0
- package/lib/link/link.js +4 -2
- package/lib/link/style/index.css +11 -0
- package/lib/link/style/index.less +14 -0
- package/lib/menu/menu.js +4 -2
- package/lib/menu/menuItem.js +5 -3
- package/lib/menu/style/index.css +10 -0
- package/lib/menu/style/index.less +33 -22
- package/lib/menu/subMenu.js +6 -4
- package/lib/modal/modal.js +4 -2
- package/lib/modal/style/index.css +7 -0
- package/lib/modal/style/index.less +14 -0
- package/lib/pagination/pagination.js +16 -13
- package/lib/pagination/style/index.css +72 -0
- package/lib/pagination/style/index.less +99 -0
- package/lib/qr-code/qr-code.js +4 -2
- package/lib/qr-code/style/index.css +3 -0
- package/lib/qr-code/style/index.less +7 -3
- package/lib/radio/group.js +4 -2
- package/lib/radio/radio.js +4 -2
- package/lib/radio/style/index.css +38 -0
- package/lib/radio/style/index.less +46 -0
- package/lib/select/option.js +4 -2
- package/lib/select/select.js +8 -6
- package/lib/select/style/index.css +61 -0
- package/lib/select/style/index.less +87 -0
- package/lib/steps/Steps.js +4 -2
- package/lib/steps/style/index.css +35 -0
- package/lib/steps/style/index.less +59 -5
- package/lib/switch/style/index.css +9 -0
- package/lib/switch/style/index.less +9 -2
- package/lib/switch/switch.js +4 -2
- package/lib/tag/style/index.css +7 -0
- package/lib/tag/style/index.less +8 -0
- package/lib/tag/tag.js +4 -2
- package/lib/tree/style/index.css +19 -0
- package/lib/tree/style/index.less +27 -0
- package/lib/tree/tree.js +4 -2
- package/lib/tree/treeNode.js +3 -2
- package/lib/upload/style/index.css +24 -1
- package/lib/upload/style/index.less +40 -2
- package/lib/upload/upload.js +4 -2
- package/package.json +1 -1
package/es/anchor/anchor.js
CHANGED
|
@@ -105,7 +105,8 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
105
105
|
var _useContext = useContext(ConfigContext),
|
|
106
106
|
getPrefixCls = _useContext.getPrefixCls,
|
|
107
107
|
prefixCls = _useContext.prefixCls,
|
|
108
|
-
userDefaultProps = _useContext.compDefaultProps
|
|
108
|
+
userDefaultProps = _useContext.compDefaultProps,
|
|
109
|
+
direction = _useContext.direction;
|
|
109
110
|
var anchorProps = getCompProps('Anchor', userDefaultProps, props);
|
|
110
111
|
var customPrefixcls = anchorProps.prefixCls,
|
|
111
112
|
className = anchorProps.className,
|
|
@@ -128,6 +129,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
128
129
|
dropdownStyle = anchorProps.dropdownStyle,
|
|
129
130
|
onVisibleChange = anchorProps.onVisibleChange;
|
|
130
131
|
var anchorPrefixCls = getPrefixCls(prefixCls, 'anchor', customPrefixcls);
|
|
132
|
+
var rtlCls = direction === 'rtl' ? "".concat(anchorPrefixCls, "-rtl") : null;
|
|
131
133
|
devWarning(AnchorTypes.indexOf(type) === -1, 'anchor', "cannot found anchor type '".concat(type, "'"));
|
|
132
134
|
var _useState = useState(null),
|
|
133
135
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -179,7 +181,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
179
181
|
var anchorRef = ref || normalRef;
|
|
180
182
|
var linksWidthRef = React.useRef([]);
|
|
181
183
|
var animating = React.useRef(false);
|
|
182
|
-
var wrapperClass = classNames(className, _defineProperty({}, "".concat(anchorPrefixCls, "-wrapper"), true));
|
|
184
|
+
var wrapperClass = classNames(className, rtlCls, _defineProperty({}, "".concat(anchorPrefixCls, "-wrapper"), true));
|
|
183
185
|
var anchorMenuClass = classNames(_defineProperty({}, "".concat(anchorPrefixCls, "-menu"), true));
|
|
184
186
|
var anchorAdvancedClass = classNames(_defineProperty({}, "".concat(anchorPrefixCls, "-advanced"), true));
|
|
185
187
|
var inkClass = classNames("".concat(anchorPrefixCls, "-line-slider"), {
|
|
@@ -418,7 +420,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
418
420
|
className: leftClasses,
|
|
419
421
|
onClick: handleLeft
|
|
420
422
|
}, React.createElement(Icon, {
|
|
421
|
-
type: "arrow-left
|
|
423
|
+
type: "".concat(direction === 'rtl' ? 'arrow-right' : 'arrow-left')
|
|
422
424
|
}));
|
|
423
425
|
};
|
|
424
426
|
var findCurrentLinkPosition = function findCurrentLinkPosition(linksWidth, boxWidth, position) {
|
|
@@ -448,12 +450,12 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
448
450
|
className: rightClasses,
|
|
449
451
|
onClick: handleRight
|
|
450
452
|
}, React.createElement(Icon, {
|
|
451
|
-
type: "arrow-right
|
|
453
|
+
type: "".concat(direction === 'rtl' ? 'arrow-left' : 'arrow-right')
|
|
452
454
|
}));
|
|
453
455
|
};
|
|
454
456
|
var anchorMenuContent = React.createElement("div", {
|
|
455
457
|
ref: anchorRef,
|
|
456
|
-
className: "".concat(anchorPrefixCls, "-menu-wrapper"),
|
|
458
|
+
className: classNames("".concat(anchorPrefixCls, "-menu-wrapper"), rtlCls),
|
|
457
459
|
style: _extends({
|
|
458
460
|
width: '100%'
|
|
459
461
|
}, 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
|
+
}
|
package/es/button/button.js
CHANGED
|
@@ -27,7 +27,8 @@ var InternalButton = function InternalButton(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 buttonProps = getCompProps('Button', userDefaultProps, props);
|
|
32
33
|
var type = buttonProps.type,
|
|
33
34
|
iconPlace = buttonProps.iconPlace,
|
|
@@ -48,6 +49,7 @@ var InternalButton = function InternalButton(props, ref) {
|
|
|
48
49
|
others = __rest(buttonProps, ["type", "iconPlace", "children", "className", "prefixCls", "size", "loading", "shape", "bordered", "onClick", "icon", "ghost", "block", "disabled", "htmlType"]);
|
|
49
50
|
devWarning(ButtonTypes.indexOf(type) === -1, 'button', "cannot found button type '".concat(type, "'"));
|
|
50
51
|
var btnPrefixCls = getPrefixCls(prefixCls, 'btn', customPrefixcls);
|
|
52
|
+
var rtlCls = direction === 'rtl' ? "".concat(btnPrefixCls, "-rtl") : null;
|
|
51
53
|
var handleClick = function handleClick(e) {
|
|
52
54
|
if (loading || disabled) {
|
|
53
55
|
return;
|
|
@@ -77,7 +79,7 @@ var InternalButton = function InternalButton(props, ref) {
|
|
|
77
79
|
return child;
|
|
78
80
|
};
|
|
79
81
|
var isTextBtn = type === 'text';
|
|
80
|
-
var btnClasses = classNames(btnPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(btnPrefixCls, "-")).call(_context, type), type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(btnPrefixCls, "-size-")).call(_context2, size), size), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(btnPrefixCls, "-shape-")).call(_context3, shape), shape && !isTextBtn), _defineProperty(_classNames, "".concat(btnPrefixCls, "-no-border"), !bordered), _defineProperty(_classNames, "".concat(btnPrefixCls, "-background-ghost"), ghost && !disabled), _defineProperty(_classNames, "".concat(btnPrefixCls, "-loading"), loading && !isTextBtn), _defineProperty(_classNames, "".concat(btnPrefixCls, "-block"), block && !shape), _defineProperty(_classNames, "".concat(btnPrefixCls, "-icon-only"), !children && children !== 0 && icon), _classNames));
|
|
82
|
+
var btnClasses = classNames(btnPrefixCls, rtlCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(btnPrefixCls, "-")).call(_context, type), type), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(btnPrefixCls, "-size-")).call(_context2, size), size), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(btnPrefixCls, "-shape-")).call(_context3, shape), shape && !isTextBtn), _defineProperty(_classNames, "".concat(btnPrefixCls, "-no-border"), !bordered), _defineProperty(_classNames, "".concat(btnPrefixCls, "-background-ghost"), ghost && !disabled), _defineProperty(_classNames, "".concat(btnPrefixCls, "-loading"), loading && !isTextBtn), _defineProperty(_classNames, "".concat(btnPrefixCls, "-block"), block && !shape), _defineProperty(_classNames, "".concat(btnPrefixCls, "-icon-only"), !children && children !== 0 && icon), _classNames));
|
|
81
83
|
var iconWrapperClassName = _concatInstanceProperty(_context4 = "".concat(btnPrefixCls, "-iconWrapper-")).call(_context4, iconPlace === 'left' ? 'left' : 'right');
|
|
82
84
|
var iconNode = icon && !loading ? React.createElement("span", {
|
|
83
85
|
className: iconWrapperClassName
|
package/es/button/group.js
CHANGED
|
@@ -17,7 +17,8 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
|
|
|
17
17
|
var _useContext = useContext(ConfigContext),
|
|
18
18
|
getPrefixCls = _useContext.getPrefixCls,
|
|
19
19
|
prefixCls = _useContext.prefixCls,
|
|
20
|
-
userDefaultProps = _useContext.compDefaultProps
|
|
20
|
+
userDefaultProps = _useContext.compDefaultProps,
|
|
21
|
+
direction = _useContext.direction;
|
|
21
22
|
var buttonGoupProps = getCompProps('ButtonGroup', userDefaultProps, props);
|
|
22
23
|
var style = buttonGoupProps.style,
|
|
23
24
|
className = buttonGoupProps.className,
|
|
@@ -41,6 +42,7 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
|
|
|
41
42
|
var triggerRef = React.useRef(null);
|
|
42
43
|
var isBsicType = type === 'basic';
|
|
43
44
|
var btnGroupPrefixCls = getPrefixCls(prefixCls, 'btn-group', customPrefixcls);
|
|
45
|
+
var rtlCls = direction === 'rtl' ? "".concat(btnGroupPrefixCls, "-rtl") : null;
|
|
44
46
|
var btnGroupClasses = classNames("".concat(btnGroupPrefixCls), className, _defineProperty({}, _concatInstanceProperty(_context = "".concat(btnGroupPrefixCls, "-")).call(_context, type), type));
|
|
45
47
|
var renderTriggerButton = useCallback(function () {
|
|
46
48
|
var _toArray = toArray(icon),
|
|
@@ -108,11 +110,11 @@ var InternalButtonGroup = function InternalButtonGroup(props, ref) {
|
|
|
108
110
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(visible);
|
|
109
111
|
};
|
|
110
112
|
var popperProps = _extends(_extends({
|
|
111
|
-
placement: 'bottomLeft',
|
|
113
|
+
placement: direction === 'rtl' ? 'bottomRight' : 'bottomLeft',
|
|
112
114
|
trigger: 'click',
|
|
113
115
|
gap: 0
|
|
114
116
|
}, buttonGoupProps), {
|
|
115
|
-
prefixCls: btnGroupPrefixCls,
|
|
117
|
+
prefixCls: classNames(btnGroupPrefixCls, rtlCls),
|
|
116
118
|
defaultVisible: optionShow,
|
|
117
119
|
visible: optionShow,
|
|
118
120
|
onVisibleChange: handleVisibleChange,
|
|
@@ -462,3 +462,35 @@
|
|
|
462
462
|
-webkit-transition: all calc(0.3s - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
|
|
463
463
|
transition: all calc(0.3s - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
|
|
464
464
|
}
|
|
465
|
+
.kd-btn-rtl {
|
|
466
|
+
direction: rtl;
|
|
467
|
+
}
|
|
468
|
+
.kd-btn-rtl .kd-btn-iconWrapper-left {
|
|
469
|
+
float: right;
|
|
470
|
+
margin-left: 4px;
|
|
471
|
+
}
|
|
472
|
+
.kd-btn-rtl .kd-btn-iconWrapper-right {
|
|
473
|
+
float: left;
|
|
474
|
+
margin-right: 4px;
|
|
475
|
+
}
|
|
476
|
+
.kd-btn-rtl .kd-btn-group-basic-icon {
|
|
477
|
+
margin-right: 5px;
|
|
478
|
+
margin-left: 0;
|
|
479
|
+
}
|
|
480
|
+
.kd-btn-rtl .btn-space {
|
|
481
|
+
margin-left: 0;
|
|
482
|
+
}
|
|
483
|
+
.kd-btn-rtl-similar .kd-btn-group-trigger .kd-btn {
|
|
484
|
+
border-top-left-radius: var(--kd-c-button-radius-border, var(--kd-g-radius-border, 2px));
|
|
485
|
+
border-bottom-left-radius: var(--kd-c-button-radius-border, var(--kd-g-radius-border, 2px));
|
|
486
|
+
border-top-right-radius: 0;
|
|
487
|
+
border-bottom-right-radius: 0;
|
|
488
|
+
margin-right: -1px;
|
|
489
|
+
}
|
|
490
|
+
.kd-btn-rtl-similar > .kd-btn:first-child {
|
|
491
|
+
border-top-right-radius: var(--kd-c-button-radius-border, var(--kd-g-radius-border, 2px));
|
|
492
|
+
border-bottom-right-radius: var(--kd-c-button-radius-border, var(--kd-g-radius-border, 2px));
|
|
493
|
+
}
|
|
494
|
+
.kd-btn-group-rtl {
|
|
495
|
+
direction: rtl;
|
|
496
|
+
}
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
& > .@{btn-prefix-cls} {
|
|
302
302
|
&:first-child {
|
|
303
303
|
border-top-right-radius: 0;
|
|
304
304
|
border-bottom-right-radius: 0;
|
|
@@ -353,3 +353,44 @@
|
|
|
353
353
|
transition: all calc(@transition-duration - 0.1s) @ease;
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
|
+
.@{btn-prefix-cls}-rtl {
|
|
357
|
+
direction: rtl;
|
|
358
|
+
.@{btn-prefix-cls}-iconWrapper-left {
|
|
359
|
+
float: right;
|
|
360
|
+
margin-left: 4px;
|
|
361
|
+
}
|
|
362
|
+
.@{btn-prefix-cls}-iconWrapper-right {
|
|
363
|
+
float: left;
|
|
364
|
+
margin-right: 4px;
|
|
365
|
+
}
|
|
366
|
+
.@{btn-prefix-cls}-group-basic {
|
|
367
|
+
&-icon {
|
|
368
|
+
margin-right: 5px;
|
|
369
|
+
margin-left: 0;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
.btn-space {
|
|
373
|
+
margin-left: 0;
|
|
374
|
+
}
|
|
375
|
+
&-similar {
|
|
376
|
+
.@{btn-prefix-cls}-group-trigger {
|
|
377
|
+
.@{btn-prefix-cls} {
|
|
378
|
+
border-top-left-radius: @btn-g-radius-border;
|
|
379
|
+
border-bottom-left-radius: @btn-g-radius-border;
|
|
380
|
+
border-top-right-radius: 0;
|
|
381
|
+
border-bottom-right-radius: 0;
|
|
382
|
+
margin-right: -1px;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
& > .@{btn-prefix-cls} {
|
|
386
|
+
&:first-child {
|
|
387
|
+
border-top-right-radius: @btn-g-radius-border;
|
|
388
|
+
border-bottom-right-radius: @btn-g-radius-border;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.@{btn-prefix-cls}-group-rtl {
|
|
395
|
+
direction: rtl;
|
|
396
|
+
}
|
package/es/checkbox/checkbox.js
CHANGED
|
@@ -24,7 +24,8 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
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 CheckboxProps = getCompProps('Checkbox', userDefaultProps, props);
|
|
29
30
|
var checkboxType = CheckboxProps.checkboxType,
|
|
30
31
|
className = CheckboxProps.className,
|
|
@@ -63,8 +64,9 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
63
64
|
var getIndeterminate = function getIndeterminate() {
|
|
64
65
|
return selected ? false : indeterminate;
|
|
65
66
|
};
|
|
66
|
-
var
|
|
67
|
-
var
|
|
67
|
+
var rtlCls = direction === 'rtl' ? "".concat(checkboxPrefixCls, "-rtl") : null;
|
|
68
|
+
var getDefaultClassName = classNames(className, rtlCls, (_classNames = {}, _defineProperty(_classNames, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames, "".concat(checkboxPrefixCls, "-no-child"), !children), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(checkboxPrefixCls, "-")).call(_context, mergedSize), !!children), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(checkboxPrefixCls, "-")).call(_context2, mergedCheckboxType), true), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(checkboxPrefixCls, "-")).call(_context3, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames, "checked", selected), _classNames));
|
|
69
|
+
var getSquareClassName = classNames(className, rtlCls, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames2, _concatInstanceProperty(_context4 = "".concat(checkboxPrefixCls, "-")).call(_context4, mergedCheckboxType), true), _defineProperty(_classNames2, _concatInstanceProperty(_context5 = "".concat(checkboxPrefixCls, "-")).call(_context5, mergedSize), !!children), _defineProperty(_classNames2, _concatInstanceProperty(_context6 = "".concat(checkboxPrefixCls, "-")).call(_context6, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames2, _concatInstanceProperty(_context7 = "".concat(checkboxPrefixCls, "-")).call(_context7, mergedCheckboxType, "-checked"), selected && !mergedDisabled), _defineProperty(_classNames2, "checked", selected), _classNames2));
|
|
68
70
|
var getRootClassName = isDefaultType() ? getDefaultClassName : getSquareClassName;
|
|
69
71
|
var inputClassName = classNames(_defineProperty({}, "".concat(checkboxPrefixCls, "-input"), true));
|
|
70
72
|
var checkedWrapperClassName = classNames((_classNames4 = {}, _defineProperty(_classNames4, _concatInstanceProperty(_context8 = "".concat(checkboxPrefixCls, "-")).call(_context8, mergedCheckboxType, "-wrapper"), true), _defineProperty(_classNames4, _concatInstanceProperty(_context9 = "".concat(checkboxPrefixCls, "-")).call(_context9, mergedCheckboxType, "-wrapper-size"), true), _defineProperty(_classNames4, _concatInstanceProperty(_context10 = "".concat(checkboxPrefixCls, "-")).call(_context10, mergedCheckboxType, "-margin"), !!children), _defineProperty(_classNames4, _concatInstanceProperty(_context11 = "".concat(checkboxPrefixCls, "-")).call(_context11, mergedCheckboxType, "-checked"), selected), _defineProperty(_classNames4, _concatInstanceProperty(_context12 = "".concat(checkboxPrefixCls, "-")).call(_context12, mergedCheckboxType, "-indeterminate"), getIndeterminate()), _defineProperty(_classNames4, _concatInstanceProperty(_context13 = "".concat(checkboxPrefixCls, "-")).call(_context13, mergedCheckboxType, "-disabled"), mergedDisabled && !selected), _defineProperty(_classNames4, _concatInstanceProperty(_context14 = "".concat(checkboxPrefixCls, "-")).call(_context14, mergedCheckboxType, "-checked-disabled"), mergedDisabled && selected), _classNames4));
|
package/es/checkbox/group.js
CHANGED
|
@@ -27,7 +27,8 @@ var CheckboxGroup = React.forwardRef(function (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 CheckboxProps = getCompProps('CheckboxGroup', userDefaultProps, props);
|
|
32
33
|
var checkboxType = CheckboxProps.checkboxType,
|
|
33
34
|
className = CheckboxProps.className,
|
|
@@ -54,6 +55,7 @@ var CheckboxGroup = React.forwardRef(function (props, ref) {
|
|
|
54
55
|
}, [value, defaultValue]);
|
|
55
56
|
var isControlled = typeof value !== 'undefined';
|
|
56
57
|
var checkboxGroupPrefixCls = getPrefixCls(prefixCls, 'checkbox-group', customPrefixcls);
|
|
58
|
+
var rtlCls = direction === 'rtl' ? "".concat(checkboxGroupPrefixCls, "-rtl") : null;
|
|
57
59
|
devWarning(isArrayValueRepeat(groupValue), 'checkboxGroup', "variable value's value should be unique ");
|
|
58
60
|
var getReduceItem = function getReduceItem(targetValue) {
|
|
59
61
|
var _context;
|
|
@@ -104,7 +106,7 @@ var CheckboxGroup = React.forwardRef(function (props, ref) {
|
|
|
104
106
|
});
|
|
105
107
|
};
|
|
106
108
|
return React.createElement("ul", _extends({
|
|
107
|
-
className: classnames(checkboxGroupPrefixCls, className),
|
|
109
|
+
className: classnames(checkboxGroupPrefixCls, rtlCls, className),
|
|
108
110
|
style: style,
|
|
109
111
|
ref: ref
|
|
110
112
|
}, rest), React.createElement(GroupContext.Provider, {
|
|
@@ -388,7 +388,7 @@
|
|
|
388
388
|
-webkit-transform: translate(-50%, -50%) scale(1);
|
|
389
389
|
transform: translate(-50%, -50%) scale(1);
|
|
390
390
|
opacity: 1;
|
|
391
|
-
content:
|
|
391
|
+
content: ' ';
|
|
392
392
|
}
|
|
393
393
|
.kd-checkbox-default.checked .kd-checkbox-children {
|
|
394
394
|
color: var(--kd-c-checkbox-color-text-primary, #212121);
|
|
@@ -396,3 +396,40 @@
|
|
|
396
396
|
.kd-checkbox-default-indeterminate .kd-checkbox-children {
|
|
397
397
|
color: var(--kd-c-checkbox-color-text-primary, #212121);
|
|
398
398
|
}
|
|
399
|
+
.kd-checkbox-rtl {
|
|
400
|
+
direction: rtl;
|
|
401
|
+
}
|
|
402
|
+
.kd-checkbox-rtl.kd-checkbox-default .kd-checkbox-default-margin {
|
|
403
|
+
margin-right: 0;
|
|
404
|
+
margin-left: var(--kd-c-checkbox-default-input-spacing-margin-right, 4px);
|
|
405
|
+
}
|
|
406
|
+
.kd-checkbox-group-rtl {
|
|
407
|
+
direction: rtl;
|
|
408
|
+
}
|
|
409
|
+
.kd-checkbox-group-rtl.kd-checkbox-group {
|
|
410
|
+
text-align: right;
|
|
411
|
+
}
|
|
412
|
+
.kd-checkbox-group-rtl.kd-checkbox-group > .kd-checkbox-rtl:not(:last-child) {
|
|
413
|
+
margin-left: var(--kd-c-checkbox-group-spacing-margin-right, 12px);
|
|
414
|
+
margin-right: 0;
|
|
415
|
+
}
|
|
416
|
+
.kd-checkbox-group-rtl.kd-checkbox-group .kd-checkbox {
|
|
417
|
+
margin-left: var(--kd-c-checkbox-group-spacing-margin-right, 12px);
|
|
418
|
+
margin-right: 0;
|
|
419
|
+
}
|
|
420
|
+
.kd-checkbox-group-rtl .kd-checkbox-square-triangle,
|
|
421
|
+
.kd-checkbox-group-rtl .kd-checkbox-square-triangle-checked {
|
|
422
|
+
position: absolute;
|
|
423
|
+
content: '';
|
|
424
|
+
height: 0;
|
|
425
|
+
width: 0;
|
|
426
|
+
right: auto;
|
|
427
|
+
left: 0;
|
|
428
|
+
bottom: 0;
|
|
429
|
+
border-style: solid;
|
|
430
|
+
border-width: 0 var(--kd-c-checkbox-square-triangle-sizing-width, 18px) var(--kd-c-checkbox-square-triangle-sizing-height, 18px) 0;
|
|
431
|
+
border-top-color: transparent;
|
|
432
|
+
border-right-color: transparent;
|
|
433
|
+
border-left-color: transparent;
|
|
434
|
+
border-bottom-color: var(--kd-c-checkbox-color-border-active, var(--kd-g-color-theme, #5582f3));
|
|
435
|
+
}
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
|
|
56
55
|
.@{checkbox-prefix-cls}-square {
|
|
57
56
|
border-radius: 2px;
|
|
58
57
|
border: 1px solid @checkbox-border-color;
|
|
@@ -89,8 +88,8 @@
|
|
|
89
88
|
border-bottom-color: @checkbox-checked-border-color;
|
|
90
89
|
}
|
|
91
90
|
&-triangle {
|
|
92
|
-
animation: kdZoomBounceLeaveEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0
|
|
93
|
-
transition: all @checkbox-transition-duration cubic-bezier(0.4,0,0.6,1);
|
|
91
|
+
animation: kdZoomBounceLeaveEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0, 0.4, 0.4, 1) forwards;
|
|
92
|
+
transition: all @checkbox-transition-duration cubic-bezier(0.4, 0, 0.6, 1);
|
|
94
93
|
visibility: hidden;
|
|
95
94
|
opacity: 0;
|
|
96
95
|
}
|
|
@@ -108,7 +107,7 @@
|
|
|
108
107
|
&-inner-icon {
|
|
109
108
|
font-size: inherit;
|
|
110
109
|
line-height: 100%;
|
|
111
|
-
animation: kdZoomLeaveEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0
|
|
110
|
+
animation: kdZoomLeaveEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
112
111
|
}
|
|
113
112
|
&-triangle-disabled {
|
|
114
113
|
border-bottom-color: @checkbox-disabled-text-color;
|
|
@@ -124,14 +123,14 @@
|
|
|
124
123
|
&-checked {
|
|
125
124
|
border-color: @checkbox-checked-border-color;
|
|
126
125
|
&:not(&-disabled)::after {
|
|
127
|
-
animation: fadeEffect calc(@checkbox-transition-duration + 0.1s) cubic-bezier(0
|
|
128
|
-
waveEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0
|
|
126
|
+
animation: fadeEffect calc(@checkbox-transition-duration + 0.1s) cubic-bezier(0, 0.4, 0.4, 1) forwards,
|
|
127
|
+
waveEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0, 0.4, 0.4, 1) forwards;
|
|
129
128
|
}
|
|
130
129
|
.@{checkbox-prefix-cls}-square-triangle-checked:not(.@{checkbox-prefix-cls}-square-disabled) {
|
|
131
|
-
animation: kdZoomBounceEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0.4,0,0.6,1);
|
|
130
|
+
animation: kdZoomBounceEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
|
|
132
131
|
}
|
|
133
132
|
.@{checkbox-prefix-cls}-square-inner-icon:not(.@{checkbox-prefix-cls}-square-disabled) {
|
|
134
|
-
animation: kdZoomEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0
|
|
133
|
+
animation: kdZoomEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
136
|
&-checked-disabled {
|
|
@@ -212,14 +211,14 @@
|
|
|
212
211
|
&-checked {
|
|
213
212
|
background-color: @checkbox-checked-border-color;
|
|
214
213
|
border-color: @checkbox-checked-border-color;
|
|
215
|
-
transition: background-color calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0
|
|
216
|
-
border-color calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0
|
|
214
|
+
transition: background-color calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0, 0.4, 0.4, 1),
|
|
215
|
+
border-color calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
217
216
|
&:not(&-disabled)::after {
|
|
218
|
-
animation: fadeEffect calc(@checkbox-transition-duration + 0.1s) cubic-bezier(0
|
|
219
|
-
waveEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0
|
|
217
|
+
animation: fadeEffect calc(@checkbox-transition-duration + 0.1s) cubic-bezier(0, 0.4, 0.4, 1) forwards,
|
|
218
|
+
waveEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0, 0.4, 0.4, 1) forwards;
|
|
220
219
|
}
|
|
221
220
|
.@{checkbox-prefix-cls}-default-inner:not(&-disabled .@{checkbox-prefix-cls}-default-inner) {
|
|
222
|
-
animation: kdZoomBounceDefaultEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0.4,0,0.6,1) !important;
|
|
221
|
+
animation: kdZoomBounceDefaultEffect calc(@checkbox-transition-duration - 0.1s) cubic-bezier(0.4, 0, 0.6, 1) !important;
|
|
223
222
|
}
|
|
224
223
|
}
|
|
225
224
|
&-inner {
|
|
@@ -245,9 +244,9 @@
|
|
|
245
244
|
height: @checkbox-default-indeterminate-square;
|
|
246
245
|
background-color: @checkbox-checked-border-color;
|
|
247
246
|
border: 0;
|
|
248
|
-
transform: translate(-50
|
|
247
|
+
transform: translate(-50%, -50%) scale(1);
|
|
249
248
|
opacity: 1;
|
|
250
|
-
content:
|
|
249
|
+
content: ' ';
|
|
251
250
|
}
|
|
252
251
|
&.checked {
|
|
253
252
|
.@{checkbox-prefix-cls}-children {
|
|
@@ -260,3 +259,45 @@
|
|
|
260
259
|
}
|
|
261
260
|
}
|
|
262
261
|
}
|
|
262
|
+
|
|
263
|
+
.@{checkbox-prefix-cls}-rtl {
|
|
264
|
+
direction: rtl;
|
|
265
|
+
&.@{checkbox-prefix-cls}-default {
|
|
266
|
+
.@{checkbox-prefix-cls}-default-margin {
|
|
267
|
+
margin-right: 0;
|
|
268
|
+
margin-left: @checkbox-default-input-margin-right;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
.@{checkbox-prefix-cls}-group-rtl {
|
|
273
|
+
direction: rtl;
|
|
274
|
+
&.@{checkbox-prefix-cls}-group {
|
|
275
|
+
text-align: right;
|
|
276
|
+
> .@{checkbox-prefix-cls}-rtl:not(:last-child) {
|
|
277
|
+
margin-left: @checkbox-group-margin-right;
|
|
278
|
+
margin-right: 0;
|
|
279
|
+
}
|
|
280
|
+
.@{checkbox-prefix-cls} {
|
|
281
|
+
margin-left: @checkbox-group-margin-right;
|
|
282
|
+
margin-right: 0;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
.@{checkbox-prefix-cls}-square {
|
|
286
|
+
&-triangle,
|
|
287
|
+
&-triangle-checked {
|
|
288
|
+
position: absolute;
|
|
289
|
+
content: '';
|
|
290
|
+
height: 0;
|
|
291
|
+
width: 0;
|
|
292
|
+
right: auto;
|
|
293
|
+
left: 0;
|
|
294
|
+
bottom: 0;
|
|
295
|
+
border-style: solid;
|
|
296
|
+
border-width: 0 @checkbox-square-triangle-width @checkbox-square-triangle-height 0;
|
|
297
|
+
border-top-color: transparent;
|
|
298
|
+
border-right-color: transparent;
|
|
299
|
+
border-left-color: transparent;
|
|
300
|
+
border-bottom-color: @checkbox-checked-border-color;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
@@ -30,7 +30,8 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
30
30
|
getPrefixCls = _useContext.getPrefixCls,
|
|
31
31
|
prefixCls = _useContext.prefixCls,
|
|
32
32
|
userDefaultProps = _useContext.compDefaultProps,
|
|
33
|
-
locale = _useContext.locale
|
|
33
|
+
locale = _useContext.locale,
|
|
34
|
+
direction = _useContext.direction;
|
|
34
35
|
var selectProps = getCompProps('CityPicker', userDefaultProps, props);
|
|
35
36
|
var cityPickerLangMsg = locale.getCompLangMsg({
|
|
36
37
|
componentName: 'CityPicker'
|
|
@@ -121,7 +122,8 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
121
122
|
return type === 'domestic';
|
|
122
123
|
};
|
|
123
124
|
var selectPrefixCls = getPrefixCls(prefixCls, 'city-picker', customPrefixcls);
|
|
124
|
-
var
|
|
125
|
+
var rtlCls = direction === 'rtl' ? "".concat(selectPrefixCls, "-rtl") : null;
|
|
126
|
+
var cityPickerCls = classNames(selectPrefixCls, rtlCls, className, _defineProperty({}, "".concat(selectPrefixCls, "-visible"), optionShow));
|
|
125
127
|
var selectionCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-selector"), true));
|
|
126
128
|
var commCls = classNames((_classNames3 = {}, _defineProperty(_classNames3, "".concat(selectPrefixCls, "-bordered"), borderType === 'bordered'), _defineProperty(_classNames3, "".concat(selectPrefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames3, "".concat(selectPrefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames3, _concatInstanceProperty(_context = "".concat(selectPrefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames3, "".concat(selectPrefixCls, "-wrapper"), true), _defineProperty(_classNames3, "".concat(selectPrefixCls, "-show-search"), focusd), _classNames3));
|
|
127
129
|
useEffect(function () {
|
|
@@ -291,22 +293,38 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
291
293
|
var symbol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ', ';
|
|
292
294
|
if (!data) return null;
|
|
293
295
|
if (isDomestic(type)) {
|
|
294
|
-
var
|
|
296
|
+
var _context8, _context10;
|
|
295
297
|
if (isCommon) {
|
|
296
|
-
var
|
|
298
|
+
var _context4;
|
|
297
299
|
var _curVal = (data === null || data === void 0 ? void 0 : data.province) ? data === null || data === void 0 ? void 0 : data.province : (data === null || data === void 0 ? void 0 : data.country) || '';
|
|
298
|
-
|
|
300
|
+
if (direction === 'rtl') {
|
|
301
|
+
var _context3;
|
|
302
|
+
return _concatInstanceProperty(_context3 = "".concat(_curVal)).call(_context3, flag && _curVal ? symbol : '');
|
|
303
|
+
}
|
|
304
|
+
return _concatInstanceProperty(_context4 = "".concat(flag && _curVal ? symbol : '')).call(_context4, _curVal);
|
|
299
305
|
}
|
|
300
306
|
if (data === null || data === void 0 ? void 0 : data.type) {
|
|
301
|
-
var
|
|
302
|
-
var _curVal2 = (data.type === 'domestic' ? (data === null || data === void 0 ? void 0 : data.province) || (data === null || data === void 0 ? void 0 : data.country) : _filterInstanceProperty(
|
|
303
|
-
|
|
307
|
+
var _context5, _context7;
|
|
308
|
+
var _curVal2 = (data.type === 'domestic' ? (data === null || data === void 0 ? void 0 : data.province) || (data === null || data === void 0 ? void 0 : data.country) : _filterInstanceProperty(_context5 = [data === null || data === void 0 ? void 0 : data.province, data === null || data === void 0 ? void 0 : data.country]).call(_context5, Boolean).join(symbol)) || '';
|
|
309
|
+
if (direction === 'rtl') {
|
|
310
|
+
var _context6;
|
|
311
|
+
return _concatInstanceProperty(_context6 = "".concat(_curVal2)).call(_context6, flag && _curVal2 ? symbol : '');
|
|
312
|
+
}
|
|
313
|
+
return _concatInstanceProperty(_context7 = "".concat(flag && _curVal2 ? symbol : '')).call(_context7, _curVal2);
|
|
304
314
|
}
|
|
305
|
-
var curVal = tabsValue === 'domestic' ? (data === null || data === void 0 ? void 0 : data.province) || (data === null || data === void 0 ? void 0 : data.country) || '' : _filterInstanceProperty(
|
|
306
|
-
|
|
315
|
+
var curVal = tabsValue === 'domestic' ? (data === null || data === void 0 ? void 0 : data.province) || (data === null || data === void 0 ? void 0 : data.country) || '' : _filterInstanceProperty(_context8 = [data === null || data === void 0 ? void 0 : data.province, data === null || data === void 0 ? void 0 : data.country]).call(_context8, Boolean).join(symbol);
|
|
316
|
+
if (direction === 'rtl') {
|
|
317
|
+
var _context9;
|
|
318
|
+
return _concatInstanceProperty(_context9 = "".concat(curVal)).call(_context9, flag && curVal ? symbol : '');
|
|
319
|
+
}
|
|
320
|
+
return _concatInstanceProperty(_context10 = "".concat(flag && curVal ? symbol : '')).call(_context10, curVal);
|
|
307
321
|
} else {
|
|
308
|
-
var
|
|
309
|
-
|
|
322
|
+
var _context13, _context14;
|
|
323
|
+
if (direction === 'rtl') {
|
|
324
|
+
var _context11, _context12;
|
|
325
|
+
return _concatInstanceProperty(_context11 = "".concat(_filterInstanceProperty(_context12 = [data === null || data === void 0 ? void 0 : data.province, data === null || data === void 0 ? void 0 : data.country]).call(_context12, Boolean).join(symbol))).call(_context11, flag && ((data === null || data === void 0 ? void 0 : data.province) || (data === null || data === void 0 ? void 0 : data.country)) ? symbol : '');
|
|
326
|
+
}
|
|
327
|
+
return _concatInstanceProperty(_context13 = "".concat(flag && ((data === null || data === void 0 ? void 0 : data.province) || (data === null || data === void 0 ? void 0 : data.country)) ? symbol : '')).call(_context13, _filterInstanceProperty(_context14 = [data === null || data === void 0 ? void 0 : data.province, data === null || data === void 0 ? void 0 : data.country]).call(_context14, Boolean).join(symbol));
|
|
310
328
|
}
|
|
311
329
|
}, [type, tabsValue]);
|
|
312
330
|
var renderSingle = function renderSingle() {
|
|
@@ -467,8 +485,8 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
467
485
|
}
|
|
468
486
|
};
|
|
469
487
|
var popperProps = _extends(_extends({}, selectProps), {
|
|
470
|
-
prefixCls: "".concat(selectPrefixCls, "-dropdown"),
|
|
471
|
-
placement: 'bottomLeft',
|
|
488
|
+
prefixCls: classNames("".concat(selectPrefixCls, "-dropdown"), rtlCls),
|
|
489
|
+
placement: direction === 'rtl' ? 'bottomRight' : 'bottomLeft',
|
|
472
490
|
popperStyle: catchStyle(),
|
|
473
491
|
defaultVisible: optionShow,
|
|
474
492
|
visible: optionShow,
|
package/es/city-picker/option.js
CHANGED
|
@@ -21,7 +21,8 @@ var InternalOption = function InternalOption(props, ref) {
|
|
|
21
21
|
name = city.name;
|
|
22
22
|
var _useContext = useContext(ConfigContext),
|
|
23
23
|
getPrefixCls = _useContext.getPrefixCls,
|
|
24
|
-
prefixCls = _useContext.prefixCls
|
|
24
|
+
prefixCls = _useContext.prefixCls,
|
|
25
|
+
direction = _useContext.direction;
|
|
25
26
|
var selectOptionPrefixCls = getPrefixCls(prefixCls, 'city-picker-list-item');
|
|
26
27
|
var isSelected = id !== undefined ? id === value : false;
|
|
27
28
|
var optionCls = classNames(selectOptionPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-selected"), isSelected), _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-disabled"), disabled), _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-active"), activeIndex === index), _classNames));
|
|
@@ -39,7 +40,11 @@ var InternalOption = function InternalOption(props, ref) {
|
|
|
39
40
|
title: name,
|
|
40
41
|
onClick: handleClick,
|
|
41
42
|
onMouseEnter: handleOnMouseEnter
|
|
42
|
-
}, typeof itemRender === 'function' ? itemRender(city) : React.createElement(React.Fragment, null, React.createElement("span", {
|
|
43
|
+
}, typeof itemRender === 'function' ? itemRender(city) : direction === 'rtl' ? React.createElement(React.Fragment, null, React.createElement("span", {
|
|
44
|
+
className: "".concat(selectOptionPrefixCls, "-info")
|
|
45
|
+
}, renderCityInfo === null || renderCityInfo === void 0 ? void 0 : renderCityInfo(city, true)), React.createElement("span", {
|
|
46
|
+
className: "".concat(selectOptionPrefixCls, "-content")
|
|
47
|
+
}, children)) : React.createElement(React.Fragment, null, React.createElement("span", {
|
|
43
48
|
className: "".concat(selectOptionPrefixCls, "-content")
|
|
44
49
|
}, children), React.createElement("span", {
|
|
45
50
|
className: "".concat(selectOptionPrefixCls, "-info")
|
|
@@ -493,3 +493,57 @@
|
|
|
493
493
|
white-space: nowrap;
|
|
494
494
|
text-overflow: ellipsis;
|
|
495
495
|
}
|
|
496
|
+
.kd-city-picker-rtl {
|
|
497
|
+
direction: rtl;
|
|
498
|
+
}
|
|
499
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-description {
|
|
500
|
+
text-align: right;
|
|
501
|
+
}
|
|
502
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-selector .kd-city-picker-wrapper {
|
|
503
|
+
padding-right: 0;
|
|
504
|
+
padding-left: 24px;
|
|
505
|
+
}
|
|
506
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-placeholder {
|
|
507
|
+
position: absolute;
|
|
508
|
+
left: 24px;
|
|
509
|
+
right: 0;
|
|
510
|
+
top: 0;
|
|
511
|
+
bottom: 0;
|
|
512
|
+
}
|
|
513
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-bordered {
|
|
514
|
+
padding-right: var(--kd-c-city-picker-bordered-spacing-padding-left, 8px) !important;
|
|
515
|
+
padding-left: auto !important;
|
|
516
|
+
}
|
|
517
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-bordered .kd-city-picker-suffix {
|
|
518
|
+
padding-right: 8px;
|
|
519
|
+
padding-left: auto;
|
|
520
|
+
}
|
|
521
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-bordered .kd-city-picker-placeholder {
|
|
522
|
+
padding-right: var(--kd-c-city-picker-bordered-spacing-padding-left, 8px);
|
|
523
|
+
}
|
|
524
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-suffix {
|
|
525
|
+
left: 0;
|
|
526
|
+
right: auto;
|
|
527
|
+
top: 0;
|
|
528
|
+
bottom: 0;
|
|
529
|
+
position: absolute;
|
|
530
|
+
display: -webkit-box;
|
|
531
|
+
display: -ms-flexbox;
|
|
532
|
+
display: flex;
|
|
533
|
+
margin-right: 8px;
|
|
534
|
+
}
|
|
535
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-disabled.kd-city-picker-bordered {
|
|
536
|
+
padding-right: auto;
|
|
537
|
+
padding-left: var(--kd-c-city-picker-bordered-spacing-padding-left, 8px);
|
|
538
|
+
}
|
|
539
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-content-item {
|
|
540
|
+
position: absolute;
|
|
541
|
+
right: 0;
|
|
542
|
+
left: auto;
|
|
543
|
+
}
|
|
544
|
+
.kd-city-picker-rtl.kd-city-picker .kd-city-picker-content-info {
|
|
545
|
+
text-align: left;
|
|
546
|
+
overflow: hidden;
|
|
547
|
+
white-space: nowrap;
|
|
548
|
+
text-overflow: ellipsis;
|
|
549
|
+
}
|