@douyinfe/semi-ui 2.51.1 → 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 +25 -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/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/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)) {
|
|
@@ -64227,7 +64216,7 @@ class TextAreaFoundation extends foundation {
|
|
|
64227
64216
|
}
|
|
64228
64217
|
constructor(adapter) {
|
|
64229
64218
|
super(Object.assign(Object.assign({}, TextAreaFoundation.textAreaDefaultAdapter), adapter));
|
|
64230
|
-
this.resizeTextarea =
|
|
64219
|
+
this.resizeTextarea = () => {
|
|
64231
64220
|
var _a;
|
|
64232
64221
|
const {
|
|
64233
64222
|
height
|
|
@@ -64239,7 +64228,6 @@ class TextAreaFoundation extends foundation {
|
|
|
64239
64228
|
const node = this._adapter.getRef();
|
|
64240
64229
|
const nodeSizingData = util_getSizingData(node);
|
|
64241
64230
|
if (!nodeSizingData) {
|
|
64242
|
-
cb && cb();
|
|
64243
64231
|
return;
|
|
64244
64232
|
}
|
|
64245
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];
|
|
@@ -64249,7 +64237,6 @@ class TextAreaFoundation extends foundation {
|
|
|
64249
64237
|
node.style.height = `${newHeight}px`;
|
|
64250
64238
|
return;
|
|
64251
64239
|
}
|
|
64252
|
-
cb && cb();
|
|
64253
64240
|
};
|
|
64254
64241
|
}
|
|
64255
64242
|
init() {
|
|
@@ -64458,6 +64445,7 @@ var input_textarea = __webpack_require__("d+AG");
|
|
|
64458
64445
|
|
|
64459
64446
|
|
|
64460
64447
|
|
|
64448
|
+
|
|
64461
64449
|
var textarea_rest = undefined && undefined.__rest || function (s, e) {
|
|
64462
64450
|
var t = {};
|
|
64463
64451
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -64474,6 +64462,7 @@ var textarea_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
64474
64462
|
|
|
64475
64463
|
|
|
64476
64464
|
|
|
64465
|
+
|
|
64477
64466
|
const textarea_prefixCls = input_constants_cssClasses.PREFIX;
|
|
64478
64467
|
class TextArea extends BaseComponent {
|
|
64479
64468
|
constructor(props) {
|
|
@@ -64502,7 +64491,7 @@ class TextArea extends BaseComponent {
|
|
|
64502
64491
|
this.focusing = false;
|
|
64503
64492
|
this.foundation = new TextAreaFoundation(this.adapter);
|
|
64504
64493
|
this.libRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
64505
|
-
this.
|
|
64494
|
+
this.throttledResizeTextarea = throttle_default()(this.foundation.resizeTextarea, 10);
|
|
64506
64495
|
}
|
|
64507
64496
|
get adapter() {
|
|
64508
64497
|
return Object.assign(Object.assign({}, super.adapter), {
|
|
@@ -64553,29 +64542,12 @@ class TextArea extends BaseComponent {
|
|
|
64553
64542
|
}
|
|
64554
64543
|
return willUpdateStates;
|
|
64555
64544
|
}
|
|
64556
|
-
componentDidMount() {
|
|
64557
|
-
this.foundation.init();
|
|
64558
|
-
this._resizeListener = null;
|
|
64559
|
-
if (this.props.autosize) {
|
|
64560
|
-
// Working around Firefox bug which runs resize listeners even when other JS is running at the same moment
|
|
64561
|
-
// causing competing rerenders (due to setState in the listener) in React.
|
|
64562
|
-
// More can be found here - facebook/react#6324
|
|
64563
|
-
// // Reference to https://github.com/andreypopp/react-textarea-autosize/
|
|
64564
|
-
this._resizeListener = () => {
|
|
64565
|
-
if (this._resizeLock) {
|
|
64566
|
-
return;
|
|
64567
|
-
}
|
|
64568
|
-
this._resizeLock = true;
|
|
64569
|
-
this.foundation.resizeTextarea(() => {
|
|
64570
|
-
this._resizeLock = false;
|
|
64571
|
-
});
|
|
64572
|
-
};
|
|
64573
|
-
window.addEventListener('resize', this._resizeListener);
|
|
64574
|
-
}
|
|
64575
|
-
}
|
|
64576
64545
|
componentWillUnmount() {
|
|
64577
|
-
|
|
64578
|
-
|
|
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
|
+
}
|
|
64579
64551
|
}
|
|
64580
64552
|
componentDidUpdate(prevProps, prevState) {
|
|
64581
64553
|
if ((this.props.value !== prevProps.value || this.props.placeholder !== prevProps.placeholder) && this.props.autosize) {
|
|
@@ -64695,8 +64667,12 @@ class TextArea extends BaseComponent {
|
|
|
64695
64667
|
style: style,
|
|
64696
64668
|
onMouseEnter: e => this.foundation.handleMouseEnter(e),
|
|
64697
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
|
|
64698
64672
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("textarea", Object.assign({}, itemProps, {
|
|
64699
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
|
|
64700
64676
|
})), this.renderClearBtn(), this.renderCounter());
|
|
64701
64677
|
}
|
|
64702
64678
|
}
|
|
@@ -100325,7 +100301,7 @@ class PreviewInnerFoundation extends foundation {
|
|
|
100325
100301
|
couldClose = false;
|
|
100326
100302
|
}
|
|
100327
100303
|
if (couldClose && maskClosable) {
|
|
100328
|
-
this.
|
|
100304
|
+
this._adapter.notifyVisibleChange(false);
|
|
100329
100305
|
}
|
|
100330
100306
|
};
|
|
100331
100307
|
this.handleMouseDown = e => {
|
|
@@ -100384,9 +100360,10 @@ class PreviewInnerFoundation extends foundation {
|
|
|
100384
100360
|
downloadImage(downloadSrc, downloadName);
|
|
100385
100361
|
this._adapter.notifyDownload(downloadSrc, currentIndex);
|
|
100386
100362
|
};
|
|
100387
|
-
this.handlePreviewClose =
|
|
100363
|
+
this.handlePreviewClose = e => {
|
|
100388
100364
|
this._adapter.notifyVisibleChange(false);
|
|
100389
100365
|
this._adapter.notifyClose();
|
|
100366
|
+
handlePrevent(e);
|
|
100390
100367
|
};
|
|
100391
100368
|
this.handleAdjustRatio = type => {
|
|
100392
100369
|
this.setState({
|
|
@@ -100672,8 +100649,8 @@ class PreviewInner extends BaseComponent {
|
|
|
100672
100649
|
this.handleDownload = () => {
|
|
100673
100650
|
this.foundation.handleDownload();
|
|
100674
100651
|
};
|
|
100675
|
-
this.handlePreviewClose =
|
|
100676
|
-
this.foundation.handlePreviewClose();
|
|
100652
|
+
this.handlePreviewClose = e => {
|
|
100653
|
+
this.foundation.handlePreviewClose(e);
|
|
100677
100654
|
};
|
|
100678
100655
|
this.handleAdjustRatio = type => {
|
|
100679
100656
|
this.foundation.handleAdjustRatio(type);
|