dtable-ui-component 7.0.14 → 7.0.16

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 (280) hide show
  1. package/lib/ActionSheet/index.js +16 -14
  2. package/lib/ActivityIndicator/index.js +8 -7
  3. package/lib/AsyncUserSelect/index.js +18 -44
  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/DTableCustomizeSearchInput/index.js +25 -19
  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 +41 -26
  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 +55 -34
  50. package/lib/DTableFiltersPopover/widgets/filter-item.js +164 -105
  51. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +161 -136
  52. package/lib/DTableFiltersPopover/widgets/rate-item.js +20 -15
  53. package/lib/DTableIcon/index.js +7 -6
  54. package/lib/DTableIcon/svg-icon.js +7 -5
  55. package/lib/DTableModalHeader/index.js +3 -1
  56. package/lib/DTablePopover/index.js +15 -11
  57. package/lib/DTableRadio/index.js +9 -10
  58. package/lib/DTableRadioGroup/index.js +17 -8
  59. package/lib/DTableSearchInput/index.js +29 -19
  60. package/lib/DTableSelect/dtable-select-label.js +5 -6
  61. package/lib/DTableSelect/index.js +22 -21
  62. package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
  63. package/lib/DTableSelect/utils.js +20 -8
  64. package/lib/DTableSubDropdownMenu/index.js +10 -8
  65. package/lib/DTableSubDropdownToggle/index.js +12 -12
  66. package/lib/DTableSwitch/index.js +11 -12
  67. package/lib/DTableToolTip/index.js +8 -7
  68. package/lib/DateEditor/index.js +15 -20
  69. package/lib/DateEditor/mb-editor/index.js +31 -18
  70. package/lib/DateEditor/pc-editor.js +45 -26
  71. package/lib/DateFormatter/index.js +5 -4
  72. package/lib/DatePicker/index.js +15 -9
  73. package/lib/DatePicker/utils.js +3 -1
  74. package/lib/DeleteTip/index.js +6 -5
  75. package/lib/DepartmentMultipleSelectEditor/index.js +23 -25
  76. package/lib/DepartmentSelectFilter/index.js +8 -6
  77. package/lib/DepartmentSingleSelectEditor/index.js +3 -1
  78. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +47 -48
  79. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +58 -36
  80. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
  81. package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
  82. package/lib/DigitalSignEditor/index.js +3 -1
  83. package/lib/DigitalSignEditor/mb-editor/index.js +20 -12
  84. package/lib/DigitalSignEditor/pc-editor/index.js +24 -17
  85. package/lib/DigitalSignEditor/service.js +4 -2
  86. package/lib/DigitalSignEditor/signature-board/index.js +8 -5
  87. package/lib/DigitalSignEditor/utils.js +4 -2
  88. package/lib/DigitalSignFormatter/index.js +15 -12
  89. package/lib/DigitalSignFormatter/utils.js +5 -4
  90. package/lib/DurationEditor/index.js +31 -21
  91. package/lib/DurationFormatter/index.js +5 -4
  92. package/lib/EditEditorButton/index.js +3 -1
  93. package/lib/EmailFormatter/index.js +4 -3
  94. package/lib/FieldDisplaySetting/field-item.js +12 -12
  95. package/lib/FieldDisplaySetting/index.js +9 -11
  96. package/lib/FileEditor/files-previewer/index.js +3 -1
  97. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +18 -10
  98. package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
  99. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
  100. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
  101. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +21 -14
  102. package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
  103. package/lib/FileEditor/index.js +3 -1
  104. package/lib/FileEditor/mb-editor/index.js +20 -28
  105. package/lib/FileEditor/pc-editor/addition-previewer/index.js +3 -1
  106. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +25 -11
  107. package/lib/FileEditor/pc-editor/index.js +27 -19
  108. package/lib/FileFormatter/index.js +19 -26
  109. package/lib/FileItemFormatter/index.js +9 -6
  110. package/lib/FileUploader/index.js +45 -28
  111. package/lib/FormulaFormatter/index.js +29 -15
  112. package/lib/GeolocationEditor/index.js +12 -11
  113. package/lib/GeolocationEditor/map-editor-utils.js +15 -17
  114. package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
  115. package/lib/GeolocationEditor/mb-editor/index.js +6 -4
  116. package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
  117. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +68 -41
  118. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
  119. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
  120. package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
  121. package/lib/GeolocationEditor/pc-editor/country-editor.js +23 -10
  122. package/lib/GeolocationEditor/pc-editor/index.js +20 -12
  123. package/lib/GeolocationEditor/pc-editor/location-editor.js +31 -26
  124. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +54 -34
  125. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +60 -36
  126. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +62 -35
  127. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +65 -36
  128. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +25 -19
  129. package/lib/GeolocationEditor/pc-editor/province-editor.js +13 -6
  130. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
  131. package/lib/GeolocationEditor/pc-editor/selector-list.js +7 -6
  132. package/lib/GeolocationFormatter/index.js +5 -4
  133. package/lib/HtmlLongTextFormatter/index.js +12 -4
  134. package/lib/Icon/index.js +5 -3
  135. package/lib/IconButton/index.js +6 -4
  136. package/lib/ImageEditor/images-previewer/image-preview/index.js +21 -12
  137. package/lib/ImageEditor/images-previewer/index.js +9 -3
  138. package/lib/ImageEditor/index.js +3 -1
  139. package/lib/ImageEditor/mb-editor/index.js +20 -28
  140. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
  141. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +3 -1
  142. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +21 -7
  143. package/lib/ImageEditor/pc-editor/images-previewer/index.js +9 -3
  144. package/lib/ImageEditor/pc-editor/index.js +16 -11
  145. package/lib/ImageFormatter/images-lazy-load.js +11 -19
  146. package/lib/ImageFormatter/index.js +13 -11
  147. package/lib/ImagePreviewerLightbox/index.js +15 -19
  148. package/lib/ImageThumbnail/index.js +13 -10
  149. package/lib/InputItem/custom-input.js +46 -26
  150. package/lib/InputItem/custom-keyboard.js +18 -15
  151. package/lib/InputItem/index.js +50 -34
  152. package/lib/InputItem/input.js +4 -2
  153. package/lib/LastModifierFormatter/index.js +8 -6
  154. package/lib/LinkEditor/index.js +53 -33
  155. package/lib/LinkEditor/link-editor-option.js +4 -3
  156. package/lib/LinkEditor/mb-popover/index.js +22 -9
  157. package/lib/LinkEditor/pc-popover/index.js +10 -5
  158. package/lib/LinkFormatter/index.js +37 -21
  159. package/lib/List/index.js +8 -6
  160. package/lib/List/list-item.js +28 -22
  161. package/lib/LongTextFormatter/index.js +5 -4
  162. package/lib/MBEditorHeader/index.js +8 -7
  163. package/lib/MTimeFormatter/index.js +4 -3
  164. package/lib/MobileFullScreenPage/body/index.js +5 -3
  165. package/lib/MobileFullScreenPage/header/index.js +6 -4
  166. package/lib/MobileFullScreenPage/index.js +11 -13
  167. package/lib/MobileModal/index.js +3 -1
  168. package/lib/MobileOperationSheet/index.js +8 -7
  169. package/lib/MobileSelector/empty/index.js +3 -1
  170. package/lib/MobileSelector/index.js +7 -5
  171. package/lib/MobileSelector/option/index.js +5 -3
  172. package/lib/MobileSelector/options/index.css +0 -4
  173. package/lib/MobileSelector/options/index.js +3 -1
  174. package/lib/MobileSelector/search/index.js +5 -3
  175. package/lib/MobileUpload/index.js +5 -4
  176. package/lib/Modal/modal.js +15 -14
  177. package/lib/Modal/prompt.js +4 -4
  178. package/lib/MultipleSelectEditor/index.js +3 -1
  179. package/lib/MultipleSelectFormatter/index.js +8 -6
  180. package/lib/NotificationPopover/index.js +5 -4
  181. package/lib/NumberEditor/index.js +21 -12
  182. package/lib/NumberFormatter/index.js +5 -4
  183. package/lib/PhoneNumberLink/index.js +4 -2
  184. package/lib/Picker/AbstractPicker.js +27 -23
  185. package/lib/Popover/index.js +4 -3
  186. package/lib/Popover/item.js +9 -7
  187. package/lib/Progress/index.js +8 -9
  188. package/lib/Radio/Radio.js +8 -4
  189. package/lib/Radio/RadioItem.js +12 -8
  190. package/lib/RateFormatter/index.js +13 -13
  191. package/lib/RoleStatusEditor/index.js +17 -18
  192. package/lib/RowExpandDialog/body/index.js +49 -32
  193. package/lib/RowExpandDialog/column-content/index.js +9 -5
  194. package/lib/RowExpandDialog/header/index.js +8 -6
  195. package/lib/RowExpandDialog/index.js +34 -49
  196. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
  197. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
  198. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
  199. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
  200. package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
  201. package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
  202. package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
  203. package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
  204. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +34 -20
  205. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +35 -21
  206. package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
  207. package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
  208. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +19 -9
  209. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +24 -13
  210. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
  211. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
  212. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
  213. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
  214. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +25 -15
  215. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +23 -13
  216. package/lib/RowExpandEditor/index.js +8 -4
  217. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
  218. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
  219. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
  220. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +19 -11
  221. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +33 -22
  222. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
  223. package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
  224. package/lib/RowExpandEditor/rate-editor/mb-editor.js +25 -12
  225. package/lib/RowExpandEditor/rate-editor/pc-editor.js +36 -20
  226. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +28 -17
  227. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +34 -22
  228. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
  229. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
  230. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +13 -5
  231. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +18 -9
  232. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
  233. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
  234. package/lib/RowExpandFormatter/email-formatter/index.js +7 -4
  235. package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
  236. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +12 -10
  237. package/lib/RowExpandFormatter/formula-formatter/index.js +34 -19
  238. package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
  239. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +8 -7
  240. package/lib/RowExpandFormatter/index.js +41 -27
  241. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +14 -8
  242. package/lib/RowExpandFormatter/link-formatter/index.js +19 -11
  243. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
  244. package/lib/RowExpandFormatter/rate-formatter/index.js +12 -11
  245. package/lib/RowExpandFormatter/text/index.js +5 -4
  246. package/lib/RowExpandFormatter/url-formatter/index.js +7 -4
  247. package/lib/RowExpandView/body/index.js +35 -22
  248. package/lib/RowExpandView/column-content/index.js +7 -3
  249. package/lib/RowExpandView/index.js +30 -42
  250. package/lib/SelectItem/index.js +7 -5
  251. package/lib/SelectOptionGroup/index.js +40 -30
  252. package/lib/SelectedDepartments/index.js +9 -7
  253. package/lib/SimpleLongTextFormatter/index.js +16 -10
  254. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
  255. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
  256. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
  257. package/lib/SingleSelectEditor/index.js +3 -1
  258. package/lib/SingleSelectFormatter/index.js +9 -8
  259. package/lib/TabBar/Tab.js +16 -14
  260. package/lib/TabBar/index.js +21 -18
  261. package/lib/Tabs/index.js +3 -1
  262. package/lib/TextEditor/index.js +23 -14
  263. package/lib/TextFormatter/index.js +4 -3
  264. package/lib/TextareaItem/index.js +26 -19
  265. package/lib/Toast/index.js +4 -3
  266. package/lib/UrlFormatter/index.js +4 -3
  267. package/lib/common/editor-base.js +12 -7
  268. package/lib/hooks/common-hooks.js +4 -2
  269. package/lib/select-editor/index.js +3 -1
  270. package/lib/select-editor/mb-editor/index.js +28 -17
  271. package/lib/select-editor/pc-editor/index.js +42 -27
  272. package/lib/toaster/alert.js +7 -6
  273. package/lib/toaster/toast.js +3 -2
  274. package/lib/toaster/toastManager.js +4 -2
  275. package/lib/utils/cell.js +11 -8
  276. package/lib/utils/column-utils.js +14 -8
  277. package/lib/utils/departments.js +3 -1
  278. package/lib/utils/url.js +25 -18
  279. package/lib/utils/utils.js +6 -2
  280. package/package.json +2 -2
