@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.
Files changed (243) hide show
  1. package/dist/css/semi.css +6 -40
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +280 -537
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/cjs/_portal/index.d.ts +3 -2
  8. package/lib/cjs/_portal/index.js +33 -26
  9. package/lib/cjs/_utils/index.js +0 -3
  10. package/lib/cjs/autoComplete/index.js +0 -2
  11. package/lib/cjs/autoComplete/option.js +0 -2
  12. package/lib/cjs/avatar/avatarGroup.js +0 -1
  13. package/lib/cjs/avatar/index.js +0 -1
  14. package/lib/cjs/backtop/index.js +0 -1
  15. package/lib/cjs/badge/index.js +0 -1
  16. package/lib/cjs/banner/index.js +0 -3
  17. package/lib/cjs/breadcrumb/index.js +0 -3
  18. package/lib/cjs/button/Button.js +8 -14
  19. package/lib/cjs/calendar/dayCalendar.js +4 -9
  20. package/lib/cjs/calendar/dayCol.js +1 -1
  21. package/lib/cjs/calendar/monthCalendar.js +5 -12
  22. package/lib/cjs/calendar/rangeCalendar.js +0 -2
  23. package/lib/cjs/carousel/index.js +0 -2
  24. package/lib/cjs/checkbox/checkbox.js +0 -2
  25. package/lib/cjs/checkbox/checkboxGroup.js +0 -3
  26. package/lib/cjs/checkbox/checkboxInner.js +0 -2
  27. package/lib/cjs/collapse/index.js +0 -1
  28. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  29. package/lib/cjs/datePicker/dateInput.js +0 -3
  30. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  31. package/lib/cjs/datePicker/datePicker.js +1 -3
  32. package/lib/cjs/datePicker/month.js +0 -4
  33. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  34. package/lib/cjs/datePicker/monthsGrid.js +1 -5
  35. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  36. package/lib/cjs/datePicker/yearAndMonth.js +0 -2
  37. package/lib/cjs/form/arrayField.js +0 -2
  38. package/lib/cjs/form/baseForm.d.ts +0 -1
  39. package/lib/cjs/form/baseForm.js +5 -7
  40. package/lib/cjs/form/context.js +0 -2
  41. package/lib/cjs/form/errorMessage.js +0 -2
  42. package/lib/cjs/form/field.d.ts +0 -1
  43. package/lib/cjs/form/field.js +0 -2
  44. package/lib/cjs/form/group.js +0 -2
  45. package/lib/cjs/form/hoc/withField.js +2 -6
  46. package/lib/cjs/form/interface.d.ts +4 -4
  47. package/lib/cjs/form/interface.js +0 -3
  48. package/lib/cjs/form/section.js +0 -2
  49. package/lib/cjs/form/slot.js +0 -3
  50. package/lib/cjs/iconButton/index.js +0 -2
  51. package/lib/cjs/image/image.js +29 -34
  52. package/lib/cjs/image/interface.d.ts +4 -1
  53. package/lib/cjs/image/preview.js +5 -3
  54. package/lib/cjs/image/previewContext.d.ts +1 -0
  55. package/lib/cjs/image/previewFooter.d.ts +5 -1
  56. package/lib/cjs/image/previewFooter.js +66 -38
  57. package/lib/cjs/image/previewInner.d.ts +2 -2
  58. package/lib/cjs/image/previewInner.js +4 -2
  59. package/lib/cjs/input/index.js +0 -2
  60. package/lib/cjs/input/inputGroup.js +0 -3
  61. package/lib/cjs/input/textarea.js +0 -2
  62. package/lib/cjs/inputNumber/index.js +1 -5
  63. package/lib/cjs/modal/ConfirmModal.js +0 -2
  64. package/lib/cjs/modal/Modal.js +0 -2
  65. package/lib/cjs/modal/ModalContent.js +0 -5
  66. package/lib/cjs/modal/confirm.d.ts +12 -12
  67. package/lib/cjs/modal/confirm.js +0 -1
  68. package/lib/cjs/modal/useModal/HookModal.js +0 -1
  69. package/lib/cjs/modal/useModal/index.js +0 -2
  70. package/lib/cjs/navigation/Item.js +0 -3
  71. package/lib/cjs/navigation/SubNav.js +0 -3
  72. package/lib/cjs/navigation/index.js +0 -2
  73. package/lib/cjs/notification/notice.js +29 -35
  74. package/lib/cjs/notification/useNotification/index.js +1 -1
  75. package/lib/cjs/overflowList/index.js +0 -2
  76. package/lib/cjs/pagination/index.d.ts +2 -0
  77. package/lib/cjs/pagination/index.js +29 -13
  78. package/lib/cjs/popconfirm/index.js +0 -2
  79. package/lib/cjs/progress/index.js +0 -1
  80. package/lib/cjs/radio/radio.js +0 -2
  81. package/lib/cjs/rating/index.js +0 -1
  82. package/lib/cjs/resizeObserver/index.js +0 -1
  83. package/lib/cjs/scrollList/scrollItem.js +0 -3
  84. package/lib/cjs/select/index.d.ts +0 -1
  85. package/lib/cjs/select/index.js +3 -12
  86. package/lib/cjs/select/option.js +0 -2
  87. package/lib/cjs/select/utils.js +0 -2
  88. package/lib/cjs/sideSheet/index.js +0 -2
  89. package/lib/cjs/slider/index.js +0 -3
  90. package/lib/cjs/spin/icon.js +0 -2
  91. package/lib/cjs/switch/index.js +0 -2
  92. package/lib/cjs/table/Body/BaseRow.js +0 -2
  93. package/lib/cjs/table/Body/ExpandedRow.js +0 -3
  94. package/lib/cjs/table/Body/SectionRow.js +0 -3
  95. package/lib/cjs/table/Body/index.js +0 -8
  96. package/lib/cjs/table/ColGroup.js +0 -1
  97. package/lib/cjs/table/ColumnFilter.js +0 -3
  98. package/lib/cjs/table/ColumnSelection.js +0 -2
  99. package/lib/cjs/table/HeadTable.js +0 -2
  100. package/lib/cjs/table/ResizableTable.js +1 -4
  101. package/lib/cjs/table/Table.js +1 -10
  102. package/lib/cjs/table/TableCell.js +0 -4
  103. package/lib/cjs/table/TableHeader.js +0 -4
  104. package/lib/cjs/table/TableHeaderRow.js +0 -2
  105. package/lib/cjs/table/TablePagination.js +0 -2
  106. package/lib/cjs/table/table-context.js +0 -2
  107. package/lib/cjs/tabs/TabBar.js +0 -2
  108. package/lib/cjs/tag/index.js +1 -3
  109. package/lib/cjs/tagInput/index.js +0 -2
  110. package/lib/cjs/timePicker/Combobox.js +0 -4
  111. package/lib/cjs/timePicker/TimeInput.js +0 -2
  112. package/lib/cjs/timePicker/TimePicker.js +0 -2
  113. package/lib/cjs/toast/index.js +0 -2
  114. package/lib/cjs/toast/toast.js +0 -2
  115. package/lib/cjs/toast/useToast/index.js +0 -1
  116. package/lib/cjs/tooltip/index.js +0 -6
  117. package/lib/cjs/transfer/index.js +0 -3
  118. package/lib/cjs/tree/index.d.ts +2 -1
  119. package/lib/cjs/tree/index.js +11 -14
  120. package/lib/cjs/tree/treeNode.js +0 -3
  121. package/lib/cjs/treeSelect/index.js +0 -7
  122. package/lib/cjs/trigger/index.js +0 -2
  123. package/lib/cjs/typography/util.js +1 -3
  124. package/lib/cjs/upload/index.js +1 -6
  125. package/lib/es/_portal/index.d.ts +3 -2
  126. package/lib/es/_portal/index.js +33 -26
  127. package/lib/es/_utils/index.js +0 -2
  128. package/lib/es/autoComplete/index.js +0 -1
  129. package/lib/es/autoComplete/option.js +0 -1
  130. package/lib/es/avatar/avatarGroup.js +0 -1
  131. package/lib/es/avatar/index.js +0 -1
  132. package/lib/es/backtop/index.js +0 -1
  133. package/lib/es/badge/index.js +0 -1
  134. package/lib/es/banner/index.js +0 -2
  135. package/lib/es/breadcrumb/index.js +0 -2
  136. package/lib/es/button/Button.js +8 -13
  137. package/lib/es/calendar/dayCalendar.js +4 -9
  138. package/lib/es/calendar/dayCol.js +1 -1
  139. package/lib/es/calendar/monthCalendar.js +5 -11
  140. package/lib/es/calendar/rangeCalendar.js +0 -1
  141. package/lib/es/carousel/index.js +0 -1
  142. package/lib/es/checkbox/checkbox.js +0 -1
  143. package/lib/es/checkbox/checkboxGroup.js +0 -2
  144. package/lib/es/checkbox/checkboxInner.js +0 -1
  145. package/lib/es/collapse/index.js +0 -1
  146. package/lib/es/datePicker/dateInput.d.ts +1 -1
  147. package/lib/es/datePicker/dateInput.js +0 -3
  148. package/lib/es/datePicker/datePicker.d.ts +1 -1
  149. package/lib/es/datePicker/datePicker.js +0 -3
  150. package/lib/es/datePicker/month.js +0 -4
  151. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  152. package/lib/es/datePicker/monthsGrid.js +1 -5
  153. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  154. package/lib/es/datePicker/yearAndMonth.js +0 -1
  155. package/lib/es/form/arrayField.js +0 -1
  156. package/lib/es/form/baseForm.d.ts +0 -1
  157. package/lib/es/form/baseForm.js +5 -6
  158. package/lib/es/form/context.js +0 -1
  159. package/lib/es/form/errorMessage.js +0 -1
  160. package/lib/es/form/field.d.ts +0 -1
  161. package/lib/es/form/field.js +0 -1
  162. package/lib/es/form/group.js +0 -1
  163. package/lib/es/form/hoc/withField.js +2 -6
  164. package/lib/es/form/interface.d.ts +4 -4
  165. package/lib/es/form/interface.js +0 -2
  166. package/lib/es/form/section.js +0 -1
  167. package/lib/es/form/slot.js +0 -2
  168. package/lib/es/iconButton/index.js +0 -1
  169. package/lib/es/image/image.js +29 -34
  170. package/lib/es/image/interface.d.ts +4 -1
  171. package/lib/es/image/preview.js +5 -3
  172. package/lib/es/image/previewContext.d.ts +1 -0
  173. package/lib/es/image/previewFooter.d.ts +5 -1
  174. package/lib/es/image/previewFooter.js +66 -38
  175. package/lib/es/image/previewInner.d.ts +2 -2
  176. package/lib/es/image/previewInner.js +4 -1
  177. package/lib/es/input/index.js +0 -1
  178. package/lib/es/input/inputGroup.js +0 -2
  179. package/lib/es/input/textarea.js +0 -1
  180. package/lib/es/inputNumber/index.js +0 -5
  181. package/lib/es/modal/ConfirmModal.js +0 -2
  182. package/lib/es/modal/Modal.js +0 -1
  183. package/lib/es/modal/ModalContent.js +0 -3
  184. package/lib/es/modal/confirm.d.ts +12 -12
  185. package/lib/es/modal/confirm.js +0 -1
  186. package/lib/es/modal/useModal/HookModal.js +0 -1
  187. package/lib/es/modal/useModal/index.js +0 -2
  188. package/lib/es/navigation/Item.js +0 -2
  189. package/lib/es/navigation/SubNav.js +0 -2
  190. package/lib/es/navigation/index.js +0 -1
  191. package/lib/es/notification/notice.js +29 -34
  192. package/lib/es/notification/useNotification/index.js +1 -1
  193. package/lib/es/overflowList/index.js +0 -1
  194. package/lib/es/pagination/index.d.ts +2 -0
  195. package/lib/es/pagination/index.js +28 -13
  196. package/lib/es/popconfirm/index.js +0 -1
  197. package/lib/es/progress/index.js +0 -1
  198. package/lib/es/radio/radio.js +0 -1
  199. package/lib/es/rating/index.js +0 -1
  200. package/lib/es/resizeObserver/index.js +0 -1
  201. package/lib/es/scrollList/scrollItem.js +0 -3
  202. package/lib/es/select/index.d.ts +0 -1
  203. package/lib/es/select/index.js +3 -12
  204. package/lib/es/select/option.js +0 -1
  205. package/lib/es/select/utils.js +0 -2
  206. package/lib/es/sideSheet/index.js +0 -1
  207. package/lib/es/slider/index.js +0 -3
  208. package/lib/es/spin/icon.js +0 -1
  209. package/lib/es/switch/index.js +0 -1
  210. package/lib/es/table/Body/BaseRow.js +0 -2
  211. package/lib/es/table/Body/ExpandedRow.js +0 -2
  212. package/lib/es/table/Body/SectionRow.js +0 -3
  213. package/lib/es/table/Body/index.js +0 -8
  214. package/lib/es/table/ColGroup.js +0 -1
  215. package/lib/es/table/ColumnFilter.js +0 -2
  216. package/lib/es/table/ColumnSelection.js +0 -1
  217. package/lib/es/table/HeadTable.js +0 -1
  218. package/lib/es/table/ResizableTable.js +0 -4
  219. package/lib/es/table/Table.js +0 -10
  220. package/lib/es/table/TableCell.js +0 -3
  221. package/lib/es/table/TableHeader.js +0 -3
  222. package/lib/es/table/TableHeaderRow.js +0 -1
  223. package/lib/es/table/TablePagination.js +0 -1
  224. package/lib/es/table/table-context.js +0 -1
  225. package/lib/es/tabs/TabBar.js +0 -2
  226. package/lib/es/tag/index.js +1 -2
  227. package/lib/es/tagInput/index.js +0 -2
  228. package/lib/es/timePicker/Combobox.js +0 -3
  229. package/lib/es/timePicker/TimeInput.js +0 -1
  230. package/lib/es/timePicker/TimePicker.js +0 -1
  231. package/lib/es/toast/index.js +0 -1
  232. package/lib/es/toast/toast.js +0 -1
  233. package/lib/es/toast/useToast/index.js +0 -1
  234. package/lib/es/tooltip/index.js +0 -5
  235. package/lib/es/transfer/index.js +0 -3
  236. package/lib/es/tree/index.d.ts +2 -1
  237. package/lib/es/tree/index.js +11 -13
  238. package/lib/es/tree/treeNode.js +0 -3
  239. package/lib/es/treeSelect/index.js +0 -7
  240. package/lib/es/trigger/index.js +0 -2
  241. package/lib/es/typography/util.js +1 -3
  242. package/lib/es/upload/index.js +1 -5
  243. package/package.json +8 -8
