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 _dtableUtils = require("dtable-utils");
@@ -16,7 +15,9 @@ class RowExpandFormatter extends _react.default.Component {
16
15
  constructor(_props) {
17
16
  super(_props);
18
17
  this.updateCollaborators = () => {
19
- const column = this.props.column;
18
+ const {
19
+ column
20
+ } = this.props;
20
21
  if (![_dtableUtils.CellType.CREATOR, _dtableUtils.CellType.LAST_MODIFIER, _dtableUtils.CellType.COLLABORATOR].includes(column.type)) return;
21
22
  const collaborators = this.getCollaborators();
22
23
  this.setState({
@@ -24,10 +25,12 @@ class RowExpandFormatter extends _react.default.Component {
24
25
  });
25
26
  };
26
27
  this.calculateCollaboratorData = props => {
27
- const row = props.row,
28
- column = props.column,
29
- valueKey = props.valueKey,
30
- queryCollaborators = props.queryCollaborators;
28
+ const {
29
+ row,
30
+ column,
31
+ valueKey,
32
+ queryCollaborators
33
+ } = props;
31
34
  if (column.type === _dtableUtils.CellType.CREATOR || column.type === _dtableUtils.CellType.LAST_MODIFIER) {
32
35
  const email = row[column[valueKey]];
33
36
  queryCollaborators && queryCollaborators(email);
@@ -39,9 +42,10 @@ class RowExpandFormatter extends _react.default.Component {
39
42
  }
40
43
  };
41
44
  this.getCollaborators = () => {
42
- const _this$props = this.props,
43
- getCollaborators = _this$props.getCollaborators,
44
- collaborators = _this$props.collaborators;
45
+ const {
46
+ getCollaborators,
47
+ collaborators
48
+ } = this.props;
45
49
  if (getCollaborators) return getCollaborators();
46
50
  return collaborators || [];
47
51
  };
@@ -51,14 +55,18 @@ class RowExpandFormatter extends _react.default.Component {
51
55
  });
52
56
  };
53
57
  this.renderFormatter = () => {
54
- let _this$props2 = this.props,
55
- column = _this$props2.column,
56
- row = _this$props2.row,
57
- valueKey = _this$props2.valueKey;
58
- let _column = column,
59
- columnType = _column.type;
60
- const collaborators = this.state.collaborators;
61
- const containerClassName = "dtable-ui-row-expand-".concat(columnType, "-formatter");
58
+ let {
59
+ column,
60
+ row,
61
+ valueKey
62
+ } = this.props;
63
+ let {
64
+ type: columnType
65
+ } = column;
66
+ const {
67
+ collaborators
68
+ } = this.state;
69
+ const containerClassName = `dtable-ui-row-expand-${columnType}-formatter`;
62
70
  let cellValue = row[column[valueKey]];
63
71
  const Formatter = this.component[columnType];
64
72
  if (!Formatter) return null;
@@ -168,8 +176,8 @@ class RowExpandFormatter extends _react.default.Component {
168
176
  }
169
177
  case _dtableUtils.CellType.MULTIPLE_SELECT:
170
178
  {
171
- var _column2, _column2$data;
172
- const options = ((_column2 = column) === null || _column2 === void 0 ? void 0 : (_column2$data = _column2.data) === null || _column2$data === void 0 ? void 0 : _column2$data.options) || [];
179
+ var _column, _column$data;
180
+ const options = ((_column = column) === null || _column === void 0 ? void 0 : (_column$data = _column.data) === null || _column$data === void 0 ? void 0 : _column$data.options) || [];
173
181
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
174
182
  className: "form-control d-flex align-items-center w-100 h-auto",
175
183
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Formatter, {
@@ -181,8 +189,8 @@ class RowExpandFormatter extends _react.default.Component {
181
189
  }
182
190
  case _dtableUtils.CellType.SINGLE_SELECT:
183
191
  {
184
- var _column3, _column3$data;
185
- const options = ((_column3 = column) === null || _column3 === void 0 ? void 0 : (_column3$data = _column3.data) === null || _column3$data === void 0 ? void 0 : _column3$data.options) || [];
192
+ var _column2, _column2$data;
193
+ const options = ((_column2 = column) === null || _column2 === void 0 ? void 0 : (_column2$data = _column2.data) === null || _column2$data === void 0 ? void 0 : _column2$data.options) || [];
186
194
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
187
195
  className: "form-control d-flex align-items-center w-100",
188
196
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Formatter, {
@@ -215,12 +223,12 @@ class RowExpandFormatter extends _react.default.Component {
215
223
  }
216
224
  case _dtableUtils.CellType.CHECKBOX:
217
225
  {
218
- var _column$data;
226
+ var _column$data2;
219
227
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
220
228
  className: "checkbox-formatter-container",
221
229
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Formatter, {
222
230
  value: cellValue,
223
- checkboxStyle: ((_column$data = column.data) === null || _column$data === void 0 ? void 0 : _column$data.checkbox_style) || {}
231
+ checkboxStyle: ((_column$data2 = column.data) === null || _column$data2 === void 0 ? void 0 : _column$data2.checkbox_style) || {}
224
232
  })
225
233
  });
226
234
  }
@@ -247,21 +255,26 @@ class RowExpandFormatter extends _react.default.Component {
247
255
  case _dtableUtils.CellType.LINK:
248
256
  {
249
257
  // handle link column do not have column.data.display_column
250
- const _column4 = column,
251
- data = _column4.data;
252
- const display_column_key = data.display_column_key,
253
- array_type = data.array_type,
254
- array_data = data.array_data;
258
+ const {
259
+ data
260
+ } = column;
261
+ const {
262
+ display_column_key,
263
+ array_type,
264
+ array_data
265
+ } = data;
255
266
  if (!data.display_column) {
256
- column = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
257
- data: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
267
+ column = {
268
+ ...column,
269
+ data: {
270
+ ...data,
258
271
  display_column: {
259
272
  key: display_column_key || '0000',
260
273
  type: array_type || _dtableUtils.CellType.TEXT,
261
274
  data: array_data || null
262
275
  }
263
- })
264
- });
276
+ }
277
+ };
265
278
  }
266
279
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Formatter, {
267
280
  value: cellValue,
@@ -362,7 +375,10 @@ class RowExpandFormatter extends _react.default.Component {
362
375
  this.state = {
363
376
  collaborators: this.getCollaborators()
364
377
  };
365
- this.component = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _constants.DEFAULT_FORMATTER), this.props.component);
378
+ this.component = {
379
+ ..._constants.DEFAULT_FORMATTER,
380
+ ...this.props.component
381
+ };
366
382
  }
367
383
  componentDidMount() {
368
384
  this.calculateCollaboratorData(this.props);
@@ -380,7 +396,9 @@ class RowExpandFormatter extends _react.default.Component {
380
396
  }
381
397
  }
382
398
  render() {
383
- const className = this.props.className;
399
+ const {
400
+ className
401
+ } = this.props;
384
402
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
385
403
  className: (0, _classnames.default)('dtable-ui dtable-ui-row-expand-formatter', className),
386
404
  children: this.renderFormatter()
@@ -14,10 +14,13 @@ class CollaboratorItemFormatter extends _react.Component {
14
14
  constructor(_props) {
15
15
  super(_props);
16
16
  this.calculateCollaboratorData = props => {
17
- const _this$props = this.props,
18
- context = _this$props.context,
19
- collaborators = _this$props.collaborators;
20
- const cellValue = props.cellValue;
17
+ const {
18
+ context,
19
+ collaborators
20
+ } = this.props;
21
+ const {
22
+ cellValue
23
+ } = props;
21
24
  if (!cellValue) {
22
25
  this.setState({
23
26
  isDataLoaded: true,
@@ -39,7 +42,7 @@ class CollaboratorItemFormatter extends _react.Component {
39
42
  }
40
43
  if (!context) return;
41
44
  const mediaUrl = context.getSetting('mediaUrl');
42
- const defaultAvatarUrl = "".concat(mediaUrl, "/avatars/default.png");
45
+ const defaultAvatarUrl = `${mediaUrl}/avatars/default.png`;
43
46
  if (cellValue === 'anonymous') {
44
47
  collaborator = {
45
48
  name: 'anonymous',
@@ -103,10 +106,13 @@ class CollaboratorItemFormatter extends _react.Component {
103
106
  this.calculateCollaboratorData(nextProps);
104
107
  }
105
108
  render() {
106
- const cellValue = this.props.cellValue;
107
- const _this$state = this.state,
108
- collaborator = _this$state.collaborator,
109
- isDataLoaded = _this$state.isDataLoaded;
109
+ const {
110
+ cellValue
111
+ } = this.props;
112
+ const {
113
+ collaborator,
114
+ isDataLoaded
115
+ } = this.state;
110
116
  if (!isDataLoaded || !cellValue || !collaborator) {
111
117
  return this.props.renderEmpty();
112
118
  }
@@ -20,21 +20,28 @@ var _jsxRuntime = require("react/jsx-runtime");
20
20
  class RowExpandLinkFormatter extends _react.Component {
21
21
  render() {
22
22
  const props = this.props;
23
- const column = props.column,
24
- value = props.value,
25
- containerClassName = props.containerClassName,
26
- collaborators = props.collaborators;
27
- const data = column.data;
23
+ const {
24
+ column,
25
+ value,
26
+ containerClassName,
27
+ collaborators
28
+ } = props;
29
+ const {
30
+ data
31
+ } = column;
28
32
  if (!Array.isArray(value) || value.length === 0) {
29
33
  return props.renderEmpty();
30
34
  }
31
- let _ref = data || {},
32
- displayColumn = _ref.display_column;
35
+ let {
36
+ display_column: displayColumn
37
+ } = data || {};
33
38
  if (!displayColumn) {
34
39
  return props.renderEmpty();
35
40
  }
36
- let displayColumnType = displayColumn.type,
37
- displayColumnData = displayColumn.data;
41
+ let {
42
+ type: displayColumnType,
43
+ data: displayColumnData
44
+ } = displayColumn;
38
45
  if (displayColumnType === 'string') {
39
46
  displayColumnType = _dtableUtils.CellType.TEXT;
40
47
  }
@@ -57,7 +64,7 @@ class RowExpandLinkFormatter extends _react.Component {
57
64
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
58
65
  className: "row-expand-link-item",
59
66
  children: value
60
- }, "link-".concat(displayColumnType, "-").concat(index));
67
+ }, `link-${displayColumnType}-${index}`);
61
68
  })
62
69
  });
63
70
  }
@@ -67,13 +74,14 @@ class RowExpandLinkFormatter extends _react.Component {
67
74
  className: containerClassName,
68
75
  children: cellValue.map((value, index) => {
69
76
  if (!value || typeof value !== 'string') return null;
70
- const _ref2 = displayColumnData || {},
71
- format = _ref2.format;
77
+ const {
78
+ format
79
+ } = displayColumnData || {};
72
80
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateFormatter.default, {
73
81
  value: value,
74
82
  format: format,
75
83
  containerClassName: "row-expand-link-item"
76
- }, "link-".concat(displayColumnType, "-").concat(index));
84
+ }, `link-${displayColumnType}-${index}`);
77
85
  })
78
86
  });
79
87
  }
