@douyinfe/semi-ui 2.45.3-alpha.0 → 2.45.3
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/umd/semi-ui.js +45 -34
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/cascader/index.d.ts +2 -0
- package/lib/cjs/cascader/index.js +14 -0
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +2 -2
- package/lib/cjs/form/field.d.ts +2 -2
- package/lib/cjs/modal/confirm.d.ts +9 -9
- package/lib/cjs/select/index.js +1 -1
- package/lib/cjs/select/utils.js +5 -1
- package/lib/cjs/treeSelect/index.d.ts +1 -1
- package/lib/cjs/treeSelect/index.js +2 -2
- package/lib/cjs/typography/base.d.ts +2 -1
- package/lib/cjs/typography/base.js +5 -16
- package/lib/cjs/typography/interface.d.ts +1 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/cascader/index.d.ts +2 -0
- package/lib/es/cascader/index.js +14 -0
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +2 -2
- package/lib/es/form/field.d.ts +2 -2
- package/lib/es/modal/confirm.d.ts +9 -9
- package/lib/es/select/index.js +1 -1
- package/lib/es/select/utils.js +5 -1
- package/lib/es/treeSelect/index.d.ts +1 -1
- package/lib/es/treeSelect/index.js +2 -2
- package/lib/es/typography/base.d.ts +2 -1
- package/lib/es/typography/base.js +5 -16
- package/lib/es/typography/interface.d.ts +1 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -17962,9 +17962,6 @@ Typography.propTypes = {
|
|
|
17962
17962
|
className: (prop_types_default()).string
|
|
17963
17963
|
};
|
|
17964
17964
|
/* harmony default export */ const typography_typography = (Typography);
|
|
17965
|
-
// EXTERNAL MODULE: ../../node_modules/lodash/isFunction.js
|
|
17966
|
-
var isFunction = __webpack_require__("2q8g");
|
|
17967
|
-
var isFunction_default = /*#__PURE__*/__webpack_require__.n(isFunction);
|
|
17968
17965
|
// EXTERNAL MODULE: ../../node_modules/lodash/isNull.js
|
|
17969
17966
|
var isNull = __webpack_require__("R7V3");
|
|
17970
17967
|
var isNull_default = /*#__PURE__*/__webpack_require__.n(isNull);
|
|
@@ -17983,6 +17980,9 @@ var isUndefined_default = /*#__PURE__*/__webpack_require__.n(isUndefined);
|
|
|
17983
17980
|
// EXTERNAL MODULE: ../../node_modules/lodash/isEqual.js
|
|
17984
17981
|
var isEqual = __webpack_require__("nnRT");
|
|
17985
17982
|
var isEqual_default = /*#__PURE__*/__webpack_require__.n(isEqual);
|
|
17983
|
+
// EXTERNAL MODULE: ../../node_modules/lodash/isFunction.js
|
|
17984
|
+
var isFunction = __webpack_require__("2q8g");
|
|
17985
|
+
var isFunction_default = /*#__PURE__*/__webpack_require__.n(isFunction);
|
|
17986
17986
|
// EXTERNAL MODULE: ../../node_modules/lodash/isEmpty.js
|
|
17987
17987
|
var isEmpty = __webpack_require__("MwrP");
|
|
17988
17988
|
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty);
|
|
@@ -23676,7 +23676,6 @@ ReactResizeObserver.defaultProps = {
|
|
|
23676
23676
|
|
|
23677
23677
|
|
|
23678
23678
|
|
|
23679
|
-
|
|
23680
23679
|
var base_rest = undefined && undefined.__rest || function (s, e) {
|
|
23681
23680
|
var t = {};
|
|
23682
23681
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -23767,7 +23766,6 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
|
|
|
23767
23766
|
return updateOverflow;
|
|
23768
23767
|
};
|
|
23769
23768
|
this.showTooltip = () => {
|
|
23770
|
-
var _a, _b;
|
|
23771
23769
|
const {
|
|
23772
23770
|
isOverflowed,
|
|
23773
23771
|
isTruncated,
|
|
@@ -23785,7 +23783,8 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
|
|
|
23785
23783
|
return show;
|
|
23786
23784
|
}
|
|
23787
23785
|
const defaultOpts = {
|
|
23788
|
-
type: 'tooltip'
|
|
23786
|
+
type: 'tooltip',
|
|
23787
|
+
opts: {}
|
|
23789
23788
|
};
|
|
23790
23789
|
if (typeof showTooltip === 'object') {
|
|
23791
23790
|
if (showTooltip.type && showTooltip.type.toLowerCase() === 'popover') {
|
|
@@ -23794,14 +23793,7 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
|
|
|
23794
23793
|
// style: { width: '240px' },
|
|
23795
23794
|
showArrow: true
|
|
23796
23795
|
}
|
|
23797
|
-
}, showTooltip
|
|
23798
|
-
opts: {
|
|
23799
|
-
className: classnames_default()({
|
|
23800
|
-
[`${base_prefixCls}-ellipsis-popover`]: true,
|
|
23801
|
-
[(_a = showTooltip === null || showTooltip === void 0 ? void 0 : showTooltip.opts) === null || _a === void 0 ? void 0 : _a.className]: Boolean((_b = showTooltip === null || showTooltip === void 0 ? void 0 : showTooltip.opts) === null || _b === void 0 ? void 0 : _b.className)
|
|
23802
|
-
})
|
|
23803
|
-
}
|
|
23804
|
-
});
|
|
23796
|
+
}, showTooltip);
|
|
23805
23797
|
}
|
|
23806
23798
|
return Object.assign(Object.assign({}, defaultOpts), showTooltip);
|
|
23807
23799
|
}
|
|
@@ -24203,12 +24195,9 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
|
|
|
24203
24195
|
if (showTooltip) {
|
|
24204
24196
|
const {
|
|
24205
24197
|
type,
|
|
24206
|
-
opts
|
|
24207
|
-
renderTooltip
|
|
24198
|
+
opts
|
|
24208
24199
|
} = showTooltip;
|
|
24209
|
-
if (
|
|
24210
|
-
return renderTooltip(children, content);
|
|
24211
|
-
} else if (type.toLowerCase() === 'popover') {
|
|
24200
|
+
if (type.toLowerCase() === 'popover') {
|
|
24212
24201
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(popover_0, Object.assign({
|
|
24213
24202
|
content: children,
|
|
24214
24203
|
position: "top"
|
|
@@ -37008,6 +36997,8 @@ class CascaderFoundation extends foundation {
|
|
|
37008
36997
|
init() {
|
|
37009
36998
|
const isOpen = this.getProp('open') || this.getProp('defaultOpen');
|
|
37010
36999
|
this.collectOptions(true);
|
|
37000
|
+
this._adapter.updateLoadingKeyRefValue(new Set());
|
|
37001
|
+
this._adapter.updateLoadedKeyRefValue(new Set());
|
|
37011
37002
|
if (isOpen && !this._isDisabled()) {
|
|
37012
37003
|
this.open();
|
|
37013
37004
|
}
|
|
@@ -37194,11 +37185,11 @@ class CascaderFoundation extends foundation {
|
|
|
37194
37185
|
} = this.getProps();
|
|
37195
37186
|
const {
|
|
37196
37187
|
activeKeys,
|
|
37197
|
-
loadingKeys,
|
|
37198
37188
|
loading,
|
|
37199
37189
|
keyEntities: keyEntityState,
|
|
37200
37190
|
selectedKeys: selectedKeysState
|
|
37201
37191
|
} = this.getStates();
|
|
37192
|
+
const loadingKeys = this._adapter.getLoadingKeyRefValue();
|
|
37202
37193
|
const filterable = this._isFilterable();
|
|
37203
37194
|
const loadingActive = [...activeKeys].filter(i => loadingKeys.has(i));
|
|
37204
37195
|
const valuePath = onChangeWithObject ? util_normalizedArr(value).map(i => i.value) : util_normalizedArr(value);
|
|
@@ -37446,17 +37437,18 @@ class CascaderFoundation extends foundation {
|
|
|
37446
37437
|
data,
|
|
37447
37438
|
key
|
|
37448
37439
|
} = item;
|
|
37449
|
-
const
|
|
37450
|
-
|
|
37451
|
-
loadingKeys: prevLoadingKeys
|
|
37452
|
-
} = this.getCopyFromState(['loadedKeys', 'loadingKeys']);
|
|
37440
|
+
const prevLoadingKeys = cloneDeep_default()(this._adapter.getLoadingKeyRefValue());
|
|
37441
|
+
const prevLoadedKeys = cloneDeep_default()(this._adapter.getLoadedKeyRefValue());
|
|
37453
37442
|
const newLoadedKeys = prevLoadedKeys.add(key);
|
|
37454
37443
|
const newLoadingKeys = new Set([...prevLoadingKeys]);
|
|
37455
37444
|
newLoadingKeys.delete(key);
|
|
37456
37445
|
// onLoad should trigger before internal setState to avoid `loadData` trigger twice.
|
|
37457
37446
|
this._adapter.notifyOnLoad(newLoadedKeys, data);
|
|
37447
|
+
this._adapter.updateLoadingKeyRefValue(newLoadingKeys);
|
|
37448
|
+
this._adapter.updateLoadedKeyRefValue(newLoadedKeys);
|
|
37458
37449
|
this._adapter.updateStates({
|
|
37459
|
-
loadingKeys: newLoadingKeys
|
|
37450
|
+
loadingKeys: newLoadingKeys,
|
|
37451
|
+
loadedKeys: newLoadedKeys
|
|
37460
37452
|
});
|
|
37461
37453
|
}
|
|
37462
37454
|
notifyIfLoadData(item) {
|
|
@@ -37468,10 +37460,8 @@ class CascaderFoundation extends foundation {
|
|
|
37468
37460
|
loading: false
|
|
37469
37461
|
});
|
|
37470
37462
|
if (!data.isLeaf && !data.children && this.getProp('loadData')) {
|
|
37471
|
-
const
|
|
37472
|
-
|
|
37473
|
-
loadingKeys
|
|
37474
|
-
} = this.getCopyFromState(['loadedKeys', 'loadingKeys']);
|
|
37463
|
+
const loadedKeys = this._adapter.getLoadedKeyRefValue();
|
|
37464
|
+
const loadingKeys = cloneDeep_default()(this._adapter.getLoadingKeyRefValue());
|
|
37475
37465
|
if (loadedKeys.has(key) || loadingKeys.has(key)) {
|
|
37476
37466
|
return;
|
|
37477
37467
|
}
|
|
@@ -37482,8 +37472,10 @@ class CascaderFoundation extends foundation {
|
|
|
37482
37472
|
keyEntities
|
|
37483
37473
|
} = this.getStates();
|
|
37484
37474
|
const optionPath = this.getItemPropPath(key, [], keyEntities);
|
|
37475
|
+
const newLoadingKeys = loadingKeys.add(key);
|
|
37476
|
+
this._adapter.updateLoadingKeyRefValue(newLoadingKeys);
|
|
37485
37477
|
this._adapter.updateStates({
|
|
37486
|
-
loadingKeys:
|
|
37478
|
+
loadingKeys: newLoadingKeys
|
|
37487
37479
|
});
|
|
37488
37480
|
this._adapter.notifyLoadData(optionPath, this.handleNodeLoad.bind(this, item));
|
|
37489
37481
|
}
|
|
@@ -47979,6 +47971,8 @@ class Cascader extends BaseComponent {
|
|
|
47979
47971
|
this.optionsRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
47980
47972
|
this.clickOutsideHandler = null;
|
|
47981
47973
|
this.foundation = new CascaderFoundation(this.adapter);
|
|
47974
|
+
this.loadingKeysRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
47975
|
+
this.loadedKeysRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
47982
47976
|
}
|
|
47983
47977
|
get adapter() {
|
|
47984
47978
|
var _this = this;
|
|
@@ -48124,6 +48118,18 @@ class Cascader extends BaseComponent {
|
|
|
48124
48118
|
this.setState({
|
|
48125
48119
|
isFocus
|
|
48126
48120
|
});
|
|
48121
|
+
},
|
|
48122
|
+
updateLoadingKeyRefValue: keys => {
|
|
48123
|
+
this.loadingKeysRef.current = keys;
|
|
48124
|
+
},
|
|
48125
|
+
getLoadingKeyRefValue: () => {
|
|
48126
|
+
return this.loadingKeysRef.current;
|
|
48127
|
+
},
|
|
48128
|
+
updateLoadedKeyRefValue: keys => {
|
|
48129
|
+
this.loadedKeysRef.current = keys;
|
|
48130
|
+
},
|
|
48131
|
+
getLoadedKeyRefValue: () => {
|
|
48132
|
+
return this.loadedKeysRef.current;
|
|
48127
48133
|
}
|
|
48128
48134
|
});
|
|
48129
48135
|
}
|
|
@@ -69890,6 +69896,7 @@ class SelectFoundation extends foundation {
|
|
|
69890
69896
|
delete newOption._show;
|
|
69891
69897
|
delete newOption._selected;
|
|
69892
69898
|
delete newOption._scrollIndex;
|
|
69899
|
+
delete newOption._keyInJsx;
|
|
69893
69900
|
if ('_keyInOptionList' in newOption) {
|
|
69894
69901
|
newOption.key = newOption._keyInOptionList;
|
|
69895
69902
|
delete newOption._keyInOptionList;
|
|
@@ -70275,7 +70282,7 @@ const generateOption = (child, parent, index) => {
|
|
|
70275
70282
|
}
|
|
70276
70283
|
const option = Object.assign(Object.assign({
|
|
70277
70284
|
value: childProps.value,
|
|
70278
|
-
//
|
|
70285
|
+
// Dropdown menu rendering priority label value, children, value in turn downgrade
|
|
70279
70286
|
label: childProps.label || childProps.children || childProps.value,
|
|
70280
70287
|
_show: true,
|
|
70281
70288
|
_selected: false,
|
|
@@ -70283,6 +70290,10 @@ const generateOption = (child, parent, index) => {
|
|
|
70283
70290
|
}, childProps), {
|
|
70284
70291
|
_parentGroup: parent
|
|
70285
70292
|
});
|
|
70293
|
+
// Props are collected from ReactNode, after React.Children.toArray
|
|
70294
|
+
// no need to determine whether the key exists in child
|
|
70295
|
+
// Even if the user does not explicitly declare it, React will always generate a key.
|
|
70296
|
+
option._keyInJsx = child.key;
|
|
70286
70297
|
return option;
|
|
70287
70298
|
};
|
|
70288
70299
|
const getOptionsFromGroup = selectChildren => {
|
|
@@ -71080,7 +71091,7 @@ class Select extends BaseComponent {
|
|
|
71080
71091
|
focused: isFocused,
|
|
71081
71092
|
onMouseEnter: () => this.onOptionHover(optionIndex),
|
|
71082
71093
|
style: optionStyle,
|
|
71083
|
-
key: option.
|
|
71094
|
+
key: option._keyInOptionList || option._keyInJsx || option.label + option.value + optionIndex,
|
|
71084
71095
|
renderOptionItem: renderOptionItem,
|
|
71085
71096
|
inputValue: inputValue,
|
|
71086
71097
|
semiOptionId: `${this.selectID}-option-${optionIndex}`
|
|
@@ -90411,7 +90422,7 @@ class TreeSelect extends BaseComponent {
|
|
|
90411
90422
|
} = item && treeNodeLabelProp in item ? renderSelectedItem(item, {
|
|
90412
90423
|
index,
|
|
90413
90424
|
onClose
|
|
90414
|
-
}) :
|
|
90425
|
+
}) : {};
|
|
90415
90426
|
if (isNull_default()(content) || isUndefined_default()(content)) {
|
|
90416
90427
|
return;
|
|
90417
90428
|
}
|
|
@@ -90707,7 +90718,7 @@ class TreeSelect extends BaseComponent {
|
|
|
90707
90718
|
} = item && treeNodeLabelProp in item ? renderSelectedItem(item, {
|
|
90708
90719
|
index: idx,
|
|
90709
90720
|
onClose
|
|
90710
|
-
}) :
|
|
90721
|
+
}) : {};
|
|
90711
90722
|
if (isRenderInTag) {
|
|
90712
90723
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Tag, Object.assign({}, tagProps), content);
|
|
90713
90724
|
} else {
|