dtable-ui-component 6.0.126 → 7.0.0-xia.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/lib/ActionSheet/index.js +16 -14
  2. package/lib/ActivityIndicator/index.js +8 -7
  3. package/lib/AsyncUserSelect/index.js +19 -40
  4. package/lib/AsyncUserSelect/user-item.js +6 -5
  5. package/lib/AutoNumberFormatter/index.js +4 -3
  6. package/lib/Badge/index.js +11 -9
  7. package/lib/ButtonFormatter/index.js +8 -6
  8. package/lib/CTimeFormatter/index.js +4 -3
  9. package/lib/CheckboxEditor/index.js +3 -1
  10. package/lib/CheckboxEditor/mb-editor.js +20 -9
  11. package/lib/CheckboxEditor/pc-editor.js +24 -12
  12. package/lib/CheckboxFormatter/index.js +5 -4
  13. package/lib/CollaboratorEditor/index.js +4 -2
  14. package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
  15. package/lib/CollaboratorEditor/pc-editor/index.js +34 -25
  16. package/lib/CollaboratorFormatter/index.js +10 -8
  17. package/lib/CollaboratorItem/index.js +5 -4
  18. package/lib/CollapsibleSettingLayout/index.js +7 -9
  19. package/lib/Comment/body/comment.js +18 -10
  20. package/lib/Comment/body/index.js +4 -2
  21. package/lib/Comment/footer/btns/index.js +7 -4
  22. package/lib/Comment/footer/index.js +20 -9
  23. package/lib/Comment/footer/input/index.js +50 -29
  24. package/lib/Comment/footer/input/participant/index.js +5 -4
  25. package/lib/Comment/footer/participants/index.js +5 -4
  26. package/lib/Comment/footer/participants/participant/index.js +3 -1
  27. package/lib/Comment/footer/participants/participant-select/index.js +24 -8
  28. package/lib/Comment/index.js +57 -39
  29. package/lib/Comment/utils/utilities.js +21 -15
  30. package/lib/CreatorFormatter/index.js +8 -6
  31. package/lib/DTableColorPicker/ColorPickerPortal/index.js +18 -22
  32. package/lib/DTableColorPicker/index.js +40 -55
  33. package/lib/DTableColorPicker/utils.js +6 -4
  34. package/lib/DTableColumnIcon/index.js +7 -6
  35. package/lib/DTableCommonAddTool/index.js +8 -6
  36. package/lib/DTableCustomFooter/index.js +3 -1
  37. package/lib/DTableCustomizeCollaboratorSelect/index.js +20 -17
  38. package/lib/DTableCustomizeSelect/index.js +24 -19
  39. package/lib/DTableDropdownItem/index.js +18 -16
  40. package/lib/DTableDropdownMenu/index.js +10 -8
  41. package/lib/DTableEmptyTip/index.js +5 -4
  42. package/lib/DTableFiltersPopover/index.js +50 -34
  43. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
  44. package/lib/DTableFiltersPopover/utils/index.js +113 -63
  45. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
  46. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
  47. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
  48. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
  49. package/lib/DTableFiltersPopover/widgets/filter-group.js +56 -35
  50. package/lib/DTableFiltersPopover/widgets/filter-item.js +171 -108
  51. package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
  52. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +161 -136
  53. package/lib/DTableFiltersPopover/widgets/rate-item.js +20 -15
  54. package/lib/DTableGroupSelect/index.js +15 -11
  55. package/lib/DTableGroupSelect/select-option-group.js +32 -23
  56. package/lib/DTableIcon/index.js +7 -6
  57. package/lib/DTableIcon/svg-icon.js +7 -5
  58. package/lib/DTableModalHeader/index.css +3 -20
  59. package/lib/DTableModalHeader/index.js +3 -1
  60. package/lib/DTablePopover/index.js +15 -11
  61. package/lib/DTableRadio/index.js +9 -10
  62. package/lib/DTableRadioGroup/index.js +17 -8
  63. package/lib/DTableSearchInput/index.js +29 -19
  64. package/lib/DTableSelect/dtable-select-label.js +5 -6
  65. package/lib/DTableSelect/index.js +22 -21
  66. package/lib/DTableSelect/utils.js +15 -7
  67. package/lib/DTableSubDropdownMenu/index.js +10 -8
  68. package/lib/DTableSubDropdownToggle/index.js +12 -12
  69. package/lib/DTableSwitch/index.js +11 -12
  70. package/lib/DTableToolTip/index.js +8 -7
  71. package/lib/DateEditor/index.js +15 -20
  72. package/lib/DateEditor/mb-editor/index.js +31 -18
  73. package/lib/DateEditor/pc-editor.js +45 -26
  74. package/lib/DateFormatter/index.js +5 -4
  75. package/lib/DatePicker/index.js +15 -9
  76. package/lib/DatePicker/utils.js +3 -1
  77. package/lib/DeleteTip/index.js +6 -5
  78. package/lib/DepartmentMultipleSelectEditor/index.js +23 -25
  79. package/lib/DepartmentSelectFilter/index.js +8 -6
  80. package/lib/DepartmentSingleSelectEditor/index.js +3 -1
  81. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +47 -48
  82. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +58 -36
  83. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
  84. package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
  85. package/lib/DigitalSignEditor/index.js +3 -1
  86. package/lib/DigitalSignEditor/mb-editor/index.js +20 -12
  87. package/lib/DigitalSignEditor/pc-editor/index.js +24 -17
  88. package/lib/DigitalSignEditor/service.js +4 -2
  89. package/lib/DigitalSignEditor/signature-board/index.js +8 -5
  90. package/lib/DigitalSignEditor/utils.js +4 -2
  91. package/lib/DigitalSignFormatter/index.js +15 -12
  92. package/lib/DigitalSignFormatter/utils.js +5 -4
  93. package/lib/DurationEditor/index.js +31 -21
  94. package/lib/DurationFormatter/index.js +5 -4
  95. package/lib/EditEditorButton/index.js +3 -1
  96. package/lib/EmailFormatter/index.js +4 -3
  97. package/lib/FieldDisplaySetting/field-item.js +12 -12
  98. package/lib/FieldDisplaySetting/index.js +10 -12
  99. package/lib/FileEditor/files-previewer/index.js +3 -1
  100. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +18 -10
  101. package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
  102. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
  103. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
  104. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +21 -14
  105. package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
  106. package/lib/FileEditor/index.js +3 -1
  107. package/lib/FileEditor/mb-editor/index.js +20 -28
  108. package/lib/FileEditor/pc-editor/addition-previewer/index.js +3 -1
  109. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +25 -11
  110. package/lib/FileEditor/pc-editor/index.js +27 -19
  111. package/lib/FileFormatter/index.js +19 -26
  112. package/lib/FileItemFormatter/index.js +9 -6
  113. package/lib/FileUploader/index.js +45 -28
  114. package/lib/FormulaFormatter/index.js +29 -15
  115. package/lib/GeolocationEditor/index.js +12 -11
  116. package/lib/GeolocationEditor/map-editor-utils.js +15 -17
  117. package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
  118. package/lib/GeolocationEditor/mb-editor/index.js +6 -4
  119. package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
  120. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +68 -41
  121. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
  122. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
  123. package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
  124. package/lib/GeolocationEditor/pc-editor/country-editor.js +23 -10
  125. package/lib/GeolocationEditor/pc-editor/index.js +20 -12
  126. package/lib/GeolocationEditor/pc-editor/location-editor.js +31 -26
  127. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +54 -34
  128. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +60 -36
  129. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +62 -35
  130. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +65 -36
  131. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +25 -19
  132. package/lib/GeolocationEditor/pc-editor/province-editor.js +13 -6
  133. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
  134. package/lib/GeolocationEditor/pc-editor/selector-list.js +7 -6
  135. package/lib/GeolocationFormatter/index.js +5 -4
  136. package/lib/HtmlLongTextFormatter/index.js +12 -4
  137. package/lib/Icon/index.js +5 -3
  138. package/lib/IconButton/index.js +6 -4
  139. package/lib/ImageEditor/images-previewer/image-preview/index.js +21 -12
  140. package/lib/ImageEditor/images-previewer/index.js +9 -3
  141. package/lib/ImageEditor/index.js +3 -1
  142. package/lib/ImageEditor/mb-editor/index.js +20 -28
  143. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
  144. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +3 -1
  145. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +21 -7
  146. package/lib/ImageEditor/pc-editor/images-previewer/index.js +9 -3
  147. package/lib/ImageEditor/pc-editor/index.js +16 -11
  148. package/lib/ImageFormatter/images-lazy-load.js +11 -19
  149. package/lib/ImageFormatter/index.js +13 -11
  150. package/lib/ImagePreviewerLightbox/index.js +13 -15
  151. package/lib/ImageThumbnail/index.js +13 -10
  152. package/lib/InputItem/custom-input.js +46 -26
  153. package/lib/InputItem/custom-keyboard.js +18 -15
  154. package/lib/InputItem/index.js +50 -34
  155. package/lib/InputItem/input.js +4 -2
  156. package/lib/LastModifierFormatter/index.js +8 -6
  157. package/lib/LinkEditor/index.js +53 -33
  158. package/lib/LinkEditor/link-editor-option.js +4 -3
  159. package/lib/LinkEditor/mb-popover/index.js +22 -9
  160. package/lib/LinkEditor/pc-popover/index.js +10 -5
  161. package/lib/LinkFormatter/index.js +37 -21
  162. package/lib/List/index.js +8 -6
  163. package/lib/List/list-item.js +28 -22
  164. package/lib/LongTextFormatter/index.js +5 -4
  165. package/lib/MBEditorHeader/index.js +8 -7
  166. package/lib/MTimeFormatter/index.js +4 -3
  167. package/lib/MobileFullScreenPage/body/index.js +5 -3
  168. package/lib/MobileFullScreenPage/header/index.js +6 -4
  169. package/lib/MobileFullScreenPage/index.js +11 -13
  170. package/lib/MobileModal/index.js +3 -1
  171. package/lib/MobileOperationSheet/index.js +8 -7
  172. package/lib/MobileSelector/empty/index.js +3 -1
  173. package/lib/MobileSelector/index.js +7 -5
  174. package/lib/MobileSelector/option/index.js +5 -3
  175. package/lib/MobileSelector/options/index.js +3 -1
  176. package/lib/MobileSelector/search/index.js +5 -3
  177. package/lib/MobileUpload/index.js +5 -4
  178. package/lib/Modal/modal.js +15 -14
  179. package/lib/Modal/prompt.js +4 -4
  180. package/lib/MultipleSelectEditor/index.js +3 -1
  181. package/lib/MultipleSelectFormatter/index.js +8 -6
  182. package/lib/NotificationPopover/index.js +5 -4
  183. package/lib/NumberEditor/index.js +21 -12
  184. package/lib/NumberFormatter/index.js +5 -4
  185. package/lib/PhoneNumberLink/index.js +4 -2
  186. package/lib/Picker/AbstractPicker.js +27 -23
  187. package/lib/Popover/index.js +4 -3
  188. package/lib/Popover/item.js +9 -7
  189. package/lib/Progress/index.js +8 -9
  190. package/lib/Radio/Radio.js +8 -4
  191. package/lib/Radio/RadioItem.js +12 -8
  192. package/lib/RateFormatter/index.js +13 -13
  193. package/lib/RoleStatusEditor/index.js +17 -18
  194. package/lib/RowExpandDialog/body/index.js +49 -32
  195. package/lib/RowExpandDialog/column-content/index.js +9 -5
  196. package/lib/RowExpandDialog/header/index.js +8 -6
  197. package/lib/RowExpandDialog/index.js +34 -49
  198. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
  199. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
  200. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
  201. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
  202. package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
  203. package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
  204. package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
  205. package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
  206. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +34 -20
  207. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +35 -21
  208. package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
  209. package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
  210. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +19 -9
  211. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +24 -13
  212. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
  213. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
  214. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
  215. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
  216. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +25 -15
  217. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +23 -13
  218. package/lib/RowExpandEditor/index.js +8 -4
  219. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
  220. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
  221. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
  222. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +19 -11
  223. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +33 -22
  224. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
  225. package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
  226. package/lib/RowExpandEditor/rate-editor/mb-editor.js +25 -12
  227. package/lib/RowExpandEditor/rate-editor/pc-editor.js +36 -20
  228. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +28 -17
  229. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +34 -22
  230. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
  231. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
  232. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +13 -5
  233. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +18 -9
  234. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
  235. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
  236. package/lib/RowExpandFormatter/email-formatter/index.js +7 -4
  237. package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
  238. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +12 -10
  239. package/lib/RowExpandFormatter/formula-formatter/index.js +34 -19
  240. package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
  241. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +8 -7
  242. package/lib/RowExpandFormatter/index.js +41 -27
  243. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +14 -8
  244. package/lib/RowExpandFormatter/link-formatter/index.js +19 -11
  245. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
  246. package/lib/RowExpandFormatter/rate-formatter/index.js +12 -11
  247. package/lib/RowExpandFormatter/text/index.js +5 -4
  248. package/lib/RowExpandFormatter/url-formatter/index.js +7 -4
  249. package/lib/RowExpandView/body/index.js +35 -22
  250. package/lib/RowExpandView/column-content/index.js +7 -3
  251. package/lib/RowExpandView/index.js +30 -42
  252. package/lib/SelectItem/index.js +8 -6
  253. package/lib/SelectOptionGroup/index.js +40 -30
  254. package/lib/SelectedDepartments/index.js +9 -7
  255. package/lib/SimpleLongTextFormatter/index.js +16 -10
  256. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
  257. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
  258. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
  259. package/lib/SingleSelectEditor/index.js +3 -1
  260. package/lib/SingleSelectFormatter/index.js +9 -8
  261. package/lib/TabBar/Tab.js +16 -14
  262. package/lib/TabBar/index.js +21 -18
  263. package/lib/Tabs/index.js +3 -1
  264. package/lib/TextEditor/index.js +23 -14
  265. package/lib/TextFormatter/index.js +4 -3
  266. package/lib/TextareaItem/index.js +26 -19
  267. package/lib/Toast/index.js +4 -3
  268. package/lib/UrlFormatter/index.js +4 -3
  269. package/lib/common/editor-base.js +12 -7
  270. package/lib/hooks/common-hooks.js +4 -2
  271. package/lib/select-editor/index.js +3 -1
  272. package/lib/select-editor/mb-editor/index.js +28 -17
  273. package/lib/select-editor/pc-editor/index.js +42 -27
  274. package/lib/toaster/alert.js +7 -6
  275. package/lib/toaster/toast.js +3 -2
  276. package/lib/toaster/toastManager.js +4 -2
  277. package/lib/utils/cell.js +11 -8
  278. package/lib/utils/column-utils.js +14 -8
  279. package/lib/utils/departments.js +3 -1
  280. package/lib/utils/url.js +31 -24
  281. package/lib/utils/utils.js +6 -2
  282. package/package.json +1 -1
