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.
- package/lib/ActionSheet/index.js +16 -14
- package/lib/ActivityIndicator/index.js +8 -7
- package/lib/AsyncUserSelect/index.js +19 -40
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +11 -9
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +3 -1
- package/lib/CheckboxEditor/mb-editor.js +20 -9
- package/lib/CheckboxEditor/pc-editor.js +24 -12
- package/lib/CheckboxFormatter/index.js +5 -4
- package/lib/CollaboratorEditor/index.js +4 -2
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +34 -25
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +7 -9
- package/lib/Comment/body/comment.js +18 -10
- package/lib/Comment/body/index.js +4 -2
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +20 -9
- package/lib/Comment/footer/input/index.js +50 -29
- package/lib/Comment/footer/input/participant/index.js +5 -4
- package/lib/Comment/footer/participants/index.js +5 -4
- package/lib/Comment/footer/participants/participant/index.js +3 -1
- package/lib/Comment/footer/participants/participant-select/index.js +24 -8
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +21 -15
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +18 -22
- package/lib/DTableColorPicker/index.js +40 -55
- package/lib/DTableColorPicker/utils.js +6 -4
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +8 -6
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeCollaboratorSelect/index.js +20 -17
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +18 -16
- package/lib/DTableDropdownMenu/index.js +10 -8
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +50 -34
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +113 -63
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
- package/lib/DTableFiltersPopover/widgets/filter-group.js +56 -35
- package/lib/DTableFiltersPopover/widgets/filter-item.js +171 -108
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +161 -136
- package/lib/DTableFiltersPopover/widgets/rate-item.js +20 -15
- package/lib/DTableGroupSelect/index.js +15 -11
- package/lib/DTableGroupSelect/select-option-group.js +32 -23
- package/lib/DTableIcon/index.js +7 -6
- package/lib/DTableIcon/svg-icon.js +7 -5
- package/lib/DTableModalHeader/index.css +3 -20
- package/lib/DTableModalHeader/index.js +3 -1
- package/lib/DTablePopover/index.js +15 -11
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +17 -8
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +5 -6
- package/lib/DTableSelect/index.js +22 -21
- package/lib/DTableSelect/utils.js +15 -7
- package/lib/DTableSubDropdownMenu/index.js +10 -8
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +8 -7
- package/lib/DateEditor/index.js +15 -20
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +45 -26
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +3 -1
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +23 -25
- package/lib/DepartmentSelectFilter/index.js +8 -6
- package/lib/DepartmentSingleSelectEditor/index.js +3 -1
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +47 -48
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +58 -36
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +3 -1
- package/lib/DigitalSignEditor/mb-editor/index.js +20 -12
- package/lib/DigitalSignEditor/pc-editor/index.js +24 -17
- package/lib/DigitalSignEditor/service.js +4 -2
- package/lib/DigitalSignEditor/signature-board/index.js +8 -5
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +5 -4
- package/lib/DurationEditor/index.js +31 -21
- package/lib/DurationFormatter/index.js +5 -4
- package/lib/EditEditorButton/index.js +3 -1
- package/lib/EmailFormatter/index.js +4 -3
- package/lib/FieldDisplaySetting/field-item.js +12 -12
- package/lib/FieldDisplaySetting/index.js +10 -12
- package/lib/FileEditor/files-previewer/index.js +3 -1
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +18 -10
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +21 -14
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +3 -1
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +3 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +25 -11
- package/lib/FileEditor/pc-editor/index.js +27 -19
- package/lib/FileFormatter/index.js +19 -26
- package/lib/FileItemFormatter/index.js +9 -6
- package/lib/FileUploader/index.js +45 -28
- package/lib/FormulaFormatter/index.js +29 -15
- package/lib/GeolocationEditor/index.js +12 -11
- package/lib/GeolocationEditor/map-editor-utils.js +15 -17
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +6 -4
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +68 -41
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
- package/lib/GeolocationEditor/pc-editor/country-editor.js +23 -10
- package/lib/GeolocationEditor/pc-editor/index.js +20 -12
- package/lib/GeolocationEditor/pc-editor/location-editor.js +31 -26
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +54 -34
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +60 -36
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +62 -35
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +65 -36
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +25 -19
- package/lib/GeolocationEditor/pc-editor/province-editor.js +13 -6
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +7 -6
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +12 -4
- package/lib/Icon/index.js +5 -3
- package/lib/IconButton/index.js +6 -4
- package/lib/ImageEditor/images-previewer/image-preview/index.js +21 -12
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +3 -1
- package/lib/ImageEditor/mb-editor/index.js +20 -28
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +3 -1
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +21 -7
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +13 -11
- package/lib/ImagePreviewerLightbox/index.js +13 -15
- package/lib/ImageThumbnail/index.js +13 -10
- package/lib/InputItem/custom-input.js +46 -26
- package/lib/InputItem/custom-keyboard.js +18 -15
- package/lib/InputItem/index.js +50 -34
- package/lib/InputItem/input.js +4 -2
- package/lib/LastModifierFormatter/index.js +8 -6
- package/lib/LinkEditor/index.js +53 -33
- package/lib/LinkEditor/link-editor-option.js +4 -3
- package/lib/LinkEditor/mb-popover/index.js +22 -9
- package/lib/LinkEditor/pc-popover/index.js +10 -5
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +8 -6
- package/lib/List/list-item.js +28 -22
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +8 -7
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +5 -3
- package/lib/MobileFullScreenPage/header/index.js +6 -4
- package/lib/MobileFullScreenPage/index.js +11 -13
- package/lib/MobileModal/index.js +3 -1
- package/lib/MobileOperationSheet/index.js +8 -7
- package/lib/MobileSelector/empty/index.js +3 -1
- package/lib/MobileSelector/index.js +7 -5
- package/lib/MobileSelector/option/index.js +5 -3
- package/lib/MobileSelector/options/index.js +3 -1
- package/lib/MobileSelector/search/index.js +5 -3
- package/lib/MobileUpload/index.js +5 -4
- package/lib/Modal/modal.js +15 -14
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +3 -1
- package/lib/MultipleSelectFormatter/index.js +8 -6
- package/lib/NotificationPopover/index.js +5 -4
- package/lib/NumberEditor/index.js +21 -12
- package/lib/NumberFormatter/index.js +5 -4
- package/lib/PhoneNumberLink/index.js +4 -2
- package/lib/Picker/AbstractPicker.js +27 -23
- package/lib/Popover/index.js +4 -3
- package/lib/Popover/item.js +9 -7
- package/lib/Progress/index.js +8 -9
- package/lib/Radio/Radio.js +8 -4
- package/lib/Radio/RadioItem.js +12 -8
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +17 -18
- package/lib/RowExpandDialog/body/index.js +49 -32
- package/lib/RowExpandDialog/column-content/index.js +9 -5
- package/lib/RowExpandDialog/header/index.js +8 -6
- package/lib/RowExpandDialog/index.js +34 -49
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
- package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
- package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
- package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
- package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +34 -20
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +35 -21
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +19 -9
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +24 -13
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +25 -15
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +23 -13
- package/lib/RowExpandEditor/index.js +8 -4
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +19 -11
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +33 -22
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
- package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +25 -12
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +36 -20
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +28 -17
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +34 -22
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +13 -5
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +18 -9
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
- package/lib/RowExpandFormatter/email-formatter/index.js +7 -4
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +12 -10
- package/lib/RowExpandFormatter/formula-formatter/index.js +34 -19
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +8 -7
- package/lib/RowExpandFormatter/index.js +41 -27
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +14 -8
- package/lib/RowExpandFormatter/link-formatter/index.js +19 -11
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +12 -11
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +7 -4
- package/lib/RowExpandView/body/index.js +35 -22
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +30 -42
- package/lib/SelectItem/index.js +8 -6
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +9 -7
- package/lib/SimpleLongTextFormatter/index.js +16 -10
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
- package/lib/SingleSelectEditor/index.js +3 -1
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +16 -14
- package/lib/TabBar/index.js +21 -18
- package/lib/Tabs/index.js +3 -1
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +26 -19
- package/lib/Toast/index.js +4 -3
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +3 -1
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +42 -27
- package/lib/toaster/alert.js +7 -6
- package/lib/toaster/toast.js +3 -2
- package/lib/toaster/toastManager.js +4 -2
- package/lib/utils/cell.js +11 -8
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +3 -1
- package/lib/utils/url.js +31 -24
- package/lib/utils/utils.js +6 -2
- 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
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
32
|
-
isScrollBottom
|
|
33
|
-
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
|
|
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
|
|
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
|
|
129
|
-
comment
|
|
130
|
-
onResolve
|
|
131
|
-
onDelete
|
|
132
|
-
|
|
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
|
|
18
|
-
|
|
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
|
|
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
|
|
77
|
-
isAdding
|
|
78
|
-
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
|
|
21
|
-
|
|
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
|
|
47
|
-
|
|
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
|
|
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
|
|
126
|
-
isAdding
|
|
127
|
-
participants
|
|
128
|
-
|
|
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
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
109
|
-
offsetHeight
|
|
110
|
-
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
|
|
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
|
|
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
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|
|
304
|
+
const {
|
|
305
|
+
collaborators
|
|
306
|
+
} = this.props;
|
|
293
307
|
let filteredCollaborators = [];
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
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
|
|
330
|
-
filteredCollaborators
|
|
331
|
-
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
|
|
354
|
-
filteredCollaborators
|
|
355
|
-
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
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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
|
|
32
|
-
participant
|
|
33
|
-
index
|
|
34
|
-
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
|
|
34
|
-
canUpdate
|
|
35
|
-
participants
|
|
36
|
-
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
|
|
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
|
|
36
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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, {
|
package/lib/Comment/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
|
93
|
-
row
|
|
94
|
-
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
|
|
103
|
-
api
|
|
104
|
-
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
|
|
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
|
|
119
|
-
row
|
|
120
|
-
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
|
|
132
|
-
|
|
133
|
-
|
|
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
|
|
183
|
-
api
|
|
184
|
-
row
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
|
245
|
-
collaborators
|
|
246
|
-
comments
|
|
247
|
-
isLoading
|
|
248
|
-
isFirstLoading
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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();
|