@kdcloudjs/kdesign 1.7.61 → 1.7.62
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 +14 -0
- package/dist/kdesign-complete.less +1 -1
- package/dist/kdesign.css +3 -3
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +16 -20
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +2 -2
- package/dist/kdesign.min.js.map +1 -1
- package/es/cascader/cascader.js +15 -15
- package/es/cascader/style/index.css +2 -2
- package/es/cascader/style/index.less +1 -1
- package/es/city-picker/city-picker.js +0 -4
- package/lib/cascader/cascader.js +15 -15
- package/lib/cascader/style/index.css +2 -2
- package/lib/cascader/style/index.less +1 -1
- package/lib/city-picker/city-picker.js +0 -4
- package/package.json +1 -1
package/es/cascader/cascader.js
CHANGED
|
@@ -271,12 +271,12 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
271
271
|
var arrowIconCls = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-icon-arrow"), true), _defineProperty(_classNames, "".concat(prefixCls, "-icon-arrow-up"), visible), _defineProperty(_classNames, "".concat(prefixCls, "-icon-arrow-down"), !visible), _defineProperty(_classNames, "".concat(prefixCls, "-icon-arrow-focus"), visible), _classNames));
|
|
272
272
|
var iconShow = allowClear && !disabled && currentOptions.length > 0;
|
|
273
273
|
var clearIconCls = classNames(_defineProperty({}, "".concat(prefixCls, "-icon-clear"), true));
|
|
274
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, iconShow
|
|
274
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, iconShow ? /*#__PURE__*/React.createElement("span", {
|
|
275
275
|
onClick: handleClear,
|
|
276
276
|
className: clearIconCls
|
|
277
277
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
278
278
|
type: "close-solid"
|
|
279
|
-
}) || clearIcon), /*#__PURE__*/React.createElement("span", {
|
|
279
|
+
}) || clearIcon) : null, /*#__PURE__*/React.createElement("span", {
|
|
280
280
|
className: arrowIconCls
|
|
281
281
|
}, suffixIcon || /*#__PURE__*/React.createElement(Icon, {
|
|
282
282
|
type: "arrow-down"
|
|
@@ -316,11 +316,11 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
316
316
|
}), /*#__PURE__*/React.createElement("div", {
|
|
317
317
|
className: "".concat(prefixCls, "-multiple-wrapper"),
|
|
318
318
|
ref: wrapperRef
|
|
319
|
-
}, Array.isArray(currentOptions)
|
|
319
|
+
}, Array.isArray(currentOptions) ? /*#__PURE__*/React.createElement(React.Fragment, null, _mapInstanceProperty(currentOptions).call(currentOptions, function (option, index) {
|
|
320
320
|
return /*#__PURE__*/React.createElement("span", {
|
|
321
321
|
key: _JSON$stringify(values[index]),
|
|
322
322
|
className: classNames("".concat(prefixCls, "-selection-tag"))
|
|
323
|
-
},
|
|
323
|
+
}, !maxTagCount || index <= maxTagCount - 1 ? /*#__PURE__*/React.createElement(Tag, {
|
|
324
324
|
type: "edit",
|
|
325
325
|
disabled: disabled,
|
|
326
326
|
style: TagStyle,
|
|
@@ -328,14 +328,14 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
328
328
|
onClose: function onClose(e) {
|
|
329
329
|
return handleRemove(e, option);
|
|
330
330
|
}
|
|
331
|
-
}, displayRender(labels[index], option)));
|
|
331
|
+
}, displayRender(labels[index], option)) : null);
|
|
332
332
|
}), maxTagCount && currentOptions.length > maxTagCount ? maxTagPlaceholder ? handleMaxTagHolder() : /*#__PURE__*/React.createElement("span", {
|
|
333
333
|
className: itemCls
|
|
334
334
|
}, /*#__PURE__*/React.createElement("span", {
|
|
335
335
|
className: "".concat(prefixCls, "-tag-describe-content")
|
|
336
|
-
}, "\u5171", currentOptions.length, "\u9879")) : null), /*#__PURE__*/React.createElement("span", {
|
|
336
|
+
}, "\u5171", currentOptions.length, "\u9879")) : null) : null, /*#__PURE__*/React.createElement("span", {
|
|
337
337
|
className: "".concat(prefixCls, "-placeholder")
|
|
338
|
-
}, !currentOptions.length
|
|
338
|
+
}, !currentOptions.length ? placeholder : null)), /*#__PURE__*/React.createElement("span", {
|
|
339
339
|
ref: suffixRef,
|
|
340
340
|
className: "".concat(prefixCls, "-suffix")
|
|
341
341
|
}, renderSuffix()));
|
|
@@ -371,11 +371,11 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
371
371
|
ref: wrapperRef
|
|
372
372
|
}, /*#__PURE__*/React.createElement(Input, _extends({}, inputProps)), /*#__PURE__*/React.createElement("span", {
|
|
373
373
|
className: "".concat(prefixCls, "-picker-label")
|
|
374
|
-
}, (labels === null || labels === void 0 ? void 0 : labels.length) ? displayRender(labels, currentOptions) : ''), allowClear
|
|
374
|
+
}, (labels === null || labels === void 0 ? void 0 : labels.length) ? displayRender(labels, currentOptions) : ''), allowClear ? /*#__PURE__*/React.createElement(Icon, {
|
|
375
375
|
type: "close-solid",
|
|
376
376
|
className: "".concat(prefixCls, "-picker-close"),
|
|
377
377
|
onClick: handleClear
|
|
378
|
-
}))));
|
|
378
|
+
}) : null)));
|
|
379
379
|
};
|
|
380
380
|
var cascaderLocator = isMultiple ? renderMultiple() : renderSingle();
|
|
381
381
|
var onExpend = function onExpend(index, opt, opts) {
|
|
@@ -433,11 +433,11 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
433
433
|
onPopperVisibleChange && onPopperVisibleChange(v);
|
|
434
434
|
v && setSelectedOptions(_sliceInstanceProperty(currentOptions).call(currentOptions, 0));
|
|
435
435
|
};
|
|
436
|
-
var cascaderMenus = /*#__PURE__*/React.createElement(React.Fragment, null, (options === null || options === void 0 ? void 0 : options.length) ? (menus === null || menus === void 0 ? void 0 : menus.length)
|
|
436
|
+
var cascaderMenus = /*#__PURE__*/React.createElement(React.Fragment, null, (options === null || options === void 0 ? void 0 : options.length) ? (menus === null || menus === void 0 ? void 0 : menus.length) ? _mapInstanceProperty(menus).call(menus, function (opts, index) {
|
|
437
437
|
return /*#__PURE__*/React.createElement("ul", {
|
|
438
438
|
key: index,
|
|
439
439
|
className: "".concat(prefixCls, "-menu")
|
|
440
|
-
}, (opts === null || opts === void 0 ? void 0 : opts.length)
|
|
440
|
+
}, (opts === null || opts === void 0 ? void 0 : opts.length) ? _mapInstanceProperty(opts).call(opts, function (opt) {
|
|
441
441
|
var isLeaf = opt.isLeaf,
|
|
442
442
|
loading = opt.loading,
|
|
443
443
|
value = opt[fieldNames.value],
|
|
@@ -461,9 +461,9 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
461
461
|
}, label), loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
462
462
|
type: "loadding-circle",
|
|
463
463
|
spin: true
|
|
464
|
-
}) : (
|
|
464
|
+
}) : (children === null || children === void 0 ? void 0 : children.length) || isLeaf === false ? props.expandIcon || /*#__PURE__*/React.createElement(Icon, {
|
|
465
465
|
type: "arrow-right"
|
|
466
|
-
}))
|
|
466
|
+
}) : null);
|
|
467
467
|
return /*#__PURE__*/React.createElement(CascaderMenuSubmenu, _extends({
|
|
468
468
|
key: value
|
|
469
469
|
}, {
|
|
@@ -480,8 +480,8 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
480
480
|
},
|
|
481
481
|
className: "".concat(prefixCls, "-checkbox")
|
|
482
482
|
}), node) : node);
|
|
483
|
-
}));
|
|
484
|
-
}) : /*#__PURE__*/React.createElement(Empty, {
|
|
483
|
+
}) : null);
|
|
484
|
+
}) : null : /*#__PURE__*/React.createElement(Empty, {
|
|
485
485
|
description: notFoundContent
|
|
486
486
|
}));
|
|
487
487
|
var cascaderPopper = dropdownRender(cascaderMenus);
|
|
@@ -464,10 +464,6 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
464
464
|
var _a;
|
|
465
465
|
return (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
466
466
|
},
|
|
467
|
-
onBlur: function onBlur() {
|
|
468
|
-
var _a;
|
|
469
|
-
return (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
470
|
-
},
|
|
471
467
|
onKeyDown: onInternalKeyDown
|
|
472
468
|
}, renderSingle()));
|
|
473
469
|
};
|
package/lib/cascader/cascader.js
CHANGED
|
@@ -284,12 +284,12 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
284
284
|
var arrowIconCls = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-icon-arrow"), true), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-icon-arrow-up"), visible), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-icon-arrow-down"), !visible), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-icon-arrow-focus"), visible), _classNames));
|
|
285
285
|
var iconShow = allowClear && !disabled && currentOptions.length > 0;
|
|
286
286
|
var clearIconCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(prefixCls, "-icon-clear"), true));
|
|
287
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconShow
|
|
287
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconShow ? /*#__PURE__*/_react.default.createElement("span", {
|
|
288
288
|
onClick: handleClear,
|
|
289
289
|
className: clearIconCls
|
|
290
290
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
291
291
|
type: "close-solid"
|
|
292
|
-
}) || clearIcon), /*#__PURE__*/_react.default.createElement("span", {
|
|
292
|
+
}) || clearIcon) : null, /*#__PURE__*/_react.default.createElement("span", {
|
|
293
293
|
className: arrowIconCls
|
|
294
294
|
}, suffixIcon || /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
295
295
|
type: "arrow-down"
|
|
@@ -329,11 +329,11 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
329
329
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
330
330
|
className: "".concat(prefixCls, "-multiple-wrapper"),
|
|
331
331
|
ref: wrapperRef
|
|
332
|
-
}, Array.isArray(currentOptions)
|
|
332
|
+
}, Array.isArray(currentOptions) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _map.default)(currentOptions).call(currentOptions, function (option, index) {
|
|
333
333
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
334
334
|
key: (0, _stringify.default)(values[index]),
|
|
335
335
|
className: (0, _classnames.default)("".concat(prefixCls, "-selection-tag"))
|
|
336
|
-
},
|
|
336
|
+
}, !maxTagCount || index <= maxTagCount - 1 ? /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
337
337
|
type: "edit",
|
|
338
338
|
disabled: disabled,
|
|
339
339
|
style: TagStyle,
|
|
@@ -341,14 +341,14 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
341
341
|
onClose: function onClose(e) {
|
|
342
342
|
return handleRemove(e, option);
|
|
343
343
|
}
|
|
344
|
-
}, displayRender(labels[index], option)));
|
|
344
|
+
}, displayRender(labels[index], option)) : null);
|
|
345
345
|
}), maxTagCount && currentOptions.length > maxTagCount ? maxTagPlaceholder ? handleMaxTagHolder() : /*#__PURE__*/_react.default.createElement("span", {
|
|
346
346
|
className: itemCls
|
|
347
347
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
348
348
|
className: "".concat(prefixCls, "-tag-describe-content")
|
|
349
|
-
}, "\u5171", currentOptions.length, "\u9879")) : null), /*#__PURE__*/_react.default.createElement("span", {
|
|
349
|
+
}, "\u5171", currentOptions.length, "\u9879")) : null) : null, /*#__PURE__*/_react.default.createElement("span", {
|
|
350
350
|
className: "".concat(prefixCls, "-placeholder")
|
|
351
|
-
}, !currentOptions.length
|
|
351
|
+
}, !currentOptions.length ? placeholder : null)), /*#__PURE__*/_react.default.createElement("span", {
|
|
352
352
|
ref: suffixRef,
|
|
353
353
|
className: "".concat(prefixCls, "-suffix")
|
|
354
354
|
}, renderSuffix()));
|
|
@@ -384,11 +384,11 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
384
384
|
ref: wrapperRef
|
|
385
385
|
}, /*#__PURE__*/_react.default.createElement(_input.default, (0, _extends2.default)({}, inputProps)), /*#__PURE__*/_react.default.createElement("span", {
|
|
386
386
|
className: "".concat(prefixCls, "-picker-label")
|
|
387
|
-
}, (labels === null || labels === void 0 ? void 0 : labels.length) ? displayRender(labels, currentOptions) : ''), allowClear
|
|
387
|
+
}, (labels === null || labels === void 0 ? void 0 : labels.length) ? displayRender(labels, currentOptions) : ''), allowClear ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
388
388
|
type: "close-solid",
|
|
389
389
|
className: "".concat(prefixCls, "-picker-close"),
|
|
390
390
|
onClick: handleClear
|
|
391
|
-
}))));
|
|
391
|
+
}) : null)));
|
|
392
392
|
};
|
|
393
393
|
var cascaderLocator = isMultiple ? renderMultiple() : renderSingle();
|
|
394
394
|
var onExpend = function onExpend(index, opt, opts) {
|
|
@@ -446,11 +446,11 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
446
446
|
onPopperVisibleChange && onPopperVisibleChange(v);
|
|
447
447
|
v && setSelectedOptions((0, _slice.default)(currentOptions).call(currentOptions, 0));
|
|
448
448
|
};
|
|
449
|
-
var cascaderMenus = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (options === null || options === void 0 ? void 0 : options.length) ? (menus === null || menus === void 0 ? void 0 : menus.length)
|
|
449
|
+
var cascaderMenus = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (options === null || options === void 0 ? void 0 : options.length) ? (menus === null || menus === void 0 ? void 0 : menus.length) ? (0, _map.default)(menus).call(menus, function (opts, index) {
|
|
450
450
|
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
451
451
|
key: index,
|
|
452
452
|
className: "".concat(prefixCls, "-menu")
|
|
453
|
-
}, (opts === null || opts === void 0 ? void 0 : opts.length)
|
|
453
|
+
}, (opts === null || opts === void 0 ? void 0 : opts.length) ? (0, _map.default)(opts).call(opts, function (opt) {
|
|
454
454
|
var isLeaf = opt.isLeaf,
|
|
455
455
|
loading = opt.loading,
|
|
456
456
|
value = opt[fieldNames.value],
|
|
@@ -474,9 +474,9 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
474
474
|
}, label), loading ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
475
475
|
type: "loadding-circle",
|
|
476
476
|
spin: true
|
|
477
|
-
}) : (
|
|
477
|
+
}) : (children === null || children === void 0 ? void 0 : children.length) || isLeaf === false ? props.expandIcon || /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
478
478
|
type: "arrow-right"
|
|
479
|
-
}))
|
|
479
|
+
}) : null);
|
|
480
480
|
return /*#__PURE__*/_react.default.createElement(CascaderMenuSubmenu, (0, _extends2.default)({
|
|
481
481
|
key: value
|
|
482
482
|
}, {
|
|
@@ -493,8 +493,8 @@ var Cascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
493
493
|
},
|
|
494
494
|
className: "".concat(prefixCls, "-checkbox")
|
|
495
495
|
}), node) : node);
|
|
496
|
-
}));
|
|
497
|
-
}) : /*#__PURE__*/_react.default.createElement(_empty.default, {
|
|
496
|
+
}) : null);
|
|
497
|
+
}) : null : /*#__PURE__*/_react.default.createElement(_empty.default, {
|
|
498
498
|
description: notFoundContent
|
|
499
499
|
}));
|
|
500
500
|
var cascaderPopper = dropdownRender(cascaderMenus);
|
|
@@ -476,10 +476,6 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
476
476
|
var _a;
|
|
477
477
|
return (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
478
478
|
},
|
|
479
|
-
onBlur: function onBlur() {
|
|
480
|
-
var _a;
|
|
481
|
-
return (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
482
|
-
},
|
|
483
479
|
onKeyDown: onInternalKeyDown
|
|
484
480
|
}, renderSingle()));
|
|
485
481
|
};
|