@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.
- package/dist/kdesign-complete.less +798 -83
- package/dist/kdesign.css +578 -7
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +166 -93
- 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/compDefaultProps.d.ts +0 -1
- package/es/config-provider/compDefaultProps.js +0 -5
- package/es/dropdown/dropdown.js +5 -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/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/compDefaultProps.d.ts +0 -1
- package/lib/config-provider/compDefaultProps.js +0 -5
- package/lib/dropdown/dropdown.js +5 -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/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/lib/qr-code/qr-code.js
CHANGED
|
@@ -33,7 +33,8 @@ var QRCode = function QRCode(props) {
|
|
|
33
33
|
getPrefixCls = _useContext.getPrefixCls,
|
|
34
34
|
prefixCls = _useContext.prefixCls,
|
|
35
35
|
userDefaultProps = _useContext.compDefaultProps,
|
|
36
|
-
getCompLangMsg = _useContext.locale.getCompLangMsg
|
|
36
|
+
getCompLangMsg = _useContext.locale.getCompLangMsg,
|
|
37
|
+
direction = _useContext.direction;
|
|
37
38
|
var qrCodeProps = (0, _utils.getCompProps)('QRCode', userDefaultProps, props);
|
|
38
39
|
var value = qrCodeProps.value,
|
|
39
40
|
size = qrCodeProps.size,
|
|
@@ -52,7 +53,8 @@ var QRCode = function QRCode(props) {
|
|
|
52
53
|
var className = qrCodeProps.className,
|
|
53
54
|
customPrefixcls = qrCodeProps.prefixCls;
|
|
54
55
|
var qrCodePrefixCls = getPrefixCls(prefixCls, 'qrcode', customPrefixcls);
|
|
55
|
-
var
|
|
56
|
+
var rtlCls = direction === 'rtl' ? "".concat(qrCodePrefixCls, "-rtl") : null;
|
|
57
|
+
var qrCodeClass = (0, _classnames.default)(qrCodePrefixCls, rtlCls, className, (0, _defineProperty2.default)({}, "".concat(qrCodePrefixCls, "-borderless"), !bordered));
|
|
56
58
|
var qrCodeLangMsg = getCompLangMsg({
|
|
57
59
|
componentName: 'QRCode'
|
|
58
60
|
});
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
list-style: none;
|
|
20
20
|
overflow: hidden;
|
|
21
21
|
|
|
22
|
-
&-expired{
|
|
22
|
+
&-expired {
|
|
23
23
|
margin-bottom: @qrcode-spacing-margin-vertical;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
&-mask{
|
|
26
|
+
&-mask {
|
|
27
27
|
position: absolute;
|
|
28
28
|
z-index: 10;
|
|
29
29
|
display: flex;
|
|
@@ -36,7 +36,11 @@
|
|
|
36
36
|
background: @qrcode-color-background;
|
|
37
37
|
text-align: center;
|
|
38
38
|
}
|
|
39
|
-
&-borderless{
|
|
39
|
+
&-borderless {
|
|
40
40
|
border: none;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
.@{qrcode-prefix-cls}-rtl {
|
|
45
|
+
direction: rtl;
|
|
46
|
+
}
|
package/lib/radio/group.js
CHANGED
|
@@ -23,7 +23,8 @@ var RadioGroup = React.forwardRef(function (props, ref) {
|
|
|
23
23
|
var _React$useContext = React.useContext(_ConfigContext.default),
|
|
24
24
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
25
25
|
prefixCls = _React$useContext.prefixCls,
|
|
26
|
-
userDefaultProps = _React$useContext.compDefaultProps
|
|
26
|
+
userDefaultProps = _React$useContext.compDefaultProps,
|
|
27
|
+
direction = _React$useContext.direction;
|
|
27
28
|
var initValue = typeof props.value === 'undefined' ? props.defaultValue : props.value;
|
|
28
29
|
var _React$useState = React.useState(initValue),
|
|
29
30
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
@@ -55,6 +56,7 @@ var RadioGroup = React.forwardRef(function (props, ref) {
|
|
|
55
56
|
optionType = _getCompProps.optionType,
|
|
56
57
|
customPrefixcls = _getCompProps.prefixCls;
|
|
57
58
|
var groupPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, "radio-group", customPrefixcls);
|
|
59
|
+
var rtlCls = direction === 'rtl' ? "".concat(groupPrefixCls, "-rtl") : null;
|
|
58
60
|
var radioPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, "radio", customPrefixcls);
|
|
59
61
|
var childrenToRender = children;
|
|
60
62
|
if (options && options.length > 0) {
|
|
@@ -81,7 +83,7 @@ var RadioGroup = React.forwardRef(function (props, ref) {
|
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
return React.createElement("div", {
|
|
84
|
-
className: (0, _classnames.default)(groupPrefixCls, className),
|
|
86
|
+
className: (0, _classnames.default)(groupPrefixCls, rtlCls, className),
|
|
85
87
|
style: style,
|
|
86
88
|
id: id,
|
|
87
89
|
ref: ref
|
package/lib/radio/radio.js
CHANGED
|
@@ -37,7 +37,8 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
37
37
|
var _React$useContext = _react.default.useContext(_ConfigContext.default),
|
|
38
38
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
39
39
|
prefixCls = _React$useContext.prefixCls,
|
|
40
|
-
userDefaultProps = _React$useContext.compDefaultProps
|
|
40
|
+
userDefaultProps = _React$useContext.compDefaultProps,
|
|
41
|
+
direction = _React$useContext.direction;
|
|
41
42
|
var innerRef = _react.default.useRef();
|
|
42
43
|
var mergedRef = ref || innerRef;
|
|
43
44
|
var _a = (0, _utils.getCompProps)('Radio', userDefaultProps, props),
|
|
@@ -59,6 +60,7 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
59
60
|
return "radio".concat(radioType === 'square' ? "-".concat(radioType) : '');
|
|
60
61
|
};
|
|
61
62
|
var radioPrefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls(prefixCls, getPrefix(radioType), customPrefixcls);
|
|
63
|
+
var rtlCls = direction === 'rtl' ? "".concat(radioPrefixCls, "-rtl") : null;
|
|
62
64
|
var _React$useState = _react.default.useState(initValue),
|
|
63
65
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
64
66
|
isChecked = _React$useState2[0],
|
|
@@ -79,7 +81,7 @@ var InternalRadio = function InternalRadio(props, ref) {
|
|
|
79
81
|
context.onChange(e, value);
|
|
80
82
|
}
|
|
81
83
|
};
|
|
82
|
-
var classString = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls), true), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-checked"), isChecked), _classNames), className);
|
|
84
|
+
var classString = (0, _classnames.default)(rtlCls, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls), true), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames, "".concat(radioPrefixCls, "-checked"), isChecked), _classNames), className);
|
|
83
85
|
(0, _react.useEffect)(function () {
|
|
84
86
|
var _a;
|
|
85
87
|
var handleRepeatClick = function handleRepeatClick(e) {
|
|
@@ -454,3 +454,41 @@
|
|
|
454
454
|
display: block;
|
|
455
455
|
line-height: 1.5;
|
|
456
456
|
}
|
|
457
|
+
.kd-radio-rtl {
|
|
458
|
+
direction: rtl;
|
|
459
|
+
}
|
|
460
|
+
.kd-radio-button-rtl {
|
|
461
|
+
direction: rtl;
|
|
462
|
+
}
|
|
463
|
+
.kd-radio-button-rtl.kd-radio-button {
|
|
464
|
+
border: var(--kd-c-radio-radius-border-width, 1px) solid var(--kd-c-radio-color-border, var(--kd-g-color-border-strong, #d9d9d9));
|
|
465
|
+
border-right: none;
|
|
466
|
+
}
|
|
467
|
+
.kd-radio-button-rtl.kd-radio-button.kd-radio-button:first-child {
|
|
468
|
+
border-radius: 0 2px 2px 0;
|
|
469
|
+
border-right: var(--kd-c-radio-radius-border-width, 1px) solid var(--kd-c-radio-color-border, var(--kd-g-color-border-strong, #d9d9d9));
|
|
470
|
+
}
|
|
471
|
+
.kd-radio-button-rtl.kd-radio-button.kd-radio-button:first-child::before {
|
|
472
|
+
content: none;
|
|
473
|
+
}
|
|
474
|
+
.kd-radio-button-rtl.kd-radio-button.kd-radio-button:last-child {
|
|
475
|
+
border-radius: 2px 0 0 2px;
|
|
476
|
+
}
|
|
477
|
+
.kd-radio-square-rtl {
|
|
478
|
+
direction: rtl;
|
|
479
|
+
}
|
|
480
|
+
.kd-radio-square-rtl.kd-radio-square {
|
|
481
|
+
margin-left: var(--kd-c-radio-spacing-margin-right, 8px);
|
|
482
|
+
margin-right: 0;
|
|
483
|
+
}
|
|
484
|
+
.kd-radio-square-rtl.kd-radio-square.kd-radio-square::after {
|
|
485
|
+
left: calc(-1 * (var(--kd-c-radio-square-sizing-height, 32px) - 10px) / 2);
|
|
486
|
+
right: auto;
|
|
487
|
+
}
|
|
488
|
+
.kd-radio-square-rtl.kd-radio-square.kd-radio-square-checked::after {
|
|
489
|
+
left: calc(-1 * (var(--kd-c-radio-square-sizing-height, 32px) - 10px) / 2);
|
|
490
|
+
right: auto;
|
|
491
|
+
}
|
|
492
|
+
.kd-radio-group-rtl {
|
|
493
|
+
direction: rtl;
|
|
494
|
+
}
|
|
@@ -365,3 +365,49 @@
|
|
|
365
365
|
line-height: 1.5;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
+
|
|
369
|
+
.@{radio-prefix-cls}-rtl {
|
|
370
|
+
direction: rtl;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.@{radio-button-prefix-cls}-rtl {
|
|
374
|
+
direction: rtl;
|
|
375
|
+
&.@{radio-button-prefix-cls} {
|
|
376
|
+
border: @radio-border-width solid @radio-color-border;
|
|
377
|
+
border-right: none;
|
|
378
|
+
&.@{radio-button-prefix-cls}:first-child {
|
|
379
|
+
border-radius: 0 @radius-size @radius-size 0;
|
|
380
|
+
border-right: @radio-border-width solid @radio-color-border;
|
|
381
|
+
&::before {
|
|
382
|
+
content: none;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
&.@{radio-button-prefix-cls}:last-child {
|
|
387
|
+
border-radius: @radius-size 0 0 @radius-size;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.@{radio-square-prefix-cls}-rtl {
|
|
394
|
+
direction: rtl;
|
|
395
|
+
&.@{radio-square-prefix-cls} {
|
|
396
|
+
margin-left: @radio-margin-right;
|
|
397
|
+
margin-right: 0;
|
|
398
|
+
&.@{radio-square-prefix-cls}::after {
|
|
399
|
+
left: calc(-1 * (@radio-square-height - 10px) / 2);
|
|
400
|
+
right: auto;
|
|
401
|
+
}
|
|
402
|
+
&.@{radio-square-prefix-cls}-checked {
|
|
403
|
+
&::after {
|
|
404
|
+
left: calc(-1 * (@radio-square-height - 10px) / 2);
|
|
405
|
+
right: auto;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
}
|
|
411
|
+
.@{radio-group-prefix-cls}-rtl {
|
|
412
|
+
direction: rtl;
|
|
413
|
+
}
|
package/lib/select/option.js
CHANGED
|
@@ -41,8 +41,10 @@ var InternalOption = function InternalOption(props, ref) {
|
|
|
41
41
|
var optionProps = (0, _extends2.default)({}, props);
|
|
42
42
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
43
43
|
getPrefixCls = _useContext.getPrefixCls,
|
|
44
|
-
prefixCls = _useContext.prefixCls
|
|
44
|
+
prefixCls = _useContext.prefixCls,
|
|
45
|
+
direction = _useContext.direction;
|
|
45
46
|
var selectOptionPrefixCls = getPrefixCls(prefixCls, 'select-item');
|
|
47
|
+
var rtlCls = direction === 'rtl' ? "".concat(selectOptionPrefixCls, "-rtl") : null;
|
|
46
48
|
(0, _react.useEffect)(function () {
|
|
47
49
|
if (isMultiple) {
|
|
48
50
|
setSelected((values === null || values === void 0 ? void 0 : values.indexOf(value)) > -1);
|
|
@@ -50,7 +52,7 @@ var InternalOption = function InternalOption(props, ref) {
|
|
|
50
52
|
setSelected(value !== undefined ? value === values : false);
|
|
51
53
|
}
|
|
52
54
|
});
|
|
53
|
-
var optionCls = (0, _classnames.default)(selectOptionPrefixCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(selectOptionPrefixCls, "-option"), true), (0, _defineProperty2.default)(_classNames, "".concat(selectOptionPrefixCls, "-option-active"), activeIndex === index), (0, _defineProperty2.default)(_classNames, "".concat(selectOptionPrefixCls, "-option-selected"), isSelected), (0, _defineProperty2.default)(_classNames, "".concat(selectOptionPrefixCls, "-option-disabled"), disabled), _classNames));
|
|
55
|
+
var optionCls = (0, _classnames.default)(selectOptionPrefixCls, rtlCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(selectOptionPrefixCls, "-option"), true), (0, _defineProperty2.default)(_classNames, "".concat(selectOptionPrefixCls, "-option-active"), activeIndex === index), (0, _defineProperty2.default)(_classNames, "".concat(selectOptionPrefixCls, "-option-selected"), isSelected), (0, _defineProperty2.default)(_classNames, "".concat(selectOptionPrefixCls, "-option-disabled"), disabled), _classNames));
|
|
54
56
|
var contentCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectOptionPrefixCls, "-option-content"), true));
|
|
55
57
|
var handleClick = function handleClick(e) {
|
|
56
58
|
e.preventDefault();
|
package/lib/select/select.js
CHANGED
|
@@ -38,16 +38,17 @@ var _KeyCode = _interopRequireDefault(require("../_utils/KeyCode"));
|
|
|
38
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
39
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
40
40
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
41
|
-
function _unsupportedIterableToArray(o, minLen) { var
|
|
41
|
+
function _unsupportedIterableToArray(o, minLen) { var _context7; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context7 = Object.prototype.toString.call(o)).call(_context7, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
42
42
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
43
43
|
var INPUT_MIN_WIDTH = 4;
|
|
44
44
|
var InternalSelect = function InternalSelect(props, ref) {
|
|
45
|
-
var _context, _classNames5, _classNames6, _classNames12, _context5;
|
|
45
|
+
var _context, _classNames5, _classNames6, _classNames12, _context5, _context6;
|
|
46
46
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
47
47
|
getPrefixCls = _useContext.getPrefixCls,
|
|
48
48
|
prefixCls = _useContext.prefixCls,
|
|
49
49
|
userDefaultProps = _useContext.compDefaultProps,
|
|
50
|
-
locale = _useContext.locale
|
|
50
|
+
locale = _useContext.locale,
|
|
51
|
+
direction = _useContext.direction;
|
|
51
52
|
var selectProps = (0, _utils.getCompProps)('Select', userDefaultProps, props);
|
|
52
53
|
var selectLangMsg = locale.getCompLangMsg({
|
|
53
54
|
componentName: 'Select'
|
|
@@ -137,7 +138,8 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
137
138
|
return (0, _isBoolean.default)(showSearch) ? showSearch : isMultiple;
|
|
138
139
|
}, [isMultiple, showSearch]);
|
|
139
140
|
var selectPrefixCls = getPrefixCls(prefixCls, 'select', customPrefixcls);
|
|
140
|
-
var
|
|
141
|
+
var rtlCls = direction === 'rtl' ? "".concat(selectPrefixCls, "-rtl") : null;
|
|
142
|
+
var selectCls = (0, _classnames.default)(selectPrefixCls, rtlCls, className, (0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-visible"), optionShow));
|
|
141
143
|
var selectionCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-selector"), true));
|
|
142
144
|
var dropContentCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-dropdown-scroll"), (isMultiple ? (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 8 : (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 10) || selectProps.dropdownRender));
|
|
143
145
|
var multipleFooterCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-multiple-footer"), true));
|
|
@@ -701,7 +703,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
701
703
|
var multipleCls = (0, _classnames.default)(commCls, (_classNames10 = {}, (0, _defineProperty2.default)(_classNames10, "".concat(selectPrefixCls, "-multiple-disabled"), disabled), (0, _defineProperty2.default)(_classNames10, (0, _concat.default)(_context3 = "".concat(selectPrefixCls, "-")).call(_context3, mode), mode), (0, _defineProperty2.default)(_classNames10, "".concat(selectPrefixCls, "-focused"), focusd || optionShow), _classNames10));
|
|
702
704
|
var itemCls = (0, _classnames.default)((_classNames11 = {}, (0, _defineProperty2.default)(_classNames11, "".concat(selectPrefixCls, "-selection-item"), true), (0, _defineProperty2.default)(_classNames11, (0, _concat.default)(_context4 = "".concat(selectPrefixCls, "-selection-item-")).call(_context4, size), size), _classNames11));
|
|
703
705
|
var TagStyle = {
|
|
704
|
-
margin: '2px 8px 2px 0',
|
|
706
|
+
margin: direction === 'rtl' ? '2px 0 2px 8px' : '2px 8px 2px 0',
|
|
705
707
|
maxWidth: '100%'
|
|
706
708
|
};
|
|
707
709
|
var totalText = locale.getLangMsg('Select', 'total', {
|
|
@@ -917,7 +919,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
917
919
|
}
|
|
918
920
|
};
|
|
919
921
|
var popperProps = (0, _extends2.default)((0, _extends2.default)({}, selectProps), {
|
|
920
|
-
prefixCls: (0, _concat.default)(_context5 = "".concat(selectPrefixCls, "-dropdown-panel")).call(
|
|
922
|
+
prefixCls: (0, _concat.default)(_context5 = (0, _concat.default)(_context6 = "".concat(selectPrefixCls, "-dropdown-panel")).call(_context6, isMultiple ? " ".concat(selectPrefixCls, "-multiple-dropdown-panel") : '', " ")).call(_context5, rtlCls),
|
|
921
923
|
placement: 'bottomLeft',
|
|
922
924
|
popperStyle: catchStyle(),
|
|
923
925
|
defaultVisible: optionShow,
|
|
@@ -717,3 +717,64 @@
|
|
|
717
717
|
-webkit-transition: all calc(0.3s - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
|
|
718
718
|
transition: all calc(0.3s - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
|
|
719
719
|
}
|
|
720
|
+
.kd-select-rtl {
|
|
721
|
+
direction: rtl;
|
|
722
|
+
}
|
|
723
|
+
.kd-select-rtl .kd-select-selector .kd-select-wrapper {
|
|
724
|
+
padding: 1px 0 1px 28px;
|
|
725
|
+
}
|
|
726
|
+
.kd-select-rtl .kd-select-selector .kd-select-wrapper .kd-select-suffix {
|
|
727
|
+
position: absolute;
|
|
728
|
+
right: auto;
|
|
729
|
+
left: 0;
|
|
730
|
+
margin-left: 0;
|
|
731
|
+
margin-right: 8px;
|
|
732
|
+
}
|
|
733
|
+
.kd-select-rtl .kd-select-selector .kd-select-wrapper .kd-select-placeholder {
|
|
734
|
+
right: 0;
|
|
735
|
+
left: 28px;
|
|
736
|
+
}
|
|
737
|
+
.kd-select-rtl .kd-select-selector .kd-select-wrapper.kd-select-single .kd-select-selection-search {
|
|
738
|
+
padding-left: auto;
|
|
739
|
+
position: absolute;
|
|
740
|
+
left: 28px;
|
|
741
|
+
right: 0;
|
|
742
|
+
height: 100%;
|
|
743
|
+
top: 0;
|
|
744
|
+
bottom: 0;
|
|
745
|
+
}
|
|
746
|
+
.kd-select-rtl .kd-select-selector .kd-select-multiple .kd-select-selection-tag .kd-tag {
|
|
747
|
+
margin: 2px 0 2px 8px;
|
|
748
|
+
}
|
|
749
|
+
.kd-select-rtl .kd-select-selector .kd-select-multiple .kd-select-selection-tag .kd-tag-closeWrapper {
|
|
750
|
+
margin-right: 4px;
|
|
751
|
+
margin-left: 0;
|
|
752
|
+
}
|
|
753
|
+
.kd-select-rtl .kd-select-selector .kd-select-bordered {
|
|
754
|
+
padding-left: auto !important;
|
|
755
|
+
padding-right: var(--kd-c-select-bordered-spacing-padding-left, 8px) !important;
|
|
756
|
+
}
|
|
757
|
+
.kd-select-rtl .kd-select-selector .kd-select-bordered .kd-select-suffix {
|
|
758
|
+
padding-left: 8px;
|
|
759
|
+
}
|
|
760
|
+
.kd-select-rtl .kd-select-selector .kd-select-bordered.kd-select-single .kd-select-selection-search {
|
|
761
|
+
padding-right: var(--kd-c-select-bordered-spacing-padding-left, 8px);
|
|
762
|
+
}
|
|
763
|
+
.kd-select-rtl .kd-select-selector .kd-select-bordered .kd-select-placeholder {
|
|
764
|
+
padding-right: var(--kd-c-select-bordered-spacing-padding-left, 8px);
|
|
765
|
+
}
|
|
766
|
+
.kd-select-rtl .kd-select-dropdown .kd-select-multiple-footer-hadSelected {
|
|
767
|
+
padding-right: 12px;
|
|
768
|
+
padding-left: 0;
|
|
769
|
+
}
|
|
770
|
+
.kd-select-rtl .kd-select-dropdown .kd-select-multiple-footer .kd-checkbox-default-margin {
|
|
771
|
+
margin-right: 0;
|
|
772
|
+
margin-left: 4px;
|
|
773
|
+
}
|
|
774
|
+
.kd-select-item-rtl {
|
|
775
|
+
direction: rtl;
|
|
776
|
+
}
|
|
777
|
+
.kd-select-item-rtl.kd-select-item .kd-select-item-option-content .kd-checkbox-default-margin {
|
|
778
|
+
margin-right: 0;
|
|
779
|
+
margin-left: 4px;
|
|
780
|
+
}
|
|
@@ -459,3 +459,90 @@
|
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
+
|
|
463
|
+
.@{select-prefix-cls}-rtl {
|
|
464
|
+
direction: rtl;
|
|
465
|
+
.@{select-prefix-cls}-selector {
|
|
466
|
+
.@{select-prefix-cls}-wrapper {
|
|
467
|
+
padding: 1px 0 1px 28px;
|
|
468
|
+
.@{select-prefix-cls}-suffix {
|
|
469
|
+
position: absolute;
|
|
470
|
+
right: auto;
|
|
471
|
+
left: 0;
|
|
472
|
+
margin-left: 0;
|
|
473
|
+
margin-right: 8px;
|
|
474
|
+
}
|
|
475
|
+
.@{select-prefix-cls}-placeholder {
|
|
476
|
+
right: 0;
|
|
477
|
+
left: 28px;
|
|
478
|
+
}
|
|
479
|
+
&.@{select-prefix-cls}-single {
|
|
480
|
+
.@{select-prefix-cls}-selection-search {
|
|
481
|
+
padding-left: auto;
|
|
482
|
+
position: absolute;
|
|
483
|
+
left: 28px;
|
|
484
|
+
right: 0;
|
|
485
|
+
height: 100%;
|
|
486
|
+
top: 0;
|
|
487
|
+
bottom: 0;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
.@{select-prefix-cls}-multiple {
|
|
492
|
+
.@{select-prefix-cls}-selection-tag {
|
|
493
|
+
.@{kd-prefix}-tag {
|
|
494
|
+
margin: 2px 0 2px 8px;
|
|
495
|
+
&-closeWrapper {
|
|
496
|
+
margin-right: 4px;
|
|
497
|
+
margin-left: 0;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
.@{select-prefix-cls}-bordered {
|
|
503
|
+
padding-left: auto !important;
|
|
504
|
+
padding-right: @select-bordered !important;
|
|
505
|
+
.@{select-prefix-cls}-suffix {
|
|
506
|
+
padding-left: 8px;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
&.@{select-prefix-cls}-single {
|
|
510
|
+
.@{select-prefix-cls}-selection-search {
|
|
511
|
+
padding-right: @select-bordered;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.@{select-prefix-cls}-placeholder {
|
|
516
|
+
padding-right: @select-bordered;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
.@{select-prefix-cls}-dropdown {
|
|
521
|
+
.@{select-prefix-cls}-multiple-footer {
|
|
522
|
+
&-hadSelected {
|
|
523
|
+
padding-right: 12px;
|
|
524
|
+
padding-left: 0;
|
|
525
|
+
}
|
|
526
|
+
.@{kd-prefix}-checkbox {
|
|
527
|
+
&-default-margin {
|
|
528
|
+
margin-right: 0;
|
|
529
|
+
margin-left: 4px;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.@{select-prefix-cls}-item-rtl {
|
|
537
|
+
direction: rtl;
|
|
538
|
+
&.@{select-prefix-cls}-item {
|
|
539
|
+
.@{select-prefix-cls}-item-option-content {
|
|
540
|
+
.@{kd-prefix}-checkbox {
|
|
541
|
+
&-default-margin {
|
|
542
|
+
margin-right: 0;
|
|
543
|
+
margin-left: 4px;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
package/lib/steps/Steps.js
CHANGED
|
@@ -36,7 +36,8 @@ var Steps = function Steps(props) {
|
|
|
36
36
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
37
37
|
getPrefixCls = _useContext.getPrefixCls,
|
|
38
38
|
prefixCls = _useContext.prefixCls,
|
|
39
|
-
userDefaultProps = _useContext.compDefaultProps
|
|
39
|
+
userDefaultProps = _useContext.compDefaultProps,
|
|
40
|
+
rtlDirection = _useContext.direction;
|
|
40
41
|
var stepsProps = (0, _utils.getCompProps)('Steps', userDefaultProps, props);
|
|
41
42
|
var direction = stepsProps.direction,
|
|
42
43
|
initial = stepsProps.initial,
|
|
@@ -58,7 +59,8 @@ var Steps = function Steps(props) {
|
|
|
58
59
|
(0, _devwarning.default)(_interface.Statuses.indexOf(status) === -1, 'steps', "cannot found steps status '".concat(status, "'"));
|
|
59
60
|
(0, _devwarning.default)(_interface.LabelPlacements.indexOf(labelPlacement) === -1, 'steps', "cannot found steps labelPlacement '".concat(labelPlacement, "'"));
|
|
60
61
|
var stepsPrefixCls = getPrefixCls(prefixCls, 'steps', customPrefixcls);
|
|
61
|
-
var
|
|
62
|
+
var rtlCls = rtlDirection === 'rtl' ? "".concat(stepsPrefixCls, "-rtl") : null;
|
|
63
|
+
var stepsClassName = (0, _classnames.default)(stepsPrefixCls, rtlCls, (0, _concat.default)(_context = "".concat(stepsPrefixCls, "-")).call(_context, direction), className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(stepsPrefixCls, "-leftLable"), labelPlacement === 'left'), (0, _defineProperty2.default)(_classNames, "".concat(stepsPrefixCls, "-rightLable"), labelPlacement === 'right'), (0, _defineProperty2.default)(_classNames, "".concat(stepsPrefixCls, "-bottomLable"), labelPlacement === 'bottom'), (0, _defineProperty2.default)(_classNames, "".concat(stepsPrefixCls, "-topLable"), labelPlacement === 'top'), _classNames));
|
|
62
64
|
var onStepClick = function onStepClick(next) {
|
|
63
65
|
if (canClickCurrentStep || onChange && current !== next) {
|
|
64
66
|
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),
|
|
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,
|
|
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
|
|
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
|
+
}
|
package/lib/switch/switch.js
CHANGED
|
@@ -37,7 +37,8 @@ var Switch = function Switch(props) {
|
|
|
37
37
|
var _useContext = (0, _react.useContext)(_ConfigContext.default),
|
|
38
38
|
getPrefixCls = _useContext.getPrefixCls,
|
|
39
39
|
prefixCls = _useContext.prefixCls,
|
|
40
|
-
userDefaultProps = _useContext.compDefaultProps
|
|
40
|
+
userDefaultProps = _useContext.compDefaultProps,
|
|
41
|
+
direction = _useContext.direction;
|
|
41
42
|
var switchProps = (0, _utils.getCompProps)('Switch', userDefaultProps, props);
|
|
42
43
|
var size = switchProps.size,
|
|
43
44
|
className = switchProps.className,
|
|
@@ -59,6 +60,7 @@ var Switch = function Switch(props) {
|
|
|
59
60
|
newChecked = _useMergedState2[0],
|
|
60
61
|
setChecked = _useMergedState2[1];
|
|
61
62
|
var switchPrefixCls = getPrefixCls(prefixCls, 'switch', customPrefixcls);
|
|
63
|
+
var rtlCls = direction === 'rtl' ? "".concat(switchPrefixCls, "-rtl") : null;
|
|
62
64
|
var handleClick = function handleClick(e) {
|
|
63
65
|
var newV = triggerChange(!newChecked, e);
|
|
64
66
|
onClick && onClick(newV, e);
|
|
@@ -73,7 +75,7 @@ var Switch = function Switch(props) {
|
|
|
73
75
|
}
|
|
74
76
|
return afterChangedChecked;
|
|
75
77
|
}
|
|
76
|
-
var switchClasses = (0, _classnames.default)(switchPrefixCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(switchPrefixCls, "-size-")).call(_context, size), size), (0, _defineProperty2.default)(_classNames, "".concat(switchPrefixCls, "-disabled"), disabled || loading), (0, _defineProperty2.default)(_classNames, "".concat(switchPrefixCls, "-loading"), loading), (0, _defineProperty2.default)(_classNames, "".concat(switchPrefixCls, "-checked"), newChecked), _classNames));
|
|
78
|
+
var switchClasses = (0, _classnames.default)(switchPrefixCls, rtlCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(switchPrefixCls, "-size-")).call(_context, size), size), (0, _defineProperty2.default)(_classNames, "".concat(switchPrefixCls, "-disabled"), disabled || loading), (0, _defineProperty2.default)(_classNames, "".concat(switchPrefixCls, "-loading"), loading), (0, _defineProperty2.default)(_classNames, "".concat(switchPrefixCls, "-checked"), newChecked), _classNames));
|
|
77
79
|
var loadingIcon = loading ? _react.default.createElement("span", {
|
|
78
80
|
className: "".concat(switchPrefixCls, "-loading-icon")
|
|
79
81
|
}, _react.default.createElement(_icon.default, {
|