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
@@ -18,9 +18,10 @@ class DtableSearchInput extends _react.Component {
18
18
  };
19
19
  this.onChange = e => {
20
20
  this.timer && clearTimeout(this.timer);
21
- const _this$props = this.props,
22
- onChange = _this$props.onChange,
23
- wait = _this$props.wait;
21
+ const {
22
+ onChange,
23
+ wait
24
+ } = this.props;
24
25
  let text = e.target.value;
25
26
  this.setState({
26
27
  searchValue: text || ''
@@ -36,7 +37,9 @@ class DtableSearchInput extends _react.Component {
36
37
  this.onChange(e);
37
38
  };
38
39
  this.clearSearch = () => {
39
- const clearValue = this.props.clearValue;
40
+ const {
41
+ clearValue
42
+ } = this.props;
40
43
  this.setState({
41
44
  searchValue: ''
42
45
  }, () => {
@@ -52,14 +55,18 @@ class DtableSearchInput extends _react.Component {
52
55
  }
53
56
  };
54
57
  this.renderClear = () => {
55
- const _this$props2 = this.props,
56
- isClearable = _this$props2.isClearable,
57
- clearClassName = _this$props2.clearClassName,
58
- _this$props2$componen = _this$props2.components,
59
- components = _this$props2$componen === void 0 ? {} : _this$props2$componen;
60
- const searchValue = this.state.searchValue;
58
+ const {
59
+ isClearable,
60
+ clearClassName,
61
+ components = {}
62
+ } = this.props;
63
+ const {
64
+ searchValue
65
+ } = this.state;
61
66
  if (!isClearable || !searchValue) return null;
62
- const ClearIndicator = components.ClearIndicator;
67
+ const {
68
+ ClearIndicator
69
+ } = components;
63
70
  if (/*#__PURE__*/_react.default.isValidElement(ClearIndicator)) {
64
71
  return /*#__PURE__*/_react.default.cloneElement(ClearIndicator, {
65
72
  clearValue: this.clearSearch
@@ -95,14 +102,17 @@ class DtableSearchInput extends _react.Component {
95
102
  this.inputRef = null;
96
103
  }
97
104
  render() {
98
- const _this$props3 = this.props,
99
- placeholder = _this$props3.placeholder,
100
- autoFocus = _this$props3.autoFocus,
101
- className = _this$props3.className,
102
- onKeyDown = _this$props3.onKeyDown,
103
- disabled = _this$props3.disabled,
104
- style = _this$props3.style;
105
- const searchValue = this.state.searchValue;
105
+ const {
106
+ placeholder,
107
+ autoFocus,
108
+ className,
109
+ onKeyDown,
110
+ disabled,
111
+ style
112
+ } = this.props;
113
+ const {
114
+ searchValue
115
+ } = this.state;
106
116
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
107
117
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
108
118
  ref: ref => this.inputRef = ref,
@@ -9,12 +9,11 @@ var _react = _interopRequireDefault(require("react"));
9
9
  require("./dtable-select-label.css");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  function DTableSelectLabel(_ref) {
12
- let _ref$classname = _ref.classname,
13
- classname = _ref$classname === void 0 ? '' : _ref$classname,
14
- _ref$name = _ref.name,
15
- name = _ref$name === void 0 ? '' : _ref$name,
16
- _ref$isSelect = _ref.isSelect,
17
- isSelect = _ref$isSelect === void 0 ? false : _ref$isSelect;
12
+ let {
13
+ classname = '',
14
+ name = '',
15
+ isSelect = false
16
+ } = _ref;
18
17
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
19
18
  className: "".concat(classname, " w-100 d-flex justify-content-between"),
20
19
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -12,27 +12,28 @@ var _utils = require("./utils");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  class DTableSelect extends _react.default.Component {
14
14
  render() {
15
- const _this$props = this.props,
16
- options = _this$props.options,
17
- onChange = _this$props.onChange,
18
- value = _this$props.value,
19
- isSearchable = _this$props.isSearchable,
20
- placeholder = _this$props.placeholder,
21
- isMulti = _this$props.isMulti,
22
- menuPosition = _this$props.menuPosition,
23
- isClearable = _this$props.isClearable,
24
- noOptionsMessage = _this$props.noOptionsMessage,
25
- classNamePrefix = _this$props.classNamePrefix,
26
- style = _this$props.style,
27
- innerRef = _this$props.innerRef,
28
- isDisabled = _this$props.isDisabled,
29
- form = _this$props.form,
30
- customFilterOption = _this$props.customFilterOption,
31
- autoFocus = _this$props.autoFocus,
32
- className = _this$props.className,
33
- closeMenuOnSelect = _this$props.closeMenuOnSelect,
34
- onMenuClose = _this$props.onMenuClose,
35
- userComponents = _this$props.components;
15
+ const {
16
+ options,
17
+ onChange,
18
+ value,
19
+ isSearchable,
20
+ placeholder,
21
+ isMulti,
22
+ menuPosition,
23
+ isClearable,
24
+ noOptionsMessage,
25
+ classNamePrefix,
26
+ style,
27
+ innerRef,
28
+ isDisabled,
29
+ form,
30
+ customFilterOption,
31
+ autoFocus,
32
+ className,
33
+ closeMenuOnSelect,
34
+ onMenuClose,
35
+ components: userComponents
36
+ } = this.props;
36
37
  const mergedComponents = (0, _objectSpread2.default)({
37
38
  Option: _utils.Option,
38
39
  DropdownIndicator: _utils.DropdownIndicator,
@@ -10,7 +10,9 @@ var _DTableIcon = _interopRequireDefault(require("../../DTableIcon"));
10
10
  require("./index.css");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  const SelectDropdownIndicator = _ref => {
13
- let isDisabled = _ref.isDisabled;
13
+ let {
14
+ isDisabled
15
+ } = _ref;
14
16
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
15
17
  className: "select-dropdown-indicator d-flex align-items-center",
16
18
  "aria-hidden": "true",
@@ -46,8 +46,10 @@ const HEADER_ICON_STYLE = {
46
46
  padding: 0
47
47
  };
48
48
  const controlCallback = (provided, state) => {
49
- const isDisabled = state.isDisabled,
50
- isFocused = state.isFocused;
49
+ const {
50
+ isDisabled,
51
+ isFocused
52
+ } = state;
51
53
  const headerIconStyle = {
52
54
  '.header-icon': HEADER_ICON_STYLE,
53
55
  '.header-icon .dtable-font': {
@@ -85,7 +87,9 @@ const MenuSelectStyle = exports.MenuSelectStyle = {
85
87
  padding: '8px'
86
88
  }),
87
89
  option: (provided, state) => {
88
- const isDisabled = state.isDisabled;
90
+ const {
91
+ isDisabled
92
+ } = state;
89
93
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
90
94
  color: 'var(--bs-body-color)',
91
95
  borderRadius: '4px',
@@ -134,7 +138,9 @@ const MenuSelectStyle = exports.MenuSelectStyle = {
134
138
  color: 'var(--bs-body-color)'
135
139
  }),
136
140
  placeholder: (provided, state) => {
137
- const isDisabled = state.isDisabled;
141
+ const {
142
+ isDisabled
143
+ } = state;
138
144
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
139
145
  color: 'var(--bs-bg-placeholder-color)',
140
146
  opacity: isDisabled ? 0.65 : 1,
@@ -147,7 +153,9 @@ const MenuSelectStyle = exports.MenuSelectStyle = {
147
153
  };
148
154
  },
149
155
  dropdownIndicator: (provided, state) => {
150
- const isDisabled = state.isDisabled;
156
+ const {
157
+ isDisabled
158
+ } = state;
151
159
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
152
160
  paddingRight: '12px',
153
161
  '.dtable-font': {
@@ -172,7 +180,9 @@ const DropdownIndicator = props => {
172
180
  };
173
181
  exports.DropdownIndicator = DropdownIndicator;
174
182
  const ClearIndicator = _ref => {
175
- let innerProps = _ref.innerProps,
183
+ let {
184
+ innerProps
185
+ } = _ref,
176
186
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
177
187
  const onMouseDown = e => {
178
188
  e.nativeEvent.stopImmediatePropagation();
@@ -202,8 +212,10 @@ const MenuList = props => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
202
212
  });
203
213
  exports.MenuList = MenuList;
204
214
  const Option = props => {
205
- const isSelected = props.isSelected,
206
- label = props.label;
215
+ const {
216
+ isSelected,
217
+ label
218
+ } = props;
207
219
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
208
220
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
209
221
  style: {
@@ -10,14 +10,16 @@ var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _DTableDropdownMenu = _interopRequireDefault(require("../DTableDropdownMenu"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  const DTableSubDropdownMenu = _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
  if (container) {
23
25
  customMenuProps.container = container;
@@ -12,18 +12,18 @@ var _classnames = _interopRequireDefault(require("classnames"));
12
12
  var _lang = require("../lang");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
14
  const DTableSubDropdownToggle = _ref => {
15
- let className = _ref.className,
16
- id = _ref.id,
17
- text = _ref.text,
18
- icon = _ref.icon,
19
- disabled = _ref.disabled,
20
- _ref$hideArrow = _ref.hideArrow,
21
- hideArrow = _ref$hideArrow === void 0 ? false : _ref$hideArrow,
22
- title = _ref.title,
23
- ariaLabel = _ref.ariaLabel,
24
- _ref$ariaExpanded = _ref.ariaExpanded,
25
- ariaExpanded = _ref$ariaExpanded === void 0 ? false : _ref$ariaExpanded,
26
- toggleProps = _ref.toggleProps;
15
+ let {
16
+ className,
17
+ id,
18
+ text,
19
+ icon,
20
+ disabled,
21
+ hideArrow = false,
22
+ title,
23
+ ariaLabel,
24
+ ariaExpanded = false,
25
+ toggleProps
26
+ } = _ref;
27
27
  const renderedIcon = () => {
28
28
  if (!icon || ! /*#__PURE__*/_react.default.isValidElement(icon)) return null;
29
29
  return /*#__PURE__*/_react.default.cloneElement(icon, {
@@ -11,18 +11,17 @@ var _dtableUtils = require("dtable-utils");
11
11
  require("./index.css");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  function DTableSwitch(_ref) {
14
- let onChange = _ref.onChange,
15
- _ref$checked = _ref.checked,
16
- checked = _ref$checked === void 0 ? false : _ref$checked,
17
- placeholder = _ref.placeholder,
18
- disabled = _ref.disabled,
19
- _ref$size = _ref.size,
20
- size = _ref$size === void 0 ? 'sm' : _ref$size,
21
- _ref$switchPosition = _ref.switchPosition,
22
- switchPosition = _ref$switchPosition === void 0 ? 'right' : _ref$switchPosition,
23
- switchClassName = _ref.switchClassName,
24
- innerClassName = _ref.innerClassName,
25
- inputId = _ref.inputId;
14
+ let {
15
+ onChange,
16
+ checked = false,
17
+ placeholder,
18
+ disabled,
19
+ size = 'sm',
20
+ switchPosition = 'right',
21
+ switchClassName,
22
+ innerClassName,
23
+ inputId
24
+ } = _ref;
26
25
  const switchNode = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
27
26
  className: "custom-switch-indicator"
28
27
  });
@@ -11,13 +11,14 @@ var _reactstrap = require("reactstrap");
11
11
  require("./index.css");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  const DTableToolTip = _ref => {
14
- let target = _ref.target,
15
- _ref$placement = _ref.placement,
16
- placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
17
- className = _ref.className,
18
- children = _ref.children,
19
- shortcut = _ref.shortcut,
20
- modifiers = _ref.modifiers;
14
+ let {
15
+ target,
16
+ placement = 'bottom',
17
+ className,
18
+ children,
19
+ shortcut,
20
+ modifiers
21
+ } = _ref;
21
22
  const hasShortcut = Boolean(shortcut);
22
23
  const renderContent = () => {
23
24
  if (hasShortcut) {
@@ -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 _reactResponsive = _interopRequireDefault(require("react-responsive"));
13
12
  var _dtableUtils = require("dtable-utils");
@@ -19,25 +18,21 @@ require("dayjs/locale/en-gb");
19
18
  require("./index.css");
20
19
  var _jsxRuntime = require("react/jsx-runtime");
21
20
  const DateEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
22
- let isMobile = _ref.isMobile,
23
- lang = _ref.lang,
24
- isReadOnly = _ref.isReadOnly,
25
- column = _ref.column,
26
- className = _ref.className,
27
- isInModal = _ref.isInModal,
28
- firstDayOfWeek = _ref.firstDayOfWeek,
29
- size = _ref.size,
30
- oldValue = _ref.value,
31
- hideCalendar = _ref.hideCalendar,
32
- onCommit = _ref.onCommit;
33
- const _useState = (0, _react.useState)(false),
34
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
35
- isDateInit = _useState2[0],
36
- setDateInit = _useState2[1];
37
- const _useState3 = (0, _react.useState)(oldValue || ''),
38
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
39
- value = _useState4[0],
40
- setValue = _useState4[1];
21
+ let {
22
+ isMobile,
23
+ lang,
24
+ isReadOnly,
25
+ column,
26
+ className,
27
+ isInModal,
28
+ firstDayOfWeek,
29
+ size,
30
+ value: oldValue,
31
+ hideCalendar,
32
+ onCommit
33
+ } = _ref;
34
+ const [isDateInit, setDateInit] = (0, _react.useState)(false);
35
+ const [value, setValue] = (0, _react.useState)(oldValue || '');
41
36
  const format = (0, _react.useMemo)(() => {
42
37
  var _column$data;
43
38
  return (column === null || column === void 0 ? void 0 : column.data) && (column === null || column === void 0 ? void 0 : (_column$data = column.data) === null || _column$data === void 0 ? void 0 : _column$data.format) || _dtableUtils.DEFAULT_DATE_FORMAT;
@@ -20,8 +20,10 @@ require("@seafile/seafile-calendar/assets/index.css");
20
20
  require("./index.css");
21
21
  var _jsxRuntime = require("react/jsx-runtime");
22
22
  let now = (0, _dayjs.default)();
23
- const Header = _MobileFullScreenPage.default.Header,
24
- Body = _MobileFullScreenPage.default.Body;
23
+ const {
24
+ Header,
25
+ Body
26
+ } = _MobileFullScreenPage.default;
25
27
  class MBDateEditor extends _react.default.PureComponent {
26
28
  constructor(props) {
27
29
  super(props);
@@ -67,11 +69,14 @@ class MBDateEditor extends _react.default.PureComponent {
67
69
  });
68
70
  };
69
71
  this.renderCalender = () => {
70
- const _this$props = this.props,
71
- lang = _this$props.lang,
72
- className = _this$props.className,
73
- firstDayOfWeek = _this$props.firstDayOfWeek;
74
- const time = this.state.time;
72
+ const {
73
+ lang,
74
+ className,
75
+ firstDayOfWeek
76
+ } = this.props;
77
+ const {
78
+ time
79
+ } = this.state;
75
80
  const calendar = /*#__PURE__*/(0, _jsxRuntime.jsx)(_seafileCalendar.default, {
76
81
  className: (0, _classnames.default)('dtable-rc-calendar', className),
77
82
  locale: (0, _editorUtils.initDateEditorLanguage)(lang),
@@ -97,7 +102,9 @@ class MBDateEditor extends _react.default.PureComponent {
97
102
  width: '100%'
98
103
  },
99
104
  children: _ref => {
100
- let time = _ref.time;
105
+ let {
106
+ time
107
+ } = _ref;
101
108
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
102
109
  tabIndex: "0",
103
110
  onFocus: this.onReadOnlyFocus,
@@ -117,8 +124,10 @@ class MBDateEditor extends _react.default.PureComponent {
117
124
  }
118
125
  });
119
126
  };
120
- const dateFormat = props.dateFormat,
121
- showHourAndMinute = props.showHourAndMinute;
127
+ const {
128
+ dateFormat,
129
+ showHourAndMinute
130
+ } = props;
122
131
  this.state = {
123
132
  time: null
124
133
  };
@@ -128,9 +137,10 @@ class MBDateEditor extends _react.default.PureComponent {
128
137
  this.format = showHourAndMinute ? 'YYYY-MM-DD HH:mm' : 'YYYY-MM-DD';
129
138
  }
130
139
  componentDidMount() {
131
- let _this$props2 = this.props,
132
- value = _this$props2.value,
133
- lang = _this$props2.lang;
140
+ let {
141
+ value,
142
+ lang
143
+ } = this.props;
134
144
  const iszhcn = lang === 'zh-cn';
135
145
  if (iszhcn) {
136
146
  now = now.locale('zh-cn');
@@ -146,11 +156,14 @@ class MBDateEditor extends _react.default.PureComponent {
146
156
  });
147
157
  }
148
158
  render() {
149
- const _this$props3 = this.props,
150
- lang = _this$props3.lang,
151
- column = _this$props3.column,
152
- showHourAndMinute = _this$props3.showHourAndMinute;
153
- const time = this.state.time;
159
+ const {
160
+ lang,
161
+ column,
162
+ showHourAndMinute
163
+ } = this.props;
164
+ const {
165
+ time
166
+ } = this.state;
154
167
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MobileFullScreenPage.default, {
155
168
  className: "dtable-ui-mobile-date-editor",
156
169
  onClose: this.props.onClose,
@@ -22,7 +22,9 @@ class PCDateEditor extends _react.default.Component {
22
22
  // event trigger sequence: onOpenChange --> onChange
23
23
  this.onChange = value => {
24
24
  if (!value) return;
25
- let dateFormat = this.props.dateFormat;
25
+ let {
26
+ dateFormat
27
+ } = this.props;
26
28
  this.setState({
27
29
  value: value,
28
30
  open: true // if value changed, don't close datePicker
@@ -33,7 +35,9 @@ class PCDateEditor extends _react.default.Component {
33
35
  this.props.onCommit(this.getValue());
34
36
  };
35
37
  this.getValue = () => {
36
- let dateFormat = this.props.dateFormat;
38
+ let {
39
+ dateFormat
40
+ } = this.props;
37
41
  let value = this.state.value ? this.state.value.format(dateFormat) : null;
38
42
  return value;
39
43
  };
@@ -45,7 +49,9 @@ class PCDateEditor extends _react.default.Component {
45
49
  return this.datePickerRef.querySelector('input:not([type=hidden])');
46
50
  };
47
51
  this.onOpenChange = open => {
48
- const isInModal = this.props.isInModal;
52
+ const {
53
+ isInModal
54
+ } = this.props;
49
55
  if (open) {
50
56
  this.toggleCalendar(open);
51
57
  }
@@ -74,7 +80,9 @@ class PCDateEditor extends _react.default.Component {
74
80
  event.stopPropagation();
75
81
  };
76
82
  this.getCalendarContainer = () => {
77
- const isInModal = this.props.isInModal;
83
+ const {
84
+ isInModal
85
+ } = this.props;
78
86
  return isInModal ? this.calendarContainerRef.current : document.body;
79
87
  };
80
88
  this.handleKeyDown = e => {
@@ -102,7 +110,9 @@ class PCDateEditor extends _react.default.Component {
102
110
  this.toggleCalendar(true);
103
111
  };
104
112
  this.onClickRightPanelTime = () => {
105
- const isInModal = this.props.isInModal;
113
+ const {
114
+ isInModal
115
+ } = this.props;
106
116
  let onClickRightPanelTime = isInModal ? this.props.onClose : this.closeEditor;
107
117
  // we should change value and save it(async function), then close Editor.
108
118
  setTimeout(() => {
@@ -118,17 +128,20 @@ class PCDateEditor extends _react.default.Component {
118
128
  }
119
129
  };
120
130
  this.getDefaultTime = () => {
121
- const value = this.props.value;
131
+ const {
132
+ value
133
+ } = this.props;
122
134
  if (value) return (0, _dayjs.default)(value).format('HH:mm');
123
135
  return '';
124
136
  };
125
137
  this.getCalender = () => {
126
- let _this$props = this.props,
127
- dateFormat = _this$props.dateFormat,
128
- showHourAndMinute = _this$props.showHourAndMinute,
129
- lang = _this$props.lang,
130
- className = _this$props.className,
131
- firstDayOfWeek = _this$props.firstDayOfWeek;
138
+ let {
139
+ dateFormat,
140
+ showHourAndMinute,
141
+ lang,
142
+ className,
143
+ firstDayOfWeek
144
+ } = this.props;
132
145
  let defaultValue = (0, _dayjs.default)().clone();
133
146
  const defaultTime = this.getDefaultTime();
134
147
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_seafileCalendar.default, {
@@ -147,9 +160,10 @@ class PCDateEditor extends _react.default.Component {
147
160
  firstDayOfWeek: firstDayOfWeek
148
161
  });
149
162
  };
150
- const _this$props2 = this.props,
151
- _dateFormat = _this$props2.dateFormat,
152
- _value = _this$props2.value;
163
+ const {
164
+ dateFormat: _dateFormat,
165
+ value: _value
166
+ } = this.props;
153
167
  this.state = {
154
168
  value: _value ? (0, _dayjs.default)(_value) : null,
155
169
  open: false
@@ -159,10 +173,11 @@ class PCDateEditor extends _react.default.Component {
159
173
  this.showHourAndMinute = !!(_dateFormat.indexOf('HH:mm') > -1);
160
174
  }
161
175
  componentDidMount() {
162
- const _this$props3 = this.props,
163
- value = _this$props3.value,
164
- lang = _this$props3.lang,
165
- isInModal = _this$props3.isInModal;
176
+ const {
177
+ value,
178
+ lang,
179
+ isInModal
180
+ } = this.props;
166
181
  const iszhcn = lang === 'zh-cn';
167
182
  if (iszhcn) {
168
183
  now = now.locale('zh-cn');
@@ -199,12 +214,14 @@ class PCDateEditor extends _react.default.Component {
199
214
  }
200
215
  }
201
216
  render() {
202
- let _this$props4 = this.props,
203
- dateFormat = _this$props4.dateFormat,
204
- isInModal = _this$props4.isInModal;
205
- let _this$state = this.state,
206
- open = _this$state.open,
207
- value = _this$state.value;
217
+ let {
218
+ dateFormat,
219
+ isInModal
220
+ } = this.props;
221
+ let {
222
+ open,
223
+ value
224
+ } = this.state;
208
225
  const calendar = this.getCalender();
209
226
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
210
227
  className: "date-picker-container ".concat(isInModal ? 'modal-date-picker-container' : ''),
@@ -223,7 +240,9 @@ class PCDateEditor extends _react.default.Component {
223
240
  onChange: this.onChange,
224
241
  onOpenChange: this.onOpenChange,
225
242
  children: _ref => {
226
- let value = _ref.value;
243
+ let {
244
+ value
245
+ } = _ref;
227
246
  value = value && value.format(dateFormat);
228
247
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
229
248
  className: "dtable-ui-date-editor-container",
@@ -12,10 +12,11 @@ require("./index.css");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  class DateFormatter extends _react.default.Component {
14
14
  render() {
15
- let _this$props = this.props,
16
- date = _this$props.value,
17
- format = _this$props.format,
18
- containerClassName = _this$props.containerClassName;
15
+ let {
16
+ value: date,
17
+ format,
18
+ containerClassName
19
+ } = this.props;
19
20
  let classname = (0, _classnames.default)('dtable-ui cell-formatter-container date-formatter', containerClassName);
20
21
  if (date !== '') {
21
22
  date = (0, _dtableUtils.getDateDisplayString)(date, format);
@@ -46,16 +46,22 @@ class DatePicker extends React.Component {
46
46
  }
47
47
  render() {
48
48
  // tslint:disable-next-line:no-this-assignment
49
- const props = this.props,
50
- context = this.context;
51
- const children = props.children,
52
- value = props.value,
53
- popupPrefixCls = props.popupPrefixCls;
49
+ const {
50
+ props,
51
+ context
52
+ } = this;
53
+ const {
54
+ children,
55
+ value,
56
+ popupPrefixCls
57
+ } = props;
54
58
  const locale = (0, _getLocale.getComponentLocale)(props, context, 'DatePicker', () => require('./locale/zh_CN'));
55
- const okText = locale.okText,
56
- dismissText = locale.dismissText,
57
- extra = locale.extra,
58
- DatePickerLocale = locale.DatePickerLocale;
59
+ const {
60
+ okText,
61
+ dismissText,
62
+ extra,
63
+ DatePickerLocale
64
+ } = locale;
59
65
  /**
60
66
  * 注意:
61
67
  * 受控 表示 通过设置 value 属性、组件的最终状态跟 value 设置值一致。