@douyinfe/semi-ui 2.40.0-alpha.0 → 2.40.0
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 +6 -40
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +280 -537
- 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/_portal/index.d.ts +3 -2
- package/lib/cjs/_portal/index.js +33 -26
- package/lib/cjs/_utils/index.js +0 -3
- package/lib/cjs/autoComplete/index.js +0 -2
- package/lib/cjs/autoComplete/option.js +0 -2
- package/lib/cjs/avatar/avatarGroup.js +0 -1
- package/lib/cjs/avatar/index.js +0 -1
- package/lib/cjs/backtop/index.js +0 -1
- package/lib/cjs/badge/index.js +0 -1
- package/lib/cjs/banner/index.js +0 -3
- package/lib/cjs/breadcrumb/index.js +0 -3
- package/lib/cjs/button/Button.js +8 -14
- package/lib/cjs/calendar/dayCalendar.js +4 -9
- package/lib/cjs/calendar/dayCol.js +1 -1
- package/lib/cjs/calendar/monthCalendar.js +5 -12
- package/lib/cjs/calendar/rangeCalendar.js +0 -2
- package/lib/cjs/carousel/index.js +0 -2
- package/lib/cjs/checkbox/checkbox.js +0 -2
- package/lib/cjs/checkbox/checkboxGroup.js +0 -3
- package/lib/cjs/checkbox/checkboxInner.js +0 -2
- package/lib/cjs/collapse/index.js +0 -1
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.js +0 -3
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.js +1 -3
- package/lib/cjs/datePicker/month.js +0 -4
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.js +1 -5
- package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.js +0 -2
- package/lib/cjs/form/arrayField.js +0 -2
- package/lib/cjs/form/baseForm.d.ts +0 -1
- package/lib/cjs/form/baseForm.js +5 -7
- package/lib/cjs/form/context.js +0 -2
- package/lib/cjs/form/errorMessage.js +0 -2
- package/lib/cjs/form/field.d.ts +0 -1
- package/lib/cjs/form/field.js +0 -2
- package/lib/cjs/form/group.js +0 -2
- package/lib/cjs/form/hoc/withField.js +2 -6
- package/lib/cjs/form/interface.d.ts +4 -4
- package/lib/cjs/form/interface.js +0 -3
- package/lib/cjs/form/section.js +0 -2
- package/lib/cjs/form/slot.js +0 -3
- package/lib/cjs/iconButton/index.js +0 -2
- package/lib/cjs/image/image.js +29 -34
- package/lib/cjs/image/interface.d.ts +4 -1
- package/lib/cjs/image/preview.js +5 -3
- package/lib/cjs/image/previewContext.d.ts +1 -0
- package/lib/cjs/image/previewFooter.d.ts +5 -1
- package/lib/cjs/image/previewFooter.js +66 -38
- package/lib/cjs/image/previewInner.d.ts +2 -2
- package/lib/cjs/image/previewInner.js +4 -2
- package/lib/cjs/input/index.js +0 -2
- package/lib/cjs/input/inputGroup.js +0 -3
- package/lib/cjs/input/textarea.js +0 -2
- package/lib/cjs/inputNumber/index.js +1 -5
- package/lib/cjs/modal/ConfirmModal.js +0 -2
- package/lib/cjs/modal/Modal.js +0 -2
- package/lib/cjs/modal/ModalContent.js +0 -5
- package/lib/cjs/modal/confirm.d.ts +12 -12
- package/lib/cjs/modal/confirm.js +0 -1
- package/lib/cjs/modal/useModal/HookModal.js +0 -1
- package/lib/cjs/modal/useModal/index.js +0 -2
- package/lib/cjs/navigation/Item.js +0 -3
- package/lib/cjs/navigation/SubNav.js +0 -3
- package/lib/cjs/navigation/index.js +0 -2
- package/lib/cjs/notification/notice.js +29 -35
- package/lib/cjs/notification/useNotification/index.js +1 -1
- package/lib/cjs/overflowList/index.js +0 -2
- package/lib/cjs/pagination/index.d.ts +2 -0
- package/lib/cjs/pagination/index.js +29 -13
- package/lib/cjs/popconfirm/index.js +0 -2
- package/lib/cjs/progress/index.js +0 -1
- package/lib/cjs/radio/radio.js +0 -2
- package/lib/cjs/rating/index.js +0 -1
- package/lib/cjs/resizeObserver/index.js +0 -1
- package/lib/cjs/scrollList/scrollItem.js +0 -3
- package/lib/cjs/select/index.d.ts +0 -1
- package/lib/cjs/select/index.js +3 -12
- package/lib/cjs/select/option.js +0 -2
- package/lib/cjs/select/utils.js +0 -2
- package/lib/cjs/sideSheet/index.js +0 -2
- package/lib/cjs/slider/index.js +0 -3
- package/lib/cjs/spin/icon.js +0 -2
- package/lib/cjs/switch/index.js +0 -2
- package/lib/cjs/table/Body/BaseRow.js +0 -2
- package/lib/cjs/table/Body/ExpandedRow.js +0 -3
- package/lib/cjs/table/Body/SectionRow.js +0 -3
- package/lib/cjs/table/Body/index.js +0 -8
- package/lib/cjs/table/ColGroup.js +0 -1
- package/lib/cjs/table/ColumnFilter.js +0 -3
- package/lib/cjs/table/ColumnSelection.js +0 -2
- package/lib/cjs/table/HeadTable.js +0 -2
- package/lib/cjs/table/ResizableTable.js +1 -4
- package/lib/cjs/table/Table.js +1 -10
- package/lib/cjs/table/TableCell.js +0 -4
- package/lib/cjs/table/TableHeader.js +0 -4
- package/lib/cjs/table/TableHeaderRow.js +0 -2
- package/lib/cjs/table/TablePagination.js +0 -2
- package/lib/cjs/table/table-context.js +0 -2
- package/lib/cjs/tabs/TabBar.js +0 -2
- package/lib/cjs/tag/index.js +1 -3
- package/lib/cjs/tagInput/index.js +0 -2
- package/lib/cjs/timePicker/Combobox.js +0 -4
- package/lib/cjs/timePicker/TimeInput.js +0 -2
- package/lib/cjs/timePicker/TimePicker.js +0 -2
- package/lib/cjs/toast/index.js +0 -2
- package/lib/cjs/toast/toast.js +0 -2
- package/lib/cjs/toast/useToast/index.js +0 -1
- package/lib/cjs/tooltip/index.js +0 -6
- package/lib/cjs/transfer/index.js +0 -3
- package/lib/cjs/tree/index.d.ts +2 -1
- package/lib/cjs/tree/index.js +11 -14
- package/lib/cjs/tree/treeNode.js +0 -3
- package/lib/cjs/treeSelect/index.js +0 -7
- package/lib/cjs/trigger/index.js +0 -2
- package/lib/cjs/typography/util.js +1 -3
- package/lib/cjs/upload/index.js +1 -6
- package/lib/es/_portal/index.d.ts +3 -2
- package/lib/es/_portal/index.js +33 -26
- package/lib/es/_utils/index.js +0 -2
- package/lib/es/autoComplete/index.js +0 -1
- package/lib/es/autoComplete/option.js +0 -1
- package/lib/es/avatar/avatarGroup.js +0 -1
- package/lib/es/avatar/index.js +0 -1
- package/lib/es/backtop/index.js +0 -1
- package/lib/es/badge/index.js +0 -1
- package/lib/es/banner/index.js +0 -2
- package/lib/es/breadcrumb/index.js +0 -2
- package/lib/es/button/Button.js +8 -13
- package/lib/es/calendar/dayCalendar.js +4 -9
- package/lib/es/calendar/dayCol.js +1 -1
- package/lib/es/calendar/monthCalendar.js +5 -11
- package/lib/es/calendar/rangeCalendar.js +0 -1
- package/lib/es/carousel/index.js +0 -1
- package/lib/es/checkbox/checkbox.js +0 -1
- package/lib/es/checkbox/checkboxGroup.js +0 -2
- package/lib/es/checkbox/checkboxInner.js +0 -1
- package/lib/es/collapse/index.js +0 -1
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/dateInput.js +0 -3
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/datePicker.js +0 -3
- package/lib/es/datePicker/month.js +0 -4
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.js +1 -5
- package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.js +0 -1
- package/lib/es/form/arrayField.js +0 -1
- package/lib/es/form/baseForm.d.ts +0 -1
- package/lib/es/form/baseForm.js +5 -6
- package/lib/es/form/context.js +0 -1
- package/lib/es/form/errorMessage.js +0 -1
- package/lib/es/form/field.d.ts +0 -1
- package/lib/es/form/field.js +0 -1
- package/lib/es/form/group.js +0 -1
- package/lib/es/form/hoc/withField.js +2 -6
- package/lib/es/form/interface.d.ts +4 -4
- package/lib/es/form/interface.js +0 -2
- package/lib/es/form/section.js +0 -1
- package/lib/es/form/slot.js +0 -2
- package/lib/es/iconButton/index.js +0 -1
- package/lib/es/image/image.js +29 -34
- package/lib/es/image/interface.d.ts +4 -1
- package/lib/es/image/preview.js +5 -3
- package/lib/es/image/previewContext.d.ts +1 -0
- package/lib/es/image/previewFooter.d.ts +5 -1
- package/lib/es/image/previewFooter.js +66 -38
- package/lib/es/image/previewInner.d.ts +2 -2
- package/lib/es/image/previewInner.js +4 -1
- package/lib/es/input/index.js +0 -1
- package/lib/es/input/inputGroup.js +0 -2
- package/lib/es/input/textarea.js +0 -1
- package/lib/es/inputNumber/index.js +0 -5
- package/lib/es/modal/ConfirmModal.js +0 -2
- package/lib/es/modal/Modal.js +0 -1
- package/lib/es/modal/ModalContent.js +0 -3
- package/lib/es/modal/confirm.d.ts +12 -12
- package/lib/es/modal/confirm.js +0 -1
- package/lib/es/modal/useModal/HookModal.js +0 -1
- package/lib/es/modal/useModal/index.js +0 -2
- package/lib/es/navigation/Item.js +0 -2
- package/lib/es/navigation/SubNav.js +0 -2
- package/lib/es/navigation/index.js +0 -1
- package/lib/es/notification/notice.js +29 -34
- package/lib/es/notification/useNotification/index.js +1 -1
- package/lib/es/overflowList/index.js +0 -1
- package/lib/es/pagination/index.d.ts +2 -0
- package/lib/es/pagination/index.js +28 -13
- package/lib/es/popconfirm/index.js +0 -1
- package/lib/es/progress/index.js +0 -1
- package/lib/es/radio/radio.js +0 -1
- package/lib/es/rating/index.js +0 -1
- package/lib/es/resizeObserver/index.js +0 -1
- package/lib/es/scrollList/scrollItem.js +0 -3
- package/lib/es/select/index.d.ts +0 -1
- package/lib/es/select/index.js +3 -12
- package/lib/es/select/option.js +0 -1
- package/lib/es/select/utils.js +0 -2
- package/lib/es/sideSheet/index.js +0 -1
- package/lib/es/slider/index.js +0 -3
- package/lib/es/spin/icon.js +0 -1
- package/lib/es/switch/index.js +0 -1
- package/lib/es/table/Body/BaseRow.js +0 -2
- package/lib/es/table/Body/ExpandedRow.js +0 -2
- package/lib/es/table/Body/SectionRow.js +0 -3
- package/lib/es/table/Body/index.js +0 -8
- package/lib/es/table/ColGroup.js +0 -1
- package/lib/es/table/ColumnFilter.js +0 -2
- package/lib/es/table/ColumnSelection.js +0 -1
- package/lib/es/table/HeadTable.js +0 -1
- package/lib/es/table/ResizableTable.js +0 -4
- package/lib/es/table/Table.js +0 -10
- package/lib/es/table/TableCell.js +0 -3
- package/lib/es/table/TableHeader.js +0 -3
- package/lib/es/table/TableHeaderRow.js +0 -1
- package/lib/es/table/TablePagination.js +0 -1
- package/lib/es/table/table-context.js +0 -1
- package/lib/es/tabs/TabBar.js +0 -2
- package/lib/es/tag/index.js +1 -2
- package/lib/es/tagInput/index.js +0 -2
- package/lib/es/timePicker/Combobox.js +0 -3
- package/lib/es/timePicker/TimeInput.js +0 -1
- package/lib/es/timePicker/TimePicker.js +0 -1
- package/lib/es/toast/index.js +0 -1
- package/lib/es/toast/toast.js +0 -1
- package/lib/es/toast/useToast/index.js +0 -1
- package/lib/es/tooltip/index.js +0 -5
- package/lib/es/transfer/index.js +0 -3
- package/lib/es/tree/index.d.ts +2 -1
- package/lib/es/tree/index.js +11 -13
- package/lib/es/tree/treeNode.js +0 -3
- package/lib/es/treeSelect/index.js +0 -7
- package/lib/es/trigger/index.js +0 -2
- package/lib/es/typography/util.js +1 -3
- package/lib/es/upload/index.js +1 -5
- package/package.json +8 -8
|
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
7
7
|
}
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
|
-
/* eslint-disable no-unreachable */
|
|
11
10
|
import React from 'react';
|
|
12
11
|
import cls from 'classnames';
|
|
13
12
|
import PropTypes from 'prop-types';
|
|
@@ -128,39 +127,35 @@ class Notice extends BaseComponent {
|
|
|
128
127
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
129
128
|
});
|
|
130
129
|
const titleID = getUuidShort({});
|
|
131
|
-
return (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
size: "small",
|
|
161
|
-
onClick: this.close
|
|
162
|
-
})))
|
|
163
|
-
);
|
|
130
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: wrapper,
|
|
132
|
+
style: style,
|
|
133
|
+
onMouseEnter: this.clearCloseTimer,
|
|
134
|
+
onMouseLeave: this.startCloseTimer,
|
|
135
|
+
onClick: this.notifyClick,
|
|
136
|
+
"aria-labelledby": titleID,
|
|
137
|
+
role: 'alert',
|
|
138
|
+
onAnimationEnd: this.props.onAnimationEnd,
|
|
139
|
+
onAnimationStart: this.props.onAnimationStart
|
|
140
|
+
}, /*#__PURE__*/React.createElement("div", null, this.renderTypeIcon()), /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: `${prefixCls}-inner`
|
|
142
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
className: `${prefixCls}-content-wrapper`
|
|
144
|
+
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
id: titleID,
|
|
146
|
+
className: `${prefixCls}-title`,
|
|
147
|
+
"x-semi-prop": "title"
|
|
148
|
+
}, title) : '', content ? /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
className: `${prefixCls}-content`,
|
|
150
|
+
"x-semi-prop": "content"
|
|
151
|
+
}, content) : ''), showClose && /*#__PURE__*/React.createElement(Button, {
|
|
152
|
+
className: `${prefixCls}-icon-close`,
|
|
153
|
+
type: "tertiary",
|
|
154
|
+
icon: /*#__PURE__*/React.createElement(IconClose, null),
|
|
155
|
+
theme: "borderless",
|
|
156
|
+
size: "small",
|
|
157
|
+
onClick: this.close
|
|
158
|
+
})));
|
|
164
159
|
}
|
|
165
160
|
}
|
|
166
161
|
Notice.contextType = ConfigContext;
|
|
@@ -52,6 +52,7 @@ function usePatchElement() {
|
|
|
52
52
|
const pos = obj[0];
|
|
53
53
|
const notices = obj[1];
|
|
54
54
|
// @ts-ignore
|
|
55
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
55
56
|
return Array.isArray(notices) && notices.length ? /*#__PURE__*/React.createElement("div", {
|
|
56
57
|
key: pos,
|
|
57
58
|
className: cls(cssClasses.LIST),
|
|
@@ -69,7 +70,6 @@ export default function useNotification() {
|
|
|
69
70
|
const mergeConfig = Object.assign(Object.assign({}, config), {
|
|
70
71
|
id
|
|
71
72
|
});
|
|
72
|
-
// eslint-disable-next-line prefer-const
|
|
73
73
|
let closeFunc;
|
|
74
74
|
const ref = ele => {
|
|
75
75
|
noticeRef.set(id, ele);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
2
|
import _isFunction from "lodash/isFunction";
|
|
3
3
|
import _isEqual from "lodash/isEqual";
|
|
4
|
-
/* eslint-disable arrow-body-style */
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import cls from 'classnames';
|
|
7
6
|
import BaseComponent from '../_base/baseComponent';
|
|
@@ -40,6 +40,7 @@ export interface PaginationState {
|
|
|
40
40
|
nextDisabled: boolean;
|
|
41
41
|
restLeftPageList: number[];
|
|
42
42
|
restRightPageList: number[];
|
|
43
|
+
allPageNumbers: number[];
|
|
43
44
|
}
|
|
44
45
|
export type PaginationLocale = Locale['Pagination'];
|
|
45
46
|
export type PopoverPosition = Position;
|
|
@@ -98,6 +99,7 @@ export default class Pagination extends BaseComponent<PaginationProps, Paginatio
|
|
|
98
99
|
renderQuickJump(locale: PaginationLocale): JSX.Element;
|
|
99
100
|
renderPageList(): JSX.Element[];
|
|
100
101
|
renderRestPageList(restList: ('...' | number)[]): JSX.Element;
|
|
102
|
+
renderSmallPageSelect(content: React.ReactNode): JSX.Element;
|
|
101
103
|
renderSmallPage(locale: PaginationLocale): JSX.Element;
|
|
102
104
|
renderDefaultPage(locale: PaginationLocale): JSX.Element;
|
|
103
105
|
render(): JSX.Element;
|
|
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
7
7
|
}
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
|
-
/* eslint-disable max-len */
|
|
11
10
|
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
|
|
12
11
|
import React from 'react';
|
|
13
12
|
import classNames from 'classnames';
|
|
@@ -32,18 +31,25 @@ const {
|
|
|
32
31
|
export default class Pagination extends BaseComponent {
|
|
33
32
|
constructor(props) {
|
|
34
33
|
super(props);
|
|
34
|
+
const total = props.total;
|
|
35
|
+
const pageSize = props.pageSize || props.pageSizeOpts[0] || numbers.DEFAULT_PAGE_SIZE; // Use pageSize first, use the first of pageSizeOpts when not, use the default value when none
|
|
36
|
+
const shouldFillAllNumber = props.size === 'small' && props.hoverShowPageSelect && !props.disabled;
|
|
35
37
|
this.state = {
|
|
36
|
-
total
|
|
38
|
+
total,
|
|
37
39
|
showTotal: props.showTotal,
|
|
38
40
|
currentPage: props.currentPage || props.defaultCurrentPage,
|
|
39
|
-
pageSize
|
|
41
|
+
pageSize,
|
|
40
42
|
pageList: [],
|
|
41
43
|
prevDisabled: false,
|
|
42
44
|
nextDisabled: false,
|
|
43
45
|
restLeftPageList: [],
|
|
44
46
|
restRightPageList: [],
|
|
45
|
-
quickJumpPage: ''
|
|
47
|
+
quickJumpPage: '',
|
|
48
|
+
allPageNumbers: shouldFillAllNumber ? Array.from({
|
|
49
|
+
length: Math.ceil(total / pageSize)
|
|
50
|
+
}, (v, i) => i + 1) : [] // only need to count in smallPage mode, when props.size = small
|
|
46
51
|
};
|
|
52
|
+
|
|
47
53
|
this.foundation = new PaginationFoundation(this.adapter);
|
|
48
54
|
this.renderDefaultPage = this.renderDefaultPage.bind(this);
|
|
49
55
|
this.renderSmallPage = this.renderSmallPage.bind(this);
|
|
@@ -78,7 +84,9 @@ export default class Pagination extends BaseComponent {
|
|
|
78
84
|
updateQuickJumpPage: quickJumpPage => this.setState({
|
|
79
85
|
quickJumpPage
|
|
80
86
|
}),
|
|
81
|
-
|
|
87
|
+
updateAllPageNumbers: allPageNumbers => this.setState({
|
|
88
|
+
allPageNumbers
|
|
89
|
+
}),
|
|
82
90
|
setCurrentPage: pageIndex => {
|
|
83
91
|
this.setState({
|
|
84
92
|
currentPage: pageIndex
|
|
@@ -114,6 +122,7 @@ export default class Pagination extends BaseComponent {
|
|
|
114
122
|
pageSize: this.props.pageSize
|
|
115
123
|
};
|
|
116
124
|
let pagerHasChanged = false;
|
|
125
|
+
let allPageNumberNeedUpdate = false;
|
|
117
126
|
if (prevProps.currentPage !== this.props.currentPage) {
|
|
118
127
|
pagerHasChanged = true;
|
|
119
128
|
// this.foundation.updatePage(this.props.currentPage);
|
|
@@ -121,13 +130,18 @@ export default class Pagination extends BaseComponent {
|
|
|
121
130
|
|
|
122
131
|
if (prevProps.total !== this.props.total) {
|
|
123
132
|
pagerHasChanged = true;
|
|
133
|
+
allPageNumberNeedUpdate = true;
|
|
124
134
|
}
|
|
125
135
|
if (prevProps.pageSize !== this.props.pageSize) {
|
|
126
136
|
pagerHasChanged = true;
|
|
137
|
+
allPageNumberNeedUpdate = true;
|
|
127
138
|
}
|
|
128
139
|
if (pagerHasChanged) {
|
|
129
140
|
this.foundation.updatePage(pagerProps.currentPage, pagerProps.total, pagerProps.pageSize);
|
|
130
141
|
}
|
|
142
|
+
if (allPageNumberNeedUpdate) {
|
|
143
|
+
this.foundation.updateAllPageNumbers(pagerProps.total, pagerProps.pageSize);
|
|
144
|
+
}
|
|
131
145
|
}
|
|
132
146
|
renderPrevBtn() {
|
|
133
147
|
const {
|
|
@@ -330,6 +344,13 @@ export default class Pagination extends BaseComponent {
|
|
|
330
344
|
}, row)
|
|
331
345
|
);
|
|
332
346
|
}
|
|
347
|
+
renderSmallPageSelect(content) {
|
|
348
|
+
const allPageNumbers = this.state.allPageNumbers;
|
|
349
|
+
const pageList = this.renderRestPageList(allPageNumbers);
|
|
350
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
351
|
+
content: pageList
|
|
352
|
+
}, content);
|
|
353
|
+
}
|
|
333
354
|
renderSmallPage(locale) {
|
|
334
355
|
const _a = this.props,
|
|
335
356
|
{
|
|
@@ -353,24 +374,18 @@ export default class Pagination extends BaseComponent {
|
|
|
353
374
|
if (totalPageNum < 2 && hideOnSinglePage && !showSizeChanger) {
|
|
354
375
|
return null;
|
|
355
376
|
}
|
|
356
|
-
const pageNumbers = Array.from({
|
|
357
|
-
length: Math.ceil(total / pageSize)
|
|
358
|
-
}, (v, i) => i + 1);
|
|
359
|
-
const pageList = this.renderRestPageList(pageNumbers);
|
|
360
377
|
const pageCls = classNames({
|
|
361
378
|
[`${prefixCls}-item`]: true,
|
|
362
379
|
[`${prefixCls}-item-small`]: true,
|
|
363
380
|
[`${prefixCls}-item-all-disabled`]: disabled
|
|
364
381
|
});
|
|
365
|
-
const
|
|
382
|
+
const content = /*#__PURE__*/React.createElement("div", {
|
|
366
383
|
className: pageCls
|
|
367
384
|
}, currentPage, "/", totalPageNum, " ");
|
|
368
385
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
369
386
|
className: paginationCls,
|
|
370
387
|
style: style
|
|
371
|
-
}, this.getDataAttr(rest)), this.renderPrevBtn(), hoverShowPageSelect && !disabled ?
|
|
372
|
-
content: pageList
|
|
373
|
-
}, page) : page, this.renderNextBtn(), this.renderQuickJump(locale));
|
|
388
|
+
}, this.getDataAttr(rest)), this.renderPrevBtn(), hoverShowPageSelect && !disabled ? this.renderSmallPageSelect(content) : content, this.renderNextBtn(), this.renderQuickJump(locale));
|
|
374
389
|
}
|
|
375
390
|
renderDefaultPage(locale) {
|
|
376
391
|
const {
|
package/lib/es/progress/index.js
CHANGED
package/lib/es/radio/radio.js
CHANGED
package/lib/es/rating/index.js
CHANGED
|
@@ -172,7 +172,6 @@ export default class Rating extends BaseComponent {
|
|
|
172
172
|
},
|
|
173
173
|
getStarDOM: index => {
|
|
174
174
|
const instance = this.stars && this.stars[index];
|
|
175
|
-
// eslint-disable-next-line react/no-find-dom-node
|
|
176
175
|
return ReactDOM.findDOMNode(instance);
|
|
177
176
|
},
|
|
178
177
|
notifyHoverChange: (hoverValue, clearedValue) => {
|
|
@@ -11,7 +11,6 @@ export default class ReactResizeObserver extends BaseComponent {
|
|
|
11
11
|
// using findDOMNode for two reasons:
|
|
12
12
|
// 1. cloning to insert a ref is unwieldy and not performant.
|
|
13
13
|
// 2. ensure that we resolve to an actual DOM node (instead of any JSX ref instance).
|
|
14
|
-
// eslint-disable-next-line
|
|
15
14
|
return findDOMNode(this.childNode || this);
|
|
16
15
|
} catch (error) {
|
|
17
16
|
// swallow error if findDOMNode is run on unmounted component.
|
|
@@ -119,7 +119,6 @@ export default class ScrollItem extends BaseComponent {
|
|
|
119
119
|
this.scrollToIndex = (selectedIndex, duration) => {
|
|
120
120
|
// move to selected item
|
|
121
121
|
duration = typeof duration === 'number' ? duration : numbers.DEFAULT_SCROLL_DURATION;
|
|
122
|
-
// eslint-disable-next-line
|
|
123
122
|
selectedIndex = selectedIndex == null ? this.props.selectedIndex : selectedIndex;
|
|
124
123
|
// this.isWheelMode() && this.addClassToNode();
|
|
125
124
|
this.scrollToNode(this.selectedNode, duration);
|
|
@@ -225,11 +224,9 @@ export default class ScrollItem extends BaseComponent {
|
|
|
225
224
|
if (typeof transform === 'function') {
|
|
226
225
|
text = transform(item.value, item.text);
|
|
227
226
|
} else {
|
|
228
|
-
// eslint-disable-next-line
|
|
229
227
|
text = item.text == null ? item.value : item.text;
|
|
230
228
|
}
|
|
231
229
|
} else {
|
|
232
|
-
// eslint-disable-next-line
|
|
233
230
|
text = item.text == null ? item.value : item.text;
|
|
234
231
|
}
|
|
235
232
|
const events = {};
|
package/lib/es/select/index.d.ts
CHANGED
|
@@ -85,7 +85,6 @@ export type SelectProps = {
|
|
|
85
85
|
autoClearSearchValue?: boolean;
|
|
86
86
|
arrowIcon?: React.ReactNode;
|
|
87
87
|
borderless?: boolean;
|
|
88
|
-
showArrowInBorderless?: boolean;
|
|
89
88
|
clearIcon?: React.ReactNode;
|
|
90
89
|
defaultValue?: string | number | any[] | Record<string, any>;
|
|
91
90
|
value?: string | number | any[] | Record<string, any>;
|
package/lib/es/select/index.js
CHANGED
|
@@ -12,8 +12,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
12
12
|
}
|
|
13
13
|
return t;
|
|
14
14
|
};
|
|
15
|
-
/* eslint-disable max-len */
|
|
16
|
-
/* eslint-disable max-lines-per-function */
|
|
17
15
|
import React, { Fragment } from 'react';
|
|
18
16
|
import ReactDOM from 'react-dom';
|
|
19
17
|
import cls from 'classnames';
|
|
@@ -155,7 +153,6 @@ class Select extends BaseComponent {
|
|
|
155
153
|
focusIndex
|
|
156
154
|
});
|
|
157
155
|
},
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
159
156
|
scrollToFocusOption: () => {}
|
|
160
157
|
};
|
|
161
158
|
const filterAdapter = {
|
|
@@ -189,7 +186,6 @@ class Select extends BaseComponent {
|
|
|
189
186
|
const clickOutsideHandler = e => {
|
|
190
187
|
const optionInstance = this.optionsRef && this.optionsRef.current;
|
|
191
188
|
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
192
|
-
// eslint-disable-next-line react/no-find-dom-node
|
|
193
189
|
const optionsDom = ReactDOM.findDOMNode(optionInstance);
|
|
194
190
|
// let isInPanel = optionsDom && optionsDom.contains(e.target);
|
|
195
191
|
// let isInTrigger = triggerDom && triggerDom.contains(e.target);
|
|
@@ -362,14 +358,12 @@ class Select extends BaseComponent {
|
|
|
362
358
|
return this.state.isFocusInContainer;
|
|
363
359
|
},
|
|
364
360
|
updateScrollTop: index => {
|
|
365
|
-
// eslint-disable-next-line max-len
|
|
366
361
|
let optionClassName = `.${prefixcls}-option-selected`;
|
|
367
362
|
if (index !== undefined) {
|
|
368
363
|
optionClassName = `.${prefixcls}-option:nth-child(${index})`;
|
|
369
364
|
}
|
|
370
365
|
let destNode = document.querySelector(`#${prefixcls}-${this.selectOptionListID} ${optionClassName}`);
|
|
371
366
|
if (Array.isArray(destNode)) {
|
|
372
|
-
// eslint-disable-next-line prefer-destructuring
|
|
373
367
|
destNode = destNode[0];
|
|
374
368
|
}
|
|
375
369
|
if (destNode) {
|
|
@@ -1047,10 +1041,9 @@ class Select extends BaseComponent {
|
|
|
1047
1041
|
triggerRender,
|
|
1048
1042
|
arrowIcon,
|
|
1049
1043
|
clearIcon,
|
|
1050
|
-
borderless
|
|
1051
|
-
showArrowInBorderless
|
|
1044
|
+
borderless
|
|
1052
1045
|
} = _a,
|
|
1053
|
-
rest = __rest(_a, ["disabled", "multiple", "filter", "style", "id", "size", "className", "validateStatus", "showArrow", "suffix", "prefix", "insetLabel", "placeholder", "triggerRender", "arrowIcon", "clearIcon", "borderless"
|
|
1046
|
+
rest = __rest(_a, ["disabled", "multiple", "filter", "style", "id", "size", "className", "validateStatus", "showArrow", "suffix", "prefix", "insetLabel", "placeholder", "triggerRender", "arrowIcon", "clearIcon", "borderless"]);
|
|
1054
1047
|
const {
|
|
1055
1048
|
selections,
|
|
1056
1049
|
isOpen,
|
|
@@ -1065,7 +1058,6 @@ class Select extends BaseComponent {
|
|
|
1065
1058
|
const filterable = Boolean(filter); // filter(boolean || function)
|
|
1066
1059
|
const selectionCls = useCustomTrigger ? cls(className) : cls(prefixcls, className, {
|
|
1067
1060
|
[`${prefixcls}-borderless`]: borderless,
|
|
1068
|
-
[`${prefixcls}-borderless-arrow`]: showArrowInBorderless,
|
|
1069
1061
|
[`${prefixcls}-open`]: isOpen,
|
|
1070
1062
|
[`${prefixcls}-focus`]: isFocus,
|
|
1071
1063
|
[`${prefixcls}-disabled`]: disabled,
|
|
@@ -1332,8 +1324,7 @@ Select.defaultProps = {
|
|
|
1332
1324
|
showRestTagsPopover: false,
|
|
1333
1325
|
restTagsPopoverProps: {},
|
|
1334
1326
|
expandRestTagsOnClick: false,
|
|
1335
|
-
ellipsisTrigger: false
|
|
1336
|
-
showArrowInBorderless: false
|
|
1327
|
+
ellipsisTrigger: false
|
|
1337
1328
|
// Radio selection is different from the default renderSelectedItem for multiple selection, so it is not declared here
|
|
1338
1329
|
// renderSelectedItem: (optionNode) => optionNode.label,
|
|
1339
1330
|
// The default creator rendering is related to i18, so it is not declared here
|
package/lib/es/select/option.js
CHANGED
package/lib/es/select/utils.js
CHANGED
|
@@ -34,7 +34,6 @@ const getOptionsFromGroup = selectChildren => {
|
|
|
34
34
|
_show: false
|
|
35
35
|
};
|
|
36
36
|
// avoid null
|
|
37
|
-
// eslint-disable-next-line max-len
|
|
38
37
|
let childNodes = React.Children.toArray(selectChildren);
|
|
39
38
|
childNodes = childNodes.filter(childNode => childNode && childNode.props);
|
|
40
39
|
let type = '';
|
|
@@ -49,7 +48,6 @@ const getOptionsFromGroup = selectChildren => {
|
|
|
49
48
|
} else if (child.type.isSelectOptionGroup) {
|
|
50
49
|
type = 'group';
|
|
51
50
|
// Avoid saving children (reactNode) by... removing other props from the group except children, causing performance problems
|
|
52
|
-
// eslint-disable-next-line prefer-const
|
|
53
51
|
let _a = child.props,
|
|
54
52
|
{
|
|
55
53
|
children
|
package/lib/es/slider/index.js
CHANGED
|
@@ -8,8 +8,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
8
8
|
}
|
|
9
9
|
return t;
|
|
10
10
|
};
|
|
11
|
-
/* eslint-disable max-lines-per-function */
|
|
12
|
-
/* eslint-disable react/no-find-dom-node */
|
|
13
11
|
import React from 'react';
|
|
14
12
|
import ReactDOM from 'react-dom';
|
|
15
13
|
import PropTypes from 'prop-types';
|
|
@@ -330,7 +328,6 @@ export default class Slider extends BaseComponent {
|
|
|
330
328
|
value = this.props.defaultValue;
|
|
331
329
|
}
|
|
332
330
|
this.state = {
|
|
333
|
-
// eslint-disable-next-line no-nested-ternary
|
|
334
331
|
currentValue: value ? value : this.props.range ? [0, 0] : 0,
|
|
335
332
|
min: this.props.min || 0,
|
|
336
333
|
max: this.props.max || 0,
|
package/lib/es/spin/icon.js
CHANGED
package/lib/es/switch/index.js
CHANGED
|
@@ -13,8 +13,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
};
|
|
16
|
-
/* eslint-disable max-len */
|
|
17
|
-
/* eslint-disable eqeqeq */
|
|
18
16
|
import React, { createRef } from 'react';
|
|
19
17
|
import classnames from 'classnames';
|
|
20
18
|
import PropTypes from 'prop-types';
|
|
@@ -9,7 +9,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
/* eslint-disable max-len */
|
|
13
12
|
import React, { PureComponent, isValidElement } from 'react';
|
|
14
13
|
import PropTypes from 'prop-types';
|
|
15
14
|
import classnames from 'classnames';
|
|
@@ -53,7 +52,6 @@ export default class TableExpandedRow extends PureComponent {
|
|
|
53
52
|
} else if ( /*#__PURE__*/isValidElement(cell)) {
|
|
54
53
|
children = cell;
|
|
55
54
|
} else if (cell && Object.prototype.toString.call(cell) === '[object Object]') {
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
57
55
|
const _a = cell,
|
|
58
56
|
{
|
|
59
57
|
children: cellChildren,
|
|
@@ -8,9 +8,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
8
8
|
}
|
|
9
9
|
return t;
|
|
10
10
|
};
|
|
11
|
-
/* eslint-disable max-len */
|
|
12
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
13
|
-
/* eslint-disable eqeqeq */
|
|
14
11
|
import React, { PureComponent, isValidElement } from 'react';
|
|
15
12
|
import PropTypes from 'prop-types';
|
|
16
13
|
import classnames from 'classnames';
|
|
@@ -14,9 +14,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
14
14
|
}
|
|
15
15
|
return t;
|
|
16
16
|
};
|
|
17
|
-
/* eslint-disable eqeqeq */
|
|
18
|
-
/* eslint-disable @typescript-eslint/member-ordering */
|
|
19
|
-
/* eslint-disable max-len */
|
|
20
17
|
import React from 'react';
|
|
21
18
|
import PropTypes from 'prop-types';
|
|
22
19
|
import classnames from 'classnames';
|
|
@@ -130,7 +127,6 @@ class Body extends BaseComponent {
|
|
|
130
127
|
flattenedColumns
|
|
131
128
|
} = this.context;
|
|
132
129
|
const virtualizedItem = _get(virtualizedData, [index], {});
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
134
130
|
const {
|
|
135
131
|
key,
|
|
136
132
|
parentKeys,
|
|
@@ -149,7 +145,6 @@ class Body extends BaseComponent {
|
|
|
149
145
|
index,
|
|
150
146
|
expandBtnShouldInRow
|
|
151
147
|
});
|
|
152
|
-
// eslint-disable-next-line no-nested-ternary
|
|
153
148
|
return sectionRow ? this.renderSectionRow(props) : expandedRow ? this.renderExpandedRow(props) : this.renderBaseRow(props);
|
|
154
149
|
};
|
|
155
150
|
// virtualized List innerElementType
|
|
@@ -174,14 +169,12 @@ class Body extends BaseComponent {
|
|
|
174
169
|
children
|
|
175
170
|
} = props,
|
|
176
171
|
rest = __rest(props, ["children"]);
|
|
177
|
-
// eslint-disable-next-line react/no-this-in-sfc
|
|
178
172
|
const {
|
|
179
173
|
handleWheel,
|
|
180
174
|
prefixCls,
|
|
181
175
|
emptySlot,
|
|
182
176
|
dataSource
|
|
183
177
|
} = this.props;
|
|
184
|
-
// eslint-disable-next-line react/no-this-in-sfc
|
|
185
178
|
const tableWidth = this.getVirtualizedRowWidth();
|
|
186
179
|
const tableCls = classnames(`${prefixCls}`, `${prefixCls}-fixed`);
|
|
187
180
|
return /*#__PURE__*/React.createElement("div", Object.assign({}, rest, {
|
|
@@ -195,7 +188,6 @@ class Body extends BaseComponent {
|
|
|
195
188
|
}
|
|
196
189
|
},
|
|
197
190
|
onScroll: function () {
|
|
198
|
-
// eslint-disable-next-line react/no-this-in-sfc
|
|
199
191
|
_this.handleVirtualizedBodyScroll(...arguments);
|
|
200
192
|
if (rest.onScroll) {
|
|
201
193
|
rest.onScroll(...arguments);
|
package/lib/es/table/ColGroup.js
CHANGED
|
@@ -13,7 +13,6 @@ export default class ColGroup extends React.PureComponent {
|
|
|
13
13
|
prefixCls,
|
|
14
14
|
components
|
|
15
15
|
} = this.props;
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
17
16
|
const ColGroup = _get(components, 'colgroup.wrapper', 'colgroup');
|
|
18
17
|
const Col = _get(components, 'colgroup.col', 'col');
|
|
19
18
|
const cols = flattenColumns(columns).map((column, idx) => {
|
|
@@ -10,11 +10,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
/* eslint-disable max-len */
|
|
14
|
-
/* eslint-disable @typescript-eslint/no-shadow */
|
|
15
13
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
16
|
-
/* eslint-disable react/destructuring-assignment */
|
|
17
|
-
/* eslint-disable max-lines-per-function */
|
|
18
14
|
import React, { useState, useEffect, useMemo } from 'react';
|
|
19
15
|
import { addClass, removeClass } from '@douyinfe/semi-foundation/lib/es/utils/classnames';
|
|
20
16
|
import { strings, numbers } from '@douyinfe/semi-foundation/lib/es/table/constants';
|
package/lib/es/table/Table.js
CHANGED
|
@@ -20,15 +20,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
/* eslint-disable no-nested-ternary */
|
|
24
|
-
/* eslint-disable prefer-const */
|
|
25
|
-
/* eslint-disable prefer-destructuring */
|
|
26
|
-
/* eslint-disable no-shadow */
|
|
27
|
-
/* eslint-disable no-param-reassign */
|
|
28
|
-
/* eslint-disable max-len */
|
|
29
23
|
/* eslint-disable react/no-did-update-set-state */
|
|
30
|
-
/* eslint-disable eqeqeq */
|
|
31
|
-
/* eslint-disable max-lines-per-function */
|
|
32
24
|
import React, { createRef, isValidElement } from 'react';
|
|
33
25
|
import PropTypes from 'prop-types';
|
|
34
26
|
import classnames from 'classnames';
|
|
@@ -861,7 +853,6 @@ class Table extends BaseComponent {
|
|
|
861
853
|
} = this.props;
|
|
862
854
|
const childrenColumnName = 'children';
|
|
863
855
|
let columns = cloneDeep(cachedColumns);
|
|
864
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
865
856
|
const addFns = function () {
|
|
866
857
|
let columns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
867
858
|
if (Array.isArray(columns) && columns.length) {
|
|
@@ -1138,7 +1129,6 @@ class Table extends BaseComponent {
|
|
|
1138
1129
|
}
|
|
1139
1130
|
if (Object.keys(states).length) {
|
|
1140
1131
|
const {
|
|
1141
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
1142
1132
|
pagination: mergedStatePagination = null,
|
|
1143
1133
|
queries: stateQueries = null,
|
|
1144
1134
|
dataSource: stateDataSource = null
|
|
@@ -4,8 +4,6 @@ import _omit from "lodash/omit";
|
|
|
4
4
|
import _set from "lodash/set";
|
|
5
5
|
import _noop from "lodash/noop";
|
|
6
6
|
import _get from "lodash/get";
|
|
7
|
-
/* eslint-disable prefer-destructuring */
|
|
8
|
-
/* eslint-disable eqeqeq */
|
|
9
7
|
import React, { createRef, Fragment } from 'react';
|
|
10
8
|
import classnames from 'classnames';
|
|
11
9
|
import PropTypes from 'prop-types';
|
|
@@ -189,7 +187,6 @@ export default class TableCell extends BaseComponent {
|
|
|
189
187
|
}
|
|
190
188
|
text = render(text, record, index, renderOptions);
|
|
191
189
|
if (isInvalidRenderCellText(text)) {
|
|
192
|
-
// eslint-disable-next-line no-param-reassign
|
|
193
190
|
tdProps = text.props ? _merge(tdProps, text.props) : tdProps;
|
|
194
191
|
colSpan = tdProps.colSpan;
|
|
195
192
|
rowSpan = tdProps.rowSpan;
|