dtable-ui-component 7.0.0-xia.1 → 7.0.0-xia.2

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 (281) hide show
  1. package/lib/ActionSheet/index.js +14 -16
  2. package/lib/ActivityIndicator/index.js +7 -8
  3. package/lib/AsyncUserSelect/index.js +40 -19
  4. package/lib/AsyncUserSelect/user-item.js +5 -6
  5. package/lib/AutoNumberFormatter/index.js +3 -4
  6. package/lib/Badge/index.js +9 -11
  7. package/lib/ButtonFormatter/index.js +6 -8
  8. package/lib/CTimeFormatter/index.js +3 -4
  9. package/lib/CheckboxEditor/index.js +1 -3
  10. package/lib/CheckboxEditor/mb-editor.js +9 -20
  11. package/lib/CheckboxEditor/pc-editor.js +12 -24
  12. package/lib/CheckboxFormatter/index.js +4 -5
  13. package/lib/CollaboratorEditor/index.js +2 -4
  14. package/lib/CollaboratorEditor/mb-editor/index.js +11 -19
  15. package/lib/CollaboratorEditor/pc-editor/index.js +25 -34
  16. package/lib/CollaboratorFormatter/index.js +8 -10
  17. package/lib/CollaboratorItem/index.js +4 -5
  18. package/lib/CollapsibleSettingLayout/index.js +9 -7
  19. package/lib/Comment/body/comment.js +10 -18
  20. package/lib/Comment/body/index.js +2 -4
  21. package/lib/Comment/footer/btns/index.js +4 -7
  22. package/lib/Comment/footer/index.js +9 -20
  23. package/lib/Comment/footer/input/index.js +29 -50
  24. package/lib/Comment/footer/input/participant/index.js +4 -5
  25. package/lib/Comment/footer/participants/index.js +4 -5
  26. package/lib/Comment/footer/participants/participant/index.js +1 -3
  27. package/lib/Comment/footer/participants/participant-select/index.js +8 -24
  28. package/lib/Comment/index.js +39 -57
  29. package/lib/Comment/utils/utilities.js +15 -21
  30. package/lib/CreatorFormatter/index.js +6 -8
  31. package/lib/DTableColorPicker/ColorPickerPortal/index.js +22 -18
  32. package/lib/DTableColorPicker/index.js +55 -40
  33. package/lib/DTableColorPicker/utils.js +4 -6
  34. package/lib/DTableColumnIcon/index.js +6 -7
  35. package/lib/DTableCommonAddTool/index.js +6 -8
  36. package/lib/DTableCustomFooter/index.js +1 -3
  37. package/lib/DTableCustomizeCollaboratorSelect/index.js +17 -20
  38. package/lib/DTableCustomizeSelect/index.js +19 -24
  39. package/lib/DTableDropdownItem/index.js +16 -18
  40. package/lib/DTableDropdownMenu/index.js +8 -10
  41. package/lib/DTableEmptyTip/index.js +4 -5
  42. package/lib/DTableFiltersPopover/index.js +26 -41
  43. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +1 -3
  44. package/lib/DTableFiltersPopover/utils/index.js +63 -113
  45. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +8 -9
  46. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +16 -13
  47. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +18 -15
  48. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +8 -14
  49. package/lib/DTableFiltersPopover/widgets/filter-group.js +34 -55
  50. package/lib/DTableFiltersPopover/widgets/filter-item.js +107 -170
  51. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +136 -161
  52. package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
  53. package/lib/DTableGroupSelect/index.js +11 -15
  54. package/lib/DTableGroupSelect/select-option-group.js +23 -32
  55. package/lib/DTableIcon/index.js +6 -7
  56. package/lib/DTableIcon/svg-icon.js +5 -7
  57. package/lib/DTableModalHeader/index.js +4 -13
  58. package/lib/DTablePopover/index.js +11 -15
  59. package/lib/DTableRadio/index.js +10 -9
  60. package/lib/DTableRadioGroup/index.js +8 -17
  61. package/lib/DTableSearchInput/index.js +19 -29
  62. package/lib/DTableSelect/dtable-select-label.js +6 -5
  63. package/lib/DTableSelect/index.js +21 -22
  64. package/lib/DTableSelect/utils.js +7 -15
  65. package/lib/DTableSubDropdownMenu/index.js +8 -10
  66. package/lib/DTableSubDropdownToggle/index.js +12 -12
  67. package/lib/DTableSwitch/index.js +12 -11
  68. package/lib/DTableToolTip/index.js +7 -8
  69. package/lib/DateEditor/index.js +20 -15
  70. package/lib/DateEditor/mb-editor/index.js +18 -31
  71. package/lib/DateEditor/pc-editor.js +26 -45
  72. package/lib/DateFormatter/index.js +4 -5
  73. package/lib/DatePicker/index.js +9 -15
  74. package/lib/DatePicker/utils.js +1 -3
  75. package/lib/DeleteTip/index.js +5 -6
  76. package/lib/DepartmentMultipleSelectEditor/index.js +25 -23
  77. package/lib/DepartmentSelectFilter/index.js +6 -8
  78. package/lib/DepartmentSingleSelectEditor/index.js +1 -3
  79. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +48 -47
  80. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +36 -58
  81. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -19
  82. package/lib/DepartmentSingleSelectFormatter/index.js +4 -6
  83. package/lib/DigitalSignEditor/index.js +1 -3
  84. package/lib/DigitalSignEditor/mb-editor/index.js +12 -20
  85. package/lib/DigitalSignEditor/pc-editor/index.js +17 -24
  86. package/lib/DigitalSignEditor/service.js +2 -4
  87. package/lib/DigitalSignEditor/signature-board/index.js +5 -8
  88. package/lib/DigitalSignEditor/utils.js +2 -4
  89. package/lib/DigitalSignFormatter/index.js +12 -15
  90. package/lib/DigitalSignFormatter/utils.js +4 -5
  91. package/lib/DurationEditor/index.js +21 -31
  92. package/lib/DurationFormatter/index.js +4 -5
  93. package/lib/EditEditorButton/index.js +1 -3
  94. package/lib/EmailFormatter/index.js +3 -4
  95. package/lib/FieldDisplaySetting/field-item.js +12 -12
  96. package/lib/FieldDisplaySetting/index.js +11 -9
  97. package/lib/FileEditor/files-previewer/index.js +1 -3
  98. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +10 -18
  99. package/lib/FileEditor/files-previewer/mb-previewer/index.js +7 -8
  100. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +3 -4
  101. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +5 -6
  102. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +14 -21
  103. package/lib/FileEditor/files-previewer/pc-previewer/index.js +29 -57
  104. package/lib/FileEditor/index.js +1 -3
  105. package/lib/FileEditor/mb-editor/index.js +28 -20
  106. package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -3
  107. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +11 -25
  108. package/lib/FileEditor/pc-editor/index.js +19 -27
  109. package/lib/FileFormatter/index.js +26 -19
  110. package/lib/FileItemFormatter/index.js +6 -9
  111. package/lib/FileUploader/index.js +28 -45
  112. package/lib/FormulaFormatter/index.js +15 -29
  113. package/lib/GeolocationEditor/index.js +11 -12
  114. package/lib/GeolocationEditor/map-editor-utils.js +17 -15
  115. package/lib/GeolocationEditor/mb-editor/country-editor.js +17 -14
  116. package/lib/GeolocationEditor/mb-editor/index.js +4 -6
  117. package/lib/GeolocationEditor/mb-editor/location-editor.js +18 -15
  118. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +41 -68
  119. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +50 -89
  120. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +17 -14
  121. package/lib/GeolocationEditor/mb-editor/province-editor.js +17 -14
  122. package/lib/GeolocationEditor/pc-editor/country-editor.js +10 -23
  123. package/lib/GeolocationEditor/pc-editor/index.js +12 -20
  124. package/lib/GeolocationEditor/pc-editor/location-editor.js +26 -31
  125. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +34 -54
  126. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +36 -60
  127. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +35 -62
  128. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +36 -65
  129. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +19 -25
  130. package/lib/GeolocationEditor/pc-editor/province-editor.js +6 -13
  131. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +5 -6
  132. package/lib/GeolocationEditor/pc-editor/selector-list.js +6 -7
  133. package/lib/GeolocationFormatter/index.js +4 -5
  134. package/lib/HtmlLongTextFormatter/index.js +4 -12
  135. package/lib/Icon/index.js +3 -5
  136. package/lib/IconButton/index.js +4 -6
  137. package/lib/ImageEditor/images-previewer/image-preview/index.js +12 -21
  138. package/lib/ImageEditor/images-previewer/index.js +3 -9
  139. package/lib/ImageEditor/index.js +1 -3
  140. package/lib/ImageEditor/mb-editor/index.js +28 -20
  141. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +2 -6
  142. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +1 -3
  143. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +7 -21
  144. package/lib/ImageEditor/pc-editor/images-previewer/index.js +3 -9
  145. package/lib/ImageEditor/pc-editor/index.js +11 -16
  146. package/lib/ImageFormatter/images-lazy-load.js +19 -11
  147. package/lib/ImageFormatter/index.js +11 -13
  148. package/lib/ImagePreviewerLightbox/index.js +15 -13
  149. package/lib/ImageThumbnail/index.js +10 -13
  150. package/lib/InputItem/custom-input.js +26 -46
  151. package/lib/InputItem/custom-keyboard.js +15 -18
  152. package/lib/InputItem/index.js +34 -50
  153. package/lib/InputItem/input.js +2 -4
  154. package/lib/LastModifierFormatter/index.js +6 -8
  155. package/lib/LinkEditor/index.js +33 -53
  156. package/lib/LinkEditor/link-editor-option.js +3 -4
  157. package/lib/LinkEditor/mb-popover/index.js +9 -22
  158. package/lib/LinkEditor/pc-popover/index.js +5 -10
  159. package/lib/LinkFormatter/index.js +21 -37
  160. package/lib/List/index.js +6 -8
  161. package/lib/List/list-item.js +22 -28
  162. package/lib/LongTextFormatter/index.js +4 -5
  163. package/lib/MBEditorHeader/index.js +7 -8
  164. package/lib/MTimeFormatter/index.js +3 -4
  165. package/lib/MobileFullScreenPage/body/index.js +3 -5
  166. package/lib/MobileFullScreenPage/header/index.js +4 -6
  167. package/lib/MobileFullScreenPage/index.js +13 -11
  168. package/lib/MobileModal/index.js +1 -3
  169. package/lib/MobileOperationSheet/index.js +7 -8
  170. package/lib/MobileSelector/empty/index.js +1 -3
  171. package/lib/MobileSelector/index.js +5 -7
  172. package/lib/MobileSelector/option/index.js +3 -5
  173. package/lib/MobileSelector/options/index.js +1 -3
  174. package/lib/MobileSelector/search/index.js +3 -5
  175. package/lib/MobileUpload/index.js +4 -5
  176. package/lib/Modal/modal.js +14 -15
  177. package/lib/Modal/prompt.js +4 -4
  178. package/lib/MultipleSelectEditor/index.js +1 -3
  179. package/lib/MultipleSelectFormatter/index.js +6 -8
  180. package/lib/NotificationPopover/index.js +4 -5
  181. package/lib/NumberEditor/index.js +12 -21
  182. package/lib/NumberFormatter/index.js +4 -5
  183. package/lib/PhoneNumberLink/index.js +2 -4
  184. package/lib/Picker/AbstractPicker.js +23 -27
  185. package/lib/Popover/index.js +3 -4
  186. package/lib/Popover/item.js +7 -9
  187. package/lib/Progress/index.js +9 -8
  188. package/lib/Radio/Radio.js +4 -8
  189. package/lib/Radio/RadioItem.js +8 -12
  190. package/lib/RateFormatter/index.js +13 -13
  191. package/lib/RoleStatusEditor/index.js +18 -17
  192. package/lib/RowExpandDialog/body/index.js +32 -49
  193. package/lib/RowExpandDialog/column-content/index.js +5 -9
  194. package/lib/RowExpandDialog/header/index.js +6 -8
  195. package/lib/RowExpandDialog/index.js +49 -34
  196. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +4 -5
  197. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +8 -10
  198. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +22 -33
  199. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +26 -40
  200. package/lib/RowExpandEditor/date-editor/mb-editor.js +12 -18
  201. package/lib/RowExpandEditor/date-editor/pc-editor.js +15 -20
  202. package/lib/RowExpandEditor/department-editor/mb-editor.js +16 -11
  203. package/lib/RowExpandEditor/department-editor/pc-editor.js +19 -14
  204. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +20 -34
  205. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +21 -35
  206. package/lib/RowExpandEditor/duration-editor/mb-editor.js +10 -17
  207. package/lib/RowExpandEditor/duration-editor/pc-editor.js +13 -19
  208. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +9 -19
  209. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +13 -24
  210. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +18 -31
  211. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +16 -23
  212. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +17 -29
  213. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +13 -26
  214. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +15 -25
  215. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +13 -23
  216. package/lib/RowExpandEditor/index.js +4 -8
  217. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +17 -18
  218. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +10 -16
  219. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +16 -23
  220. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +11 -19
  221. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +22 -33
  222. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +8 -14
  223. package/lib/RowExpandEditor/number-editor/pc-editor.js +13 -20
  224. package/lib/RowExpandEditor/rate-editor/mb-editor.js +12 -25
  225. package/lib/RowExpandEditor/rate-editor/pc-editor.js +20 -36
  226. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +17 -28
  227. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +22 -34
  228. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +4 -5
  229. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +15 -26
  230. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +5 -13
  231. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +9 -18
  232. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -4
  233. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +2 -4
  234. package/lib/RowExpandFormatter/email-formatter/index.js +4 -7
  235. package/lib/RowExpandFormatter/file-formatter/index.js +8 -9
  236. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +10 -12
  237. package/lib/RowExpandFormatter/formula-formatter/index.js +19 -34
  238. package/lib/RowExpandFormatter/image-formatter/index.js +9 -11
  239. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +7 -8
  240. package/lib/RowExpandFormatter/index.js +27 -41
  241. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +8 -14
  242. package/lib/RowExpandFormatter/link-formatter/index.js +11 -19
  243. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +3 -5
  244. package/lib/RowExpandFormatter/rate-formatter/index.js +11 -12
  245. package/lib/RowExpandFormatter/text/index.js +4 -5
  246. package/lib/RowExpandFormatter/url-formatter/index.js +4 -7
  247. package/lib/RowExpandView/body/index.js +22 -35
  248. package/lib/RowExpandView/column-content/index.js +3 -7
  249. package/lib/RowExpandView/index.js +42 -30
  250. package/lib/SelectItem/index.js +5 -7
  251. package/lib/SelectOptionGroup/index.js +30 -40
  252. package/lib/SelectedDepartments/index.js +7 -9
  253. package/lib/SimpleLongTextFormatter/index.js +10 -16
  254. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +3 -4
  255. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +12 -21
  256. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -4
  257. package/lib/SingleSelectEditor/index.js +1 -3
  258. package/lib/SingleSelectFormatter/index.js +8 -9
  259. package/lib/TabBar/Tab.js +14 -16
  260. package/lib/TabBar/index.js +18 -21
  261. package/lib/Tabs/index.js +1 -3
  262. package/lib/TextEditor/index.js +14 -23
  263. package/lib/TextFormatter/index.js +3 -4
  264. package/lib/TextareaItem/index.js +19 -26
  265. package/lib/Toast/index.js +3 -4
  266. package/lib/UrlFormatter/index.js +3 -4
  267. package/lib/common/editor-base.js +7 -12
  268. package/lib/hooks/common-hooks.js +2 -4
  269. package/lib/select-editor/index.js +1 -3
  270. package/lib/select-editor/mb-editor/index.js +17 -28
  271. package/lib/select-editor/pc-editor/index.js +27 -42
  272. package/lib/toaster/alert.js +6 -7
  273. package/lib/toaster/toast.js +2 -3
  274. package/lib/toaster/toastManager.js +2 -4
  275. package/lib/utils/cell.js +8 -11
  276. package/lib/utils/column-utils.js +8 -14
  277. package/lib/utils/departments.js +1 -3
  278. package/lib/utils/url.js +24 -31
  279. package/lib/utils/utils.js +2 -6
  280. package/package.json +1 -1
  281. package/lib/DTableModalHeader/index.css +0 -5
