dtable-ui-component 7.0.13 → 7.0.15

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 (308) hide show
  1. package/lib/ActionSheet/index.js +58 -49
  2. package/lib/ActivityIndicator/index.js +17 -16
  3. package/lib/AsyncUserSelect/index.js +20 -46
  4. package/lib/AsyncUserSelect/user-item.js +6 -5
  5. package/lib/AutoNumberFormatter/index.js +4 -3
  6. package/lib/Badge/index.js +27 -29
  7. package/lib/ButtonFormatter/index.js +8 -6
  8. package/lib/CTimeFormatter/index.js +4 -3
  9. package/lib/CheckboxEditor/index.js +16 -13
  10. package/lib/CheckboxEditor/mb-editor.js +20 -9
  11. package/lib/CheckboxEditor/pc-editor.js +24 -12
  12. package/lib/CheckboxFormatter/index.js +5 -4
  13. package/lib/CollaboratorEditor/index.js +17 -14
  14. package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
  15. package/lib/CollaboratorEditor/pc-editor/index.js +35 -26
  16. package/lib/CollaboratorFormatter/index.js +10 -8
  17. package/lib/CollaboratorItem/index.js +5 -4
  18. package/lib/CollapsibleSettingLayout/index.js +8 -10
  19. package/lib/Comment/body/comment.js +19 -11
  20. package/lib/Comment/body/index.js +8 -8
  21. package/lib/Comment/footer/btns/index.js +7 -4
  22. package/lib/Comment/footer/index.js +21 -10
  23. package/lib/Comment/footer/input/index.js +55 -34
  24. package/lib/Comment/footer/input/participant/index.js +6 -5
  25. package/lib/Comment/footer/participants/index.js +5 -4
  26. package/lib/Comment/footer/participants/participant/index.js +3 -1
  27. package/lib/Comment/footer/participants/participant-select/index.js +26 -10
  28. package/lib/Comment/index.js +57 -39
  29. package/lib/Comment/utils/utilities.js +22 -16
  30. package/lib/CreatorFormatter/index.js +8 -6
  31. package/lib/DTableColorPicker/ColorPickerPortal/index.js +26 -28
  32. package/lib/DTableColorPicker/index.js +53 -67
  33. package/lib/DTableColorPicker/utils.js +7 -5
  34. package/lib/DTableColumnIcon/index.js +7 -6
  35. package/lib/DTableCommonAddTool/index.js +10 -8
  36. package/lib/DTableCustomFooter/index.js +3 -1
  37. package/lib/DTableCustomizeSearchInput/index.js +41 -26
  38. package/lib/DTableCustomizeSelect/index.js +24 -19
  39. package/lib/DTableDropdownItem/index.js +28 -24
  40. package/lib/DTableDropdownMenu/index.js +17 -14
  41. package/lib/DTableEmptyTip/index.js +5 -4
  42. package/lib/DTableFiltersPopover/index.js +42 -27
  43. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
  44. package/lib/DTableFiltersPopover/utils/index.js +114 -64
  45. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
  46. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
  47. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
  48. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
  49. package/lib/DTableFiltersPopover/widgets/filter-group.js +57 -36
  50. package/lib/DTableFiltersPopover/widgets/filter-item.js +165 -106
  51. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +162 -137
  52. package/lib/DTableFiltersPopover/widgets/rate-item.js +25 -20
  53. package/lib/DTableIcon/index.js +11 -10
  54. package/lib/DTableIcon/svg-icon.js +11 -9
  55. package/lib/DTableModalHeader/index.js +7 -7
  56. package/lib/DTablePopover/index.js +16 -12
  57. package/lib/DTableRadio/index.js +9 -10
  58. package/lib/DTableRadioGroup/index.js +20 -11
  59. package/lib/DTableSearchInput/index.js +29 -19
  60. package/lib/DTableSelect/dtable-select-label.js +6 -7
  61. package/lib/DTableSelect/index.js +26 -25
  62. package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
  63. package/lib/DTableSelect/utils.js +83 -47
  64. package/lib/DTableSubDropdownMenu/index.js +16 -12
  65. package/lib/DTableSubDropdownToggle/index.js +16 -17
  66. package/lib/DTableSwitch/index.js +11 -12
  67. package/lib/DTableToolTip/index.js +12 -11
  68. package/lib/DateEditor/index.js +28 -30
  69. package/lib/DateEditor/mb-editor/index.js +31 -18
  70. package/lib/DateEditor/pc-editor.js +46 -27
  71. package/lib/DateFormatter/index.js +5 -4
  72. package/lib/DatePicker/index.js +15 -9
  73. package/lib/DatePicker/utils.js +7 -5
  74. package/lib/DeleteTip/index.js +6 -5
  75. package/lib/DepartmentMultipleSelectEditor/index.js +26 -28
  76. package/lib/DepartmentSelectFilter/index.js +13 -8
  77. package/lib/DepartmentSingleSelectEditor/index.js +16 -13
  78. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +49 -50
  79. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +64 -42
  80. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
  81. package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
  82. package/lib/DigitalSignEditor/index.js +16 -13
  83. package/lib/DigitalSignEditor/mb-editor/index.js +24 -16
  84. package/lib/DigitalSignEditor/pc-editor/index.js +31 -23
  85. package/lib/DigitalSignEditor/service.js +5 -3
  86. package/lib/DigitalSignEditor/signature-board/index.js +10 -7
  87. package/lib/DigitalSignEditor/utils.js +4 -2
  88. package/lib/DigitalSignFormatter/index.js +15 -12
  89. package/lib/DigitalSignFormatter/utils.js +6 -5
  90. package/lib/Drawer/index.js +3 -2
  91. package/lib/DurationEditor/index.js +31 -21
  92. package/lib/DurationFormatter/index.js +5 -4
  93. package/lib/EditEditorButton/index.js +3 -1
  94. package/lib/EmailFormatter/index.js +4 -3
  95. package/lib/FieldDisplaySetting/field-item.js +13 -13
  96. package/lib/FieldDisplaySetting/index.js +20 -20
  97. package/lib/FileEditor/files-previewer/index.js +16 -13
  98. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +20 -12
  99. package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
  100. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
  101. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
  102. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +24 -17
  103. package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
  104. package/lib/FileEditor/index.js +16 -13
  105. package/lib/FileEditor/mb-editor/index.js +20 -28
  106. package/lib/FileEditor/pc-editor/addition-previewer/index.js +4 -2
  107. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +31 -17
  108. package/lib/FileEditor/pc-editor/index.js +30 -22
  109. package/lib/FileFormatter/index.js +20 -27
  110. package/lib/FileItemFormatter/index.js +10 -7
  111. package/lib/FileUploader/index.js +46 -29
  112. package/lib/FormulaFormatter/index.js +44 -24
  113. package/lib/GeolocationEditor/index.js +32 -27
  114. package/lib/GeolocationEditor/map-editor-utils.js +23 -21
  115. package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
  116. package/lib/GeolocationEditor/mb-editor/index.js +28 -22
  117. package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
  118. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +77 -47
  119. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
  120. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
  121. package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
  122. package/lib/GeolocationEditor/pc-editor/country-editor.js +25 -12
  123. package/lib/GeolocationEditor/pc-editor/index.js +41 -27
  124. package/lib/GeolocationEditor/pc-editor/location-editor.js +33 -28
  125. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +67 -43
  126. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +69 -42
  127. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +86 -42
  128. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +85 -39
  129. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +26 -20
  130. package/lib/GeolocationEditor/pc-editor/province-editor.js +15 -8
  131. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
  132. package/lib/GeolocationEditor/pc-editor/selector-list.js +8 -7
  133. package/lib/GeolocationFormatter/index.js +5 -4
  134. package/lib/HtmlLongTextFormatter/index.js +13 -5
  135. package/lib/Icon/index.js +13 -15
  136. package/lib/Icon/load-sprite.js +13 -2
  137. package/lib/IconButton/index.js +12 -13
  138. package/lib/ImageEditor/images-previewer/image-preview/index.js +22 -13
  139. package/lib/ImageEditor/images-previewer/index.js +9 -3
  140. package/lib/ImageEditor/index.js +16 -13
  141. package/lib/ImageEditor/mb-editor/index.js +20 -28
  142. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
  143. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +5 -3
  144. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +26 -12
  145. package/lib/ImageEditor/pc-editor/images-previewer/index.js +10 -4
  146. package/lib/ImageEditor/pc-editor/index.js +16 -11
  147. package/lib/ImageFormatter/images-lazy-load.js +11 -19
  148. package/lib/ImageFormatter/index.js +14 -12
  149. package/lib/ImagePreviewerLightbox/index.js +15 -19
  150. package/lib/ImageThumbnail/index.js +15 -12
  151. package/lib/InputItem/custom-input.js +55 -35
  152. package/lib/InputItem/custom-keyboard.js +42 -42
  153. package/lib/InputItem/index.js +82 -63
  154. package/lib/InputItem/input.js +9 -11
  155. package/lib/LastModifierFormatter/index.js +8 -6
  156. package/lib/LinkEditor/index.js +53 -33
  157. package/lib/LinkEditor/link-editor-option.js +4 -3
  158. package/lib/LinkEditor/mb-popover/index.js +22 -9
  159. package/lib/LinkEditor/pc-popover/index.js +13 -7
  160. package/lib/LinkFormatter/index.js +37 -21
  161. package/lib/List/index.js +17 -19
  162. package/lib/List/list-item.js +59 -55
  163. package/lib/LongTextFormatter/index.js +5 -4
  164. package/lib/MBEditorHeader/index.js +9 -8
  165. package/lib/MTimeFormatter/index.js +4 -3
  166. package/lib/MobileFullScreenPage/body/index.js +6 -4
  167. package/lib/MobileFullScreenPage/header/index.js +10 -8
  168. package/lib/MobileFullScreenPage/index.js +12 -14
  169. package/lib/MobileModal/index.js +7 -8
  170. package/lib/MobileOperationSheet/index.js +8 -7
  171. package/lib/MobileSelector/empty/index.js +3 -1
  172. package/lib/MobileSelector/index.js +7 -5
  173. package/lib/MobileSelector/option/index.js +5 -3
  174. package/lib/MobileSelector/options/index.css +0 -4
  175. package/lib/MobileSelector/options/index.js +3 -1
  176. package/lib/MobileSelector/search/index.js +5 -3
  177. package/lib/MobileUpload/index.js +5 -4
  178. package/lib/Modal/alert.js +2 -2
  179. package/lib/Modal/modal.js +28 -30
  180. package/lib/Modal/prompt.js +14 -14
  181. package/lib/MultipleSelectEditor/index.js +7 -7
  182. package/lib/MultipleSelectFormatter/index.js +9 -7
  183. package/lib/NotificationPopover/index.js +5 -4
  184. package/lib/NumberEditor/index.js +21 -12
  185. package/lib/NumberFormatter/index.js +5 -4
  186. package/lib/PhoneNumberLink/index.js +5 -3
  187. package/lib/Picker/AbstractPicker.js +35 -33
  188. package/lib/Popover/index.js +9 -11
  189. package/lib/Popover/item.js +22 -24
  190. package/lib/Progress/index.js +18 -17
  191. package/lib/Radio/Radio.js +17 -15
  192. package/lib/Radio/RadioItem.js +23 -19
  193. package/lib/RateFormatter/index.js +15 -15
  194. package/lib/RoleStatusEditor/index.js +18 -19
  195. package/lib/RowExpand/index.js +7 -6
  196. package/lib/RowExpandDialog/body/index.js +57 -40
  197. package/lib/RowExpandDialog/column-content/index.js +10 -6
  198. package/lib/RowExpandDialog/header/index.js +12 -9
  199. package/lib/RowExpandDialog/index.js +59 -63
  200. package/lib/RowExpandEditor/add-btn/index.js +7 -6
  201. package/lib/RowExpandEditor/checkbox-editor/index.js +7 -6
  202. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
  203. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
  204. package/lib/RowExpandEditor/collaborator-editor/index.js +7 -6
  205. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
  206. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
  207. package/lib/RowExpandEditor/date-editor/index.js +7 -6
  208. package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
  209. package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
  210. package/lib/RowExpandEditor/department-editor/index.js +7 -6
  211. package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
  212. package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
  213. package/lib/RowExpandEditor/digital-sign-editor/index.js +7 -6
  214. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +38 -24
  215. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +39 -25
  216. package/lib/RowExpandEditor/duration-editor/index.js +7 -6
  217. package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
  218. package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
  219. package/lib/RowExpandEditor/email-editor/index.js +7 -6
  220. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +20 -10
  221. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +25 -14
  222. package/lib/RowExpandEditor/file-editor/index.js +7 -6
  223. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
  224. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
  225. package/lib/RowExpandEditor/geolocation-editor/index.js +7 -6
  226. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
  227. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
  228. package/lib/RowExpandEditor/image-editor/index.js +7 -6
  229. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +26 -16
  230. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +24 -14
  231. package/lib/RowExpandEditor/index.js +16 -11
  232. package/lib/RowExpandEditor/long-text-editor/index.js +7 -6
  233. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
  234. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
  235. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
  236. package/lib/RowExpandEditor/multiple-select-editor/index.js +7 -6
  237. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +20 -12
  238. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +38 -27
  239. package/lib/RowExpandEditor/number-editor/index.js +7 -6
  240. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
  241. package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
  242. package/lib/RowExpandEditor/rate-editor/index.js +7 -6
  243. package/lib/RowExpandEditor/rate-editor/mb-editor.js +26 -13
  244. package/lib/RowExpandEditor/rate-editor/pc-editor.js +41 -25
  245. package/lib/RowExpandEditor/single-select-editor/index.js +7 -6
  246. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +32 -21
  247. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +37 -25
  248. package/lib/RowExpandEditor/text-editor/index.js +7 -6
  249. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
  250. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
  251. package/lib/RowExpandEditor/url-editor/index.js +7 -6
  252. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +15 -7
  253. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +20 -11
  254. package/lib/RowExpandFormatter/department-formatter/index.js +6 -3
  255. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
  256. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
  257. package/lib/RowExpandFormatter/email-formatter/index.js +8 -5
  258. package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
  259. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +14 -12
  260. package/lib/RowExpandFormatter/formula-formatter/index.js +51 -30
  261. package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
  262. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +10 -9
  263. package/lib/RowExpandFormatter/index.js +52 -34
  264. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +15 -9
  265. package/lib/RowExpandFormatter/link-formatter/index.js +25 -17
  266. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
  267. package/lib/RowExpandFormatter/rate-formatter/index.js +14 -13
  268. package/lib/RowExpandFormatter/text/index.js +5 -4
  269. package/lib/RowExpandFormatter/url-formatter/index.js +9 -6
  270. package/lib/RowExpandView/body/index.js +43 -32
  271. package/lib/RowExpandView/column-content/index.js +7 -3
  272. package/lib/RowExpandView/index.js +52 -53
  273. package/lib/SelectItem/index.js +7 -5
  274. package/lib/SelectOptionGroup/index.js +40 -30
  275. package/lib/SelectedDepartments/index.js +12 -10
  276. package/lib/SimpleLongTextFormatter/index.js +18 -12
  277. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
  278. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
  279. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
  280. package/lib/SingleSelectEditor/index.js +7 -7
  281. package/lib/SingleSelectFormatter/index.js +9 -8
  282. package/lib/TabBar/Tab.js +26 -24
  283. package/lib/TabBar/index.js +28 -24
  284. package/lib/Tabs/index.js +13 -10
  285. package/lib/TextEditor/index.js +23 -14
  286. package/lib/TextFormatter/index.js +4 -3
  287. package/lib/TextareaItem/index.js +53 -48
  288. package/lib/Toast/index.js +9 -8
  289. package/lib/UrlFormatter/index.js +4 -3
  290. package/lib/common/editor-base.js +12 -7
  291. package/lib/formatterConfig/index.js +3 -3
  292. package/lib/hooks/common-hooks.js +4 -2
  293. package/lib/select-editor/index.js +16 -13
  294. package/lib/select-editor/mb-editor/index.js +28 -17
  295. package/lib/select-editor/pc-editor/index.js +47 -32
  296. package/lib/toaster/alert.js +8 -7
  297. package/lib/toaster/toast.js +4 -3
  298. package/lib/toaster/toastManager.js +13 -13
  299. package/lib/toaster/toaster.js +12 -9
  300. package/lib/utils/cell.js +11 -8
  301. package/lib/utils/class.js +3 -3
  302. package/lib/utils/column-utils.js +14 -8
  303. package/lib/utils/departments.js +6 -5
  304. package/lib/utils/getLocale.js +11 -5
  305. package/lib/utils/object-utils.js +5 -4
  306. package/lib/utils/url.js +29 -22
  307. package/lib/utils/utils.js +6 -2
  308. package/package.json +2 -2
