dtable-ui-component 6.0.126-beta.s1 → 6.0.126
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 +14 -16
- package/lib/ActivityIndicator/index.js +7 -8
- package/lib/AsyncUserSelect/index.css +19 -46
- package/lib/AsyncUserSelect/index.js +58 -41
- package/lib/AsyncUserSelect/user-item.js +5 -6
- package/lib/AutoNumberFormatter/index.js +3 -4
- package/lib/Badge/index.js +9 -11
- package/lib/ButtonFormatter/index.js +6 -8
- package/lib/CTimeFormatter/index.js +3 -4
- package/lib/CheckboxEditor/index.js +1 -3
- package/lib/CheckboxEditor/mb-editor.js +9 -20
- package/lib/CheckboxEditor/pc-editor.js +12 -24
- package/lib/CheckboxFormatter/index.js +4 -5
- package/lib/CollaboratorEditor/index.js +2 -4
- package/lib/CollaboratorEditor/mb-editor/index.js +11 -19
- package/lib/CollaboratorEditor/pc-editor/index.js +25 -34
- package/lib/CollaboratorFormatter/index.js +8 -10
- package/lib/CollaboratorItem/index.js +4 -5
- package/lib/CollapsibleSettingLayout/index.js +9 -7
- package/lib/Comment/body/comment.js +10 -18
- package/lib/Comment/body/index.js +2 -4
- package/lib/Comment/footer/btns/index.js +4 -7
- package/lib/Comment/footer/index.js +9 -20
- package/lib/Comment/footer/input/index.js +29 -50
- package/lib/Comment/footer/input/participant/index.js +4 -5
- package/lib/Comment/footer/participants/index.js +4 -5
- package/lib/Comment/footer/participants/participant/index.js +1 -3
- package/lib/Comment/footer/participants/participant-select/index.js +8 -24
- package/lib/Comment/index.js +39 -57
- package/lib/Comment/utils/utilities.js +15 -21
- package/lib/CreatorFormatter/index.js +6 -8
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +23 -19
- package/lib/DTableColorPicker/index.css +0 -2
- package/lib/DTableColorPicker/index.js +56 -41
- package/lib/DTableColorPicker/utils.js +4 -6
- package/lib/DTableColumnIcon/index.js +6 -7
- package/lib/DTableCommonAddTool/index.css +1 -3
- package/lib/DTableCommonAddTool/index.js +6 -8
- package/lib/DTableCustomFooter/index.css +1 -3
- package/lib/DTableCustomFooter/index.js +1 -3
- package/lib/DTableCustomizeCollaboratorSelect/index.js +17 -20
- package/lib/DTableCustomizeSelect/index.css +43 -67
- package/lib/DTableCustomizeSelect/index.js +29 -40
- package/lib/DTableDropdownItem/index.js +16 -18
- package/lib/DTableDropdownMenu/index.js +8 -10
- package/lib/DTableEmptyTip/index.js +4 -5
- package/lib/DTableFiltersPopover/index.css +0 -2
- package/lib/DTableFiltersPopover/index.js +26 -41
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -5
- package/lib/DTableFiltersPopover/utils/index.js +63 -113
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -10
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +16 -13
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +18 -15
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +8 -14
- package/lib/DTableFiltersPopover/widgets/filter-group.js +34 -55
- package/lib/DTableFiltersPopover/widgets/filter-item.js +107 -170
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +136 -161
- package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
- package/lib/DTableGroupSelect/index.css +5 -31
- package/lib/DTableGroupSelect/index.js +13 -17
- package/lib/DTableGroupSelect/select-option-group.css +15 -11
- package/lib/DTableGroupSelect/select-option-group.js +31 -43
- package/lib/DTableIcon/index.js +6 -7
- package/lib/DTableIcon/svg-icon.js +5 -7
- package/lib/DTableModalHeader/index.js +1 -3
- package/lib/DTablePopover/index.js +13 -16
- package/lib/DTableRadio/index.js +10 -9
- package/lib/DTableRadioGroup/index.js +8 -17
- package/lib/DTableSearchInput/index.js +19 -29
- package/lib/DTableSelect/dtable-select-label.css +4 -4
- package/lib/DTableSelect/dtable-select-label.js +7 -6
- package/lib/DTableSelect/index.js +24 -25
- package/lib/DTableSelect/user-select.css +46 -7
- package/lib/DTableSelect/utils.js +82 -179
- package/lib/DTableSubDropdownMenu/index.js +8 -10
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.css +0 -1
- package/lib/DTableSwitch/index.js +12 -11
- package/lib/DTableToolTip/index.js +7 -8
- package/lib/DateEditor/index.js +20 -15
- package/lib/DateEditor/mb-editor/index.js +18 -31
- package/lib/DateEditor/pc-editor.js +26 -45
- package/lib/DateFormatter/index.js +4 -5
- package/lib/DatePicker/index.js +9 -15
- package/lib/DatePicker/utils.js +1 -3
- package/lib/DeleteTip/index.js +5 -6
- package/lib/DepartmentMultipleSelectEditor/index.js +25 -23
- package/lib/DepartmentSelectFilter/index.js +6 -8
- package/lib/DepartmentSingleSelectEditor/index.js +1 -3
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +48 -47
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +36 -58
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -19
- package/lib/DepartmentSingleSelectFormatter/index.js +4 -6
- package/lib/DigitalSignEditor/index.js +1 -3
- package/lib/DigitalSignEditor/mb-editor/index.js +12 -20
- package/lib/DigitalSignEditor/pc-editor/index.js +17 -24
- package/lib/DigitalSignEditor/service.js +2 -4
- package/lib/DigitalSignEditor/signature-board/index.js +5 -8
- package/lib/DigitalSignEditor/utils.js +2 -4
- package/lib/DigitalSignFormatter/index.js +12 -15
- package/lib/DigitalSignFormatter/utils.js +4 -5
- package/lib/DurationEditor/index.js +21 -31
- package/lib/DurationFormatter/index.js +4 -5
- package/lib/EditEditorButton/index.js +1 -3
- package/lib/EmailFormatter/index.js +3 -4
- package/lib/FieldDisplaySetting/field-item.js +12 -12
- package/lib/FieldDisplaySetting/index.js +11 -9
- package/lib/FileEditor/files-previewer/index.js +1 -3
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +10 -18
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +7 -8
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +3 -4
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +5 -6
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +14 -21
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +29 -57
- package/lib/FileEditor/index.js +1 -3
- package/lib/FileEditor/mb-editor/index.js +28 -20
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +11 -25
- package/lib/FileEditor/pc-editor/index.js +19 -27
- package/lib/FileFormatter/index.js +26 -19
- package/lib/FileItemFormatter/index.js +6 -9
- package/lib/FileUploader/index.js +28 -45
- package/lib/FormulaFormatter/index.js +15 -29
- package/lib/GeolocationEditor/index.js +11 -12
- package/lib/GeolocationEditor/map-editor-utils.js +17 -15
- package/lib/GeolocationEditor/mb-editor/country-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/index.js +4 -6
- package/lib/GeolocationEditor/mb-editor/location-editor.js +18 -15
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +41 -68
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +50 -89
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/province-editor.js +17 -14
- package/lib/GeolocationEditor/pc-editor/country-editor.js +10 -23
- package/lib/GeolocationEditor/pc-editor/index.js +12 -20
- package/lib/GeolocationEditor/pc-editor/location-editor.js +26 -31
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +34 -54
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +36 -60
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +35 -62
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +36 -65
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +19 -25
- package/lib/GeolocationEditor/pc-editor/province-editor.js +6 -13
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +5 -6
- package/lib/GeolocationEditor/pc-editor/selector-list.js +6 -7
- package/lib/GeolocationFormatter/index.js +4 -5
- package/lib/HtmlLongTextFormatter/index.js +4 -12
- package/lib/Icon/index.js +3 -5
- package/lib/IconButton/index.js +4 -6
- package/lib/ImageEditor/images-previewer/image-preview/index.js +12 -21
- package/lib/ImageEditor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/index.js +1 -3
- package/lib/ImageEditor/mb-editor/index.js +28 -20
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +2 -6
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +7 -21
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/pc-editor/index.js +11 -16
- package/lib/ImageFormatter/images-lazy-load.js +19 -11
- package/lib/ImageFormatter/index.js +11 -13
- package/lib/ImagePreviewerLightbox/index.js +15 -13
- package/lib/ImageThumbnail/index.js +10 -13
- package/lib/InputItem/custom-input.js +26 -46
- package/lib/InputItem/custom-keyboard.js +15 -18
- package/lib/InputItem/index.js +34 -50
- package/lib/InputItem/input.js +2 -4
- package/lib/LastModifierFormatter/index.js +6 -8
- package/lib/LinkEditor/index.js +33 -53
- package/lib/LinkEditor/link-editor-option.js +3 -4
- package/lib/LinkEditor/mb-popover/index.js +9 -22
- package/lib/LinkEditor/pc-popover/index.js +5 -10
- package/lib/LinkFormatter/index.js +21 -37
- package/lib/List/index.js +6 -8
- package/lib/List/list-item.js +22 -28
- package/lib/LongTextFormatter/index.js +4 -5
- package/lib/MBEditorHeader/index.js +7 -8
- package/lib/MTimeFormatter/index.js +3 -4
- package/lib/MobileFullScreenPage/body/index.js +3 -5
- package/lib/MobileFullScreenPage/header/index.js +4 -6
- package/lib/MobileFullScreenPage/index.js +13 -11
- package/lib/MobileModal/index.js +1 -3
- package/lib/MobileOperationSheet/index.js +7 -8
- package/lib/MobileSelector/empty/index.js +1 -3
- package/lib/MobileSelector/index.js +5 -7
- package/lib/MobileSelector/option/index.js +3 -5
- package/lib/MobileSelector/options/index.js +1 -3
- package/lib/MobileSelector/search/index.js +3 -5
- package/lib/MobileUpload/index.js +4 -5
- package/lib/Modal/modal.js +14 -15
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +1 -3
- package/lib/MultipleSelectFormatter/index.js +6 -8
- package/lib/NotificationPopover/index.css +1 -6
- package/lib/NotificationPopover/index.js +6 -7
- package/lib/NumberEditor/index.js +12 -21
- package/lib/NumberFormatter/index.js +4 -5
- package/lib/PhoneNumberLink/index.js +2 -4
- package/lib/Picker/AbstractPicker.js +23 -27
- package/lib/Popover/index.js +3 -4
- package/lib/Popover/item.js +7 -9
- package/lib/Progress/index.js +9 -8
- package/lib/Radio/Radio.js +4 -8
- package/lib/Radio/RadioItem.js +8 -12
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +18 -17
- package/lib/RowExpandDialog/body/index.js +32 -49
- package/lib/RowExpandDialog/column-content/index.js +5 -9
- package/lib/RowExpandDialog/header/index.js +6 -8
- package/lib/RowExpandDialog/index.js +49 -34
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +8 -10
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +22 -33
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +26 -40
- package/lib/RowExpandEditor/date-editor/mb-editor.js +12 -18
- package/lib/RowExpandEditor/date-editor/pc-editor.js +15 -20
- package/lib/RowExpandEditor/department-editor/mb-editor.js +16 -11
- package/lib/RowExpandEditor/department-editor/pc-editor.js +19 -14
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +20 -34
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +21 -35
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +10 -17
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +13 -19
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +9 -19
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +13 -24
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +18 -31
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +17 -29
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +13 -26
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +15 -25
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +13 -23
- package/lib/RowExpandEditor/index.js +4 -8
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +17 -18
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +10 -16
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +11 -19
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +22 -33
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +8 -14
- package/lib/RowExpandEditor/number-editor/pc-editor.js +13 -20
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +12 -25
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +20 -36
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +17 -28
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +22 -34
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +15 -26
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +5 -13
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +9 -18
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -4
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +2 -4
- package/lib/RowExpandFormatter/email-formatter/index.js +4 -7
- package/lib/RowExpandFormatter/file-formatter/index.js +8 -9
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +10 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +19 -34
- package/lib/RowExpandFormatter/image-formatter/index.js +9 -11
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +7 -8
- package/lib/RowExpandFormatter/index.js +27 -41
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +8 -14
- package/lib/RowExpandFormatter/link-formatter/index.js +11 -19
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +3 -5
- package/lib/RowExpandFormatter/rate-formatter/index.js +11 -12
- package/lib/RowExpandFormatter/text/index.js +4 -5
- package/lib/RowExpandFormatter/url-formatter/index.js +4 -7
- package/lib/RowExpandView/body/index.js +22 -35
- package/lib/RowExpandView/column-content/index.js +3 -7
- package/lib/RowExpandView/index.js +42 -30
- package/lib/SelectItem/index.js +5 -7
- package/lib/SelectOptionGroup/index.css +25 -53
- package/lib/SelectOptionGroup/index.js +36 -84
- package/lib/SelectedDepartments/index.js +7 -9
- package/lib/SimpleLongTextFormatter/index.js +10 -16
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +3 -4
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +12 -21
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -4
- package/lib/SingleSelectEditor/index.js +1 -3
- package/lib/SingleSelectFormatter/index.js +8 -9
- package/lib/TabBar/Tab.js +14 -16
- package/lib/TabBar/index.js +18 -21
- package/lib/Tabs/index.js +1 -3
- package/lib/TextEditor/index.js +14 -23
- package/lib/TextFormatter/index.js +3 -4
- package/lib/TextareaItem/index.js +19 -26
- package/lib/Toast/index.js +3 -4
- package/lib/UrlFormatter/index.js +3 -4
- package/lib/common/editor-base.js +7 -12
- package/lib/hooks/common-hooks.js +2 -4
- package/lib/index.js +0 -7
- package/lib/select-editor/index.js +1 -3
- package/lib/select-editor/mb-editor/index.js +17 -28
- package/lib/select-editor/pc-editor/index.js +27 -42
- package/lib/toaster/alert.js +6 -7
- package/lib/toaster/toast.js +2 -3
- package/lib/toaster/toastManager.js +2 -4
- package/lib/utils/cell.js +8 -11
- package/lib/utils/column-utils.js +8 -14
- package/lib/utils/departments.js +1 -3
- package/lib/utils/url.js +24 -31
- package/lib/utils/utils.js +2 -6
- package/package.json +8 -8
- package/lib/DTableCustomizeSearchInput/index.css +0 -81
- package/lib/DTableCustomizeSearchInput/index.js +0 -141
- package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +0 -109
- package/lib/DTableCustomizeSelect/select-option-group/index.css +0 -134
- package/lib/DTableCustomizeSelect/select-option-group/index.js +0 -260
- package/lib/DTableCustomizeSelect/select-option-group/option.js +0 -48
- package/lib/DTableCustomizeSelect/util.js +0 -12
- package/lib/DTableSelect/select-dropdown-indicator/index.css +0 -16
- package/lib/DTableSelect/select-dropdown-indicator/index.js +0 -26
- package/lib/DTableSelect/select-style.js +0 -133
- package/lib/assets/icons/close.svg +0 -1
- package/lib/assets/icons/down.svg +0 -3
|
@@ -12,12 +12,10 @@ var _lang = require("../../lang");
|
|
|
12
12
|
var _CollaboratorItem = _interopRequireDefault(require("../../CollaboratorItem"));
|
|
13
13
|
require("./index.css");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Empty
|
|
20
|
-
} = _MobileSelector.default;
|
|
15
|
+
const Search = _MobileSelector.default.Search,
|
|
16
|
+
Option = _MobileSelector.default.Option,
|
|
17
|
+
Options = _MobileSelector.default.Options,
|
|
18
|
+
Empty = _MobileSelector.default.Empty;
|
|
21
19
|
class MBCollaboratorEditor extends _react.default.Component {
|
|
22
20
|
constructor(props) {
|
|
23
21
|
super(props);
|
|
@@ -26,9 +24,7 @@ class MBCollaboratorEditor extends _react.default.Component {
|
|
|
26
24
|
this.props.onClose();
|
|
27
25
|
};
|
|
28
26
|
this.onChangeSearch = newValue => {
|
|
29
|
-
let
|
|
30
|
-
searchVal
|
|
31
|
-
} = this.state;
|
|
27
|
+
let searchVal = this.state.searchVal;
|
|
32
28
|
if (searchVal === newValue) return;
|
|
33
29
|
this.setState({
|
|
34
30
|
searchVal: newValue
|
|
@@ -38,9 +34,8 @@ class MBCollaboratorEditor extends _react.default.Component {
|
|
|
38
34
|
this.props.onCommit(collaborator);
|
|
39
35
|
};
|
|
40
36
|
this.renderCollaborators = collaborators => {
|
|
41
|
-
const
|
|
42
|
-
value = []
|
|
43
|
-
} = this.props;
|
|
37
|
+
const _this$props$value = this.props.value,
|
|
38
|
+
value = _this$props$value === void 0 ? [] : _this$props$value;
|
|
44
39
|
return collaborators.map(collaborator => {
|
|
45
40
|
const isSelected = value.includes(collaborator.email);
|
|
46
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Option, {
|
|
@@ -64,13 +59,10 @@ class MBCollaboratorEditor extends _react.default.Component {
|
|
|
64
59
|
window.removeEventListener('popstate', this.handleHistoryBack, false);
|
|
65
60
|
}
|
|
66
61
|
render() {
|
|
67
|
-
const
|
|
68
|
-
column,
|
|
69
|
-
collaborators
|
|
70
|
-
|
|
71
|
-
const {
|
|
72
|
-
searchVal
|
|
73
|
-
} = this.state;
|
|
62
|
+
const _this$props = this.props,
|
|
63
|
+
column = _this$props.column,
|
|
64
|
+
collaborators = _this$props.collaborators;
|
|
65
|
+
const searchVal = this.state.searchVal;
|
|
74
66
|
const displayCollaborators = searchVal ? (0, _dtableUtils.searchCollaborators)(collaborators, searchVal) : collaborators;
|
|
75
67
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MobileSelector.default, {
|
|
76
68
|
onClose: this.props.onClose,
|
|
@@ -21,9 +21,7 @@ class PCCollaboratorEditor extends _react.default.Component {
|
|
|
21
21
|
super(props);
|
|
22
22
|
this.onValueChanged = newSearchValue => {
|
|
23
23
|
if (newSearchValue === this.state.searchValue) return;
|
|
24
|
-
const
|
|
25
|
-
collaborators
|
|
26
|
-
} = this.props;
|
|
24
|
+
const collaborators = this.props.collaborators;
|
|
27
25
|
this.filteredCollaborators = (0, _dtableUtils.searchCollaborators)(collaborators, newSearchValue);
|
|
28
26
|
this.setState({
|
|
29
27
|
highlightIndex: this.filteredCollaborators.length > 0 ? 0 : -1,
|
|
@@ -34,9 +32,7 @@ class PCCollaboratorEditor extends _react.default.Component {
|
|
|
34
32
|
this.props.onCommit(collaborator);
|
|
35
33
|
};
|
|
36
34
|
this.getFilterCollaborator = () => {
|
|
37
|
-
const
|
|
38
|
-
collaborators
|
|
39
|
-
} = this.props;
|
|
35
|
+
const collaborators = this.props.collaborators;
|
|
40
36
|
const searchValue = this.state.searchValue.toLowerCase();
|
|
41
37
|
if (!searchValue) return collaborators;
|
|
42
38
|
return (0, _dtableUtils.searchCollaborators)(collaborators, searchValue);
|
|
@@ -77,11 +73,10 @@ class PCCollaboratorEditor extends _react.default.Component {
|
|
|
77
73
|
this.onUpArrow = e => {
|
|
78
74
|
e.preventDefault();
|
|
79
75
|
e.stopPropagation();
|
|
80
|
-
let
|
|
81
|
-
highlightIndex,
|
|
82
|
-
maxItemNum,
|
|
83
|
-
itemHeight
|
|
84
|
-
} = this.state;
|
|
76
|
+
let _this$state = this.state,
|
|
77
|
+
highlightIndex = _this$state.highlightIndex,
|
|
78
|
+
maxItemNum = _this$state.maxItemNum,
|
|
79
|
+
itemHeight = _this$state.itemHeight;
|
|
85
80
|
if (highlightIndex > 0) {
|
|
86
81
|
this.setState({
|
|
87
82
|
highlightIndex: highlightIndex - 1
|
|
@@ -101,11 +96,10 @@ class PCCollaboratorEditor extends _react.default.Component {
|
|
|
101
96
|
this.onDownArrow = e => {
|
|
102
97
|
e.preventDefault();
|
|
103
98
|
e.stopPropagation();
|
|
104
|
-
let
|
|
105
|
-
highlightIndex,
|
|
106
|
-
maxItemNum,
|
|
107
|
-
itemHeight
|
|
108
|
-
} = this.state;
|
|
99
|
+
let _this$state2 = this.state,
|
|
100
|
+
highlightIndex = _this$state2.highlightIndex,
|
|
101
|
+
maxItemNum = _this$state2.maxItemNum,
|
|
102
|
+
itemHeight = _this$state2.itemHeight;
|
|
109
103
|
if (highlightIndex < this.filteredCollaborators.length - 1) {
|
|
110
104
|
this.setState({
|
|
111
105
|
highlightIndex: highlightIndex + 1
|
|
@@ -125,12 +119,11 @@ class PCCollaboratorEditor extends _react.default.Component {
|
|
|
125
119
|
this.onEsc = e => {
|
|
126
120
|
e.preventDefault();
|
|
127
121
|
e.stopPropagation();
|
|
128
|
-
const
|
|
129
|
-
isInModal,
|
|
130
|
-
value,
|
|
131
|
-
onCommitCancel,
|
|
132
|
-
onClose
|
|
133
|
-
} = this.props;
|
|
122
|
+
const _this$props = this.props,
|
|
123
|
+
isInModal = _this$props.isInModal,
|
|
124
|
+
value = _this$props.value,
|
|
125
|
+
onCommitCancel = _this$props.onCommitCancel,
|
|
126
|
+
onClose = _this$props.onClose;
|
|
134
127
|
if (isInModal) {
|
|
135
128
|
onClose && onClose();
|
|
136
129
|
return;
|
|
@@ -172,9 +165,8 @@ class PCCollaboratorEditor extends _react.default.Component {
|
|
|
172
165
|
}
|
|
173
166
|
}
|
|
174
167
|
if (!this.props.isInModal && this.ref) {
|
|
175
|
-
const
|
|
176
|
-
bottom
|
|
177
|
-
} = this.ref.getBoundingClientRect();
|
|
168
|
+
const _this$ref$getBounding = this.ref.getBoundingClientRect(),
|
|
169
|
+
bottom = _this$ref$getBounding.bottom;
|
|
178
170
|
if (bottom > window.innerHeight) {
|
|
179
171
|
this.ref.style.top = "".concat(window.innerHeight - bottom, "px");
|
|
180
172
|
}
|
|
@@ -198,15 +190,14 @@ class PCCollaboratorEditor extends _react.default.Component {
|
|
|
198
190
|
document.removeEventListener('keydown', this.onHotKey, true);
|
|
199
191
|
}
|
|
200
192
|
render() {
|
|
201
|
-
const
|
|
202
|
-
searchValue,
|
|
203
|
-
highlightIndex
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
value = [],
|
|
208
|
-
target
|
|
209
|
-
} = this.props;
|
|
193
|
+
const _this$state3 = this.state,
|
|
194
|
+
searchValue = _this$state3.searchValue,
|
|
195
|
+
highlightIndex = _this$state3.highlightIndex;
|
|
196
|
+
const _this$props2 = this.props,
|
|
197
|
+
isInModal = _this$props2.isInModal,
|
|
198
|
+
_this$props2$value = _this$props2.value,
|
|
199
|
+
value = _this$props2$value === void 0 ? [] : _this$props2$value,
|
|
200
|
+
target = _this$props2.target;
|
|
210
201
|
const dom = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
211
202
|
className: "dtable-ui-editor-container dtable-ui-collaborator-editor-container",
|
|
212
203
|
ref: ref => this.ref = ref,
|
|
@@ -20,12 +20,11 @@ class CollaboratorFormatter extends _react.default.PureComponent {
|
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
22
|
this.getCollaborators = () => {
|
|
23
|
-
let
|
|
24
|
-
value,
|
|
25
|
-
collaborators,
|
|
26
|
-
enableDeleteCollaborator,
|
|
27
|
-
onDeleteCollaborator
|
|
28
|
-
} = this.props;
|
|
23
|
+
let _this$props = this.props,
|
|
24
|
+
value = _this$props.value,
|
|
25
|
+
collaborators = _this$props.collaborators,
|
|
26
|
+
enableDeleteCollaborator = _this$props.enableDeleteCollaborator,
|
|
27
|
+
onDeleteCollaborator = _this$props.onDeleteCollaborator;
|
|
29
28
|
if (!Array.isArray(value)) {
|
|
30
29
|
value = [value];
|
|
31
30
|
}
|
|
@@ -46,10 +45,9 @@ class CollaboratorFormatter extends _react.default.PureComponent {
|
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
47
|
render() {
|
|
49
|
-
const
|
|
50
|
-
containerClassName,
|
|
51
|
-
value
|
|
52
|
-
} = this.props;
|
|
48
|
+
const _this$props2 = this.props,
|
|
49
|
+
containerClassName = _this$props2.containerClassName,
|
|
50
|
+
value = _this$props2.value;
|
|
53
51
|
const classname = (0, _classnames.default)('dtable-ui cell-formatter-container collaborator-formatter', containerClassName);
|
|
54
52
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
55
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -19,11 +19,10 @@ class CollaboratorItem extends _react.default.Component {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
const
|
|
23
|
-
className,
|
|
24
|
-
collaborator,
|
|
25
|
-
enableDeleteCollaborator
|
|
26
|
-
} = this.props;
|
|
22
|
+
const _this$props = this.props,
|
|
23
|
+
className = _this$props.className,
|
|
24
|
+
collaborator = _this$props.collaborator,
|
|
25
|
+
enableDeleteCollaborator = _this$props.enableDeleteCollaborator;
|
|
27
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
28
27
|
title: collaborator.name,
|
|
29
28
|
className: (0, _classnames.default)('dtable-ui collaborator-item', className),
|
|
@@ -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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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", {
|
|
@@ -28,10 +28,9 @@ 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
|
|
34
|
-
} = this.props;
|
|
31
|
+
let _this$props = this.props,
|
|
32
|
+
isScrollBottom = _this$props.isScrollBottom,
|
|
33
|
+
onScrollBottom = _this$props.onScrollBottom;
|
|
35
34
|
this.setState({
|
|
36
35
|
commentContent: commentContent
|
|
37
36
|
});
|
|
@@ -76,15 +75,11 @@ class Comment extends _react.PureComponent {
|
|
|
76
75
|
});
|
|
77
76
|
};
|
|
78
77
|
this.isCommentUserExist = commentItem => {
|
|
79
|
-
const
|
|
80
|
-
collaborators
|
|
81
|
-
} = this.props;
|
|
78
|
+
const collaborators = this.props.collaborators;
|
|
82
79
|
return !!collaborators.find(collaborator => collaborator.email === commentItem.author);
|
|
83
80
|
};
|
|
84
81
|
this.renderInfo = comment => {
|
|
85
|
-
const
|
|
86
|
-
collaborators
|
|
87
|
-
} = this.props;
|
|
82
|
+
const collaborators = this.props.collaborators;
|
|
88
83
|
let authorInfo = Array.isArray(collaborators) && collaborators.find(collaborator => comment.author === collaborator.email);
|
|
89
84
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
90
85
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
@@ -130,14 +125,11 @@ class Comment extends _react.PureComponent {
|
|
|
130
125
|
}
|
|
131
126
|
}
|
|
132
127
|
render() {
|
|
133
|
-
const
|
|
134
|
-
comment,
|
|
135
|
-
onResolve,
|
|
136
|
-
onDelete
|
|
137
|
-
|
|
138
|
-
const {
|
|
139
|
-
username
|
|
140
|
-
} = 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;
|
|
141
133
|
const moreOperationsText = (0, _lang.getLocale)('More_operations');
|
|
142
134
|
if (!this.isCommentUserExist(comment)) return null;
|
|
143
135
|
const isShowDropdownMenu = comment.author === username || !comment.resolved;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
310
|
-
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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' : ''),
|
|
@@ -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,
|
|
@@ -11,9 +11,7 @@ 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
|
|
15
|
-
participant
|
|
16
|
-
} = _ref;
|
|
14
|
+
let participant = _ref.participant;
|
|
17
15
|
const ref = (0, _react.useRef)(null);
|
|
18
16
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
19
17
|
className: "dtable-ui-participant-avatar",
|
|
@@ -32,18 +32,12 @@ class ParticipantSelect extends _react.Component {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
this.getFilteredParticipants = () => {
|
|
35
|
-
let
|
|
36
|
-
|
|
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,9 +71,7 @@ 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 => {
|
|
@@ -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, {
|