@douyinfe/semi-ui 2.51.3 → 2.51.4
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 +103 -54
- 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.d.ts +3 -2
- package/lib/cjs/cascader/index.js +28 -19
- package/lib/cjs/datePicker/datePicker.js +1 -1
- package/lib/cjs/datePicker/yearAndMonth.js +20 -16
- package/lib/cjs/form/hoc/withField.d.ts +3 -3
- package/lib/cjs/modal/Modal.js +2 -2
- package/lib/cjs/select/option.js +2 -1
- package/lib/cjs/table/ResizableTable.js +1 -1
- package/lib/es/cascader/index.d.ts +3 -2
- package/lib/es/cascader/index.js +28 -19
- package/lib/es/datePicker/datePicker.js +1 -1
- package/lib/es/datePicker/yearAndMonth.js +20 -16
- package/lib/es/form/hoc/withField.d.ts +3 -3
- package/lib/es/modal/Modal.js +2 -2
- package/lib/es/select/option.js +2 -1
- package/lib/es/table/ResizableTable.js +1 -1
- package/package.json +8 -8
|
@@ -191,9 +191,10 @@ declare class Cascader extends BaseComponent<CascaderProps, CascaderState> {
|
|
|
191
191
|
componentWillUnmount(): void;
|
|
192
192
|
componentDidUpdate(prevProps: CascaderProps): void;
|
|
193
193
|
handleInputChange: (value: string) => void;
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
handleTagRemoveInTrigger: (pos: string) => void;
|
|
195
|
+
handleTagClose: (tagChildren: React.ReactNode, e: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
196
196
|
renderTagItem: (nodeKey: string, idx: number) => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
197
|
+
onRemoveInTagInput: (v: string) => void;
|
|
197
198
|
renderTagInput(): JSX.Element;
|
|
198
199
|
renderInput(): JSX.Element;
|
|
199
200
|
handleItemClick: (e: MouseEvent | KeyboardEvent, item: Entity | Data) => void;
|
|
@@ -43,14 +43,13 @@ class Cascader extends _baseComponent.default {
|
|
|
43
43
|
this.handleInputChange = value => {
|
|
44
44
|
this.foundation.handleInputChange(value);
|
|
45
45
|
};
|
|
46
|
-
this.
|
|
47
|
-
this.foundation.
|
|
46
|
+
this.handleTagRemoveInTrigger = pos => {
|
|
47
|
+
this.foundation.handleTagRemoveInTrigger(pos);
|
|
48
48
|
};
|
|
49
|
-
this.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.handleTagRemove(null, keyEntities[key].valuePath);
|
|
49
|
+
this.handleTagClose = (tagChildren, e, tagKey) => {
|
|
50
|
+
// When value has not changed, prevent clicking tag closeBtn to close tag
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
this.foundation.handleTagRemoveByKey(tagKey);
|
|
54
53
|
};
|
|
55
54
|
this.renderTagItem = (nodeKey, idx) => {
|
|
56
55
|
const {
|
|
@@ -78,18 +77,18 @@ class Cascader extends _baseComponent.default {
|
|
|
78
77
|
size: size === 'default' ? 'large' : size,
|
|
79
78
|
key: `tag-${nodeKey}-${idx}`,
|
|
80
79
|
color: "white",
|
|
80
|
+
tagKey: nodeKey,
|
|
81
81
|
className: tagCls,
|
|
82
82
|
closable: true,
|
|
83
|
-
onClose:
|
|
84
|
-
// When value has not changed, prevent clicking tag closeBtn to close tag
|
|
85
|
-
e.preventDefault();
|
|
86
|
-
this.handleTagRemove(e, keyEntities[nodeKey].valuePath);
|
|
87
|
-
}
|
|
83
|
+
onClose: this.handleTagClose
|
|
88
84
|
}, keyEntities[nodeKey].data[displayProp]);
|
|
89
85
|
}
|
|
90
86
|
}
|
|
91
87
|
return null;
|
|
92
88
|
};
|
|
89
|
+
this.onRemoveInTagInput = v => {
|
|
90
|
+
this.foundation.handleTagRemoveByKey(v);
|
|
91
|
+
};
|
|
93
92
|
this.handleItemClick = (e, item) => {
|
|
94
93
|
this.foundation.handleItemClick(e, item);
|
|
95
94
|
};
|
|
@@ -289,6 +288,7 @@ class Cascader extends _baseComponent.default {
|
|
|
289
288
|
}, labelNode);
|
|
290
289
|
};
|
|
291
290
|
this.renderCustomTrigger = () => {
|
|
291
|
+
var _a;
|
|
292
292
|
const {
|
|
293
293
|
disabled,
|
|
294
294
|
triggerRender,
|
|
@@ -299,17 +299,26 @@ class Cascader extends _baseComponent.default {
|
|
|
299
299
|
inputValue,
|
|
300
300
|
inputPlaceHolder,
|
|
301
301
|
resolvedCheckedKeys,
|
|
302
|
-
checkedKeys
|
|
302
|
+
checkedKeys,
|
|
303
|
+
keyEntities
|
|
303
304
|
} = this.state;
|
|
304
305
|
let realValue;
|
|
305
306
|
if (multiple) {
|
|
306
307
|
if (this.mergeType === _constants.strings.NONE_MERGE_TYPE) {
|
|
307
|
-
realValue =
|
|
308
|
+
realValue = new Set();
|
|
309
|
+
checkedKeys.forEach(key => {
|
|
310
|
+
var _a;
|
|
311
|
+
realValue.add((_a = keyEntities[key]) === null || _a === void 0 ? void 0 : _a.pos);
|
|
312
|
+
});
|
|
308
313
|
} else {
|
|
309
|
-
realValue =
|
|
314
|
+
realValue = new Set();
|
|
315
|
+
resolvedCheckedKeys.forEach(key => {
|
|
316
|
+
var _a;
|
|
317
|
+
realValue.add((_a = keyEntities[key]) === null || _a === void 0 ? void 0 : _a.pos);
|
|
318
|
+
});
|
|
310
319
|
}
|
|
311
320
|
} else {
|
|
312
|
-
realValue = [...selectedKeys][0];
|
|
321
|
+
realValue = (_a = keyEntities[[...selectedKeys][0]]) === null || _a === void 0 ? void 0 : _a.pos;
|
|
313
322
|
}
|
|
314
323
|
return /*#__PURE__*/_react.default.createElement(_trigger.default, {
|
|
315
324
|
value: realValue,
|
|
@@ -322,7 +331,7 @@ class Cascader extends _baseComponent.default {
|
|
|
322
331
|
componentName: 'Cascader',
|
|
323
332
|
componentProps: Object.assign({}, this.props),
|
|
324
333
|
onSearch: this.handleInputChange,
|
|
325
|
-
onRemove: this.
|
|
334
|
+
onRemove: this.handleTagRemoveInTrigger
|
|
326
335
|
});
|
|
327
336
|
};
|
|
328
337
|
this.handleMouseOver = () => {
|
|
@@ -806,11 +815,11 @@ class Cascader extends _baseComponent.default {
|
|
|
806
815
|
showRestTagsPopover: showRestTagsPopover,
|
|
807
816
|
restTagsPopoverProps: restTagsPopoverProps,
|
|
808
817
|
maxTagCount: maxTagCount,
|
|
809
|
-
renderTagItem:
|
|
818
|
+
renderTagItem: this.renderTagItem,
|
|
810
819
|
inputValue: inputValue,
|
|
811
820
|
onInputChange: this.handleInputChange,
|
|
812
821
|
// TODO Modify logic, not modify type
|
|
813
|
-
onRemove:
|
|
822
|
+
onRemove: this.onRemoveInTagInput,
|
|
814
823
|
placeholder: placeholder,
|
|
815
824
|
expandRestTagsOnClick: false
|
|
816
825
|
});
|
|
@@ -471,7 +471,7 @@ class DatePicker extends _baseComponent.default {
|
|
|
471
471
|
return /range/i.test(type) && !(0, _isFunction2.default)(triggerRender);
|
|
472
472
|
}
|
|
473
473
|
componentDidUpdate(prevProps) {
|
|
474
|
-
if (prevProps.value
|
|
474
|
+
if (!(0, _isEqual2.default)(prevProps.value, this.props.value)) {
|
|
475
475
|
this.foundation.initFromProps(Object.assign({}, this.props));
|
|
476
476
|
} else if (this.props.timeZone !== prevProps.timeZone) {
|
|
477
477
|
this.foundation.initFromProps({
|
|
@@ -48,16 +48,6 @@ class YearAndMonth extends _baseComponent.default {
|
|
|
48
48
|
currentYear,
|
|
49
49
|
currentMonth
|
|
50
50
|
} = props;
|
|
51
|
-
const currentLeftYear = currentYear.left || now.getFullYear();
|
|
52
|
-
const currentLeftMonth = currentMonth.left || now.getMonth() + 1;
|
|
53
|
-
currentYear = {
|
|
54
|
-
left: currentLeftYear,
|
|
55
|
-
right: currentLeftYear
|
|
56
|
-
};
|
|
57
|
-
currentMonth = {
|
|
58
|
-
left: currentLeftMonth,
|
|
59
|
-
right: currentMonth.right || currentLeftMonth + 1
|
|
60
|
-
};
|
|
61
51
|
this.state = {
|
|
62
52
|
years: (0, _index2.getYears)(props.startYear, props.endYear).map(year => ({
|
|
63
53
|
value: year,
|
|
@@ -67,8 +57,14 @@ class YearAndMonth extends _baseComponent.default {
|
|
|
67
57
|
value: idx + 1,
|
|
68
58
|
month: idx + 1
|
|
69
59
|
})),
|
|
70
|
-
currentYear
|
|
71
|
-
|
|
60
|
+
currentYear: {
|
|
61
|
+
left: currentYear.left || now.getFullYear(),
|
|
62
|
+
right: currentYear.right || now.getFullYear()
|
|
63
|
+
},
|
|
64
|
+
currentMonth: {
|
|
65
|
+
left: currentMonth.left || now.getMonth() + 1,
|
|
66
|
+
right: currentMonth.right || now.getMonth() + 2
|
|
67
|
+
}
|
|
72
68
|
};
|
|
73
69
|
this.yearRef = /*#__PURE__*/_react.default.createRef();
|
|
74
70
|
this.monthRef = /*#__PURE__*/_react.default.createRef();
|
|
@@ -105,11 +101,19 @@ class YearAndMonth extends _baseComponent.default {
|
|
|
105
101
|
}
|
|
106
102
|
static getDerivedStateFromProps(props, state) {
|
|
107
103
|
const willUpdateStates = {};
|
|
108
|
-
if (!(0, _isEqual2.default)(props.currentYear, state.currentYear)
|
|
109
|
-
|
|
104
|
+
if (!(0, _isEqual2.default)(props.currentYear, state.currentYear)) {
|
|
105
|
+
const nowYear = new Date().getFullYear();
|
|
106
|
+
willUpdateStates.currentYear = {
|
|
107
|
+
left: props.currentYear.left || nowYear,
|
|
108
|
+
right: props.currentYear.right || nowYear
|
|
109
|
+
};
|
|
110
110
|
}
|
|
111
|
-
if (!(0, _isEqual2.default)(props.currentMonth, state.currentMonth)
|
|
112
|
-
|
|
111
|
+
if (!(0, _isEqual2.default)(props.currentMonth, state.currentMonth)) {
|
|
112
|
+
const nowMonth = new Date().getMonth();
|
|
113
|
+
willUpdateStates.currentMonth = {
|
|
114
|
+
left: props.currentMonth.left || nowMonth + 1,
|
|
115
|
+
right: props.currentMonth.right || nowMonth + 2
|
|
116
|
+
};
|
|
113
117
|
}
|
|
114
118
|
return willUpdateStates;
|
|
115
119
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WithFieldOption } from '@douyinfe/semi-foundation/lib/cjs/form/interface';
|
|
3
|
-
import { CommonFieldProps, CommonexcludeType } from '../interface';
|
|
4
|
-
import { Subtract } from 'utility-types';
|
|
2
|
+
import type { WithFieldOption } from '@douyinfe/semi-foundation/lib/cjs/form/interface';
|
|
3
|
+
import type { CommonFieldProps, CommonexcludeType } from '../interface';
|
|
4
|
+
import type { Subtract } from 'utility-types';
|
|
5
5
|
/**
|
|
6
6
|
* withFiled is used to inject components
|
|
7
7
|
* 1. Takes over the value and onChange of the component and synchronizes them to Form Foundation
|
package/lib/cjs/modal/Modal.js
CHANGED
|
@@ -36,6 +36,7 @@ exports.destroyFns = destroyFns;
|
|
|
36
36
|
class Modal extends _baseComponent.default {
|
|
37
37
|
constructor(props) {
|
|
38
38
|
super(props);
|
|
39
|
+
this.bodyOverflow = null;
|
|
39
40
|
this.handleCancel = e => {
|
|
40
41
|
this.foundation.handleCancel(e);
|
|
41
42
|
};
|
|
@@ -175,7 +176,6 @@ class Modal extends _baseComponent.default {
|
|
|
175
176
|
};
|
|
176
177
|
this.foundation = new _modalFoundation.default(this.adapter);
|
|
177
178
|
this.modalRef = /*#__PURE__*/_react.default.createRef();
|
|
178
|
-
this.bodyOverflow = '';
|
|
179
179
|
this.scrollBarWidth = 0;
|
|
180
180
|
this.originBodyWidth = '100%';
|
|
181
181
|
}
|
|
@@ -196,7 +196,7 @@ class Modal extends _baseComponent.default {
|
|
|
196
196
|
const {
|
|
197
197
|
getPopupContainer
|
|
198
198
|
} = this.props;
|
|
199
|
-
if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
|
|
199
|
+
if (!getPopupContainer && this.bodyOverflow !== null && this.bodyOverflow !== 'hidden') {
|
|
200
200
|
document.body.style.overflow = this.bodyOverflow;
|
|
201
201
|
document.body.style.width = this.originBodyWidth;
|
|
202
202
|
}
|
package/lib/cjs/select/option.js
CHANGED
|
@@ -67,7 +67,7 @@ const ResizableTable = function () {
|
|
|
67
67
|
width: _constants.numbers.DEFAULT_WIDTH_COLUMN_EXPAND
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
if (props.rowSelection && !(0, _find2.default)(rawColumns, item => item.key === _constants.strings.DEFAULT_KEY_COLUMN_SELECTION)) {
|
|
70
|
+
if (props.rowSelection && !(0, _get2.default)(props.rowSelection, 'hidden') && !(0, _find2.default)(rawColumns, item => item.key === _constants.strings.DEFAULT_KEY_COLUMN_SELECTION)) {
|
|
71
71
|
newColumns.unshift({
|
|
72
72
|
width: (0, _get2.default)(props, 'rowSelection.width', _constants.numbers.DEFAULT_WIDTH_COLUMN_SELECTION),
|
|
73
73
|
key: _constants.strings.DEFAULT_KEY_COLUMN_SELECTION
|
|
@@ -191,9 +191,10 @@ declare class Cascader extends BaseComponent<CascaderProps, CascaderState> {
|
|
|
191
191
|
componentWillUnmount(): void;
|
|
192
192
|
componentDidUpdate(prevProps: CascaderProps): void;
|
|
193
193
|
handleInputChange: (value: string) => void;
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
handleTagRemoveInTrigger: (pos: string) => void;
|
|
195
|
+
handleTagClose: (tagChildren: React.ReactNode, e: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
196
196
|
renderTagItem: (nodeKey: string, idx: number) => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
197
|
+
onRemoveInTagInput: (v: string) => void;
|
|
197
198
|
renderTagInput(): JSX.Element;
|
|
198
199
|
renderInput(): JSX.Element;
|
|
199
200
|
handleItemClick: (e: MouseEvent | KeyboardEvent, item: Entity | Data) => void;
|
package/lib/es/cascader/index.js
CHANGED
|
@@ -34,14 +34,13 @@ class Cascader extends BaseComponent {
|
|
|
34
34
|
this.handleInputChange = value => {
|
|
35
35
|
this.foundation.handleInputChange(value);
|
|
36
36
|
};
|
|
37
|
-
this.
|
|
38
|
-
this.foundation.
|
|
37
|
+
this.handleTagRemoveInTrigger = pos => {
|
|
38
|
+
this.foundation.handleTagRemoveInTrigger(pos);
|
|
39
39
|
};
|
|
40
|
-
this.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.handleTagRemove(null, keyEntities[key].valuePath);
|
|
40
|
+
this.handleTagClose = (tagChildren, e, tagKey) => {
|
|
41
|
+
// When value has not changed, prevent clicking tag closeBtn to close tag
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
this.foundation.handleTagRemoveByKey(tagKey);
|
|
45
44
|
};
|
|
46
45
|
this.renderTagItem = (nodeKey, idx) => {
|
|
47
46
|
const {
|
|
@@ -69,18 +68,18 @@ class Cascader extends BaseComponent {
|
|
|
69
68
|
size: size === 'default' ? 'large' : size,
|
|
70
69
|
key: `tag-${nodeKey}-${idx}`,
|
|
71
70
|
color: "white",
|
|
71
|
+
tagKey: nodeKey,
|
|
72
72
|
className: tagCls,
|
|
73
73
|
closable: true,
|
|
74
|
-
onClose:
|
|
75
|
-
// When value has not changed, prevent clicking tag closeBtn to close tag
|
|
76
|
-
e.preventDefault();
|
|
77
|
-
this.handleTagRemove(e, keyEntities[nodeKey].valuePath);
|
|
78
|
-
}
|
|
74
|
+
onClose: this.handleTagClose
|
|
79
75
|
}, keyEntities[nodeKey].data[displayProp]);
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
78
|
return null;
|
|
83
79
|
};
|
|
80
|
+
this.onRemoveInTagInput = v => {
|
|
81
|
+
this.foundation.handleTagRemoveByKey(v);
|
|
82
|
+
};
|
|
84
83
|
this.handleItemClick = (e, item) => {
|
|
85
84
|
this.foundation.handleItemClick(e, item);
|
|
86
85
|
};
|
|
@@ -280,6 +279,7 @@ class Cascader extends BaseComponent {
|
|
|
280
279
|
}, labelNode);
|
|
281
280
|
};
|
|
282
281
|
this.renderCustomTrigger = () => {
|
|
282
|
+
var _a;
|
|
283
283
|
const {
|
|
284
284
|
disabled,
|
|
285
285
|
triggerRender,
|
|
@@ -290,17 +290,26 @@ class Cascader extends BaseComponent {
|
|
|
290
290
|
inputValue,
|
|
291
291
|
inputPlaceHolder,
|
|
292
292
|
resolvedCheckedKeys,
|
|
293
|
-
checkedKeys
|
|
293
|
+
checkedKeys,
|
|
294
|
+
keyEntities
|
|
294
295
|
} = this.state;
|
|
295
296
|
let realValue;
|
|
296
297
|
if (multiple) {
|
|
297
298
|
if (this.mergeType === strings.NONE_MERGE_TYPE) {
|
|
298
|
-
realValue =
|
|
299
|
+
realValue = new Set();
|
|
300
|
+
checkedKeys.forEach(key => {
|
|
301
|
+
var _a;
|
|
302
|
+
realValue.add((_a = keyEntities[key]) === null || _a === void 0 ? void 0 : _a.pos);
|
|
303
|
+
});
|
|
299
304
|
} else {
|
|
300
|
-
realValue =
|
|
305
|
+
realValue = new Set();
|
|
306
|
+
resolvedCheckedKeys.forEach(key => {
|
|
307
|
+
var _a;
|
|
308
|
+
realValue.add((_a = keyEntities[key]) === null || _a === void 0 ? void 0 : _a.pos);
|
|
309
|
+
});
|
|
301
310
|
}
|
|
302
311
|
} else {
|
|
303
|
-
realValue = [...selectedKeys][0];
|
|
312
|
+
realValue = (_a = keyEntities[[...selectedKeys][0]]) === null || _a === void 0 ? void 0 : _a.pos;
|
|
304
313
|
}
|
|
305
314
|
return /*#__PURE__*/React.createElement(Trigger, {
|
|
306
315
|
value: realValue,
|
|
@@ -313,7 +322,7 @@ class Cascader extends BaseComponent {
|
|
|
313
322
|
componentName: 'Cascader',
|
|
314
323
|
componentProps: Object.assign({}, this.props),
|
|
315
324
|
onSearch: this.handleInputChange,
|
|
316
|
-
onRemove: this.
|
|
325
|
+
onRemove: this.handleTagRemoveInTrigger
|
|
317
326
|
});
|
|
318
327
|
};
|
|
319
328
|
this.handleMouseOver = () => {
|
|
@@ -797,11 +806,11 @@ class Cascader extends BaseComponent {
|
|
|
797
806
|
showRestTagsPopover: showRestTagsPopover,
|
|
798
807
|
restTagsPopoverProps: restTagsPopoverProps,
|
|
799
808
|
maxTagCount: maxTagCount,
|
|
800
|
-
renderTagItem:
|
|
809
|
+
renderTagItem: this.renderTagItem,
|
|
801
810
|
inputValue: inputValue,
|
|
802
811
|
onInputChange: this.handleInputChange,
|
|
803
812
|
// TODO Modify logic, not modify type
|
|
804
|
-
onRemove:
|
|
813
|
+
onRemove: this.onRemoveInTagInput,
|
|
805
814
|
placeholder: placeholder,
|
|
806
815
|
expandRestTagsOnClick: false
|
|
807
816
|
});
|
|
@@ -463,7 +463,7 @@ export default class DatePicker extends BaseComponent {
|
|
|
463
463
|
return /range/i.test(type) && !_isFunction(triggerRender);
|
|
464
464
|
}
|
|
465
465
|
componentDidUpdate(prevProps) {
|
|
466
|
-
if (prevProps.value
|
|
466
|
+
if (!_isEqual(prevProps.value, this.props.value)) {
|
|
467
467
|
this.foundation.initFromProps(Object.assign({}, this.props));
|
|
468
468
|
} else if (this.props.timeZone !== prevProps.timeZone) {
|
|
469
469
|
this.foundation.initFromProps({
|
|
@@ -41,16 +41,6 @@ class YearAndMonth extends BaseComponent {
|
|
|
41
41
|
currentYear,
|
|
42
42
|
currentMonth
|
|
43
43
|
} = props;
|
|
44
|
-
const currentLeftYear = currentYear.left || now.getFullYear();
|
|
45
|
-
const currentLeftMonth = currentMonth.left || now.getMonth() + 1;
|
|
46
|
-
currentYear = {
|
|
47
|
-
left: currentLeftYear,
|
|
48
|
-
right: currentLeftYear
|
|
49
|
-
};
|
|
50
|
-
currentMonth = {
|
|
51
|
-
left: currentLeftMonth,
|
|
52
|
-
right: currentMonth.right || currentLeftMonth + 1
|
|
53
|
-
};
|
|
54
44
|
this.state = {
|
|
55
45
|
years: getYears(props.startYear, props.endYear).map(year => ({
|
|
56
46
|
value: year,
|
|
@@ -60,8 +50,14 @@ class YearAndMonth extends BaseComponent {
|
|
|
60
50
|
value: idx + 1,
|
|
61
51
|
month: idx + 1
|
|
62
52
|
})),
|
|
63
|
-
currentYear
|
|
64
|
-
|
|
53
|
+
currentYear: {
|
|
54
|
+
left: currentYear.left || now.getFullYear(),
|
|
55
|
+
right: currentYear.right || now.getFullYear()
|
|
56
|
+
},
|
|
57
|
+
currentMonth: {
|
|
58
|
+
left: currentMonth.left || now.getMonth() + 1,
|
|
59
|
+
right: currentMonth.right || now.getMonth() + 2
|
|
60
|
+
}
|
|
65
61
|
};
|
|
66
62
|
this.yearRef = /*#__PURE__*/React.createRef();
|
|
67
63
|
this.monthRef = /*#__PURE__*/React.createRef();
|
|
@@ -98,11 +94,19 @@ class YearAndMonth extends BaseComponent {
|
|
|
98
94
|
}
|
|
99
95
|
static getDerivedStateFromProps(props, state) {
|
|
100
96
|
const willUpdateStates = {};
|
|
101
|
-
if (!_isEqual(props.currentYear, state.currentYear)
|
|
102
|
-
|
|
97
|
+
if (!_isEqual(props.currentYear, state.currentYear)) {
|
|
98
|
+
const nowYear = new Date().getFullYear();
|
|
99
|
+
willUpdateStates.currentYear = {
|
|
100
|
+
left: props.currentYear.left || nowYear,
|
|
101
|
+
right: props.currentYear.right || nowYear
|
|
102
|
+
};
|
|
103
103
|
}
|
|
104
|
-
if (!_isEqual(props.currentMonth, state.currentMonth)
|
|
105
|
-
|
|
104
|
+
if (!_isEqual(props.currentMonth, state.currentMonth)) {
|
|
105
|
+
const nowMonth = new Date().getMonth();
|
|
106
|
+
willUpdateStates.currentMonth = {
|
|
107
|
+
left: props.currentMonth.left || nowMonth + 1,
|
|
108
|
+
right: props.currentMonth.right || nowMonth + 2
|
|
109
|
+
};
|
|
106
110
|
}
|
|
107
111
|
return willUpdateStates;
|
|
108
112
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WithFieldOption } from '@douyinfe/semi-foundation/lib/es/form/interface';
|
|
3
|
-
import { CommonFieldProps, CommonexcludeType } from '../interface';
|
|
4
|
-
import { Subtract } from 'utility-types';
|
|
2
|
+
import type { WithFieldOption } from '@douyinfe/semi-foundation/lib/es/form/interface';
|
|
3
|
+
import type { CommonFieldProps, CommonexcludeType } from '../interface';
|
|
4
|
+
import type { Subtract } from 'utility-types';
|
|
5
5
|
/**
|
|
6
6
|
* withFiled is used to inject components
|
|
7
7
|
* 1. Takes over the value and onChange of the component and synchronizes them to Form Foundation
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -26,6 +26,7 @@ export const destroyFns = [];
|
|
|
26
26
|
class Modal extends BaseComponent {
|
|
27
27
|
constructor(props) {
|
|
28
28
|
super(props);
|
|
29
|
+
this.bodyOverflow = null;
|
|
29
30
|
this.handleCancel = e => {
|
|
30
31
|
this.foundation.handleCancel(e);
|
|
31
32
|
};
|
|
@@ -165,7 +166,6 @@ class Modal extends BaseComponent {
|
|
|
165
166
|
};
|
|
166
167
|
this.foundation = new ModalFoundation(this.adapter);
|
|
167
168
|
this.modalRef = /*#__PURE__*/React.createRef();
|
|
168
|
-
this.bodyOverflow = '';
|
|
169
169
|
this.scrollBarWidth = 0;
|
|
170
170
|
this.originBodyWidth = '100%';
|
|
171
171
|
}
|
|
@@ -186,7 +186,7 @@ class Modal extends BaseComponent {
|
|
|
186
186
|
const {
|
|
187
187
|
getPopupContainer
|
|
188
188
|
} = this.props;
|
|
189
|
-
if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
|
|
189
|
+
if (!getPopupContainer && this.bodyOverflow !== null && this.bodyOverflow !== 'hidden') {
|
|
190
190
|
document.body.style.overflow = this.bodyOverflow;
|
|
191
191
|
document.body.style.width = this.originBodyWidth;
|
|
192
192
|
}
|
package/lib/es/select/option.js
CHANGED
|
@@ -57,7 +57,7 @@ const ResizableTable = function () {
|
|
|
57
57
|
width: numbers.DEFAULT_WIDTH_COLUMN_EXPAND
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
if (props.rowSelection && !_find(rawColumns, item => item.key === strings.DEFAULT_KEY_COLUMN_SELECTION)) {
|
|
60
|
+
if (props.rowSelection && !_get(props.rowSelection, 'hidden') && !_find(rawColumns, item => item.key === strings.DEFAULT_KEY_COLUMN_SELECTION)) {
|
|
61
61
|
newColumns.unshift({
|
|
62
62
|
width: _get(props, 'rowSelection.width', numbers.DEFAULT_WIDTH_COLUMN_SELECTION),
|
|
63
63
|
key: strings.DEFAULT_KEY_COLUMN_SELECTION
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.51.
|
|
3
|
+
"version": "2.51.4",
|
|
4
4
|
"description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@dnd-kit/core": "^6.0.8",
|
|
21
21
|
"@dnd-kit/sortable": "^7.0.2",
|
|
22
22
|
"@dnd-kit/utilities": "^3.2.1",
|
|
23
|
-
"@douyinfe/semi-animation": "2.51.
|
|
24
|
-
"@douyinfe/semi-animation-react": "2.51.
|
|
25
|
-
"@douyinfe/semi-foundation": "2.51.
|
|
26
|
-
"@douyinfe/semi-icons": "2.51.
|
|
27
|
-
"@douyinfe/semi-illustrations": "2.51.
|
|
28
|
-
"@douyinfe/semi-theme-default": "2.51.
|
|
23
|
+
"@douyinfe/semi-animation": "2.51.4",
|
|
24
|
+
"@douyinfe/semi-animation-react": "2.51.4",
|
|
25
|
+
"@douyinfe/semi-foundation": "2.51.4",
|
|
26
|
+
"@douyinfe/semi-icons": "2.51.4",
|
|
27
|
+
"@douyinfe/semi-illustrations": "2.51.4",
|
|
28
|
+
"@douyinfe/semi-theme-default": "2.51.4",
|
|
29
29
|
"async-validator": "^3.5.0",
|
|
30
30
|
"classnames": "^2.2.6",
|
|
31
31
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
],
|
|
76
76
|
"author": "",
|
|
77
77
|
"license": "MIT",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "b8cad87796be9b6b10409a95d3a5b4cb8b9592e6",
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
81
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|