@@ -1,34 +1,26 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
10
9
  var _react = _interopRequireWildcard(require("react"));
11
10
  var _dtableUtils = require("dtable-utils");
12
11
  var _Loading = _interopRequireDefault(require("../Loading"));
13
12
  var _jsxRuntime = require("react/jsx-runtime");
14
13
  const ImagesLazyLoad = _ref => {
15
- let images = _ref.images,
16
- server = _ref.server,
17
- onImageClick = _ref.onImageClick,
18
- renderItem = _ref.renderItem,
19
- dtableUuid = _ref.dtableUuid;
20
- const _useState = (0, _react.useState)(images),
21
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
22
- currentImages = _useState2[0],
23
- setCurrentImages = _useState2[1];
24
- const _useState3 = (0, _react.useState)([]),
25
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
26
- loadedImages = _useState4[0],
27
- setLoadedImages = _useState4[1];
28
- const _useState5 = (0, _react.useState)(0),
29
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
30
- loadedCount = _useState6[0],
31
- setLoadedCount = _useState6[1];
14
+ let {
15
+ images,
16
+ server,
17
+ onImageClick,
18
+ renderItem,
19
+ dtableUuid
20
+ } = _ref;
21
+ const [currentImages, setCurrentImages] = (0, _react.useState)(images);
22
+ const [loadedImages, setLoadedImages] = (0, _react.useState)([]);
23
+ const [loadedCount, setLoadedCount] = (0, _react.useState)(0);
32
24
  const lazyLoadImage = (url, resolve, reject) => {
33
25
  if (!url) {
34
26
  reject('img path is required');
@@ -63,18 +63,20 @@ class ImageFormatter extends _react.default.Component {
63
63
  this.canRotate = props.rotateImage && !props.readOnly;
64
64
  }
65
65
  render() {
66
- const _this$props = this.props,
67
- isSample = _this$props.isSample,
68
- value = _this$props.value,
69
- server = _this$props.server,
70
- containerClassName = _this$props.containerClassName,
71
- lightboxClassName = _this$props.lightboxClassName,
72
- readOnly = _this$props.readOnly,
73
- dtableUuid = _this$props.dtableUuid;
66
+ const {
67
+ isSample,
68
+ value,
69
+ server,
70
+ containerClassName,
71
+ lightboxClassName,
72
+ readOnly,
73
+ dtableUuid
74
+ } = this.props;
74
75
  const className = (0, _classnames.default)('dtable-ui cell-formatter-container image-formatter', containerClassName);
75
- const _this$state = this.state,
76
- isPreviewImage = _this$state.isPreviewImage,
77
- previewImageIndex = _this$state.previewImageIndex;
76
+ const {
77
+ isPreviewImage,
78
+ previewImageIndex
79
+ } = this.state;
78
80
  if (!Array.isArray(value) || value.length === 0) {
79
81
  return null;
80
82
  }
@@ -92,7 +94,7 @@ class ImageFormatter extends _react.default.Component {
92
94
  alt: ""
93
95
  }), value.length !== 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
94
96
  className: "image-item-count",
95
- children: "+".concat(value.length)
97
+ children: `+${value.length}`
96
98
  })]
