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
@@ -31,11 +31,14 @@ class RowExpandMBGeolocationEditor extends _react.default.Component {
31
31
  this.props.onCommit(value);
32
32
  };
33
33
  this.getLocationInfo = value => {
34
- const _this$props = this.props,
35
- column = _this$props.column,
36
- config = _this$props.config;
37
- const dtableBaiduMapKey = config.dtableBaiduMapKey,
38
- dtableMineMapKey = config.dtableMineMapKey;
34
+ const {
35
+ column,
36
+ config
37
+ } = this.props;
38
+ const {
39
+ dtableBaiduMapKey,
40
+ dtableMineMapKey
41
+ } = config;
39
42
  const isBaiduMap = !!(dtableBaiduMapKey || dtableMineMapKey);
40
43
  return (0, _dtableUtils.getGeolocationDisplayString)(value, column.data, {
41
44
  isBaiduMap,
@@ -43,7 +46,9 @@ class RowExpandMBGeolocationEditor extends _react.default.Component {
43
46
  });
44
47
  };
45
48
  this.renderGeoLocation = () => {
46
- const value = this.state.value;
49
+ const {
50
+ value
51
+ } = this.state;
47
52
  const text = (0, _dtableUtils.isEmptyObject)(value) ? (0, _lang.getLocale)('Edit_Location') : this.getLocationInfo(value);
48
53
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_addBtn.default, {
49
54
  onClick: this.openEditor,
@@ -51,18 +56,22 @@ class RowExpandMBGeolocationEditor extends _react.default.Component {
51
56
  className: "py-4"
52
57
  });
53
58
  };
54
- const row = props.row,
55
- _column = props.column,
56
- valueKey = props.valueKey;
59
+ const {
60
+ row,
61
+ column: _column,
62
+ valueKey
63
+ } = props;
57
64
  this.state = {
58
65
  isShowEditor: false,
59
66
  value: row[_column[valueKey]] || {}
60
67
  };
61
68
  }
