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
@@ -50,7 +50,9 @@ class TextareaItem extends React.Component {
50
50
  value
51
51
  });
52
52
  }
53
- const onChange = this.props.onChange;
53
+ const {
54
+ onChange
55
+ } = this.props;
54
56
  if (onChange) {
55
57
  onChange(value);
56
58
  }
@@ -134,25 +136,30 @@ class TextareaItem extends React.Component {
134
136
  }
135
137
  render() {
136
138
  const _this$props = this.props,
137
- prefixCls = _this$props.prefixCls,
138
- prefixListCls = _this$props.prefixListCls,
139
- editable = _this$props.editable,
140
- style = _this$props.style,
141
- clear = _this$props.clear,
142
- children = _this$props.children,
143
- error = _this$props.error,
144
- className = _this$props.className,
145
- count = _this$props.count,
146
- labelNumber = _this$props.labelNumber,
147
- title = _this$props.title,
148
- onErrorClick = _this$props.onErrorClick,
149
- autoHeight = _this$props.autoHeight,
150
- defaultValue = _this$props.defaultValue,
139
+ {
140
+ prefixCls,
141
+ prefixListCls,
142
+ editable,
143
+ style,
144
+ clear,
145
+ children,
146
+ error,
147
+ className,
148
+ count,
149
+ labelNumber,
150
+ title,
151
+ onErrorClick,
152
+ autoHeight,
153
+ defaultValue
154
+ } = _this$props,
151
155
  otherProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
152
- const disabled = otherProps.disabled;
153
- const _this$state = this.state,
154
- value = _this$state.value,
155
- focus = _this$state.focus;
156
+ const {
157
+ disabled
158
+ } = otherProps;
159
+ const {
160
+ value,
161
+ focus
162
+ } = this.state;
156
163
  const hasCount = count > 0 && this.props.rows > 1;
157
164
  const wrapCls = (0, _classnames.default)(className, "".concat(prefixListCls, "-item"), "".concat(prefixCls, "-item"), {
158
165
  ["".concat(prefixCls, "-disabled")]: disabled,
@@ -124,9 +124,10 @@ const Toast = {
124
124
  },
125
125
  config() {
126
126
  let conf = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
127
- const _conf$duration = conf.duration,
128
- duration = _conf$duration === void 0 ? SHORT : _conf$duration,
129
- mask = conf.mask;
127
+ const {
128
+ duration = SHORT,
129
+ mask
130
+ } = conf;
130
131
  config.duration = duration;
131
132
  if (mask === false) {
132
133
  config.mask = false;
@@ -11,9 +11,10 @@ require("./index.css");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  class UrlFormatter extends _react.default.Component {
13
13
  render() {
14
- const _this$props = this.props,
15
- containerClassName = _this$props.containerClassName,
16
- value = _this$props.value;
14
+ const {
15
+ containerClassName,
16
+ value
17
+ } = this.props;
17
18
  let classname = (0, _classnames.default)('dtable-ui cell-formatter-container url-formatter', containerClassName);
18
19
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
19
20
  title: value,
@@ -15,17 +15,22 @@ class EditorBase extends _react.default.Component {
15
15
  }
16
16
  getValue() {
17
17
  const updated = {};
18
- const column = this.props.column;
19
- const type = column.type,
20
- key = column.key,
21
- data = column.data;
18
+ const {
19
+ column
20
+ } = this.props;
21
+ const {
22
+ type,
23
+ key,
24
+ data
25
+ } = column;
22
26
  let value = this.getInputNode().value;
23
27
  if (type === _dtableUtils.CellType.TEXT) {
24
28
  value = value ? value.trim() : '';
25
29
  } else if (type === _dtableUtils.CellType.NUMBER) {
26
- let _ref = data || {},
27
- precision = _ref.precision,
28
- enable_precision = _ref.enable_precision;
30
+ let {
31
+ precision,
32
+ enable_precision
33
+ } = data || {};
29
34
  if (enable_precision && (0, _dtableUtils.isNumber)(value)) {
30
35
  value = Number(value.toFixed(precision));
31
36
  }
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useClickOutside = void 0;
7
7
  var _react = require("react");
8
8
  const useClickOutside = (_ref, deps) => {
9
- let currDOM = _ref.currDOM,
10
- onClickOutside = _ref.onClickOutside;
9
+ let {
10
+ currDOM,
11
+ onClickOutside
12
+ } = _ref;
11
13
  (0, _react.useEffect)(() => {
12
14
  const onMousedown = event => {
13
15
  if (currDOM && event && currDOM.contains(event.target)) {
@@ -15,7 +15,9 @@ var _mbEditor = _interopRequireDefault(require("./mb-editor"));
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
16
  const _excluded = ["isMobile"];
17
17
  const SelectEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
18
- let isMobile = _ref.isMobile,
18
+ let {
19
+ isMobile
20
+ } = _ref,
19
21
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
20
22
  if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
21
23
  ref: ref
@@ -12,23 +12,31 @@ var _MobileSelector = _interopRequireDefault(require("../../MobileSelector"));
12
12
  var _DTableCommonAddTool = _interopRequireDefault(require("../../DTableCommonAddTool"));
13
13
  require("./index.css");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- const Search = _MobileSelector.default.Search,
16
- Option = _MobileSelector.default.Option,
17
- Options = _MobileSelector.default.Options,
18
- Empty = _MobileSelector.default.Empty;
15
+ const {
16
+ Search,
17
+ Option,
18
+ Options,
19
+ Empty
20
+ } = _MobileSelector.default;
19
21
  class MBSelectEditor extends _react.default.Component {
20
22
  constructor(props) {
21
23
  super(props);
22
24
  this.onChangeSearch = newValue => {
23
- const searchVal = this.state.searchVal;
25
+ const {
26
+ searchVal
27
+ } = this.state;
24
28
  if (searchVal === newValue) return;
25
29
  this.setState({
26
30
  searchVal: newValue
27
31
  });
28
32
  };
29
33
  this.getDisplayOptions = () => {
30
- const options = this.props.options;
31
- const searchVal = this.state.searchVal;
34
+ const {
35
+ options
36
+ } = this.props;
37
+ const {
38
+ searchVal
39
+ } = this.state;
32
40
  return searchVal ? options.filter(item => item.name.indexOf(searchVal) > -1) : options;
33
41
  };
34
42
  this.onChange = option => {
@@ -44,10 +52,10 @@ class MBSelectEditor extends _react.default.Component {
44
52
  }
45
53
  };
46
54
  this.renderOptions = options => {
47
- const _this$props = this.props,
48
- _this$props$value = _this$props.value,
49
- value = _this$props$value === void 0 ? [] : _this$props$value,
50
- valueKey = _this$props.valueKey;
55
+ const {
56
+ value = [],
57
+ valueKey
58
+ } = this.props;
51
59
  return options.map(option => {
52
60
  const isSelected = value.includes(option[valueKey]);
53
61
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Option, {
@@ -64,12 +72,15 @@ class MBSelectEditor extends _react.default.Component {
64
72
  };
65
73
  }
66
74
  render() {
67
- const _this$props2 = this.props,
68
- column = _this$props2.column,
69
- isSupportNewOption = _this$props2.isSupportNewOption,
70
- options = _this$props2.options,
71
- onAddNewOption = _this$props2.onAddNewOption;
72
- const searchVal = this.state.searchVal;
75
+ const {
76
+ column,
77
+ isSupportNewOption,
78
+ options,
79
+ onAddNewOption
80
+ } = this.props;
81
+ const {
82
+ searchVal
83
+ } = this.state;
73
84
  const displayOptions = this.getDisplayOptions();
74
85
  const isShowCreateBtn = isSupportNewOption && onAddNewOption && !!searchVal && !options.find(item => item.name !== searchVal);
75
86
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MobileSelector.default, {
@@ -38,7 +38,9 @@ class PCSelectEditor extends _react.default.Component {
38
38
  this.onEnter = e => {
39
39
  e.preventDefault();
40
40
  let option;
41
- const isSupportNewOption = this.props.isSupportNewOption;
41
+ const {
42
+ isSupportNewOption
43
+ } = this.props;
42
44
  if (this.filteredOptions.length === 1) {
43
45
  option = this.filteredOptions[0];
44
46
  } else if (this.state.highlightIndex > -1) {
@@ -47,7 +49,9 @@ class PCSelectEditor extends _react.default.Component {
47
49
  if (option) {
48
50
  this.onChange(option);
49
51
  } else {
50
- const searchValue = this.state.searchValue;
52
+ const {
53
+ searchValue
54
+ } = this.state;
51
55
  if (searchValue && isSupportNewOption && this.filteredOptions.length === 0) {
52
56
  e.stopPropagation();
53
57
  this.onAddNewOption();
@@ -57,10 +61,11 @@ class PCSelectEditor extends _react.default.Component {
57
61
  this.onUpArrow = e => {
58
62
  e.preventDefault();
59
63
  e.stopPropagation();
60
- let _this$state = this.state,
61
- highlightIndex = _this$state.highlightIndex,
62
- maxItemNum = _this$state.maxItemNum,
63
- itemHeight = _this$state.itemHeight;
64
+ let {
65
+ highlightIndex,
66
+ maxItemNum,
67
+ itemHeight
68
+ } = this.state;
64
69
  if (highlightIndex > 0) {
65
70
  this.setState({
66
71
  highlightIndex: highlightIndex - 1
@@ -74,10 +79,11 @@ class PCSelectEditor extends _react.default.Component {
74
79
  this.onDownArrow = e => {
75
80
  e.preventDefault();
76
81
  e.stopPropagation();
77
- let _this$state2 = this.state,
78
- highlightIndex = _this$state2.highlightIndex,
79
- maxItemNum = _this$state2.maxItemNum,
80
- itemHeight = _this$state2.itemHeight;
82
+ let {
83
+ highlightIndex,
84
+ maxItemNum,
85
+ itemHeight
86
+ } = this.state;
81
87
  if (highlightIndex < this.filteredOptions.length - 1) {
82
88
  this.setState({
83
89
  highlightIndex: highlightIndex + 1
@@ -89,8 +95,12 @@ class PCSelectEditor extends _react.default.Component {
89
95
  }
90
96
  };
91
97
  this.onValueChanged = searchValue => {
92
- const oldSearchVal = this.state.searchValue;
93
- const options = this.props.options;
98
+ const {
99
+ searchValue: oldSearchVal
100
+ } = this.state;
101
+ const {
102
+ options
103
+ } = this.props;
94
104
  if (oldSearchVal === searchValue) return;
95
105
  this.setState({
96
106
  searchValue
@@ -123,7 +133,9 @@ class PCSelectEditor extends _react.default.Component {
123
133
  }, 300);
124
134
  };
125
135
  this.getOptionStyle = option => {
126
- const optionWidth = this.props.optionWidth;
136
+ const {
137
+ optionWidth
138
+ } = this.props;
127
139
  const textColor = option.textColor || null;
128
140
  return {
129
141
  display: 'inline-block',
@@ -167,8 +179,9 @@ class PCSelectEditor extends _react.default.Component {
167
179
  this.ref.style.top = '-200px';
168
180
  }
169
181
  }
170
- const _this$ref$getBounding = this.ref.getBoundingClientRect(),
171
- bottom = _this$ref$getBounding.bottom;
182
+ const {
183
+ bottom
184
+ } = this.ref.getBoundingClientRect();
172
185
  if (bottom > window.innerHeight) {
173
186
  this.ref.style.top = parseInt(this.ref.style.top) - bottom + window.innerHeight + 'px';
174
187
  }
@@ -188,18 +201,20 @@ class PCSelectEditor extends _react.default.Component {
188
201
  }
189
202
  }
190
203
  render() {
191
- const _this$props = this.props,
192
- isInModal = _this$props.isInModal,
193
- className = _this$props.className,
194
- value = _this$props.value,
195
- column = _this$props.column,
196
- valueKey = _this$props.valueKey,
197
- isSupportNewOption = _this$props.isSupportNewOption,
198
- target = _this$props.target,
199
- classNamePrefix = _this$props.classNamePrefix;
200
- const _this$state3 = this.state,
201
- searchValue = _this$state3.searchValue,
202
- highlightIndex = _this$state3.highlightIndex;
204
+ const {
205
+ isInModal,
206
+ className,
207
+ value,
208
+ column,
209
+ valueKey,
210
+ isSupportNewOption,
211
+ target,
212
+ classNamePrefix
213
+ } = this.props;
214
+ const {
215
+ searchValue,
216
+ highlightIndex
217
+ } = this.state;
203
218
 
204
219
  // maxWidth = single-selects-container's width - single-selects-container's padding-left and padding-right - single-select-container's padding-left - single-select-check-icon's width - The gap between the single-select-check-icon and single-select-name or scroll's width
205
220
  // maxWidth = column.width > 200 ? column.width - 20 - 12 - 20 - 10 : 200 - 20 - 12 - 20 - 10
@@ -23,12 +23,13 @@ class Alert extends _react.default.PureComponent {
23
23
  }
24
24
  }
25
25
  render() {
26
- const _this$props = this.props,
27
- intent = _this$props.intent,
28
- title = _this$props.title,
29
- children = _this$props.children,
30
- isRemovable = _this$props.isRemovable,
31
- onRemove = _this$props.onRemove;
26
+ const {
27
+ intent,
28
+ title,
29
+ children,
30
+ isRemovable,
31
+ onRemove
32
+ } = this.props;
32
33
  const iconClass = this.getIconClass(intent);
33
34
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
34
35
  className: "dtable-toast-alert-container ".concat(intent || 'success'),
@@ -52,8 +52,9 @@ class Toast extends _react.default.PureComponent {
52
52
  this.onRef = ref => {
53
53
  if (ref === null) return;
54
54
  setTimeout(() => {
55
- const _ref$getBoundingClien = ref.getBoundingClientRect(),
56
- height = _ref$getBoundingClien.height;
55
+ const {
56
+ height
57
+ } = ref.getBoundingClientRect();
57
58
  this.containerRef.current.style.height = height + 'px';
58
59
  }, 1);
59
60
  };
@@ -97,8 +97,10 @@ class ToastManager extends _react.default.PureComponent {
97
97
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
98
98
  className: "dtable-toast-manager",
99
99
  children: this.state.toasts.map(_ref => {
100
- let id = _ref.id,
101
- description = _ref.description,
100
+ let {
101
+ id,
102
+ description
103
+ } = _ref,
102
104
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
103
105
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_toast.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
104
106
  onRemove: () => this.removeToast(id)
package/lib/utils/cell.js CHANGED
@@ -7,9 +7,10 @@ exports.isValidPosition = exports.isLongTextValueExceedLimit = exports.checkValu
7
7
  var _constants = require("../constants");
8
8
  var _utils = require("./utils");
9
9
  const checkValueConformityFormat = (columnData, value) => {
10
- const _ref = columnData || {},
11
- format_specification_value = _ref.format_specification_value,
12
- format_check_type = _ref.format_check_type;
10
+ const {
11
+ format_specification_value,
12
+ format_check_type
13
+ } = columnData || {};
13
14
  let isMatched = false;
14
15
  if (format_check_type !== 'custom_format') {
15
16
  const reg = _constants.FORMAT_REG_EXP_LIST[format_check_type];
@@ -22,9 +23,10 @@ const checkValueConformityFormat = (columnData, value) => {
22
23
  };
23
24
  exports.checkValueConformityFormat = checkValueConformityFormat;
24
25
  const checkNumberValidation = (columnData, value) => {
25
- const _ref2 = columnData || {},
26
- format_max_value = _ref2.format_max_value,
27
- format_min_value = _ref2.format_min_value;
26
+ const {
27
+ format_max_value,
28
+ format_min_value
29
+ } = columnData || {};
28
30
  const num = parseFloat(value);
29
31
  if (isNaN(num) || !num && num !== 0) {
30
32
  return false;
@@ -41,8 +43,9 @@ exports.checkNumberValidation = checkNumberValidation;
41
43
  const isLongTextValueExceedLimit = value => {
42
44
  if (!value) return false;
43
45
  if (typeof value === 'string') return value.length >= _constants.LONG_TEXT_LENGTH_LIMIT;
44
- const _ref3 = value || {},
45
- text = _ref3.text;
46
+ const {
47
+ text
48
+ } = value || {};
46
49
  return text ? text.length >= _constants.LONG_TEXT_LENGTH_LIMIT : false;
47
50
  };
48
51
  exports.isLongTextValueExceedLimit = isLongTextValueExceedLimit;
@@ -9,9 +9,12 @@ exports.isEnableCheckFormat = void 0;
9
9
  var _dtableUtils = require("dtable-utils");
10
10
  const isEnableCheckFormat = column => {
11
11
  if (!column) return false;
12
- const data = column.data;
13
- const _ref = data || {},
14
- enable_check_format = _ref.enable_check_format;
12
+ const {
13
+ data
14
+ } = column;
15
+ const {
16
+ enable_check_format
17
+ } = data || {};
15
18
  if (enable_check_format) return true;
16
19
  return false;
17
20
  };
@@ -23,12 +26,15 @@ const getDateColumnFormat = column => {
23
26
  };
24
27
  exports.getDateColumnFormat = getDateColumnFormat;
25
28
  function isCheckboxColumn(column) {
26
- let type = column.type,
27
- data = column.data;
29
+ let {
30
+ type,
31
+ data
32
+ } = column;
28
33
  if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
29
- const _ref2 = data || {},
30
- result_type = _ref2.result_type,
31
- array_type = _ref2.array_type;
34
+ const {
35
+ result_type,
36
+ array_type
37
+ } = data || {};
32
38
  if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) {
33
39
  return array_type === _dtableUtils.CellType.CHECKBOX;
34
40
  }
@@ -11,7 +11,9 @@ const searchDepartments = (departments, searchValue) => {
11
11
  const validDepartments = Array.isArray(departments) ? departments : [];
12
12
  if (!validSearchValue) return validDepartments;
13
13
  return validDepartments.filter(department => {
14
- const name = department.name;
14
+ const {
15
+ name
16
+ } = department;
15
17
  if (!name) return false;
16
18
  return name.toString().toLowerCase().indexOf(validSearchValue) > -1;
17
19
  });
package/lib/utils/url.js CHANGED
@@ -71,11 +71,13 @@ const needUseThumbnailImage = url => {
71
71
  exports.needUseThumbnailImage = needUseThumbnailImage;
72
72
  const generateCurrentBaseImageThumbnailUrl = _ref => {
73
73
  var _window2;
74
- let server = _ref.server,
75
- workspaceID = _ref.workspaceID,
76
- dtableUuid = _ref.dtableUuid,
77
- partUrl = _ref.partUrl,
78
- size = _ref.size;
74
+ let {
75
+ server,
76
+ workspaceID,
77
+ dtableUuid,
78
+ partUrl,
79
+ size
80
+ } = _ref;
79
81
  const validServer = server || ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.dtable) && window.dtable.server || '';
80
82
  if (!partUrl || typeof partUrl !== 'string') return '';
81
83
  let url = "".concat(validServer, "/thumbnail/workspace/").concat(workspaceID, "/asset/").concat(dtableUuid).concat(partUrl);
@@ -85,10 +87,12 @@ const generateCurrentBaseImageThumbnailUrl = _ref => {
85
87
  exports.generateCurrentBaseImageThumbnailUrl = generateCurrentBaseImageThumbnailUrl;
86
88
  const generateCurrentBaseImageUrl = _ref2 => {
87
89
  var _window3;
88
- let server = _ref2.server,
89
- workspaceID = _ref2.workspaceID,
90
- dtableUuid = _ref2.dtableUuid,
91
- partUrl = _ref2.partUrl;
90
+ let {
91
+ server,
92
+ workspaceID,
93
+ dtableUuid,
94
+ partUrl
95
+ } = _ref2;
92
96
  if (!partUrl || typeof partUrl !== 'string') return '';
93
97
  if (partUrl.startsWith('http')) return partUrl;
94
98
  const validServer = server || ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.dtable) && window.dtable.server || '';
@@ -96,12 +100,12 @@ const generateCurrentBaseImageUrl = _ref2 => {
96
100
  };
97
101
  exports.generateCurrentBaseImageUrl = generateCurrentBaseImageUrl;
98
102
  const getImageThumbnailUrl = function (url) {
99
- let _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
100
- server = _ref3.server,
101
- dtableUuid = _ref3.dtableUuid,
102
- workspaceID = _ref3.workspaceID,
103
- _ref3$size = _ref3.size,
104
- size = _ref3$size === void 0 ? 256 : _ref3$size;
103
+ let {
104
+ server,
105
+ dtableUuid,
106
+ workspaceID,
107
+ size = 256
108
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
105
109
  if (!url || typeof url !== 'string') return '';
106
110
  if (server && dtableUuid && isCustomAssetUrl(url)) {
107
111
  const assetUuid = url.slice(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
@@ -145,9 +149,9 @@ const imageCheck = filename => {
145
149
  };
146
150
  exports.imageCheck = imageCheck;
147
151
  const isInternalURL = function (url) {
148
- let _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
149
- _ref4$server = _ref4.server,
150
- server = _ref4$server === void 0 ? '' : _ref4$server;
152
+ let {
153
+ server = ''
154
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
151
155
  if (!url || typeof url !== 'string') return false;
152
156
  return server && url.indexOf(server) > -1;
153
157
  };
@@ -156,8 +160,10 @@ const getValidFileImageUrls = files => {
156
160
  if (!Array.isArray(files)) return [];
157
161
  return files.map(file => {
158
162
  if (typeof file !== 'object') return null;
159
- const url = file.url,
160
- name = file.name;
163
+ const {
164
+ url,
165
+ name
166
+ } = file;
161
167
  if (!url || url.indexOf('/asset') < 0) return null;
162
168
  return imageCheck(name) ? url : null;
163
169
  }).filter(Boolean);
@@ -182,10 +188,11 @@ const getFileIconUrl = (filename, direntType) => {
182
188
  };
183
189
  exports.getFileIconUrl = getFileIconUrl;
184
190
  const getFileThumbnailInfo = function (file) {
185
- let _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
186
- server = _ref5.server,
187
- dtableUuid = _ref5.dtableUuid,
188
- workspaceID = _ref5.workspaceID;
191
+ let {
192
+ server,
193
+ dtableUuid,
194
+ workspaceID
195
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
189
196
  const defaultIcon = _file.FILEEXT_ICON_MAP['default'];
190
197
  const defaultIconUrl = _file.FILEEXT_ICON_URL_MAP[defaultIcon];
191
198
  if (!file || !file.name) return {
@@ -163,12 +163,16 @@ const getFormulaArrayValue = value => {
163
163
  return item;
164
164
  }
165
165
  if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
166
- const display_value = item.display_value;
166
+ const {
167
+ display_value
168
+ } = item;
167
169
  if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
168
170
  return display_value.map(i => {
169
171
  if (Object.prototype.toString.call(i) === '[object Object]') {
170
172
  if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
171
- const display_value = i.display_value;
173
+ const {
174
+ display_value
175
+ } = i;
172
176
  return display_value;
173
177
  }
174
178
  return i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.126",
3
+ "version": "7.0.0xia.1",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "5.0.9",