dtable-ui-component 6.0.125 → 6.0.126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/lib/ActionSheet/index.js +14 -16
  2. package/lib/ActivityIndicator/index.js +7 -8
  3. package/lib/AsyncUserSelect/index.css +5 -0
  4. package/lib/AsyncUserSelect/index.js +40 -19
  5. package/lib/AsyncUserSelect/user-item.js +5 -6
  6. package/lib/AutoNumberFormatter/index.js +3 -4
  7. package/lib/Badge/index.js +9 -11
  8. package/lib/ButtonFormatter/index.js +6 -8
  9. package/lib/CTimeFormatter/index.js +3 -4
  10. package/lib/CheckboxEditor/index.js +1 -3
  11. package/lib/CheckboxEditor/mb-editor.js +9 -20
  12. package/lib/CheckboxEditor/pc-editor.js +12 -24
  13. package/lib/CheckboxFormatter/index.js +4 -5
  14. package/lib/CollaboratorEditor/index.js +2 -4
  15. package/lib/CollaboratorEditor/mb-editor/index.js +11 -19
  16. package/lib/CollaboratorEditor/pc-editor/index.js +25 -34
  17. package/lib/CollaboratorFormatter/index.js +8 -10
  18. package/lib/CollaboratorItem/index.js +4 -5
  19. package/lib/CollapsibleSettingLayout/index.js +9 -7
  20. package/lib/Comment/body/comment.js +10 -18
  21. package/lib/Comment/body/index.js +2 -4
  22. package/lib/Comment/footer/btns/index.js +4 -7
  23. package/lib/Comment/footer/index.js +9 -20
  24. package/lib/Comment/footer/input/index.js +29 -50
  25. package/lib/Comment/footer/input/participant/index.js +4 -5
  26. package/lib/Comment/footer/participants/index.js +4 -5
  27. package/lib/Comment/footer/participants/participant/index.js +1 -3
  28. package/lib/Comment/footer/participants/participant-select/index.js +8 -24
  29. package/lib/Comment/index.js +39 -57
  30. package/lib/Comment/utils/utilities.js +15 -21
  31. package/lib/CreatorFormatter/index.js +6 -8
  32. package/lib/DTableColorPicker/ColorPickerPortal/index.js +23 -19
  33. package/lib/DTableColorPicker/index.css +0 -2
  34. package/lib/DTableColorPicker/index.js +56 -41
  35. package/lib/DTableColorPicker/utils.js +4 -6
  36. package/lib/DTableColumnIcon/index.js +6 -7
  37. package/lib/DTableCommonAddTool/index.css +1 -3
  38. package/lib/DTableCommonAddTool/index.js +6 -8
  39. package/lib/DTableCustomFooter/index.css +1 -3
  40. package/lib/DTableCustomFooter/index.js +1 -3
  41. package/lib/DTableCustomizeCollaboratorSelect/index.js +17 -20
  42. package/lib/DTableCustomizeSelect/index.js +19 -24
  43. package/lib/DTableDropdownItem/index.js +16 -18
  44. package/lib/DTableDropdownMenu/index.js +8 -10
  45. package/lib/DTableEmptyTip/index.js +4 -5
  46. package/lib/DTableFiltersPopover/index.css +0 -2
  47. package/lib/DTableFiltersPopover/index.js +26 -41
  48. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +1 -3
  49. package/lib/DTableFiltersPopover/utils/index.js +63 -113
  50. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +8 -9
  51. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +16 -13
  52. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +18 -15
  53. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +8 -14
  54. package/lib/DTableFiltersPopover/widgets/filter-group.js +34 -55
  55. package/lib/DTableFiltersPopover/widgets/filter-item.js +107 -170
  56. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +136 -161
  57. package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
  58. package/lib/DTableGroupSelect/index.js +11 -15
  59. package/lib/DTableGroupSelect/select-option-group.js +23 -32
  60. package/lib/DTableIcon/index.js +6 -7
  61. package/lib/DTableIcon/svg-icon.js +5 -7
  62. package/lib/DTableModalHeader/index.js +1 -3
  63. package/lib/DTablePopover/index.js +13 -16
  64. package/lib/DTableRadio/index.js +10 -9
  65. package/lib/DTableRadioGroup/index.js +8 -17
  66. package/lib/DTableSearchInput/index.js +19 -29
  67. package/lib/DTableSelect/dtable-select-label.js +6 -5
  68. package/lib/DTableSelect/index.js +21 -22
  69. package/lib/DTableSelect/utils.js +7 -15
  70. package/lib/DTableSubDropdownMenu/index.js +8 -10
  71. package/lib/DTableSubDropdownToggle/index.js +12 -12
  72. package/lib/DTableSwitch/index.css +0 -1
  73. package/lib/DTableSwitch/index.js +12 -11
  74. package/lib/DTableToolTip/index.js +7 -8
  75. package/lib/DateEditor/index.js +20 -15
  76. package/lib/DateEditor/mb-editor/index.js +18 -31
  77. package/lib/DateEditor/pc-editor.js +26 -45
  78. package/lib/DateFormatter/index.js +4 -5
  79. package/lib/DatePicker/index.js +9 -15
  80. package/lib/DatePicker/utils.js +1 -3
  81. package/lib/DeleteTip/index.js +5 -6
  82. package/lib/DepartmentMultipleSelectEditor/index.js +25 -23
  83. package/lib/DepartmentSelectFilter/index.js +6 -8
  84. package/lib/DepartmentSingleSelectEditor/index.js +1 -3
  85. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +48 -47
  86. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +36 -58
  87. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -19
  88. package/lib/DepartmentSingleSelectFormatter/index.js +4 -6
  89. package/lib/DigitalSignEditor/index.js +1 -3
  90. package/lib/DigitalSignEditor/mb-editor/index.js +12 -20
  91. package/lib/DigitalSignEditor/pc-editor/index.js +17 -24
  92. package/lib/DigitalSignEditor/service.js +2 -4
  93. package/lib/DigitalSignEditor/signature-board/index.js +5 -8
  94. package/lib/DigitalSignEditor/utils.js +2 -4
  95. package/lib/DigitalSignFormatter/index.js +12 -15
  96. package/lib/DigitalSignFormatter/utils.js +4 -5
  97. package/lib/DurationEditor/index.js +21 -31
  98. package/lib/DurationFormatter/index.js +4 -5
  99. package/lib/EditEditorButton/index.js +1 -3
  100. package/lib/EmailFormatter/index.js +3 -4
  101. package/lib/FieldDisplaySetting/field-item.js +12 -12
  102. package/lib/FieldDisplaySetting/index.js +11 -9
  103. package/lib/FileEditor/files-previewer/index.js +1 -3
  104. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +10 -18
  105. package/lib/FileEditor/files-previewer/mb-previewer/index.js +7 -8
  106. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +3 -4
  107. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +5 -6
  108. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +14 -21
  109. package/lib/FileEditor/files-previewer/pc-previewer/index.js +29 -57
  110. package/lib/FileEditor/index.js +1 -3
  111. package/lib/FileEditor/mb-editor/index.js +28 -20
  112. package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -3
  113. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +11 -25
  114. package/lib/FileEditor/pc-editor/index.js +19 -27
  115. package/lib/FileFormatter/index.js +26 -19
  116. package/lib/FileItemFormatter/index.js +6 -9
  117. package/lib/FileUploader/index.js +28 -45
  118. package/lib/FormulaFormatter/index.js +15 -29
  119. package/lib/GeolocationEditor/index.js +11 -12
  120. package/lib/GeolocationEditor/map-editor-utils.js +17 -15
  121. package/lib/GeolocationEditor/mb-editor/country-editor.js +17 -14
  122. package/lib/GeolocationEditor/mb-editor/index.js +4 -6
  123. package/lib/GeolocationEditor/mb-editor/location-editor.js +18 -15
  124. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +41 -68
  125. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +50 -89
  126. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +17 -14
  127. package/lib/GeolocationEditor/mb-editor/province-editor.js +17 -14
  128. package/lib/GeolocationEditor/pc-editor/country-editor.js +10 -23
  129. package/lib/GeolocationEditor/pc-editor/index.js +12 -20
  130. package/lib/GeolocationEditor/pc-editor/location-editor.js +26 -31
  131. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +34 -54
  132. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +36 -60
  133. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +35 -62
  134. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +36 -65
  135. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +19 -25
  136. package/lib/GeolocationEditor/pc-editor/province-editor.js +6 -13
  137. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +5 -6
  138. package/lib/GeolocationEditor/pc-editor/selector-list.js +6 -7
  139. package/lib/GeolocationFormatter/index.js +4 -5
  140. package/lib/HtmlLongTextFormatter/index.js +4 -12
  141. package/lib/Icon/index.js +3 -5
  142. package/lib/IconButton/index.js +4 -6
  143. package/lib/ImageEditor/images-previewer/image-preview/index.js +12 -21
  144. package/lib/ImageEditor/images-previewer/index.js +3 -9
  145. package/lib/ImageEditor/index.js +1 -3
  146. package/lib/ImageEditor/mb-editor/index.js +28 -20
  147. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +2 -6
  148. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +1 -3
  149. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +7 -21
  150. package/lib/ImageEditor/pc-editor/images-previewer/index.js +3 -9
  151. package/lib/ImageEditor/pc-editor/index.js +11 -16
  152. package/lib/ImageFormatter/images-lazy-load.js +19 -11
  153. package/lib/ImageFormatter/index.js +11 -13
  154. package/lib/ImagePreviewerLightbox/index.js +15 -13
  155. package/lib/ImageThumbnail/index.js +10 -13
  156. package/lib/InputItem/custom-input.js +26 -46
  157. package/lib/InputItem/custom-keyboard.js +15 -18
  158. package/lib/InputItem/index.js +34 -50
  159. package/lib/InputItem/input.js +2 -4
  160. package/lib/LastModifierFormatter/index.js +6 -8
  161. package/lib/LinkEditor/index.js +33 -53
  162. package/lib/LinkEditor/link-editor-option.js +3 -4
  163. package/lib/LinkEditor/mb-popover/index.js +9 -22
  164. package/lib/LinkEditor/pc-popover/index.js +5 -10
  165. package/lib/LinkFormatter/index.js +21 -37
  166. package/lib/List/index.js +6 -8
  167. package/lib/List/list-item.js +22 -28
  168. package/lib/LongTextFormatter/index.js +4 -5
  169. package/lib/MBEditorHeader/index.js +7 -8
  170. package/lib/MTimeFormatter/index.js +3 -4
  171. package/lib/MobileFullScreenPage/body/index.js +3 -5
  172. package/lib/MobileFullScreenPage/header/index.js +4 -6
  173. package/lib/MobileFullScreenPage/index.js +13 -11
  174. package/lib/MobileModal/index.js +1 -3
  175. package/lib/MobileOperationSheet/index.js +7 -8
  176. package/lib/MobileSelector/empty/index.js +1 -3
  177. package/lib/MobileSelector/index.js +5 -7
  178. package/lib/MobileSelector/option/index.js +3 -5
  179. package/lib/MobileSelector/options/index.js +1 -3
  180. package/lib/MobileSelector/search/index.js +3 -5
  181. package/lib/MobileUpload/index.js +4 -5
  182. package/lib/Modal/modal.js +14 -15
  183. package/lib/Modal/prompt.js +4 -4
  184. package/lib/MultipleSelectEditor/index.js +1 -3
  185. package/lib/MultipleSelectFormatter/index.js +6 -8
  186. package/lib/NotificationPopover/index.css +1 -6
  187. package/lib/NotificationPopover/index.js +6 -7
  188. package/lib/NumberEditor/index.js +12 -21
  189. package/lib/NumberFormatter/index.js +4 -5
  190. package/lib/PhoneNumberLink/index.js +2 -4
  191. package/lib/Picker/AbstractPicker.js +23 -27
  192. package/lib/Popover/index.js +3 -4
  193. package/lib/Popover/item.js +7 -9
  194. package/lib/Progress/index.js +9 -8
  195. package/lib/Radio/Radio.js +4 -8
  196. package/lib/Radio/RadioItem.js +8 -12
  197. package/lib/RateFormatter/index.js +13 -13
  198. package/lib/RoleStatusEditor/index.js +18 -17
  199. package/lib/RowExpandDialog/body/index.js +32 -49
  200. package/lib/RowExpandDialog/column-content/index.js +5 -9
  201. package/lib/RowExpandDialog/header/index.js +6 -8
  202. package/lib/RowExpandDialog/index.js +49 -34
  203. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +4 -5
  204. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +8 -10
  205. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +22 -33
  206. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +26 -40
  207. package/lib/RowExpandEditor/date-editor/mb-editor.js +12 -18
  208. package/lib/RowExpandEditor/date-editor/pc-editor.js +15 -20
  209. package/lib/RowExpandEditor/department-editor/mb-editor.js +16 -11
  210. package/lib/RowExpandEditor/department-editor/pc-editor.js +19 -14
  211. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +20 -34
  212. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +21 -35
  213. package/lib/RowExpandEditor/duration-editor/mb-editor.js +10 -17
  214. package/lib/RowExpandEditor/duration-editor/pc-editor.js +13 -19
  215. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +9 -19
  216. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +13 -24
  217. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +18 -31
  218. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +16 -23
  219. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +17 -29
  220. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +13 -26
  221. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +15 -25
  222. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +13 -23
  223. package/lib/RowExpandEditor/index.js +4 -8
  224. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +17 -18
  225. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +10 -16
  226. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +16 -23
  227. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +11 -19
  228. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +22 -33
  229. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +8 -14
  230. package/lib/RowExpandEditor/number-editor/pc-editor.js +13 -20
  231. package/lib/RowExpandEditor/rate-editor/mb-editor.js +12 -25
  232. package/lib/RowExpandEditor/rate-editor/pc-editor.js +20 -36
  233. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +17 -28
  234. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +22 -34
  235. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +4 -5
  236. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +15 -26
  237. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +5 -13
  238. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +9 -18
  239. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -4
  240. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +2 -4
  241. package/lib/RowExpandFormatter/email-formatter/index.js +4 -7
  242. package/lib/RowExpandFormatter/file-formatter/index.js +8 -9
  243. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +10 -12
  244. package/lib/RowExpandFormatter/formula-formatter/index.js +19 -34
  245. package/lib/RowExpandFormatter/image-formatter/index.js +9 -11
  246. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +7 -8
  247. package/lib/RowExpandFormatter/index.js +27 -41
  248. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +8 -14
  249. package/lib/RowExpandFormatter/link-formatter/index.js +11 -19
  250. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +3 -5
  251. package/lib/RowExpandFormatter/rate-formatter/index.js +11 -12
  252. package/lib/RowExpandFormatter/text/index.js +4 -5
  253. package/lib/RowExpandFormatter/url-formatter/index.js +4 -7
  254. package/lib/RowExpandView/body/index.js +22 -35
  255. package/lib/RowExpandView/column-content/index.js +3 -7
  256. package/lib/RowExpandView/index.js +42 -30
  257. package/lib/SelectItem/index.js +5 -7
  258. package/lib/SelectOptionGroup/index.css +3 -3
  259. package/lib/SelectOptionGroup/index.js +31 -40
  260. package/lib/SelectedDepartments/index.js +7 -9
  261. package/lib/SimpleLongTextFormatter/index.js +10 -16
  262. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +3 -4
  263. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +12 -21
  264. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -4
  265. package/lib/SingleSelectEditor/index.js +1 -3
  266. package/lib/SingleSelectFormatter/index.js +8 -9
  267. package/lib/TabBar/Tab.js +14 -16
  268. package/lib/TabBar/index.js +18 -21
  269. package/lib/Tabs/index.js +1 -3
  270. package/lib/TextEditor/index.js +14 -23
  271. package/lib/TextFormatter/index.js +3 -4
  272. package/lib/TextareaItem/index.js +19 -26
  273. package/lib/Toast/index.js +3 -4
  274. package/lib/UrlFormatter/index.js +3 -4
  275. package/lib/common/editor-base.js +7 -12
  276. package/lib/hooks/common-hooks.js +2 -4
  277. package/lib/select-editor/index.js +1 -3
  278. package/lib/select-editor/mb-editor/index.js +17 -28
  279. package/lib/select-editor/pc-editor/index.js +27 -42
  280. package/lib/toaster/alert.js +6 -7
  281. package/lib/toaster/toast.js +2 -3
  282. package/lib/toaster/toastManager.js +2 -4
  283. package/lib/utils/cell.js +8 -11
  284. package/lib/utils/column-utils.js +8 -14
  285. package/lib/utils/departments.js +1 -3
  286. package/lib/utils/url.js +24 -31
  287. package/lib/utils/utils.js +2 -6
  288. package/package.json +8 -8
