@kdcloudjs/kdesign 1.7.28 → 1.7.30
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/CHANGELOG.md +30 -0
- package/dist/kdesign-complete.less +27 -8
- package/dist/kdesign.css +44 -7
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +175 -137
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +3 -3
- package/dist/kdesign.min.js +6 -6
- package/dist/kdesign.min.js.map +1 -1
- package/es/checkbox/checkbox.js +17 -12
- package/es/city-picker/city-picker.js +36 -22
- package/es/city-picker/style/index.css +4 -3
- package/es/city-picker/style/index.less +2 -1
- package/es/city-picker/style/token.less +3 -2
- package/es/grid/col.d.ts +1 -1
- package/es/grid/col.js +46 -31
- package/es/grid/row.d.ts +9 -1
- package/es/grid/row.js +20 -15
- package/es/select/select.js +10 -10
- package/es/select/style/index.css +39 -3
- package/es/select/style/index.less +15 -3
- package/es/select/style/mixin.less +6 -2
- package/lib/checkbox/checkbox.js +17 -12
- package/lib/city-picker/city-picker.js +36 -22
- package/lib/city-picker/style/index.css +4 -3
- package/lib/city-picker/style/index.less +2 -1
- package/lib/city-picker/style/token.less +3 -2
- package/lib/grid/col.d.ts +1 -1
- package/lib/grid/col.js +48 -33
- package/lib/grid/row.d.ts +9 -1
- package/lib/grid/row.js +24 -18
- package/lib/select/select.js +10 -10
- package/lib/select/style/index.css +39 -3
- package/lib/select/style/index.less +15 -3
- package/lib/select/style/mixin.less +6 -2
- package/package.json +1 -1
package/lib/grid/row.js
CHANGED
|
@@ -7,11 +7,10 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.default = void 0;
|
|
11
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
10
|
+
exports.default = exports.GapContext = void 0;
|
|
12
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
13
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
14
|
-
var
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
15
|
var _utils = require("../_utils");
|
|
17
16
|
var _configProvider = require("../config-provider");
|
|
@@ -33,9 +32,16 @@ function getGap(gutter, width) {
|
|
|
33
32
|
if (xl && width >= 1920) gap = xl;
|
|
34
33
|
return gap;
|
|
35
34
|
}
|
|
35
|
+
var GapContext = /*#__PURE__*/(0, _react.createContext)({
|
|
36
|
+
gap: {
|
|
37
|
+
h: 0,
|
|
38
|
+
v: 0
|
|
39
|
+
},
|
|
40
|
+
winWidth: window.innerWidth
|
|
41
|
+
});
|
|
42
|
+
exports.GapContext = GapContext;
|
|
36
43
|
var Row = function Row(props) {
|
|
37
|
-
var
|
|
38
|
-
var _React$useContext = React.useContext(_configProvider.ConfigContext),
|
|
44
|
+
var _React$useContext = _react.default.useContext(_configProvider.ConfigContext),
|
|
39
45
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
40
46
|
pkgPrefixCls = _React$useContext.prefixCls,
|
|
41
47
|
userDefaultProps = _React$useContext.compDefaultProps;
|
|
@@ -50,10 +56,10 @@ var Row = function Row(props) {
|
|
|
50
56
|
justify = _getCompProps.justify,
|
|
51
57
|
customPrefixcls = _getCompProps.prefixCls;
|
|
52
58
|
// 浏览器名称
|
|
53
|
-
var
|
|
59
|
+
var isSogouOrIe = (0, _testBrowserType.testBrowserType)(/^sogou/i, 0) || /Trident|MSIE/.test(navigator.userAgent);
|
|
54
60
|
// className前缀
|
|
55
61
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'row', customPrefixcls);
|
|
56
|
-
var _React$useState =
|
|
62
|
+
var _React$useState = _react.default.useState(window.innerWidth),
|
|
57
63
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
58
64
|
winWidth = _React$useState2[0],
|
|
59
65
|
setWinWidth = _React$useState2[1];
|
|
@@ -82,9 +88,10 @@ var Row = function Row(props) {
|
|
|
82
88
|
}
|
|
83
89
|
}
|
|
84
90
|
var rowStyle = {
|
|
85
|
-
'
|
|
91
|
+
'row-gap': "".concat(gap.v, "px"),
|
|
92
|
+
margin: "0 ".concat(-1 * gap.h / 2, "px")
|
|
86
93
|
};
|
|
87
|
-
if (gap.v) rowStyle['
|
|
94
|
+
if (gap.v && isSogouOrIe) rowStyle['margin-bottom'] = "".concat(-1 * gap.v, "px");
|
|
88
95
|
var toalign = {
|
|
89
96
|
top: 'flex-start',
|
|
90
97
|
middle: 'center',
|
|
@@ -94,22 +101,21 @@ var Row = function Row(props) {
|
|
|
94
101
|
start: 'flex-start',
|
|
95
102
|
end: 'flex-end'
|
|
96
103
|
};
|
|
97
|
-
var styleString = (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({},
|
|
104
|
+
var styleString = (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({}, rowStyle), style), {
|
|
98
105
|
alignItems: toalign[align] || align,
|
|
99
106
|
justifyContent: tojustify[justify] || justify
|
|
100
107
|
});
|
|
101
|
-
return /*#__PURE__*/
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement(GapContext.Provider, {
|
|
109
|
+
value: {
|
|
110
|
+
gap: gap,
|
|
111
|
+
winWidth: winWidth
|
|
112
|
+
}
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
102
114
|
className: (0, _classnames.default)(prefixCls, className, {
|
|
103
115
|
nowrap: !wrap
|
|
104
|
-
}, {
|
|
105
|
-
'sogou-row': isSogou
|
|
106
116
|
}),
|
|
107
117
|
style: styleString
|
|
108
|
-
},
|
|
109
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
110
|
-
winWidth: winWidth
|
|
111
|
-
});
|
|
112
|
-
}));
|
|
118
|
+
}, children));
|
|
113
119
|
};
|
|
114
120
|
Row.displayName = 'Row';
|
|
115
121
|
var _default = Row;
|
package/lib/select/select.js
CHANGED
|
@@ -468,7 +468,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
468
468
|
var arrowIconCls = (0, _classnames.default)((_classNames7 = {}, (0, _defineProperty2.default)(_classNames7, "".concat(selectPrefixCls, "-icon-arrow"), true), (0, _defineProperty2.default)(_classNames7, "".concat(selectPrefixCls, "-icon-arrow-up"), optionShow), (0, _defineProperty2.default)(_classNames7, "".concat(selectPrefixCls, "-icon-arrow-down"), !optionShow), (0, _defineProperty2.default)(_classNames7, "".concat(selectPrefixCls, "-icon-arrow-focus"), optionShow), _classNames7));
|
|
469
469
|
var iconShow = allowClear && !disabled && ((isMultiple ? mulOptions.length > 0 : (singleVal !== null && singleVal !== void 0 ? singleVal : '') !== '') || searchValue);
|
|
470
470
|
var clearIconCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-icon-clear"), true));
|
|
471
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconShow
|
|
471
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconShow ? /*#__PURE__*/_react.default.createElement("span", {
|
|
472
472
|
onClick: handleReset,
|
|
473
473
|
onMouseDown: function onMouseDown(e) {
|
|
474
474
|
return e.preventDefault();
|
|
@@ -477,11 +477,11 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
477
477
|
ref: clearRef
|
|
478
478
|
}, clearIcon || /*#__PURE__*/_react.default.createElement(_index.Icon, {
|
|
479
479
|
type: "close-solid"
|
|
480
|
-
})), showArrow
|
|
480
|
+
})) : null, showArrow ? /*#__PURE__*/_react.default.createElement("span", {
|
|
481
481
|
className: arrowIconCls
|
|
482
482
|
}, suffixIcon || /*#__PURE__*/_react.default.createElement(_index.Icon, {
|
|
483
483
|
type: "arrow-down"
|
|
484
|
-
})));
|
|
484
|
+
})) : null);
|
|
485
485
|
};
|
|
486
486
|
var renderOption = function renderOption(child, index) {
|
|
487
487
|
if ((child === null || child === void 0 ? void 0 : child.props) && (child.type.displayName === 'Option' || child.type.name === 'Option')) {
|
|
@@ -580,7 +580,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
580
580
|
className: dropDownCls,
|
|
581
581
|
style: dropdownStyle,
|
|
582
582
|
ref: dropDownRef
|
|
583
|
-
}, !dropdownRender && childrenToRender.length > 0
|
|
583
|
+
}, !dropdownRender && childrenToRender.length > 0 ? dropRender(eleOptionList, heightStyle) : null, renderNotContent(), /*#__PURE__*/_react.default.createElement("div", null, dropdownRender ? dropdownRender(dropRender(childrenToRender, heightStyle)) : null), isMultiple && realChildren.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
584
584
|
className: multipleFooterCls
|
|
585
585
|
}, /*#__PURE__*/_react.default.createElement(_index.Checkbox, {
|
|
586
586
|
style: checkboxStyle,
|
|
@@ -589,7 +589,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
589
589
|
onChange: handleSelectAll
|
|
590
590
|
}, "\u5168\u9009"), /*#__PURE__*/_react.default.createElement("span", {
|
|
591
591
|
className: "".concat(selectPrefixCls, "-multiple-footer-hadSelected")
|
|
592
|
-
}, "\u5DF2\u9009", /*#__PURE__*/_react.default.createElement("span", null, selectedVal.length), "\u9879"))));
|
|
592
|
+
}, "\u5DF2\u9009", /*#__PURE__*/_react.default.createElement("span", null, selectedVal.length), "\u9879")) : null));
|
|
593
593
|
};
|
|
594
594
|
// 处理多选tag
|
|
595
595
|
var handleMaxTagHolder = (0, _react.useCallback)(function () {
|
|
@@ -664,10 +664,10 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
664
664
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
665
665
|
className: multipleCls,
|
|
666
666
|
ref: selectionRef
|
|
667
|
-
}, Array.isArray(mulOptions)
|
|
667
|
+
}, Array.isArray(mulOptions) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _map.default)(mulOptions).call(mulOptions, function (item, index) {
|
|
668
668
|
var label = item.label,
|
|
669
669
|
value = item.value;
|
|
670
|
-
return
|
|
670
|
+
return !maxTagCount || index <= maxTagCount - 1 ? /*#__PURE__*/_react.default.createElement("span", {
|
|
671
671
|
key: value,
|
|
672
672
|
className: (0, _classnames.default)("".concat(selectPrefixCls, "-selection-tag")),
|
|
673
673
|
onMouseDown: function onMouseDown(e) {
|
|
@@ -689,12 +689,12 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
689
689
|
return handleRemove(e, value);
|
|
690
690
|
},
|
|
691
691
|
"data-tag": value
|
|
692
|
-
}, label));
|
|
692
|
+
}, label)) : null;
|
|
693
693
|
}), maxTagCount && mulOptions.length > maxTagCount ? maxTagPlaceholder ? handleMaxTagHolder() : /*#__PURE__*/_react.default.createElement("span", {
|
|
694
694
|
className: itemCls
|
|
695
695
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
696
696
|
className: "".concat(selectPrefixCls, "-selection-item-content")
|
|
697
|
-
}, "\u5171", mulOptions.length, "\u9879")) : null), /*#__PURE__*/_react.default.createElement("span", {
|
|
697
|
+
}, "\u5171", mulOptions.length, "\u9879")) : null) : null, /*#__PURE__*/_react.default.createElement("span", {
|
|
698
698
|
className: "".concat(selectPrefixCls, "-selection-search"),
|
|
699
699
|
style: {
|
|
700
700
|
width: inputWidth
|
|
@@ -712,7 +712,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
712
712
|
className: "".concat(selectPrefixCls, "-selection-search-mirror")
|
|
713
713
|
}, searchValue, "\xA0")), /*#__PURE__*/_react.default.createElement("span", {
|
|
714
714
|
className: "".concat(selectPrefixCls, "-placeholder")
|
|
715
|
-
}, !mulOptions.length && !searchValue
|
|
715
|
+
}, !mulOptions.length && !searchValue ? placeholder : null), /*#__PURE__*/_react.default.createElement("span", {
|
|
716
716
|
className: "".concat(selectPrefixCls, "-suffix")
|
|
717
717
|
}, renderSuffix()));
|
|
718
718
|
};
|
|
@@ -280,6 +280,14 @@
|
|
|
280
280
|
.kd-select-icon-clear {
|
|
281
281
|
opacity: 0;
|
|
282
282
|
z-index: 1;
|
|
283
|
+
top: 0;
|
|
284
|
+
bottom: 0;
|
|
285
|
+
display: -webkit-box;
|
|
286
|
+
display: -ms-flexbox;
|
|
287
|
+
display: flex;
|
|
288
|
+
-webkit-box-align: center;
|
|
289
|
+
-ms-flex-align: center;
|
|
290
|
+
align-items: center;
|
|
283
291
|
position: absolute;
|
|
284
292
|
background: #fff;
|
|
285
293
|
-webkit-transition: opacity 0.15s ease;
|
|
@@ -299,6 +307,15 @@
|
|
|
299
307
|
text-overflow: ellipsis;
|
|
300
308
|
right: 28px;
|
|
301
309
|
left: 0;
|
|
310
|
+
top: 0;
|
|
311
|
+
bottom: 0;
|
|
312
|
+
z-index: -1;
|
|
313
|
+
display: -webkit-box;
|
|
314
|
+
display: -ms-flexbox;
|
|
315
|
+
display: flex;
|
|
316
|
+
-webkit-box-align: center;
|
|
317
|
+
-ms-flex-align: center;
|
|
318
|
+
align-items: center;
|
|
302
319
|
}
|
|
303
320
|
.kd-select-borderless {
|
|
304
321
|
border: none;
|
|
@@ -433,18 +450,32 @@
|
|
|
433
450
|
max-height: calc(var(--kd-c-select-sizing-height-small, 24px) * 3 - 10px);
|
|
434
451
|
font-size: var(--kd-c-select-font-size-small, 12px);
|
|
435
452
|
}
|
|
453
|
+
.kd-select-size-small .kd-select-selection-item {
|
|
454
|
+
min-height: calc(var(--kd-c-select-sizing-height-small, 24px) - 4px);
|
|
455
|
+
line-height: calc(var(--kd-c-select-sizing-height-small, 24px) - 4px);
|
|
456
|
+
}
|
|
436
457
|
.kd-select-size-middle {
|
|
437
458
|
min-height: var(--kd-c-select-sizing-height-middle, 30px);
|
|
438
459
|
max-height: calc(var(--kd-c-select-sizing-height-middle, 30px) * 3 - 10px);
|
|
439
460
|
font-size: var(--kd-c-select-font-size-middle, 14px);
|
|
440
461
|
}
|
|
462
|
+
.kd-select-size-middle .kd-select-selection-item {
|
|
463
|
+
min-height: calc(var(--kd-c-select-sizing-height-middle, 30px) - 4px);
|
|
464
|
+
line-height: calc(var(--kd-c-select-sizing-height-middle, 30px) - 4px);
|
|
465
|
+
}
|
|
441
466
|
.kd-select-size-large {
|
|
442
467
|
min-height: var(--kd-c-select-sizing-height-large, 36px);
|
|
443
468
|
max-height: calc(var(--kd-c-select-sizing-height-large, 36px) * 3 - 10px);
|
|
444
469
|
font-size: var(--kd-c-select-font-size-large, 16px);
|
|
445
470
|
}
|
|
471
|
+
.kd-select-size-large .kd-select-selection-item {
|
|
472
|
+
min-height: calc(var(--kd-c-select-sizing-height-large, 36px) - 4px);
|
|
473
|
+
line-height: calc(var(--kd-c-select-sizing-height-large, 36px) - 4px);
|
|
474
|
+
}
|
|
446
475
|
.kd-select-suffix {
|
|
447
476
|
right: 0;
|
|
477
|
+
top: 0;
|
|
478
|
+
bottom: 0;
|
|
448
479
|
position: absolute;
|
|
449
480
|
display: -webkit-box;
|
|
450
481
|
display: -ms-flexbox;
|
|
@@ -467,6 +498,14 @@
|
|
|
467
498
|
right: 28px;
|
|
468
499
|
left: 0;
|
|
469
500
|
height: 100%;
|
|
501
|
+
top: 0;
|
|
502
|
+
bottom: 0;
|
|
503
|
+
display: -webkit-box;
|
|
504
|
+
display: -ms-flexbox;
|
|
505
|
+
display: flex;
|
|
506
|
+
-webkit-box-align: center;
|
|
507
|
+
-ms-flex-align: center;
|
|
508
|
+
align-items: center;
|
|
470
509
|
}
|
|
471
510
|
.kd-select .kd-select-single .kd-select-selection-search-input {
|
|
472
511
|
outline: 0;
|
|
@@ -525,9 +564,6 @@
|
|
|
525
564
|
align-items: center;
|
|
526
565
|
vertical-align: middle;
|
|
527
566
|
max-width: 100%;
|
|
528
|
-
height: 20px;
|
|
529
|
-
line-height: 20px;
|
|
530
|
-
margin: 2px 8px 2px 0;
|
|
531
567
|
cursor: default;
|
|
532
568
|
-webkit-user-select: none;
|
|
533
569
|
-moz-user-select: none;
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
&-clear {
|
|
47
47
|
opacity: 0;
|
|
48
48
|
z-index: 1;
|
|
49
|
+
top: 0;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
49
53
|
position: absolute;
|
|
50
54
|
background: #fff;
|
|
51
55
|
transition: opacity 0.15s ease;
|
|
@@ -66,6 +70,11 @@
|
|
|
66
70
|
text-overflow: ellipsis;
|
|
67
71
|
right: 28px;
|
|
68
72
|
left: 0;
|
|
73
|
+
top: 0;
|
|
74
|
+
bottom: 0;
|
|
75
|
+
z-index: -1;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
69
78
|
}
|
|
70
79
|
|
|
71
80
|
&-borderless {
|
|
@@ -220,6 +229,8 @@
|
|
|
220
229
|
|
|
221
230
|
&-suffix {
|
|
222
231
|
right: 0;
|
|
232
|
+
top: 0;
|
|
233
|
+
bottom: 0;
|
|
223
234
|
position: absolute;
|
|
224
235
|
display: flex;
|
|
225
236
|
flex: 0;
|
|
@@ -235,6 +246,10 @@
|
|
|
235
246
|
right: 28px;
|
|
236
247
|
left: 0;
|
|
237
248
|
height: 100%;
|
|
249
|
+
top: 0;
|
|
250
|
+
bottom: 0;
|
|
251
|
+
display: flex;
|
|
252
|
+
align-items: center;
|
|
238
253
|
&-input {
|
|
239
254
|
outline: 0;
|
|
240
255
|
border-radius: 0;
|
|
@@ -289,9 +304,6 @@
|
|
|
289
304
|
align-items: center;
|
|
290
305
|
vertical-align: middle;
|
|
291
306
|
max-width: 100%;
|
|
292
|
-
height: 20px;
|
|
293
|
-
line-height: 20px;
|
|
294
|
-
margin: 2px 8px 2px 0;
|
|
295
307
|
cursor: default;
|
|
296
308
|
user-select: none;
|
|
297
309
|
&-small {
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
min-height: @height;
|
|
20
20
|
max-height: calc(@maxHeight * 3 - 10px);
|
|
21
21
|
font-size: @fontSize;
|
|
22
|
+
|
|
23
|
+
.@{select-prefix-cls}-selection-item {
|
|
24
|
+
min-height: calc(@height - 4px);
|
|
25
|
+
line-height: calc(@height - 4px);
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
.over() {
|
|
@@ -52,7 +57,6 @@
|
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
59
|
|
|
55
|
-
|
|
56
60
|
@keyframes SlideUpIn {
|
|
57
61
|
0% {
|
|
58
62
|
transform: scaleY(0.8);
|
|
@@ -77,4 +81,4 @@
|
|
|
77
81
|
transform-origin: 100% 100%;
|
|
78
82
|
opacity: 0;
|
|
79
83
|
}
|
|
80
|
-
}
|
|
84
|
+
}
|