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