@@ -86,7 +94,7 @@ class RowExpandLinkFormatter extends _react.Component {
86
94
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CTimeFormatter.default, {
87
95
  value: value,
88
96
  containerClassName: "row-expand-link-item"
89
- }, "link-".concat(displayColumnType, "-").concat(index));
97
+ }, `link-${displayColumnType}-${index}`);
90
98
  })
91
99
  });
92
100
  }
@@ -99,7 +107,7 @@ class RowExpandLinkFormatter extends _react.Component {
99
107
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MTimeFormatter.default, {
100
108
  value: value,
101
109
  containerClassName: "row-expand-link-item"
102
- }, "link-".concat(displayColumnType, "-").concat(index));
110
+ }, `link-${displayColumnType}-${index}`);
103
111
  })
104
112
  });
105
113
  }
@@ -115,7 +123,7 @@ class RowExpandLinkFormatter extends _react.Component {
115
123
  collaborators: collaborators,
116
124
  context: props.context,
117
125
  renderEmpty: props.renderEmpty
118
- }, "link-".concat(displayColumnType, "-").concat(index));
126
+ }, `link-${displayColumnType}-${index}`);
119
127
  })
120
128
  });
121
129
  }
@@ -138,7 +146,7 @@ class RowExpandLinkFormatter extends _react.Component {
138
146
  children: (0, _valueDisplayUtils.getCellDisplayValue)({
139
147
  [displayColumn.key]: value
140
148
  }, displayColumn, collaborators)
141
- }, "link-".concat(displayColumnType, "-").concat(index));
149
+ }, `link-${displayColumnType}-${index}`);
142
150
  })