@@ -50,9 +50,7 @@ class TextareaItem extends React.Component {
50
50
  value
51
51
  });
52
52
  }
53
- const {
54
- onChange
55
- } = this.props;
53
+ const onChange = this.props.onChange;
56
54
  if (onChange) {
57
55
  onChange(value);
58
56
  }
@@ -136,30 +134,25 @@ class TextareaItem extends React.Component {
136
134
  }
137
135
  render() {
138
136
  const _this$props = this.props,
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,
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,
155
151
  otherProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
156
- const {
157
- disabled
158
- } = otherProps;
159
- const {
160
- value,
161
- focus
162
- } = this.state;
152
+ const disabled = otherProps.disabled;
153
+ const _this$state = this.state,
154
+ value = _this$state.value,
155
+ focus = _this$state.focus;
163
156
  const hasCount = count > 0 && this.props.rows > 1;
164
157
  const wrapCls = (0, _classnames.default)(className, "".concat(prefixListCls, "-item"), "".concat(prefixCls, "-item"), {
165
158
  ["".concat(prefixCls, "-disabled")]: disabled,
@@ -124,10 +124,9 @@ const Toast = {
124
124
  },
125
125
  config() {
126
126
  let conf = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
127
- const {
128
- duration = SHORT,
129
- mask
130
- } = conf;
127
+ const _conf$duration = conf.duration,
128
+ duration = _conf$duration === void 0 ? SHORT : _conf$duration,
129
+ mask = conf.mask;
131
130
  config.duration = duration;
132
131
  if (mask === false) {
133
132
  config.mask = false;
@@ -11,10 +11,9 @@ require("./index.css");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  class UrlFormatter extends _react.default.Component {
13
13
  render() {
14
- const {
15
- containerClassName,
16
- value
17
- } = this.props;
14
+ const _this$props = this.props,
15
+ containerClassName = _this$props.containerClassName,
16
+ value = _this$props.value;
18
17
  let classname = (0, _classnames.default)('dtable-ui cell-formatter-container url-formatter', containerClassName);
19
18
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
20
19
  title: value,
@@ -15,22 +15,17 @@ class EditorBase extends _react.default.Component {
15
15
  }
16
16
  getValue() {
17
17
  const updated = {};
18
- const {
19
- column
20
- } = this.props;
21
- const {
22
- type,
23
- key,
24
- data
25
- } = column;
18
+ const column = this.props.column;
19
+ const type = column.type,
20
+ key = column.key,
21
+ data = column.data;
26
22
  let value = this.getInputNode().value;
27
23
  if (type === _dtableUtils.CellType.TEXT) {
28
24
  value = value ? value.trim() : '';
29
25
  } else if (type === _dtableUtils.CellType.NUMBER) {
30
- let {
31
- precision,
32
- enable_precision
33
- } = data || {};
26
+ let _ref = data || {},
27
+ precision = _ref.precision,
28
+ enable_precision = _ref.enable_precision;
34
29
  if (enable_precision && (0, _dtableUtils.isNumber)(value)) {
35
30
  value = Number(value.toFixed(precision));
36
31
  }
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useClickOutside = void 0;
7
7
  var _react = require("react");
8
8
  const useClickOutside = (_ref, deps) => {
9
- let {
10
- currDOM,
11
- onClickOutside
12
- } = _ref;
9
+ let currDOM = _ref.currDOM,
10
+ onClickOutside = _ref.onClickOutside;
13
11
  (0, _react.useEffect)(() => {
14
12
  const onMousedown = event => {
15
13
  if (currDOM && event && currDOM.contains(event.target)) {
@@ -15,9 +15,7 @@ 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 {
19
- isMobile
20
- } = _ref,
18
+ let isMobile = _ref.isMobile,
21
19
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
22
20
  if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
23
21
  ref: ref
@@ -12,31 +12,23 @@ 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 {
16
- Search,
17
- Option,
18
- Options,
19
- Empty
20
- } = _MobileSelector.default;
15
+ const Search = _MobileSelector.default.Search,
16
+ Option = _MobileSelector.default.Option,
17
+ Options = _MobileSelector.default.Options,
18
+ Empty = _MobileSelector.default.Empty;
21
19
  class MBSelectEditor extends _react.default.Component {
22
20
  constructor(props) {
23
21
  super(props);
24
22
  this.onChangeSearch = newValue => {
25
- const {
26
- searchVal
27
- } = this.state;
23
+ const searchVal = this.state.searchVal;
28
24
  if (searchVal === newValue) return;
29
25
  this.setState({
30
26
  searchVal: newValue
31
27
  });
32
28
  };
33
29
  this.getDisplayOptions = () => {
34
- const {
35
- options
36
- } = this.props;
37
- const {
38
- searchVal
39
- } = this.state;
30
+ const options = this.props.options;
31
+ const searchVal = this.state.searchVal;
40
32
  return searchVal ? options.filter(item => item.name.indexOf(searchVal) > -1) : options;
41
33
  };
42
34
  this.onChange = option => {
@@ -52,10 +44,10 @@ class MBSelectEditor extends _react.default.Component {
52
44
  }
53
45
  };
54
46
  this.renderOptions = options => {
55
- const {
56
- value = [],
57
- valueKey
58
- } = this.props;
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;
59
51
  return options.map(option => {
60
52
  const isSelected = value.includes(option[valueKey]);
61
53
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Option, {
@@ -72,15 +64,12 @@ class MBSelectEditor extends _react.default.Component {
72
64
  };
73
65
  }
74
66
  render() {
75
- const {
76
- column,
77
- isSupportNewOption,
78
- options,
79
- onAddNewOption
80
- } = this.props;
81
- const {
82
- searchVal
83
- } = this.state;
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;
84
73
  const displayOptions = this.getDisplayOptions();
85
74
  const isShowCreateBtn = isSupportNewOption && onAddNewOption && !!searchVal && !options.find(item => item.name !== searchVal);
86
75
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MobileSelector.default, {
@@ -38,9 +38,7 @@ class PCSelectEditor extends _react.default.Component {
38
38
  this.onEnter = e => {
39
39
  e.preventDefault();
40
40
  let option;
41
- const {
42
- isSupportNewOption
43
- } = this.props;
41
+ const isSupportNewOption = this.props.isSupportNewOption;
44
42
  if (this.filteredOptions.length === 1) {
45
43
  option = this.filteredOptions[0];
46
44
  } else if (this.state.highlightIndex > -1) {
@@ -49,9 +47,7 @@ class PCSelectEditor extends _react.default.Component {
49
47
  if (option) {
50
48
  this.onChange(option);
51
49
  } else {
52
- const {
53
- searchValue
54
- } = this.state;
50
+ const searchValue = this.state.searchValue;
55
51
  if (searchValue && isSupportNewOption && this.filteredOptions.length === 0) {
56
52
  e.stopPropagation();
57
53
  this.onAddNewOption();
@@ -61,11 +57,10 @@ class PCSelectEditor extends _react.default.Component {
61
57
  this.onUpArrow = e => {
62
58
  e.preventDefault();
63
59
  e.stopPropagation();
64
- let {
65
- highlightIndex,
66
- maxItemNum,
67
- itemHeight
68
- } = this.state;
60
+ let _this$state = this.state,
61
+ highlightIndex = _this$state.highlightIndex,
62
+ maxItemNum = _this$state.maxItemNum,
63
+ itemHeight = _this$state.itemHeight;
69
64
  if (highlightIndex > 0) {
70
65
  this.setState({
71
66
  highlightIndex: highlightIndex - 1
@@ -79,11 +74,10 @@ class PCSelectEditor extends _react.default.Component {
79
74
  this.onDownArrow = e => {
80
75
  e.preventDefault();
81
76
  e.stopPropagation();
82
- let {
83
- highlightIndex,
84
- maxItemNum,
85
- itemHeight
86
- } = this.state;
77
+ let _this$state2 = this.state,
78
+ highlightIndex = _this$state2.highlightIndex,
79
+ maxItemNum = _this$state2.maxItemNum,
80
+ itemHeight = _this$state2.itemHeight;
87
81
  if (highlightIndex < this.filteredOptions.length - 1) {
88
82
  this.setState({
89
83
  highlightIndex: highlightIndex + 1
@@ -95,12 +89,8 @@ class PCSelectEditor extends _react.default.Component {
95
89
  }
96
90
  };
97
91
  this.onValueChanged = searchValue => {
98
- const {
99
- searchValue: oldSearchVal
100
- } = this.state;
101
- const {
102
- options
103
- } = this.props;
92
+ const oldSearchVal = this.state.searchValue;
93
+ const options = this.props.options;
104
94
  if (oldSearchVal === searchValue) return;
105
95
  this.setState({
106
96
  searchValue
@@ -133,9 +123,7 @@ class PCSelectEditor extends _react.default.Component {
133
123
  }, 300);
134
124
  };
135
125
  this.getOptionStyle = option => {
136
- const {
137
- optionWidth
138
- } = this.props;
126
+ const optionWidth = this.props.optionWidth;
139
127
  const textColor = option.textColor || null;
140
128
  return {
141
129
  display: 'inline-block',
@@ -179,9 +167,8 @@ class PCSelectEditor extends _react.default.Component {
179
167
  this.ref.style.top = '-200px';
180
168
  }
181
169
  }
182
- const {
183
- bottom
184
- } = this.ref.getBoundingClientRect();
170
+ const _this$ref$getBounding = this.ref.getBoundingClientRect(),
171
+ bottom = _this$ref$getBounding.bottom;
185
172
  if (bottom > window.innerHeight) {
186
173
  this.ref.style.top = parseInt(this.ref.style.top) - bottom + window.innerHeight + 'px';
187
174
  }
@@ -201,20 +188,18 @@ class PCSelectEditor extends _react.default.Component {
201
188
  }
202
189
  }
203
190
  render() {
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;
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;
218
203
 
219
204
  // 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
220
205
  // maxWidth = column.width > 200 ? column.width - 20 - 12 - 20 - 10 : 200 - 20 - 12 - 20 - 10
@@ -23,13 +23,12 @@ class Alert extends _react.default.PureComponent {
23
23
  }
24
24
  }
25
25
  render() {
26
- const {
27
- intent,
28
- title,
29
- children,
30
- isRemovable,
31
- onRemove
32
- } = this.props;
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;
33
32
  const iconClass = this.getIconClass(intent);
34
33
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
35
34
  className: "dtable-toast-alert-container ".concat(intent || 'success'),
@@ -52,9 +52,8 @@ class Toast extends _react.default.PureComponent {
52
52
  this.onRef = ref => {
53
53
  if (ref === null) return;
54
54
  setTimeout(() => {
55
- const {
56
- height
57
- } = ref.getBoundingClientRect();
55
+ const _ref$getBoundingClien = ref.getBoundingClientRect(),
56
+ height = _ref$getBoundingClien.height;
58
57
  this.containerRef.current.style.height = height + 'px';
59
58
  }, 1);
60
59
  };
@@ -97,10 +97,8 @@ 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 {
101
- id,
102
- description
103
- } = _ref,
100
+ let id = _ref.id,
101
+ description = _ref.description,
104
102
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
105
103
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_toast.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
106
104
  onRemove: () => this.removeToast(id)
package/lib/utils/cell.js CHANGED
@@ -7,10 +7,9 @@ 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 {
11
- format_specification_value,
12
- format_check_type
13
- } = columnData || {};
10
+ const _ref = columnData || {},
11
+ format_specification_value = _ref.format_specification_value,
12
+ format_check_type = _ref.format_check_type;
14
13
  let isMatched = false;
15
14
  if (format_check_type !== 'custom_format') {
16
15
  const reg = _constants.FORMAT_REG_EXP_LIST[format_check_type];
@@ -23,10 +22,9 @@ const checkValueConformityFormat = (columnData, value) => {
23
22
  };
24
23
  exports.checkValueConformityFormat = checkValueConformityFormat;
25
24
  const checkNumberValidation = (columnData, value) => {
26
- const {
27
- format_max_value,
28
- format_min_value
29
- } = columnData || {};
25
+ const _ref2 = columnData || {},
26
+ format_max_value = _ref2.format_max_value,
27
+ format_min_value = _ref2.format_min_value;
30
28
  const num = parseFloat(value);
31
29
  if (isNaN(num) || !num && num !== 0) {
32
30
  return false;
@@ -43,9 +41,8 @@ exports.checkNumberValidation = checkNumberValidation;
43
41
  const isLongTextValueExceedLimit = value => {
44
42
  if (!value) return false;
45
43
  if (typeof value === 'string') return value.length >= _constants.LONG_TEXT_LENGTH_LIMIT;
46
- const {
47
- text
48
- } = value || {};
44
+ const _ref3 = value || {},
45
+ text = _ref3.text;
49
46
  return text ? text.length >= _constants.LONG_TEXT_LENGTH_LIMIT : false;
50
47
  };
51
48
  exports.isLongTextValueExceedLimit = isLongTextValueExceedLimit;
@@ -9,12 +9,9 @@ exports.isEnableCheckFormat = void 0;
9
9
  var _dtableUtils = require("dtable-utils");
10
10
  const isEnableCheckFormat = column => {
11
11
  if (!column) return false;
12
- const {
13
- data
14
- } = column;
15
- const {
16
- enable_check_format
17
- } = data || {};
12
+ const data = column.data;
13
+ const _ref = data || {},
14
+ enable_check_format = _ref.enable_check_format;
18
15
  if (enable_check_format) return true;
19
16
  return false;
20
17
  };
@@ -26,15 +23,12 @@ const getDateColumnFormat = column => {
26
23
  };
27
24
  exports.getDateColumnFormat = getDateColumnFormat;
28
25
  function isCheckboxColumn(column) {
29
- let {
30
- type,
31
- data
32
- } = column;
26
+ let type = column.type,
27
+ data = column.data;
33
28
  if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
34
- const {
35
- result_type,
36
- array_type
37
- } = data || {};
29
+ const _ref2 = data || {},
30
+ result_type = _ref2.result_type,
31
+ array_type = _ref2.array_type;
38
32
  if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) {
39
33
  return array_type === _dtableUtils.CellType.CHECKBOX;
40
34
  }
@@ -11,9 +11,7 @@ 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 {
15
- name
16
- } = department;
14
+ const name = department.name;
17
15
  if (!name) return false;
18
16
  return name.toString().toLowerCase().indexOf(validSearchValue) > -1;
19
17
  });
package/lib/utils/url.js CHANGED
@@ -71,13 +71,11 @@ const needUseThumbnailImage = url => {
71
71
  exports.needUseThumbnailImage = needUseThumbnailImage;
72
72
  const generateCurrentBaseImageThumbnailUrl = _ref => {
73
73
  var _window2;
74
- let {
75
- server,
76
- workspaceID,
77
- dtableUuid,
78
- partUrl,
79
- size
80
- } = _ref;
74
+ let server = _ref.server,
75
+ workspaceID = _ref.workspaceID,
76
+ dtableUuid = _ref.dtableUuid,
77
+ partUrl = _ref.partUrl,
78
+ size = _ref.size;
81
79
  const validServer = server || ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.dtable) && window.dtable.server || '';
82
80
  if (!partUrl || typeof partUrl !== 'string') return '';
83
81
  let url = "".concat(validServer, "/thumbnail/workspace/").concat(workspaceID, "/asset/").concat(dtableUuid).concat(partUrl);
@@ -87,12 +85,10 @@ const generateCurrentBaseImageThumbnailUrl = _ref => {
87
85
  exports.generateCurrentBaseImageThumbnailUrl = generateCurrentBaseImageThumbnailUrl;
88
86
  const generateCurrentBaseImageUrl = _ref2 => {
89
87
  var _window3;
90
- let {
91
- server,
92
- workspaceID,
93
- dtableUuid,
94
- partUrl
95
- } = _ref2;
88
+ let server = _ref2.server,
89
+ workspaceID = _ref2.workspaceID,
90
+ dtableUuid = _ref2.dtableUuid,
91
+ partUrl = _ref2.partUrl;
96
92
  if (!partUrl || typeof partUrl !== 'string') return '';
97
93
  if (partUrl.startsWith('http')) return partUrl;
98
94
  const validServer = server || ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.dtable) && window.dtable.server || '';
@@ -100,12 +96,12 @@ const generateCurrentBaseImageUrl = _ref2 => {
100
96
  };
101
97
  exports.generateCurrentBaseImageUrl = generateCurrentBaseImageUrl;
102
98
  const getImageThumbnailUrl = function (url) {
103
- let {
104
- server,
105
- dtableUuid,
106
- workspaceID,
107
- size = 256
108
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
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;
109
105
  if (!url || typeof url !== 'string') return '';
110
106
  if (server && dtableUuid && isCustomAssetUrl(url)) {
111
107
  const assetUuid = url.slice(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
@@ -149,9 +145,9 @@ const imageCheck = filename => {
149
145
  };
150
146
  exports.imageCheck = imageCheck;
151
147
  const isInternalURL = function (url) {
152
- let {
153
- server = ''
154
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
148
+ let _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
149
+ _ref4$server = _ref4.server,
150
+ server = _ref4$server === void 0 ? '' : _ref4$server;
155
151
  if (!url || typeof url !== 'string') return false;
156
152
  return server && url.indexOf(server) > -1;
157
153
  };
@@ -160,10 +156,8 @@ const getValidFileImageUrls = files => {
160
156
  if (!Array.isArray(files)) return [];
161
157
  return files.map(file => {
162
158
  if (typeof file !== 'object') return null;
163
- const {
164
- url,
165
- name
166
- } = file;
159
+ const url = file.url,
160
+ name = file.name;
167
161
  if (!url || url.indexOf('/asset') < 0) return null;
168
162
  return imageCheck(name) ? url : null;
169
163
  }).filter(Boolean);
@@ -188,11 +182,10 @@ const getFileIconUrl = (filename, direntType) => {
188
182
  };
189
183
  exports.getFileIconUrl = getFileIconUrl;
190
184
  const getFileThumbnailInfo = function (file) {
191
- let {
192
- server,
193
- dtableUuid,
194
- workspaceID
195
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
185
+ let _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
186
+ server = _ref5.server,
187
+ dtableUuid = _ref5.dtableUuid,
188
+ workspaceID = _ref5.workspaceID;
196
189
  const defaultIcon = _file.FILEEXT_ICON_MAP['default'];
197
190
  const defaultIconUrl = _file.FILEEXT_ICON_URL_MAP[defaultIcon];
198
191
  if (!file || !file.name) return {
@@ -163,16 +163,12 @@ const getFormulaArrayValue = value => {
163
163
  return item;
164
164
  }
165
165
  if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
166
- const {
167
- display_value
168
- } = item;
166
+ const display_value = item.display_value;
169
167
  if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
170
168
  return display_value.map(i => {
171
169
  if (Object.prototype.toString.call(i) === '[object Object]') {
172
170
  if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
173
- const {
174
- display_value
175
- } = i;
171
+ const display_value = i.display_value;
176
172
  return display_value;
177
173
  }
178
174
  return i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.125",
3
+ "version": "6.0.126",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "5.0.9",
@@ -66,15 +66,15 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@babel/cli": "7.22.15",
69
- "@babel/core": "^7.16.0",
69
+ "@babel/core": "^7.29.6",
70
70
  "@babel/plugin-proposal-private-property-in-object": "7.21.11",
71
71
  "@babel/plugin-transform-runtime": "7.22.10",
72
72
  "@babel/runtime": "7.27.6",
73
73
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
74
- "@storybook/addon-docs": "^9.1.0",
75
- "@storybook/addon-onboarding": "^9.1.0",
74
+ "@storybook/addon-docs": "^10.4.6",
75
+ "@storybook/addon-onboarding": "^10.4.6",
76
76
  "@storybook/addon-webpack5-compiler-swc": "^3.0.0",
77
- "@storybook/react-webpack5": "^9.1.0",
77
+ "@storybook/react-webpack5": "^10.4.6",
78
78
  "@svgr/webpack": "8.1.0",
79
79
  "@testing-library/jest-dom": "^5.17.0",
80
80
  "@testing-library/react": "^14.3.1",
@@ -97,7 +97,7 @@
97
97
  "dotenv-expand": "^5.1.0",
98
98
  "eslint": "^8.3.0",
99
99
  "eslint-config-react-app": "^7.0.1",
100
- "eslint-plugin-storybook": "^9.1.0",
100
+ "eslint-plugin-storybook": "^10.4.6",
101
101
  "eslint-webpack-plugin": "^3.1.1",
102
102
  "file-loader": "^6.2.0",
103
103
  "fs-extra": "^10.0.0",
@@ -131,12 +131,12 @@
131
131
  "sass-loader": "^12.3.0",
132
132
  "semver": "^7.3.5",
133
133
  "source-map-loader": "^3.0.0",
134
- "storybook": "^9.1.19",
134
+ "storybook": "^10.4.6",
135
135
  "style-loader": "^3.3.1",
136
136
  "terser-webpack-plugin": "^5.2.5",
137
137
  "url-loader": "^4.1.1",
138
138
  "webpack": "^5.105.4",
139
- "webpack-dev-server": "^5.2.4",
139
+ "webpack-dev-server": "^5.2.5",
140
140
  "worker-loader": "3.0.8"
141
141
  }
142
142
  }