dtable-ui-component 6.0.125 → 6.0.126

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 (288) hide show
  1. package/lib/ActionSheet/index.js +14 -16
  2. package/lib/ActivityIndicator/index.js +7 -8
  3. package/lib/AsyncUserSelect/index.css +5 -0
  4. package/lib/AsyncUserSelect/index.js +40 -19
  5. package/lib/AsyncUserSelect/user-item.js +5 -6
  6. package/lib/AutoNumberFormatter/index.js +3 -4
  7. package/lib/Badge/index.js +9 -11
  8. package/lib/ButtonFormatter/index.js +6 -8
  9. package/lib/CTimeFormatter/index.js +3 -4
  10. package/lib/CheckboxEditor/index.js +1 -3
  11. package/lib/CheckboxEditor/mb-editor.js +9 -20
  12. package/lib/CheckboxEditor/pc-editor.js +12 -24
  13. package/lib/CheckboxFormatter/index.js +4 -5
  14. package/lib/CollaboratorEditor/index.js +2 -4
  15. package/lib/CollaboratorEditor/mb-editor/index.js +11 -19
  16. package/lib/CollaboratorEditor/pc-editor/index.js +25 -34
  17. package/lib/CollaboratorFormatter/index.js +8 -10
  18. package/lib/CollaboratorItem/index.js +4 -5
  19. package/lib/CollapsibleSettingLayout/index.js +9 -7
  20. package/lib/Comment/body/comment.js +10 -18
  21. package/lib/Comment/body/index.js +2 -4
  22. package/lib/Comment/footer/btns/index.js +4 -7
  23. package/lib/Comment/footer/index.js +9 -20
  24. package/lib/Comment/footer/input/index.js +29 -50
  25. package/lib/Comment/footer/input/participant/index.js +4 -5
  26. package/lib/Comment/footer/participants/index.js +4 -5
  27. package/lib/Comment/footer/participants/participant/index.js +1 -3
  28. package/lib/Comment/footer/participants/participant-select/index.js +8 -24
  29. package/lib/Comment/index.js +39 -57
  30. package/lib/Comment/utils/utilities.js +15 -21
  31. package/lib/CreatorFormatter/index.js +6 -8
  32. package/lib/DTableColorPicker/ColorPickerPortal/index.js +23 -19
  33. package/lib/DTableColorPicker/index.css +0 -2
  34. package/lib/DTableColorPicker/index.js +56 -41
  35. package/lib/DTableColorPicker/utils.js +4 -6
  36. package/lib/DTableColumnIcon/index.js +6 -7
  37. package/lib/DTableCommonAddTool/index.css +1 -3
  38. package/lib/DTableCommonAddTool/index.js +6 -8
  39. package/lib/DTableCustomFooter/index.css +1 -3
  40. package/lib/DTableCustomFooter/index.js +1 -3
  41. package/lib/DTableCustomizeCollaboratorSelect/index.js +17 -20
  42. package/lib/DTableCustomizeSelect/index.js +19 -24
  43. package/lib/DTableDropdownItem/index.js +16 -18
  44. package/lib/DTableDropdownMenu/index.js +8 -10
  45. package/lib/DTableEmptyTip/index.js +4 -5
  46. package/lib/DTableFiltersPopover/index.css +0 -2
  47. package/lib/DTableFiltersPopover/index.js +26 -41
  48. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +1 -3
  49. package/lib/DTableFiltersPopover/utils/index.js +63 -113
  50. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +8 -9
  51. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +16 -13
  52. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +18 -15
  53. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +8 -14
  54. package/lib/DTableFiltersPopover/widgets/filter-group.js +34 -55
  55. package/lib/DTableFiltersPopover/widgets/filter-item.js +107 -170
  56. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +136 -161
  57. package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
  58. package/lib/DTableGroupSelect/index.js +11 -15
  59. package/lib/DTableGroupSelect/select-option-group.js +23 -32
  60. package/lib/DTableIcon/index.js +6 -7
  61. package/lib/DTableIcon/svg-icon.js +5 -7
  62. package/lib/DTableModalHeader/index.js +1 -3
  63. package/lib/DTablePopover/index.js +13 -16
  64. package/lib/DTableRadio/index.js +10 -9
  65. package/lib/DTableRadioGroup/index.js +8 -17
  66. package/lib/DTableSearchInput/index.js +19 -29
  67. package/lib/DTableSelect/dtable-select-label.js +6 -5
  68. package/lib/DTableSelect/index.js +21 -22
  69. package/lib/DTableSelect/utils.js +7 -15
  70. package/lib/DTableSubDropdownMenu/index.js +8 -10
  71. package/lib/DTableSubDropdownToggle/index.js +12 -12
  72. package/lib/DTableSwitch/index.css +0 -1
  73. package/lib/DTableSwitch/index.js +12 -11
  74. package/lib/DTableToolTip/index.js +7 -8
  75. package/lib/DateEditor/index.js +20 -15
  76. package/lib/DateEditor/mb-editor/index.js +18 -31
  77. package/lib/DateEditor/pc-editor.js +26 -45
  78. package/lib/DateFormatter/index.js +4 -5
  79. package/lib/DatePicker/index.js +9 -15
  80. package/lib/DatePicker/utils.js +1 -3
  81. package/lib/DeleteTip/index.js +5 -6
  82. package/lib/DepartmentMultipleSelectEditor/index.js +25 -23
  83. package/lib/DepartmentSelectFilter/index.js +6 -8
  84. package/lib/DepartmentSingleSelectEditor/index.js +1 -3
  85. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +48 -47
  86. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +36 -58
  87. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -19
  88. package/lib/DepartmentSingleSelectFormatter/index.js +4 -6
  89. package/lib/DigitalSignEditor/index.js +1 -3
  90. package/lib/DigitalSignEditor/mb-editor/index.js +12 -20
  91. package/lib/DigitalSignEditor/pc-editor/index.js +17 -24
  92. package/lib/DigitalSignEditor/service.js +2 -4
  93. package/lib/DigitalSignEditor/signature-board/index.js +5 -8
  94. package/lib/DigitalSignEditor/utils.js +2 -4
  95. package/lib/DigitalSignFormatter/index.js +12 -15
  96. package/lib/DigitalSignFormatter/utils.js +4 -5
  97. package/lib/DurationEditor/index.js +21 -31
  98. package/lib/DurationFormatter/index.js +4 -5
  99. package/lib/EditEditorButton/index.js +1 -3
  100. package/lib/EmailFormatter/index.js +3 -4
  101. package/lib/FieldDisplaySetting/field-item.js +12 -12
  102. package/lib/FieldDisplaySetting/index.js +11 -9
  103. package/lib/FileEditor/files-previewer/index.js +1 -3
  104. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +10 -18
  105. package/lib/FileEditor/files-previewer/mb-previewer/index.js +7 -8
  106. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +3 -4
  107. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +5 -6
  108. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +14 -21
  109. package/lib/FileEditor/files-previewer/pc-previewer/index.js +29 -57
  110. package/lib/FileEditor/index.js +1 -3
  111. package/lib/FileEditor/mb-editor/index.js +28 -20
  112. package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -3
  113. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +11 -25
  114. package/lib/FileEditor/pc-editor/index.js +19 -27
  115. package/lib/FileFormatter/index.js +26 -19
  116. package/lib/FileItemFormatter/index.js +6 -9
  117. package/lib/FileUploader/index.js +28 -45
  118. package/lib/FormulaFormatter/index.js +15 -29
  119. package/lib/GeolocationEditor/index.js +11 -12
  120. package/lib/GeolocationEditor/map-editor-utils.js +17 -15
  121. package/lib/GeolocationEditor/mb-editor/country-editor.js +17 -14
  122. package/lib/GeolocationEditor/mb-editor/index.js +4 -6
  123. package/lib/GeolocationEditor/mb-editor/location-editor.js +18 -15
  124. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +41 -68
  125. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +50 -89
  126. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +17 -14
  127. package/lib/GeolocationEditor/mb-editor/province-editor.js +17 -14
  128. package/lib/GeolocationEditor/pc-editor/country-editor.js +10 -23
  129. package/lib/GeolocationEditor/pc-editor/index.js +12 -20
  130. package/lib/GeolocationEditor/pc-editor/location-editor.js +26 -31
  131. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +34 -54
  132. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +36 -60
  133. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +35 -62
  134. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +36 -65
  135. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +19 -25
  136. package/lib/GeolocationEditor/pc-editor/province-editor.js +6 -13
  137. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +5 -6
  138. package/lib/GeolocationEditor/pc-editor/selector-list.js +6 -7
  139. package/lib/GeolocationFormatter/index.js +4 -5
  140. package/lib/HtmlLongTextFormatter/index.js +4 -12
  141. package/lib/Icon/index.js +3 -5
  142. package/lib/IconButton/index.js +4 -6
  143. package/lib/ImageEditor/images-previewer/image-preview/index.js +12 -21
  144. package/lib/ImageEditor/images-previewer/index.js +3 -9
  145. package/lib/ImageEditor/index.js +1 -3
  146. package/lib/ImageEditor/mb-editor/index.js +28 -20
  147. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +2 -6
  148. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +1 -3
  149. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +7 -21
  150. package/lib/ImageEditor/pc-editor/images-previewer/index.js +3 -9
  151. package/lib/ImageEditor/pc-editor/index.js +11 -16
  152. package/lib/ImageFormatter/images-lazy-load.js +19 -11
  153. package/lib/ImageFormatter/index.js +11 -13
  154. package/lib/ImagePreviewerLightbox/index.js +15 -13
  155. package/lib/ImageThumbnail/index.js +10 -13
  156. package/lib/InputItem/custom-input.js +26 -46
  157. package/lib/InputItem/custom-keyboard.js +15 -18
  158. package/lib/InputItem/index.js +34 -50
  159. package/lib/InputItem/input.js +2 -4
  160. package/lib/LastModifierFormatter/index.js +6 -8
  161. package/lib/LinkEditor/index.js +33 -53
  162. package/lib/LinkEditor/link-editor-option.js +3 -4
  163. package/lib/LinkEditor/mb-popover/index.js +9 -22
  164. package/lib/LinkEditor/pc-popover/index.js +5 -10
  165. package/lib/LinkFormatter/index.js +21 -37
  166. package/lib/List/index.js +6 -8
  167. package/lib/List/list-item.js +22 -28
  168. package/lib/LongTextFormatter/index.js +4 -5
  169. package/lib/MBEditorHeader/index.js +7 -8
  170. package/lib/MTimeFormatter/index.js +3 -4
  171. package/lib/MobileFullScreenPage/body/index.js +3 -5
  172. package/lib/MobileFullScreenPage/header/index.js +4 -6
  173. package/lib/MobileFullScreenPage/index.js +13 -11
  174. package/lib/MobileModal/index.js +1 -3
  175. package/lib/MobileOperationSheet/index.js +7 -8
  176. package/lib/MobileSelector/empty/index.js +1 -3
  177. package/lib/MobileSelector/index.js +5 -7
  178. package/lib/MobileSelector/option/index.js +3 -5
  179. package/lib/MobileSelector/options/index.js +1 -3
  180. package/lib/MobileSelector/search/index.js +3 -5
  181. package/lib/MobileUpload/index.js +4 -5
  182. package/lib/Modal/modal.js +14 -15
  183. package/lib/Modal/prompt.js +4 -4
  184. package/lib/MultipleSelectEditor/index.js +1 -3
  185. package/lib/MultipleSelectFormatter/index.js +6 -8
  186. package/lib/NotificationPopover/index.css +1 -6
  187. package/lib/NotificationPopover/index.js +6 -7
  188. package/lib/NumberEditor/index.js +12 -21
  189. package/lib/NumberFormatter/index.js +4 -5
  190. package/lib/PhoneNumberLink/index.js +2 -4
  191. package/lib/Picker/AbstractPicker.js +23 -27
  192. package/lib/Popover/index.js +3 -4
  193. package/lib/Popover/item.js +7 -9
  194. package/lib/Progress/index.js +9 -8
  195. package/lib/Radio/Radio.js +4 -8
  196. package/lib/Radio/RadioItem.js +8 -12
  197. package/lib/RateFormatter/index.js +13 -13
  198. package/lib/RoleStatusEditor/index.js +18 -17
  199. package/lib/RowExpandDialog/body/index.js +32 -49
  200. package/lib/RowExpandDialog/column-content/index.js +5 -9
  201. package/lib/RowExpandDialog/header/index.js +6 -8
  202. package/lib/RowExpandDialog/index.js +49 -34
  203. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +4 -5
  204. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +8 -10
  205. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +22 -33
  206. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +26 -40
  207. package/lib/RowExpandEditor/date-editor/mb-editor.js +12 -18
  208. package/lib/RowExpandEditor/date-editor/pc-editor.js +15 -20
  209. package/lib/RowExpandEditor/department-editor/mb-editor.js +16 -11
  210. package/lib/RowExpandEditor/department-editor/pc-editor.js +19 -14
  211. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +20 -34
  212. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +21 -35
  213. package/lib/RowExpandEditor/duration-editor/mb-editor.js +10 -17
  214. package/lib/RowExpandEditor/duration-editor/pc-editor.js +13 -19
  215. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +9 -19
  216. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +13 -24
  217. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +18 -31
  218. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +16 -23
  219. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +17 -29
  220. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +13 -26
  221. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +15 -25
  222. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +13 -23
  223. package/lib/RowExpandEditor/index.js +4 -8
  224. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +17 -18
  225. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +10 -16
  226. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +16 -23
  227. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +11 -19
  228. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +22 -33
  229. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +8 -14
  230. package/lib/RowExpandEditor/number-editor/pc-editor.js +13 -20
  231. package/lib/RowExpandEditor/rate-editor/mb-editor.js +12 -25
  232. package/lib/RowExpandEditor/rate-editor/pc-editor.js +20 -36
  233. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +17 -28
  234. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +22 -34
  235. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +4 -5
  236. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +15 -26
  237. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +5 -13
  238. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +9 -18
  239. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -4
  240. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +2 -4
  241. package/lib/RowExpandFormatter/email-formatter/index.js +4 -7
  242. package/lib/RowExpandFormatter/file-formatter/index.js +8 -9
  243. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +10 -12
  244. package/lib/RowExpandFormatter/formula-formatter/index.js +19 -34
  245. package/lib/RowExpandFormatter/image-formatter/index.js +9 -11
  246. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +7 -8
  247. package/lib/RowExpandFormatter/index.js +27 -41
  248. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +8 -14
  249. package/lib/RowExpandFormatter/link-formatter/index.js +11 -19
  250. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +3 -5
  251. package/lib/RowExpandFormatter/rate-formatter/index.js +11 -12
  252. package/lib/RowExpandFormatter/text/index.js +4 -5
  253. package/lib/RowExpandFormatter/url-formatter/index.js +4 -7
  254. package/lib/RowExpandView/body/index.js +22 -35
  255. package/lib/RowExpandView/column-content/index.js +3 -7
  256. package/lib/RowExpandView/index.js +42 -30
  257. package/lib/SelectItem/index.js +5 -7
  258. package/lib/SelectOptionGroup/index.css +3 -3
  259. package/lib/SelectOptionGroup/index.js +31 -40
  260. package/lib/SelectedDepartments/index.js +7 -9
  261. package/lib/SimpleLongTextFormatter/index.js +10 -16
  262. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +3 -4
  263. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +12 -21
  264. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -4
  265. package/lib/SingleSelectEditor/index.js +1 -3
  266. package/lib/SingleSelectFormatter/index.js +8 -9
  267. package/lib/TabBar/Tab.js +14 -16
  268. package/lib/TabBar/index.js +18 -21
  269. package/lib/Tabs/index.js +1 -3
  270. package/lib/TextEditor/index.js +14 -23
  271. package/lib/TextFormatter/index.js +3 -4
  272. package/lib/TextareaItem/index.js +19 -26
  273. package/lib/Toast/index.js +3 -4
  274. package/lib/UrlFormatter/index.js +3 -4
  275. package/lib/common/editor-base.js +7 -12
  276. package/lib/hooks/common-hooks.js +2 -4
  277. package/lib/select-editor/index.js +1 -3
  278. package/lib/select-editor/mb-editor/index.js +17 -28
  279. package/lib/select-editor/pc-editor/index.js +27 -42
  280. package/lib/toaster/alert.js +6 -7
  281. package/lib/toaster/toast.js +2 -3
  282. package/lib/toaster/toastManager.js +2 -4
  283. package/lib/utils/cell.js +8 -11
  284. package/lib/utils/column-utils.js +8 -14
  285. package/lib/utils/departments.js +1 -3
  286. package/lib/utils/url.js +24 -31
  287. package/lib/utils/utils.js +2 -6
  288. package/package.json +8 -8
