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

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