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
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _classnames = _interopRequireDefault(require("classnames"));
11
10
  var _reactstrap = require("reactstrap");
@@ -38,7 +37,9 @@ class PCSelectEditor extends _react.default.Component {
38
37
  this.onEnter = e => {
39
38
  e.preventDefault();
40
39
  let option;
41
- const isSupportNewOption = this.props.isSupportNewOption;
40
+ const {
41
+ isSupportNewOption
42
+ } = this.props;
42
43
  if (this.filteredOptions.length === 1) {
43
44
  option = this.filteredOptions[0];
44
45
  } else if (this.state.highlightIndex > -1) {
@@ -47,7 +48,9 @@ class PCSelectEditor extends _react.default.Component {
47
48
  if (option) {
48
49
  this.onChange(option);
49
50
  } else {
50
- const searchValue = this.state.searchValue;
51
+ const {
52
+ searchValue
53
+ } = this.state;
51
54
  if (searchValue && isSupportNewOption && this.filteredOptions.length === 0) {
52
55
  e.stopPropagation();
53
56
  this.onAddNewOption();
@@ -57,10 +60,11 @@ class PCSelectEditor extends _react.default.Component {
57
60
  this.onUpArrow = e => {
58
61
  e.preventDefault();
59
62
  e.stopPropagation();
60
- let _this$state = this.state,
61
- highlightIndex = _this$state.highlightIndex,
62
- maxItemNum = _this$state.maxItemNum,
63
- itemHeight = _this$state.itemHeight;
63
+ let {
64
+ highlightIndex,
65
+ maxItemNum,
66
+ itemHeight
67
+ } = this.state;
64
68
  if (highlightIndex > 0) {
65
69
  this.setState({
66
70
  highlightIndex: highlightIndex - 1
@@ -74,10 +78,11 @@ class PCSelectEditor extends _react.default.Component {
74
78
  this.onDownArrow = e => {
75
79
  e.preventDefault();
76
80
  e.stopPropagation();
77
- let _this$state2 = this.state,
78
- highlightIndex = _this$state2.highlightIndex,
79
- maxItemNum = _this$state2.maxItemNum,
80
- itemHeight = _this$state2.itemHeight;
81
+ let {
82
+ highlightIndex,
83
+ maxItemNum,
84
+ itemHeight
85
+ } = this.state;
81
86
  if (highlightIndex < this.filteredOptions.length - 1) {
82
87
  this.setState({
83
88
  highlightIndex: highlightIndex + 1
@@ -89,8 +94,12 @@ class PCSelectEditor extends _react.default.Component {
89
94
  }
90
95
  };
91
96
  this.onValueChanged = searchValue => {
92
- const oldSearchVal = this.state.searchValue;
93
- const options = this.props.options;
97
+ const {
98
+ searchValue: oldSearchVal
99
+ } = this.state;
100
+ const {
101
+ options
102
+ } = this.props;
94
103
  if (oldSearchVal === searchValue) return;
95
104
  this.setState({
96
105
  searchValue
@@ -123,7 +132,9 @@ class PCSelectEditor extends _react.default.Component {
123
132
  }, 300);
124
133
  };
125
134
  this.getOptionStyle = option => {
126
- const optionWidth = this.props.optionWidth;
135
+ const {
136
+ optionWidth
137
+ } = this.props;
127
138
  const textColor = option.textColor || null;
128
139
  return {
129
140
  display: 'inline-block',
@@ -167,8 +178,9 @@ class PCSelectEditor extends _react.default.Component {
167
178
  this.ref.style.top = '-200px';
168
179
  }
169
180
  }
170
- const _this$ref$getBounding = this.ref.getBoundingClientRect(),
171
- bottom = _this$ref$getBounding.bottom;
181
+ const {
182
+ bottom
183
+ } = this.ref.getBoundingClientRect();
172
184
  if (bottom > window.innerHeight) {
173
185
  this.ref.style.top = parseInt(this.ref.style.top) - bottom + window.innerHeight + 'px';
174
186
  }
@@ -188,18 +200,20 @@ class PCSelectEditor extends _react.default.Component {
188
200
  }
189
201
  }
190
202
  render() {
191
- const _this$props = this.props,
192
- isInModal = _this$props.isInModal,
193
- className = _this$props.className,
194
- value = _this$props.value,
195
- column = _this$props.column,
196
- valueKey = _this$props.valueKey,
197
- isSupportNewOption = _this$props.isSupportNewOption,
198
- target = _this$props.target,
199
- classNamePrefix = _this$props.classNamePrefix;
200
- const _this$state3 = this.state,
201
- searchValue = _this$state3.searchValue,
202
- highlightIndex = _this$state3.highlightIndex;
203
+ const {
204
+ isInModal,
205
+ className,
206
+ value,
207
+ column,
208
+ valueKey,
209
+ isSupportNewOption,
210
+ target,
211
+ classNamePrefix
212
+ } = this.props;
213
+ const {
214
+ searchValue,
215
+ highlightIndex
216
+ } = this.state;
203
217
 
204
218
  // maxWidth = single-selects-container's width - single-selects-container's padding-left and padding-right - single-select-container's padding-left - single-select-check-icon's width - The gap between the single-select-check-icon and single-select-name or scroll's width
205
219
  // maxWidth = column.width > 200 ? column.width - 20 - 12 - 20 - 10 : 200 - 20 - 12 - 20 - 10
@@ -207,7 +221,7 @@ class PCSelectEditor extends _react.default.Component {
207
221
  let maxWidth = isInModal ? 250 : (column === null || column === void 0 ? void 0 : column.width) > 200 ? column.width - 62 : 138;
208
222
  const dom = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
209
223
  className: (0, _classnames.default)('dtable-ui-editor-container dtable-ui-select-editor-container', className, {
210
- ["".concat(classNamePrefix, "-select-editor-container")]: classNamePrefix
224
+ [`${classNamePrefix}-select-editor-container`]: classNamePrefix
211
225
  }),
212
226
  ref: ref => this.ref = ref,
213
227
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -223,9 +237,10 @@ class PCSelectEditor extends _react.default.Component {
223
237
  ref: ref => this.container = ref,
224
238
  children: [this.filteredOptions.length > 0 && this.filteredOptions.map((option, index) => {
225
239
  let optionStyle = this.getOptionStyle(option);
226
- optionStyle = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, optionStyle), {}, {
240
+ optionStyle = {
241
+ ...optionStyle,
227
242
  maxWidth
228
- });
243
+ };
229
244
  let isSelected = value.includes(option[valueKey]);
230
245
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
231
246
  className: "select-option-item",
@@ -277,7 +292,7 @@ class PCSelectEditor extends _react.default.Component {
277
292
  hideArrow: true,
278
293
  fade: false,
279
294
  className: (0, _classnames.default)('dtable-ui dtable-ui-row-expand-select-editor-popover', {
280
- ["".concat(classNamePrefix, "-select-editor-popover")]: classNamePrefix
295
+ [`${classNamePrefix}-select-editor-popover`]: classNamePrefix
281
296
  }),
282
297
  children: dom
283
298
  })
@@ -23,15 +23,16 @@ class Alert extends _react.default.PureComponent {
23
23
  }
24
24
  }
25
25
  render() {
26
- const _this$props = this.props,
27
- intent = _this$props.intent,
28
- title = _this$props.title,
29
- children = _this$props.children,
30
- isRemovable = _this$props.isRemovable,
31
- onRemove = _this$props.onRemove;
26
+ const {
27
+ intent,
28
+ title,
29
+ children,
30
+ isRemovable,
31
+ onRemove
32
+ } = this.props;
32
33
  const iconClass = this.getIconClass(intent);
33
34
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
34
- className: "dtable-toast-alert-container ".concat(intent || 'success'),
35
+ className: `dtable-toast-alert-container ${intent || 'success'}`,
35
36
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
36
37
  className: "toast-alert-icon",
37
38
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
@@ -52,8 +52,9 @@ class Toast extends _react.default.PureComponent {
52
52
  this.onRef = ref => {
53
53
  if (ref === null) return;
54
54
  setTimeout(() => {
55
- const _ref$getBoundingClien = ref.getBoundingClientRect(),
56
- height = _ref$getBoundingClien.height;
55
+ const {
56
+ height
57
+ } = ref.getBoundingClientRect();
57
58
  this.containerRef.current.style.height = height + 'px';
58
59
  }, 1);
59
60
  };
@@ -83,7 +84,7 @@ class Toast extends _react.default.PureComponent {
83
84
  onExited: this.props.onRemove,
84
85
  children: state => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
85
86
  "data-state": state,
86
- className: "dtable-toast-container ".concat(state),
87
+ className: `dtable-toast-container ${state}`,
87
88
  onMouseEnter: this.handleMouseEnter,
88
89
  onMouseLeave: this.handleMouseLeave,
89
90
  style: {
@@ -5,12 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
9
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
8
  var _react = _interopRequireDefault(require("react"));
11
9
  var _toast = _interopRequireDefault(require("./toast"));
12
10
  var _jsxRuntime = require("react/jsx-runtime");
13
- const _excluded = ["id", "description"];
14
11
  const hasCustomId = settings => Object.hasOwnProperty.call(settings, 'id');
15
12
  class ToastManager extends _react.default.PureComponent {
16
13
  constructor(props, context) {
@@ -42,7 +39,7 @@ class ToastManager extends _react.default.PureComponent {
42
39
  };
43
40
  this.createToastInstance = (title, settings) => {
44
41
  const uniqueId = ++ToastManager.idCounter;
45
- const id = hasCustomId(settings) ? "".concat(settings.id, "-").concat(uniqueId) : uniqueId;
42
+ const id = hasCustomId(settings) ? `${settings.id}-${uniqueId}` : uniqueId;
46
43
  let hasCloseButton = settings.hasCloseButton || true;
47
44
  let duration = settings.duration || 2;
48
45
  if (settings.hasCloseButton !== undefined) {
@@ -70,9 +67,10 @@ class ToastManager extends _react.default.PureComponent {
70
67
  return {
71
68
  toasts: previousState.toasts.map(toast => {
72
69
  if (toast.id === id) {
73
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, toast), {}, {
70
+ return {
71
+ ...toast,
74
72
  isShown: false
75
- });
73
+ };
76
74
  }
77
75
  return toast;
78
76
  })
@@ -97,14 +95,16 @@ class ToastManager extends _react.default.PureComponent {
97
95
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
98
96
  className: "dtable-toast-manager",
99
97
  children: this.state.toasts.map(_ref => {
100
- let id = _ref.id,
101
- description = _ref.description,
102
- props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
103
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_toast.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
104
- onRemove: () => this.removeToast(id)
105
- }, props), {}, {
98
+ let {
99
+ id,
100
+ description,
101
+ ...props
102
+ } = _ref;
103
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_toast.default, {
104
+ onRemove: () => this.removeToast(id),
105
+ ...props,
106
106
  children: description
107
- }), id);
107
+ }, id);
108
108
  })
109
109
  });
110
110
  }
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _client = require("react-dom/client");
11
10
  var _toastManager = _interopRequireDefault(require("./toastManager"));
@@ -37,27 +36,31 @@ class Toaster {
37
36
  };
38
37
  this.notify = function (title) {
39
38
  let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
40
- return _this.notifyHandler(title, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, settings), {}, {
39
+ return _this.notifyHandler(title, {
40
+ ...settings,
41
41
  intent: 'none'
42
- }));
42
+ });
43
43
  };
44
44
  this.success = function (title) {
45
45
  let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46
- return _this.notifyHandler(title, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, settings), {}, {
46
+ return _this.notifyHandler(title, {
47
+ ...settings,
47
48
  intent: 'success'
48
- }));
49
+ });
49
50
  };
50
51
  this.warning = function (title) {
51
52
  let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52
- return _this.notifyHandler(title, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, settings), {}, {
53
+ return _this.notifyHandler(title, {
54
+ ...settings,
53
55
  intent: 'warning'
54
- }));
56
+ });
55
57
  };
56
58
  this.danger = function (title) {
57
59
  let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
58
- return _this.notifyHandler(title, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, settings), {}, {
60
+ return _this.notifyHandler(title, {
61
+ ...settings,
59
62
  intent: 'danger'
60
- }));
63
+ });
61
64
  };
62
65
  if (!isBrowser) return;
63
66
  const container = document.createElement('div');
package/lib/utils/cell.js CHANGED
@@ -7,9 +7,10 @@ exports.isValidPosition = exports.isLongTextValueExceedLimit = exports.checkValu
7
7
  var _constants = require("../constants");
8
8
  var _utils = require("./utils");
9
9
  const checkValueConformityFormat = (columnData, value) => {
10
- const _ref = columnData || {},
11
- format_specification_value = _ref.format_specification_value,
12
- format_check_type = _ref.format_check_type;
10
+ const {
11
+ format_specification_value,
12
+ format_check_type
13
+ } = columnData || {};
13
14
  let isMatched = false;
14
15
  if (format_check_type !== 'custom_format') {
15
16
  const reg = _constants.FORMAT_REG_EXP_LIST[format_check_type];
@@ -22,9 +23,10 @@ const checkValueConformityFormat = (columnData, value) => {
22
23
  };
23
24
  exports.checkValueConformityFormat = checkValueConformityFormat;
24
25
  const checkNumberValidation = (columnData, value) => {
25
- const _ref2 = columnData || {},
26
- format_max_value = _ref2.format_max_value,
27
- format_min_value = _ref2.format_min_value;
26
+ const {
27
+ format_max_value,
28
+ format_min_value
29
+ } = columnData || {};
28
30
  const num = parseFloat(value);
29
31
  if (isNaN(num) || !num && num !== 0) {
30
32
  return false;
@@ -41,8 +43,9 @@ exports.checkNumberValidation = checkNumberValidation;
41
43
  const isLongTextValueExceedLimit = value => {
42
44
  if (!value) return false;
43
45
  if (typeof value === 'string') return value.length >= _constants.LONG_TEXT_LENGTH_LIMIT;
44
- const _ref3 = value || {},
45
- text = _ref3.text;
46
+ const {
47
+ text
48
+ } = value || {};
46
49
  return text ? text.length >= _constants.LONG_TEXT_LENGTH_LIMIT : false;
47
50
  };
48
51
  exports.isLongTextValueExceedLimit = isLongTextValueExceedLimit;
@@ -11,14 +11,14 @@ function hasClass(node, className) {
11
11
  return node.classList.contains(className);
12
12
  }
13
13
  const originClass = node.className;
14
- return " ".concat(originClass, " ").indexOf(" ".concat(className, " ")) > -1;
14
+ return ` ${originClass} `.indexOf(` ${className} `) > -1;
15
15
  }
16
16
  function addClass(node, className) {
17
17
  if (node.classList) {
18
18
  node.classList.add(className);
19
19
  } else {
20
20
  if (!hasClass(node, className)) {
21
- node.className = "".concat(node.className, " ").concat(className);
21
+ node.className = `${node.className} ${className}`;
22
22
  }
23
23
  }
24
24
  }
@@ -28,7 +28,7 @@ function removeClass(node, className) {
28
28
  } else {
29
29
  if (hasClass(node, className)) {
30
30
  const originClass = node.className;
31
- node.className = " ".concat(originClass, " ").replace(" ".concat(className, " "), '');
31
+ node.className = ` ${originClass} `.replace(` ${className} `, '');
32
32
  }
33
33
  }
34
34
  }
@@ -9,9 +9,12 @@ exports.isEnableCheckFormat = void 0;
9
9
  var _dtableUtils = require("dtable-utils");
10
10
  const isEnableCheckFormat = column => {
11
11
  if (!column) return false;
12
- const data = column.data;
13
- const _ref = data || {},
14
- enable_check_format = _ref.enable_check_format;
12
+ const {
13
+ data
14
+ } = column;
15
+ const {
16
+ enable_check_format
17
+ } = data || {};
15
18
  if (enable_check_format) return true;
16
19
  return false;
17
20
  };
@@ -23,12 +26,15 @@ const getDateColumnFormat = column => {
23
26
  };
24
27
  exports.getDateColumnFormat = getDateColumnFormat;
25
28
  function isCheckboxColumn(column) {
26
- let type = column.type,
27
- data = column.data;
29
+ let {
30
+ type,
31
+ data
32
+ } = column;
28
33
  if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
29
- const _ref2 = data || {},
30
- result_type = _ref2.result_type,
31
- array_type = _ref2.array_type;
34
+ const {
35
+ result_type,
36
+ array_type
37
+ } = data || {};
32
38
  if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) {
33
39
  return array_type === _dtableUtils.CellType.CHECKBOX;
34
40
  }
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.searchDepartments = exports.getNormalizedDepartments = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
7
  const searchDepartments = (departments, searchValue) => {
10
8
  const validSearchValue = searchValue ? searchValue.trim().toLowerCase() : '';
11
9
  const validDepartments = Array.isArray(departments) ? departments : [];
12
10
  if (!validSearchValue) return validDepartments;
13
11
  return validDepartments.filter(department => {
14
- const name = department.name;
12
+ const {
13
+ name
14
+ } = department;
15
15
  if (!name) return false;
16
16
  return name.toString().toLowerCase().indexOf(validSearchValue) > -1;
17
17
  });
@@ -27,10 +27,11 @@ const getNormalizedDepartments = function (departments) {
27
27
  return departments.map(depart => {
28
28
  const hasChild = canExpand && !!parentIdMap[depart.id];
29
29
  const isExpanded = depart.parent_id === -1 ? true : false;
30
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, depart), {}, {
30
+ return {
31
+ ...depart,
31
32
  hasChild,
32
33
  isExpanded
33
- });
34
+ };
34
35
  });
35
36
  };
36
37
  exports.getNormalizedDepartments = getNormalizedDepartments;
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.getComponentLocale = getComponentLocale;
8
7
  exports.getLocaleCode = getLocaleCode;
9
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
8
  function getComponentLocale(props, context, componentName, getDefaultLocale) {
11
9
  let locale = {};
12
10
  if (context && context.antLocale && context.antLocale[componentName]) {
@@ -17,11 +15,19 @@ function getComponentLocale(props, context, componentName, getDefaultLocale) {
17
15
  // https://github.com/ant-design/ant-design/issues/6334
18
16
  locale = defaultLocale.default || defaultLocale;
19
17
  }
20
- let result = (0, _objectSpread2.default)({}, locale);
18
+ let result = {
19
+ ...locale
20
+ };
21
21
  if (props.locale) {
22
- result = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, result), props.locale);
22
+ result = {
23
+ ...result,
24
+ ...props.locale
25
+ };
23
26
  if (props.locale.lang) {
24
- result.lang = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, locale.lang), props.locale.lang);
27
+ result.lang = {
28
+ ...locale.lang,
29
+ ...props.locale.lang
30
+ };
25
31
  }
26
32
  }
27
33
  return result;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.shallowCloneObject = exports.hasOwnProperty = exports.default = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
7
  class ObjectUtils {
10
8
  static getDataType(data) {
11
9
  let type = typeof data;
@@ -19,13 +17,16 @@ class ObjectUtils {
19
17
  }
20
18
  static isObjectChanged(source, comparison) {
21
19
  if (!this.iterable(source)) {
22
- throw new Error("source should be a Object or Array , but got ".concat(this.getDataType(source)));
20
+ throw new Error(`source should be a Object or Array , but got ${this.getDataType(source)}`);
23
21
  }
24
22
  if (this.getDataType(source) !== this.getDataType(comparison)) {
25
23
  return true;
26
24
  }
27
25
  const sourceKeys = Object.keys(source);
28
- const comparisonKeys = Object.keys((0, _objectSpread2.default)((0, _objectSpread2.default)({}, source), comparison));
26
+ const comparisonKeys = Object.keys({
27
+ ...source,
28
+ ...comparison
29
+ });
29
30
  if (sourceKeys.length !== comparisonKeys.length) {
30
31
  return true;
31
32
  }
package/lib/utils/url.js CHANGED
@@ -72,28 +72,32 @@ const needUseThumbnailImage = url => {
72
72
  exports.needUseThumbnailImage = needUseThumbnailImage;
73
73
  const generateCurrentBaseImageThumbnailUrl = _ref => {
74
74
  var _window2;
75
- let server = _ref.server,
76
- workspaceID = _ref.workspaceID,
77
- dtableUuid = _ref.dtableUuid,
78
- partUrl = _ref.partUrl,
79
- size = _ref.size;
75
+ let {
76
+ server,
77
+ workspaceID,
78
+ dtableUuid,
79
+ partUrl,
80
+ size
81
+ } = _ref;
80
82
  const validServer = server || ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.dtable) && window.dtable.server || '';
81
83
  if (!partUrl || typeof partUrl !== 'string') return '';
82
- let url = "".concat(validServer, "/thumbnail/workspace/").concat(workspaceID, "/asset/").concat(dtableUuid).concat(partUrl);
83
- if (url.indexOf('?') > -1) return "".concat(url, "&size=").concat(size);
84
- return "".concat(url, "?size=").concat(size);
84
+ let url = `${validServer}/thumbnail/workspace/${workspaceID}/asset/${dtableUuid}${partUrl}`;
85
+ if (url.indexOf('?') > -1) return `${url}&size=${size}`;
86
+ return `${url}?size=${size}`;
85
87
  };
86
88
  exports.generateCurrentBaseImageThumbnailUrl = generateCurrentBaseImageThumbnailUrl;
87
89
  const generateCurrentBaseImageUrl = _ref2 => {
88
90
  var _window3;
89
- let server = _ref2.server,
90
- workspaceID = _ref2.workspaceID,
91
- dtableUuid = _ref2.dtableUuid,
92
- partUrl = _ref2.partUrl;
91
+ let {
92
+ server,
93
+ workspaceID,
94
+ dtableUuid,
95
+ partUrl
96
+ } = _ref2;
93
97
  if (!partUrl || typeof partUrl !== 'string') return '';
94
98
  if (partUrl.startsWith('http')) return partUrl;
95
99
  const validServer = server || ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.dtable) && window.dtable.server || '';
96
- return "".concat(validServer, "/workspace/").concat(workspaceID, "/asset/").concat(dtableUuid).concat(partUrl);
100
+ return `${validServer}/workspace/${workspaceID}/asset/${dtableUuid}${partUrl}`;
97
101
  };
98
102
  exports.generateCurrentBaseImageUrl = generateCurrentBaseImageUrl;
99
103
  const getFileName = url => {
@@ -120,9 +124,9 @@ const imageCheck = filename => {
120
124
  };
121
125
  exports.imageCheck = imageCheck;
122
126
  const isInternalURL = function (url) {
123
- let _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
124
- _ref3$server = _ref3.server,
125
- server = _ref3$server === void 0 ? '' : _ref3$server;
127
+ let {
128
+ server = ''
129
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
126
130
  if (!url || typeof url !== 'string') return false;
127
131
  return server && url.indexOf(server) > -1;
128
132
  };
@@ -131,8 +135,10 @@ const getValidFileImageUrls = files => {
131
135
  if (!Array.isArray(files)) return [];
132
136
  return files.map(file => {
133
137
  if (typeof file !== 'object') return null;
134
- const url = file.url,
135
- name = file.name;
138
+ const {
139
+ url,
140
+ name
141
+ } = file;
136
142
  if (!url || url.indexOf('/asset') < 0) return null;
137
143
  return imageCheck(name) ? url : null;
138
144
  }).filter(Boolean);
@@ -157,10 +163,11 @@ const getFileIconUrl = (filename, direntType) => {
157
163
  };
158
164
  exports.getFileIconUrl = getFileIconUrl;
159
165
  const getFileThumbnailInfo = function (file) {
160
- let _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
161
- server = _ref4.server,
162
- dtableUuid = _ref4.dtableUuid,
163
- workspaceID = _ref4.workspaceID;
166
+ let {
167
+ server,
168
+ dtableUuid,
169
+ workspaceID
170
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
164
171
  const defaultIcon = _file.FILEEXT_ICON_MAP['default'];
165
172
  const defaultIconUrl = _file.FILEEXT_ICON_URL_MAP[defaultIcon];
166
173
  if (!file || !file.name) return {
@@ -163,12 +163,16 @@ const getFormulaArrayValue = value => {
163
163
  return item;
164
164
  }
165
165
  if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
166
- const display_value = item.display_value;
166
+ const {
167
+ display_value
168
+ } = item;
167
169
  if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
168
170
  return display_value.map(i => {
169
171
  if (Object.prototype.toString.call(i) === '[object Object]') {
170
172
  if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
171
- const display_value = i.display_value;
173
+ const {
174
+ display_value
175
+ } = i;
172
176
  return display_value;
173
177
  }
174
178
  return i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "7.0.13",
3
+ "version": "7.0.15",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "5.0.9",
@@ -87,7 +87,7 @@
87
87
  "babel-plugin-import": "^1.13.6",
88
88
  "babel-plugin-named-asset-import": "^0.3.6",
89
89
  "babel-preset-react-app": "^10.0.1",
90
- "browserslist": "^4.18.1",
90
+ "browserslist": "^4.28.8",
91
91
  "camelcase": "^6.2.1",
92
92
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
93
93
  "circular-dependency-plugin": "^5.2.2",