@@ -31,12 +31,11 @@ class FileNameEditor extends _react.Component {
31
31
  }
32
32
  };
33
33
  this.onSave = () => {
34
- const {
35
- renameFile,
36
- name,
37
- closeRenameFile,
38
- itemIndex
39
- } = this.props;
34
+ const _this$props = this.props,
35
+ renameFile = _this$props.renameFile,
36
+ name = _this$props.name,
37
+ closeRenameFile = _this$props.closeRenameFile,
38
+ itemIndex = _this$props.itemIndex;
40
39
  let newName = this.state.fileName.trim();
41
40
  if (newName === name || newName === '') {
42
41
  closeRenameFile();
@@ -33,9 +33,7 @@ class FilePreviewer extends _react.default.Component {
33
33
  }
34
34
  };
35
35
  this.handleFileClick = () => {
36
- let {
37
- fileItem
38
- } = this.props;
36
+ let fileItem = this.props.fileItem;
39
37
  let openFileUrl = fileItem.url;
40
38
  let assetFileIndex = openFileUrl.indexOf('/asset');
41
39
  if (assetFileIndex > -1 && (0, _url.imageCheck)(fileItem.name)) {
@@ -49,9 +47,7 @@ class FilePreviewer extends _react.default.Component {
49
47
  this.props.downloadFile(downloadUrl);
50
48
  };
51
49
  this.onSelectFile = () => {
52
- const {
53
- fileItem
54
- } = this.props;
50
+ const fileItem = this.props.fileItem;
55
51
  this.props.onSelectFiles(fileItem.name);
56
52
  };
57
53
  this.closeRenameFile = () => {
@@ -81,21 +77,18 @@ class FilePreviewer extends _react.default.Component {
81
77
  };
82
78
  }
83
79
  render() {
84
- const {
85
- fileItem,
86
- isItemFreezed,
87
- isSelectMultipleFiles,
88
- isSelected,
89
- config
90
- } = this.props;
91
- const {
92
- isShowRename,
93
- isShowOperation,
94
- highlight
95
- } = this.state;
96
- const {
97
- fileIconUrl
98
- } = (0, _url.getFileThumbnailInfo)(fileItem, config);
80
+ const _this$props = this.props,
81
+ fileItem = _this$props.fileItem,
82
+ isItemFreezed = _this$props.isItemFreezed,
83
+ isSelectMultipleFiles = _this$props.isSelectMultipleFiles,
84
+ isSelected = _this$props.isSelected,
85
+ config = _this$props.config;
86
+ const _this$state = this.state,
87
+ isShowRename = _this$state.isShowRename,
88
+ isShowOperation = _this$state.isShowOperation,
89
+ highlight = _this$state.highlight;
90
+ const _getFileThumbnailInfo = (0, _url.getFileThumbnailInfo)(fileItem, config),
91
+ fileIconUrl = _getFileThumbnailInfo.fileIconUrl;
99
92
  const errorMessage = '';
100
93
  const uploadTime = (0, _utils.getFileUploadTime)(fileItem);
101
94
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -5,6 +5,7 @@ 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"));
8
9
  var _react = _interopRequireDefault(require("react"));
9
10
  var _url = require("../../../utils/url");
10
11
  var _utils = require("../../../utils/utils");
@@ -23,26 +24,20 @@ class PCFilesPreviewer extends _react.default.Component {
23
24
  });
24
25
  };
25
26
  this.showLargeImage = itemUrl => {
26
- let {
27
- fileImageUrlList
28
- } = this.state;
27
+ let fileImageUrlList = this.state.fileImageUrlList;
29
28
  this.setState({
30
29
  isShowLargeImage: true,
31
30
  largeImageIndex: fileImageUrlList.indexOf(itemUrl)
32
31
  });
33
32
  };
34
33
  this.moveNext = () => {
35
- let {
36
- fileImageUrlList
37
- } = this.state;
34
+ let fileImageUrlList = this.state.fileImageUrlList;
38
35
  this.setState(prevState => ({
39
36
  largeImageIndex: (prevState.largeImageIndex + 1) % fileImageUrlList.length
40
37
  }));
41
38
  };
42
39
  this.movePrev = () => {
43
- let {
44
- fileImageUrlList
45
- } = this.state;
40
+ let fileImageUrlList = this.state.fileImageUrlList;
46
41
  this.setState(prevState => ({
47
42
  largeImageIndex: (prevState.largeImageIndex + fileImageUrlList.length - 1) % fileImageUrlList.length
48
43
  }));
@@ -54,30 +49,23 @@ class PCFilesPreviewer extends _react.default.Component {
54
49
  });
55
50
  };
56
51
  this.downloadImage = imageItemUrl => {
57
- const {
58
- value
59
- } = this.props;
52
+ const value = this.props.value;
60
53
  const file = value.find(v => v.url === imageItemUrl);
61
54
  if (!file) return;
62
55
  this.props.getDownLoadFiles([file], _ref => {
63
- let [dFile] = _ref;
56
+ let _ref2 = (0, _slicedToArray2.default)(_ref, 1),
57
+ dFile = _ref2[0];
64
58
  dFile && (0, _utils.downloadFile)(dFile);
65
59
  });
66
60
  };
67
61
  this.onRotateImage = (imageIndex, degree) => {
68
- let {
69
- fileImageUrlList
70
- } = this.state;
62
+ let fileImageUrlList = this.state.fileImageUrlList;
71
63
  const imageUrl = fileImageUrlList[imageIndex];
72
64
  this.props.onRotateImage && this.props.onRotateImage(imageUrl, degree);
73
65
  };
74
66
  this.deleteImage = (index, type) => {
75
- const {
76
- value
77
- } = this.props;
78
- let {
79
- fileImageUrlList
80
- } = this.state;
67
+ const value = this.props.value;
68
+ let fileImageUrlList = this.state.fileImageUrlList;
81
69
  const imageUrl = fileImageUrlList[index];
82
70
  let fileItemIndex = value.findIndex(fileItem => fileItem.url === imageUrl);
83
71
  this.props.deleteFile(fileItemIndex, type);
@@ -106,9 +94,7 @@ class PCFilesPreviewer extends _react.default.Component {
106
94
  });
107
95
  };