@@ -25,36 +25,29 @@ class LinkEditor extends _react.default.Component {
25
25
  }
26
26
  };
27
27
  this.getLinkedCellValue = () => {
28
- let {
29
- row,
30
- column,
31
- linkMetaData
32
- } = this.props;
33
- let {
34
- link_id,
35
- table_id,
36
- other_table_id
37
- } = column.data || {};
28
+ let _this$props = this.props,
29
+ row = _this$props.row,
30
+ column = _this$props.column,
31
+ linkMetaData = _this$props.linkMetaData;
32
+ let _ref = column.data || {},
33
+ link_id = _ref.link_id,
34
+ table_id = _ref.table_id,
35
+ other_table_id = _ref.other_table_id;
38
36
  this.linkId = link_id;
39
37
  this.tableId = table_id;
40
38
  this.otherTableId = other_table_id;
41
39
  return linkMetaData.getLinkedCellValue(this.linkId, this.tableId, this.otherTableId, row._id);
42
40
  };
43
41
  this.formatLinkedValuesToOptions = () => {
44
- let {
45
- column,
46
- linkMetaData
47
- } = this.props;
48
- let {
49
- newValue: rowIds
50
- } = this.state;
42
+ let _this$props2 = this.props,
43
+ column = _this$props2.column,
44
+ linkMetaData = _this$props2.linkMetaData;
45
+ let rowIds = this.state.newValue;
51
46
  if (rowIds && Array.isArray(rowIds) && rowIds.length > 0) {
52
47
  let linkedRows = linkMetaData.getLinkedRows(this.otherTableId, rowIds);
53
48
  let linkedTable = linkMetaData.getLinkedTable(this.otherTableId);
54
49
  return linkedRows.map(linkedRow => {
55
- let {
56
- display_column_key: displayColumnKey
57
- } = column.data;
50
+ let displayColumnKey = column.data.display_column_key;
58
51
  // format value to display
59
52
  let displayValue = this.getDisplayValue(linkedTable, linkedRow, displayColumnKey);
60
53
  return {
@@ -68,10 +61,8 @@ class LinkEditor extends _react.default.Component {
68
61
  this.getDisplayValue = (linkedTable, linkedRow, displayColumnKey) => {
69
62
  let value = linkedRow[displayColumnKey];
70
63
  let linkedColumn = linkedTable.columns.find(column => column.key === displayColumnKey);
71
- let {
72
- type,
73
- data
74
- } = linkedColumn;
64
+ let type = linkedColumn.type,
65
+ data = linkedColumn.data;
75
66
  switch (type) {
76
67
  case _dtableUtils.CellType.NUMBER:
77
68
  {
@@ -79,9 +70,7 @@ class LinkEditor extends _react.default.Component {
79
70
  }
80
71
  case _dtableUtils.CellType.DATE:
81
72
  {
82
- let {
83
- format
84
- } = data;
73
+ let format = data.format;
85
74
  return (0, _dtableUtils.getDateDisplayString)(value, format);
86
75
  }
87
76
  default:
@@ -89,13 +78,10 @@ class LinkEditor extends _react.default.Component {
89
78
  }
90
79
  };
91
80
  this.getAvailableLinkedOptions = () => {
92
- let {
93
- column,
94
- linkMetaData
95
- } = this.props;
96
- let {
97
- display_column_key: displayColumnKey
98
- } = column.data;
81
+ let _this$props3 = this.props,
82
+ column = _this$props3.column,
83
+ linkMetaData = _this$props3.linkMetaData;
84
+ let displayColumnKey = column.data.display_column_key;
99
85
  let linkedTable = linkMetaData.getLinkedTable(this.otherTableId);
100
86
  let availableRows = linkedTable.rows.filter(row => {
101
87
  return !!row[displayColumnKey];
@@ -132,10 +118,9 @@ class LinkEditor extends _react.default.Component {
132
118
  }
133
119
  };
134
120
  this.onOptionItemToggle = option => {
135
- let {
136
- row,
137
- linkMetaData
138
- } = this.props;
121
+ let _this$props4 = this.props,
122
+ row = _this$props4.row,
123
+ linkMetaData = _this$props4.linkMetaData;
139
124
  let newValue = this.state.newValue.slice();
140
125
  let optionIndex = newValue.findIndex(option_id => option_id === option.id);
141
126
  if (optionIndex !== -1) {
@@ -150,10 +135,9 @@ class LinkEditor extends _react.default.Component {
150
135
  });
151
136
  };
152
137
  this.onDeleteOption = option => {
153
- let {
154
- row,
155
- linkMetaData
156
- } = this.props;
138
+ let _this$props5 = this.props,
139
+ row = _this$props5.row,
140
+ linkMetaData = _this$props5.linkMetaData;
157
141
  let newValue = this.state.newValue.slice();
158
142
  let optionIndex = newValue.findIndex(option_id => option_id === option.id);
159
143
  newValue.splice(optionIndex, 1);
@@ -166,10 +150,9 @@ class LinkEditor extends _react.default.Component {
166
150
  this.caculatePopoverPosition = () => {
167
151
  const POPOVER_MAX_HEIGHT = 200;
168
152
  let innerHeight = window.innerHeight;
169
- let {
170
- top,
171
- height
172
- } = this.editor.getClientRects()[0];
153
+ let _this$editor$getClien = this.editor.getClientRects()[0],
154
+ top = _this$editor$getClien.top,
155
+ height = _this$editor$getClien.height;
173
156
  let isBelow = innerHeight - (top + height) > POPOVER_MAX_HEIGHT;
174
157
  let position = {
175
158
  top: height + 1,
@@ -211,13 +194,10 @@ class LinkEditor extends _react.default.Component {
211
194
  document.removeEventListener('mousedown', this.onMouseDown);
212
195
  }
213
196
  render() {
214
- let {
215
- isReadOnly
216
- } = this.props;
217
- let {
218
- isPopoverShow,
219
- popoverPosition
220
- } = this.state;
197
+ let isReadOnly = this.props.isReadOnly;
198
+ let _this$state = this.state,
199
+ isPopoverShow = _this$state.isPopoverShow,
200
+ popoverPosition = _this$state.popoverPosition;
221
201
  let options = this.getAvailableLinkedOptions();
222
202
  let selectedOptions = this.formatLinkedValuesToOptions();
223
203
  let isShowRemoveIcon = !isReadOnly;
@@ -54,10 +54,9 @@ class LinkEditorOption extends _react.default.Component {
54
54
  };
55
55
  }
56
56
  render() {
57
- let {
58
- option,
59
- isShowRemoveIcon
60
- } = this.props;
57
+ let _this$props = this.props,
58
+ option = _this$props.option,
59
+ isShowRemoveIcon = _this$props.isShowRemoveIcon;
61
60
  let containerStyle = this.getContainerStyle();
62
61
  let optionStyle = this.getOptionStyle();
63
62
  let optionNameStyle = this.getOptionNameStyle();
@@ -25,9 +25,7 @@ class MBLinkEditorPopover extends _react.default.Component {
25
25
  }
26
26
  };
27
27
  this.onChangeSearch = event => {
28
- let {
29
- searchVal
30
- } = this.state;
28
+ let searchVal = this.state.searchVal;
31
29
  if (searchVal === event.target.value) {
32
30
  return;
33
31
  }
@@ -37,10 +35,9 @@ class MBLinkEditorPopover extends _react.default.Component {
37
35
  });
38
36
  };
39
37
  this.getSelectedOptions = () => {
40
- let {
41
- value,
42
- options
43
- } = this.props;
38
+ let _this$props = this.props,
39
+ value = _this$props.value,
40
+ options = _this$props.options;
44
41
  if (!Array.isArray(value)) {
45
42
  return [];
46
43
  }
@@ -49,12 +46,8 @@ class MBLinkEditorPopover extends _react.default.Component {
49
46
  });
50
47
  };
51
48
  this.getFilterOptions = () => {
52
- let {
53
- options
54
- } = this.props;
55
- let {
56
- searchVal
57
- } = this.state;
49
+ let options = this.props.options;
50
+ let searchVal = this.state.searchVal;
58
51
  return searchVal ? options.filter(item => item.name.indexOf(searchVal) > -1) : options;
59
52
  };
60
53
  this.onSelectOption = option => {
@@ -64,9 +57,7 @@ class MBLinkEditorPopover extends _react.default.Component {
64
57
  this.props.onOptionItemToggle(option);
65
58
  };
66
59
  this.renderFilteredOptions = options => {
67
- let {
68
- value
69
- } = this.props;
60
+ let value = this.props.value;
70
61
  return options.map((option, index) => {
71
62
  let isSelect = value.some(item => item === option.id);
72
63
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -100,12 +91,8 @@ class MBLinkEditorPopover extends _react.default.Component {
100
91
  window.removeEventListener('popstate', this.handleHistaryBack, false);
101
92
  }
102
93
  render() {
103
- const {
104
- column
105
- } = this.props;
106
- const {
107
- searchVal
108
- } = this.state;
94
+ const column = this.props.column;
95
+ const searchVal = this.state.searchVal;
109
96
  let filterOptions = this.getFilterOptions();
110
97
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
111
98
  ref: this.setEditorPopover,
@@ -27,9 +27,7 @@ class PCLinkEditorPopover extends _react.default.Component {
27
27
  this.props.onOptionItemToggle(item);
28
28
  };
29
29
  this.getFilterOptions = () => {
30
- let {
31
- options
32
- } = this.props;
30
+ let options = this.props.options;
33
31
  let filter = this.state.searchValue.toLowerCase();
34
32
  if (!filter) {
35
33
  return options;
@@ -44,13 +42,10 @@ class PCLinkEditorPopover extends _react.default.Component {
44
42
  }
45
43
  render() {
46
44
  let options = this.getFilterOptions();
47
- let {
48
- popoverPosition,
49
- selectedOptions
50
- } = this.props;
51
- let {
52
- searchValue
53
- } = this.state;
45
+ let _this$props = this.props,
46
+ popoverPosition = _this$props.popoverPosition,
47
+ selectedOptions = _this$props.selectedOptions;
48
+ let searchValue = this.state.searchValue;
54
49
  let popoverStyle = Object.assign({}, (0, _objectSpread2.default)({}, popoverPosition), {
55
50
  position: 'absolute'
56
51
  });
@@ -16,45 +16,37 @@ class LinkFormatter extends _react.default.Component {
16
16
  super(props);
17
17
  this.getLinkedCellValue = row => {
18
18
  if (!row) return [];
19
- const {
20
- column,
21
- currentTableId,
22
- linkMetaData
23
- } = this.props;
24
- const {
25
- link_id,
26
- table_id,
27
- other_table_id
28
- } = column.data || {};
19
+ const _this$props = this.props,
20
+ column = _this$props.column,
21
+ currentTableId = _this$props.currentTableId,
22
+ linkMetaData = _this$props.linkMetaData;
23
+ const _ref = column.data || {},
24
+ link_id = _ref.link_id,
25
+ table_id = _ref.table_id,
26
+ other_table_id = _ref.other_table_id;
29
27
  this.linkID = link_id;
30
28
  this.tableID = currentTableId === table_id ? table_id : other_table_id;
31
29
  this.otherTableID = this.tableID === table_id ? other_table_id : table_id;
32
30
  return linkMetaData.getLinkedCellValue(this.linkID, this.tableID, this.otherTableID, row._id);
33
31
  };
34
32
  this.expandLinkedTableRow = row => {
35
- let {
36
- enableOpenLinkedRow,
37
- linkMetaData
38
- } = this.props;
33
+ let _this$props2 = this.props,
34
+ enableOpenLinkedRow = _this$props2.enableOpenLinkedRow,
35
+ linkMetaData = _this$props2.linkMetaData;
39
36
  if (enableOpenLinkedRow) {
40
37
  linkMetaData.expandLinkedTableRow(row, this.otherTableID);
41
38
  }
42
39
  };
43
40
  this.getDisplayValues = () => {
44
- let {
45
- column,
46
- linkMetaData
47
- } = this.props;
48
- let {
49
- value: rowIds
50
- } = this.state;
41
+ let _this$props3 = this.props,
42
+ column = _this$props3.column,
43
+ linkMetaData = _this$props3.linkMetaData;
44
+ let rowIds = this.state.value;
51
45
  if (rowIds && Array.isArray(rowIds) && rowIds.length > 0) {
52
46
  let linkedTable = linkMetaData.getLinkedTable(this.otherTableID);
53
47
  let linkedRows = linkMetaData.getLinkedRows(this.otherTableID, rowIds);
54
48
  let result = linkedRows.map((row, index) => {
55
- let {
56
- display_column_key: displayColumnKey
57
- } = column.data;
49
+ let displayColumnKey = column.data.display_column_key;
58
50
  let displayValue = this.getDisplayValue(linkedTable, row, displayColumnKey);
59
51
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
60
52
  className: "link-item",
@@ -73,10 +65,8 @@ class LinkFormatter extends _react.default.Component {
73
65
  this.getDisplayValue = (linkedTable, row, displayColumnKey) => {
74
66
  let value = row[displayColumnKey];
75
67
  let linkedColumn = linkedTable.columns.find(column => column.key === displayColumnKey);
76
- let {
77
- type,
78
- data
79
- } = linkedColumn;
68
+ let type = linkedColumn.type,
69
+ data = linkedColumn.data;
80
70
  // todo: improve
81
71
  switch (type) {
82
72
  case _dtableUtils.CellType.NUMBER:
@@ -85,9 +75,7 @@ class LinkFormatter extends _react.default.Component {
85
75
  }
86
76
  case _dtableUtils.CellType.DATE:
87
77
  {
88
- let {
89
- format
90
- } = data;
78
+ let format = data.format;
91
79
  return (0, _dtableUtils.getDateDisplayString)(value, format);
92
80
  }
93
81
  default:
@@ -102,9 +90,7 @@ class LinkFormatter extends _react.default.Component {
102
90
  };
103
91
  }
104
92
  UNSAFE_componentWillReceiveProps(nextProps) {
105
- const {
106
- row: nextRow
107
- } = nextProps;
93
+ const nextRow = nextProps.row;
108
94
  if (nextRow._id !== this.props.row._id) {
109
95
  this.setState({
110
96
  value: this.getLinkedCellValue(nextRow)
@@ -112,9 +98,7 @@ class LinkFormatter extends _react.default.Component {
112
98
  }
113
99
  }
114
100
  render() {
115
- const {
116
- containerClassName
117
- } = this.props;
101
+ const containerClassName = this.props.containerClassName;
118
102
  const classname = (0, _classnames.default)('dtable-ui cell-formatter-container link-formatter', containerClassName);
119
103
  let displayValues = this.getDisplayValues();
120
104
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
package/lib/List/index.js CHANGED
@@ -17,14 +17,12 @@ const _excluded = ["prefixCls", "children", "className", "style", "renderHeader"
17
17
  class List extends React.Component {
18
18
  render() {
19
19
  const _this$props = this.props,
20
- {
21
- prefixCls,
22
- children,
23
- className,
24
- style,
25
- renderHeader,
26
- renderFooter
27
- } = _this$props,
20
+ prefixCls = _this$props.prefixCls,
21
+ children = _this$props.children,
22
+ className = _this$props.className,
23
+ style = _this$props.style,
24
+ renderHeader = _this$props.renderHeader,
25
+ renderFooter = _this$props.renderFooter,
28
26
  restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
29
27
  const wrapCls = (0, _classnames.default)(prefixCls, className);
30
28
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
@@ -28,10 +28,9 @@ class ListItem extends React.Component {
28
28
  constructor(props) {
29
29
  super(props);
30
30
  this.onClick = ev => {
31
- const {
32
- onClick,
33
- platform
34
- } = this.props;
31
+ const _this$props = this.props,
32
+ onClick = _this$props.onClick,
33
+ platform = _this$props.platform;
35
34
  const isAndroid = platform === 'android';
36
35
  if (!!onClick && isAndroid) {
37
36
  if (this.debounceTimeout) {
@@ -81,31 +80,26 @@ class ListItem extends React.Component {
81
80
  }
82
81
  }
83
82
  render() {
84
- const _this$props = this.props,
85
- {
86
- prefixCls,
87
- className,
88
- activeStyle,
89
- error,
90
- align,
91
- wrap,
92
- disabled,
93
- children,
94
- multipleLine,
95
- thumb,
96
- extra,
97
- arrow,
98
- onClick
99
- } = _this$props,
100
- restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
101
- const {
102
- platform
103
- } = restProps,
83
+ const _this$props2 = this.props,
84
+ prefixCls = _this$props2.prefixCls,
85
+ className = _this$props2.className,
86
+ activeStyle = _this$props2.activeStyle,
87
+ error = _this$props2.error,
88
+ align = _this$props2.align,
89
+ wrap = _this$props2.wrap,
90
+ disabled = _this$props2.disabled,
91
+ children = _this$props2.children,
92
+ multipleLine = _this$props2.multipleLine,
93
+ thumb = _this$props2.thumb,
94
+ extra = _this$props2.extra,
95
+ arrow = _this$props2.arrow,
96
+ onClick = _this$props2.onClick,
97
+ restProps = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
98
+ const platform = restProps.platform,
104
99
  otherProps = (0, _objectWithoutProperties2.default)(restProps, _excluded2);
105
- const {
106
- coverRippleStyle,
107
- RippleClicked
108
- } = this.state;
100
+ const _this$state = this.state,
101
+ coverRippleStyle = _this$state.coverRippleStyle,
102
+ RippleClicked = _this$state.RippleClicked;
109
103
  const wrapCls = (0, _classnames.default)("".concat(prefixCls, "-item"), className, {
110
104
  ["".concat(prefixCls, "-item-disabled")]: disabled,
111
105
  ["".concat(prefixCls, "-item-error")]: error,
@@ -10,11 +10,10 @@ var _HtmlLongTextFormatter = _interopRequireDefault(require("../HtmlLongTextForm
10
10
  var _SimpleLongTextFormatter = _interopRequireDefault(require("../SimpleLongTextFormatter"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  function LongTextFormatter(_ref) {
13
- let {
14
- isSample = true,
15
- value,
16
- containerClassName
17
- } = _ref;
13
+ let _ref$isSample = _ref.isSample,
14
+ isSample = _ref$isSample === void 0 ? true : _ref$isSample,
15
+ value = _ref.value,
16
+ containerClassName = _ref.containerClassName;
18
17
  if (isSample) {
19
18
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SimpleLongTextFormatter.default, {
20
19
  value: value,
@@ -9,14 +9,13 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
10
  class MBEditorHeader extends _react.default.Component {
11
11
  render() {
12
- let {
13
- title,
14
- titleClass,
15
- leftContent,
16
- rightContent,
17
- onLeftClick,
18
- onRightClick
19
- } = this.props;
12
+ let _this$props = this.props,
13
+ title = _this$props.title,
14
+ titleClass = _this$props.titleClass,
15
+ leftContent = _this$props.leftContent,
16
+ rightContent = _this$props.rightContent,
17
+ onLeftClick = _this$props.onLeftClick,
18
+ onRightClick = _this$props.onRightClick;
20
19
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
21
20
  className: "dtable-ui-mb-editor-header ".concat(titleClass ? titleClass : ''),
22
21
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -18,10 +18,9 @@ class MTimeFormatter extends _react.default.Component {
18
18
  };
19
19
  }
20
20
  render() {
21
- let {
22
- value: date,
23
- containerClassName
24
- } = this.props;
21
+ let _this$props = this.props,
22
+ date = _this$props.value,
23
+ containerClassName = _this$props.containerClassName;
25
24
  let classname = (0, _classnames.default)('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
26
25
  if (date) {
27
26
  date = this.formatDate(date);
@@ -10,11 +10,9 @@ var _classnames = _interopRequireDefault(require("classnames"));
10
10
  require("./index.css");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  const Body = _ref => {
13
- let {
14
- classNamePrefix,
15
- className,
16
- children
17
- } = _ref;
13
+ let classNamePrefix = _ref.classNamePrefix,
14
+ className = _ref.className,
15
+ children = _ref.children;
18
16
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
19
17
  className: (0, _classnames.default)('dtable-ui-mobile-full-screen-page-body', className, {
20
18
  ["".concat(classNamePrefix, "-mobile-full-screen-page-body")]: classNamePrefix
@@ -10,12 +10,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
10
10
  require("./index.css");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  const Header = _ref => {
13
- let {
14
- classNamePrefix,
15
- children,
16
- onLeftClick,
17
- onRightClick
18
- } = _ref;
13
+ let classNamePrefix = _ref.classNamePrefix,
14
+ children = _ref.children,
15
+ onLeftClick = _ref.onLeftClick,
16
+ onRightClick = _ref.onRightClick;
19
17
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
20
18
  className: (0, _classnames.default)('dtable-ui-mobile-full-screen-page-header p-0', {
21
19
  ["".concat(classNamePrefix, "-mobile-full-screen-page-header")]: classNamePrefix
@@ -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 _BodyPortal = _interopRequireDefault(require("../BodyPortal"));
@@ -15,16 +16,17 @@ var _utils = require("../utils/utils");
15
16
  require("./index.css");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
17
18
  const MobileFullScreenPage = _ref => {
18
- let {
19
- classNamePrefix,
20
- className,
21
- style,
22
- zIndex,
23
- children,
24
- onClose,
25
- historyCallback
26
- } = _ref;
27
- const [isMount, setMount] = (0, _react.useState)(false);
19
+ let classNamePrefix = _ref.classNamePrefix,
20
+ className = _ref.className,
21
+ style = _ref.style,
22
+ zIndex = _ref.zIndex,
23
+ children = _ref.children,
24
+ onClose = _ref.onClose,
25
+ historyCallback = _ref.historyCallback;
26
+ const _useState = (0, _react.useState)(false),
27
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
28
+ isMount = _useState2[0],
29
+ setMount = _useState2[1];
28
30
  const element = (0, _react.useMemo)(() => {
29
31
  let _element = document.createElement('div');
30
32
  _element.setAttribute('tabindex', '-1');
@@ -28,9 +28,7 @@ class MobileModal extends _react.default.PureComponent {
28
28
  }
29
29
  render() {
30
30
  const _this$props = this.props,
31
- {
32
- children
33
- } = _this$props,
31
+ children = _this$props.children,
34
32
  props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
35
33
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
36
34
  popup: true,
@@ -19,11 +19,10 @@ const OPERATION_TYPE = exports.OPERATION_TYPE = {
19
19
  };
20
20
  const OPERATION_TYPES = [OPERATION_TYPE.RENAME, OPERATION_TYPE.DOWNLOAD, OPERATION_TYPE.DELETE];
21
21
  const MobileOperationSheet = _ref => {
22
- let {
23
- onChange,
24
- onClose,
25
- operations = OPERATION_TYPES
26
- } = _ref;
22
+ let onChange = _ref.onChange,
23
+ onClose = _ref.onClose,
24
+ _ref$operations = _ref.operations,
25
+ operations = _ref$operations === void 0 ? OPERATION_TYPES : _ref$operations;
27
26
  const actionSheet = (0, _react.useRef)(_ActionSheet.default);
28
27
  const btns = (0, _react.useMemo)(() => {
29
28
  let _btns = [];
@@ -78,9 +77,9 @@ const MobileOperationSheet = _ref => {
78
77
  maskClosable: true,
79
78
  className: 'dtable-ui-mobile-action-sheet'
80
79
  }, index => {
81
- const {
82
- value = 'close'
83
- } = btns[index] || {};
80
+ const _ref2 = btns[index] || {},
81
+ _ref2$value = _ref2.value,
82
+ value = _ref2$value === void 0 ? 'close' : _ref2$value;
84
83
  if (value === 'close') {
85
84
  onClose && onClose();
86
85
  return;
@@ -11,9 +11,7 @@ var _List = _interopRequireDefault(require("../../List"));
11
11
  require("./index.css");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  const Empty = _ref => {
14
- let {
15
- children
16
- } = _ref;
14
+ let children = _ref.children;
17
15
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_List.default.Item, {
18
16
  className: "dtable-ui-mobile-selector-no-options",
19
17
  children: children
@@ -17,13 +17,11 @@ var _empty = _interopRequireDefault(require("./empty"));
17
17
  require("./index.css");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
19
  const MobileSelector = _ref => {
20
- let {
21
- className,
22
- listClassName,
23
- title,
24
- children,
25
- onClose
26
- } = _ref;
20
+ let className = _ref.className,
21
+ listClassName = _ref.listClassName,
22
+ title = _ref.title,
23
+ children = _ref.children,
24
+ onClose = _ref.onClose;
27
25
  const handleHistoryBack = (0, _react.useCallback)(event => {
28
26
  event.preventDefault();
29
27
  onClose && onClose();