143
151
  });
144
152
  }
@@ -8,9 +8,11 @@ var _dtableUtils = require("dtable-utils");
8
8
  const DOWNLOAD_NAME_COLUMN_TYPES = [_dtableUtils.CellType.TEXT, _dtableUtils.CellType.NUMBER, _dtableUtils.CellType.DATE, _dtableUtils.CellType.COLLABORATOR, _dtableUtils.CellType.CREATOR, _dtableUtils.CellType.AUTO_NUMBER];
9
9
  const getCellDisplayValue = (record, column, collaborators) => {
10
10
  if (!column || !DOWNLOAD_NAME_COLUMN_TYPES.includes(column.type)) return '';
11
- const key = column.key,
12
- type = column.type,
13
- data = column.data;
11
+ const {
12
+ key,
13
+ type,
14
+ data
15
+ } = column;
14
16
  return (0, _dtableUtils.getCellValueDisplayString)(record, type, key, {
15
17
  data,
16
18
  collaborators,
@@ -13,31 +13,32 @@ class RateExpendRateFormatter extends _react.default.Component {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  this.getRateList = () => {
16
- const _this$props = this.props,
17
- data = _this$props.data,
18
- value = _this$props.value;
19
- const _ref = data || {},
20
- _ref$rate_max_number = _ref.rate_max_number,
21
- rate_max_number = _ref$rate_max_number === void 0 ? 5 : _ref$rate_max_number,
22
- _ref$rate_style_color = _ref.rate_style_color,
23
- rate_style_color = _ref$rate_style_color === void 0 ? '#e5e5e5' : _ref$rate_style_color,
24
- _ref$rate_style_type = _ref.rate_style_type,
25
- rate_style_type = _ref$rate_style_type === void 0 ? 'dtable-icon-rate' : _ref$rate_style_type;
16
+ const {
17
+ data,
18
+ value
19
+ } = this.props;
20
+ const {
21
+ rate_max_number = 5,
22
+ rate_style_color = '#e5e5e5',
23
+ rate_style_type = 'dtable-icon-rate'
24
+ } = data || {};
26
25
  let rateList = [];
27
26
  for (let i = 0; i < rate_max_number; i++) {
28
27
  let style = {
29
28
  color: value >= i + 1 ? rate_style_color : '#e5e5e5'
30
29
  };
31
30
  rateList.push(/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
32
- className: "dtable-font ".concat(rate_style_type),
31
+ className: `dtable-font ${rate_style_type}`,
33
32
  style: style
34
- }, "dtable-ui-component-rate-".concat(i)));
33
+ }, `dtable-ui-component-rate-${i}`));
35
34
  }
