@douyinfe/semi-ui 2.57.0-beta.0 → 2.57.1-alpha.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/README.md +1 -1
- package/dist/css/semi.css +21 -3
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +99 -87
- 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/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/form/hoc/withField.js +11 -4
- package/lib/cjs/image/image.js +7 -3
- package/lib/cjs/image/interface.d.ts +2 -0
- package/lib/cjs/input/index.js +3 -3
- package/lib/cjs/input/textarea.js +4 -2
- package/lib/cjs/modal/confirm.d.ts +9 -9
- package/lib/cjs/slider/index.js +4 -2
- package/lib/cjs/table/Body/BaseRow.js +1 -1
- package/lib/cjs/table/interface.d.ts +1 -1
- package/lib/cjs/tagInput/index.js +8 -3
- package/lib/cjs/tooltip/index.js +10 -1
- package/lib/cjs/treeSelect/index.js +44 -39
- package/lib/cjs/typography/title.d.ts +1 -1
- 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/form/hoc/withField.js +11 -4
- package/lib/es/image/image.js +7 -3
- package/lib/es/image/interface.d.ts +2 -0
- package/lib/es/input/index.js +3 -3
- package/lib/es/input/textarea.js +4 -2
- package/lib/es/modal/confirm.d.ts +9 -9
- package/lib/es/slider/index.js +4 -2
- package/lib/es/table/Body/BaseRow.js +1 -1
- package/lib/es/table/interface.d.ts +1 -1
- package/lib/es/tagInput/index.js +8 -3
- package/lib/es/tooltip/index.js +11 -2
- package/lib/es/treeSelect/index.js +44 -39
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -18204,6 +18204,14 @@ class foundation_Tooltip extends foundation {
|
|
|
18204
18204
|
this.setDisplayNone = (displayNone, cb) => {
|
|
18205
18205
|
this._adapter.setDisplayNone(displayNone, cb);
|
|
18206
18206
|
};
|
|
18207
|
+
this.updateStateIfCursorOnTrigger = trigger => {
|
|
18208
|
+
var _a, _b;
|
|
18209
|
+
if ((_a = trigger === null || trigger === void 0 ? void 0 : trigger.matches) === null || _a === void 0 ? void 0 : _a.call(trigger, ":hover")) {
|
|
18210
|
+
const eventNames = this._adapter.getEventName();
|
|
18211
|
+
const triggerEventSet = this.getState("triggerEventSet");
|
|
18212
|
+
(_b = triggerEventSet[eventNames.mouseEnter]) === null || _b === void 0 ? void 0 : _b.call(triggerEventSet);
|
|
18213
|
+
}
|
|
18214
|
+
};
|
|
18207
18215
|
this.onResize = () => {
|
|
18208
18216
|
// this.log('resize');
|
|
18209
18217
|
// rePosition when window resize
|
|
@@ -20631,6 +20639,15 @@ class Tooltip extends BaseComponent {
|
|
|
20631
20639
|
this.mounted = true;
|
|
20632
20640
|
this.getPopupContainer = this.props.getPopupContainer || this.context.getPopupContainer || tooltip_defaultGetContainer;
|
|
20633
20641
|
this.foundation.init();
|
|
20642
|
+
runAfterTicks(() => {
|
|
20643
|
+
let triggerEle = this.triggerEl.current;
|
|
20644
|
+
if (triggerEle) {
|
|
20645
|
+
if (!(triggerEle instanceof HTMLElement)) {
|
|
20646
|
+
triggerEle = (0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.findDOMNode)(triggerEle);
|
|
20647
|
+
}
|
|
20648
|
+
}
|
|
20649
|
+
this.foundation.updateStateIfCursorOnTrigger(triggerEle);
|
|
20650
|
+
}, 1);
|
|
20634
20651
|
}
|
|
20635
20652
|
componentWillUnmount() {
|
|
20636
20653
|
this.mounted = false;
|
|
@@ -25073,9 +25090,6 @@ class InputFoundation extends foundation {
|
|
|
25073
25090
|
constructor(adapter) {
|
|
25074
25091
|
super(Object.assign(Object.assign({}, InputFoundation.inputDefaultAdapter), adapter));
|
|
25075
25092
|
}
|
|
25076
|
-
init() {
|
|
25077
|
-
this._setInitValue();
|
|
25078
|
-
}
|
|
25079
25093
|
destroy() {
|
|
25080
25094
|
if (this._timer) {
|
|
25081
25095
|
clearTimeout(this._timer);
|
|
@@ -25083,19 +25097,6 @@ class InputFoundation extends foundation {
|
|
|
25083
25097
|
}
|
|
25084
25098
|
}
|
|
25085
25099
|
setDisable() {}
|
|
25086
|
-
_setInitValue() {
|
|
25087
|
-
const {
|
|
25088
|
-
defaultValue,
|
|
25089
|
-
value
|
|
25090
|
-
} = this.getProps();
|
|
25091
|
-
let v = defaultValue;
|
|
25092
|
-
if (this._isControlledComponent()) {
|
|
25093
|
-
v = value;
|
|
25094
|
-
}
|
|
25095
|
-
this._adapter.setValue(v);
|
|
25096
|
-
// this.checkAllowClear(v);
|
|
25097
|
-
}
|
|
25098
|
-
|
|
25099
25100
|
setValue(value) {
|
|
25100
25101
|
this._adapter.setValue(value);
|
|
25101
25102
|
}
|
|
@@ -25480,9 +25481,10 @@ class Input extends BaseComponent {
|
|
|
25480
25481
|
this.handlePreventMouseDown = e => {
|
|
25481
25482
|
this.foundation.handlePreventMouseDown(e);
|
|
25482
25483
|
};
|
|
25484
|
+
const initValue = 'value' in props ? props.value : props.defaultValue;
|
|
25483
25485
|
this.state = {
|
|
25484
|
-
value:
|
|
25485
|
-
cachedValue:
|
|
25486
|
+
value: initValue,
|
|
25487
|
+
cachedValue: props.value,
|
|
25486
25488
|
disabled: false,
|
|
25487
25489
|
props: {},
|
|
25488
25490
|
isFocus: false,
|
|
@@ -25555,7 +25557,6 @@ class Input extends BaseComponent {
|
|
|
25555
25557
|
componentDidMount() {
|
|
25556
25558
|
// autofocus is changed from the original support of input to the support of manually calling the focus method,
|
|
25557
25559
|
// so that preventScroll can still take effect under the setting of autofocus
|
|
25558
|
-
this.foundation.init();
|
|
25559
25560
|
const {
|
|
25560
25561
|
disabled,
|
|
25561
25562
|
autoFocus,
|
|
@@ -46908,9 +46909,12 @@ class TagInput extends BaseComponent {
|
|
|
46908
46909
|
className,
|
|
46909
46910
|
disabled,
|
|
46910
46911
|
placeholder,
|
|
46911
|
-
validateStatus
|
|
46912
|
+
validateStatus,
|
|
46913
|
+
prefix,
|
|
46914
|
+
insetLabel,
|
|
46915
|
+
suffix
|
|
46912
46916
|
} = _a,
|
|
46913
|
-
rest = tagInput_rest(_a, ["size", "style", "className", "disabled", "placeholder", "validateStatus"]);
|
|
46917
|
+
rest = tagInput_rest(_a, ["size", "style", "className", "disabled", "placeholder", "validateStatus", "prefix", "insetLabel", "suffix"]);
|
|
46914
46918
|
const {
|
|
46915
46919
|
focusing,
|
|
46916
46920
|
hovering,
|
|
@@ -46925,7 +46929,9 @@ class TagInput extends BaseComponent {
|
|
|
46925
46929
|
[`${tagInput_prefixCls}-error`]: validateStatus === 'error',
|
|
46926
46930
|
[`${tagInput_prefixCls}-warning`]: validateStatus === 'warning',
|
|
46927
46931
|
[`${tagInput_prefixCls}-small`]: size === 'small',
|
|
46928
|
-
[`${tagInput_prefixCls}-large`]: size === 'large'
|
|
46932
|
+
[`${tagInput_prefixCls}-large`]: size === 'large',
|
|
46933
|
+
[`${tagInput_prefixCls}-with-prefix`]: !!prefix || !!insetLabel,
|
|
46934
|
+
[`${tagInput_prefixCls}-with-suffix`]: !!suffix
|
|
46929
46935
|
});
|
|
46930
46936
|
const inputCls = classnames_default()(`${tagInput_prefixCls}-wrapper-input`, `${tagInput_prefixCls}-wrapper-input-${size}`);
|
|
46931
46937
|
const wrapperCls = classnames_default()(`${tagInput_prefixCls}-wrapper`);
|
|
@@ -64302,21 +64308,7 @@ class TextAreaFoundation extends foundation {
|
|
|
64302
64308
|
}
|
|
64303
64309
|
};
|
|
64304
64310
|
}
|
|
64305
|
-
init() {
|
|
64306
|
-
this.setInitValue();
|
|
64307
|
-
}
|
|
64308
64311
|
destroy() {}
|
|
64309
|
-
setInitValue() {
|
|
64310
|
-
const {
|
|
64311
|
-
defaultValue,
|
|
64312
|
-
value
|
|
64313
|
-
} = this.getProps();
|
|
64314
|
-
let v = defaultValue;
|
|
64315
|
-
if (this._isControlledComponent()) {
|
|
64316
|
-
v = value;
|
|
64317
|
-
}
|
|
64318
|
-
this._adapter.setValue(v);
|
|
64319
|
-
}
|
|
64320
64312
|
handleValueChange(v) {
|
|
64321
64313
|
this._adapter.setValue(v);
|
|
64322
64314
|
}
|
|
@@ -64544,12 +64536,14 @@ class TextArea extends BaseComponent {
|
|
|
64544
64536
|
forwardRef.current = node;
|
|
64545
64537
|
}
|
|
64546
64538
|
};
|
|
64539
|
+
const initValue = 'value' in props ? props.value : props.defaultValue;
|
|
64547
64540
|
this.state = {
|
|
64548
|
-
value:
|
|
64541
|
+
value: initValue,
|
|
64549
64542
|
isFocus: false,
|
|
64550
64543
|
isHover: false,
|
|
64551
64544
|
height: 0,
|
|
64552
|
-
minLength: props.minLength
|
|
64545
|
+
minLength: props.minLength,
|
|
64546
|
+
cachedValue: props.value
|
|
64553
64547
|
};
|
|
64554
64548
|
this.focusing = false;
|
|
64555
64549
|
this.foundation = new TextAreaFoundation(this.adapter);
|
|
@@ -76769,11 +76763,13 @@ class Slider extends BaseComponent {
|
|
|
76769
76763
|
var _this = this;
|
|
76770
76764
|
return Object.assign(Object.assign({}, super.adapter), {
|
|
76771
76765
|
getSliderLengths: () => {
|
|
76766
|
+
var _a;
|
|
76772
76767
|
if (this.sliderEl && this.sliderEl.current) {
|
|
76773
76768
|
const rect = this.sliderEl.current.getBoundingClientRect();
|
|
76769
|
+
const offsetParentRect = (_a = this.sliderEl.current.offsetParent) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
76774
76770
|
const offset = {
|
|
76775
|
-
x: this.sliderEl.current.offsetLeft,
|
|
76776
|
-
y: this.sliderEl.current.offsetTop
|
|
76771
|
+
x: offsetParentRect ? rect.left - offsetParentRect.left : this.sliderEl.current.offsetLeft,
|
|
76772
|
+
y: offsetParentRect ? rect.top - offsetParentRect.top : this.sliderEl.current.offsetTop
|
|
76777
76773
|
};
|
|
76778
76774
|
return {
|
|
76779
76775
|
sliderX: offset.x,
|
|
@@ -81843,7 +81839,7 @@ class TableRow extends BaseComponent {
|
|
|
81843
81839
|
rowProps = BaseRow_rest(_a, ["className", "style"]);
|
|
81844
81840
|
this.adapter.setCache('customRowProps', Object.assign({}, rowProps));
|
|
81845
81841
|
const baseRowStyle = Object.assign(Object.assign({}, style), customStyle);
|
|
81846
|
-
const rowCls = typeof replaceClassName === 'string' && replaceClassName.length ? replaceClassName : classnames_default()(className, `${prefixCls}-row`, {
|
|
81842
|
+
const rowCls = typeof replaceClassName === 'string' && replaceClassName.length ? classnames_default()(replaceClassName, customClassName) : classnames_default()(className, `${prefixCls}-row`, {
|
|
81847
81843
|
[`${prefixCls}-row-selected`]: selected,
|
|
81848
81844
|
[`${prefixCls}-row-expanded`]: expanded,
|
|
81849
81845
|
[`${prefixCls}-row-hovered`]: hovered,
|
|
@@ -91164,15 +91160,17 @@ class TreeSelect extends BaseComponent {
|
|
|
91164
91160
|
leafOnly,
|
|
91165
91161
|
searchPosition,
|
|
91166
91162
|
triggerRender,
|
|
91167
|
-
borderless
|
|
91163
|
+
borderless,
|
|
91164
|
+
checkRelation
|
|
91168
91165
|
} = _a,
|
|
91169
|
-
rest = treeSelect_rest(_a, ["disabled", "multiple", "filterTreeNode", "validateStatus", "prefix", "suffix", "style", "size", "insetLabel", "className", "placeholder", "showClear", "leafOnly", "searchPosition", "triggerRender", "borderless"]);
|
|
91166
|
+
rest = treeSelect_rest(_a, ["disabled", "multiple", "filterTreeNode", "validateStatus", "prefix", "suffix", "style", "size", "insetLabel", "className", "placeholder", "showClear", "leafOnly", "searchPosition", "triggerRender", "borderless", "checkRelation"]);
|
|
91170
91167
|
const {
|
|
91171
91168
|
inputValue,
|
|
91172
91169
|
selectedKeys,
|
|
91173
91170
|
checkedKeys,
|
|
91174
91171
|
keyEntities,
|
|
91175
|
-
isFocus
|
|
91172
|
+
isFocus,
|
|
91173
|
+
realCheckedKeys
|
|
91176
91174
|
} = this.state;
|
|
91177
91175
|
const filterable = Boolean(filterTreeNode);
|
|
91178
91176
|
const useCustomTrigger = typeof triggerRender === 'function';
|
|
@@ -91200,31 +91198,45 @@ class TreeSelect extends BaseComponent {
|
|
|
91200
91198
|
[`${treeSelect_prefixcls}-with-suffix`]: suffix,
|
|
91201
91199
|
[`${treeSelect_prefixcls}-with-suffix`]: suffix
|
|
91202
91200
|
}, className);
|
|
91203
|
-
|
|
91204
|
-
|
|
91205
|
-
|
|
91206
|
-
|
|
91207
|
-
|
|
91208
|
-
|
|
91209
|
-
|
|
91210
|
-
|
|
91211
|
-
|
|
91212
|
-
|
|
91213
|
-
|
|
91214
|
-
|
|
91215
|
-
|
|
91216
|
-
|
|
91217
|
-
|
|
91218
|
-
|
|
91219
|
-
|
|
91220
|
-
|
|
91221
|
-
|
|
91222
|
-
|
|
91223
|
-
|
|
91224
|
-
|
|
91225
|
-
|
|
91226
|
-
|
|
91227
|
-
}
|
|
91201
|
+
let inner;
|
|
91202
|
+
if (useCustomTrigger) {
|
|
91203
|
+
let triggerRenderKeys = [];
|
|
91204
|
+
if (multiple) {
|
|
91205
|
+
if (checkRelation === 'related') {
|
|
91206
|
+
triggerRenderKeys = normalizeKeyList([...checkedKeys], keyEntities, leafOnly, true);
|
|
91207
|
+
} else if (checkRelation === 'unRelated') {
|
|
91208
|
+
triggerRenderKeys = [...realCheckedKeys];
|
|
91209
|
+
}
|
|
91210
|
+
} else {
|
|
91211
|
+
triggerRenderKeys = selectedKeys;
|
|
91212
|
+
}
|
|
91213
|
+
inner = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(trigger, {
|
|
91214
|
+
inputValue: inputValue,
|
|
91215
|
+
value: triggerRenderKeys.map(key => get_default()(keyEntities, [key, 'data'])),
|
|
91216
|
+
disabled: disabled,
|
|
91217
|
+
placeholder: placeholder,
|
|
91218
|
+
onClear: this.handleClear,
|
|
91219
|
+
componentName: 'TreeSelect',
|
|
91220
|
+
triggerRender: triggerRender,
|
|
91221
|
+
componentProps: Object.assign({}, this.props),
|
|
91222
|
+
onSearch: this.search,
|
|
91223
|
+
onRemove: this.removeTag
|
|
91224
|
+
});
|
|
91225
|
+
} else {
|
|
91226
|
+
inner = [/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91227
|
+
key: 'prefix'
|
|
91228
|
+
}, prefix || insetLabel ? this.renderPrefix() : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91229
|
+
key: 'selection'
|
|
91230
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
91231
|
+
className: `${treeSelect_prefixcls}-selection`
|
|
91232
|
+
}, this.renderSelectContent())), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91233
|
+
key: 'suffix'
|
|
91234
|
+
}, suffix ? this.renderSuffix() : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91235
|
+
key: 'clearBtn'
|
|
91236
|
+
}, showClear || isTriggerPositionSearch && inputValue ? this.renderClearBtn() : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91237
|
+
key: 'arrow'
|
|
91238
|
+
}, this.renderArrow())];
|
|
91239
|
+
}
|
|
91228
91240
|
const tabIndex = disabled ? null : 0;
|
|
91229
91241
|
/**
|
|
91230
91242
|
* Reasons for disabling the a11y eslint rule:
|
|
@@ -91688,7 +91700,6 @@ class TreeSelect extends BaseComponent {
|
|
|
91688
91700
|
};
|
|
91689
91701
|
}
|
|
91690
91702
|
static getDerivedStateFromProps(props, prevState) {
|
|
91691
|
-
var _a;
|
|
91692
91703
|
const {
|
|
91693
91704
|
prevProps,
|
|
91694
91705
|
rePosKey
|
|
@@ -91751,16 +91762,6 @@ class TreeSelect extends BaseComponent {
|
|
|
91751
91762
|
newState.expandedKeys = calcExpandedKeysForValues(normalizeValue(props.defaultValue, withObject, keyMaps), keyEntities, props.multiple, valueEntities);
|
|
91752
91763
|
} else if (!prevProps && props.value) {
|
|
91753
91764
|
newState.expandedKeys = calcExpandedKeysForValues(normalizeValue(props.value, withObject, keyMaps), keyEntities, props.multiple, valueEntities);
|
|
91754
|
-
} else if (!isExpandControlled && needUpdateTreeData && props.value) {
|
|
91755
|
-
// 当 treeData 已经设置具体的值,并且设置了 props.loadData ,则认为 treeData 的更新是因为 loadData 导致的
|
|
91756
|
-
// 如果是因为 loadData 导致 treeData改变, 此时在这里重新计算 key 会导致为未选中的展开项目被收起
|
|
91757
|
-
// 所以此时不需要重新计算 expandedKeys,因为在点击展开按钮时候已经把被展开的项添加到 expandedKeys 中
|
|
91758
|
-
// When treeData has a specific value and props.loadData is set, it is considered that the update of treeData is caused by loadData
|
|
91759
|
-
// If the treeData is changed because of loadData, recalculating the key here will cause the unselected expanded items to be collapsed
|
|
91760
|
-
// So there is no need to recalculate expandedKeys at this time, because the expanded item has been added to expandedKeys when the expand button is clicked
|
|
91761
|
-
if (!(prevState.treeData && ((_a = prevState.treeData) === null || _a === void 0 ? void 0 : _a.length) > 0 && props.loadData)) {
|
|
91762
|
-
newState.expandedKeys = calcExpandedKeysForValues(props.value, keyEntities, props.multiple, valueEntities);
|
|
91763
|
-
}
|
|
91764
91765
|
}
|
|
91765
91766
|
if (!newState.expandedKeys) {
|
|
91766
91767
|
delete newState.expandedKeys;
|
|
@@ -98371,6 +98372,7 @@ function withField(Component, opts) {
|
|
|
98371
98372
|
const [touched, setTouched] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)();
|
|
98372
98373
|
const [cursor, setCursor, getCursor] = useStateWithGetter(0);
|
|
98373
98374
|
const [status, setStatus] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(validateStatus); // use props.validateStatus to init
|
|
98375
|
+
const isUnmounted = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
98374
98376
|
const rulesRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(rules);
|
|
98375
98377
|
const validateRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(validate);
|
|
98376
98378
|
const validatePromise = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
@@ -98381,6 +98383,9 @@ function withField(Component, opts) {
|
|
|
98381
98383
|
updater.updateStateTouched(field, isTouched, callOpts);
|
|
98382
98384
|
};
|
|
98383
98385
|
const updateError = (errors, callOpts) => {
|
|
98386
|
+
if (isUnmounted.current) {
|
|
98387
|
+
return;
|
|
98388
|
+
}
|
|
98384
98389
|
if (errors === getError()) {
|
|
98385
98390
|
// When the inspection result is unchanged, no need to update, saving a forceUpdate overhead
|
|
98386
98391
|
// When errors is an array, deepEqual is not used, and it is always treated as a need to update
|
|
@@ -98425,7 +98430,7 @@ function withField(Component, opts) {
|
|
|
98425
98430
|
validator.validate(model, {
|
|
98426
98431
|
first: mergeStopValidateWithError
|
|
98427
98432
|
}, (errors, fields) => {}).then(res => {
|
|
98428
|
-
if (validatePromise.current !== rootPromise) {
|
|
98433
|
+
if (isUnmounted.current || validatePromise.current !== rootPromise) {
|
|
98429
98434
|
return;
|
|
98430
98435
|
}
|
|
98431
98436
|
// validation passed
|
|
@@ -98433,7 +98438,7 @@ function withField(Component, opts) {
|
|
|
98433
98438
|
updateError(undefined, callOpts);
|
|
98434
98439
|
resolve({});
|
|
98435
98440
|
}).catch(err => {
|
|
98436
|
-
if (validatePromise.current !== rootPromise) {
|
|
98441
|
+
if (isUnmounted.current || validatePromise.current !== rootPromise) {
|
|
98437
98442
|
return;
|
|
98438
98443
|
}
|
|
98439
98444
|
let {
|
|
@@ -98479,7 +98484,7 @@ function withField(Component, opts) {
|
|
|
98479
98484
|
} else if (isPromise(maybePromisedErrors)) {
|
|
98480
98485
|
maybePromisedErrors.then(result => {
|
|
98481
98486
|
// If the async validate is outdated (a newer validate occurs), the result should be discarded
|
|
98482
|
-
if (validatePromise.current !== rootPromise) {
|
|
98487
|
+
if (isUnmounted.current || validatePromise.current !== rootPromise) {
|
|
98483
98488
|
return;
|
|
98484
98489
|
}
|
|
98485
98490
|
if (utils_isValid(result)) {
|
|
@@ -98607,11 +98612,14 @@ function withField(Component, opts) {
|
|
|
98607
98612
|
rulesRef.current = rules;
|
|
98608
98613
|
validateRef.current = validate;
|
|
98609
98614
|
}, [rules, validate]);
|
|
98610
|
-
// exec validate once when trigger inlcude 'mount'
|
|
98611
98615
|
useIsomorphicEffect(() => {
|
|
98616
|
+
// exec validate once when trigger include 'mount'
|
|
98612
98617
|
if (validateOnMount) {
|
|
98613
98618
|
fieldValidate(value);
|
|
98614
98619
|
}
|
|
98620
|
+
return () => {
|
|
98621
|
+
isUnmounted.current = true;
|
|
98622
|
+
};
|
|
98615
98623
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
98616
98624
|
}, []);
|
|
98617
98625
|
// register when mounted,unregister when unmounted
|
|
@@ -101541,9 +101549,11 @@ class image_Image extends BaseComponent {
|
|
|
101541
101549
|
fallback,
|
|
101542
101550
|
placeholder,
|
|
101543
101551
|
imageID,
|
|
101544
|
-
setDownloadName
|
|
101552
|
+
setDownloadName,
|
|
101553
|
+
imgCls,
|
|
101554
|
+
imgStyle
|
|
101545
101555
|
} = _b,
|
|
101546
|
-
restProps = image_rest(_b, ["src", "width", "height", "alt", "style", "className", "crossOrigin", "preview", "fallback", "placeholder", "imageID", "setDownloadName"]);
|
|
101556
|
+
restProps = image_rest(_b, ["src", "width", "height", "alt", "style", "className", "crossOrigin", "preview", "fallback", "placeholder", "imageID", "setDownloadName", "imgCls", "imgStyle"]);
|
|
101547
101557
|
const outerStyle = Object.assign({
|
|
101548
101558
|
width,
|
|
101549
101559
|
height
|
|
@@ -101566,9 +101576,11 @@ class image_Image extends BaseComponent {
|
|
|
101566
101576
|
src: this.isInGroup() && this.isLazyLoad() ? undefined : src,
|
|
101567
101577
|
"data-src": src,
|
|
101568
101578
|
alt: alt,
|
|
101579
|
+
style: imgStyle,
|
|
101569
101580
|
className: classnames_default()(`${image_prefixCls}-img`, {
|
|
101570
101581
|
[`${image_prefixCls}-img-preview`]: showPreviewCursor,
|
|
101571
|
-
[`${image_prefixCls}-img-error`]: loadStatus === "error"
|
|
101582
|
+
[`${image_prefixCls}-img-error`]: loadStatus === "error",
|
|
101583
|
+
[imgCls]: Boolean(imgCls)
|
|
101572
101584
|
}),
|
|
101573
101585
|
width: width,
|
|
101574
101586
|
height: height,
|