@douyinfe/semi-ui 2.51.0 → 2.51.2
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 +30 -48
- 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/image/interface.d.ts +1 -1
- package/lib/cjs/image/previewInner.d.ts +1 -1
- package/lib/cjs/image/previewInner.js +2 -2
- package/lib/cjs/input/textarea.js +12 -23
- package/lib/cjs/modal/Modal.js +2 -0
- package/lib/es/image/interface.d.ts +1 -1
- package/lib/es/image/previewInner.d.ts +1 -1
- package/lib/es/image/previewInner.js +2 -2
- package/lib/es/input/textarea.js +12 -23
- package/lib/es/modal/Modal.js +2 -0
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -53970,26 +53970,15 @@ class DatePickerFoundation extends foundation {
|
|
|
53970
53970
|
* 受控时如果输入不完整,由于没有触发 notifyChange
|
|
53971
53971
|
* 需要组件内更新一下输入框的值,否则会出现选了一个日期但是输入框没有回显日期的问题 #1357
|
|
53972
53972
|
*/
|
|
53973
|
-
if (
|
|
53974
|
-
|
|
53975
|
-
// do not change value when selected value is incomplete
|
|
53976
|
-
this._adapter.updateInputValue(inputValue);
|
|
53977
|
-
this._adapter.updateInsetInputValue(insetInputValue);
|
|
53978
|
-
return;
|
|
53979
|
-
} else {
|
|
53980
|
-
if (!controlled || fromPreset) {
|
|
53981
|
-
this._updateValueAndInput(dates, true, inputValue);
|
|
53982
|
-
this._adapter.updateInsetInputValue(insetInputValue);
|
|
53983
|
-
}
|
|
53984
|
-
}
|
|
53985
|
-
}
|
|
53986
|
-
if (!controlled && this._adapter.needConfirm()) {
|
|
53987
|
-
// select date only change inputValue when needConfirm is true
|
|
53973
|
+
if (isRangeTypeAndInputIncomplete) {
|
|
53974
|
+
// do not change value when selected value is incomplete
|
|
53988
53975
|
this._adapter.updateInputValue(inputValue);
|
|
53989
53976
|
this._adapter.updateInsetInputValue(insetInputValue);
|
|
53990
|
-
|
|
53991
|
-
|
|
53992
|
-
|
|
53977
|
+
return;
|
|
53978
|
+
} else {
|
|
53979
|
+
if (!controlled || fromPreset) {
|
|
53980
|
+
this._updateValueAndInput(dates, true, inputValue);
|
|
53981
|
+
this._adapter.updateInsetInputValue(insetInputValue);
|
|
53993
53982
|
}
|
|
53994
53983
|
}
|
|
53995
53984
|
if (!isEqual_default()(value, stateValue)) {
|
|
@@ -61321,6 +61310,9 @@ class ModalFoundation extends foundation {
|
|
|
61321
61310
|
this._adapter.enabledBodyScroll();
|
|
61322
61311
|
this._adapter.notifyClose();
|
|
61323
61312
|
}
|
|
61313
|
+
enabledBodyScroll() {
|
|
61314
|
+
this._adapter.enabledBodyScroll();
|
|
61315
|
+
}
|
|
61324
61316
|
}
|
|
61325
61317
|
;// CONCATENATED MODULE: ../semi-foundation/modal/modalContentFoundation.ts
|
|
61326
61318
|
|
|
@@ -62377,6 +62369,8 @@ class Modal extends BaseComponent {
|
|
|
62377
62369
|
componentWillUnmount() {
|
|
62378
62370
|
if (this.props.visible) {
|
|
62379
62371
|
this.foundation.destroy();
|
|
62372
|
+
} else {
|
|
62373
|
+
this.foundation.enabledBodyScroll();
|
|
62380
62374
|
}
|
|
62381
62375
|
}
|
|
62382
62376
|
render() {
|
|
@@ -64222,7 +64216,7 @@ class TextAreaFoundation extends foundation {
|
|
|
64222
64216
|
}
|
|
64223
64217
|
constructor(adapter) {
|
|
64224
64218
|
super(Object.assign(Object.assign({}, TextAreaFoundation.textAreaDefaultAdapter), adapter));
|
|
64225
|
-
this.resizeTextarea =
|
|
64219
|
+
this.resizeTextarea = () => {
|
|
64226
64220
|
var _a;
|
|
64227
64221
|
const {
|
|
64228
64222
|
height
|
|
@@ -64234,7 +64228,6 @@ class TextAreaFoundation extends foundation {
|
|
|
64234
64228
|
const node = this._adapter.getRef();
|
|
64235
64229
|
const nodeSizingData = util_getSizingData(node);
|
|
64236
64230
|
if (!nodeSizingData) {
|
|
64237
|
-
cb && cb();
|
|
64238
64231
|
return;
|
|
64239
64232
|
}
|
|
64240
64233
|
const [minRows, maxRows] = autosize !== null && typeof autosize === 'object' ? [(_a = autosize === null || autosize === void 0 ? void 0 : autosize.minRows) !== null && _a !== void 0 ? _a : rows, autosize === null || autosize === void 0 ? void 0 : autosize.maxRows] : [rows];
|
|
@@ -64244,7 +64237,6 @@ class TextAreaFoundation extends foundation {
|
|
|
64244
64237
|
node.style.height = `${newHeight}px`;
|
|
64245
64238
|
return;
|
|
64246
64239
|
}
|
|
64247
|
-
cb && cb();
|
|
64248
64240
|
};
|
|
64249
64241
|
}
|
|
64250
64242
|
init() {
|
|
@@ -64453,6 +64445,7 @@ var input_textarea = __webpack_require__("d+AG");
|
|
|
64453
64445
|
|
|
64454
64446
|
|
|
64455
64447
|
|
|
64448
|
+
|
|
64456
64449
|
var textarea_rest = undefined && undefined.__rest || function (s, e) {
|
|
64457
64450
|
var t = {};
|
|
64458
64451
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -64469,6 +64462,7 @@ var textarea_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
64469
64462
|
|
|
64470
64463
|
|
|
64471
64464
|
|
|
64465
|
+
|
|
64472
64466
|
const textarea_prefixCls = input_constants_cssClasses.PREFIX;
|
|
64473
64467
|
class TextArea extends BaseComponent {
|
|
64474
64468
|
constructor(props) {
|
|
@@ -64497,7 +64491,7 @@ class TextArea extends BaseComponent {
|
|
|
64497
64491
|
this.focusing = false;
|
|
64498
64492
|
this.foundation = new TextAreaFoundation(this.adapter);
|
|
64499
64493
|
this.libRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
64500
|
-
this.
|
|
64494
|
+
this.throttledResizeTextarea = throttle_default()(this.foundation.resizeTextarea, 10);
|
|
64501
64495
|
}
|
|
64502
64496
|
get adapter() {
|
|
64503
64497
|
return Object.assign(Object.assign({}, super.adapter), {
|
|
@@ -64548,29 +64542,12 @@ class TextArea extends BaseComponent {
|
|
|
64548
64542
|
}
|
|
64549
64543
|
return willUpdateStates;
|
|
64550
64544
|
}
|
|
64551
|
-
componentDidMount() {
|
|
64552
|
-
this.foundation.init();
|
|
64553
|
-
this._resizeListener = null;
|
|
64554
|
-
if (this.props.autosize) {
|
|
64555
|
-
// Working around Firefox bug which runs resize listeners even when other JS is running at the same moment
|
|
64556
|
-
// causing competing rerenders (due to setState in the listener) in React.
|
|
64557
|
-
// More can be found here - facebook/react#6324
|
|
64558
|
-
// // Reference to https://github.com/andreypopp/react-textarea-autosize/
|
|
64559
|
-
this._resizeListener = () => {
|
|
64560
|
-
if (this._resizeLock) {
|
|
64561
|
-
return;
|
|
64562
|
-
}
|
|
64563
|
-
this._resizeLock = true;
|
|
64564
|
-
this.foundation.resizeTextarea(() => {
|
|
64565
|
-
this._resizeLock = false;
|
|
64566
|
-
});
|
|
64567
|
-
};
|
|
64568
|
-
window.addEventListener('resize', this._resizeListener);
|
|
64569
|
-
}
|
|
64570
|
-
}
|
|
64571
64545
|
componentWillUnmount() {
|
|
64572
|
-
|
|
64573
|
-
|
|
64546
|
+
var _a, _b;
|
|
64547
|
+
if (this.throttledResizeTextarea) {
|
|
64548
|
+
(_b = (_a = this.throttledResizeTextarea) === null || _a === void 0 ? void 0 : _a.cancel) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
64549
|
+
this.throttledResizeTextarea = null;
|
|
64550
|
+
}
|
|
64574
64551
|
}
|
|
64575
64552
|
componentDidUpdate(prevProps, prevState) {
|
|
64576
64553
|
if ((this.props.value !== prevProps.value || this.props.placeholder !== prevProps.placeholder) && this.props.autosize) {
|
|
@@ -64690,8 +64667,12 @@ class TextArea extends BaseComponent {
|
|
|
64690
64667
|
style: style,
|
|
64691
64668
|
onMouseEnter: e => this.foundation.handleMouseEnter(e),
|
|
64692
64669
|
onMouseLeave: e => this.foundation.handleMouseLeave(e)
|
|
64670
|
+
}, autosize ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(ReactResizeObserver, {
|
|
64671
|
+
onResize: this.throttledResizeTextarea
|
|
64693
64672
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("textarea", Object.assign({}, itemProps, {
|
|
64694
64673
|
ref: this.setRef
|
|
64674
|
+
}))) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("textarea", Object.assign({}, itemProps, {
|
|
64675
|
+
ref: this.setRef
|
|
64695
64676
|
})), this.renderClearBtn(), this.renderCounter());
|
|
64696
64677
|
}
|
|
64697
64678
|
}
|
|
@@ -100320,7 +100301,7 @@ class PreviewInnerFoundation extends foundation {
|
|
|
100320
100301
|
couldClose = false;
|
|
100321
100302
|
}
|
|
100322
100303
|
if (couldClose && maskClosable) {
|
|
100323
|
-
this.
|
|
100304
|
+
this._adapter.notifyVisibleChange(false);
|
|
100324
100305
|
}
|
|
100325
100306
|
};
|
|
100326
100307
|
this.handleMouseDown = e => {
|
|
@@ -100379,9 +100360,10 @@ class PreviewInnerFoundation extends foundation {
|
|
|
100379
100360
|
downloadImage(downloadSrc, downloadName);
|
|
100380
100361
|
this._adapter.notifyDownload(downloadSrc, currentIndex);
|
|
100381
100362
|
};
|
|
100382
|
-
this.handlePreviewClose =
|
|
100363
|
+
this.handlePreviewClose = e => {
|
|
100383
100364
|
this._adapter.notifyVisibleChange(false);
|
|
100384
100365
|
this._adapter.notifyClose();
|
|
100366
|
+
handlePrevent(e);
|
|
100385
100367
|
};
|
|
100386
100368
|
this.handleAdjustRatio = type => {
|
|
100387
100369
|
this.setState({
|
|
@@ -100667,8 +100649,8 @@ class PreviewInner extends BaseComponent {
|
|
|
100667
100649
|
this.handleDownload = () => {
|
|
100668
100650
|
this.foundation.handleDownload();
|
|
100669
100651
|
};
|
|
100670
|
-
this.handlePreviewClose =
|
|
100671
|
-
this.foundation.handlePreviewClose();
|
|
100652
|
+
this.handlePreviewClose = e => {
|
|
100653
|
+
this.foundation.handlePreviewClose(e);
|
|
100672
100654
|
};
|
|
100673
100655
|
this.handleAdjustRatio = type => {
|
|
100674
100656
|
this.foundation.handleAdjustRatio(type);
|