@@ -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,
@@ -7,7 +7,6 @@ var __rest = this && this.__rest || function (s, e) {
7
7
  }
8
8
  return t;
9
9
  };
10
- /* eslint-disable eqeqeq */
11
10
  import React, { PureComponent } from 'react';
12
11
  import classNames from 'classnames';
13
12
  import PropTypes from 'prop-types';
@@ -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
- /*#__PURE__*/
179
- // eslint-disable jsx-a11y/no-static-element-interactions
180
- // eslint-disable jsx-a11y/click-events-have-key-events
181
- React.createElement("div", {
182
- style: outerStyle,
183
- className: outerCls,
184
- onClick: this.handleClick
185
- }, /*#__PURE__*/React.createElement("img", Object.assign({
186
- ref: this.imgRef
187
- }, restProps, {
188
- src: this.isInGroup() && this.isLazyLoad() ? undefined : src,
189
- "data-src": src,
190
- alt: alt,
191
- className: cls(`${prefixCls}-img`, {
192
- [`${prefixCls}-img-preview`]: showPreviewCursor,
193
- [`${prefixCls}-img-error`]: loadStatus === "error"
194
- }),
195
- width: width,
196
- height: height,
197
- crossOrigin: crossOrigin,
198
- onError: this.handleError,
199
- onLoad: this.handleLoaded
200
- })), loadStatus !== "success" && this.renderExtra(), canPreview && /*#__PURE__*/React.createElement(PreviewInner, Object.assign({}, previewProps, {
201
- src: previewSrc,
202
- visible: previewVisible,
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>;
@@ -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
- if (renderPreviewMenu) {
221
- return /*#__PURE__*/React.createElement("div", {
222
- className: `${footerPrefixCls}-wrapper`
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: cls(footerPrefixCls, `${footerPrefixCls}-wrapper`, className)
227
- }, this.getIconChevronLeft(), /*#__PURE__*/React.createElement("div", {
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: string) => void;
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
  }
@@ -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,
@@ -9,7 +9,6 @@ var __rest = this && this.__rest || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- /* eslint-disable no-unused-vars */
13
12
  import React from 'react';
14
13
  import cls from 'classnames';
15
14
  import PropTypes from 'prop-types';
@@ -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';
@@ -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?: "yes" | "no";
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): {
@@ -17,7 +17,6 @@ export default function confirm(props) {
17
17
  }
18
18
  for (let i = 0; i < destroyFns.length; i++) {
19
19
  const fn = destroyFns[i];
20
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
21
20
  if (fn === close) {
22
21
  destroyFns.splice(i, 1);
23
22
  break;
@@ -8,7 +8,6 @@ var __rest = this && this.__rest || function (s, e) {
8
8
  };
9
9
  import React from 'react';
10
10
  import ConfirmModal from '../ConfirmModal';
11
- // eslint-disable-next-line max-len
12
11
  const HookModal = (_a, ref) => {
13
12
  var {
14
13
  afterClose,
@@ -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}`,
@@ -1,7 +1,5 @@
1
1
  import _times from "lodash/times";
2
2
  import _noop from "lodash/noop";
3
- /* eslint-disable max-len */
4
- /* eslint-disable no-nested-ternary */
5
3
  import BaseComponent from '../_base/baseComponent';
6
4
  import React from 'react';
7
5
  import PropTypes from 'prop-types';
@@ -1,7 +1,5 @@
1
1
  import _get from "lodash/get";
2
2
  import _times from "lodash/times";
3
- /* eslint-disable max-len */
4
- /* eslint-disable no-nested-ternary */
5
3
  import BaseComponent from '../_base/baseComponent';
6
4
  import React from 'react';
7
5
  import PropTypes from 'prop-types';