@@ -20,9 +20,10 @@ class CreatorFormatter extends _react.default.PureComponent {
20
20
  constructor() {
21
21
  super(...arguments);
22
22
  this.getCollaborators = () => {
23
- let _this$props = this.props,
24
- value = _this$props.value,
25
- collaborators = _this$props.collaborators;
23
+ let {
24
+ value,
25
+ collaborators
26
+ } = this.props;
26
27
  if (!Array.isArray(value)) {
27
28
  value = [value];
28
29
  }
@@ -42,9 +43,10 @@ class CreatorFormatter extends _react.default.PureComponent {
42
43
  };
43
44
  }
44
45
  render() {
45
- const _this$props2 = this.props,
46
- containerClassName = _this$props2.containerClassName,
47
- value = _this$props2.value;
46
+ const {
47
+ containerClassName,
48
+ value
49
+ } = this.props;
48
50
  const classname = (0, _classnames.default)('dtable-ui cell-formatter-container creator-formatter', containerClassName);
49
51
  if (!value || Array.isArray(value) && value.length === 0) {
50
52
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -7,37 +7,33 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = ColorPickerPortal;
9
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
10
  var _react = _interopRequireWildcard(require("react"));
12
11
  var _reactDom = _interopRequireDefault(require("react-dom"));
13
12
  var _utils = require("../../utils/utils");
14
13
  var _jsxRuntime = require("react/jsx-runtime");
15
14
  function ColorPickerPortal(_ref) {
16
- let target = _ref.target,
17
- scrollContainerId = _ref.scrollContainerId,
18
- _ref$throttleDelay = _ref.throttleDelay,
19
- throttleDelay = _ref$throttleDelay === void 0 ? 16 : _ref$throttleDelay,
20
- children = _ref.children;
15
+ let {
16
+ target,
17
+ scrollContainerId,
18
+ throttleDelay = 16,
19
+ children
20
+ } = _ref;
21
21
  const containerRef = (0, _react.useRef)(null);
22
- const _useState = (0, _react.useState)(false),
23
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
24
- isPositioned = _useState2[0],
25
- setIsPositioned = _useState2[1];
26
- const _useState3 = (0, _react.useState)(() => {
27
- return {
28
- top: '-9999px',
29
- left: '-9999px',
30
- visibility: 'hidden'
31
- };
32
- }),
33
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
34
- position = _useState4[0],
35
- setPosition = _useState4[1];
22
+ const [isPositioned, setIsPositioned] = (0, _react.useState)(false);
23
+ const [position, setPosition] = (0, _react.useState)(() => {
24
+ return {
25
+ top: '-9999px',
26
+ left: '-9999px',
27
+ visibility: 'hidden'
28
+ };
29
+ });
36
30
  const updatePosition = (0, _react.useCallback)(() => {
37
31
  if (!target || !containerRef.current) return;
38
32
  const targetRect = target.getBoundingClientRect();
39
- const spaceAbove = targetRect.top,
40
- left = targetRect.left;
33
+ const {
34
+ top: spaceAbove,
35
+ left
36
+ } = targetRect;
41
37
  const portalRectHeight = containerRef.current.clientHeight;
42
38
  const newPosition = {
43
39
  left: "".concat(left + 1, "px"),
@@ -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 _react = _interopRequireWildcard(require("react"));
12
11
  var _reactstrap = require("reactstrap");
13
12
  var _reactColor = require("react-color");
@@ -30,46 +29,25 @@ const RGB_COLORS_MAP = {
30
29
  };
31
30
  const LOCAL_STORAGE_KEY = 'dtable-color-picker';
32
31
  const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
33
- let onToggle = _ref.onToggle,
34
- popoverStyle = _ref.popoverStyle,
35
- _ref$color = _ref.color,
36
- color = _ref$color === void 0 ? '#ffffff' : _ref$color,
37
- defaultColors = _ref.defaultColors,
38
- useProtal = _ref.useProtal,
39
- target = _ref.target,
40
- scrollContainerId = _ref.scrollContainerId,
41
- _ref$throttleDelay = _ref.throttleDelay,
42
- throttleDelay = _ref$throttleDelay === void 0 ? 20 : _ref$throttleDelay,
43
- onSubmit = _ref.onSubmit;
32
+ let {
33
+ onToggle,
34
+ popoverStyle,
35
+ color = '#ffffff',
36
+ defaultColors,
37
+ useProtal,
38
+ target,
39
+ scrollContainerId,
40
+ throttleDelay = 20,
41
+ onSubmit
42
+ } = _ref;
44
43
  const initialRgbaColor = (0, _utils.hexToRgba)(color);
45
- const _useState = (0, _react.useState)(initialRgbaColor),
46
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
47
- value = _useState2[0],
48
- setValue = _useState2[1];
49
- const _useState3 = (0, _react.useState)((0, _utils.getInitialHexVal)(color)),
50
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
51
- hexVal = _useState4[0],
52
- setHexVal = _useState4[1];
53
- const _useState5 = (0, _react.useState)((0, _utils.toPercentage)(initialRgbaColor.a)),
54
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
55
- alphaVal = _useState6[0],
56
- setAlphaVal = _useState6[1];
57
- const _useState7 = (0, _react.useState)(initialRgbaColor.r),
58
- _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
59
- redVal = _useState8[0],
60
- setRedVal = _useState8[1];
61
- const _useState9 = (0, _react.useState)(initialRgbaColor.g),
62
- _useState0 = (0, _slicedToArray2.default)(_useState9, 2),
63
- greenVal = _useState0[0],
64
- setGreenVal = _useState0[1];
65
- const _useState1 = (0, _react.useState)(initialRgbaColor.b),
66
- _useState10 = (0, _slicedToArray2.default)(_useState1, 2),
67
- blueVal = _useState10[0],
68
- setBlueVal = _useState10[1];
69
- const _useState11 = (0, _react.useState)(COLOR_PICKER_MODE.HEX),
70
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
71
- colorMode = _useState12[0],
72
- setColorMode = _useState12[1]; // hex or rgb
44
+ const [value, setValue] = (0, _react.useState)(initialRgbaColor);
45
+ const [hexVal, setHexVal] = (0, _react.useState)((0, _utils.getInitialHexVal)(color));
46
+ const [alphaVal, setAlphaVal] = (0, _react.useState)((0, _utils.toPercentage)(initialRgbaColor.a));
47
+ const [redVal, setRedVal] = (0, _react.useState)(initialRgbaColor.r);
48
+ const [greenVal, setGreenVal] = (0, _react.useState)(initialRgbaColor.g);
49
+ const [blueVal, setBlueVal] = (0, _react.useState)(initialRgbaColor.b);
50
+ const [colorMode, setColorMode] = (0, _react.useState)(COLOR_PICKER_MODE.HEX); // hex or rgb
73
51
  const colorPickerRef = (0, _react.useRef)(null);
74
52
  let currentUsedColors = [];
75
53
  const currentUsedColorsStr = window.localStorage.getItem(LOCAL_STORAGE_KEY);
@@ -92,10 +70,12 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
92
70
  rgba.a = Math.round(rgba.a * 100) / 100;
93
71
  const transferedHex = (0, _utils.rgbaToHex)(rgba);
94
72
  const hexVal = transferedHex.substring(1, 7);
95
- const r = rgba.r,
96
- g = rgba.g,
97
- b = rgba.b,
98
- a = rgba.a;
73
+ const {
74
+ r,
75
+ g,
76
+ b,
77
+ a
78
+ } = rgba;
99
79
  setAlphaVal((0, _utils.toPercentage)(a));
100
80
  updateValue(rgba);
101
81
  if (colorMode === COLOR_PICKER_MODE.HEX) {
@@ -111,9 +91,11 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
111
91
  if (colorMode === COLOR_PICKER_MODE.HEX) {
112
92
  newMode = COLOR_PICKER_MODE.RGBA;
113
93
  const rgba = (0, _utils.hexToRgba)(color);
114
- const r = rgba.r,
115
- g = rgba.g,
116
- b = rgba.b;
94
+ const {
95
+ r,
96
+ g,
97
+ b
98
+ } = rgba;
117
99
  setRedVal(r);
118
100
  setGreenVal(g);
119
101
  setBlueVal(b);
@@ -140,10 +122,11 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
140
122
  newHexVal = newHexVal.split('').map(char => char + char).join('');
141
123
  }
142
124
  setHexVal(newHexVal);
143
- const _hexToRgba = (0, _utils.hexToRgba)(newHexVal),
144
- r = _hexToRgba.r,
145
- g = _hexToRgba.g,
146
- b = _hexToRgba.b;
125
+ const {
126
+ r,
127
+ g,
128
+ b
129
+ } = (0, _utils.hexToRgba)(newHexVal);
147
130
  const newValue = {
148
131
  r,
149
132
  g,
@@ -226,10 +209,12 @@ const DTableColorPicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
226
209
  };
227
210
  const onSelectDefaultColor = color => {
228
211
  const rgba = (0, _utils.hexToRgba)(color);
229
- const r = rgba.r,
230
- g = rgba.g,
231
- b = rgba.b,
232
- a = rgba.a;
212
+ const {
213
+ r,
214
+ g,
215
+ b,
216
+ a
217
+ } = rgba;
233
218
  const alphaVal = (0, _utils.toPercentage)(a);
234
219
  if (colorMode === COLOR_PICKER_MODE.RGBA) {
235
220
  setRedVal(r);
@@ -43,10 +43,12 @@ const rgbaToHex = function (color) {
43
43
  let isNeedPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
44
44
  let isNeedAlpha = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
45
45
  if (hexRegex.test(color)) return color;
46
- const r = color.r,
47
- g = color.g,
48
- b = color.b,
49
- a = color.a;
46
+ const {
47
+ r,
48
+ g,
49
+ b,
50
+ a
51
+ } = color;
50
52
  const toHex = value => {
51
53
  const hex = value.toString(16);
52
54
  return hex.length === 1 ? '0' + hex : hex;
@@ -45,12 +45,13 @@ const COLUMN_DISPLAY_TYPE_ICON_CONFIG = {
45
45
  }
46
46
  };
47
47
  const DTableColumnIcon = _ref => {
48
- let column = _ref.column,
49
- color = _ref.color,
50
- className = _ref.className,
51
- _ref$ariaHidden = _ref.ariaHidden,
52
- ariaHidden = _ref$ariaHidden === void 0 ? false : _ref$ariaHidden,
53
- getSvg = _ref.getSvg;
48
+ let {
49
+ column,
50
+ color,
51
+ className,
52
+ ariaHidden = false,
53
+ getSvg
54
+ } = _ref;
54
55
  const columnType = column === null || column === void 0 ? void 0 : column.type;
55
56
  if (!columnType) return null;
56
57
  const columnDisplayType = (0, _dtableUtils.getColumnDisplayType)(column);
@@ -9,12 +9,14 @@ var _react = _interopRequireDefault(require("react"));
9
9
  require("./index.css");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  function DTableCommonAddTool(_ref) {
12
- let callBack = _ref.callBack,
13
- footerName = _ref.footerName,
14
- className = _ref.className,
15
- addIconClassName = _ref.addIconClassName,
16
- hideIcon = _ref.hideIcon,
17
- style = _ref.style;
12
+ let {
13
+ callBack,
14
+ footerName,
15
+ className,
16
+ addIconClassName,
17
+ hideIcon,
18
+ style
19
+ } = _ref;
18
20
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
19
21
  className: "dtable-ui add-item-btn ".concat(className ? className : ''),
20
22
  style: style,
@@ -10,7 +10,9 @@ require("./index.css");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  // DTableCustomFooter is used in geolocation editor and digital sign editor
12
12
  const DTableCustomFooter = _ref => {
13
- let children = _ref.children;
13
+ let {
14
+ children
15
+ } = _ref;
14
16
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
15
17
  className: "dtable-custom-footer",
16
18
  children: children
@@ -25,10 +25,10 @@ class DTableCustomizeSearchInput extends _react.Component {
25
25
  this.timer = null;
26
26
  };
27
27
  this.scheduleSearchChange = searchValue => {
28
- const _this$props = this.props,
29
- onChange = _this$props.onChange,
30
- _this$props$wait = _this$props.wait,
31
- wait = _this$props$wait === void 0 ? 100 : _this$props$wait;
28
+ const {
29
+ onChange,
30
+ wait = 100
31
+ } = this.props;
32
32
  this.timer = setTimeout(() => {
33
33
  this.timer = null;
34
34
  onChange(searchValue.trim());
@@ -49,7 +49,9 @@ class DTableCustomizeSearchInput extends _react.Component {
49
49
  };
50
50
  this.clearSearch = event => {
51
51
  event && event.stopPropagation && event.stopPropagation();
52
- const clearValue = this.props.clearValue;
52
+ const {
53
+ clearValue
54
+ } = this.props;
53
55
  this.clearChangeTimer();
54
56
  this.setState({
55
57
  searchValue: ''
@@ -66,10 +68,13 @@ class DTableCustomizeSearchInput extends _react.Component {
66
68
  }
67
69
  };
68
70
  this.renderClear = () => {
69
- const _this$props2 = this.props,
70
- isClearable = _this$props2.isClearable,
71
- clearClassName = _this$props2.clearClassName;
72
- const searchValue = this.state.searchValue;
71
+ const {
72
+ isClearable,
73
+ clearClassName
74
+ } = this.props;
75
+ const {
76
+ searchValue
77
+ } = this.state;
73
78
  if (!isClearable || !searchValue) return null;
74
79
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
75
80
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -114,16 +119,17 @@ class DTableCustomizeSearchInput extends _react.Component {
114
119
  this.inputRef = null;
115
120
  }
116
121
  render() {
117
- const _this$props3 = this.props,
118
- placeholder = _this$props3.placeholder,
119
- autoFocus = _this$props3.autoFocus,
120
- className = _this$props3.className,
121
- onKeyDown = _this$props3.onKeyDown,
122
- _this$props3$disabled = _this$props3.disabled,
123
- disabled = _this$props3$disabled === void 0 ? false : _this$props3$disabled,
124
- _this$props3$style = _this$props3.style,
125
- style = _this$props3$style === void 0 ? {} : _this$props3$style;
126
- const searchValue = this.state.searchValue;
122
+ const {
123
+ placeholder,
124
+ autoFocus,
125
+ className,
126
+ onKeyDown,
127
+ disabled = false,
128
+ style = {}
129
+ } = this.props;
130
+ const {
131
+ searchValue
132
+ } = this.state;
127
133
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
128
134
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
129
135
  type: "text",
@@ -54,20 +54,24 @@ class DTableCustomizeSelect extends _react.Component {
54
54
  };
55
55
  this.getSelectedOptionTop = () => {
56
56
  if (!this.selector) return 38;
57
- const _this$selector$getBou = this.selector.getBoundingClientRect(),
58
- height = _this$selector$getBou.height;
57
+ const {
58
+ height
59
+ } = this.selector.getBoundingClientRect();
59
60
  return height;
60
61
  };
61
62
  this.getFilterOptions = searchValue => {
62
- const _this$props = this.props,
63
- options = _this$props.options,
64
- searchable = _this$props.searchable;
63
+ const {
64
+ options,
65
+ searchable
66
+ } = this.props;
65
67
  if (!searchable) return options || [];
66
68
  const validSearchVal = searchValue.trim().toLowerCase();
67
69
  if (!validSearchVal) return options || [];
68
70
  return options.filter(option => {
69
- const value = option.value,
70
- name = option.name;
71
+ const {
72
+ value,
73
+ name
74
+ } = option;
71
75
  if (typeof name === 'string') {
72
76
  return name.toLowerCase().indexOf(validSearchVal) > -1;
73
77
  }
@@ -94,18 +98,19 @@ class DTableCustomizeSelect extends _react.Component {
94
98
  document.removeEventListener('mousedown', this.handleDocumentMouseDown, true);
95
99
  }
96
100
  render() {
97
- let _this$props2 = this.props,
98
- className = _this$props2.className,
99
- value = _this$props2.value,
100
- options = _this$props2.options,
101
- placeholder = _this$props2.placeholder,
102
- searchable = _this$props2.searchable,
103
- searchPlaceholder = _this$props2.searchPlaceholder,
104
- noOptionsPlaceholder = _this$props2.noOptionsPlaceholder,
105
- isLocked = _this$props2.isLocked,
106
- isInModal = _this$props2.isInModal,
107
- addOptionAble = _this$props2.addOptionAble,
108
- component = _this$props2.component;
101
+ let {
102
+ className,
103
+ value,
104
+ options,
105
+ placeholder,
106
+ searchable,
107
+ searchPlaceholder,
108
+ noOptionsPlaceholder,
109
+ isLocked,
110
+ isInModal,
111
+ addOptionAble,
112
+ component
113
+ } = this.props;
109
114
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
110
115
  ref: node => this.selector = node,
111
116
  className: (0, _classnames.default)('seatable-customize-select custom-select', {
@@ -13,22 +13,24 @@ var _DTableToolTip = _interopRequireDefault(require("../DTableToolTip"));
13
13
  var _svgIcon = _interopRequireDefault(require("../DTableIcon/svg-icon"));
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  const DTableDropdownItem = _ref => {
16
- let className = _ref.className,
17
- divider = _ref.divider,
18
- id = _ref.id,
19
- toggle = _ref.toggle,
20
- disabled = _ref.disabled,
21
- tooltip = _ref.tooltip,
22
- itemProps = _ref.itemProps,
23
- showChecked = _ref.showChecked,
24
- checked = _ref.checked,
25
- leftSlotContent = _ref.leftSlotContent,
26
- rightSlotContent = _ref.rightSlotContent,
27
- icon = _ref.icon,
28
- content = _ref.content,
29
- onClick = _ref.onClick,
30
- style = _ref.style,
31
- tabIndex = _ref.tabIndex;
16
+ let {
17
+ className,
18
+ divider,
19
+ id,
20
+ toggle,
21
+ disabled,
22
+ tooltip,
23
+ itemProps,
24
+ showChecked,
25
+ checked,
26
+ leftSlotContent,
27
+ rightSlotContent,
28
+ icon,
29
+ content,
30
+ onClick,
31
+ style,
32
+ tabIndex
33
+ } = _ref;
32
34
  if (divider) {
33
35
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownItem, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, itemProps), {}, {
34
36
  divider: true,
@@ -10,14 +10,16 @@ var _reactstrap = require("reactstrap");
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  const DTableDropdownMenu = _ref => {
13
- let id = _ref.id,
14
- className = _ref.className,
15
- container = _ref.container,
16
- modifiers = _ref.modifiers,
17
- flip = _ref.flip,
18
- style = _ref.style,
19
- menuProps = _ref.menuProps,
20
- children = _ref.children;
13
+ let {
14
+ id,
15
+ className,
16
+ container,
17
+ modifiers,
18
+ flip,
19
+ style,
20
+ menuProps,
21
+ children
22
+ } = _ref;
21
23
  let customMenuProps = (0, _objectSpread2.default)({}, menuProps);
22
24
  customMenuProps.modifiers = [{
23
25
  name: 'preventOverflow',
@@ -10,10 +10,11 @@ require("./index.css");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  class DTableEmptyTip extends _react.default.Component {
12
12
  render() {
13
- const _this$props = this.props,
14
- text = _this$props.text,
15
- title = _this$props.title,
16
- type = _this$props.type;
13
+ const {
14
+ text,
15
+ title,
16
+ type
17
+ } = this.props;
17
18
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
18
19
  className: "empty-tip",
19
20
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -29,8 +29,10 @@ var _jsxRuntime = require("react/jsx-runtime");
29
29
  constructor(props) {
30
30
  super(props);
31
31
  this.updateFilters = _ref => {
32
- let filter_conjunction = _ref.filter_conjunction,
33
- filters = _ref.filters;
32
+ let {
33
+ filter_conjunction,
34
+ filters
35
+ } = _ref;
34
36
  const filterConjunction = filter_conjunction || this.state.filterConjunction;
35
37
  if (this.isNeedSubmit) {
36
38
  const isSubmitDisabled = false;
@@ -52,8 +54,12 @@ var _jsxRuntime = require("react/jsx-runtime");
52
54
  });
53
55
  };
54
56
  this.addFilter = () => {
55
- const columns = this.props.columns;
56
- const filters = this.state.filters;
57
+ const {
58
+ columns
59
+ } = this.props;
60
+ const {
61
+ filters
62
+ } = this.state;
57
63
  const newFilter = (0, _utils.getDefaultFilter)(columns);
58
64
  if (!newFilter) {
59
65
  return;
@@ -63,8 +69,12 @@ var _jsxRuntime = require("react/jsx-runtime");
63
69
  });
64
70
  };
65
71
  this.addFilterGroup = () => {
66
- const columns = this.props.columns;
67
- const filters = this.state.filters;
72
+ const {
73
+ columns
74
+ } = this.props;
75
+ const {
76
+ filters
77
+ } = this.state;
68
78
  const newFilterGroup = (0, _utils.getDefaultFilterGroup)(columns);
69
79
  if (!newFilterGroup) {
70
80
  return;
@@ -77,9 +87,10 @@ var _jsxRuntime = require("react/jsx-runtime");
77
87
  this.props.hidePopover();
78
88
  };
79
89
  this.onSubmitFilters = () => {
80
- const _this$state = this.state,
81
- filters = _this$state.filters,
82
- filterConjunction = _this$state.filterConjunction;
90
+ const {
91
+ filters,
92
+ filterConjunction
93
+ } = this.state;
83
94
  const update = {
84
95
  filters,
85
96
  filter_conjunction: filterConjunction
@@ -90,10 +101,12 @@ var _jsxRuntime = require("react/jsx-runtime");
90
101
  this.onPopoverInsideClick = e => {
91
102
  e.stopPropagation();
92
103
  };
93
- const _filterConjunction = props.filterConjunction,
94
- _filters = props.filters,
95
- _columns = props.columns,
96
- isNeedSubmit = props.isNeedSubmit;
104
+ const {
105
+ filterConjunction: _filterConjunction,
106
+ filters: _filters,
107
+ columns: _columns,
108
+ isNeedSubmit
109
+ } = props;
97
110
  this.state = {
98
111
  filters: (0, _dtableUtils.getValidFilters)(_filters, _columns),
99
112
  filterConjunction: _constants.SUPPORT_CONJUNCTIONS.includes(_filterConjunction) ? _filterConjunction : _dtableUtils.FILTER_CONJUNCTION_TYPE.AND,
@@ -102,19 +115,21 @@ var _jsxRuntime = require("react/jsx-runtime");
102
115
  this.isNeedSubmit = isNeedSubmit;
103
116
  }
104
117
  render() {
105
- const _this$props = this.props,
106
- target = _this$props.target,
107
- columns = _this$props.columns,
108
- placement = _this$props.placement,
109
- isSupportAdvanced = _this$props.isSupportAdvanced,
110
- departments = _this$props.departments,
111
- lang = _this$props.lang,
112
- readOnly = _this$props.readOnly,
113
- userDepartmentIdsMap = _this$props.userDepartmentIdsMap,
114
- firstDayOfWeek = _this$props.firstDayOfWeek;
115
- const _this$state2 = this.state,
116
- filters = _this$state2.filters,
117
- filterConjunction = _this$state2.filterConjunction;
118
+ const {
119
+ target,
120
+ columns,
121
+ placement,
122
+ isSupportAdvanced,
123
+ departments,
124
+ lang,
125
+ readOnly,
126
+ userDepartmentIdsMap,
127
+ firstDayOfWeek
128
+ } = this.props;
129
+ const {
130
+ filters,
131
+ filterConjunction
132
+ } = this.state;
118
133
  const canAddFilter = columns.length > 0;
119
134
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTablePopover.default, {
120
135
  target: target,
@@ -13,7 +13,9 @@ var _jsxRuntime = require("react/jsx-runtime");
13
13
  class FilterItemUtils {
14
14
  static generatorColumnOption(column) {
15
15
  if (!column) return null;
16
- const name = column.name;
16
+ const {
17
+ name
18
+ } = column;
17
19
  return {
18
20
  value: {
19
21
  column