62
69
  UNSAFE_componentWillReceiveProps(nextProps) {
63
- const column = nextProps.column,
64
- row = nextProps.row,
65
- valueKey = nextProps.valueKey;
70
+ const {
71
+ column,
72
+ row,
73
+ valueKey
74
+ } = nextProps;
66
75
  if (row._id !== this.props.row._id) {
67
76
  this.setState({
68
77
  value: row[column[valueKey]] || {},
@@ -71,11 +80,14 @@ class RowExpandMBGeolocationEditor extends _react.default.Component {
71
80
  }
72
81
  }
73
82
  render() {
74
- const _this$props2 = this.props,
75
- column = _this$props2.column,
76
- row = _this$props2.row,
77
- config = _this$props2.config;
78
- const value = this.state.value;
83
+ const {
84
+ column,
85
+ row,
86
+ config
87
+ } = this.props;
88
+ const {
89
+ value
90
+ } = this.state;
79
91
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
80
92
  children: [this.renderGeoLocation(), this.state.isShowEditor && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeolocationEditor.default, {
81
93
  column: column,
@@ -69,8 +69,12 @@ class RowExpandPCGeolocationEditor extends _react.default.Component {
69
69
  });
70
70
  };
71
71
  this.renderGeoLocation = () => {
72
- let isEditorFocus = this.props.isEditorFocus;
73
- let value = this.state.value;
72
+ let {
73
+ isEditorFocus
74
+ } = this.props;
75
+ let {
76
+ value
77
+ } = this.state;
74
78
  if (!(0, _dtableUtils.isEmptyObject)(value)) {
75
79
  const displayContent = this.getLocationInfo(value);
76
80
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -93,14 +97,18 @@ class RowExpandPCGeolocationEditor extends _react.default.Component {
93
97
  });
94
98
  };
95
99
  this.getLocationInfo = value => {
96
- const column = this.props.column;
100
+ const {
101
+ column
102
+ } = this.props;
97
103
  return (0, _dtableUtils.getGeolocationDisplayString)(value, column.data, {
98
104
  hyphen: ' '
99
105
  });
100
106
  };
101
- const row = props.row,
102
- _column = props.column,
103
- valueKey = props.valueKey;
107
+ const {
108
+ row,
109
+ column: _column,
110
+ valueKey
111
+ } = props;
104
112
  this.state = {
105
113
  isShowEditor: false,
106
114
  value: row[_column[valueKey]] || {}
@@ -113,9 +121,11 @@ class RowExpandPCGeolocationEditor extends _react.default.Component {
113
121
  document.addEventListener('keydown', this.onKeyDown);
114
122
  }
115
123
  UNSAFE_componentWillReceiveProps(nextProps) {
116
- const column = nextProps.column,
117
- row = nextProps.row,
118
- valueKey = nextProps.valueKey;
124
+ const {
125
+ column,
126
+ row,
127
+ valueKey
128
+ } = nextProps;
119
129
  if (row._id !== this.props.row._id) {
120
130
  this.setState({
121
131
  value: row[column[valueKey]] || {},
@@ -138,10 +148,13 @@ class RowExpandPCGeolocationEditor extends _react.default.Component {
138
148
  document.removeEventListener('keydown', this.onKeyDown);
139
149
  }
140
150
  render() {
141
- const _this$props = this.props,
142
- column = _this$props.column,
143
- config = _this$props.config;
144
- const value = this.state.value;
151
+ const {
152
+ column,
153
+ config
154
+ } = this.props;
155
+ const {
156
+ value
157
+ } = this.state;
145
158
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
146
159
  ref: ref => this.editorContainer = ref,
147
160
  className: "mt-2",
@@ -41,8 +41,12 @@ class RowExpandMBImageEditor extends _react.default.Component {
41
41
  this.props.onCommit(updatedValue);
42
42
  };
43
43
  this.renderImages = () => {
44
- const value = this.state.value;
45
- const config = this.props.config;
44
+ const {
45
+ value
46
+ } = this.state;
47
+ const {
48
+ config
49
+ } = this.props;
46
50
  return value.map((src, index) => {
47
51
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageThumbnail.default, {
48
52
  index: index,
@@ -54,18 +58,22 @@ class RowExpandMBImageEditor extends _react.default.Component {
54
58
  }, "image-".concat(index));
55
59
  });
56
60
  };
57
- const column = props.column,
58
- row = props.row,
59
- valueKey = props.valueKey;
61
+ const {
62
+ column,
63
+ row,
64
+ valueKey
65
+ } = props;
60
66
  this.state = {
61
67
  isShowEditor: false,
62
68
  value: row[column[valueKey]] || []
63
69
  };
64
70
  }
65
71
  UNSAFE_componentWillReceiveProps(nextProps) {
66
- const column = nextProps.column,
67
- row = nextProps.row,
68
- valueKey = nextProps.valueKey;
72
+ const {
73
+ column,
74
+ row,
75
+ valueKey
76
+ } = nextProps;
69
77
  if (row._id !== this.props.row._id) {
70
78
  this.setState({
71
79
  value: row[column[valueKey]] || [],
@@ -74,13 +82,15 @@ class RowExpandMBImageEditor extends _react.default.Component {
74
82
  }
75
83
  }
76
84
  render() {
77
- const _this$props = this.props,
78
- column = _this$props.column,
79
- config = _this$props.config,
80
- uploadFile = _this$props.uploadFile;
81
- const _this$state = this.state,
82
- isShowEditor = _this$state.isShowEditor,
83
- value = _this$state.value;
85
+ const {
86
+ column,
87
+ config,
88
+ uploadFile
89
+ } = this.props;
90
+ const {
91
+ isShowEditor,
92
+ value
93
+ } = this.state;
84
94
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
85
95
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
86
96
  className: "dtable-ui-mobile-row-expand-image position-relative",
@@ -65,11 +65,14 @@ class RowExpandPCImageEditor extends _react.default.Component {
65
65
  this.setLargeImageIndex(-1);
66
66
  };
67
67
  this.getValue = () => {
68
- let _this$props = this.props,
69
- column = _this$props.column,
70
- row = _this$props.row,
71
- valueKey = _this$props.valueKey;
72
- let imageContainer = this.state.imageContainer;
68
+ let {
69
+ column,
70
+ row,
71
+ valueKey
72
+ } = this.props;
73
+ let {
74
+ imageContainer
75
+ } = this.state;
73
76
  return imageContainer ? imageContainer : row[column[valueKey]];
74
77
  };
75
78
  this.deleteImage = index => {
@@ -82,7 +85,9 @@ class RowExpandPCImageEditor extends _react.default.Component {
82
85
  this.props.onCommit(updatedValue);
83
86
  };
84
87
  this.getImageArray = value => {
85
- const config = this.props.config;
88
+ const {
89
+ config
90
+ } = this.props;
86
91
  return value.map((imageSrc, index) => {
87
92
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageThumbnail.default, {
88
93
  index: index,
@@ -103,9 +108,11 @@ class RowExpandPCImageEditor extends _react.default.Component {
103
108
  document.addEventListener('keydown', this.onKeyDown);
104
109
  }
105
110
  UNSAFE_componentWillReceiveProps(nextProps) {
106
- const column = nextProps.column,
107
- row = nextProps.row,
108
- valueKey = nextProps.valueKey;
111
+ const {
112
+ column,
113
+ row,
114
+ valueKey
115
+ } = nextProps;
109
116
  if (row._id !== this.props.row._id) {
110
117
  this.setState({
111
118
  imageContainer: row[column[valueKey]] || [],
@@ -128,10 +135,13 @@ class RowExpandPCImageEditor extends _react.default.Component {
128
135
  document.removeEventListener('keydown', this.onKeyDown);
129
136
  }
130
137
  render() {
131
- const isEditorFocus = this.props.isEditorFocus;
132
- let _this$state = this.state,
133
- isShowImageEditor = _this$state.isShowImageEditor,
134
- largeImageIndex = _this$state.largeImageIndex;
138
+ const {
139
+ isEditorFocus
140
+ } = this.props;
141
+ let {
142
+ isShowImageEditor,
143
+ largeImageIndex
144
+ } = this.state;
135
145
  let value = this.getValue();
136
146
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
137
147
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -12,14 +12,18 @@ var _constants = require("./constants");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  const _excluded = ["column", "component"];
14
14
  const RowExpandEditor = _ref => {
15
- let column = _ref.column,
16
- component = _ref.component,
15
+ let {
16
+ column,
17
+ component
18
+ } = _ref,
17
19
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
18
20
  const components = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _constants.CELL_EDITOR_MAP), component);
19
21
  const Editor = components[column.type];
20
22
  if (!Editor) return null;
21
- const row = props.row,
22
- valueKey = props.valueKey;
23
+ const {
24
+ row,
25
+ valueKey
26
+ } = props;
23
27
  const value = row[column[valueKey]];
24
28
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Editor, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
25
29
  value: value,
@@ -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 _seafileEditor = require("@seafile/seafile-editor");
12
11
  var _TextareaItem = _interopRequireDefault(require("../../../../TextareaItem"));
@@ -14,17 +13,18 @@ var _MobileFullScreenPage = _interopRequireDefault(require("../../../../MobileFu
14
13
  var _lang = require("../../../../lang");
15
14
  require("./index.css");
16
15
  var _jsxRuntime = require("react/jsx-runtime");
17
- const Header = _MobileFullScreenPage.default.Header,
18
- Body = _MobileFullScreenPage.default.Body;
16
+ const {
17
+ Header,
18
+ Body
19
+ } = _MobileFullScreenPage.default;
19
20
  const Editor = _ref => {
20
- let oldValue = _ref.value,
21
- title = _ref.title,
22
- onToggle = _ref.onToggle,
23
- onChange = _ref.onChange;
24
- const _useState = (0, _react.useState)(oldValue || ''),
25
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
26
- value = _useState2[0],
27
- setValue = _useState2[1];
21
+ let {
22
+ value: oldValue,
23
+ title,
24
+ onToggle,
25
+ onChange
26
+ } = _ref;
27
+ const [value, setValue] = (0, _react.useState)(oldValue || '');
28
28
  const hasUnSaved = (0, _react.useRef)(false);
29
29
  const rowCounts = (0, _react.useMemo)(() => document.body.offsetWidth < 768 ? 10 : 20, []);
30
30
  const handleTextChange = (0, _react.useCallback)(newValue => {
@@ -34,11 +34,12 @@ const Editor = _ref => {
34
34
  }, [value]);
35
35
  const onSave = (0, _react.useCallback)(() => {
36
36
  if (!hasUnSaved.current) return;
37
- const _getPreviewContent = (0, _seafileEditor.getPreviewContent)(value),
38
- previewText = _getPreviewContent.previewText,
39
- images = _getPreviewContent.images,
40
- links = _getPreviewContent.links,
41
- checklist = _getPreviewContent.checklist;
37
+ const {
38
+ previewText,
39
+ images,
40
+ links,
41
+ checklist
42
+ } = (0, _seafileEditor.getPreviewContent)(value);
42
43
  const newValue = Object.assign({}, {
43
44
  text: value,
44
45
  preview: previewText,
@@ -48,12 +48,15 @@ class RowExpandMBLongTextEditor extends _react.default.Component {
48
48
  }
49
49
  UNSAFE_componentWillReceiveProps(nextProps) {
50
50
  var _this$editorRef, _this$editorRef$curre;
51
- const column = nextProps.column,
52
- row = nextProps.row,
53
- valueKey = nextProps.valueKey;
54
- const _this$props = this.props,
55
- currentColumn = _this$props.column,
56
- currentRow = _this$props.row;
51
+ const {
52
+ column,
53
+ row,
54
+ valueKey
55
+ } = nextProps;
56
+ const {
57
+ column: currentColumn,
58
+ row: currentRow
59
+ } = this.props;
57
60
  const value = row[column[valueKey]];
58
61
  const currentValue = currentRow[currentColumn[valueKey]];
59
62
  if (value !== currentValue && !((_this$editorRef = this.editorRef) !== null && _this$editorRef !== void 0 && (_this$editorRef$curre = _this$editorRef.current) !== null && _this$editorRef$curre !== void 0 && _this$editorRef$curre.enableEdit)) {
@@ -61,10 +64,13 @@ class RowExpandMBLongTextEditor extends _react.default.Component {
61
64
  }
62
65
  }
63
66
  render() {
64
- const column = this.props.column;
65
- const _this$state = this.state,
66
- innerHtml = _this$state.innerHtml,
67
- isShowEditor = _this$state.isShowEditor;
67
+ const {
68
+ column
69
+ } = this.props;
70
+ const {
71
+ innerHtml,
72
+ isShowEditor
73
+ } = this.state;
68
74
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
69
75
  children: [innerHtml ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
70
76
  className: "dtable-ui-mobile-long-text-formatter article py-2",
@@ -47,7 +47,9 @@ class RowExpandPCLongTextEditor extends _react.default.Component {
47
47
  this.editorRef.current.closeEditor();
48
48
  };
49
49
  this.onClick = () => {
50
- const columnIndex = this.props.columnIndex;
50
+ const {
51
+ columnIndex
52
+ } = this.props;
51
53
  this.props.updateTabIndex && this.props.updateTabIndex(columnIndex);
52
54
  };
53
55
  this.state = {
@@ -61,14 +63,17 @@ class RowExpandPCLongTextEditor extends _react.default.Component {
61
63
  }
62
64
  UNSAFE_componentWillReceiveProps(nextProps) {
63
65
  var _this$editorRef, _this$editorRef$curre;
64
- const column = nextProps.column,
65
- row = nextProps.row,
66
- nextIsEditorFocus = nextProps.isEditorFocus,
67
- valueKey = nextProps.valueKey;
68
- const _this$props = this.props,
69
- currentColumn = _this$props.column,
70
- currentRow = _this$props.row,
71
- isEditorFocus = _this$props.isEditorFocus;
66
+ const {
67
+ column,
68
+ row,
69
+ isEditorFocus: nextIsEditorFocus,
70
+ valueKey
71
+ } = nextProps;
72
+ const {
73
+ column: currentColumn,
74
+ row: currentRow,
75
+ isEditorFocus
76
+ } = this.props;
72
77
  const value = row[column[valueKey]];
73
78
  const currentValue = currentRow[currentColumn[valueKey]];
74
79
  if (value !== currentValue && !((_this$editorRef = this.editorRef) !== null && _this$editorRef !== void 0 && (_this$editorRef$curre = _this$editorRef.current) !== null && _this$editorRef$curre !== void 0 && _this$editorRef$curre.enableEdit)) {
@@ -86,13 +91,15 @@ class RowExpandPCLongTextEditor extends _react.default.Component {
86
91
  }
87
92
  }
88
93
  render() {
89
- const _this$props2 = this.props,
90
- column = _this$props2.column,
91
- longTextEditorAPI = _this$props2.longTextEditorAPI,
92
- longTextEditorI18n = _this$props2.longTextEditorI18n;
93
- const _this$state = this.state,
94
- isLoading = _this$state.isLoading,
95
- value = _this$state.value;
94
+ const {
95
+ column,
96
+ longTextEditorAPI,
97
+ longTextEditorI18n
98
+ } = this.props;
99
+ const {
100
+ isLoading,
101
+ value
102
+ } = this.state;
96
103
  if (isLoading) return null;
97
104
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Suspense, {
98
105
  fallback: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -19,7 +19,9 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
19
19
  constructor(_props) {
20
20
  super(_props);
21
21
  this.getOptions = props => {
22
- const column = props.column;
22
+ const {
23
+ column
24
+ } = props;
23
25
  return (0, _dtableUtils.getColumnOptions)(column);
24
26
  };
25
27
  this.toggleEditor = value => {
@@ -63,7 +65,9 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
63
65
  this.props.onCommit(newValue);
64
66
  };
65
67
  this.renderOptions = () => {
66
- const value = this.state.value;
68
+ const {
69
+ value
70
+ } = this.state;
67
71
  let displayOptions = [];
68
72
  if (Array.isArray(value)) {
69
73
  const selectedOptions = this.options.filter(option => value.includes(option[this.key]));
@@ -110,8 +114,10 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
110
114
  this.options = this.getOptions(_props);
111
115
  }
112
116
  UNSAFE_componentWillReceiveProps(nextProps) {
113
- const value = nextProps.value,
114
- column = nextProps.column;
117
+ const {
118
+ value,
119
+ column
120
+ } = nextProps;
115
121
  if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
116
122
  this.options = this.getOptions(nextProps);
117
123
  this.setState({
@@ -121,13 +127,15 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
121
127
  }
122
128
  }
123
129
  render() {
124
- const _this$props = this.props,
125
- column = _this$props.column,
126
- isSupportNewOption = _this$props.isSupportNewOption,
127
- onAddNewOption = _this$props.onAddNewOption;
128
- const _this$state = this.state,
129
- showEditor = _this$state.showEditor,
130
- value = _this$state.value;
130
+ const {
131
+ column,
132
+ isSupportNewOption,
133
+ onAddNewOption
134
+ } = this.props;
135
+ const {
136
+ showEditor,
137
+ value
138
+ } = this.state;
131
139
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
132
140
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
133
141
  className: "dtable-ui dtable-ui-mobile-row-expand-options-editor position-relative",
@@ -18,7 +18,9 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
18
18
  constructor(_props) {
19
19
  super(_props);
20
20
  this.getOptions = props => {
21
- const column = props.column;
21
+ const {
22
+ column
23
+ } = props;
22
24
  return (0, _dtableUtils.getColumnOptions)(column);
23
25
  };
24
26
  this.onKeyDown = e => {
@@ -49,9 +51,10 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
49
51
  this.onToggleSelect = e => {
50
52
  e.preventDefault();
51
53
  e.stopPropagation();
52
- const _this$props = this.props,
53
- updateTabIndex = _this$props.updateTabIndex,
54
- columnIndex = _this$props.columnIndex;
54
+ const {
55
+ updateTabIndex,
56
+ columnIndex
57
+ } = this.props;
55
58
  updateTabIndex && updateTabIndex(columnIndex);
56
59
  this.toggleSingleSelect(true);
57
60
  };
@@ -59,9 +62,10 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
59
62
  this.toggleSingleSelect(false);
60
63
  };
61
64
  this.onFocus = () => {
62
- const _this$props2 = this.props,
63
- updateTabIndex = _this$props2.updateTabIndex,
64
- columnIndex = _this$props2.columnIndex;
65
+ const {
66
+ updateTabIndex,
67
+ columnIndex
68
+ } = this.props;
65
69
  updateTabIndex && updateTabIndex(columnIndex);
66
70
  };
67
71
  this.onChange = option => {
@@ -83,7 +87,9 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
83
87
  this.onChange(option);
84
88
  };
85
89
  this.getMultipleSelectList = () => {
86
- const value = this.state.value;
90
+ const {
91
+ value
92
+ } = this.state;
87
93
  if (!Array.isArray(value)) return [];
88
94
  const selectedOptions = this.options.filter(option => value.includes(option[this.key]));
89
95
  const selectedOptionIds = selectedOptions.map(option => option[this.key]);
@@ -144,10 +150,11 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
144
150
  }));
145
151
  };
146
152
  this.renderOptions = () => {
147
- const _this$props3 = this.props,
148
- isEditorFocus = _this$props3.isEditorFocus,
149
- classNamePrefix = _this$props3.classNamePrefix,
150
- placeholder = _this$props3.placeholder;
153
+ const {
154
+ isEditorFocus,
155
+ classNamePrefix,
156
+ placeholder
157
+ } = this.props;
151
158
  const options = this.getMultipleSelectList();
152
159
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
153
160
  tabIndex: 0,
@@ -194,8 +201,10 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
194
201
  document.addEventListener('keydown', this.onKeyDown);
195
202
  }
196
203
  UNSAFE_componentWillReceiveProps(nextProps) {
197
- const value = nextProps.value,
198
- column = nextProps.column;
204
+ const {
205
+ value,
206
+ column
207
+ } = nextProps;
199
208
  if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
200
209
  this.options = this.getOptions(nextProps);
201
210
  this.setState({
@@ -218,14 +227,16 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
218
227
  document.removeEventListener('keydown', this.onKeyDown);
219
228
  }
220
229
  render() {
221
- const _this$props4 = this.props,
222
- column = _this$props4.column,
223
- isSupportNewOption = _this$props4.isSupportNewOption,
224
- onAddNewOption = _this$props4.onAddNewOption,
225
- classNamePrefix = _this$props4.classNamePrefix;
226
- const _this$state = this.state,
227
- showSelectPopover = _this$state.showSelectPopover,
228
- value = _this$state.value;
230
+ const {
231
+ column,
232
+ isSupportNewOption,
233
+ onAddNewOption,
234
+ classNamePrefix
235
+ } = this.props;
236
+ const {
237
+ showSelectPopover,
238
+ value
239
+ } = this.state;
229
240
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
230
241
  className: "position-relative w-100",
231
242
  ref: ref => this.ref = ref,
@@ -35,22 +35,28 @@ class RowExpandMBNumberEditor extends _react.default.Component {
35
35
  isShowEditor: false
36
36
  });
37
37
  };
38
- const column = props.column,
39
- row = props.row;
38
+ const {
39
+ column,
40
+ row
41
+ } = props;
40
42
  this.state = {
41
43
  isShowEditor: false,
42
44
  value: row[column.key]
43
45
  };
44
46
  }
45
47
  render() {
46
- const column = this.props.column;
47
- const _this$state = this.state,
48
- value = _this$state.value,
49
- isShowEditor = _this$state.isShowEditor;
48
+ const {
49
+ column
50
+ } = this.props;
51
+ const {
52
+ value,
53
+ isShowEditor
54
+ } = this.state;
50
55
  let formatValue = '';
51
56
  if (!isShowEditor && (0, _dtableUtils.isNumber)(value)) {
52
- const _column$data = column.data,
53
- data = _column$data === void 0 ? {} : _column$data;
57
+ const {
58
+ data = {}
59
+ } = column;
54
60
  formatValue = (0, _dtableUtils.getNumberDisplayString)(value, data);
55
61
  }
56
62
  const dom = isShowEditor ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_NumberEditor.default, {