97
99
  });
98
100
  }
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _classnames = _interopRequireDefault(require("classnames"));
11
10
  var _reactImageLightbox = _interopRequireDefault(require("@seafile/react-image-lightbox"));
@@ -16,20 +15,20 @@ require("@seafile/react-image-lightbox/style.css");
16
15
  require("./index.css");
17
16
  var _jsxRuntime = require("react/jsx-runtime");
18
17
  function ImagePreviewerLightbox(props) {
19
- const imageItems = props.imageItems,
20
- imageIndex = props.imageIndex,
21
- readOnly = props.readOnly,
22
- className = props.className,
23
- server = props.server,
24
- workspaceID = props.workspaceID,
25
- dtableUuid = props.dtableUuid,
26
- deleteImage = props.deleteImage,
27
- downloadImage = props.downloadImage,
28
- onRotateImage = props.onRotateImage,
29
- _props$isShowPreLine = props.isShowPreLine,
30
- isShowPreLine = _props$isShowPreLine === void 0 ? true : _props$isShowPreLine,
31
- _props$isShowNextLine = props.isShowNextLine,
32
- isShowNextLine = _props$isShowNextLine === void 0 ? true : _props$isShowNextLine;
18
+ const {
19
+ imageItems,
20
+ imageIndex,
21
+ readOnly,
22
+ className,
23
+ server,
24
+ workspaceID,
25
+ dtableUuid,
26
+ deleteImage,
27
+ downloadImage,
28
+ onRotateImage,
29
+ isShowPreLine = true,
30
+ isShowNextLine = true
31
+ } = props;
33
32
  const imageSrcList = imageItems.map(src => {
34
33
  let name = '';
35
34
  try {
@@ -62,10 +61,7 @@ function ImagePreviewerLightbox(props) {
62
61
  };
63
62
  });
64
63
  const imagesLength = imageSrcList.length;
65
- const _React$useState = _react.default.useState(imageIndex || 0),
66
- _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
67
- currentImageIndex = _React$useState2[0],
68
- setCurrentImageIndex = _React$useState2[1];
64
+ const [currentImageIndex, setCurrentImageIndex] = _react.default.useState(imageIndex || 0);
69
65
  const imageItem = imageSrcList[currentImageIndex];
70
66
  const URL = imageItem ? imageItem.thumbnail : '';
71
67
  const imageName = imageItem ? imageItem.name : '';
@@ -67,10 +67,10 @@ class ImageThumbnail extends _react.default.Component {
67
67
  showTip: false
68
68
  };
69
69
  this.ref = null;
70
- const _ref = props.config || {},
71
- _ref$mediaUrl = _ref.mediaUrl,
72
- mediaUrl = _ref$mediaUrl === void 0 ? '' : _ref$mediaUrl;
73
- this.imageLoadingFailedUrl = "".concat(mediaUrl, "img/image-loading-failed.png");
70
+ const {
71
+ mediaUrl = ''
72
+ } = props.config || {};
73
+ this.imageLoadingFailedUrl = `${mediaUrl}img/image-loading-failed.png`;
74
74
  }
75
75
  componentDidMount() {
76
76
  this.getUrl(this.props.src);
@@ -81,13 +81,16 @@ class ImageThumbnail extends _react.default.Component {
81
81
  }
82
82
  }
83
83
  render() {
84
- const _this$props = this.props,
85
- index = _this$props.index,
86
- downloadImage = _this$props.downloadImage,
87
- src = _this$props.src,
88
- className = _this$props.className,
89
- name = _this$props.name;
90
- const imageThumbnailUrl = this.state.imageThumbnailUrl;
84
+ const {
85
+ index,
86
+ downloadImage,
87
+ src,
88
+ className,
89
+ name
90
+ } = this.props;
91
+ const {
92
+ imageThumbnailUrl
93
+ } = this.state;
91
94
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
92
95
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
93
96
  className: (0, _classnames.default)('dtable-ui-image-thumbnail', className),
@@ -95,7 +98,7 @@ class ImageThumbnail extends _react.default.Component {
95
98
  ref: ref => this.ref = ref,
96
99
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
97
100
  src: imageThumbnailUrl,
98
- id: "item-image-".concat(index),
101
+ id: `item-image-${index}`,
99
102
  alt: ""
100
103
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
101
104
  className: "dtable-ui-image-icons-choice",
@@ -50,7 +50,9 @@ class NumberInput extends React.Component {
50
50
  }
51
51
  };
52
52
  this.doBlur = ev => {
53
- const value = this.state.value;
53
+ const {
54
+ value
55
+ } = this.state;
54
56
  if (ev.target !== this.inputRef) {
55
57
  this.onInputBlur(value);
56
58
  }
@@ -61,7 +63,7 @@ class NumberInput extends React.Component {
61
63
  if (this.props.autoAdjustHeight) {
62
64
  this.getContainer().style.height = '0';
63
65
  }
64
- (0, _class.addClass)(customNumberKeyboard.antmKeyboard, "".concat(this.props.keyboardPrefixCls, "-wrapper-hide"));
66
+ (0, _class.addClass)(customNumberKeyboard.antmKeyboard, `${this.props.keyboardPrefixCls}-wrapper-hide`);
65
67
  }
66
68
  // for unmount
67
69
  this.removeBlurListener();
@@ -70,7 +72,9 @@ class NumberInput extends React.Component {
70
72
  if (IS_REACT_16) {
71
73
  this.keyBoard = null;
72
74
  }
73
- const focus = this.state.focus;
75
+ const {
76
+ focus
77
+ } = this.state;
74
78
  if (focus) {
75
79
  this.setState({
76
80
  focus: false
@@ -82,7 +86,9 @@ class NumberInput extends React.Component {
82
86
  }
83
87
  };
84
88
  this.onInputFocus = () => {
85
- const value = this.state.value;
89
+ const {
90
+ value
91
+ } = this.state;
86
92
  this.props.onFocus(value);
87
93
  this.setState({
88
94
  focus: true
@@ -92,10 +98,11 @@ class NumberInput extends React.Component {
92
98
  if (customNumberKeyboard.antmKeyboard) {
93
99
  if (this.props.autoAdjustHeight) {
94
100
  const keyBoardHeight = customNumberKeyboard.antmKeyboard.offsetHeight;
95
- this.getContainer().style.height = "".concat(keyBoardHeight, "px");
101
+ this.getContainer().style.height = `${keyBoardHeight}px`;
96
102
  if (this.inputRef) {
97
- const _this$inputRef$getBou = this.inputRef.getBoundingClientRect(),
98
- bottom = _this$inputRef$getBou.bottom;
103
+ const {
104
+ bottom
105
+ } = this.inputRef.getBoundingClientRect();
99
106
  const clientHeight = window.innerHeight;
100
107
  // 计算输入框距离视窗的底部距离
101
108
  const distance = clientHeight - bottom;
@@ -104,24 +111,30 @@ class NumberInput extends React.Component {
104
111
  }
105
112
  }
106
113
  }
107
- (0, _class.removeClass)(customNumberKeyboard.antmKeyboard, "".concat(this.props.keyboardPrefixCls, "-wrapper-hide"));
114
+ (0, _class.removeClass)(customNumberKeyboard.antmKeyboard, `${this.props.keyboardPrefixCls}-wrapper-hide`);
108
115
  }
109
116
  customNumberKeyboard.confirmDisabled = value === '';
110
117
  if (customNumberKeyboard.confirmKeyboardItem) {
111
118
  if (value === '') {
112
- (0, _class.addClass)(customNumberKeyboard.confirmKeyboardItem, "".concat(this.props.keyboardPrefixCls, "-item-disabled"));
119
+ (0, _class.addClass)(customNumberKeyboard.confirmKeyboardItem, `${this.props.keyboardPrefixCls}-item-disabled`);
113
120
  } else {
114
- (0, _class.removeClass)(customNumberKeyboard.confirmKeyboardItem, "".concat(this.props.keyboardPrefixCls, "-item-disabled"));
121
+ (0, _class.removeClass)(customNumberKeyboard.confirmKeyboardItem, `${this.props.keyboardPrefixCls}-item-disabled`);
115
122
  }
116
123
  }
117
124
  }
118
125
  });
119
126
  };
120
127
  this.onKeyboardClick = KeyboardItemValue => {
121
- const maxLength = this.props.maxLength;
122
- const value = this.state.value;
128
+ const {
129
+ maxLength
130
+ } = this.props;
131
+ const {
132
+ value
133
+ } = this.state;
123
134
  // tslint:disable-next-line:no-this-assignment
124
- const onChange = this.onChange;
135
+ const {
136
+ onChange
137
+ } = this;
125
138
  let valueAfterChange;
126
139
  // 删除键
127
140
  if (KeyboardItemValue === 'delete') {
@@ -166,9 +179,9 @@ class NumberInput extends React.Component {
166
179
  customNumberKeyboard.confirmDisabled = valueAfterChange === '';
167
180
  if (customNumberKeyboard.confirmKeyboardItem) {
168
181
  if (valueAfterChange === '') {
169
- (0, _class.addClass)(customNumberKeyboard.confirmKeyboardItem, "".concat(this.props.keyboardPrefixCls, "-item-disabled"));
182
+ (0, _class.addClass)(customNumberKeyboard.confirmKeyboardItem, `${this.props.keyboardPrefixCls}-item-disabled`);
170
183
  } else {
171
- (0, _class.removeClass)(customNumberKeyboard.confirmKeyboardItem, "".concat(this.props.keyboardPrefixCls, "-item-disabled"));
184
+ (0, _class.removeClass)(customNumberKeyboard.confirmKeyboardItem, `${this.props.keyboardPrefixCls}-item-disabled`);
172
185
  }
173
186
  }
174
187
  }
@@ -180,7 +193,9 @@ class NumberInput extends React.Component {
180
193
  // this focus may invocked by users page button click, so this click may trigger blurEventListener at the same time
181
194
  this.renderCustomKeyboard();
182
195
  this.removeBlurListener();
183
- const focus = this.state.focus;
196
+ const {
197
+ focus
198
+ } = this.state;
184
199
  if (!focus) {
185
200
  this.onInputFocus();
186
201
  }
@@ -208,14 +223,15 @@ class NumberInput extends React.Component {
208
223
  this.unLinkInput();
209
224
  }
210
225
  getComponent() {
211
- const _this$props = this.props,
212
- confirmLabel = _this$props.confirmLabel,
213
- backspaceLabel = _this$props.backspaceLabel,
214
- cancelKeyboardLabel = _this$props.cancelKeyboardLabel,
215
- keyboardPrefixCls = _this$props.keyboardPrefixCls,
216
- moneyKeyboardWrapProps = _this$props.moneyKeyboardWrapProps,
217
- moneyKeyboardHeader = _this$props.moneyKeyboardHeader,
218
- disabledKeys = _this$props.disabledKeys;
226
+ const {
227
+ confirmLabel,
228
+ backspaceLabel,
229
+ cancelKeyboardLabel,
230
+ keyboardPrefixCls,
231
+ moneyKeyboardWrapProps,
232
+ moneyKeyboardHeader,
233
+ disabledKeys
234
+ } = this.props;
219
235
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_customKeyboard.default, {
220
236
  ref: this.saveRef,
221
237
  onClick: this.onKeyboardClick,
@@ -229,11 +245,13 @@ class NumberInput extends React.Component {
229
245
  });
230
246
  }
231
247
  getContainer() {
232
- const keyboardPrefixCls = this.props.keyboardPrefixCls;
233
- let container = document.querySelector("#".concat(keyboardPrefixCls, "-container"));
248
+ const {
249
+ keyboardPrefixCls
250
+ } = this.props;
251
+ let container = document.querySelector(`#${keyboardPrefixCls}-container`);
234
252
  if (!container) {
235
253
  container = document.createElement('div');
236
- container.setAttribute('id', "".concat(keyboardPrefixCls, "-container"));
254
+ container.setAttribute('id', `${keyboardPrefixCls}-container`);
237
255
  document.body.appendChild(container);
238
256
  }
239
257
  this.container = container;
@@ -258,14 +276,16 @@ class NumberInput extends React.Component {
258
276
  return this.keyBoard;
259
277
  }
260
278
  render() {
261
- const _this$props2 = this.props,
262
- placeholder = _this$props2.placeholder,
263
- disabled = _this$props2.disabled,
264
- editable = _this$props2.editable,
265
- moneyKeyboardAlign = _this$props2.moneyKeyboardAlign;
266
- const _this$state = this.state,
267
- focus = _this$state.focus,
268
- value = _this$state.value;
279
+ const {
280
+ placeholder,
281
+ disabled,
282
+ editable,
283
+ moneyKeyboardAlign
284
+ } = this.props;
285
+ const {
286
+ focus,
287
+ value
288
+ } = this.state;
269
289
  const preventKeyboard = disabled || !editable;
270
290
  const fakeInputCls = (0, _classnames.default)('fake-input', {
271
291
  focus,
@@ -1,25 +1,21 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = exports.KeyboardItem = void 0;
9
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
11
9
  var _classnames = _interopRequireDefault(require("classnames"));
12
10
  var React = _interopRequireWildcard(require("react"));
13
11
  var _rmcFeedback = _interopRequireDefault(require("rmc-feedback"));
14
12
  var _exenv = require("../utils/exenv");
15
13
  var _jsxRuntime = require("react/jsx-runtime");
16
- const _excluded = ["prefixCls", "onClick", "className", "disabled", "children", "tdRef", "label", "iconOnly"];
17
14
  /**
18
15
  * determines whether an array includes a certain value among its entries, returning true or false as appropriate.
19
16
  * @param {array} arr The array to search in
20
17
  * @param {any} item The value to search for
21
- */
22
- function includes(arr, item) {
18
+ */function includes(arr, item) {
23
19
  if (!arr || !arr.length || !item) {
24
20
  return false;
25
21
  }
@@ -32,16 +28,17 @@ function includes(arr, item) {
32
28
  }
33
29
  class KeyboardItem extends React.Component {
34
30
  render() {
35
- const _this$props = this.props,
36
- prefixCls = _this$props.prefixCls,
37
- onClick = _this$props.onClick,
38
- className = _this$props.className,
39
- disabled = _this$props.disabled,
40
- children = _this$props.children,
41
- tdRef = _this$props.tdRef,
42
- label = _this$props.label,
43
- iconOnly = _this$props.iconOnly,
44
- restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
31
+ const {
32
+ prefixCls,
33
+ onClick,
34
+ className,
35
+ disabled,
36
+ children,
37
+ tdRef,
38
+ label,
39
+ iconOnly,
40
+ ...restProps
41
+ } = this.props;
45
42
  let value = children;
46
43
  if (className === 'keyboard-delete') {
47
44
  value = 'delete';
@@ -51,26 +48,26 @@ class KeyboardItem extends React.Component {
51
48
  value = 'confirm';
52
49
  }
53
50
  const extraCls = {
54
- ["".concat(prefixCls, "-item-disabled")]: disabled
51
+ [`${prefixCls}-item-disabled`]: disabled
55
52
  };
56
- const wrapCls = (0, _classnames.default)("".concat(prefixCls, "-item"), className, extraCls);
53
+ const wrapCls = (0, _classnames.default)(`${prefixCls}-item`, className, extraCls);
57
54
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
58
55
  disabled: disabled,
59
- activeClassName: "".concat(prefixCls, "-item-active"),
60
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("td", (0, _objectSpread2.default)((0, _objectSpread2.default)({
56
+ activeClassName: `${prefixCls}-item-active`,
57
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("td", {
61
58
  ref: tdRef
62
59
  // tslint:disable-next-line:jsx-no-multiline-js
63
60
  ,
64
61
  onTouchEnd: e => {
65
62
  onClick(e, value);
66
63
  },
67
- className: wrapCls
68
- }, restProps), {}, {
64
+ className: wrapCls,
65
+ ...restProps,
69
66
  children: [children, iconOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
70
67
  className: "sr-only",
71
68
  children: label
72
69
  })]
73
- }))
70
+ })
74
71
  });
75
72
  }
76
73
  }
@@ -108,22 +105,23 @@ class CustomKeyboard extends React.Component {
108
105
  onClick: this.onKeyboardClick,
109
106
  disabled: disabled,
110
107
  children: item
111
- }, "item-".concat(item, "-").concat(index));
108
+ }, `item-${item}-${index}`);
112
109
  };
113
110
  }
114
111
  render() {
115
- const _this$props2 = this.props,
116
- prefixCls = _this$props2.prefixCls,
117
- confirmLabel = _this$props2.confirmLabel,
118
- backspaceLabel = _this$props2.backspaceLabel,
119
- cancelKeyboardLabel = _this$props2.cancelKeyboardLabel,
120
- wrapProps = _this$props2.wrapProps,
121
- header = _this$props2.header;
122
- const wrapperCls = (0, _classnames.default)("".concat(prefixCls, "-wrapper"), "".concat(prefixCls, "-wrapper-hide"));
123
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
112
+ const {
113
+ prefixCls,
114
+ confirmLabel,
115
+ backspaceLabel,
116
+ cancelKeyboardLabel,
117
+ wrapProps,
118
+ header
119
+ } = this.props;
120
+ const wrapperCls = (0, _classnames.default)(`${prefixCls}-wrapper`, `${prefixCls}-wrapper-hide`);
121
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
124
122
  className: wrapperCls,
125
- ref: el => this.antmKeyboard = el
126
- }, wrapProps), {}, {
123
+ ref: el => this.antmKeyboard = el,
124
+ ...wrapProps,
127
125
  children: [header && /*#__PURE__*/React.cloneElement(header, {
128
126
  onClick: this.onKeyboardClick
129
127
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("table", {
@@ -131,11 +129,12 @@ class CustomKeyboard extends React.Component {
131
129
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
132
130
  children: [['1', '2', '3'].map((item, index) =>
133
131
  // tslint:disable-next-line:jsx-no-multiline-js
134
- this.renderKeyboardItem(item, index)), /*#__PURE__*/(0, _jsxRuntime.jsx)(KeyboardItem, (0, _objectSpread2.default)({
132
+ this.renderKeyboardItem(item, index)), /*#__PURE__*/(0, _jsxRuntime.jsx)(KeyboardItem, {
135
133
  className: "keyboard-delete",
136
134
  rowSpan: 2,
137
- onClick: this.onKeyboardClick
138
- }, this.getAriaAttr(backspaceLabel)))]
135
+ onClick: this.onKeyboardClick,
136
+ ...this.getAriaAttr(backspaceLabel)
137
+ })]
139
138
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("tr", {
140
139
  children: ['4', '5', '6'].map((item, index) =>
141
140
  // tslint:disable-next-line:jsx-no-multiline-js
@@ -153,14 +152,15 @@ class CustomKeyboard extends React.Component {
153
152
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
154
153
  children: [['.', '0'].map((item, index) =>
155
154
  // tslint:disable-next-line:jsx-no-multiline-js
156
- this.renderKeyboardItem(item, index)), /*#__PURE__*/(0, _jsxRuntime.jsx)(KeyboardItem, (0, _objectSpread2.default)({
155
+ this.renderKeyboardItem(item, index)), /*#__PURE__*/(0, _jsxRuntime.jsx)(KeyboardItem, {
157
156
  className: "keyboard-hide",
158
- onClick: this.onKeyboardClick
159
- }, this.getAriaAttr(cancelKeyboardLabel)))]
157
+ onClick: this.onKeyboardClick,
158
+ ...this.getAriaAttr(cancelKeyboardLabel)
159
+ })]
160
160
  })]
161
161
  })
162
162
  })]
163
- }));
163
+ });
164
164
  }
165
165
  getAriaAttr(label) {
166
166
  if (_exenv.IS_IOS) {