@douyinfe/semi-ui 2.51.0-beta.0 → 2.51.1
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 +49 -12
- 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.js +1 -1
- package/lib/cjs/image/interface.d.ts +1 -0
- package/lib/cjs/image/previewFooter.js +4 -2
- package/lib/cjs/image/previewInner.js +2 -1
- package/lib/cjs/modal/Modal.js +2 -0
- package/lib/es/cascader/index.js +1 -1
- package/lib/es/image/interface.d.ts +1 -0
- package/lib/es/image/previewFooter.js +4 -2
- package/lib/es/image/previewInner.js +3 -2
- package/lib/es/modal/Modal.js +2 -0
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -48261,7 +48261,7 @@ class Cascader extends BaseComponent {
|
|
|
48261
48261
|
const formatValuePath = [];
|
|
48262
48262
|
normalizedValue.forEach(valueItem => {
|
|
48263
48263
|
const formatItem = onChangeWithObject && isObject_default()(valueItem[0]) ? valueItem.map(i => i === null || i === void 0 ? void 0 : i.value) : valueItem;
|
|
48264
|
-
formatValuePath.push(formatItem);
|
|
48264
|
+
formatItem.length > 0 && formatValuePath.push(formatItem);
|
|
48265
48265
|
});
|
|
48266
48266
|
// formatKeys is used to save key of value
|
|
48267
48267
|
const formatKeys = formatValuePath.map(v => getKeyByValuePath(v));
|
|
@@ -61321,6 +61321,9 @@ class ModalFoundation extends foundation {
|
|
|
61321
61321
|
this._adapter.enabledBodyScroll();
|
|
61322
61322
|
this._adapter.notifyClose();
|
|
61323
61323
|
}
|
|
61324
|
+
enabledBodyScroll() {
|
|
61325
|
+
this._adapter.enabledBodyScroll();
|
|
61326
|
+
}
|
|
61324
61327
|
}
|
|
61325
61328
|
;// CONCATENATED MODULE: ../semi-foundation/modal/modalContentFoundation.ts
|
|
61326
61329
|
|
|
@@ -62377,6 +62380,8 @@ class Modal extends BaseComponent {
|
|
|
62377
62380
|
componentWillUnmount() {
|
|
62378
62381
|
if (this.props.visible) {
|
|
62379
62382
|
this.foundation.destroy();
|
|
62383
|
+
} else {
|
|
62384
|
+
this.foundation.enabledBodyScroll();
|
|
62380
62385
|
}
|
|
62381
62386
|
}
|
|
62382
62387
|
render() {
|
|
@@ -64318,15 +64323,21 @@ class TextAreaFoundation extends foundation {
|
|
|
64318
64323
|
maxLength,
|
|
64319
64324
|
getValueLength
|
|
64320
64325
|
} = this._adapter.getProps();
|
|
64321
|
-
if (isNumber_default()(maxLength) && maxLength >= 0 &&
|
|
64322
|
-
|
|
64323
|
-
|
|
64324
|
-
|
|
64325
|
-
|
|
64326
|
-
|
|
64326
|
+
if (isNumber_default()(maxLength) && maxLength >= 0 && isString_default()(value)) {
|
|
64327
|
+
if (isFunction_default()(getValueLength)) {
|
|
64328
|
+
const valueLength = getValueLength(value);
|
|
64329
|
+
if (valueLength > maxLength) {
|
|
64330
|
+
console.warn('[Semi TextArea] The input character is truncated because the input length exceeds the maximum length limit');
|
|
64331
|
+
const truncatedValue = this.handleTruncateValue(value, maxLength);
|
|
64332
|
+
return truncatedValue;
|
|
64333
|
+
}
|
|
64327
64334
|
} else {
|
|
64328
|
-
|
|
64335
|
+
if (value.length > maxLength) {
|
|
64336
|
+
console.warn('[Semi TextArea] The input character is truncated because the input length exceeds the maximum length limit');
|
|
64337
|
+
return value.slice(0, maxLength);
|
|
64338
|
+
}
|
|
64329
64339
|
}
|
|
64340
|
+
return value;
|
|
64330
64341
|
}
|
|
64331
64342
|
return undefined;
|
|
64332
64343
|
}
|
|
@@ -64366,8 +64377,28 @@ class TextAreaFoundation extends foundation {
|
|
|
64366
64377
|
const {
|
|
64367
64378
|
value
|
|
64368
64379
|
} = this.getStates();
|
|
64380
|
+
const {
|
|
64381
|
+
maxLength
|
|
64382
|
+
} = this.getProps();
|
|
64383
|
+
let realValue = value;
|
|
64384
|
+
if (maxLength) {
|
|
64385
|
+
// 如果设置了 maxLength,在中文输输入过程中,如果点击外部触发 blur,则拼音字符的所有内容会回显,
|
|
64386
|
+
// 该表现不符合 maxLength 规定,因此需要在 blur 的时候二次确认
|
|
64387
|
+
// 详情见 https://github.com/DouyinFE/semi-design/issues/2005
|
|
64388
|
+
// If maxLength is set, during the Chinese input process, if you click outside to trigger blur,
|
|
64389
|
+
// all the contents of the Pinyin characters will be echoed.
|
|
64390
|
+
// This behavior does not meet the maxLength requirement, so we need to confirm twice when blurring。
|
|
64391
|
+
// For details, see https://github.com/DouyinFE/semi-design/issues/2005
|
|
64392
|
+
realValue = this.handleVisibleMaxLength(value);
|
|
64393
|
+
if (realValue !== value) {
|
|
64394
|
+
if (!this._isControlledComponent()) {
|
|
64395
|
+
this._adapter.setValue(realValue);
|
|
64396
|
+
}
|
|
64397
|
+
this._adapter.notifyChange(realValue, e);
|
|
64398
|
+
}
|
|
64399
|
+
}
|
|
64369
64400
|
this._adapter.toggleFocusing(false);
|
|
64370
|
-
this._adapter.notifyBlur(
|
|
64401
|
+
this._adapter.notifyBlur(realValue, e);
|
|
64371
64402
|
}
|
|
64372
64403
|
handleKeyDown(e) {
|
|
64373
64404
|
this._adapter.notifyKeyDown(e);
|
|
@@ -99055,6 +99086,9 @@ ArrayFieldComponent.contextType = FormUpdaterContext;
|
|
|
99055
99086
|
const image_constants_cssClasses = {
|
|
99056
99087
|
PREFIX: `${BASE_CLASS_PREFIX}-image`
|
|
99057
99088
|
};
|
|
99089
|
+
const image_constants_numbers = {
|
|
99090
|
+
DEFAULT_Z_INDEX: 1070
|
|
99091
|
+
};
|
|
99058
99092
|
|
|
99059
99093
|
;// CONCATENATED MODULE: ../semi-icons/lib/es/icons/IconUploadError.js
|
|
99060
99094
|
|
|
@@ -99418,11 +99452,13 @@ class previewFooter_Footer extends BaseComponent {
|
|
|
99418
99452
|
// 根据 props 中的 showTooltip 决定是否使用 Tooltip 包一层
|
|
99419
99453
|
this.getFinalIconElement = (element, content, key) => {
|
|
99420
99454
|
const {
|
|
99421
|
-
showTooltip
|
|
99455
|
+
showTooltip,
|
|
99456
|
+
zIndex
|
|
99422
99457
|
} = this.props;
|
|
99423
99458
|
return showTooltip ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Tooltip, {
|
|
99424
99459
|
content: content,
|
|
99425
|
-
key: `tooltip-${key}
|
|
99460
|
+
key: `tooltip-${key}`,
|
|
99461
|
+
zIndex: zIndex + 1
|
|
99426
99462
|
}, element) : element;
|
|
99427
99463
|
};
|
|
99428
99464
|
this.getLocalTextByKey = key => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(LocaleConsumer, {
|
|
@@ -100875,6 +100911,7 @@ class PreviewInner extends BaseComponent {
|
|
|
100875
100911
|
ratio: ratio,
|
|
100876
100912
|
prevTip: prevTip,
|
|
100877
100913
|
nextTip: nextTip,
|
|
100914
|
+
zIndex: zIndex,
|
|
100878
100915
|
zoomInTip: zoomInTip,
|
|
100879
100916
|
zoomOutTip: zoomOutTip,
|
|
100880
100917
|
rotateTip: rotateTip,
|
|
@@ -100945,7 +100982,7 @@ PreviewInner.defaultProps = {
|
|
|
100945
100982
|
lazyLoad: false,
|
|
100946
100983
|
preLoad: true,
|
|
100947
100984
|
preLoadGap: 2,
|
|
100948
|
-
zIndex:
|
|
100985
|
+
zIndex: image_constants_numbers.DEFAULT_Z_INDEX,
|
|
100949
100986
|
maskClosable: true,
|
|
100950
100987
|
viewerVisibleDelay: 10000,
|
|
100951
100988
|
maxZoom: 5,
|