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
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
10
  var _react = _interopRequireDefault(require("react"));
12
11
  var _reactstrap = require("reactstrap");
13
12
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -65,10 +64,11 @@ class Body extends _react.default.Component {
65
64
  this.fieldEditorOpen = false;
66
65
  };
67
66
  this.onHotKey = event => {
68
- const _this$props = this.props,
69
- columns = _this$props.columns,
70
- onKeyDown = _this$props.onKeyDown,
71
- onToggle = _this$props.onToggle;
67
+ const {
68
+ columns,
69
+ onKeyDown,
70
+ onToggle
71
+ } = this.props;
72
72
  const readonly = Array.isArray(columns) && columns.length > 0 ? !columns.some(c => c.editable) : true;
73
73
  const keyCode = event.keyCode;
74
74
  // When opening field editor, all shortcuts in row expand dialog do not work
@@ -96,7 +96,9 @@ class Body extends _react.default.Component {
96
96
  this.onPressTab = event => {
97
97
  event.stopPropagation();
98
98
  event.preventDefault();
99
- const columns = this.props.columns;
99
+ const {
100
+ columns
101
+ } = this.props;
100
102
  let tabIndex = this.state.tabIndex;
101
103
  // Press tab, highlight next column;
102
104
  if (event.shiftKey) {
@@ -127,30 +129,40 @@ class Body extends _react.default.Component {
127
129
  this.props.getDownLoadFiles([{
128
130
  url: imageItemUrl
129
131
  }]).then(res => {
130
- const _res$data$urls = (0, _slicedToArray2.default)(res.data.urls, 1),
131
- downloadUrl = _res$data$urls[0];
132
+ const [downloadUrl] = res.data.urls;
132
133
  (0, _utils.downloadFile)(downloadUrl);
133
134
  }).catch(error => {
134
135
  // todo
135
136
  });
136
137
  };
137
138
  this.getCellValue = _ref => {
138
- let row = _ref.row,
139
- column = _ref.column;
139
+ let {
140
+ row,
141
+ column
142
+ } = _ref;
140
143
  if (!row || !column) return null;
141
- const valueKey = this.props.valueKey;
144
+ const {
145
+ valueKey
146
+ } = this.props;
142
147
  return row[column[valueKey]];
143
148
  };
144
149
  this.renderColumnValue = (row, column, columnIndex, isEditorFocus) => {
145
- const _this$props2 = this.props,
146
- component = _this$props2.component,
147
- onChange = _this$props2.onChange,
148
- props = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
149
- const getDownLoadFiles = props.getDownLoadFiles;
150
- const editable = column.editable;
151
- const _ref2 = component || {},
152
- editor = _ref2.editor,
153
- formatter = _ref2.formatter;
150
+ const _this$props = this.props,
151
+ {
152
+ component,
153
+ onChange
154
+ } = _this$props,
155
+ props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
156
+ const {
157
+ getDownLoadFiles
158
+ } = props;
159
+ const {
160
+ editable
161
+ } = column;
162
+ const {
163
+ editor,
164
+ formatter
165
+ } = component || {};
154
166
  if (editable) {
155
167
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowExpandEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
156
168
  column: column,
@@ -183,10 +195,11 @@ class Body extends _react.default.Component {
183
195
  });
184
196
  };
185
197
  this.renderChildren = () => {
186
- const _this$props3 = this.props,
187
- columns = _this$props3.columns,
188
- row = _this$props3.row,
189
- children = _this$props3.children;
198
+ const {
199
+ columns,
200
+ row,
201
+ children
202
+ } = this.props;
190
203
  const props = {
191
204
  columns,
192
205
  row
@@ -216,10 +229,11 @@ class Body extends _react.default.Component {
216
229
  window.removeEventListener('keydown', this.onHotKey);
217
230
  }
218
231
  render() {
219
- const _this$props4 = this.props,
220
- columns = _this$props4.columns,
221
- row = _this$props4.row,
222
- placeholder = _this$props4.placeholder;
232
+ const {
233
+ columns,
234
+ row,
235
+ placeholder
236
+ } = this.props;
223
237
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.ModalBody, {
224
238
  className: "dtable-ui-row-expand-body",
225
239
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -228,12 +242,15 @@ class Body extends _react.default.Component {
228
242
  children: [columns.length === 0 && placeholder && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
229
243
  children: placeholder
230
244
  }), columns.map((column, index) => {
231
- const type = column.type,
232
- data = column.data;
245
+ const {
246
+ type,
247
+ data
248
+ } = column;
233
249
  let isHasMore = false;
234
250
  if (type === _dtableUtils.CellType.LINK_FORMULA) {
235
- let _ref3 = data || {},
236
- array_type = _ref3.array_type;
251
+ let {
252
+ array_type
253
+ } = data || {};
237
254
  const value = this.getCellValue({
238
255
  row,
239
256
  column
@@ -13,12 +13,16 @@ var _DTableColumnIcon = _interopRequireDefault(require("../../DTableColumnIcon")
13
13
  require("./index.css");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  const ColumnContent = _ref => {
16
- let column = _ref.column,
17
- children = _ref.children;
16
+ let {
17
+ column,
18
+ children
19
+ } = _ref;
18
20
  const descriptionRef = (0, _react.useRef)(null);
19
- const name = column.name,
20
- key = column.key,
21
- description = column.description;
21
+ const {
22
+ name,
23
+ key,
24
+ description
25
+ } = column;
22
26
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Row, {
23
27
  className: "dtable-ui-row-expand-column-content pb-4",
24
28
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Col, {
@@ -15,12 +15,14 @@ var _IconButton = _interopRequireDefault(require("../../IconButton"));
15
15
  require("./index.css");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
  const Header = _ref => {
18
- let title = _ref.title,
19
- columns = _ref.columns,
20
- row = _ref.row,
21
- onToggle = _ref.onToggle,
22
- copyURL = _ref.copyURL,
23
- children = _ref.children;
18
+ let {
19
+ title,
20
+ columns,
21
+ row,
22
+ onToggle,
23
+ copyURL,
24
+ children
25
+ } = _ref;
24
26
  const renderTitle = (0, _react.useCallback)(() => {
25
27
  const props = {
26
28
  columns,
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
12
11
  var _react = _interopRequireWildcard(require("react"));
13
12
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -23,48 +22,31 @@ require("./index.css");
23
22
  var _jsxRuntime = require("react/jsx-runtime");
24
23
  const _excluded = ["saveImmediately", "readonly", "isInsertingRow", "zIndex", "title", "className", "valueKey", "layout", "row", "columns", "commit", "onToggle", "uploadFile", "copyURL", "children"];
25
24
  const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
26
- let _ref$saveImmediately = _ref.saveImmediately,
27
- saveImmediately = _ref$saveImmediately === void 0 ? true : _ref$saveImmediately,
28
- _ref$readonly = _ref.readonly,
29
- readonly = _ref$readonly === void 0 ? false : _ref$readonly,
30
- _ref$isInsertingRow = _ref.isInsertingRow,
31
- isInsertingRow = _ref$isInsertingRow === void 0 ? false : _ref$isInsertingRow,
32
- zIndex = _ref.zIndex,
33
- title = _ref.title,
34
- className = _ref.className,
35
- _ref$valueKey = _ref.valueKey,
36
- valueKey = _ref$valueKey === void 0 ? 'name' : _ref$valueKey,
37
- _ref$layout = _ref.layout,
38
- layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
39
- defaultRow = _ref.row,
40
- defaultColumns = _ref.columns,
41
- commit = _ref.commit,
42
- onToggle = _ref.onToggle,
43
- uploadFile = _ref.uploadFile,
44
- copyURL = _ref.copyURL,
45
- _ref$children = _ref.children,
46
- children = _ref$children === void 0 ? [] : _ref$children,
25
+ let {
26
+ saveImmediately = true,
27
+ readonly = false,
28
+ isInsertingRow = false,
29
+ zIndex,
30
+ title,
31
+ className,
32
+ valueKey = 'name',
33
+ // name or key
34
+ layout = 'horizontal',
35
+ // horizontal or vertical
36
+ row: defaultRow,
37
+ columns: defaultColumns,
38
+ commit,
39
+ onToggle,
40
+ uploadFile,
41
+ copyURL,
42
+ children = []
43
+ } = _ref,
47
44
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
48
- const _useState = (0, _react.useState)(false),
49
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
50
- isAnimationEnd = _useState2[0],
51
- setAnimationEnd = _useState2[1];
52
- const _useState3 = (0, _react.useState)(true),
53
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
54
- isLoading = _useState4[0],
55
- setLoading = _useState4[1];
56
- const _useState5 = (0, _react.useState)(false),
57
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
58
- isSaving = _useState6[0],
59
- setSaving = _useState6[1];
60
- const _useState7 = (0, _react.useState)({}),
61
- _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
62
- row = _useState8[0],
63
- setRow = _useState8[1];
64
- const _useState9 = (0, _react.useState)([]),
65
- _useState0 = (0, _slicedToArray2.default)(_useState9, 2),
66
- columns = _useState0[0],
67
- setColumns = _useState0[1];
45
+ const [isAnimationEnd, setAnimationEnd] = (0, _react.useState)(false);
46
+ const [isLoading, setLoading] = (0, _react.useState)(true);
47
+ const [isSaving, setSaving] = (0, _react.useState)(false);
48
+ const [row, setRow] = (0, _react.useState)({});
49
+ const [columns, setColumns] = (0, _react.useState)([]);
68
50
  const modalRef = (0, _react.useRef)(null);
69
51
  const isChangedRef = (0, _react.useRef)(false);
70
52
  const update = (0, _react.useRef)({});
@@ -115,9 +97,10 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
115
97
  onToggle();
116
98
  }, [isSaving, onToggle]);
117
99
  const onSave = (0, _react.useCallback)(function (updated) {
118
- let _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
119
- successCallback = _ref2.successCallback,
120
- failCallback = _ref2.failCallback;
100
+ let {
101
+ successCallback,
102
+ failCallback
103
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
121
104
  commit(updated, columns, {
122
105
  successCallback,
123
106
  failCallback
@@ -168,10 +151,12 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
168
151
  // use setTimeout to make sure real dom rendered
169
152
  setTimeout(() => {
170
153
  let dom = modalRef.current.firstChild;
171
- const width = style.width,
172
- maxWidth = style.maxWidth,
173
- marginLeft = style.marginLeft,
174
- height = style.height;
154
+ const {
155
+ width,
156
+ maxWidth,
157
+ marginLeft,
158
+ height
159
+ } = style;
175
160
  dom.style.width = "".concat(width, "px");
176
161
  dom.style.maxWidth = "".concat(maxWidth, "px");
177
162
  dom.style.marginLeft = "".concat(marginLeft, "px");
@@ -19,10 +19,11 @@ class RowExpandMBCheckboxEditor extends _react.default.Component {
19
19
  this.editor = null;
20
20
  }
21
21
  render() {
22
- const _this$props = this.props,
23
- column = _this$props.column,
24
- value = _this$props.value,
25
- className = _this$props.className;
22
+ const {
23
+ column,
24
+ value,
25
+ className
26
+ } = this.props;
26
27
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
27
28
  className: (0, _classnames.default)('dtable-ui-mobile-row-expand-checkbox-editor-container', className),
28
29
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxEditor.default, {
@@ -13,19 +13,21 @@ class RowExpandPCCheckboxEditor extends _react.default.Component {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  this.onCommit = newValue => {
16
- const _this$props = this.props,
17
- columnIndex = _this$props.columnIndex,
18
- updateTabIndex = _this$props.updateTabIndex,
19
- onCommit = _this$props.onCommit;
16
+ const {
17
+ columnIndex,
18
+ updateTabIndex,
19
+ onCommit
20
+ } = this.props;
20
21
  updateTabIndex && updateTabIndex(columnIndex);
21
22
  onCommit && onCommit(newValue);
22
23
  };
23
24
  }
24
25
  render() {
25
- const _this$props2 = this.props,
26
- isEditorFocus = _this$props2.isEditorFocus,
27
- column = _this$props2.column,
28
- value = _this$props2.value;
26
+ const {
27
+ isEditorFocus,
28
+ column,
29
+ value
30
+ } = this.props;
29
31
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxEditor.default, {
30
32
  className: "dtable-ui-row-expand-checkbox-editor mt-2",
31
33
  column: column,
@@ -17,16 +17,19 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
17
17
  constructor(_props) {
18
18
  super(_props);
19
19
  this.initCollaborators = props => {
20
- const row = props.row,
21
- column = props.column,
22
- valueKey = props.valueKey;
20
+ const {
21
+ row,
22
+ column,
23
+ valueKey
24
+ } = props;
23
25
  const emails = row[column[valueKey]] || [];
24
26
  props.queryCollaborators && props.queryCollaborators(emails);
25
27
  };
26
28
  this.getCollaborators = () => {
27
- const _this$props = this.props,
28
- getCollaborators = _this$props.getCollaborators,
29
- collaborators = _this$props.collaborators;
29
+ const {
30
+ getCollaborators,
31
+ collaborators
32
+ } = this.props;
30
33
  if (getCollaborators) return getCollaborators();
31
34
  return collaborators || [];
32
35
  };
@@ -66,13 +69,16 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
66
69
  this.props.onCommit(newValue);
67
70
  };
68
71
  this.renderCollaborators = value => {
69
- const emailCollaboratorMap = this.state.emailCollaboratorMap;
72
+ const {
73
+ emailCollaboratorMap
74
+ } = this.state;
70
75
  if (Array.isArray(value) && value.length > 0) {
71
76
  return value.map((email, index) => {
72
77
  let collaborator = emailCollaboratorMap[email];
73
78
  if (collaborator) {
74
- const _collaborator = collaborator,
75
- email = _collaborator.email;
79
+ const {
80
+ email
81
+ } = collaborator;
76
82
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollaboratorItem.default, {
77
83
  collaborator: collaborator
78
84
  }, email);
@@ -92,10 +98,11 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
92
98
  text: (0, _lang.getLocale)('Add_collaborator')
93
99
  });
94
100
  };
95
- const _this$props2 = this.props,
96
- _row = _this$props2.row,
97
- _column = _this$props2.column,
98
- _valueKey = _this$props2.valueKey;
101
+ const {
102
+ row: _row,
103
+ column: _column,
104
+ valueKey: _valueKey
105
+ } = this.props;
99
106
  this.state = {
100
107
  menuPosition: null,
101
108
  value: _row[_column[_valueKey]] || [],
@@ -113,9 +120,11 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
113
120
  }
114
121
  }
115
122
  UNSAFE_componentWillReceiveProps(nextProps) {
116
- const column = nextProps.column,
117
- row = nextProps.row,
118
- valueKey = nextProps.valueKey;
123
+ const {
124
+ column,
125
+ row,
126
+ valueKey
127
+ } = nextProps;
119
128
  if (row._id !== this.props.row._id) {
120
129
  this.initCollaborators(nextProps);
121
130
  this.setState({
@@ -130,12 +139,14 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
130
139
  }
131
140
  }
132
141
  render() {
133
- const _this$props3 = this.props,
134
- collaborators = _this$props3.collaborators,
135
- column = _this$props3.column;
136
- const _this$state = this.state,
137
- showEditor = _this$state.showEditor,
138
- value = _this$state.value;
142
+ const {
143
+ collaborators,
144
+ column
145
+ } = this.props;
146
+ const {
147
+ showEditor,
148
+ value
149
+ } = this.state;
139
150
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
140
151
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
141
152
  className: "dtable-ui dtable-ui-mobile-row-expand-collaborators position-relative",
@@ -17,16 +17,19 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
17
17
  constructor(_props) {
18
18
  super(_props);
19
19
  this.initCollaborators = props => {
20
- const row = props.row,
21
- column = props.column,
22
- valueKey = props.valueKey;
20
+ const {
21
+ row,
22
+ column,
23
+ valueKey
24
+ } = props;
23
25
  const emails = row[column[valueKey]] || [];
24
26
  props.queryCollaborators && props.queryCollaborators(emails);
25
27
  };
26
28
  this.getCollaborators = () => {
27
- const _this$props = this.props,
28
- getCollaborators = _this$props.getCollaborators,
29
- collaborators = _this$props.collaborators;
29
+ const {
30
+ getCollaborators,
31
+ collaborators
32
+ } = this.props;
30
33
  if (getCollaborators) return getCollaborators();
31
34
  return collaborators || [];
32
35
  };
@@ -87,7 +90,9 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
87
90
  this.props.onCommit(newValue);
88
91
  };
89
92
  this.removeCollaborator = index => {
90
- let value = this.state.value;
93
+ let {
94
+ value
95
+ } = this.state;
91
96
  let newValue = value.slice(0);
92
97
  newValue.splice(index, 1);
93
98
  this.setState({
@@ -96,10 +101,13 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
96
101
  this.props.onCommit(newValue);
97
102
  };
98
103
  this.renderSelectedCollaborators = () => {
99
- const isEditorFocus = this.props.isEditorFocus;
100
- const _this$state = this.state,
101
- value = _this$state.value,
102
- emailCollaboratorMap = _this$state.emailCollaboratorMap;
104
+ const {
105
+ isEditorFocus
106
+ } = this.props;
107
+ const {
108
+ value,
109
+ emailCollaboratorMap
110
+ } = this.state;
103
111
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
104
112
  tabIndex: 0,
105
113
  onFocus: this.onFocus,
@@ -116,8 +124,9 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
116
124
  children: value.map((email, index) => {
117
125
  let collaborator = emailCollaboratorMap[email];
118
126
  if (collaborator) {
119
- const _collaborator = collaborator,
120
- email = _collaborator.email;
127
+ const {
128
+ email
129
+ } = collaborator;
121
130
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollaboratorItem.default, {
122
131
  collaborator: collaborator,
123
132
  enableDeleteCollaborator: true,
@@ -144,10 +153,11 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
144
153
  })
145
154
  });
146
155
  };
147
- const _this$props2 = this.props,
148
- _row = _this$props2.row,
149
- _column = _this$props2.column,
150
- _valueKey = _this$props2.valueKey;
156
+ const {
157
+ row: _row,
158
+ column: _column,
159
+ valueKey: _valueKey
160
+ } = this.props;
151
161
  this.state = {
152
162
  menuPosition: null,
153
163
  value: _row[_column[_valueKey]] || [],
@@ -167,9 +177,11 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
167
177
  }
168
178
  }
169
179
  UNSAFE_componentWillReceiveProps(nextProps) {
170
- const column = nextProps.column,
171
- row = nextProps.row,
172
- valueKey = nextProps.valueKey;
180
+ const {
181
+ column,
182
+ row,
183
+ valueKey
184
+ } = nextProps;
173
185
  if (row._id !== this.props.row._id) {
174
186
  this.initCollaborators(nextProps);
175
187
  this.setState({
@@ -196,12 +208,14 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
196
208
  document.removeEventListener('keydown', this.onKeyDown);
197
209
  }
198
210
  render() {
199
- const _this$props3 = this.props,
200
- collaborators = _this$props3.collaborators,
201
- column = _this$props3.column;
202
- const _this$state2 = this.state,
203
- showCollaboratorSelect = _this$state2.showCollaboratorSelect,
204
- value = _this$state2.value;
211
+ const {
212
+ collaborators,
213
+ column
214
+ } = this.props;
215
+ const {
216
+ showCollaboratorSelect,
217
+ value
218
+ } = this.state;
205
219
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
206
220
  className: "position-relative mt-1 w-100",
207
221
  ref: ref => this.collaboratorSelectRef = ref,
@@ -30,18 +30,22 @@ class RowExpandMBDateEditor extends _react.default.Component {
30
30
  value
31
31
  });
32
32
  };
33
- const column = props.column,
34
- row = props.row,
35
- valueKey = props.valueKey;
33
+ const {
34
+ column,
35
+ row,
36
+ valueKey
37
+ } = props;
36
38
  this.state = {
37
39
  isShowEditor: false,
38
40
  value: row[column[valueKey]]
39
41
  };
40
42
  }
41
43
  UNSAFE_componentWillReceiveProps(nextProps) {
42
- const column = nextProps.column,
43
- row = nextProps.row,
44
- valueKey = nextProps.valueKey;
44
+ const {
45
+ column,
46
+ row,
47
+ valueKey
48
+ } = nextProps;
45
49
  if (row._id !== this.props.row._id) {
46
50
  this.setState({
47
51
  value: row[column[valueKey]],
@@ -50,12 +54,14 @@ class RowExpandMBDateEditor extends _react.default.Component {
50
54
  }
51
55
  }
52
56
  render() {
53
- let _this$props = this.props,
54
- column = _this$props.column,
55
- lang = _this$props.lang;
56
- let _this$state = this.state,
57
- value = _this$state.value,
58
- isShowEditor = _this$state.isShowEditor;
57
+ let {
58
+ column,
59
+ lang
60
+ } = this.props;
61
+ let {
62
+ value,
63
+ isShowEditor
64
+ } = this.state;
59
65
  const format = (0, _columnUtils.getDateColumnFormat)(column);
60
66
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
61
67
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -57,19 +57,22 @@ class RowExpandPCDateEditor extends _react.default.Component {
57
57
  };
58
58
  }
59
59
  componentDidMount() {
60
- const _this$props = this.props,
61
- column = _this$props.column,
62
- row = _this$props.row,
63
- valueKey = _this$props.valueKey;
60
+ const {
61
+ column,
62
+ row,
63
+ valueKey
64
+ } = this.props;
64
65
  this.setState({
65
66
  value: row[column[valueKey]]
66
67
  });
67
68
  document.addEventListener('keydown', this.onKeyDown);
68
69
  }
69
70
  UNSAFE_componentWillReceiveProps(nextProps) {
70
- const column = nextProps.column,
71
- row = nextProps.row,
72
- valueKey = nextProps.valueKey;
71
+ const {
72
+ column,
73
+ row,
74
+ valueKey
75
+ } = nextProps;
73
76
  if (row._id !== this.props.row._id) {
74
77
  this.setState({
75
78
  value: row[column[valueKey]],
@@ -91,14 +94,16 @@ class RowExpandPCDateEditor extends _react.default.Component {
91
94
  document.removeEventListener('keydown', this.onKeyDown);
92
95
  }
93
96
  render() {
94
- let _this$props2 = this.props,
95
- column = _this$props2.column,
96
- isInModal = _this$props2.isInModal,
97
- isEditorFocus = _this$props2.isEditorFocus,
98
- lang = _this$props2.lang;
99
- let _this$state = this.state,
100
- value = _this$state.value,
101
- isShowEditor = _this$state.isShowEditor;
97
+ let {
98
+ column,
99
+ isInModal,
100
+ isEditorFocus,
101
+ lang
102
+ } = this.props;
103
+ let {
104
+ value,
105
+ isShowEditor
106
+ } = this.state;
102
107
  const format = (0, _columnUtils.getDateColumnFormat)(column);
103
108
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
104
109
  ref: ref => this.dateSelectRef = ref,