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
@@ -34,17 +34,21 @@ class RowExpandPCNumberEditor extends _react.default.Component {
34
34
  isShowEditor: false
35
35
  });
36
36
  };
37
- const column = props.column,
38
- row = props.row,
39
- isEditorFocus = props.isEditorFocus;
37
+ const {
38
+ column,
39
+ row,
40
+ isEditorFocus
41
+ } = props;
40
42
  this.state = {
41
43
  isShowEditor: isEditorFocus || false,
42
44
  value: row[column.key]
43
45
  };
44
46
  }
45
47
  UNSAFE_componentWillReceiveProps(nextProps) {
46
- const column = nextProps.column,
47
- row = nextProps.row;
48
+ const {
49
+ column,
50
+ row
51
+ } = nextProps;
48
52
  if (row._id !== this.props.row._id) {
49
53
  this.setState({
50
54
  value: row[column.key],
@@ -62,12 +66,14 @@ class RowExpandPCNumberEditor extends _react.default.Component {
62
66
  }
63
67
  }
64
68
  render() {
65
- let _this$props = this.props,
66
- column = _this$props.column,
67
- isInModal = _this$props.isInModal;
68
- let _this$state = this.state,
69
- value = _this$state.value,
70
- isShowEditor = _this$state.isShowEditor;
69
+ let {
70
+ column,
71
+ isInModal
72
+ } = this.props;
73
+ let {
74
+ value,
75
+ isShowEditor
76
+ } = this.state;
71
77
  if (isShowEditor) {
72
78
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NumberEditor.default, {
73
79
  isInModal: isInModal,
@@ -79,8 +85,9 @@ class RowExpandPCNumberEditor extends _react.default.Component {
79
85
  }
80
86
  let formatValue = '';
81
87
  if ((0, _dtableUtils.isNumber)(value)) {
82
- let _column$data = column.data,
83
- data = _column$data === void 0 ? {} : _column$data;
88
+ let {
89
+ data = {}
90
+ } = column;
84
91
  formatValue = (0, _dtableUtils.getNumberDisplayString)(value, data);
85
92
  }
86
93
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -13,7 +13,9 @@ class RowExpandMBRateEditor extends _react.default.Component {
13
13
  super(props);
14
14
  this.onChangeRateNumber = index => {
15
15
  if (!this.canEdit) return;
16
- const value = this.state.value;
16
+ const {
17
+ value
18
+ } = this.state;
17
19
  const newValue = value === index ? '' : index;
18
20
  this.setState({
19
21
  value: newValue
@@ -21,12 +23,17 @@ class RowExpandMBRateEditor extends _react.default.Component {
21
23
  this.props.onCommit(newValue);
22
24
  };
23
25
  this.getRateMaxStar = () => {
24
- const value = this.state.value;
25
- const column = this.props.column;
26
- const _ref = column.data || {},
27
- rate_max_number = _ref.rate_max_number,
28
- rate_style_color = _ref.rate_style_color,
29
- rate_style_type = _ref.rate_style_type;
26
+ const {
27
+ value
28
+ } = this.state;
29
+ const {
30
+ column
31
+ } = this.props;
32
+ const {
33
+ rate_max_number,
34
+ rate_style_color,
35
+ rate_style_type
36
+ } = column.data || {};
30
37
  const rateShowType = rate_style_type ? rate_style_type : 'dtable-icon-rate';
31
38
  let rateList = [];
32
39
  for (let i = 0; i < rate_max_number; i++) {
@@ -52,14 +59,20 @@ class RowExpandMBRateEditor extends _react.default.Component {
52
59
  this.state = {
53
60
  value: props.value || ''
54
61
  };
55
- let _column = this.props.column;
56
- const editable = _column.editable;
62
+ let {
63
+ column: _column
64
+ } = this.props;
65
+ const {
66
+ editable
67
+ } = _column;
57
68
  this.canEdit = editable;
58
69
  }
59
70
  UNSAFE_componentWillReceiveProps(nextProps) {
60
- const column = nextProps.column,
61
- row = nextProps.row,
62
- valueKey = nextProps.valueKey;
71
+ const {
72
+ column,
73
+ row,
74
+ valueKey
75
+ } = nextProps;
63
76
  if (row._id !== this.props.row._id) {
64
77
  this.setState({
65
78
  value: row[column[valueKey]] || ''
@@ -15,12 +15,14 @@ class RowExpandPCRateEditor extends _react.default.Component {
15
15
  super(props);
16
16
  this.onKeyDown = event => {
17
17
  event.stopPropagation();
18
- const _this$props = this.props,
19
- isEditorFocus = _this$props.isEditorFocus,
20
- column = _this$props.column;
18
+ const {
19
+ isEditorFocus,
20
+ column
21
+ } = this.props;
21
22
  if (!isEditorFocus || !this.canEdit) return;
22
- const _ref = column.data || {},
23
- rate_max_number = _ref.rate_max_number;
23
+ const {
24
+ rate_max_number
25
+ } = column.data || {};
24
26
  const currentInputNum = Number(event.key);
25
27
  const isValidNumber = currentInputNum <= rate_max_number;
26
28
  if (isValidNumber) {
@@ -30,7 +32,9 @@ class RowExpandPCRateEditor extends _react.default.Component {
30
32
  this.onChangeRateNumber = index => {
31
33
  this.props.updateTabIndex(this.props.columnIndex);
32
34
  if (!this.canEdit) return;
33
- const value = this.state.value;
35
+ const {
36
+ value
37
+ } = this.state;
34
38
  let newValue = value === index ? '' : index;
35
39
  this.setState({
36
40
  value: newValue
@@ -52,16 +56,22 @@ class RowExpandPCRateEditor extends _react.default.Component {
52
56
  }
53
57
  };
54
58
  this.getRateMaxStar = () => {
55
- const _this$state = this.state,
56
- enterRateItemIndex = _this$state.enterRateItemIndex,
57
- value = _this$state.value;
58
- const column = this.props.column;
59
- const _ref2 = column.data || {},
60
- rate_max_number = _ref2.rate_max_number,
61
- rate_style_color = _ref2.rate_style_color,
62
- rate_style_type = _ref2.rate_style_type;
59
+ const {
60
+ enterRateItemIndex,
61
+ value
62
+ } = this.state;
63
+ const {
64
+ column
65
+ } = this.props;
66
+ const {
67
+ rate_max_number,
68
+ rate_style_color,
69
+ rate_style_type
70
+ } = column.data || {};
63
71
  const rateShowType = rate_style_type ? rate_style_type : 'dtable-icon-rate';
64
- const editable = column.editable;
72
+ const {
73
+ editable
74
+ } = column;
65
75
  let rateList = [];
66
76
  for (let i = 0; i < rate_max_number; i++) {
67
77
  const rateItemIndex = i + 1;
@@ -94,14 +104,20 @@ class RowExpandPCRateEditor extends _react.default.Component {
94
104
  value: props.value || '',
95
105
  enterRateItemIndex: -1
96
106
  };
97
- let _column = this.props.column;
98
- const _editable = _column.editable;
107
+ let {
108
+ column: _column
109
+ } = this.props;
110
+ const {
111
+ editable: _editable
112
+ } = _column;
99
113
  this.canEdit = _editable;
100
114
  }
101
115
  UNSAFE_componentWillReceiveProps(nextProps) {
102
- const column = nextProps.column,
103
- row = nextProps.row,
104
- valueKey = nextProps.valueKey;
116
+ const {
117
+ column,
118
+ row,
119
+ valueKey
120
+ } = nextProps;
105
121
  if (row._id !== this.props.row._id) {
106
122
  this.setState({
107
123
  value: row[column[valueKey]] || ''
@@ -21,14 +21,19 @@ class RowExpandMBSingleSelectEditor extends _react.default.Component {
21
21
  constructor(_props) {
22
22
  super(_props);
23
23
  this.getOptions = props => {
24
- const column = props.column,
25
- row = props.row,
26
- columns = props.columns;
24
+ const {
25
+ column,
26
+ row,
27
+ columns
28
+ } = props;
27
29
  const options = (0, _dtableUtils.getColumnOptions)(column);
28
- const data = column.data;
29
- const _ref = data || {},
30
- cascade_column_key = _ref.cascade_column_key,
31
- cascade_settings = _ref.cascade_settings;
30
+ const {
31
+ data
32
+ } = column;
33
+ const {
34
+ cascade_column_key,
35
+ cascade_settings
36
+ } = data || {};
32
37
  if (cascade_column_key && Array.isArray(columns)) {
33
38
  const cascadeColumn = columns.find(c => c.key === cascade_column_key);
34
39
  if (cascadeColumn) {
@@ -65,7 +70,9 @@ class RowExpandMBSingleSelectEditor extends _react.default.Component {
65
70
  this.toggleEditor(false);
66
71
  };
67
72
  this.renderOption = () => {
68
- const value = this.state.value;
73
+ const {
74
+ value
75
+ } = this.state;
69
76
  let option = this.options.find(o => o[this.key] === value);
70
77
  option = (0, _objectSpread2.default)({
71
78
  name: (0, _lang.getLocale)(_constants.DELETED_OPTION_TIPS),
@@ -93,8 +100,10 @@ class RowExpandMBSingleSelectEditor extends _react.default.Component {
93
100
  this.options = this.getOptions(_props);
94
101
  }
95
102
  UNSAFE_componentWillReceiveProps(nextProps) {
96
- const value = nextProps.value,
97
- column = nextProps.column;
103
+ const {
104
+ value,
105
+ column
106
+ } = nextProps;
98
107
  if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
99
108
  this.options = this.getOptions(nextProps);
100
109
  this.setState({
@@ -104,13 +113,15 @@ class RowExpandMBSingleSelectEditor extends _react.default.Component {
104
113
  }
105
114
  }
106
115
  render() {
107
- const _this$props = this.props,
108
- column = _this$props.column,
109
- isSupportNewOption = _this$props.isSupportNewOption,
110
- onAddNewOption = _this$props.onAddNewOption;
111
- const _this$state = this.state,
112
- showEditor = _this$state.showEditor,
113
- value = _this$state.value;
116
+ const {
117
+ column,
118
+ isSupportNewOption,
119
+ onAddNewOption
120
+ } = this.props;
121
+ const {
122
+ showEditor,
123
+ value
124
+ } = this.state;
114
125
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
115
126
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
116
127
  className: "dtable-ui dtable-ui-mobile-row-expand-options-editor position-relative",
@@ -18,14 +18,19 @@ class RowExpandPCSingleSelectEditor extends _react.default.Component {
18
18
  constructor(_props) {
19
19
  super(_props);
20
20
  this.getOptions = props => {
21
- const column = props.column,
22
- row = props.row,
23
- columns = props.columns;
21
+ const {
22
+ column,
23
+ row,
24
+ columns
25
+ } = props;
24
26
  const options = (0, _dtableUtils.getColumnOptions)(column);
25
- const data = column.data;
26
- const _ref = data || {},
27
- cascade_column_key = _ref.cascade_column_key,
28
- cascade_settings = _ref.cascade_settings;
27
+ const {
28
+ data
29
+ } = column;
30
+ const {
31
+ cascade_column_key,
32
+ cascade_settings
33
+ } = data || {};
29
34
  if (cascade_column_key && Array.isArray(columns)) {
30
35
  const cascadeColumn = columns.find(c => c.key === cascade_column_key);
31
36
  if (cascadeColumn) {
@@ -86,11 +91,14 @@ class RowExpandPCSingleSelectEditor extends _react.default.Component {
86
91
  this.toggleSingleSelect(false);
87
92
  };
88
93
  this.renderOption = () => {
89
- const _this$props = this.props,
90
- isEditorFocus = _this$props.isEditorFocus,
91
- classNamePrefix = _this$props.classNamePrefix,
92
- placeholder = _this$props.placeholder;
93
- const value = this.state.value;
94
+ const {
95
+ isEditorFocus,
96
+ classNamePrefix,
97
+ placeholder
98
+ } = this.props;
99
+ const {
100
+ value
101
+ } = this.state;
94
102
  const option = this.options.find(o => o[this.key] === value);
95
103
  const optionStyle = option ? {
96
104
  backgroundColor: option.color,
@@ -145,8 +153,10 @@ class RowExpandPCSingleSelectEditor extends _react.default.Component {
145
153
  document.addEventListener('keydown', this.onKeyDown);
146
154
  }
147
155
  UNSAFE_componentWillReceiveProps(nextProps) {
148
- const value = nextProps.value,
149
- column = nextProps.column;
156
+ const {
157
+ value,
158
+ column
159
+ } = nextProps;
150
160
  if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
151
161
  this.options = this.getOptions(nextProps);
152
162
  this.setState({
@@ -170,14 +180,16 @@ class RowExpandPCSingleSelectEditor extends _react.default.Component {
170
180
  document.removeEventListener('keydown', this.onKeyDown);
171
181
  }
172
182
  render() {
173
- const _this$props2 = this.props,
174
- isSupportNewOption = _this$props2.isSupportNewOption,
175
- onAddNewOption = _this$props2.onAddNewOption,
176
- column = _this$props2.column,
177
- classNamePrefix = _this$props2.classNamePrefix;
178
- const _this$state = this.state,
179
- isShowEditor = _this$state.isShowEditor,
180
- value = _this$state.value;
183
+ const {
184
+ isSupportNewOption,
185
+ onAddNewOption,
186
+ column,
187
+ classNamePrefix
188
+ } = this.props;
189
+ const {
190
+ isShowEditor,
191
+ value
192
+ } = this.state;
181
193
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
182
194
  className: "position-relative w-100",
183
195
  ref: ref => this.ref = ref,
@@ -19,10 +19,11 @@ class RowExpandMBTextEditor extends _react.default.Component {
19
19
  this.editor = null;
20
20
  }
21
21
  render() {
22
- const _this$props = this.props,
23
- readOnly = _this$props.readOnly,
24
- column = _this$props.column,
25
- value = _this$props.value;
22
+ const {
23
+ readOnly,
24
+ column,
25
+ value
26
+ } = this.props;
26
27
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
27
28
  className: "dtable-ui-mobile-row-expand-input-editor-container",
28
29
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditor.default, {
@@ -35,9 +35,10 @@ class RowExpandPCTextEditor extends _react.default.Component {
35
35
  }, 1);
36
36
  };
37
37
  this.onCommit = () => {
38
- const _this$props = this.props,
39
- isRequired = _this$props.isRequired,
40
- column = _this$props.column;
38
+ const {
39
+ isRequired,
40
+ column
41
+ } = this.props;
41
42
  const value = this.editor.getValue();
42
43
  if (isRequired && (0, _columnUtils.isEnableCheckFormat)(column)) {
43
44
  this.checked = true;
@@ -46,7 +47,9 @@ class RowExpandPCTextEditor extends _react.default.Component {
46
47
  this.props.onCommit(value);
47
48
  };
48
49
  this.checkField = () => {
49
- const column = this.props.column;
50
+ const {
51
+ column
52
+ } = this.props;
50
53
  const text = this.editor.getValue();
51
54
  this.validValue = (0, _cell.checkValueConformityFormat)(column.data, text);
52
55
  this.setState({
@@ -60,10 +63,11 @@ class RowExpandPCTextEditor extends _react.default.Component {
60
63
  this.blurInput();
61
64
  return;
62
65
  }
63
- const _event$currentTarget = event.currentTarget,
64
- selectionStart = _event$currentTarget.selectionStart,
65
- selectionEnd = _event$currentTarget.selectionEnd,
66
- value = _event$currentTarget.value;
66
+ const {
67
+ selectionStart,
68
+ selectionEnd,
69
+ value
70
+ } = event.currentTarget;
67
71
  if (event.keyCode === _constants.KeyCodes.ChineseInputMethod || event.keyCode === _constants.KeyCodes.LeftArrow && selectionStart === 0 || event.keyCode === _constants.KeyCodes.RightArrow && selectionEnd === value.length) {
68
72
  event.stopPropagation();
69
73
  }
@@ -89,13 +93,17 @@ class RowExpandPCTextEditor extends _react.default.Component {
89
93
  this.checkingField = null;
90
94
  }
91
95
  componentDidMount() {
92
- const isEditorFocus = this.props.isEditorFocus;
96
+ const {
97
+ isEditorFocus
98
+ } = this.props;
93
99
  if (isEditorFocus) {
94
100
  this.focusInput();
95
101
  }
96
102
  }
97
103
  UNSAFE_componentWillReceiveProps(nextProps) {
98
- const isEditorFocus = nextProps.isEditorFocus;
104
+ const {
105
+ isEditorFocus
106
+ } = nextProps;
99
107
  if (isEditorFocus && !this.props.isEditorFocus) {
100
108
  this.focusInput();
101
109
  } else if (!isEditorFocus && this.props.isEditorFocus) {
@@ -103,11 +111,14 @@ class RowExpandPCTextEditor extends _react.default.Component {
103
111
  }
104
112
  }
105
113
  render() {
106
- const _this$props2 = this.props,
107
- readOnly = _this$props2.readOnly,
108
- column = _this$props2.column,
109
- value = _this$props2.value;
110
- const inconformityFormat = this.state.inconformityFormat;
114
+ const {
115
+ readOnly,
116
+ column,
117
+ value
118
+ } = this.props;
119
+ const {
120
+ inconformityFormat
121
+ } = this.state;
111
122
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
112
123
  className: "dtable-ui-row-expand-simple-text-editor-container",
113
124
  ref: this.setEditorRef,
@@ -15,7 +15,9 @@ class RowExpandMBUrlEditor extends _react.default.Component {
15
15
  constructor(props) {
16
16
  super(props);
17
17
  this.onBlur = () => {
18
- const onCommit = this.props.onCommit;
18
+ const {
19
+ onCommit
20
+ } = this.props;
19
21
  onCommit(this.state.value.trim());
20
22
  };
21
23
  this.onChange = e => {
@@ -32,7 +34,9 @@ class RowExpandMBUrlEditor extends _react.default.Component {
32
34
  e.stopPropagation();
33
35
  };
34
36
  this.onOpenUrlLink = () => {
35
- const value = this.state.value;
37
+ const {
38
+ value
39
+ } = this.state;
36
40
  let newValue = value.trim();
37
41
  if (!(0, _utils.isValidUrl)(newValue)) {
38
42
  newValue = "http://".concat(newValue);
@@ -48,8 +52,10 @@ class RowExpandMBUrlEditor extends _react.default.Component {
48
52
  };
49
53
  }
50
54
  UNSAFE_componentWillReceiveProps(nextProps) {
51
- const column = nextProps.column,
52
- row = nextProps.row;
55
+ const {
56
+ column,
57
+ row
58
+ } = nextProps;
53
59
  if (row._id !== this.props.row._id) {
54
60
  this.setState({
55
61
  value: row[column[this.props.valueKey]] || ''
@@ -57,7 +63,9 @@ class RowExpandMBUrlEditor extends _react.default.Component {
57
63
  }
58
64
  }
59
65
  render() {
60
- const value = this.state.value;
66
+ const {
67
+ value
68
+ } = this.state;
61
69
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
62
70
  className: "dtable-ui-mobile-row-expand-input-editor-container position-relative dtable-ui-mobile-row-expand-url-editor-container",
63
71
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
@@ -27,7 +27,9 @@ class RowExpandPCUrlEditor extends _react.default.Component {
27
27
  }, 1);
28
28
  };
29
29
  this.onBlur = () => {
30
- const onCommit = this.props.onCommit;
30
+ const {
31
+ onCommit
32
+ } = this.props;
31
33
  onCommit(this.state.value.trim());
32
34
  };
33
35
  this.onFocus = e => {
@@ -52,16 +54,19 @@ class RowExpandPCUrlEditor extends _react.default.Component {
52
54
  this.blurInput();
53
55
  return;
54
56
  }
55
- const _event$currentTarget = event.currentTarget,
56
- selectionStart = _event$currentTarget.selectionStart,
57
- selectionEnd = _event$currentTarget.selectionEnd,
58
- value = _event$currentTarget.value;
57
+ const {
58
+ selectionStart,
59
+ selectionEnd,
60
+ value
61
+ } = event.currentTarget;
59
62
  if (event.keyCode === _constants.KeyCodes.ChineseInputMethod || event.keyCode === _constants.KeyCodes.LeftArrow && selectionStart === 0 || event.keyCode === _constants.KeyCodes.RightArrow && selectionEnd === value.length) {
60
63
  event.stopPropagation();
61
64
  }
62
65
  };
63
66
  this.onOpenUrlLink = () => {
64
- const value = this.state.value;
67
+ const {
68
+ value
69
+ } = this.state;
65
70
  let newValue = value.trim();
66
71
  if (!(0, _utils.isValidUrl)(newValue)) {
67
72
  newValue = "http://".concat(newValue);
@@ -83,8 +88,10 @@ class RowExpandPCUrlEditor extends _react.default.Component {
83
88
  }
84
89
  }
85
90
  UNSAFE_componentWillReceiveProps(nextProps) {
86
- const column = nextProps.column,
87
- row = nextProps.row;
91
+ const {
92
+ column,
93
+ row
94
+ } = nextProps;
88
95
  if (row._id !== this.props.row._id) {
89
96
  this.setState({
90
97
  value: row[column[this.props.valueKey]] || ''
@@ -98,7 +105,9 @@ class RowExpandPCUrlEditor extends _react.default.Component {
98
105
  }
99
106
  }
100
107
  render() {
101
- let value = this.state.value;
108
+ let {
109
+ value
110
+ } = this.state;
102
111
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
103
112
  className: "dtable-ui-row-expand-url-editor",
104
113
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
@@ -9,8 +9,10 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _DepartmentSingleSelectFormatter = _interopRequireDefault(require("../../DepartmentSingleSelectFormatter"));
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  function RowExpandMBDepartmentFormatter(_ref) {
12
- let value = _ref.value,
13
- departments = _ref.departments;
12
+ let {
13
+ value,
14
+ departments
15
+ } = _ref;
14
16
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DepartmentSingleSelectFormatter.default, {
15
17
  value: value,
16
18
  departments: departments
@@ -9,8 +9,10 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _DepartmentSingleSelectFormatter = _interopRequireDefault(require("../../DepartmentSingleSelectFormatter"));
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  function RowExpandPCDepartmentFormatter(_ref) {
12
- let value = _ref.value,
13
- departments = _ref.departments;
12
+ let {
13
+ value,
14
+ departments
15
+ } = _ref;
14
16
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
15
17
  className: "position-relative w-100",
16
18
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -14,15 +14,18 @@ class RowExpandEmailFormatter extends _react.default.Component {
14
14
  constructor() {
15
15
  super(...arguments);
16
16
  this.onOpenEmailLink = () => {
17
- const value = this.props.value;
17
+ const {
18
+ value
19
+ } = this.props;
18
20
  let newValue = value.trim();
19
21
  window.location.href = "mailto:".concat(newValue);
20
22
  };
21
23
  }
22
24
  render() {
23
- const _this$props = this.props,
24
- containerClassName = _this$props.containerClassName,
25
- value = _this$props.value;
25
+ const {
26
+ containerClassName,
27
+ value
28
+ } = this.props;
26
29
  let classname = (0, _classnames.default)('dtable-ui cell-formatter-container email-formatter row-expand-jump-link-container', containerClassName);
27
30
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
28
31
  className: classname,
@@ -12,14 +12,15 @@ require("./index.css");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  class RowExpandFileFormatter extends _react.default.PureComponent {
14
14
  render() {
15
- let _this$props = this.props,
16
- value = _this$props.value,
17
- containerClassName = _this$props.containerClassName,
18
- column = _this$props.column,
19
- downloadFile = _this$props.downloadFile,
20
- deleteFile = _this$props.deleteFile,
21
- readOnly = _this$props.readOnly,
22
- config = _this$props.config;
15
+ let {
16
+ value,
17
+ containerClassName,
18
+ column,
19
+ downloadFile,
20
+ deleteFile,
21
+ readOnly,
22
+ config
23
+ } = this.props;
23
24
  if (!Array.isArray(value) || value.length === 0) {
24
25
  return null;
25
26
  }