@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
package/lib/es/form/slot.js
CHANGED
|
@@ -9,7 +9,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
/* eslint-disable max-lines-per-function, prefer-destructuring, prefer-const, @typescript-eslint/no-unused-vars */
|
|
13
12
|
import React, { useContext } from 'react';
|
|
14
13
|
import classNames from 'classnames';
|
|
15
14
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/form/constants';
|
|
@@ -30,7 +29,6 @@ const FormSlot = props => {
|
|
|
30
29
|
labelAlign = formProps.labelAlign;
|
|
31
30
|
labelPosition = formProps.labelPosition ? formProps.labelPosition : labelPosition;
|
|
32
31
|
} catch (error) {}
|
|
33
|
-
// eslint-disable-next-line react/destructuring-assignment
|
|
34
32
|
props.labelPosition ? labelPosition = props.labelPosition : null;
|
|
35
33
|
let {
|
|
36
34
|
children,
|
package/lib/es/image/image.js
CHANGED
|
@@ -9,8 +9,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
13
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
14
12
|
import React from "react";
|
|
15
13
|
import BaseComponent from "../_base/baseComponent";
|
|
16
14
|
import PropTypes from "prop-types";
|
|
@@ -162,9 +160,10 @@ export default class Image extends BaseComponent {
|
|
|
162
160
|
preview,
|
|
163
161
|
fallback,
|
|
164
162
|
placeholder,
|
|
165
|
-
imageID
|
|
163
|
+
imageID,
|
|
164
|
+
setDownloadName
|
|
166
165
|
} = _b,
|
|
167
|
-
restProps = __rest(_b, ["src", "width", "height", "alt", "style", "className", "crossOrigin", "preview", "fallback", "placeholder", "imageID"]);
|
|
166
|
+
restProps = __rest(_b, ["src", "width", "height", "alt", "style", "className", "crossOrigin", "preview", "fallback", "placeholder", "imageID", "setDownloadName"]);
|
|
168
167
|
const outerStyle = Object.assign({
|
|
169
168
|
width,
|
|
170
169
|
height
|
|
@@ -174,36 +173,32 @@ export default class Image extends BaseComponent {
|
|
|
174
173
|
const showPreviewCursor = preview && loadStatus === "success";
|
|
175
174
|
const previewSrc = _isObject(preview) ? (_a = preview.src) !== null && _a !== void 0 ? _a : src : src;
|
|
176
175
|
const previewProps = _isObject(preview) ? preview : {};
|
|
177
|
-
return (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
onVisibleChange: this.handlePreviewVisibleChange,
|
|
204
|
-
crossOrigin: !_isUndefined(crossOrigin) ? crossOrigin : previewProps === null || previewProps === void 0 ? void 0 : previewProps.crossOrigin
|
|
205
|
-
})))
|
|
206
|
-
);
|
|
176
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
style: outerStyle,
|
|
178
|
+
className: outerCls,
|
|
179
|
+
onClick: this.handleClick
|
|
180
|
+
}, /*#__PURE__*/React.createElement("img", Object.assign({
|
|
181
|
+
ref: this.imgRef
|
|
182
|
+
}, restProps, {
|
|
183
|
+
src: this.isInGroup() && this.isLazyLoad() ? undefined : src,
|
|
184
|
+
"data-src": src,
|
|
185
|
+
alt: alt,
|
|
186
|
+
className: cls(`${prefixCls}-img`, {
|
|
187
|
+
[`${prefixCls}-img-preview`]: showPreviewCursor,
|
|
188
|
+
[`${prefixCls}-img-error`]: loadStatus === "error"
|
|
189
|
+
}),
|
|
190
|
+
width: width,
|
|
191
|
+
height: height,
|
|
192
|
+
crossOrigin: crossOrigin,
|
|
193
|
+
onError: this.handleError,
|
|
194
|
+
onLoad: this.handleLoaded
|
|
195
|
+
})), loadStatus !== "success" && this.renderExtra(), canPreview && /*#__PURE__*/React.createElement(PreviewInner, Object.assign({}, previewProps, {
|
|
196
|
+
src: previewSrc,
|
|
197
|
+
visible: previewVisible,
|
|
198
|
+
onVisibleChange: this.handlePreviewVisibleChange,
|
|
199
|
+
crossOrigin: !_isUndefined(crossOrigin) ? crossOrigin : previewProps === null || previewProps === void 0 ? void 0 : previewProps.crossOrigin,
|
|
200
|
+
setDownloadName: setDownloadName
|
|
201
|
+
})));
|
|
207
202
|
}
|
|
208
203
|
}
|
|
209
204
|
Image.isSemiImage = true;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { BaseProps } from "_base/baseComponent";
|
|
3
|
+
import { RatioType } from '@douyinfe/semi-foundation/lib/es/image/previewInnerFoundation';
|
|
3
4
|
import React from "react";
|
|
5
|
+
export type { RatioType };
|
|
4
6
|
export interface ImageStates {
|
|
5
7
|
src: string;
|
|
6
8
|
loadStatus: "loading" | "success" | "error";
|
|
@@ -19,6 +21,7 @@ export interface ImageProps extends BaseProps {
|
|
|
19
21
|
crossOrigin?: "anonymous" | "use-credentials";
|
|
20
22
|
children?: ReactNode;
|
|
21
23
|
imageID?: number;
|
|
24
|
+
setDownloadName?: (src: string) => string;
|
|
22
25
|
}
|
|
23
26
|
export interface PreviewProps extends BaseProps {
|
|
24
27
|
visible?: boolean;
|
|
@@ -63,6 +66,7 @@ export interface PreviewProps extends BaseProps {
|
|
|
63
66
|
onRatioChange?: (type: RatioType) => void;
|
|
64
67
|
onRotateLeft?: (angle: number) => void;
|
|
65
68
|
onDownload?: (src: string, index: number) => void;
|
|
69
|
+
setDownloadName?: (src: string) => string;
|
|
66
70
|
}
|
|
67
71
|
export interface MenuProps {
|
|
68
72
|
min?: number;
|
|
@@ -84,7 +88,6 @@ export interface MenuProps {
|
|
|
84
88
|
onRotateLeft?: () => void;
|
|
85
89
|
onRotateRight?: () => void;
|
|
86
90
|
}
|
|
87
|
-
export type RatioType = "adaptation" | "realSize";
|
|
88
91
|
export interface PreviewInnerStates {
|
|
89
92
|
imgSrc?: string[];
|
|
90
93
|
imgLoadStatus?: Map<string, boolean>;
|
package/lib/es/image/preview.js
CHANGED
|
@@ -141,9 +141,10 @@ export default class Preview extends BaseComponent {
|
|
|
141
141
|
src,
|
|
142
142
|
className,
|
|
143
143
|
style,
|
|
144
|
-
lazyLoad
|
|
144
|
+
lazyLoad,
|
|
145
|
+
setDownloadName
|
|
145
146
|
} = _a,
|
|
146
|
-
restProps = __rest(_a, ["src", "className", "style", "lazyLoad"]);
|
|
147
|
+
restProps = __rest(_a, ["src", "className", "style", "lazyLoad", "setDownloadName"]);
|
|
147
148
|
const {
|
|
148
149
|
currentIndex,
|
|
149
150
|
visible
|
|
@@ -165,7 +166,8 @@ export default class Preview extends BaseComponent {
|
|
|
165
166
|
lazyLoad,
|
|
166
167
|
previewObserver: this.previewObserver,
|
|
167
168
|
setCurrentIndex: this.handleCurrentIndexChange,
|
|
168
|
-
handleVisibleChange: this.handleVisibleChange
|
|
169
|
+
handleVisibleChange: this.handleVisibleChange,
|
|
170
|
+
setDownloadName: setDownloadName
|
|
169
171
|
}
|
|
170
172
|
}, /*#__PURE__*/React.createElement("div", {
|
|
171
173
|
id: this.previewGroupId,
|
|
@@ -9,5 +9,6 @@ export interface PreviewContextProps {
|
|
|
9
9
|
previewObserver: IntersectionObserver;
|
|
10
10
|
setCurrentIndex: (current: number) => void;
|
|
11
11
|
handleVisibleChange: (visible: boolean, preVisible?: boolean) => void;
|
|
12
|
+
setDownloadName: (src: string) => string;
|
|
12
13
|
}
|
|
13
14
|
export declare const PreviewContext: import("react").Context<PreviewContextProps>;
|
|
@@ -49,7 +49,7 @@ export default class Footer extends BaseComponent<FooterProps> {
|
|
|
49
49
|
handleSlideChange: import("lodash").DebouncedFunc<(value: any) => void>;
|
|
50
50
|
handleRatioClick: () => void;
|
|
51
51
|
customRenderViewMenu: () => ReactNode;
|
|
52
|
-
getFinalIconElement: (element: ReactNode, content: ReactNode) => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
52
|
+
getFinalIconElement: (element: ReactNode, content: ReactNode, key: string) => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
53
53
|
getLocalTextByKey: (key: string) => JSX.Element;
|
|
54
54
|
getIconChevronLeft: () => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
55
55
|
getIconChevronRight: () => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
@@ -58,5 +58,9 @@ export default class Footer extends BaseComponent<FooterProps> {
|
|
|
58
58
|
getIconRatio: () => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
59
59
|
getIconRotate: () => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
60
60
|
getIconDownload: () => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
61
|
+
getNumberInfo: () => JSX.Element;
|
|
62
|
+
getSlider: () => JSX.Element;
|
|
63
|
+
getMenu: () => (string | number | boolean | React.ReactFragment | JSX.Element)[];
|
|
64
|
+
getFooterMenu: () => (string | number | boolean | React.ReactFragment | JSX.Element)[];
|
|
61
65
|
render(): JSX.Element;
|
|
62
66
|
}
|
|
@@ -81,18 +81,20 @@ export default class Footer extends BaseComponent {
|
|
|
81
81
|
disabledZoomOut: zoom === min,
|
|
82
82
|
onRatioClick: this.handleRatioClick,
|
|
83
83
|
onZoomIn: this.handlePlusClick,
|
|
84
|
-
onZoomOut: this.handleMinusClick
|
|
84
|
+
onZoomOut: this.handleMinusClick,
|
|
85
|
+
menuItems: this.getMenu()
|
|
85
86
|
};
|
|
86
87
|
return renderPreviewMenu(props);
|
|
87
88
|
};
|
|
88
89
|
// According to showTooltip in props, decide whether to use Tooltip to pack a layer
|
|
89
90
|
// 根据 props 中的 showTooltip 决定是否使用 Tooltip 包一层
|
|
90
|
-
this.getFinalIconElement = (element, content) => {
|
|
91
|
+
this.getFinalIconElement = (element, content, key) => {
|
|
91
92
|
const {
|
|
92
93
|
showTooltip
|
|
93
94
|
} = this.props;
|
|
94
95
|
return showTooltip ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
95
|
-
content: content
|
|
96
|
+
content: content,
|
|
97
|
+
key: `tooltip-${key}`
|
|
96
98
|
}, element) : element;
|
|
97
99
|
};
|
|
98
100
|
this.getLocalTextByKey = key => /*#__PURE__*/React.createElement(LocaleConsumer, {
|
|
@@ -105,12 +107,13 @@ export default class Footer extends BaseComponent {
|
|
|
105
107
|
prevTip
|
|
106
108
|
} = this.props;
|
|
107
109
|
const icon = /*#__PURE__*/React.createElement(IconChevronLeft, {
|
|
110
|
+
key: "chevron-left",
|
|
108
111
|
size: "large",
|
|
109
112
|
className: disabledPrev ? `${footerPrefixCls}-disabled` : "",
|
|
110
113
|
onClick: !disabledPrev ? onPrev : undefined
|
|
111
114
|
});
|
|
112
115
|
const content = prevTip !== null && prevTip !== void 0 ? prevTip : this.getLocalTextByKey("prevTip");
|
|
113
|
-
return this.getFinalIconElement(icon, content);
|
|
116
|
+
return this.getFinalIconElement(icon, content, 'chevron-left');
|
|
114
117
|
};
|
|
115
118
|
this.getIconChevronRight = () => {
|
|
116
119
|
const {
|
|
@@ -119,12 +122,13 @@ export default class Footer extends BaseComponent {
|
|
|
119
122
|
nextTip
|
|
120
123
|
} = this.props;
|
|
121
124
|
const icon = /*#__PURE__*/React.createElement(IconChevronRight, {
|
|
125
|
+
key: "chevron-right",
|
|
122
126
|
size: "large",
|
|
123
127
|
className: disabledNext ? `${footerPrefixCls}-disabled` : "",
|
|
124
128
|
onClick: !disabledNext ? onNext : undefined
|
|
125
129
|
});
|
|
126
130
|
const content = nextTip !== null && nextTip !== void 0 ? nextTip : this.getLocalTextByKey("nextTip");
|
|
127
|
-
return this.getFinalIconElement(icon, content);
|
|
131
|
+
return this.getFinalIconElement(icon, content, 'chevron-right');
|
|
128
132
|
};
|
|
129
133
|
this.getIconMinus = () => {
|
|
130
134
|
const {
|
|
@@ -134,12 +138,13 @@ export default class Footer extends BaseComponent {
|
|
|
134
138
|
} = this.props;
|
|
135
139
|
const disabledZoomOut = zoom === min;
|
|
136
140
|
const icon = /*#__PURE__*/React.createElement(IconMinus, {
|
|
141
|
+
key: "minus",
|
|
137
142
|
size: "large",
|
|
138
143
|
onClick: !disabledZoomOut ? this.handleMinusClick : undefined,
|
|
139
144
|
className: disabledZoomOut ? `${footerPrefixCls}-disabled` : ""
|
|
140
145
|
});
|
|
141
146
|
const content = zoomOutTip !== null && zoomOutTip !== void 0 ? zoomOutTip : this.getLocalTextByKey("zoomOutTip");
|
|
142
|
-
return this.getFinalIconElement(icon, content);
|
|
147
|
+
return this.getFinalIconElement(icon, content, 'minus');
|
|
143
148
|
};
|
|
144
149
|
this.getIconPlus = () => {
|
|
145
150
|
const {
|
|
@@ -149,12 +154,13 @@ export default class Footer extends BaseComponent {
|
|
|
149
154
|
} = this.props;
|
|
150
155
|
const disabledZoomIn = zoom === max;
|
|
151
156
|
const icon = /*#__PURE__*/React.createElement(IconPlus, {
|
|
157
|
+
key: "plus",
|
|
152
158
|
size: "large",
|
|
153
159
|
onClick: !disabledZoomIn ? this.handlePlusClick : undefined,
|
|
154
160
|
className: disabledZoomIn ? `${footerPrefixCls}-disabled` : ""
|
|
155
161
|
});
|
|
156
162
|
const content = zoomInTip !== null && zoomInTip !== void 0 ? zoomInTip : this.getLocalTextByKey("zoomInTip");
|
|
157
|
-
return this.getFinalIconElement(icon, content);
|
|
163
|
+
return this.getFinalIconElement(icon, content, 'plus');
|
|
158
164
|
};
|
|
159
165
|
this.getIconRatio = () => {
|
|
160
166
|
const {
|
|
@@ -163,6 +169,7 @@ export default class Footer extends BaseComponent {
|
|
|
163
169
|
adaptiveTip
|
|
164
170
|
} = this.props;
|
|
165
171
|
const props = {
|
|
172
|
+
key: "ratio",
|
|
166
173
|
size: "large",
|
|
167
174
|
className: cls(`${footerPrefixCls}-gap`),
|
|
168
175
|
onClick: this.handleRatioClick
|
|
@@ -174,18 +181,19 @@ export default class Footer extends BaseComponent {
|
|
|
174
181
|
} else {
|
|
175
182
|
content = adaptiveTip !== null && adaptiveTip !== void 0 ? adaptiveTip : this.getLocalTextByKey("adaptiveTip");
|
|
176
183
|
}
|
|
177
|
-
return this.getFinalIconElement(icon, content);
|
|
184
|
+
return this.getFinalIconElement(icon, content, 'ratio');
|
|
178
185
|
};
|
|
179
186
|
this.getIconRotate = () => {
|
|
180
187
|
const {
|
|
181
188
|
rotateTip
|
|
182
189
|
} = this.props;
|
|
183
190
|
const icon = /*#__PURE__*/React.createElement(IconRotate, {
|
|
191
|
+
key: "rotate",
|
|
184
192
|
size: "large",
|
|
185
193
|
onClick: this.handleRotateLeft
|
|
186
194
|
});
|
|
187
195
|
const content = rotateTip !== null && rotateTip !== void 0 ? rotateTip : this.getLocalTextByKey("rotateTip");
|
|
188
|
-
return this.getFinalIconElement(icon, content);
|
|
196
|
+
return this.getFinalIconElement(icon, content, 'rotate');
|
|
189
197
|
};
|
|
190
198
|
this.getIconDownload = () => {
|
|
191
199
|
const {
|
|
@@ -194,6 +202,7 @@ export default class Footer extends BaseComponent {
|
|
|
194
202
|
disableDownload
|
|
195
203
|
} = this.props;
|
|
196
204
|
const icon = /*#__PURE__*/React.createElement(IconDownload, {
|
|
205
|
+
key: 'download',
|
|
197
206
|
size: "large",
|
|
198
207
|
onClick: !disableDownload ? onDownload : undefined,
|
|
199
208
|
className: cls(`${footerPrefixCls}-gap`, {
|
|
@@ -201,44 +210,63 @@ export default class Footer extends BaseComponent {
|
|
|
201
210
|
})
|
|
202
211
|
});
|
|
203
212
|
const content = downloadTip !== null && downloadTip !== void 0 ? downloadTip : this.getLocalTextByKey("downloadTip");
|
|
204
|
-
return this.getFinalIconElement(icon, content);
|
|
213
|
+
return this.getFinalIconElement(icon, content, 'download');
|
|
214
|
+
};
|
|
215
|
+
this.getNumberInfo = () => {
|
|
216
|
+
const {
|
|
217
|
+
curPage,
|
|
218
|
+
totalNum
|
|
219
|
+
} = this.props;
|
|
220
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
221
|
+
className: `${footerPrefixCls}-page`,
|
|
222
|
+
key: 'info'
|
|
223
|
+
}, curPage, "/", totalNum);
|
|
224
|
+
};
|
|
225
|
+
this.getSlider = () => {
|
|
226
|
+
const {
|
|
227
|
+
zoom,
|
|
228
|
+
min,
|
|
229
|
+
max,
|
|
230
|
+
step,
|
|
231
|
+
showTooltip
|
|
232
|
+
} = this.props;
|
|
233
|
+
return /*#__PURE__*/React.createElement(Slider, {
|
|
234
|
+
key: 'slider',
|
|
235
|
+
value: zoom,
|
|
236
|
+
min: min,
|
|
237
|
+
max: max,
|
|
238
|
+
step: step,
|
|
239
|
+
tipFormatter: v => `${v}%`,
|
|
240
|
+
tooltipVisible: showTooltip ? undefined : false,
|
|
241
|
+
onChange: this.handleSlideChange
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
this.getMenu = () => [this.getIconChevronLeft(), this.getNumberInfo(), this.getIconChevronRight(), this.getIconMinus(), this.getSlider(), this.getIconPlus(), this.getIconRatio(), this.getIconRotate(), this.getIconDownload()];
|
|
245
|
+
this.getFooterMenu = () => {
|
|
246
|
+
const menuItems = this.getMenu();
|
|
247
|
+
menuItems.splice(3, 0, /*#__PURE__*/React.createElement(Divider, {
|
|
248
|
+
layout: "vertical",
|
|
249
|
+
key: "divider-first"
|
|
250
|
+
}));
|
|
251
|
+
menuItems.splice(8, 0, /*#__PURE__*/React.createElement(Divider, {
|
|
252
|
+
layout: "vertical",
|
|
253
|
+
key: "divider-second"
|
|
254
|
+
}));
|
|
255
|
+
return menuItems;
|
|
205
256
|
};
|
|
206
257
|
this.foundation = new PreviewFooterFoundation(this.adapter);
|
|
207
258
|
}
|
|
208
259
|
render() {
|
|
209
260
|
const {
|
|
210
|
-
min,
|
|
211
|
-
max,
|
|
212
|
-
step,
|
|
213
|
-
curPage,
|
|
214
|
-
totalNum,
|
|
215
|
-
zoom,
|
|
216
|
-
showTooltip,
|
|
217
261
|
className,
|
|
218
262
|
renderPreviewMenu
|
|
219
263
|
} = this.props;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}, this.customRenderViewMenu());
|
|
224
|
-
}
|
|
264
|
+
const menuCls = cls(footerPrefixCls, `${footerPrefixCls}-wrapper`, className, {
|
|
265
|
+
[`${footerPrefixCls}-content`]: !Boolean(renderPreviewMenu)
|
|
266
|
+
});
|
|
225
267
|
return /*#__PURE__*/React.createElement("section", {
|
|
226
|
-
className:
|
|
227
|
-
}, this.
|
|
228
|
-
className: `${footerPrefixCls}-page`
|
|
229
|
-
}, /*#__PURE__*/React.createElement("span", null, curPage), /*#__PURE__*/React.createElement("span", null, "/"), /*#__PURE__*/React.createElement("span", null, totalNum)), this.getIconChevronRight(), /*#__PURE__*/React.createElement(Divider, {
|
|
230
|
-
layout: "vertical"
|
|
231
|
-
}), this.getIconMinus(), /*#__PURE__*/React.createElement(Slider, {
|
|
232
|
-
value: zoom,
|
|
233
|
-
min: min,
|
|
234
|
-
max: max,
|
|
235
|
-
step: step,
|
|
236
|
-
tipFormatter: v => `${v}%`,
|
|
237
|
-
tooltipVisible: showTooltip ? undefined : false,
|
|
238
|
-
onChange: this.handleSlideChange
|
|
239
|
-
}), this.getIconPlus(), this.getIconRatio(), /*#__PURE__*/React.createElement(Divider, {
|
|
240
|
-
layout: "vertical"
|
|
241
|
-
}), this.getIconRotate(), this.getIconDownload());
|
|
268
|
+
className: menuCls
|
|
269
|
+
}, renderPreviewMenu ? this.customRenderViewMenu() : this.getFooterMenu());
|
|
242
270
|
}
|
|
243
271
|
}
|
|
244
272
|
Footer.propTypes = {
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import BaseComponent from "../_base/baseComponent";
|
|
3
3
|
import { PreviewProps as PreviewInnerProps, PreviewInnerStates } from "./interface";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import PreviewInnerFoundation, { PreviewInnerAdapter } from '@douyinfe/semi-foundation/lib/es/image/previewInnerFoundation';
|
|
5
|
+
import PreviewInnerFoundation, { PreviewInnerAdapter, RatioType } from '@douyinfe/semi-foundation/lib/es/image/previewInnerFoundation';
|
|
6
6
|
import { PreviewContextProps } from "./previewContext";
|
|
7
7
|
export default class PreviewInner extends BaseComponent<PreviewInnerProps, PreviewInnerStates> {
|
|
8
8
|
static contextType: React.Context<PreviewContextProps>;
|
|
@@ -77,7 +77,7 @@ export default class PreviewInner extends BaseComponent<PreviewInnerProps, Previ
|
|
|
77
77
|
handleSwitchImage: (direction: string) => void;
|
|
78
78
|
handleDownload: () => void;
|
|
79
79
|
handlePreviewClose: () => void;
|
|
80
|
-
handleAdjustRatio: (type:
|
|
80
|
+
handleAdjustRatio: (type: RatioType) => void;
|
|
81
81
|
handleRotateImage: (direction: any) => void;
|
|
82
82
|
handleZoomImage: (newZoom: number) => void;
|
|
83
83
|
handleMouseUp: (e: any) => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _isFunction from "lodash/isFunction";
|
|
2
2
|
import _isEqual from "lodash/isEqual";
|
|
3
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
4
3
|
import React from "react";
|
|
5
4
|
import BaseComponent from "../_base/baseComponent";
|
|
6
5
|
import PropTypes from "prop-types";
|
|
@@ -125,6 +124,10 @@ export default class PreviewInner extends BaseComponent {
|
|
|
125
124
|
},
|
|
126
125
|
setMouseActiveTime: time => {
|
|
127
126
|
mouseActiveTime = time;
|
|
127
|
+
},
|
|
128
|
+
getSetDownloadFunc: () => {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
return (_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.setDownloadName) !== null && _b !== void 0 ? _b : this.props.setDownloadName;
|
|
128
131
|
}
|
|
129
132
|
});
|
|
130
133
|
}
|
package/lib/es/input/index.js
CHANGED
|
@@ -10,7 +10,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
/* eslint-disable no-unused-vars, max-len, @typescript-eslint/no-unused-vars */
|
|
14
13
|
import React from 'react';
|
|
15
14
|
import cls from 'classnames';
|
|
16
15
|
import PropTypes from 'prop-types';
|
|
@@ -8,7 +8,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
8
8
|
}
|
|
9
9
|
return t;
|
|
10
10
|
};
|
|
11
|
-
/* eslint-disable max-len */
|
|
12
11
|
import React from 'react';
|
|
13
12
|
import cls from 'classnames';
|
|
14
13
|
import PropTypes from 'prop-types';
|
|
@@ -20,7 +19,6 @@ const prefixCls = cssClasses.PREFIX;
|
|
|
20
19
|
const sizeSet = strings.SIZE;
|
|
21
20
|
export default class inputGroup extends BaseComponent {
|
|
22
21
|
renderGroupWithLabel(inner) {
|
|
23
|
-
// eslint-disable-next-line no-unused-vars
|
|
24
22
|
const _a = this.props,
|
|
25
23
|
{
|
|
26
24
|
size,
|
package/lib/es/input/textarea.js
CHANGED
|
@@ -10,11 +10,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
13
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
14
|
-
/* eslint-disable no-unused-vars */
|
|
15
|
-
/* eslint-disable max-depth */
|
|
16
|
-
/* eslint-disable react/no-did-update-set-state */
|
|
17
|
-
/* eslint-disable max-len */
|
|
18
13
|
import React from 'react';
|
|
19
14
|
import PropTypes from 'prop-types';
|
|
20
15
|
import classnames from 'classnames';
|
|
@@ -6,8 +6,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
6
6
|
}
|
|
7
7
|
return t;
|
|
8
8
|
};
|
|
9
|
-
/* eslint-disable react/destructuring-assignment */
|
|
10
|
-
/* eslint-disable eqeqeq */
|
|
11
9
|
import React, { useState, useCallback } from 'react';
|
|
12
10
|
import cls from 'classnames';
|
|
13
11
|
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/modal/constants';
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
7
7
|
}
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
|
-
/* eslint-disable react/destructuring-assignment, prefer-const, @typescript-eslint/no-unused-vars */
|
|
11
10
|
import React from 'react';
|
|
12
11
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/modal/constants';
|
|
13
12
|
import Button from '../button';
|
|
@@ -9,7 +9,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
/* eslint-disable eqeqeq */
|
|
13
12
|
import React from 'react';
|
|
14
13
|
import PropTypes from 'prop-types';
|
|
15
14
|
import cls from 'classnames';
|
|
@@ -18,7 +17,6 @@ import ConfigContext from '../configProvider/context';
|
|
|
18
17
|
import Button from '../iconButton';
|
|
19
18
|
import Typography from '../typography';
|
|
20
19
|
import BaseComponent from '../_base/baseComponent';
|
|
21
|
-
// eslint-disable-next-line max-len
|
|
22
20
|
import ModalContentFoundation from '@douyinfe/semi-foundation/lib/es/modal/modalContentFoundation';
|
|
23
21
|
import { IconClose } from '@douyinfe/semi-icons';
|
|
24
22
|
import FocusTrapHandle from '@douyinfe/semi-foundation/lib/es/utils/FocusHandle';
|
|
@@ -308,7 +306,6 @@ export default class ModalContent extends BaseComponent {
|
|
|
308
306
|
onClick: maskClosable ? this.onMaskClick : null,
|
|
309
307
|
onMouseUp: maskClosable ? this.onMaskMouseUp : null
|
|
310
308
|
}, this.props.contentExtraProps), this.getDialogElement()));
|
|
311
|
-
// eslint-disable-next-line max-len
|
|
312
309
|
return containerContext && containerContext.Provider ? /*#__PURE__*/React.createElement(containerContext.Provider, {
|
|
313
310
|
value: containerContext.value
|
|
314
311
|
}, elem) : elem;
|
|
@@ -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/es/modal/confirm.js
CHANGED
|
@@ -14,12 +14,10 @@ function usePatchElement() {
|
|
|
14
14
|
}
|
|
15
15
|
export default function useModal() {
|
|
16
16
|
const [elements, patchElement] = usePatchElement();
|
|
17
|
-
// eslint-disable-next-line max-len
|
|
18
17
|
function getConfirmFunc(withFunc) {
|
|
19
18
|
return function hookConfirm(config) {
|
|
20
19
|
uuid += 1;
|
|
21
20
|
const modalRef = /*#__PURE__*/React.createRef();
|
|
22
|
-
// eslint-disable-next-line prefer-const
|
|
23
21
|
let closeFunc;
|
|
24
22
|
const modal = /*#__PURE__*/React.createElement(HookModal, {
|
|
25
23
|
key: `semi-modal-${uuid}`,
|