@@ -1,24 +1,22 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
10
9
  var _react = _interopRequireWildcard(require("react"));
11
10
  var _classnames = _interopRequireDefault(require("classnames"));
12
11
  require("./index.css");
13
12
  var _jsxRuntime = require("react/jsx-runtime");
14
13
  const CollapsibleSettingLayout = props => {
15
- const className = props.className,
16
- title = props.title,
17
- children = props.children;
18
- const _useState = (0, _react.useState)(true),
19
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
20
- isShowSettings = _useState2[0],
21
- setIsShowSettings = _useState2[1];
14
+ const {
15
+ className,
16
+ title,
17
+ children
18
+ } = props;
19
+ const [isShowSettings, setIsShowSettings] = (0, _react.useState)(true);
22
20
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
23
21
  className: (0, _classnames.default)('collapsible-setting-layout', className),
24
22
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -28,9 +28,10 @@ class Comment extends _react.PureComponent {
28
28
  const mdString = mdFile.replaceAll('&', '&');
29
29
  _seafileEditor.processor.process(mdString).then(result => {
30
30
  let commentContent = String(result);
31
- let _this$props = this.props,
32
- isScrollBottom = _this$props.isScrollBottom,
33
- onScrollBottom = _this$props.onScrollBottom;
31
+ let {
32
+ isScrollBottom,
33
+ onScrollBottom
34
+ } = this.props;
34
35
  this.setState({
35
36
  commentContent: commentContent
36
37
  });
@@ -75,11 +76,15 @@ class Comment extends _react.PureComponent {
75
76
  });
76
77
  };
77
78
  this.isCommentUserExist = commentItem => {
78
- const collaborators = this.props.collaborators;
79
+ const {
80
+ collaborators
81
+ } = this.props;
79
82
  return !!collaborators.find(collaborator => collaborator.email === commentItem.author);
80
83
  };
81
84
  this.renderInfo = comment => {
82
- const collaborators = this.props.collaborators;
85
+ const {
86
+ collaborators
87
+ } = this.props;
83
88
  let authorInfo = Array.isArray(collaborators) && collaborators.find(collaborator => comment.author === collaborator.email);
84
89
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
85
90
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -125,11 +130,14 @@ class Comment extends _react.PureComponent {
125
130
  }
126
131
  }
127
132
  render() {
128
- const _this$props2 = this.props,
129
- comment = _this$props2.comment,
130
- onResolve = _this$props2.onResolve,
131
- onDelete = _this$props2.onDelete;
132
- const username = window.dtable.username;
133
+ const {
134
+ comment,
135
+ onResolve,
136
+ onDelete
137
+ } = this.props;
138
+ const {
139
+ username
140
+ } = window.dtable;
133
141
  const moreOperationsText = (0, _lang.getLocale)('More_operations');
134
142
  if (!this.isCommentUserExist(comment)) return null;
135
143
  const isShowDropdownMenu = comment.author === username || !comment.resolved;
@@ -14,8 +14,10 @@ require("./index.css");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  const _excluded = ["comments", "isFirstLoading"];
16
16
  const Body = _ref => {
17
- let comments = _ref.comments,
18
- isFirstLoading = _ref.isFirstLoading,
17
+ let {
18
+ comments,
19
+ isFirstLoading
20
+ } = _ref,
19
21
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
20
22
  if (comments.length === 0) {
21
23
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -40,7 +40,9 @@ class Btns extends _react.default.Component {
40
40
  this.props.onInsertElement(uploadFileMessage.url, 'image');
41
41
  };
42
42
  this.getCollaboratorContent = () => {
43
- const collaborators = this.props.collaborators;
43
+ const {
44
+ collaborators
45
+ } = this.props;
44
46
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
45
47
  className: "comment-popover-list",
46
48
  children: collaborators.map(participant => {
@@ -73,9 +75,10 @@ class Btns extends _react.default.Component {
73
75
  return nextProps.isAdding !== this.props.isAdding || nextState.isShowPopover !== this.state.isShowPopover;
74
76
  }
75
77
  render() {
76
- const _this$props = this.props,
77
- isAdding = _this$props.isAdding,
78
- canUpdateParticipants = _this$props.canUpdateParticipants;
78
+ const {
79
+ isAdding,
80
+ canUpdateParticipants
81
+ } = this.props;
79
82
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
80
83
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
81
84
  className: "dtable-ui-comment-input-btns",
@@ -17,8 +17,10 @@ class Footer extends _react.default.Component {
17
17
  constructor(_props) {
18
18
  super(_props);
19
19
  this.initParticipants = props => {
20
- const row = props.row,
21
- collaborators = props.collaborators;
20
+ const {
21
+ row,
22
+ collaborators
23
+ } = props;
22
24
  if (row._participants && Array.isArray(row._participants)) {
23
25
  let rowParticipants = row._participants.filter(Boolean);
24
26
  rowParticipants = rowParticipants.filter(participant => {
@@ -43,8 +45,12 @@ class Footer extends _react.default.Component {
43
45
  };
44
46
  this.addParticipant = email => {
45
47
  if (!email) return;
46
- const participants = this.state.participants;
47
- const collaborators = this.props.collaborators;
48
+ const {
49
+ participants
50
+ } = this.state;
51
+ const {
52
+ collaborators
53
+ } = this.props;
48
54
  const isExist = participants.some(participant => participant.email === email);
49
55
  if (isExist) return;
50
56
  let newParticipantList = participants.slice(0);
@@ -100,7 +106,9 @@ class Footer extends _react.default.Component {
100
106
  const comment = this.convertComment(commentValue);
101
107
  if (!comment.trim()) return;
102
108
  this.addComment(comment);
103
- const username = window.dtable.username;
109
+ const {
110
+ username
111
+ } = window.dtable;
104
112
  this.addParticipant(username);
105
113
  };
106
114
  this.onInsertElement = (content, nodeType) => {
@@ -122,10 +130,13 @@ class Footer extends _react.default.Component {
122
130
  }
123
131
  }
124
132
  render() {
125
- const _this$state = this.state,
126
- isAdding = _this$state.isAdding,
127
- participants = _this$state.participants;
128
- const collaborators = this.props.collaborators;
133
+ const {
134
+ isAdding,
135
+ participants
136
+ } = this.state;
137
+ const {
138
+ collaborators
139
+ } = this.props;
129
140
  const canUpdateParticipants = Boolean(this.props.onChangeParticipants);
130
141
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
131
142
  className: "dtable-ui-comments-footer",
@@ -42,10 +42,13 @@ class Input extends _react.default.Component {
42
42
  }
43
43
  };
44
44
  this.setPopoverPosition = () => {
45
- const caretPosition = this.state.caretPosition;
46
- let _this$commentRef$getB = this.commentRef.getBoundingClientRect(),
47
- right = _this$commentRef$getB.right,
48
- left = _this$commentRef$getB.left;
45
+ const {
46
+ caretPosition
47
+ } = this.state;
48
+ let {
49
+ right,
50
+ left
51
+ } = this.commentRef.getBoundingClientRect();
49
52
  this.commentPopoverRef.style.left = "".concat(caretPosition.x + FONT_SIZE_WIDTH, "px");
50
53
  this.commentPopoverRef.style.top = "".concat(caretPosition.y - this.commentPopoverRef.offsetHeight, "px");
51
54
  if (caretPosition.x + FONT_SIZE_WIDTH > right - PADDING_WIDTH) {
@@ -105,9 +108,10 @@ class Input extends _react.default.Component {
105
108
  this.props.onInputBlur && this.props.onInputBlur();
106
109
  };
107
110
  this.setScrollTop = (offsetTop, itemOffsetHeight, mouseDownType) => {
108
- let _this$commentPopoverR = this.commentPopoverRef,
109
- offsetHeight = _this$commentPopoverR.offsetHeight,
110
- scrollTop = _this$commentPopoverR.scrollTop;
111
+ let {
112
+ offsetHeight,
113
+ scrollTop
114
+ } = this.commentPopoverRef;
111
115
  if (mouseDownType === DOWN) {
112
116
  if (offsetTop + itemOffsetHeight - scrollTop - offsetHeight + POPOVER_PADDING_HEIGHT > 0) {
113
117
  let top = offsetTop + itemOffsetHeight - offsetHeight + POPOVER_PADDING_HEIGHT;
@@ -128,7 +132,9 @@ class Input extends _react.default.Component {
128
132
  };
129
133
  this.onInsertElement = (content, nodeType) => {
130
134
  const selection = window.getSelection();
131
- let range = this.state.range;
135
+ let {
136
+ range
137
+ } = this.state;
132
138
  let newRange = this.commentUtilities.onInsertElement({
133
139
  selection,
134
140
  range,
@@ -189,7 +195,9 @@ class Input extends _react.default.Component {
189
195
  };
190
196
  this.onSelectCollaborator = collaborator => {
191
197
  const selection = window.getSelection();
192
- let range = this.state.range;
198
+ let {
199
+ range
200
+ } = this.state;
193
201
  let callBack = () => {
194
202
  this.onHidePopover();
195
203
  this.props.addParticipant(collaborator.email);
@@ -271,10 +279,14 @@ class Input extends _react.default.Component {
271
279
  });
272
280
  };
273
281
  this.checkMentionOperation = event => {
274
- const keyCode = event.keyCode;
275
- const Escape = _constants.KeyCodes.Escape,
276
- LeftArrow = _constants.KeyCodes.LeftArrow,
277
- RightArrow = _constants.KeyCodes.RightArrow;
282
+ const {
283
+ keyCode
284
+ } = event;
285
+ const {
286
+ Escape,
287
+ LeftArrow,
288
+ RightArrow
289
+ } = _constants.KeyCodes;
278
290
  if (keyCode === Escape || keyCode === LeftArrow || keyCode === RightArrow) {
279
291
  return false;
280
292
  }
@@ -289,11 +301,15 @@ class Input extends _react.default.Component {
289
301
  return this.onHidePopover();
290
302
  }
291
303
  const selection = window.getSelection();
292
- const collaborators = this.props.collaborators;
304
+ const {
305
+ collaborators
306
+ } = this.props;
293
307
  let filteredCollaborators = [];
294
- const isCollapsed = selection.isCollapsed,
295
- anchorNode = selection.anchorNode,
296
- anchorOffset = selection.anchorOffset;
308
+ const {
309
+ isCollapsed,
310
+ anchorNode,
311
+ anchorOffset
312
+ } = selection;
297
313
  if (!isCollapsed || !anchorNode || !anchorNode.data) {
298
314
  return this.onHidePopover();
299
315
  }
@@ -326,9 +342,10 @@ class Input extends _react.default.Component {
326
342
  };
327
343
  this.handleSelectingCollaborator = (event, direction) => {
328
344
  event.stopPropagation();
329
- const _this$state = this.state,
330
- filteredCollaborators = _this$state.filteredCollaborators,
331
- activeCollaboratorIndex = _this$state.activeCollaboratorIndex;
345
+ const {
346
+ filteredCollaborators,
347
+ activeCollaboratorIndex
348
+ } = this.state;
332
349
  const collaboratorsLen = filteredCollaborators.length;
333
350
  if (collaboratorsLen === 0) {
334
351
  return;
@@ -350,9 +367,10 @@ class Input extends _react.default.Component {
350
367
  });
351
368
  };
352
369
  this.handleSelectCollaborator = () => {
353
- const _this$state2 = this.state,
354
- filteredCollaborators = _this$state2.filteredCollaborators,
355
- activeCollaboratorIndex = _this$state2.activeCollaboratorIndex;
370
+ const {
371
+ filteredCollaborators,
372
+ activeCollaboratorIndex
373
+ } = this.state;
356
374
  if (filteredCollaborators.length === 0) {
357
375
  return;
358
376
  }
@@ -378,12 +396,15 @@ class Input extends _react.default.Component {
378
396
  document.removeEventListener('mousedown', this.hidePopover);
379
397
  }
380
398
  render() {
381
- const api = this.props.api;
382
- const _this$state3 = this.state,
383
- imageUrlList = _this$state3.imageUrlList,
384
- largeImageIndex = _this$state3.largeImageIndex,
385
- filteredCollaborators = _this$state3.filteredCollaborators,
386
- activeCollaboratorIndex = _this$state3.activeCollaboratorIndex;
399
+ const {
400
+ api
401
+ } = this.props;
402
+ const {
403
+ imageUrlList,
404
+ largeImageIndex,
405
+ filteredCollaborators,
406
+ activeCollaboratorIndex
407
+ } = this.state;
387
408
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
388
409
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
389
410
  className: (0, _classnames.default)('dtable-ui-comment-input', {
@@ -28,10 +28,11 @@ class Participant extends _react.default.Component {
28
28
  }
29
29
  }
30
30
  render() {
31
- const _this$props = this.props,
32
- participant = _this$props.participant,
33
- index = _this$props.index,
34
- activeIndex = _this$props.activeIndex;
31
+ const {
32
+ participant,
33
+ index,
34
+ activeIndex
35
+ } = this.props;
35
36
  const active = index === activeIndex;
36
37
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
37
38
  className: "comment-participant-item ".concat(active ? 'active' : ''),
@@ -30,10 +30,11 @@ class Participants extends _react.default.Component {
30
30
  };
31
31
  }
32
32
  render() {
33
- const _this$props = this.props,
34
- canUpdate = _this$props.canUpdate,
35
- participants = _this$props.participants,
36
- collaborators = _this$props.collaborators;
33
+ const {
34
+ canUpdate,
35
+ participants,
36
+ collaborators
37
+ } = this.props;
37
38
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
38
39
  className: "dtable-ui-comments-participants mb-2 position-relative",
39
40
  ref: ref => this.ref = ref,
@@ -11,7 +11,9 @@ var _DTableToolTip = _interopRequireDefault(require("../../../../DTableToolTip")
11
11
  require("./index.css");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  const Participant = _ref => {
14
- let participant = _ref.participant;
14
+ let {
15
+ participant
16
+ } = _ref;
15
17
  const ref = (0, _react.useRef)(null);
16
18
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
17
19
  className: "dtable-ui-participant-avatar",
@@ -32,12 +32,18 @@ class ParticipantSelect extends _react.Component {
32
32
  }
33
33
  };
34
34
  this.getFilteredParticipants = () => {
35
- let collaborators = window.app.state.collaborators;
36
- let searchVal = this.state.searchVal;
35
+ let {
36
+ collaborators
37
+ } = window.app.state;
38
+ let {
39
+ searchVal
40
+ } = this.state;
37
41
  return (0, _dtableUtils.searchCollaborators)(collaborators, searchVal);
38
42
  };
39
43
  this.removeParticipant = participant => {
40
- let participants = this.state.participants;
44
+ let {
45
+ participants
46
+ } = this.state;
41
47
  let updatedValue = participants.slice(0);
42
48
  let participant_index = participants.findIndex(participantItem => participantItem.email === participant.email);
43
49
  updatedValue.splice(participant_index, 1);
@@ -47,7 +53,9 @@ class ParticipantSelect extends _react.Component {
47
53
  });
48
54
  };
49
55
  this.onChangeSearch = event => {
50
- let searchVal = this.state.searchVal;
56
+ let {
57
+ searchVal
58
+ } = this.state;
51
59
  if (searchVal === event.target.value) {
52
60
  return;
53
61
  }
@@ -57,7 +65,9 @@ class ParticipantSelect extends _react.Component {
57
65
  });
58
66
  };
59
67
  this.onSelectParticipant = participant => {
60
- let participants = this.state.participants;
68
+ let {
69
+ participants
70
+ } = this.state;
61
71
  participants = participants.slice(0);
62
72
  let participant_index = participants.findIndex(participantItem => participantItem.email === participant.email);
63
73
  if (participant_index > -1) {
@@ -71,7 +81,9 @@ class ParticipantSelect extends _react.Component {
71
81
  });
72
82
  };
73
83
  this.renderMenuContent = () => {
74
- let participants = this.state.participants;
84
+ let {
85
+ participants
86
+ } = this.state;
75
87
  let filteredParticipants = this.getFilteredParticipants();
76
88
  if (filteredParticipants.length > 0) {
77
89
  return filteredParticipants.map(participant => {
@@ -126,7 +138,9 @@ class ParticipantSelect extends _react.Component {
126
138
  this.unregisterHandlers();
127
139
  }
128
140
  renderParticipantList() {
129
- const collaborators = this.props.collaborators;
141
+ const {
142
+ collaborators
143
+ } = this.props;
130
144
  const selectedParticipants = collaborators.filter(item => {
131
145
  return this.state.participants.find(participant => participant.email === item.email);
132
146
  });
@@ -144,7 +158,9 @@ class ParticipantSelect extends _react.Component {
144
158
  });
145
159
  }
146
160
  render() {
147
- const target = this.props.target;
161
+ const {
162
+ target
163
+ } = this.props;
148
164
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
149
165
  ref: ref => this.outerRef = ref,
150
166
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Popover, {
@@ -42,7 +42,9 @@ class Comment extends _react.default.Component {
42
42
  let isGetCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
43
43
  _this.initComments(row, 1, pageNum);
44
44
  if (!isGetCount) return;
45
- const api = _this.props.api;
45
+ const {
46
+ api
47
+ } = _this.props;
46
48
  api.getCount(row).then(res => {
47
49
  const count = res.data.count;
48
50
  _this.updateCount(row, count);
@@ -53,7 +55,9 @@ class Comment extends _react.default.Component {
53
55
  this.initComments = function (row) {
54
56
  let page = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
55
57
  let perPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
56
- const api = _this.props.api;
58
+ const {
59
+ api
60
+ } = _this.props;
57
61
  api.get(row, page, perPage).then(res => {
58
62
  let comments = res.data.comment_list || [];
59
63
  let newComments = [];
@@ -70,11 +74,14 @@ class Comment extends _react.default.Component {
70
74
  });
71
75
  };
72
76
  this.addComment = (newComment, _ref) => {
73
- let successCallback = _ref.successCallback,
74
- failCallback = _ref.failCallback;
75
- const _this$props = this.props,
76
- row = _this$props.row,
77
- api = _this$props.api;
77
+ let {
78
+ successCallback,
79
+ failCallback
80
+ } = _ref;
81
+ const {
82
+ row,
83
+ api
84
+ } = this.props;
78
85
  api.add(row, newComment).then(res => api.getCount(row)).then(res => {
79
86
  const count = res.data.count;
80
87
  this.updateCount(row, count);
@@ -89,9 +96,10 @@ class Comment extends _react.default.Component {
89
96
  };
90
97
  this.resolveComment = (event, commentID) => {
91
98
  event.persist();
92
- const _this$props2 = this.props,
93
- row = _this$props2.row,
94
- api = _this$props2.api;
99
+ const {
100
+ row,
101
+ api
102
+ } = this.props;
95
103
  api.update(row, commentID, null, 1).then(() => {
96
104
  this.reCalculateComments(row);
97
105
  }).catch(error => {
@@ -99,9 +107,10 @@ class Comment extends _react.default.Component {
99
107
  });
100
108
  };
101
109
  this.deleteComment = (event, commentID) => {
102
- const _this$props3 = this.props,
103
- api = _this$props3.api,
104
- row = _this$props3.row;
110
+ const {
111
+ api,
112
+ row
113
+ } = this.props;
105
114
  api.delete(row, commentID).then(() => {
106
115
  this.reCalculateComments(row);
107
116
  }).catch(e => {
@@ -110,14 +119,17 @@ class Comment extends _react.default.Component {
110
119
  };
111
120
  // notification
112
121
  this.onNewNotification = notification => {
113
- const msg_type = notification.msg_type;
122
+ const {
123
+ msg_type
124
+ } = notification;
114
125
  if (msg_type !== ROW_COMMENT) return;
115
126
  this.setState({
116
127
  isFirstLoading: true
117
128
  });
118
- const _this$props4 = this.props,
119
- row = _this$props4.row,
120
- api = _this$props4.api;
129
+ const {
130
+ row,
131
+ api
132
+ } = this.props;
121
133
  api.getCount(row).then(res => {
122
134
  const count = res.data.count;
123
135
  this.updateCount(row, count);
@@ -128,9 +140,11 @@ class Comment extends _react.default.Component {
128
140
  };
129
141
  // collaborators
130
142
  this.initCollaborators = props => {
131
- const columns = props.columns,
132
- row = props.row,
133
- collaborators = props.collaborators;
143
+ const {
144
+ columns,
145
+ row,
146
+ collaborators
147
+ } = props;
134
148
  let collaboratorColumnKeyList = [];
135
149
  columns.forEach(column => {
136
150
  if (column.type === _dtableUtils.CellType.COLLABORATOR) {
@@ -179,12 +193,14 @@ class Comment extends _react.default.Component {
179
193
  };
180
194
  this.onScroll = () => {
181
195
  if (this.body.offsetHeight + this.body.scrollTop + 1 < this.bodyContent.offsetHeight + 32) return; // 16 is padding height
182
- const _this$props5 = this.props,
183
- api = _this$props5.api,
184
- row = _this$props5.row;
185
- const _this$state = this.state,
186
- comments = _this$state.comments,
187
- count = _this$state.count;
196
+ const {
197
+ api,
198
+ row
199
+ } = this.props;
200
+ const {
201
+ comments,
202
+ count
203
+ } = this.state;
188
204
  let currentCommentsLength = comments.length;
189
205
  if (currentCommentsLength < count) {
190
206
  // Have pagination
@@ -241,19 +257,21 @@ class Comment extends _react.default.Component {
241
257
  this.unsubscribeNotification();
242
258
  }
243
259
  render() {
244
- const _this$state2 = this.state,
245
- collaborators = _this$state2.collaborators,
246
- comments = _this$state2.comments,
247
- isLoading = _this$state2.isLoading,
248
- isFirstLoading = _this$state2.isFirstLoading;
249
- const _this$props6 = this.props,
250
- autoFocusInput = _this$props6.autoFocusInput,
251
- row = _this$props6.row,
252
- columns = _this$props6.columns,
253
- onInputFocus = _this$props6.onInputFocus,
254
- onInputBlur = _this$props6.onInputBlur,
255
- api = _this$props6.api,
256
- uploadFile = _this$props6.uploadFile;
260
+ const {
261
+ collaborators,
262
+ comments,
263
+ isLoading,
264
+ isFirstLoading
265
+ } = this.state;
266
+ const {
267
+ autoFocusInput,
268
+ row,
269
+ columns,
270
+ onInputFocus,
271
+ onInputBlur,
272
+ api,
273
+ uploadFile
274
+ } = this.props;
257
275
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
258
276
  className: "dtable-ui-comments h-100 w-100",
259
277
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -9,11 +9,13 @@ var _getEventTransfer = _interopRequireDefault(require("../../utils/get-event-tr
9
9
  class Utilities {
10
10
  constructor() {
11
11
  this.onInsertElement = _ref => {
12
- let commentRef = _ref.commentRef,
13
- selection = _ref.selection,
14
- range = _ref.range,
15
- content = _ref.content,
16
- nodeType = _ref.nodeType;
12
+ let {
13
+ commentRef,
14
+ selection,
15
+ range,
16
+ content,
17
+ nodeType
18
+ } = _ref;
17
19
  if (range) {
18
20
  selection.removeAllRanges();
19
21
  selection.addRange(range);
@@ -46,11 +48,13 @@ class Utilities {
46
48
  }
47
49
  };
48
50
  this.createHtmlElement = _ref2 => {
49
- let commentRef = _ref2.commentRef,
50
- selection = _ref2.selection,
51
- range = _ref2.range,
52
- content = _ref2.content,
53
- nodeType = _ref2.nodeType;
51
+ let {
52
+ commentRef,
53
+ selection,
54
+ range,
55
+ content,
56
+ nodeType
57
+ } = _ref2;
54
58
  let spanNode1;
55
59
  let spanNode2;
56
60
  let imageContainer;
@@ -93,11 +97,13 @@ class Utilities {
93
97
  return range;
94
98
  };
95
99
  this.onSelectParticipant = _ref3 => {
96
- let selection = _ref3.selection,
97
- range = _ref3.range,
98
- participant = _ref3.participant,
99
- callBack = _ref3.callBack,
100
- commentRef = _ref3.commentRef;
100
+ let {
101
+ selection,
102
+ range,
103
+ participant,
104
+ callBack,
105
+ commentRef
106
+ } = _ref3;
101
107
  if (range) {
102
108
  // delete '@xxx';
103
109
  selection.removeAllRanges();