108
96
  this.onSelectFiles = name => {
109
- const {
110
- selectedFilesList
111
- } = this.state;
97
+ const selectedFilesList = this.state.selectedFilesList;
112
98
  let filesList = selectedFilesList.slice(0);
113
99
  const selectedFileIndex = selectedFilesList.indexOf(name);
114
100
  if (selectedFileIndex > -1) {
@@ -121,12 +107,8 @@ class PCFilesPreviewer extends _react.default.Component {
121
107
  });
122
108
  };
123
109
  this.onSelectAllFiles = () => {
124
- const {
125
- value
126
- } = this.props;
127
- const {
128
- selectedFilesList
129
- } = this.state;
110
+ const value = this.props.value;
111
+ const selectedFilesList = this.state.selectedFilesList;
130
112
  if (value.length === 0) return;
131
113
  let allFilesList = selectedFilesList.slice(0);
132
114
  value.map(item => {
@@ -146,12 +128,8 @@ class PCFilesPreviewer extends _react.default.Component {
146
128
  });
147
129
  };
148
130
  this.onDownloadAllSelectedFiles = () => {
149
- const {
150
- config
151
- } = this.props;
152
- const {
153
- selectedFilesList
154
- } = this.state;
131
+ const config = this.props.config;
132
+ const selectedFilesList = this.state.selectedFilesList;
155
133
  if (selectedFilesList.length === 0) return;
156
134
  this.props.getDownLoadFiles(selectedFilesList, downloadFilesUrlList => {
157
135
  if (downloadFilesUrlList.length > 0) {
@@ -161,22 +139,18 @@ class PCFilesPreviewer extends _react.default.Component {
161
139
  });
162
140
  };
163
141
  this.onDeleteAllSelectedFiles = () => {
164
- const {
165
- selectedFilesList
166
- } = this.state;
142
+ const selectedFilesList = this.state.selectedFilesList;
167
143
  this.props.deleteFiles(selectedFilesList);
168
144
  this.onChangeSelectMultipleFiles(false);
169
145
  };
170
146
  this.renderFilesOperation = () => {
171
- const {
172
- value,
173
- deleteFiles,
174
- getDownLoadFiles
175
- } = this.props;
176
- const {
177
- isSelectMultipleFiles,
178
- selectedFilesList
179
- } = this.state;
147
+ const _this$props = this.props,
148
+ value = _this$props.value,
149
+ deleteFiles = _this$props.deleteFiles,
150
+ getDownLoadFiles = _this$props.getDownLoadFiles;
151
+ const _this$state = this.state,
152
+ isSelectMultipleFiles = _this$state.isSelectMultipleFiles,
153
+ selectedFilesList = _this$state.selectedFilesList;
180
154
  if (value.length === 0) return null;
181
155
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
182
156
  className: "dtable-ui-file-editor-operation-content",
@@ -225,14 +199,12 @@ class PCFilesPreviewer extends _react.default.Component {
225
199
  }
226
200
  }
227
201
  render() {
228
- let {
229
- value,
230
- getDownLoadFiles
231
- } = this.props;
232
- const {
233
- isSelectMultipleFiles,
234
- selectedFilesList
235
- } = this.state;
202
+ let _this$props2 = this.props,
203
+ value = _this$props2.value,
204
+ getDownLoadFiles = _this$props2.getDownLoadFiles;
205
+ const _this$state2 = this.state,
206
+ isSelectMultipleFiles = _this$state2.isSelectMultipleFiles,
207
+ selectedFilesList = _this$state2.selectedFilesList;
236
208
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
237
209
  className: "dtable-ui-file-editor-previewer",
238
210
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -16,9 +16,7 @@ require("./index.css");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
  const _excluded = ["isMobile"];
18
18
  const FileEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
19
- let {
20
- isMobile
21
- } = _ref,
19
+ let isMobile = _ref.isMobile,
22
20
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
23
21
  if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
24
22
  ref: ref
@@ -1,11 +1,12 @@
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 = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
9
10
  var _react = _interopRequireWildcard(require("react"));
10
11
  var _ActivityIndicator = _interopRequireDefault(require("../../ActivityIndicator"));
11
12
  var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
@@ -16,28 +17,35 @@ var _utils = require("../../utils/utils");
16
17
  var _lang = require("../../lang");
17
18
  require("./index.css");
18
19
  var _jsxRuntime = require("react/jsx-runtime");
19
- const {
20
- Header,
21
- Body
22
- } = _MobileFullScreenPage.default;
20
+ const Header = _MobileFullScreenPage.default.Header,
21
+ Body = _MobileFullScreenPage.default.Body;
23
22
  const MBFileEditor = _ref => {
24
- let {
25
- value: oldValue,
26
- column,
27
- config,
28
- onToggle,
29
- onCommit,
30
- uploadFile
31
- } = _ref;
32
- const [value, setValue] = (0, _react.useState)(oldValue || []);
33
- const [isShowEditor, setShowEditor] = (0, _react.useState)(false);
34
- const [uploadLocalFiles, setUploadLocalFiles] = (0, _react.useState)([]);
35
- const [isUploading, setUploading] = (0, _react.useState)(false);
23
+ let oldValue = _ref.value,
24
+ column = _ref.column,
25
+ config = _ref.config,
26
+ onToggle = _ref.onToggle,
27
+ onCommit = _ref.onCommit,
28
+ uploadFile = _ref.uploadFile;
29
+ const _useState = (0, _react.useState)(oldValue || []),
30
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
31
+ value = _useState2[0],
32
+ setValue = _useState2[1];
33
+ const _useState3 = (0, _react.useState)(false),
34
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
35
+ isShowEditor = _useState4[0],
36
+ setShowEditor = _useState4[1];
37
+ const _useState5 = (0, _react.useState)([]),
38
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
39
+ uploadLocalFiles = _useState6[0],
40
+ setUploadLocalFiles = _useState6[1];
41
+ const _useState7 = (0, _react.useState)(false),
42
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
43
+ isUploading = _useState8[0],
44
+ setUploading = _useState8[1];
36
45
  const uploadingFilesCount = (0, _react.useRef)(0);
37
46
  const uploadedFilesCount = (0, _react.useRef)(0);
38
- const {
39
- mediaUrl
40
- } = config || {};
47
+ const _ref2 = config || {},
48
+ mediaUrl = _ref2.mediaUrl;
41
49
  const resetFileValue = (0, _react.useCallback)(() => {
42
50
  setUploadLocalFiles([]);
43
51
  }, []);
@@ -25,9 +25,7 @@ class AdditionPreviewer extends _react.default.Component {
25
25
  };
26
26
  }
27
27
  render() {
28
- let {
29
- activeTab
30
- } = this.state;
28
+ let activeTab = this.state.activeTab;
31
29
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
32
30
  className: "dtable-ui-image-addition-container",
33
31
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -36,9 +36,7 @@ class LocalFileAddition extends _react.default.Component {
36
36
  };
37
37
  this.onFileUploadSuccess = fileMessage => {
38
38
  this.hideDeleteIcon();
39
- let {
40
- thumbnailSrcList
41
- } = this.state;
39
+ let thumbnailSrcList = this.state.thumbnailSrcList;
42
40
  const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
43
41
  thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
44
42
  if (thumbnailSrcList.every(fileItem => !fileItem.isUploading)) {
@@ -49,9 +47,7 @@ class LocalFileAddition extends _react.default.Component {
49
47
  this.props.fileUploadCompleted(fileMessage);
50
48
  };
51
49
  this.onFileUploadProgress = fileMessage => {
52
- let {
53
- thumbnailSrcList
54
- } = this.state;
50
+ let thumbnailSrcList = this.state.thumbnailSrcList;
55
51
  const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
56
52
  thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
57
53
  this.setState({
@@ -59,9 +55,7 @@ class LocalFileAddition extends _react.default.Component {
59
55
  });
60
56
  };
61
57
  this.onFileUploadFailed = fileMessage => {
62
- let {
63
- thumbnailSrcList
64
- } = this.state;
58
+ let thumbnailSrcList = this.state.thumbnailSrcList;
65
59
  const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
66
60
  thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
67
61
  this.setState({
@@ -69,9 +63,7 @@ class LocalFileAddition extends _react.default.Component {
69
63
  });
70
64
  };
71
65
  this.findUploadFileIndex = uploadFileMessage => {
72
- let {
73
- thumbnailSrcList
74
- } = this.state;
66
+ let thumbnailSrcList = this.state.thumbnailSrcList;
75
67
  let uploadFileIndex = thumbnailSrcList.findIndex(item => item.name === uploadFileMessage.file.name);
76
68
  return uploadFileIndex;
77
69
  };
@@ -105,9 +97,7 @@ class LocalFileAddition extends _react.default.Component {
105
97
  });
106
98
  };
107
99
  this.renderMultipleFilesArr = () => {
108
- let {
109
- thumbnailSrcList
110
- } = this.state;
100
+ let thumbnailSrcList = this.state.thumbnailSrcList;
111
101
  let fileArr = [];
112
102
  if (Array.isArray(this.props.uploadLocalFileValue)) {
113
103
  let uploadedFileList = this.renderUploadedFile();
@@ -163,15 +153,13 @@ class LocalFileAddition extends _react.default.Component {
163
153
  return fileArr;
164
154
  };
165
155
  this.renderUploadedFile = () => {
166
- const {
167
- config,
168
- uploadLocalFileValue
169
- } = this.props;
156
+ const _this$props = this.props,
157
+ config = _this$props.config,
158
+ uploadLocalFileValue = _this$props.uploadLocalFileValue;
170
159
  let uploadedFileList = [];
171
160
  uploadedFileList = uploadLocalFileValue.length > 0 && uploadLocalFileValue.map((fileItem, index) => {
172
- let {
173
- fileIconUrl
174
- } = (0, _url.getFileThumbnailInfo)(fileItem, config);
161
+ let _getFileThumbnailInfo = (0, _url.getFileThumbnailInfo)(fileItem, config),
162
+ fileIconUrl = _getFileThumbnailInfo.fileIconUrl;
175
163
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
176
164
  className: "dtable-ui-image-wrapper",
177
165
  id: "file-content-tip-".concat(index),
@@ -203,9 +191,7 @@ class LocalFileAddition extends _react.default.Component {
203
191
  return uploadedFileList;
204
192
  };
205
193
  this.renderUploadFileWrapper = fileArr => {
206
- let {
207
- isFileTipShow
208
- } = this.state;
194
+ let isFileTipShow = this.state.isFileTipShow;
209
195
  let editorContent = fileArr.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
210
196
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
211
197
  className: "dtable-ui-image-tip-addition ".concat(isFileTipShow ? 'dtable-ui-image-drop-active' : ''),
@@ -27,10 +27,9 @@ class PCFileEditor extends _react.default.Component {
27
27
  return this.state.value;
28
28
  };
29
29
  this.getEditorView = () => {
30
- const {
31
- isInModal,
32
- value
33
- } = this.props;
30
+ const _this$props = this.props,
31
+ isInModal = _this$props.isInModal,
32
+ value = _this$props.value;
34
33
  return !value || value.length === 0 || isInModal ? _constants.FILE_EDITOR_STATUS.ADDITION : _constants.FILE_EDITOR_STATUS.PREVIEWER;
35
34
  };
36
35
  this.deleteImage = function (index) {
@@ -60,10 +59,9 @@ class PCFileEditor extends _react.default.Component {
60
59
  e.stopPropagation();
61
60
  if (this.state.isOpen && this.state.isUpdated) {
62
61
  if (this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION) {
63
- let {
64
- value,
65
- uploadLocalFileValue
66
- } = this.state;
62
+ let _this$state = this.state,
63
+ value = _this$state.value,
64
+ uploadLocalFileValue = _this$state.uploadLocalFileValue;
67
65
  let newValue = value.concat(uploadLocalFileValue);
68
66
  this.setState({
69
67
  value: newValue
@@ -113,13 +111,11 @@ class PCFileEditor extends _react.default.Component {
113
111
  };
114
112
  this.addUploadedFile = fileMessageList => {
115
113
  const uploadLocalFileValue = [...this.state.uploadLocalFileValue, ...fileMessageList.map(_ref => {
116
- let {
117
- name,
118
- size,
119
- type,
120
- url,
121
- mtime
122
- } = _ref;
114
+ let name = _ref.name,
115
+ size = _ref.size,
116
+ type = _ref.type,
117
+ url = _ref.url,
118
+ mtime = _ref.mtime;
123
119
  return {
124
120
  name,
125
121
  size,
@@ -134,9 +130,7 @@ class PCFileEditor extends _react.default.Component {
134
130
  });
135
131
  };
136
132
  this.renderHeader = () => {
137
- let {
138
- editorView
139
- } = this.state;
133
+ let editorView = this.state.editorView;
140
134
  // if (this.props.isInModal) {
141
135
  // return (<span>{getLocale('Add_files')}</span>);
142
136
  // }
@@ -156,11 +150,10 @@ class PCFileEditor extends _react.default.Component {
156
150
  });
157
151
  };
158
152
  this.showImageListPreviewer = () => {
159
- let {
160
- value,
161
- uploadLocalFileValue,
162
- imageLinkValue
163
- } = this.state;
153
+ let _this$state2 = this.state,
154
+ value = _this$state2.value,
155
+ uploadLocalFileValue = _this$state2.uploadLocalFileValue,
156
+ imageLinkValue = _this$state2.imageLinkValue;
164
157
  let newValue = value.concat(uploadLocalFileValue, imageLinkValue);
165
158
  this.setState({
166
159
  value: newValue
@@ -203,10 +196,9 @@ class PCFileEditor extends _react.default.Component {
203
196
  let fileItem = newValue[index];
204
197
  if (!this.props.renameFile) return;
205
198
  this.props.renameFile(fileItem, newName).then(res => {
206
- const {
207
- name,
208
- url
209
- } = res.data;
199
+ const _res$data = res.data,
200
+ name = _res$data.name,
201
+ url = _res$data.url;
210
202
  fileItem = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, fileItem), {}, {
211
203
  name,
212
204
  url
@@ -1,11 +1,12 @@
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 = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
9
10
  var _react = _interopRequireWildcard(require("react"));
10
11
  var _classnames = _interopRequireDefault(require("classnames"));
11
12
  var _FileItemFormatter = _interopRequireDefault(require("../FileItemFormatter"));
@@ -14,27 +15,33 @@ var _url = require("../utils/url");
14
15
  require("./index.css");
15
16
  var _jsxRuntime = require("react/jsx-runtime");
16
17
  const FileFormatter = _ref => {
17
- let {
18
- isSample = false,
19
- value = [],
20
- containerClassName = '',
21
- renderItem,
22
- isSupportOpenFile = false,
23
- onOpenFile,
24
- server,
25
- workspaceID,
26
- dtableUuid,
27
- downloadImage
28
- } = _ref;
29
- const [largeImageIndex, setLargeImageIndex] = (0, _react.useState)(-1);
30
- const [fileImageUrlList, setFileImageUrlList] = (0, _react.useState)([]);
18
+ let _ref$isSample = _ref.isSample,
19
+ isSample = _ref$isSample === void 0 ? false : _ref$isSample,
20
+ _ref$value = _ref.value,
21
+ value = _ref$value === void 0 ? [] : _ref$value,
22
+ _ref$containerClassNa = _ref.containerClassName,
23
+ containerClassName = _ref$containerClassNa === void 0 ? '' : _ref$containerClassNa,
24
+ renderItem = _ref.renderItem,
25
+ _ref$isSupportOpenFil = _ref.isSupportOpenFile,
26
+ isSupportOpenFile = _ref$isSupportOpenFil === void 0 ? false : _ref$isSupportOpenFil,
27
+ onOpenFile = _ref.onOpenFile,
28
+ server = _ref.server,
29
+ workspaceID = _ref.workspaceID,
30
+ dtableUuid = _ref.dtableUuid,
31
+ downloadImage = _ref.downloadImage;
32
+ const _useState = (0, _react.useState)(-1),
33
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
34
+ largeImageIndex = _useState2[0],
35
+ setLargeImageIndex = _useState2[1];
36
+ const _useState3 = (0, _react.useState)([]),
37
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
38
+ fileImageUrlList = _useState4[0],
39
+ setFileImageUrlList = _useState4[1];
31
40
  const getFileItemImageUrlList = (0, _react.useCallback)(value => {
32
41
  let newFileImageUrlList = [];
33
42
  value.forEach(fileItem => {
34
- const {
35
- url,
36
- name
37
- } = fileItem;
43
+ const url = fileItem.url,
44
+ name = fileItem.name;
38
45
  let assetFileIndex = typeof url === 'string' ? url.indexOf('/asset') : -1;
39
46
  if (assetFileIndex > -1) {
40
47
  const isImage = (0, _url.imageCheck)(name);
@@ -9,15 +9,12 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _url = require("../utils/url");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  const FileItemFormatter = _ref => {
12
- let {
13
- file,
14
- config,
15
- openFile
16
- } = _ref;
17
- const {
18
- fileIconUrl,
19
- isImage
20
- } = (0, _url.getFileThumbnailInfo)(file, config);
12
+ let file = _ref.file,
13
+ config = _ref.config,
14
+ openFile = _ref.openFile;
15
+ const _getFileThumbnailInfo = (0, _url.getFileThumbnailInfo)(file, config),
16
+ fileIconUrl = _getFileThumbnailInfo.fileIconUrl,
17
+ isImage = _getFileThumbnailInfo.isImage;
21
18
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
22
19
  onClick: () => openFile && openFile(file),
23
20
  className: "file-item-icon ".concat(isImage ? 'img' : ''),