@douyinfe/semi-ui 2.0.9-alpha.3 → 2.1.0-alpha.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/css/semi.css +14 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +1633 -2533
- 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/es/_base/baseComponent.js +1 -5
- package/lib/es/_portal/index.js +7 -17
- package/lib/es/_utils/index.js +13 -16
- package/lib/es/breadcrumb/index.js +2 -4
- package/lib/es/breadcrumb/item.js +4 -6
- package/lib/es/button/index.d.ts +0 -1
- package/lib/es/button/index.js +2 -4
- package/lib/es/calendar/monthCalendar.js +9 -11
- package/lib/es/cascader/index.d.ts +1 -0
- package/lib/es/cascader/index.js +23 -14
- package/lib/es/cascader/item.js +1 -2
- package/lib/es/collapse/item.js +1 -2
- package/lib/es/collapsible/index.js +9 -9
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/dateInput.js +9 -29
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/datePicker.js +12 -49
- package/lib/es/datePicker/footer.js +1 -2
- package/lib/es/datePicker/index.js +12 -15
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.js +17 -23
- package/lib/es/dropdown/dropdownDivider.js +1 -2
- package/lib/es/form/baseForm.d.ts +3 -9
- package/lib/es/form/field.d.ts +3 -21
- package/lib/es/form/field.js +2 -18
- package/lib/es/form/hoc/withField.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +3 -14
- package/lib/es/iconButton/index.d.ts +0 -1
- package/lib/es/iconButton/index.js +0 -1
- package/lib/es/inputNumber/index.js +4 -12
- package/lib/es/locale/localeConsumer.js +3 -6
- package/lib/es/modal/ConfirmModal.js +2 -2
- package/lib/es/modal/confirm.js +2 -2
- package/lib/es/modal/useModal/HookModal.js +2 -2
- package/lib/es/motions/Rotate.js +4 -6
- package/lib/es/navigation/CollapseButton.js +7 -9
- package/lib/es/navigation/Item.js +7 -33
- package/lib/es/navigation/OpenIconTransition.js +4 -6
- package/lib/es/navigation/SubNav.js +6 -33
- package/lib/es/navigation/SubNavTransition.js +5 -7
- package/lib/es/navigation/index.js +6 -24
- package/lib/es/notification/NoticeTransition.js +5 -7
- package/lib/es/notification/index.js +8 -16
- package/lib/es/notification/useNotification/index.js +7 -11
- package/lib/es/overflowList/index.js +4 -9
- package/lib/es/overflowList/intersectionObserver.js +1 -2
- package/lib/es/popconfirm/index.d.ts +5 -1
- package/lib/es/popconfirm/index.js +10 -4
- package/lib/es/popover/Arrow.js +1 -3
- package/lib/es/popover/index.d.ts +3 -1
- package/lib/es/popover/index.js +4 -8
- package/lib/es/radio/context.d.ts +1 -1
- package/lib/es/radio/radio.d.ts +2 -2
- package/lib/es/radio/radioGroup.d.ts +4 -4
- package/lib/es/resizeObserver/index.js +1 -2
- package/lib/es/scrollList/scrollItem.d.ts +4 -3
- package/lib/es/scrollList/scrollItem.js +32 -48
- package/lib/es/select/index.js +19 -16
- package/lib/es/select/option.js +8 -10
- package/lib/es/select/utils.d.ts +1 -1
- package/lib/es/select/utils.js +10 -4
- package/lib/es/select/virtualRow.js +5 -6
- package/lib/es/sideSheet/SideSheetTransition.js +1 -3
- package/lib/es/slider/index.js +11 -23
- package/lib/es/spin/icon.js +1 -3
- package/lib/es/table/Body/BaseRow.js +8 -16
- package/lib/es/table/Body/SectionRow.js +3 -6
- package/lib/es/table/Body/index.js +32 -49
- package/lib/es/table/Column.js +1 -2
- package/lib/es/table/ColumnFilter.js +2 -6
- package/lib/es/table/ColumnSelection.js +1 -5
- package/lib/es/table/HeadTable.js +3 -4
- package/lib/es/table/ResizableTable.js +20 -31
- package/lib/es/table/Table.d.ts +1 -1
- package/lib/es/table/Table.js +63 -160
- package/lib/es/table/TableCell.js +3 -5
- package/lib/es/table/TableContextProvider.js +15 -16
- package/lib/es/table/TableHeader.js +1 -4
- package/lib/es/table/utils.js +1 -3
- package/lib/es/tabs/TabBar.d.ts +5 -3
- package/lib/es/tabs/TabBar.js +12 -4
- package/lib/es/tabs/TabPane.d.ts +2 -1
- package/lib/es/tabs/TabPane.js +3 -2
- package/lib/es/tabs/TabPaneTransition.js +9 -12
- package/lib/es/tabs/index.d.ts +3 -1
- package/lib/es/tabs/index.js +83 -14
- package/lib/es/tabs/interface.d.ts +6 -1
- package/lib/es/tagInput/index.d.ts +3 -0
- package/lib/es/tagInput/index.js +6 -1
- package/lib/es/timePicker/Combobox.js +5 -6
- package/lib/es/timePicker/TimeInput.js +3 -11
- package/lib/es/timePicker/TimePicker.d.ts +2 -2
- package/lib/es/timePicker/TimePicker.js +7 -21
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +2 -2
- package/lib/es/timePicker/index.js +12 -15
- package/lib/es/toast/ToastTransition.js +8 -12
- package/lib/es/toast/useToast/index.js +3 -6
- package/lib/es/tooltip/TooltipStyledTransition.js +10 -14
- package/lib/es/tooltip/index.d.ts +3 -0
- package/lib/es/tooltip/index.js +22 -28
- package/lib/es/transfer/index.js +15 -18
- package/lib/es/tree/index.js +28 -38
- package/lib/es/tree/interface.d.ts +2 -2
- package/lib/es/treeSelect/index.d.ts +2 -11
- package/lib/es/treeSelect/index.js +32 -44
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/typography/util.js +3 -12
- package/lib/es/upload/fileCard.js +53 -62
- package/lib/es/upload/index.d.ts +2 -2
- package/lib/es/upload/index.js +23 -32
- package/package.json +8 -8
|
@@ -55,11 +55,7 @@ export default class BaseComponent extends Component {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
log(text) {
|
|
59
|
-
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
60
|
-
rest[_key - 1] = arguments[_key];
|
|
61
|
-
}
|
|
62
|
-
|
|
58
|
+
log(text, ...rest) {
|
|
63
59
|
return log(text, ...rest);
|
|
64
60
|
}
|
|
65
61
|
|
package/lib/es/_portal/index.js
CHANGED
|
@@ -11,36 +11,26 @@ const defaultGetContainer = () => document.body;
|
|
|
11
11
|
|
|
12
12
|
class Portal extends PureComponent {
|
|
13
13
|
constructor(props) {
|
|
14
|
-
var _this;
|
|
15
|
-
|
|
16
14
|
super(props);
|
|
17
|
-
_this = this;
|
|
18
|
-
|
|
19
|
-
this.addStyle = function () {
|
|
20
|
-
let style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21
15
|
|
|
22
|
-
|
|
16
|
+
this.addStyle = (style = {}) => {
|
|
17
|
+
if (this.el) {
|
|
23
18
|
for (const key of _Object$keys(style)) {
|
|
24
|
-
|
|
19
|
+
this.el.style[key] = style[key];
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
};
|
|
28
23
|
|
|
29
|
-
this.addClass =
|
|
24
|
+
this.addClass = (prefixCls, ...classNames) => {
|
|
30
25
|
const {
|
|
31
26
|
direction
|
|
32
|
-
} =
|
|
33
|
-
|
|
34
|
-
for (var _len = arguments.length, classNames = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
35
|
-
classNames[_key - 1] = arguments[_key];
|
|
36
|
-
}
|
|
37
|
-
|
|
27
|
+
} = this.context;
|
|
38
28
|
const cls = classnames(prefixCls, ...classNames, {
|
|
39
29
|
["".concat(prefixCls, "-rtl")]: direction === 'rtl'
|
|
40
30
|
});
|
|
41
31
|
|
|
42
|
-
if (
|
|
43
|
-
|
|
32
|
+
if (this.el) {
|
|
33
|
+
this.el.className = cls;
|
|
44
34
|
}
|
|
45
35
|
};
|
|
46
36
|
|
package/lib/es/_utils/index.js
CHANGED
|
@@ -84,15 +84,14 @@ export function cloneDeep(value, customizer) {
|
|
|
84
84
|
* @return {Array<object>}
|
|
85
85
|
*/
|
|
86
86
|
|
|
87
|
-
export const getHighLightTextHTML =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
} = _ref;
|
|
87
|
+
export const getHighLightTextHTML = ({
|
|
88
|
+
sourceString = '',
|
|
89
|
+
searchWords = [],
|
|
90
|
+
option = {
|
|
91
|
+
autoEscape: true,
|
|
92
|
+
caseSensitive: false
|
|
93
|
+
}
|
|
94
|
+
}) => {
|
|
96
95
|
const chunks = findAll(_Object$assign({
|
|
97
96
|
sourceString,
|
|
98
97
|
searchWords
|
|
@@ -125,13 +124,11 @@ export const getHighLightTextHTML = _ref => {
|
|
|
125
124
|
* @returns function
|
|
126
125
|
*/
|
|
127
126
|
|
|
128
|
-
export const registerMediaQuery = (media,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
} = _ref2;
|
|
134
|
-
|
|
127
|
+
export const registerMediaQuery = (media, {
|
|
128
|
+
match,
|
|
129
|
+
unmatch,
|
|
130
|
+
callInInit = true
|
|
131
|
+
}) => {
|
|
135
132
|
if (typeof window !== 'undefined') {
|
|
136
133
|
const mediaQueryList = window.matchMedia(media);
|
|
137
134
|
|
|
@@ -147,11 +147,9 @@ class Breadcrumb extends BaseComponent {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
get adapter() {
|
|
150
|
-
var _this = this;
|
|
151
|
-
|
|
152
150
|
return _Object$assign(_Object$assign({}, super.adapter), {
|
|
153
|
-
notifyClick:
|
|
154
|
-
|
|
151
|
+
notifyClick: (...args) => {
|
|
152
|
+
this.props.onClick(...args);
|
|
155
153
|
},
|
|
156
154
|
expandCollapsed: () => this.setState({
|
|
157
155
|
isCollapsed: false
|
|
@@ -149,14 +149,12 @@ export default class BreadcrumbItem extends BaseComponent {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
get adapter() {
|
|
152
|
-
var _this = this;
|
|
153
|
-
|
|
154
152
|
return _Object$assign(_Object$assign({}, super.adapter), {
|
|
155
|
-
notifyClick:
|
|
156
|
-
|
|
153
|
+
notifyClick: (...args) => {
|
|
154
|
+
this.props.onClick(...args);
|
|
157
155
|
},
|
|
158
|
-
notifyParent:
|
|
159
|
-
|
|
156
|
+
notifyParent: (...args) => {
|
|
157
|
+
this.context.onClick(...args);
|
|
160
158
|
}
|
|
161
159
|
});
|
|
162
160
|
}
|
package/lib/es/button/index.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
14
14
|
loading: import("prop-types").Requireable<boolean>;
|
|
15
15
|
prefixCls: import("prop-types").Requireable<string>;
|
|
16
16
|
icon: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
17
|
-
iconType: import("prop-types").Requireable<import("prop-types").ReactElementLike>;
|
|
18
17
|
iconSize: import("prop-types").Requireable<string>;
|
|
19
18
|
noHorizontalPadding: import("prop-types").Requireable<string | boolean | any[]>;
|
|
20
19
|
children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
package/lib/es/button/index.js
CHANGED
|
@@ -4,16 +4,14 @@ import BaseButton from './Button';
|
|
|
4
4
|
import IconButton from '../iconButton';
|
|
5
5
|
|
|
6
6
|
class Button extends React.PureComponent {
|
|
7
|
-
constructor() {
|
|
8
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
constructor(props = {}) {
|
|
9
8
|
super(props);
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
render() {
|
|
13
12
|
const props = _Object$assign({}, this.props);
|
|
14
13
|
|
|
15
|
-
const hasIcon = Boolean(props.icon
|
|
16
|
-
|
|
14
|
+
const hasIcon = Boolean(props.icon);
|
|
17
15
|
const isLoading = Boolean(props.loading);
|
|
18
16
|
const isDisabled = Boolean(props.disabled);
|
|
19
17
|
|
|
@@ -31,10 +31,9 @@ const contentPadding = 60;
|
|
|
31
31
|
const contentHeight = 24;
|
|
32
32
|
export default class monthCalendar extends BaseComponent {
|
|
33
33
|
constructor(props) {
|
|
34
|
-
var
|
|
34
|
+
var _context4;
|
|
35
35
|
|
|
36
36
|
super(props);
|
|
37
|
-
_this = this;
|
|
38
37
|
|
|
39
38
|
this.calcItemLimit = () => {
|
|
40
39
|
this.contentCellHeight = this.cellDom.current.getBoundingClientRect().height;
|
|
@@ -213,14 +212,13 @@ export default class monthCalendar extends BaseComponent {
|
|
|
213
212
|
return dateGridRender(date.toString(), date);
|
|
214
213
|
};
|
|
215
214
|
|
|
216
|
-
this.renderWeekRow =
|
|
217
|
-
let events = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
215
|
+
this.renderWeekRow = (index, weekDay, events = {}) => {
|
|
218
216
|
const {
|
|
219
217
|
markWeekend
|
|
220
|
-
} =
|
|
218
|
+
} = this.props;
|
|
221
219
|
const {
|
|
222
220
|
itemLimit
|
|
223
|
-
} =
|
|
221
|
+
} = this.state;
|
|
224
222
|
const {
|
|
225
223
|
display,
|
|
226
224
|
day
|
|
@@ -228,7 +226,7 @@ export default class monthCalendar extends BaseComponent {
|
|
|
228
226
|
return /*#__PURE__*/React.createElement("div", {
|
|
229
227
|
role: "gridcell",
|
|
230
228
|
className: "".concat(prefixCls, "-weekrow"),
|
|
231
|
-
ref:
|
|
229
|
+
ref: this.cellDom,
|
|
232
230
|
key: "".concat(index, "-weekrow")
|
|
233
231
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
234
232
|
className: "".concat(prefixCls, "-skeleton")
|
|
@@ -251,17 +249,17 @@ export default class monthCalendar extends BaseComponent {
|
|
|
251
249
|
const inner = /*#__PURE__*/React.createElement("li", {
|
|
252
250
|
key: "".concat(date, "-weeksk"),
|
|
253
251
|
className: listCls,
|
|
254
|
-
onClick: e =>
|
|
255
|
-
},
|
|
252
|
+
onClick: e => this.handleClick(e, [date])
|
|
253
|
+
}, this.formatDayString(month, dayString), this.renderCusDateGrid(date));
|
|
256
254
|
|
|
257
255
|
if (!shouldRenderCollapsed) {
|
|
258
256
|
return inner;
|
|
259
257
|
}
|
|
260
258
|
|
|
261
|
-
return
|
|
259
|
+
return this.renderCollapsed(day[ind], each, listCls, month);
|
|
262
260
|
})), /*#__PURE__*/React.createElement("ul", {
|
|
263
261
|
className: "".concat(cssClasses.PREFIX, "-event-items")
|
|
264
|
-
}, display ?
|
|
262
|
+
}, display ? this.renderEvents(display) : null));
|
|
265
263
|
};
|
|
266
264
|
|
|
267
265
|
this.renderMonthGrid = () => {
|
|
@@ -7,6 +7,7 @@ import Input from '../input/index';
|
|
|
7
7
|
import { PopoverProps } from '../popover/index';
|
|
8
8
|
import { CascaderData, Entities, Entity, Data } from './item';
|
|
9
9
|
import { Motion } from '../_base/base';
|
|
10
|
+
export { CascaderType, ShowNextType } from '@douyinfe/semi-foundation/lib/es/cascader/foundation';
|
|
10
11
|
export { CascaderData, Entity, Data, CascaderItemProps } from './item';
|
|
11
12
|
export interface ScrollPanelProps extends BasicScrollPanelProps {
|
|
12
13
|
activeNode: CascaderData;
|
package/lib/es/cascader/index.js
CHANGED
|
@@ -272,15 +272,27 @@ class Cascader extends BaseComponent {
|
|
|
272
272
|
this.renderCustomTrigger = () => {
|
|
273
273
|
const {
|
|
274
274
|
disabled,
|
|
275
|
-
triggerRender
|
|
275
|
+
triggerRender,
|
|
276
|
+
multiple,
|
|
277
|
+
autoMergeValue
|
|
276
278
|
} = this.props;
|
|
277
279
|
const {
|
|
278
280
|
selectedKeys,
|
|
279
281
|
inputValue,
|
|
280
|
-
inputPlaceHolder
|
|
282
|
+
inputPlaceHolder,
|
|
283
|
+
mergedCheckedKeys,
|
|
284
|
+
checkedKeys
|
|
281
285
|
} = this.state;
|
|
286
|
+
let realValue;
|
|
287
|
+
|
|
288
|
+
if (multiple) {
|
|
289
|
+
realValue = autoMergeValue ? mergedCheckedKeys : checkedKeys;
|
|
290
|
+
} else {
|
|
291
|
+
realValue = [...selectedKeys][0];
|
|
292
|
+
}
|
|
293
|
+
|
|
282
294
|
return /*#__PURE__*/React.createElement(Trigger, {
|
|
283
|
-
value:
|
|
295
|
+
value: realValue,
|
|
284
296
|
inputValue: inputValue,
|
|
285
297
|
onChange: this.handleInputChange,
|
|
286
298
|
onClear: this.handleClear,
|
|
@@ -476,8 +488,6 @@ class Cascader extends BaseComponent {
|
|
|
476
488
|
}
|
|
477
489
|
|
|
478
490
|
get adapter() {
|
|
479
|
-
var _this = this;
|
|
480
|
-
|
|
481
491
|
const filterAdapter = {
|
|
482
492
|
updateInputValue: value => {
|
|
483
493
|
this.setState({
|
|
@@ -553,11 +563,11 @@ class Cascader extends BaseComponent {
|
|
|
553
563
|
notifyOnSearch: input => {
|
|
554
564
|
this.props.onSearch && this.props.onSearch(input);
|
|
555
565
|
},
|
|
556
|
-
notifyFocus:
|
|
557
|
-
|
|
566
|
+
notifyFocus: (...v) => {
|
|
567
|
+
this.props.onFocus && this.props.onFocus(...v);
|
|
558
568
|
},
|
|
559
|
-
notifyBlur:
|
|
560
|
-
|
|
569
|
+
notifyBlur: (...v) => {
|
|
570
|
+
this.props.onBlur && this.props.onBlur(...v);
|
|
561
571
|
},
|
|
562
572
|
notifyDropdownVisibleChange: visible => {
|
|
563
573
|
this.props.onDropdownVisibleChange(visible);
|
|
@@ -590,11 +600,10 @@ class Cascader extends BaseComponent {
|
|
|
590
600
|
} = this.props;
|
|
591
601
|
onLoad && onLoad(newLoadedKeys, data);
|
|
592
602
|
},
|
|
593
|
-
notifyListScroll: (e,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
} = _ref;
|
|
603
|
+
notifyListScroll: (e, {
|
|
604
|
+
panelIndex,
|
|
605
|
+
activeNode
|
|
606
|
+
}) => {
|
|
598
607
|
this.props.onListScroll(e, {
|
|
599
608
|
panelIndex,
|
|
600
609
|
activeNode
|
package/lib/es/cascader/item.js
CHANGED
|
@@ -182,8 +182,7 @@ export default class Item extends PureComponent {
|
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
renderItem(renderData) {
|
|
186
|
-
let content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
185
|
+
renderItem(renderData, content = []) {
|
|
187
186
|
const {
|
|
188
187
|
multiple,
|
|
189
188
|
checkedKeys,
|
package/lib/es/collapse/item.js
CHANGED
|
@@ -21,8 +21,7 @@ import Collapsible from '../collapsible';
|
|
|
21
21
|
import CollapseContext from './collapse-context';
|
|
22
22
|
import { IconChevronDown, IconChevronUp } from '@douyinfe/semi-icons';
|
|
23
23
|
export default class CollapsePanel extends PureComponent {
|
|
24
|
-
renderHeader(active) {
|
|
25
|
-
let expandIconEnable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
24
|
+
renderHeader(active, expandIconEnable = true) {
|
|
26
25
|
const {
|
|
27
26
|
header,
|
|
28
27
|
extra
|
|
@@ -51,14 +51,11 @@ const Collapsible = props => {
|
|
|
51
51
|
ref.current.style.maxHeight = 'none';
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
const formatStyle =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
maxHeight: maxHeightInTransitionStyle
|
|
60
|
-
};
|
|
61
|
-
};
|
|
54
|
+
const formatStyle = ({
|
|
55
|
+
maxHeight: maxHeightInTransitionStyle
|
|
56
|
+
}) => ({
|
|
57
|
+
maxHeight: maxHeightInTransitionStyle
|
|
58
|
+
});
|
|
62
59
|
|
|
63
60
|
const shouldKeepDOM = () => keepDOM || collapseHeight !== 0;
|
|
64
61
|
|
|
@@ -84,7 +81,10 @@ const Collapsible = props => {
|
|
|
84
81
|
className: wrapperCls,
|
|
85
82
|
ref: ref
|
|
86
83
|
}, /*#__PURE__*/React.createElement("div", {
|
|
87
|
-
ref: setHeight
|
|
84
|
+
ref: setHeight,
|
|
85
|
+
style: {
|
|
86
|
+
overflow: 'hidden'
|
|
87
|
+
}
|
|
88
88
|
}, children));
|
|
89
89
|
};
|
|
90
90
|
|
|
@@ -24,7 +24,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
24
24
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
25
|
value: PropTypes.Requireable<any[]>;
|
|
26
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
27
|
-
type: PropTypes.Requireable<"date" | "
|
|
27
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
28
28
|
multiple: PropTypes.Requireable<boolean>;
|
|
29
29
|
showClear: PropTypes.Requireable<boolean>;
|
|
30
30
|
format: PropTypes.Requireable<string>;
|
|
@@ -83,39 +83,19 @@ export default class DateInput extends BaseComponent {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
get adapter() {
|
|
86
|
-
var _this = this;
|
|
87
|
-
|
|
88
86
|
return _Object$assign(_Object$assign({}, super.adapter), {
|
|
89
87
|
updateIsFocusing: isFocusing => this.setState({
|
|
90
88
|
isFocusing
|
|
91
89
|
}),
|
|
92
|
-
notifyClick:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
notifyBlur: function () {
|
|
102
|
-
return _this.props.onBlur(...arguments);
|
|
103
|
-
},
|
|
104
|
-
notifyClear: function () {
|
|
105
|
-
return _this.props.onClear(...arguments);
|
|
106
|
-
},
|
|
107
|
-
notifyFocus: function () {
|
|
108
|
-
return _this.props.onFocus(...arguments);
|
|
109
|
-
},
|
|
110
|
-
notifyRangeInputClear: function () {
|
|
111
|
-
return _this.props.onRangeClear(...arguments);
|
|
112
|
-
},
|
|
113
|
-
notifyRangeInputFocus: function () {
|
|
114
|
-
return _this.props.onFocus(...arguments);
|
|
115
|
-
},
|
|
116
|
-
notifyTabPress: function () {
|
|
117
|
-
return _this.props.onRangeEndTabPress(...arguments);
|
|
118
|
-
}
|
|
90
|
+
notifyClick: (...args) => this.props.onClick(...args),
|
|
91
|
+
notifyChange: (...args) => this.props.onChange(...args),
|
|
92
|
+
notifyEnter: (...args) => this.props.onEnterPress(...args),
|
|
93
|
+
notifyBlur: (...args) => this.props.onBlur(...args),
|
|
94
|
+
notifyClear: (...args) => this.props.onClear(...args),
|
|
95
|
+
notifyFocus: (...args) => this.props.onFocus(...args),
|
|
96
|
+
notifyRangeInputClear: (...args) => this.props.onRangeClear(...args),
|
|
97
|
+
notifyRangeInputFocus: (...args) => this.props.onFocus(...args),
|
|
98
|
+
notifyTabPress: (...args) => this.props.onRangeEndTabPress(...args)
|
|
119
99
|
});
|
|
120
100
|
}
|
|
121
101
|
|
|
@@ -29,7 +29,7 @@ export declare type DatePickerState = DatePickerFoundationState;
|
|
|
29
29
|
export default class DatePicker extends BaseComponent<DatePickerProps, DatePickerState> {
|
|
30
30
|
static contextType: React.Context<import("../configProvider/context").ContextValue>;
|
|
31
31
|
static propTypes: {
|
|
32
|
-
type: PropTypes.Requireable<"date" | "
|
|
32
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
33
33
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
34
34
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
35
35
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
@@ -24,10 +24,7 @@ import YearAndMonth from './yearAndMonth';
|
|
|
24
24
|
import '@douyinfe/semi-foundation/lib/es/datePicker/datePicker.css';
|
|
25
25
|
export default class DatePicker extends BaseComponent {
|
|
26
26
|
constructor(props) {
|
|
27
|
-
var _this;
|
|
28
|
-
|
|
29
27
|
super(props);
|
|
30
|
-
_this = this;
|
|
31
28
|
|
|
32
29
|
this.setTriggerRef = node => this.triggerElRef.current = node; // Called when changes are selected by clicking on the selected date
|
|
33
30
|
|
|
@@ -37,35 +34,19 @@ export default class DatePicker extends BaseComponent {
|
|
|
37
34
|
|
|
38
35
|
this.handleYMSelectedChange = item => this.foundation.handleYMSelectedChange(item);
|
|
39
36
|
|
|
40
|
-
this.disabledDisposeDate =
|
|
41
|
-
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
42
|
-
rest[_key - 1] = arguments[_key];
|
|
43
|
-
}
|
|
37
|
+
this.disabledDisposeDate = (date, ...rest) => this.foundation.disabledDisposeDate(date, ...rest);
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
this.disabledDisposeTime = function (date) {
|
|
49
|
-
for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
50
|
-
rest[_key2 - 1] = arguments[_key2];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return _this.foundation.disabledDisposeTime(date, ...rest);
|
|
54
|
-
};
|
|
39
|
+
this.disabledDisposeTime = (date, ...rest) => this.foundation.disabledDisposeTime(date, ...rest);
|
|
55
40
|
|
|
56
41
|
this.handleOpenPanel = () => this.foundation.openPanel();
|
|
57
42
|
|
|
58
|
-
this.handleInputChange =
|
|
59
|
-
return _this.foundation.handleInputChange(...arguments);
|
|
60
|
-
};
|
|
43
|
+
this.handleInputChange = (...args) => this.foundation.handleInputChange(...args);
|
|
61
44
|
|
|
62
45
|
this.handleInputComplete = v => this.foundation.handleInputComplete(v);
|
|
63
46
|
|
|
64
47
|
this.handleInputBlur = e => this.foundation.handleInputBlur(get(e, 'nativeEvent.target.value'), e);
|
|
65
48
|
|
|
66
|
-
this.handleInputFocus =
|
|
67
|
-
return _this.foundation.handleInputFocus(...arguments);
|
|
68
|
-
};
|
|
49
|
+
this.handleInputFocus = (...args) => this.foundation.handleInputFocus(...args);
|
|
69
50
|
|
|
70
51
|
this.handleInputClear = e => this.foundation.handleInputClear(e);
|
|
71
52
|
|
|
@@ -217,8 +198,6 @@ export default class DatePicker extends BaseComponent {
|
|
|
217
198
|
}
|
|
218
199
|
|
|
219
200
|
get adapter() {
|
|
220
|
-
var _this2 = this;
|
|
221
|
-
|
|
222
201
|
return _Object$assign(_Object$assign({}, super.adapter), {
|
|
223
202
|
togglePanel: panelShow => {
|
|
224
203
|
this.setState({
|
|
@@ -252,30 +231,14 @@ export default class DatePicker extends BaseComponent {
|
|
|
252
231
|
unregisterClickOutSide: () => {
|
|
253
232
|
document.removeEventListener('mousedown', this.clickOutSideHandler);
|
|
254
233
|
},
|
|
255
|
-
notifyBlur:
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
},
|
|
264
|
-
notifyChange: function () {
|
|
265
|
-
return _this2.props.onChange(...arguments);
|
|
266
|
-
},
|
|
267
|
-
notifyCancel: function () {
|
|
268
|
-
return _this2.props.onCancel(...arguments);
|
|
269
|
-
},
|
|
270
|
-
notifyConfirm: function () {
|
|
271
|
-
return _this2.props.onConfirm(...arguments);
|
|
272
|
-
},
|
|
273
|
-
notifyOpenChange: function () {
|
|
274
|
-
return _this2.props.onOpenChange(...arguments);
|
|
275
|
-
},
|
|
276
|
-
notifyPresetsClick: function () {
|
|
277
|
-
return _this2.props.onPresetClick(...arguments);
|
|
278
|
-
},
|
|
234
|
+
notifyBlur: (...args) => this.props.onBlur(...args),
|
|
235
|
+
notifyFocus: (...args) => this.props.onFocus(...args),
|
|
236
|
+
notifyClear: (...args) => this.props.onClear(...args),
|
|
237
|
+
notifyChange: (...args) => this.props.onChange(...args),
|
|
238
|
+
notifyCancel: (...args) => this.props.onCancel(...args),
|
|
239
|
+
notifyConfirm: (...args) => this.props.onConfirm(...args),
|
|
240
|
+
notifyOpenChange: (...args) => this.props.onOpenChange(...args),
|
|
241
|
+
notifyPresetsClick: (...args) => this.props.onPresetClick(...args),
|
|
279
242
|
updateValue: value => this.setState({
|
|
280
243
|
value
|
|
281
244
|
}),
|
|
@@ -2,8 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import Button from '../button';
|
|
4
4
|
import { get } from 'lodash-es';
|
|
5
|
-
export default function Footer() {
|
|
6
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5
|
+
export default function Footer(props = {}) {
|
|
7
6
|
const {
|
|
8
7
|
prefixCls,
|
|
9
8
|
locale,
|
|
@@ -29,19 +29,16 @@ export default forwardStatics( /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
29
29
|
propsObj.rangeSeparator = " ".concat(_trimInstanceProperty(rangeSeparator).call(rangeSeparator), " ");
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
return /*#__PURE__*/React.createElement(ConfigContext.Consumer, null,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
ref: ref
|
|
45
|
-
})));
|
|
46
|
-
});
|
|
32
|
+
return /*#__PURE__*/React.createElement(ConfigContext.Consumer, null, ({
|
|
33
|
+
timeZone
|
|
34
|
+
}) => /*#__PURE__*/React.createElement(LocaleConsumer, {
|
|
35
|
+
componentName: 'DatePicker'
|
|
36
|
+
}, (locale, localeCode, dateFnsLocale) => /*#__PURE__*/React.createElement(DatePicker, _Object$assign({
|
|
37
|
+
timeZone: timeZone,
|
|
38
|
+
localeCode: localeCode,
|
|
39
|
+
locale: locale,
|
|
40
|
+
dateFnsLocale: dateFnsLocale
|
|
41
|
+
}, propsObj, {
|
|
42
|
+
ref: ref
|
|
43
|
+
}))));
|
|
47
44
|
}), DatePicker);
|
|
@@ -17,7 +17,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
17
17
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
18
18
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
19
19
|
static propTypes: {
|
|
20
|
-
type: PropTypes.Requireable<"date" | "
|
|
20
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
|
|
21
21
|
defaultValue: PropTypes.Requireable<string | number | object>;
|
|
22
22
|
defaultPickerValue: PropTypes.Requireable<string | number | object>;
|
|
23
23
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -126,17 +126,14 @@ class YearAndMonth extends BaseComponent {
|
|
|
126
126
|
} = this.props;
|
|
127
127
|
const currentDate = setMonth(_Date$now(), currentMonth - 1);
|
|
128
128
|
|
|
129
|
-
const list = _mapInstanceProperty(years).call(years,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
disabled: disabledDate(setYear(currentDate, year))
|
|
138
|
-
};
|
|
139
|
-
});
|
|
129
|
+
const list = _mapInstanceProperty(years).call(years, ({
|
|
130
|
+
value,
|
|
131
|
+
year
|
|
132
|
+
}) => ({
|
|
133
|
+
year,
|
|
134
|
+
value,
|
|
135
|
+
disabled: disabledDate(setYear(currentDate, year))
|
|
136
|
+
}));
|
|
140
137
|
|
|
141
138
|
let transform = val => val;
|
|
142
139
|
|
|
@@ -179,18 +176,15 @@ class YearAndMonth extends BaseComponent {
|
|
|
179
176
|
} // i18n
|
|
180
177
|
|
|
181
178
|
|
|
182
|
-
const list = _mapInstanceProperty(months).call(months,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
disabled: disabledDate(setMonth(currentDate, month - 1)),
|
|
190
|
-
value: locale.fullMonths[value] // Actual rendered text
|
|
179
|
+
const list = _mapInstanceProperty(months).call(months, ({
|
|
180
|
+
value,
|
|
181
|
+
month
|
|
182
|
+
}) => ({
|
|
183
|
+
month,
|
|
184
|
+
disabled: disabledDate(setMonth(currentDate, month - 1)),
|
|
185
|
+
value: locale.fullMonths[value] // Actual rendered text
|
|
191
186
|
|
|
192
|
-
|
|
193
|
-
});
|
|
187
|
+
}));
|
|
194
188
|
|
|
195
189
|
const selectedIndex = _findIndexInstanceProperty(list).call(list, item => item.month === currentMonth);
|
|
196
190
|
|
|
@@ -220,7 +214,7 @@ class YearAndMonth extends BaseComponent {
|
|
|
220
214
|
className: prefix
|
|
221
215
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
222
216
|
noHorizontalPadding: false,
|
|
223
|
-
|
|
217
|
+
icon: /*#__PURE__*/React.createElement(IconChevronLeft, {
|
|
224
218
|
size: iconSize
|
|
225
219
|
}),
|
|
226
220
|
size: buttonSize,
|
|
@@ -4,8 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/dropdown/constants';
|
|
5
5
|
const prefixCls = cssClasses.PREFIX;
|
|
6
6
|
|
|
7
|
-
const DropdownDivider =
|
|
8
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const DropdownDivider = (props = {}) => {
|
|
9
8
|
const {
|
|
10
9
|
style,
|
|
11
10
|
className
|