@douyinfe/semi-ui 2.41.0 → 2.41.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 +37 -27
- 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/_utils/index.d.ts +1 -0
- package/lib/cjs/_utils/index.js +7 -0
- package/lib/cjs/datePicker/dateInput.js +2 -2
- package/lib/cjs/image/previewInner.d.ts +0 -1
- package/lib/cjs/image/previewInner.js +2 -7
- package/lib/cjs/input/index.d.ts +2 -3
- package/lib/cjs/input/index.js +5 -5
- package/lib/cjs/input/textarea.d.ts +1 -1
- package/lib/cjs/input/textarea.js +4 -2
- package/lib/cjs/modal/Modal.d.ts +0 -1
- package/lib/cjs/modal/Modal.js +2 -7
- package/lib/cjs/sideSheet/index.d.ts +3 -0
- package/lib/cjs/sideSheet/index.js +12 -3
- package/lib/cjs/slider/index.js +4 -1
- package/lib/es/_utils/index.d.ts +1 -0
- package/lib/es/_utils/index.js +6 -0
- package/lib/es/datePicker/dateInput.js +2 -2
- package/lib/es/image/previewInner.d.ts +0 -1
- package/lib/es/image/previewInner.js +2 -7
- package/lib/es/input/index.d.ts +2 -3
- package/lib/es/input/index.js +5 -5
- package/lib/es/input/textarea.d.ts +1 -1
- package/lib/es/input/textarea.js +4 -2
- package/lib/es/modal/Modal.d.ts +0 -1
- package/lib/es/modal/Modal.js +2 -7
- package/lib/es/sideSheet/index.d.ts +3 -0
- package/lib/es/sideSheet/index.js +12 -3
- package/lib/es/slider/index.js +4 -1
- package/package.json +2 -2
package/dist/umd/semi-ui.js
CHANGED
|
@@ -19754,6 +19754,12 @@ function getFocusableElements(node) {
|
|
|
19754
19754
|
const focusableElements = Array.from(node.querySelectorAll(focusableSelectorsStr));
|
|
19755
19755
|
return focusableElements;
|
|
19756
19756
|
}
|
|
19757
|
+
function getScrollbarWidth() {
|
|
19758
|
+
if (globalThis && Object.prototype.toString.call(globalThis) === '[object Window]') {
|
|
19759
|
+
return window.innerWidth - document.documentElement.clientWidth;
|
|
19760
|
+
}
|
|
19761
|
+
return 0;
|
|
19762
|
+
}
|
|
19757
19763
|
;// CONCATENATED MODULE: ./configProvider/context.tsx
|
|
19758
19764
|
|
|
19759
19765
|
const ConfigContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
|
|
@@ -27663,10 +27669,10 @@ class Input extends BaseComponent {
|
|
|
27663
27669
|
this.foundation.init();
|
|
27664
27670
|
const {
|
|
27665
27671
|
disabled,
|
|
27666
|
-
|
|
27672
|
+
autoFocus,
|
|
27667
27673
|
preventScroll
|
|
27668
27674
|
} = this.props;
|
|
27669
|
-
if (!disabled && autofocus) {
|
|
27675
|
+
if (!disabled && (autoFocus || this.props['autofocus'])) {
|
|
27670
27676
|
this.inputRef.current.focus({
|
|
27671
27677
|
preventScroll
|
|
27672
27678
|
});
|
|
@@ -27829,7 +27835,7 @@ class Input extends BaseComponent {
|
|
|
27829
27835
|
{
|
|
27830
27836
|
addonAfter,
|
|
27831
27837
|
addonBefore,
|
|
27832
|
-
|
|
27838
|
+
autoFocus,
|
|
27833
27839
|
clearIcon,
|
|
27834
27840
|
className,
|
|
27835
27841
|
disabled,
|
|
@@ -27857,7 +27863,7 @@ class Input extends BaseComponent {
|
|
|
27857
27863
|
borderless,
|
|
27858
27864
|
showClearIgnoreDisabled
|
|
27859
27865
|
} = _a,
|
|
27860
|
-
rest = input_rest(_a, ["addonAfter", "addonBefore", "
|
|
27866
|
+
rest = input_rest(_a, ["addonAfter", "addonBefore", "autoFocus", "clearIcon", "className", "disabled", "defaultValue", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength", "preventScroll", "borderless", "showClearIgnoreDisabled"]);
|
|
27861
27867
|
const {
|
|
27862
27868
|
value,
|
|
27863
27869
|
isFocus,
|
|
@@ -27951,7 +27957,7 @@ Input.propTypes = {
|
|
|
27951
27957
|
defaultValue: (prop_types_default()).any,
|
|
27952
27958
|
disabled: (prop_types_default()).bool,
|
|
27953
27959
|
readonly: (prop_types_default()).bool,
|
|
27954
|
-
|
|
27960
|
+
autoFocus: (prop_types_default()).bool,
|
|
27955
27961
|
type: (prop_types_default()).string,
|
|
27956
27962
|
showClear: (prop_types_default()).bool,
|
|
27957
27963
|
hideSuffix: (prop_types_default()).bool,
|
|
@@ -53985,7 +53991,7 @@ class DateInput extends BaseComponent {
|
|
|
53985
53991
|
onChange: (rangeStartValue, e) => this.handleRangeInputChange(rangeStartValue, rangeEnd, e),
|
|
53986
53992
|
onEnterPress: e => this.handleRangeInputEnterPress(e, rangeStart, rangeEnd),
|
|
53987
53993
|
onFocus: e => this.handleRangeInputFocus(e, 'rangeStart'),
|
|
53988
|
-
|
|
53994
|
+
autoFocus: autofocus,
|
|
53989
53995
|
ref: rangeInputStartRef
|
|
53990
53996
|
})), this.renderRangeSeparator(rangeStart, rangeEnd), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
53991
53997
|
className: `${inputCls} ${inputRightWrapperCls}`,
|
|
@@ -54160,7 +54166,7 @@ class DateInput extends BaseComponent {
|
|
|
54160
54166
|
value: text,
|
|
54161
54167
|
validateStatus: validateStatus,
|
|
54162
54168
|
prefix: prefix,
|
|
54163
|
-
|
|
54169
|
+
autoFocus: autofocus,
|
|
54164
54170
|
size: size,
|
|
54165
54171
|
onBlur: onBlur,
|
|
54166
54172
|
onFocus: onFocus
|
|
@@ -60872,6 +60878,7 @@ var Modal_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
60872
60878
|
|
|
60873
60879
|
|
|
60874
60880
|
|
|
60881
|
+
|
|
60875
60882
|
const destroyFns = [];
|
|
60876
60883
|
class Modal extends BaseComponent {
|
|
60877
60884
|
constructor(props) {
|
|
@@ -61080,14 +61087,8 @@ class Modal extends BaseComponent {
|
|
|
61080
61087
|
// }
|
|
61081
61088
|
return newState;
|
|
61082
61089
|
}
|
|
61083
|
-
static getScrollbarWidth() {
|
|
61084
|
-
if (globalThis && Object.prototype.toString.call(globalThis) === '[object Window]') {
|
|
61085
|
-
return window.innerWidth - document.documentElement.clientWidth;
|
|
61086
|
-
}
|
|
61087
|
-
return 0;
|
|
61088
|
-
}
|
|
61089
61090
|
componentDidMount() {
|
|
61090
|
-
this.scrollBarWidth =
|
|
61091
|
+
this.scrollBarWidth = getScrollbarWidth();
|
|
61091
61092
|
this.originBodyWidth = document.body.style.width;
|
|
61092
61093
|
if (this.props.visible) {
|
|
61093
61094
|
this.foundation.beforeShow();
|
|
@@ -63328,9 +63329,10 @@ class TextArea extends BaseComponent {
|
|
|
63328
63329
|
maxLength,
|
|
63329
63330
|
minLength,
|
|
63330
63331
|
showClear,
|
|
63331
|
-
borderless
|
|
63332
|
+
borderless,
|
|
63333
|
+
autoFocus
|
|
63332
63334
|
} = _a,
|
|
63333
|
-
rest = textarea_rest(_a, ["autosize", "placeholder", "onEnterPress", "onResize", "disabled", "readonly", "className", "showCounter", "validateStatus", "maxCount", "defaultValue", "style", "forwardRef", "getValueLength", "maxLength", "minLength", "showClear", "borderless"]);
|
|
63335
|
+
rest = textarea_rest(_a, ["autosize", "placeholder", "onEnterPress", "onResize", "disabled", "readonly", "className", "showCounter", "validateStatus", "maxCount", "defaultValue", "style", "forwardRef", "getValueLength", "maxLength", "minLength", "showClear", "borderless", "autoFocus"]);
|
|
63334
63336
|
const {
|
|
63335
63337
|
isFocus,
|
|
63336
63338
|
value,
|
|
@@ -63352,6 +63354,7 @@ class TextArea extends BaseComponent {
|
|
|
63352
63354
|
[`${textarea_prefixCls}-textarea-showClear`]: showClear
|
|
63353
63355
|
});
|
|
63354
63356
|
const itemProps = Object.assign(Object.assign({}, omit_default()(rest, 'insetLabel', 'insetLabelId', 'getValueLength', 'onClear', 'showClear')), {
|
|
63357
|
+
autoFocus: autoFocus || this.props['autofocus'],
|
|
63355
63358
|
className: itemCls,
|
|
63356
63359
|
disabled,
|
|
63357
63360
|
readOnly: readonly,
|
|
@@ -75814,6 +75817,7 @@ var sideSheet_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
75814
75817
|
|
|
75815
75818
|
|
|
75816
75819
|
|
|
75820
|
+
|
|
75817
75821
|
const sideSheet_prefixCls = sideSheet_constants_cssClasses.PREFIX;
|
|
75818
75822
|
const defaultWidthList = sideSheet_constants_strings.WIDTH;
|
|
75819
75823
|
const defaultHeight = sideSheet_constants_strings.HEIGHT;
|
|
@@ -75833,6 +75837,9 @@ class SideSheet extends BaseComponent {
|
|
|
75833
75837
|
displayNone: !this.props.visible
|
|
75834
75838
|
};
|
|
75835
75839
|
this.foundation = new SideSheetFoundation(this.adapter);
|
|
75840
|
+
this.bodyOverflow = '';
|
|
75841
|
+
this.scrollBarWidth = 0;
|
|
75842
|
+
this.originBodyWidth = '100%';
|
|
75836
75843
|
}
|
|
75837
75844
|
get adapter() {
|
|
75838
75845
|
return Object.assign(Object.assign({}, super.adapter), {
|
|
@@ -75840,16 +75847,19 @@ class SideSheet extends BaseComponent {
|
|
|
75840
75847
|
const {
|
|
75841
75848
|
getPopupContainer
|
|
75842
75849
|
} = this.props;
|
|
75843
|
-
|
|
75850
|
+
this.bodyOverflow = document.body.style.overflow || '';
|
|
75851
|
+
if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
|
|
75844
75852
|
document.body.style.overflow = 'hidden';
|
|
75853
|
+
document.body.style.width = `calc(${this.originBodyWidth || '100%'} - ${this.scrollBarWidth}px)`;
|
|
75845
75854
|
}
|
|
75846
75855
|
},
|
|
75847
75856
|
enabledBodyScroll: () => {
|
|
75848
75857
|
const {
|
|
75849
75858
|
getPopupContainer
|
|
75850
75859
|
} = this.props;
|
|
75851
|
-
if (!getPopupContainer &&
|
|
75852
|
-
document.body.style.overflow =
|
|
75860
|
+
if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
|
|
75861
|
+
document.body.style.overflow = this.bodyOverflow;
|
|
75862
|
+
document.body.style.width = this.originBodyWidth;
|
|
75853
75863
|
}
|
|
75854
75864
|
},
|
|
75855
75865
|
notifyCancel: e => {
|
|
@@ -75888,6 +75898,8 @@ class SideSheet extends BaseComponent {
|
|
|
75888
75898
|
return newState;
|
|
75889
75899
|
}
|
|
75890
75900
|
componentDidMount() {
|
|
75901
|
+
this.scrollBarWidth = getScrollbarWidth();
|
|
75902
|
+
this.originBodyWidth = document.body.style.width;
|
|
75891
75903
|
if (this.props.visible) {
|
|
75892
75904
|
this.foundation.beforeShow();
|
|
75893
75905
|
}
|
|
@@ -77285,7 +77297,7 @@ class Slider extends BaseComponent {
|
|
|
77285
77297
|
getMaxHandleEl: () => this.maxHanleEl.current,
|
|
77286
77298
|
onHandleDown: e => {
|
|
77287
77299
|
this._addEventListener(document.body, 'mousemove', this.foundation.onHandleMove, false);
|
|
77288
|
-
this._addEventListener(
|
|
77300
|
+
this._addEventListener(window, 'mouseup', this.foundation.onHandleUp, false);
|
|
77289
77301
|
this._addEventListener(document.body, 'touchmove', this.foundation.onHandleTouchMove, false);
|
|
77290
77302
|
},
|
|
77291
77303
|
onHandleMove: function (mousePos, isMin) {
|
|
@@ -77349,6 +77361,8 @@ class Slider extends BaseComponent {
|
|
|
77349
77361
|
});
|
|
77350
77362
|
},
|
|
77351
77363
|
onHandleUpBefore: e => {
|
|
77364
|
+
var _a, _b;
|
|
77365
|
+
(_b = (_a = this.props).onMouseUp) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
77352
77366
|
e.stopPropagation();
|
|
77353
77367
|
e.preventDefault();
|
|
77354
77368
|
document.body.removeEventListener('mousemove', this.foundation.onHandleMove, false);
|
|
@@ -77475,6 +77489,7 @@ Slider.propTypes = {
|
|
|
77475
77489
|
vertical: (prop_types_default()).bool,
|
|
77476
77490
|
onAfterChange: (prop_types_default()).func,
|
|
77477
77491
|
onChange: (prop_types_default()).func,
|
|
77492
|
+
onMouseUp: (prop_types_default()).func,
|
|
77478
77493
|
tooltipVisible: (prop_types_default()).bool,
|
|
77479
77494
|
style: (prop_types_default()).object,
|
|
77480
77495
|
className: (prop_types_default()).string,
|
|
@@ -100188,6 +100203,7 @@ class PreviewInnerFoundation extends foundation {
|
|
|
100188
100203
|
|
|
100189
100204
|
|
|
100190
100205
|
|
|
100206
|
+
|
|
100191
100207
|
const previewInner_prefixCls = image_constants_cssClasses.PREFIX;
|
|
100192
100208
|
let startMouseDown = {
|
|
100193
100209
|
x: 0,
|
|
@@ -100392,14 +100408,8 @@ class PreviewInner extends BaseComponent {
|
|
|
100392
100408
|
}
|
|
100393
100409
|
return willUpdateStates;
|
|
100394
100410
|
}
|
|
100395
|
-
static getScrollbarWidth() {
|
|
100396
|
-
if (globalThis && Object.prototype.toString.call(globalThis) === '[object Window]') {
|
|
100397
|
-
return window.innerWidth - document.documentElement.clientWidth;
|
|
100398
|
-
}
|
|
100399
|
-
return 0;
|
|
100400
|
-
}
|
|
100401
100411
|
componentDidMount() {
|
|
100402
|
-
this.scrollBarWidth =
|
|
100412
|
+
this.scrollBarWidth = getScrollbarWidth();
|
|
100403
100413
|
this.originBodyWidth = document.body.style.width;
|
|
100404
100414
|
if (this.props.visible) {
|
|
100405
100415
|
this.foundation.beforeShow();
|