36
35
  return rateList;
37
36
  };
38
37
  }
39
38
  render() {
40
- const containerClassName = this.props.containerClassName;
39
+ const {
40
+ containerClassName
41
+ } = this.props;
41
42
  const className = (0, _classnames.default)('dtable-ui cell-formatter-container rate-formatter', containerClassName);
42
43
  const rateList = this.getRateList();
43
44
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -26,10 +26,11 @@ class TextFormatter extends _react.default.Component {
26
26
  };
27
27
  }
28
28
  render() {
29
- const _this$props = this.props,
30
- containerClassName = _this$props.containerClassName,
31
- value = _this$props.value,
32
- column = _this$props.column;
29
+ const {
30
+ containerClassName,
31
+ value,
32
+ column
33
+ } = this.props;
33
34
  const isDisplayAsAsPhoneNumber = column ? (0, _dtableUtils.checkIsDisplayAsPhoneNumberColumn)(column) : false;
34
35
  const classname = (0, _classnames.default)('dtable-ui cell-formatter-container text-formatter', containerClassName, {
35
36
  'row-expand-jump-link-container': isDisplayAsAsPhoneNumber
@@ -16,9 +16,11 @@ class UrlFormatter extends _react.default.Component {
16
16
  constructor() {
17
17
  super(...arguments);
18
18
  this.onOpenUrlLink = () => {
19
- const value = this.props.value;
19
+ const {
20
+ value
21
+ } = this.props;
20
22
  const url = (0, _editorUtils.getTrimmedString)(value);
21
- const validUrl = (0, _utils.isValidUrl)(url) ? url : "http://".concat(url);
23
+ const validUrl = (0, _utils.isValidUrl)(url) ? url : `http://${url}`;
22
24
  try {
23
25
  let a = document.createElement('a');
24
26
  document.body.appendChild(a);
@@ -27,15 +29,16 @@ class UrlFormatter extends _react.default.Component {
27
29
  a.rel = 'noopener noreferrer';
28
30
  a.click();
29
31
  document.body.removeChild(a);
30
- } catch (_unused) {
32
+ } catch {
31
33
  _toaster.default.danger('The url is invalid');
32
34
  }
33
35
  };
34
36
  }
35
37
  render() {
36
- const _this$props = this.props,
37
- containerClassName = _this$props.containerClassName,
38
- value = _this$props.value;
38
+ const {
39
+ containerClassName,
40
+ value
41
+ } = this.props;
39
42
  const classname = (0, _classnames.default)('dtable-ui cell-formatter-container url-formatter row-expand-jump-link-container', containerClassName);
40
43
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
41
44
  className: classname,
@@ -5,9 +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
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
8
  var _react = _interopRequireDefault(require("react"));
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
10
  var _dtableUtils = require("dtable-utils");
@@ -17,7 +14,6 @@ var _RowExpandFormatter = _interopRequireDefault(require("../../RowExpandFormatt
17
14
  var _utils = require("../../utils/utils");
18
15
  require("./index.css");
19
16
  var _jsxRuntime = require("react/jsx-runtime");
20
- const _excluded = ["component", "onChange", "className"];
21
17
  class Body extends _react.default.Component {
22
18
  constructor() {
23
19
  super(...arguments);
@@ -25,64 +21,79 @@ class Body extends _react.default.Component {
25
21
  this.props.getDownLoadFiles([{
26
22
  url: imageItemUrl
27
23
  }]).then(res => {
28
- const _res$data$urls = (0, _slicedToArray2.default)(res.data.urls, 1),
29
- downloadUrl = _res$data$urls[0];
24
+ const [downloadUrl] = res.data.urls;
30
25
  (0, _utils.downloadFile)(downloadUrl);
31
26
  }).catch(error => {
32
27
  // todo
33
28
  });
34
29
  };
35
30
  this.getCellValue = _ref => {
36
- let row = _ref.row,
37
- column = _ref.column;
31
+ let {
32
+ row,
33
+ column
34
+ } = _ref;
38
35
  if (!row || !column) return null;
39
- const valueKey = this.props.valueKey;
36
+ const {
37
+ valueKey
38
+ } = this.props;
40
39
  return row[column[valueKey]];
41
40
  };
42
41
  this.renderColumnValue = (row, column) => {
43
- const _this$props = this.props,
44
- component = _this$props.component,
45
- onChange = _this$props.onChange,
46
- className = _this$props.className,
47
- props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
48
- const getDownLoadFiles = props.getDownLoadFiles;
49
- const editable = column.editable;
50
- const _ref2 = component || {},
51
- editor = _ref2.editor,
52
- formatter = _ref2.formatter;
42
+ const {
43
+ component,
44
+ onChange,
45
+ className,
46
+ ...props
47
+ } = this.props;
48
+ const {
49
+ getDownLoadFiles
50
+ } = props;
51
+ const {
52
+ editable
53
+ } = column;
54
+ const {
55
+ editor,
56
+ formatter
57
+ } = component || {};
53
58
  if (editable) {
54
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowExpandEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
59
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowExpandEditor.default, {
60
+ ...props,
55
61
  column: column,
56
62
  row: row,
57
63
  component: editor,
58
64
  onCommit: value => onChange(column, value)
59
- }));
65
+ });
60
66
  }
61
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowExpandFormatter.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
62
- className: (0, _classnames.default)('dtable-ui-mobile-row-expand-formatter', "mobile-dtable-row-expand-".concat(column.type, "-formatter"), className),
67
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowExpandFormatter.default, {
68
+ ...props,
69
+ className: (0, _classnames.default)('dtable-ui-mobile-row-expand-formatter', `mobile-dtable-row-expand-${column.type}-formatter`, className),
63
70
  column: column,
64
71
  row: row,
65
72
  component: formatter,
66
73
  downloadImage: getDownLoadFiles ? this.downloadImage : null
67
- }));
74
+ });
68
75
  };
69
76
  }
70
77
  render() {
71
- const _this$props2 = this.props,
72
- columns = _this$props2.columns,
73
- row = _this$props2.row,
74
- placeholder = _this$props2.placeholder;
78
+ const {
79
+ columns,
80
+ row,
81
+ placeholder
82
+ } = this.props;
75
83
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
76
84
  className: "dtable-ui-row-expand-body dtable-ui-mobile-row-expand-body",
77
85
  children: [columns.length === 0 && placeholder && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
78
86
  children: placeholder
79
87
  }), columns.map(column => {
80
- const type = column.type,
81
- data = column.data;
88
+ const {
89
+ type,
90
+ data
91
+ } = column;
82
92
  let isHasMore = false;
83
93
  if (type === _dtableUtils.CellType.LINK_FORMULA) {
84
- let _ref3 = data || {},
85
- array_type = _ref3.array_type;
94
+ let {
95
+ array_type
96
+ } = data || {};
86
97
  const value = this.getCellValue({
87
98
  row,
88
99
  column
@@ -10,9 +10,13 @@ var _reactstrap = require("reactstrap");
10
10
  require("./index.css");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  const ColumnContent = _ref => {
13
- let column = _ref.column,
14
- children = _ref.children;
15
- const name = column.name;
13
+ let {
14
+ column,
15
+ children
16
+ } = _ref;
17
+ const {
18
+ name
19
+ } = column;
16
20
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
17
21
  className: "dtable-ui-mobile-row-expand-item",
18
22
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {