@douyinfe/semi-ui 2.37.0-beta.0 → 2.38.0-beta.0
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/css/semi.css +11 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +43 -17
- 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/badge/index.d.ts +1 -1
- package/lib/cjs/cascader/index.js +1 -1
- package/lib/cjs/image/preview.js +4 -2
- package/lib/cjs/input/index.d.ts +1 -0
- package/lib/cjs/input/index.js +15 -1
- package/lib/cjs/pagination/index.js +1 -1
- package/lib/cjs/toast/useToast/index.js +16 -8
- package/lib/cjs/tree/index.js +2 -2
- package/lib/cjs/treeSelect/index.js +3 -1
- package/lib/es/badge/index.d.ts +1 -1
- package/lib/es/cascader/index.js +1 -1
- package/lib/es/image/preview.js +4 -2
- package/lib/es/input/index.d.ts +1 -0
- package/lib/es/input/index.js +15 -1
- package/lib/es/pagination/index.js +1 -1
- package/lib/es/toast/useToast/index.js +14 -8
- package/lib/es/tree/index.js +2 -2
- package/lib/es/treeSelect/index.js +3 -1
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -27724,6 +27724,21 @@ class Input extends BaseComponent {
|
|
|
27724
27724
|
this.handleModeChange(mode);
|
|
27725
27725
|
}
|
|
27726
27726
|
}
|
|
27727
|
+
componentDidMount() {
|
|
27728
|
+
// autofocus is changed from the original support of input to the support of manually calling the focus method,
|
|
27729
|
+
// so that preventScroll can still take effect under the setting of autofocus
|
|
27730
|
+
this.foundation.init();
|
|
27731
|
+
const {
|
|
27732
|
+
disabled,
|
|
27733
|
+
autofocus,
|
|
27734
|
+
preventScroll
|
|
27735
|
+
} = this.props;
|
|
27736
|
+
if (!disabled && autofocus) {
|
|
27737
|
+
this.inputRef.current.focus({
|
|
27738
|
+
preventScroll
|
|
27739
|
+
});
|
|
27740
|
+
}
|
|
27741
|
+
}
|
|
27727
27742
|
renderPrepend() {
|
|
27728
27743
|
const {
|
|
27729
27744
|
addonBefore
|
|
@@ -27948,7 +27963,6 @@ class Input extends BaseComponent {
|
|
|
27948
27963
|
const inputValue = value === null || value === undefined ? '' : value;
|
|
27949
27964
|
const inputProps = Object.assign(Object.assign({}, rest), {
|
|
27950
27965
|
style: inputStyle,
|
|
27951
|
-
autoFocus: autofocus,
|
|
27952
27966
|
className: inputCls,
|
|
27953
27967
|
disabled,
|
|
27954
27968
|
readOnly: readonly,
|
|
@@ -43286,7 +43300,7 @@ class Cascader extends BaseComponent {
|
|
|
43286
43300
|
const renderPlusNChildren = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
43287
43301
|
className: plusNCls
|
|
43288
43302
|
}, "+", hiddenTag.length);
|
|
43289
|
-
return showRestTagsPopover
|
|
43303
|
+
return showRestTagsPopover ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(popover_0, Object.assign({
|
|
43290
43304
|
content: hiddenTag,
|
|
43291
43305
|
showArrow: true,
|
|
43292
43306
|
trigger: "hover",
|
|
@@ -69489,7 +69503,7 @@ class Pagination extends BaseComponent {
|
|
|
69489
69503
|
"aria-label": "Next",
|
|
69490
69504
|
onClick: e => !isDisabled && this.foundation.goNext(e),
|
|
69491
69505
|
className: nextClassName,
|
|
69492
|
-
"x-semi-prop": "
|
|
69506
|
+
"x-semi-prop": "nextText"
|
|
69493
69507
|
}, nextText || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(IconChevronRight, {
|
|
69494
69508
|
size: "large"
|
|
69495
69509
|
}));
|
|
@@ -84211,6 +84225,7 @@ const HookToast = (_a, ref) => {
|
|
|
84211
84225
|
|
|
84212
84226
|
|
|
84213
84227
|
|
|
84228
|
+
|
|
84214
84229
|
// const ref = null;
|
|
84215
84230
|
// TODO: toast larger than N bars, automatic folding, allowing expansion, N configurable
|
|
84216
84231
|
const defaultOpts = {
|
|
@@ -84238,7 +84253,7 @@ function useToast_usePatchElement() {
|
|
|
84238
84253
|
}
|
|
84239
84254
|
function useToast() {
|
|
84240
84255
|
const [elements, patchElement] = useToast_usePatchElement();
|
|
84241
|
-
const toastRef = new Map();
|
|
84256
|
+
const toastRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(new Map());
|
|
84242
84257
|
const addToast = config => {
|
|
84243
84258
|
const id = getUuid('semi_toast_');
|
|
84244
84259
|
const mergeConfig = Object.assign(Object.assign({}, config), {
|
|
@@ -84246,20 +84261,25 @@ function useToast() {
|
|
|
84246
84261
|
});
|
|
84247
84262
|
// eslint-disable-next-line prefer-const
|
|
84248
84263
|
let closeFunc;
|
|
84249
|
-
const ref = ele => {
|
|
84250
|
-
toastRef.set(id, ele);
|
|
84251
|
-
};
|
|
84252
84264
|
const toast = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(useToast_HookToast, Object.assign({}, mergeConfig, {
|
|
84253
84265
|
key: id,
|
|
84254
84266
|
afterClose: instanceId => closeFunc(instanceId),
|
|
84255
|
-
ref:
|
|
84267
|
+
ref: data => {
|
|
84268
|
+
var _a;
|
|
84269
|
+
toastRef.current.set(id, {
|
|
84270
|
+
close: (_a = data === null || data === void 0 ? void 0 : data.close) !== null && _a !== void 0 ? _a : (noop_default())
|
|
84271
|
+
});
|
|
84272
|
+
}
|
|
84256
84273
|
}));
|
|
84257
84274
|
closeFunc = patchElement(toast, Object.assign({}, mergeConfig));
|
|
84258
84275
|
return id;
|
|
84259
84276
|
};
|
|
84260
84277
|
const removeElement = id => {
|
|
84261
|
-
|
|
84262
|
-
|
|
84278
|
+
var _a;
|
|
84279
|
+
const {
|
|
84280
|
+
close
|
|
84281
|
+
} = (_a = toastRef.current.get(id)) !== null && _a !== void 0 ? _a : {};
|
|
84282
|
+
close === null || close === void 0 ? void 0 : close();
|
|
84263
84283
|
};
|
|
84264
84284
|
return [{
|
|
84265
84285
|
success: config => addToast(Object.assign(Object.assign(Object.assign({}, defaultOpts), config), {
|
|
@@ -84719,13 +84739,14 @@ class TreeFoundation extends foundation {
|
|
|
84719
84739
|
filteredShownKeys = new Set([...shownChildKeys, ...expandedOptsKeys]);
|
|
84720
84740
|
flattenNodes = flattenTreeData(treeData, new Set(expandedOptsKeys), showFilteredOnly && filteredShownKeys);
|
|
84721
84741
|
}
|
|
84722
|
-
|
|
84742
|
+
const newFilteredExpandedKeys = new Set(expandedOptsKeys);
|
|
84743
|
+
this._adapter.notifySearch(sugInput, Array.from(newFilteredExpandedKeys));
|
|
84723
84744
|
this._adapter.updateState({
|
|
84724
84745
|
expandedKeys,
|
|
84725
84746
|
flattenNodes,
|
|
84726
84747
|
motionKeys: new Set([]),
|
|
84727
84748
|
filteredKeys: new Set(filteredOptsKeys),
|
|
84728
|
-
filteredExpandedKeys:
|
|
84749
|
+
filteredExpandedKeys: newFilteredExpandedKeys,
|
|
84729
84750
|
filteredShownKeys
|
|
84730
84751
|
});
|
|
84731
84752
|
}
|
|
@@ -86286,8 +86307,8 @@ class Tree extends BaseComponent {
|
|
|
86286
86307
|
notifyChange: value => {
|
|
86287
86308
|
this.props.onChange && this.props.onChange(value);
|
|
86288
86309
|
},
|
|
86289
|
-
notifySearch: input => {
|
|
86290
|
-
this.props.onSearch && this.props.onSearch(input);
|
|
86310
|
+
notifySearch: (input, filteredExpandedKeys) => {
|
|
86311
|
+
this.props.onSearch && this.props.onSearch(input, filteredExpandedKeys);
|
|
86291
86312
|
},
|
|
86292
86313
|
notifyRightClick: (e, node) => {
|
|
86293
86314
|
this.props.onContextMenu && this.props.onContextMenu(e, node);
|
|
@@ -87935,7 +87956,8 @@ class TreeSelect extends BaseComponent {
|
|
|
87935
87956
|
searchPosition,
|
|
87936
87957
|
searchAutoFocus,
|
|
87937
87958
|
multiple,
|
|
87938
|
-
disabled
|
|
87959
|
+
disabled,
|
|
87960
|
+
preventScroll
|
|
87939
87961
|
} = this.props;
|
|
87940
87962
|
const isDropdownPositionSearch = searchPosition === treeSelect_constants_strings.SEARCH_POSITION_DROPDOWN;
|
|
87941
87963
|
const inputcls = classnames_default()({
|
|
@@ -87948,6 +87970,7 @@ class TreeSelect extends BaseComponent {
|
|
|
87948
87970
|
const baseInputProps = {
|
|
87949
87971
|
value: inputValue,
|
|
87950
87972
|
className: inputcls,
|
|
87973
|
+
preventScroll,
|
|
87951
87974
|
onChange: value => this.search(value)
|
|
87952
87975
|
};
|
|
87953
87976
|
const inputDropdownProps = {
|
|
@@ -89322,6 +89345,7 @@ class UploadFoundation extends foundation {
|
|
|
89322
89345
|
newFileList[index].fileInstance = fileInstance;
|
|
89323
89346
|
newFileList[index].size = getFileSize(fileInstance.size);
|
|
89324
89347
|
newFileList[index].name = fileInstance.name;
|
|
89348
|
+
newFileList[index].url = this._createURL(fileInstance);
|
|
89325
89349
|
}
|
|
89326
89350
|
newFileList[index].shouldUpload = shouldUpload;
|
|
89327
89351
|
}
|
|
@@ -97678,6 +97702,7 @@ var preview_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
97678
97702
|
|
|
97679
97703
|
|
|
97680
97704
|
|
|
97705
|
+
|
|
97681
97706
|
const preview_prefixCls = image_constants_cssClasses.PREFIX;
|
|
97682
97707
|
class Preview extends BaseComponent {
|
|
97683
97708
|
get adapter() {
|
|
@@ -97799,10 +97824,11 @@ class Preview extends BaseComponent {
|
|
|
97799
97824
|
const _a = this.props,
|
|
97800
97825
|
{
|
|
97801
97826
|
src,
|
|
97827
|
+
className,
|
|
97802
97828
|
style,
|
|
97803
97829
|
lazyLoad
|
|
97804
97830
|
} = _a,
|
|
97805
|
-
restProps = preview_rest(_a, ["src", "style", "lazyLoad"]);
|
|
97831
|
+
restProps = preview_rest(_a, ["src", "className", "style", "lazyLoad"]);
|
|
97806
97832
|
const {
|
|
97807
97833
|
currentIndex,
|
|
97808
97834
|
visible
|
|
@@ -97829,7 +97855,7 @@ class Preview extends BaseComponent {
|
|
|
97829
97855
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
97830
97856
|
id: this.previewGroupId,
|
|
97831
97857
|
style: style,
|
|
97832
|
-
className: `${preview_prefixCls}-preview-group
|
|
97858
|
+
className: classnames_default()(`${preview_prefixCls}-preview-group`, className)
|
|
97833
97859
|
}, newChildren), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(PreviewInner, Object.assign({}, restProps, {
|
|
97834
97860
|
ref: this.previewRef,
|
|
97835
97861
|
src: finalSrcList,
|