@douyinfe/semi-ui 2.40.0-alpha.0 → 2.40.0-beta.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 +3 -36
- 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
|
@@ -156,6 +156,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
156
156
|
visible?: boolean;
|
|
157
157
|
content?: React.ReactNode;
|
|
158
158
|
icon: string | number | boolean | React.ReactFragment | JSX.Element;
|
|
159
|
+
onCancel?: (e: React.MouseEvent<Element, MouseEvent>) => void | Promise<any>;
|
|
159
160
|
zIndex?: number;
|
|
160
161
|
closeOnEsc?: boolean;
|
|
161
162
|
preventScroll?: boolean;
|
|
@@ -163,7 +164,6 @@ export declare function withError(props: ModalReactProps): {
|
|
|
163
164
|
keepDOM?: boolean;
|
|
164
165
|
cancelText?: string;
|
|
165
166
|
okText?: string;
|
|
166
|
-
onCancel?: (e: React.MouseEvent<Element, MouseEvent>) => void | Promise<any>;
|
|
167
167
|
closeIcon?: React.ReactNode;
|
|
168
168
|
bodyStyle?: React.CSSProperties;
|
|
169
169
|
closable?: boolean;
|
|
@@ -211,12 +211,22 @@ export declare function withError(props: ModalReactProps): {
|
|
|
211
211
|
hidden?: boolean;
|
|
212
212
|
color?: string;
|
|
213
213
|
content?: string;
|
|
214
|
+
onChange?: React.FormEventHandler<HTMLButtonElement>;
|
|
215
|
+
defaultChecked?: boolean;
|
|
214
216
|
defaultValue?: string | number | readonly string[];
|
|
217
|
+
suppressContentEditableWarning?: boolean;
|
|
218
|
+
suppressHydrationWarning?: boolean;
|
|
215
219
|
accessKey?: string;
|
|
220
|
+
autoFocus?: boolean;
|
|
221
|
+
formAction?: string;
|
|
222
|
+
formEncType?: string;
|
|
223
|
+
formMethod?: string;
|
|
224
|
+
formNoValidate?: boolean;
|
|
225
|
+
formTarget?: string;
|
|
216
226
|
dir?: string;
|
|
217
227
|
draggable?: boolean | "false" | "true";
|
|
218
228
|
lang?: string;
|
|
219
|
-
translate?: "
|
|
229
|
+
translate?: "no" | "yes";
|
|
220
230
|
prefix?: string;
|
|
221
231
|
role?: React.AriaRole;
|
|
222
232
|
contentEditable?: "inherit" | (boolean | "false" | "true");
|
|
@@ -232,10 +242,6 @@ export declare function withError(props: ModalReactProps): {
|
|
|
232
242
|
'aria-haspopup'?: boolean | "dialog" | "menu" | "listbox" | "grid" | "false" | "true" | "tree";
|
|
233
243
|
'aria-controls'?: string;
|
|
234
244
|
'aria-describedby'?: string;
|
|
235
|
-
defaultChecked?: boolean;
|
|
236
|
-
suppressContentEditableWarning?: boolean;
|
|
237
|
-
suppressHydrationWarning?: boolean;
|
|
238
|
-
autoFocus?: boolean;
|
|
239
245
|
contextMenu?: string;
|
|
240
246
|
placeholder?: string;
|
|
241
247
|
spellCheck?: boolean | "false" | "true";
|
|
@@ -321,7 +327,6 @@ export declare function withError(props: ModalReactProps): {
|
|
|
321
327
|
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLButtonElement>;
|
|
322
328
|
onFocusCapture?: React.FocusEventHandler<HTMLButtonElement>;
|
|
323
329
|
onBlurCapture?: React.FocusEventHandler<HTMLButtonElement>;
|
|
324
|
-
onChange?: React.FormEventHandler<HTMLButtonElement>;
|
|
325
330
|
onChangeCapture?: React.FormEventHandler<HTMLButtonElement>;
|
|
326
331
|
onBeforeInput?: React.FormEventHandler<HTMLButtonElement>;
|
|
327
332
|
onBeforeInputCapture?: React.FormEventHandler<HTMLButtonElement>;
|
|
@@ -458,11 +463,6 @@ export declare function withError(props: ModalReactProps): {
|
|
|
458
463
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
459
464
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement>;
|
|
460
465
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement>;
|
|
461
|
-
formAction?: string;
|
|
462
|
-
formEncType?: string;
|
|
463
|
-
formMethod?: string;
|
|
464
|
-
formNoValidate?: boolean;
|
|
465
|
-
formTarget?: string;
|
|
466
466
|
};
|
|
467
467
|
};
|
|
468
468
|
export declare function withConfirm(props: ModalReactProps): {
|
package/lib/cjs/modal/confirm.js
CHANGED
|
@@ -21,12 +21,10 @@ function usePatchElement() {
|
|
|
21
21
|
}
|
|
22
22
|
function useModal() {
|
|
23
23
|
const [elements, patchElement] = usePatchElement();
|
|
24
|
-
// eslint-disable-next-line max-len
|
|
25
24
|
function getConfirmFunc(withFunc) {
|
|
26
25
|
return function hookConfirm(config) {
|
|
27
26
|
uuid += 1;
|
|
28
27
|
const modalRef = /*#__PURE__*/_react.default.createRef();
|
|
29
|
-
// eslint-disable-next-line prefer-const
|
|
30
28
|
let closeFunc;
|
|
31
29
|
const modal = /*#__PURE__*/_react.default.createElement(_HookModal.default, {
|
|
32
30
|
key: `semi-modal-${uuid}`,
|
|
@@ -18,9 +18,6 @@ var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
|
18
18
|
var _navContext = _interopRequireDefault(require("./nav-context"));
|
|
19
19
|
var _dropdown = _interopRequireDefault(require("../dropdown"));
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
/* eslint-disable max-len */
|
|
22
|
-
/* eslint-disable no-nested-ternary */
|
|
23
|
-
|
|
24
21
|
const clsPrefix = `${_constants.cssClasses.PREFIX}-item`;
|
|
25
22
|
class NavItem extends _baseComponent.default {
|
|
26
23
|
constructor(props) {
|
|
@@ -21,9 +21,6 @@ var _navContext = _interopRequireDefault(require("./nav-context"));
|
|
|
21
21
|
var _collapsible = _interopRequireDefault(require("../collapsible"));
|
|
22
22
|
var _cssAnimation = _interopRequireDefault(require("../_cssAnimation"));
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
/* eslint-disable max-len */
|
|
25
|
-
/* eslint-disable no-nested-ternary */
|
|
26
|
-
|
|
27
24
|
class SubNav extends _baseComponent.default {
|
|
28
25
|
constructor(props) {
|
|
29
26
|
super(props);
|
|
@@ -31,8 +31,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
31
31
|
}
|
|
32
32
|
return t;
|
|
33
33
|
};
|
|
34
|
-
/* eslint-disable max-lines-per-function */
|
|
35
|
-
|
|
36
34
|
function createAddKeysFn(context, keyName) {
|
|
37
35
|
return function addKeys() {
|
|
38
36
|
const handleKeys = new Set(context.state[keyName]);
|
|
@@ -25,8 +25,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
25
25
|
}
|
|
26
26
|
return t;
|
|
27
27
|
};
|
|
28
|
-
/* eslint-disable no-unreachable */
|
|
29
|
-
|
|
30
28
|
const prefixCls = _constants.cssClasses.NOTICE;
|
|
31
29
|
const {
|
|
32
30
|
duration
|
|
@@ -136,39 +134,35 @@ class Notice extends _baseComponent.default {
|
|
|
136
134
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
137
135
|
});
|
|
138
136
|
const titleID = (0, _uuid.getUuidShort)({});
|
|
139
|
-
return (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
size: "small",
|
|
169
|
-
onClick: this.close
|
|
170
|
-
})))
|
|
171
|
-
);
|
|
137
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
138
|
+
className: wrapper,
|
|
139
|
+
style: style,
|
|
140
|
+
onMouseEnter: this.clearCloseTimer,
|
|
141
|
+
onMouseLeave: this.startCloseTimer,
|
|
142
|
+
onClick: this.notifyClick,
|
|
143
|
+
"aria-labelledby": titleID,
|
|
144
|
+
role: 'alert',
|
|
145
|
+
onAnimationEnd: this.props.onAnimationEnd,
|
|
146
|
+
onAnimationStart: this.props.onAnimationStart
|
|
147
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, this.renderTypeIcon()), /*#__PURE__*/_react.default.createElement("div", {
|
|
148
|
+
className: `${prefixCls}-inner`
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
+
className: `${prefixCls}-content-wrapper`
|
|
151
|
+
}, title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
152
|
+
id: titleID,
|
|
153
|
+
className: `${prefixCls}-title`,
|
|
154
|
+
"x-semi-prop": "title"
|
|
155
|
+
}, title) : '', content ? /*#__PURE__*/_react.default.createElement("div", {
|
|
156
|
+
className: `${prefixCls}-content`,
|
|
157
|
+
"x-semi-prop": "content"
|
|
158
|
+
}, content) : ''), showClose && /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
159
|
+
className: `${prefixCls}-icon-close`,
|
|
160
|
+
type: "tertiary",
|
|
161
|
+
icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, null),
|
|
162
|
+
theme: "borderless",
|
|
163
|
+
size: "small",
|
|
164
|
+
onClick: this.close
|
|
165
|
+
})));
|
|
172
166
|
}
|
|
173
167
|
}
|
|
174
168
|
Notice.contextType = _context.default;
|
|
@@ -61,6 +61,7 @@ function usePatchElement() {
|
|
|
61
61
|
const pos = obj[0];
|
|
62
62
|
const notices = obj[1];
|
|
63
63
|
// @ts-ignore
|
|
64
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
64
65
|
return Array.isArray(notices) && notices.length ? /*#__PURE__*/_react.default.createElement("div", {
|
|
65
66
|
key: pos,
|
|
66
67
|
className: (0, _classnames.default)(_constants.cssClasses.LIST),
|
|
@@ -78,7 +79,6 @@ function useNotification() {
|
|
|
78
79
|
const mergeConfig = Object.assign(Object.assign({}, config), {
|
|
79
80
|
id
|
|
80
81
|
});
|
|
81
|
-
// eslint-disable-next-line prefer-const
|
|
82
82
|
let closeFunc;
|
|
83
83
|
const ref = ele => {
|
|
84
84
|
noticeRef.set(id, ele);
|
|
@@ -18,8 +18,6 @@ var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/
|
|
|
18
18
|
require("@douyinfe/semi-foundation/lib/cjs/overflowList/overflowList.css");
|
|
19
19
|
var _utils = require("../_utils");
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
/* eslint-disable arrow-body-style */
|
|
22
|
-
|
|
23
21
|
const prefixCls = _constants.cssClasses.PREFIX;
|
|
24
22
|
const Boundary = _constants.strings.BOUNDARY_MAP;
|
|
25
23
|
const OverflowDirection = _constants.strings.OVERFLOW_DIR;
|
|
@@ -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;
|
|
@@ -30,8 +30,8 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
30
30
|
}
|
|
31
31
|
return t;
|
|
32
32
|
};
|
|
33
|
-
/* eslint-disable max-len */
|
|
34
33
|
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
|
|
34
|
+
|
|
35
35
|
const prefixCls = _constants.cssClasses.PREFIX;
|
|
36
36
|
const {
|
|
37
37
|
Option
|
|
@@ -39,18 +39,25 @@ const {
|
|
|
39
39
|
class Pagination extends _baseComponent.default {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|
|
42
|
+
const total = props.total;
|
|
43
|
+
const pageSize = props.pageSize || props.pageSizeOpts[0] || _constants.numbers.DEFAULT_PAGE_SIZE; // Use pageSize first, use the first of pageSizeOpts when not, use the default value when none
|
|
44
|
+
const shouldFillAllNumber = props.size === 'small' && props.hoverShowPageSelect && !props.disabled;
|
|
42
45
|
this.state = {
|
|
43
|
-
total
|
|
46
|
+
total,
|
|
44
47
|
showTotal: props.showTotal,
|
|
45
48
|
currentPage: props.currentPage || props.defaultCurrentPage,
|
|
46
|
-
pageSize
|
|
49
|
+
pageSize,
|
|
47
50
|
pageList: [],
|
|
48
51
|
prevDisabled: false,
|
|
49
52
|
nextDisabled: false,
|
|
50
53
|
restLeftPageList: [],
|
|
51
54
|
restRightPageList: [],
|
|
52
|
-
quickJumpPage: ''
|
|
55
|
+
quickJumpPage: '',
|
|
56
|
+
allPageNumbers: shouldFillAllNumber ? Array.from({
|
|
57
|
+
length: Math.ceil(total / pageSize)
|
|
58
|
+
}, (v, i) => i + 1) : [] // only need to count in smallPage mode, when props.size = small
|
|
53
59
|
};
|
|
60
|
+
|
|
54
61
|
this.foundation = new _foundation.default(this.adapter);
|
|
55
62
|
this.renderDefaultPage = this.renderDefaultPage.bind(this);
|
|
56
63
|
this.renderSmallPage = this.renderSmallPage.bind(this);
|
|
@@ -85,7 +92,9 @@ class Pagination extends _baseComponent.default {
|
|
|
85
92
|
updateQuickJumpPage: quickJumpPage => this.setState({
|
|
86
93
|
quickJumpPage
|
|
87
94
|
}),
|
|
88
|
-
|
|
95
|
+
updateAllPageNumbers: allPageNumbers => this.setState({
|
|
96
|
+
allPageNumbers
|
|
97
|
+
}),
|
|
89
98
|
setCurrentPage: pageIndex => {
|
|
90
99
|
this.setState({
|
|
91
100
|
currentPage: pageIndex
|
|
@@ -121,6 +130,7 @@ class Pagination extends _baseComponent.default {
|
|
|
121
130
|
pageSize: this.props.pageSize
|
|
122
131
|
};
|
|
123
132
|
let pagerHasChanged = false;
|
|
133
|
+
let allPageNumberNeedUpdate = false;
|
|
124
134
|
if (prevProps.currentPage !== this.props.currentPage) {
|
|
125
135
|
pagerHasChanged = true;
|
|
126
136
|
// this.foundation.updatePage(this.props.currentPage);
|
|
@@ -128,13 +138,18 @@ class Pagination extends _baseComponent.default {
|
|
|
128
138
|
|
|
129
139
|
if (prevProps.total !== this.props.total) {
|
|
130
140
|
pagerHasChanged = true;
|
|
141
|
+
allPageNumberNeedUpdate = true;
|
|
131
142
|
}
|
|
132
143
|
if (prevProps.pageSize !== this.props.pageSize) {
|
|
133
144
|
pagerHasChanged = true;
|
|
145
|
+
allPageNumberNeedUpdate = true;
|
|
134
146
|
}
|
|
135
147
|
if (pagerHasChanged) {
|
|
136
148
|
this.foundation.updatePage(pagerProps.currentPage, pagerProps.total, pagerProps.pageSize);
|
|
137
149
|
}
|
|
150
|
+
if (allPageNumberNeedUpdate) {
|
|
151
|
+
this.foundation.updateAllPageNumbers(pagerProps.total, pagerProps.pageSize);
|
|
152
|
+
}
|
|
138
153
|
}
|
|
139
154
|
renderPrevBtn() {
|
|
140
155
|
const {
|
|
@@ -337,6 +352,13 @@ class Pagination extends _baseComponent.default {
|
|
|
337
352
|
}, row)
|
|
338
353
|
);
|
|
339
354
|
}
|
|
355
|
+
renderSmallPageSelect(content) {
|
|
356
|
+
const allPageNumbers = this.state.allPageNumbers;
|
|
357
|
+
const pageList = this.renderRestPageList(allPageNumbers);
|
|
358
|
+
return /*#__PURE__*/_react.default.createElement(_index3.default, {
|
|
359
|
+
content: pageList
|
|
360
|
+
}, content);
|
|
361
|
+
}
|
|
340
362
|
renderSmallPage(locale) {
|
|
341
363
|
const _a = this.props,
|
|
342
364
|
{
|
|
@@ -360,24 +382,18 @@ class Pagination extends _baseComponent.default {
|
|
|
360
382
|
if (totalPageNum < 2 && hideOnSinglePage && !showSizeChanger) {
|
|
361
383
|
return null;
|
|
362
384
|
}
|
|
363
|
-
const pageNumbers = Array.from({
|
|
364
|
-
length: Math.ceil(total / pageSize)
|
|
365
|
-
}, (v, i) => i + 1);
|
|
366
|
-
const pageList = this.renderRestPageList(pageNumbers);
|
|
367
385
|
const pageCls = (0, _classnames.default)({
|
|
368
386
|
[`${prefixCls}-item`]: true,
|
|
369
387
|
[`${prefixCls}-item-small`]: true,
|
|
370
388
|
[`${prefixCls}-item-all-disabled`]: disabled
|
|
371
389
|
});
|
|
372
|
-
const
|
|
390
|
+
const content = /*#__PURE__*/_react.default.createElement("div", {
|
|
373
391
|
className: pageCls
|
|
374
392
|
}, currentPage, "/", totalPageNum, " ");
|
|
375
393
|
return /*#__PURE__*/_react.default.createElement("div", Object.assign({
|
|
376
394
|
className: paginationCls,
|
|
377
395
|
style: style
|
|
378
|
-
}, this.getDataAttr(rest)), this.renderPrevBtn(), hoverShowPageSelect && !disabled ?
|
|
379
|
-
content: pageList
|
|
380
|
-
}, page) : page, this.renderNextBtn(), this.renderQuickJump(locale));
|
|
396
|
+
}, this.getDataAttr(rest)), this.renderPrevBtn(), hoverShowPageSelect && !disabled ? this.renderSmallPageSelect(content) : content, this.renderNextBtn(), this.renderQuickJump(locale));
|
|
381
397
|
}
|
|
382
398
|
renderDefaultPage(locale) {
|
|
383
399
|
const {
|
package/lib/cjs/radio/radio.js
CHANGED
package/lib/cjs/rating/index.js
CHANGED
|
@@ -179,7 +179,6 @@ class Rating extends _baseComponent.default {
|
|
|
179
179
|
},
|
|
180
180
|
getStarDOM: index => {
|
|
181
181
|
const instance = this.stars && this.stars[index];
|
|
182
|
-
// eslint-disable-next-line react/no-find-dom-node
|
|
183
182
|
return _reactDom.default.findDOMNode(instance);
|
|
184
183
|
},
|
|
185
184
|
notifyHoverChange: (hoverValue, clearedValue) => {
|
|
@@ -18,7 +18,6 @@ class ReactResizeObserver extends _baseComponent.default {
|
|
|
18
18
|
// using findDOMNode for two reasons:
|
|
19
19
|
// 1. cloning to insert a ref is unwieldy and not performant.
|
|
20
20
|
// 2. ensure that we resolve to an actual DOM node (instead of any JSX ref instance).
|
|
21
|
-
// eslint-disable-next-line
|
|
22
21
|
return (0, _reactDom.findDOMNode)(this.childNode || this);
|
|
23
22
|
} catch (error) {
|
|
24
23
|
// swallow error if findDOMNode is run on unmounted component.
|
|
@@ -126,7 +126,6 @@ class ScrollItem extends _baseComponent.default {
|
|
|
126
126
|
this.scrollToIndex = (selectedIndex, duration) => {
|
|
127
127
|
// move to selected item
|
|
128
128
|
duration = typeof duration === 'number' ? duration : _constants.numbers.DEFAULT_SCROLL_DURATION;
|
|
129
|
-
// eslint-disable-next-line
|
|
130
129
|
selectedIndex = selectedIndex == null ? this.props.selectedIndex : selectedIndex;
|
|
131
130
|
// this.isWheelMode() && this.addClassToNode();
|
|
132
131
|
this.scrollToNode(this.selectedNode, duration);
|
|
@@ -232,11 +231,9 @@ class ScrollItem extends _baseComponent.default {
|
|
|
232
231
|
if (typeof transform === 'function') {
|
|
233
232
|
text = transform(item.value, item.text);
|
|
234
233
|
} else {
|
|
235
|
-
// eslint-disable-next-line
|
|
236
234
|
text = item.text == null ? item.value : item.text;
|
|
237
235
|
}
|
|
238
236
|
} else {
|
|
239
|
-
// eslint-disable-next-line
|
|
240
237
|
text = item.text == null ? item.value : item.text;
|
|
241
238
|
}
|
|
242
239
|
const events = {};
|
|
@@ -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/cjs/select/index.js
CHANGED
|
@@ -50,8 +50,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
50
50
|
}
|
|
51
51
|
return t;
|
|
52
52
|
};
|
|
53
|
-
/* eslint-disable max-len */
|
|
54
|
-
/* eslint-disable max-lines-per-function */
|
|
55
53
|
const prefixcls = _constants.cssClasses.PREFIX;
|
|
56
54
|
const key = 0;
|
|
57
55
|
// Notes: Use the label of the option as the identifier, that is, the option in Select, the value is allowed to be the same, but the label must be unique
|
|
@@ -164,7 +162,6 @@ class Select extends _baseComponent.default {
|
|
|
164
162
|
focusIndex
|
|
165
163
|
});
|
|
166
164
|
},
|
|
167
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
168
165
|
scrollToFocusOption: () => {}
|
|
169
166
|
};
|
|
170
167
|
const filterAdapter = {
|
|
@@ -198,7 +195,6 @@ class Select extends _baseComponent.default {
|
|
|
198
195
|
const clickOutsideHandler = e => {
|
|
199
196
|
const optionInstance = this.optionsRef && this.optionsRef.current;
|
|
200
197
|
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
201
|
-
// eslint-disable-next-line react/no-find-dom-node
|
|
202
198
|
const optionsDom = _reactDom.default.findDOMNode(optionInstance);
|
|
203
199
|
// let isInPanel = optionsDom && optionsDom.contains(e.target);
|
|
204
200
|
// let isInTrigger = triggerDom && triggerDom.contains(e.target);
|
|
@@ -371,14 +367,12 @@ class Select extends _baseComponent.default {
|
|
|
371
367
|
return this.state.isFocusInContainer;
|
|
372
368
|
},
|
|
373
369
|
updateScrollTop: index => {
|
|
374
|
-
// eslint-disable-next-line max-len
|
|
375
370
|
let optionClassName = `.${prefixcls}-option-selected`;
|
|
376
371
|
if (index !== undefined) {
|
|
377
372
|
optionClassName = `.${prefixcls}-option:nth-child(${index})`;
|
|
378
373
|
}
|
|
379
374
|
let destNode = document.querySelector(`#${prefixcls}-${this.selectOptionListID} ${optionClassName}`);
|
|
380
375
|
if (Array.isArray(destNode)) {
|
|
381
|
-
// eslint-disable-next-line prefer-destructuring
|
|
382
376
|
destNode = destNode[0];
|
|
383
377
|
}
|
|
384
378
|
if (destNode) {
|
|
@@ -1056,10 +1050,9 @@ class Select extends _baseComponent.default {
|
|
|
1056
1050
|
triggerRender,
|
|
1057
1051
|
arrowIcon,
|
|
1058
1052
|
clearIcon,
|
|
1059
|
-
borderless
|
|
1060
|
-
showArrowInBorderless
|
|
1053
|
+
borderless
|
|
1061
1054
|
} = _a,
|
|
1062
|
-
rest = __rest(_a, ["disabled", "multiple", "filter", "style", "id", "size", "className", "validateStatus", "showArrow", "suffix", "prefix", "insetLabel", "placeholder", "triggerRender", "arrowIcon", "clearIcon", "borderless"
|
|
1055
|
+
rest = __rest(_a, ["disabled", "multiple", "filter", "style", "id", "size", "className", "validateStatus", "showArrow", "suffix", "prefix", "insetLabel", "placeholder", "triggerRender", "arrowIcon", "clearIcon", "borderless"]);
|
|
1063
1056
|
const {
|
|
1064
1057
|
selections,
|
|
1065
1058
|
isOpen,
|
|
@@ -1074,7 +1067,6 @@ class Select extends _baseComponent.default {
|
|
|
1074
1067
|
const filterable = Boolean(filter); // filter(boolean || function)
|
|
1075
1068
|
const selectionCls = useCustomTrigger ? (0, _classnames.default)(className) : (0, _classnames.default)(prefixcls, className, {
|
|
1076
1069
|
[`${prefixcls}-borderless`]: borderless,
|
|
1077
|
-
[`${prefixcls}-borderless-arrow`]: showArrowInBorderless,
|
|
1078
1070
|
[`${prefixcls}-open`]: isOpen,
|
|
1079
1071
|
[`${prefixcls}-focus`]: isFocus,
|
|
1080
1072
|
[`${prefixcls}-disabled`]: disabled,
|
|
@@ -1341,8 +1333,7 @@ Select.defaultProps = {
|
|
|
1341
1333
|
showRestTagsPopover: false,
|
|
1342
1334
|
restTagsPopoverProps: {},
|
|
1343
1335
|
expandRestTagsOnClick: false,
|
|
1344
|
-
ellipsisTrigger: false
|
|
1345
|
-
showArrowInBorderless: false
|
|
1336
|
+
ellipsisTrigger: false
|
|
1346
1337
|
// Radio selection is different from the default renderSelectedItem for multiple selection, so it is not declared here
|
|
1347
1338
|
// renderSelectedItem: (optionNode) => optionNode.label,
|
|
1348
1339
|
// The default creator rendering is related to i18, so it is not declared here
|
package/lib/cjs/select/option.js
CHANGED
package/lib/cjs/select/utils.js
CHANGED
|
@@ -42,7 +42,6 @@ const getOptionsFromGroup = selectChildren => {
|
|
|
42
42
|
_show: false
|
|
43
43
|
};
|
|
44
44
|
// avoid null
|
|
45
|
-
// eslint-disable-next-line max-len
|
|
46
45
|
let childNodes = _react.default.Children.toArray(selectChildren);
|
|
47
46
|
childNodes = childNodes.filter(childNode => childNode && childNode.props);
|
|
48
47
|
let type = '';
|
|
@@ -57,7 +56,6 @@ const getOptionsFromGroup = selectChildren => {
|
|
|
57
56
|
} else if (child.type.isSelectOptionGroup) {
|
|
58
57
|
type = 'group';
|
|
59
58
|
// Avoid saving children (reactNode) by... removing other props from the group except children, causing performance problems
|
|
60
|
-
// eslint-disable-next-line prefer-const
|
|
61
59
|
let _a = child.props,
|
|
62
60
|
{
|
|
63
61
|
children
|
|
@@ -25,8 +25,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
25
25
|
}
|
|
26
26
|
return t;
|
|
27
27
|
};
|
|
28
|
-
/* eslint-disable no-nested-ternary */
|
|
29
|
-
|
|
30
28
|
const prefixCls = _constants.cssClasses.PREFIX;
|
|
31
29
|
const defaultWidthList = _constants.strings.WIDTH;
|
|
32
30
|
const defaultHeight = _constants.strings.HEIGHT;
|
package/lib/cjs/slider/index.js
CHANGED
|
@@ -24,8 +24,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
|
-
/* eslint-disable max-lines-per-function */
|
|
28
|
-
/* eslint-disable react/no-find-dom-node */
|
|
29
27
|
const prefixCls = _constants.cssClasses.PREFIX;
|
|
30
28
|
function domIsInRenderTree(e) {
|
|
31
29
|
if (!e) {
|
|
@@ -337,7 +335,6 @@ class Slider extends _baseComponent.default {
|
|
|
337
335
|
value = this.props.defaultValue;
|
|
338
336
|
}
|
|
339
337
|
this.state = {
|
|
340
|
-
// eslint-disable-next-line no-nested-ternary
|
|
341
338
|
currentValue: value ? value : this.props.range ? [0, 0] : 0,
|
|
342
339
|
min: this.props.min || 0,
|
|
343
340
|
max: this.props.max || 0,
|
package/lib/cjs/spin/icon.js
CHANGED
package/lib/cjs/switch/index.js
CHANGED
|
@@ -26,8 +26,6 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
26
26
|
}
|
|
27
27
|
return t;
|
|
28
28
|
};
|
|
29
|
-
/* eslint-disable max-len */
|
|
30
|
-
|
|
31
29
|
/**
|
|
32
30
|
* Render expanded row
|
|
33
31
|
*/
|
|
@@ -63,7 +61,6 @@ class TableExpandedRow extends _react.PureComponent {
|
|
|
63
61
|
} else if ( /*#__PURE__*/(0, _react.isValidElement)(cell)) {
|
|
64
62
|
children = cell;
|
|
65
63
|
} else if (cell && Object.prototype.toString.call(cell) === '[object Object]') {
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
67
64
|
const _a = cell,
|
|
68
65
|
{
|
|
69
66
|
children: cellChildren,
|