dtable-ui-component 6.0.1140-oal.3 → 7.0.0

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