dtable-ui-component 7.0.13 → 7.0.15
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 +58 -49
- package/lib/ActivityIndicator/index.js +17 -16
- package/lib/AsyncUserSelect/index.js +20 -46
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +27 -29
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +16 -13
- 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 +17 -14
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +35 -26
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +8 -10
- package/lib/Comment/body/comment.js +19 -11
- package/lib/Comment/body/index.js +8 -8
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +21 -10
- package/lib/Comment/footer/input/index.js +55 -34
- package/lib/Comment/footer/input/participant/index.js +6 -5
- 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 +26 -10
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +22 -16
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +26 -28
- package/lib/DTableColorPicker/index.js +53 -67
- package/lib/DTableColorPicker/utils.js +7 -5
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +10 -8
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeSearchInput/index.js +41 -26
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +28 -24
- package/lib/DTableDropdownMenu/index.js +17 -14
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +42 -27
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +114 -64
- 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 +57 -36
- package/lib/DTableFiltersPopover/widgets/filter-item.js +165 -106
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +162 -137
- package/lib/DTableFiltersPopover/widgets/rate-item.js +25 -20
- package/lib/DTableIcon/index.js +11 -10
- package/lib/DTableIcon/svg-icon.js +11 -9
- package/lib/DTableModalHeader/index.js +7 -7
- package/lib/DTablePopover/index.js +16 -12
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +20 -11
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +6 -7
- package/lib/DTableSelect/index.js +26 -25
- package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
- package/lib/DTableSelect/utils.js +83 -47
- package/lib/DTableSubDropdownMenu/index.js +16 -12
- package/lib/DTableSubDropdownToggle/index.js +16 -17
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +12 -11
- package/lib/DateEditor/index.js +28 -30
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +46 -27
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +7 -5
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +26 -28
- package/lib/DepartmentSelectFilter/index.js +13 -8
- package/lib/DepartmentSingleSelectEditor/index.js +16 -13
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +49 -50
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +64 -42
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +16 -13
- package/lib/DigitalSignEditor/mb-editor/index.js +24 -16
- package/lib/DigitalSignEditor/pc-editor/index.js +31 -23
- package/lib/DigitalSignEditor/service.js +5 -3
- package/lib/DigitalSignEditor/signature-board/index.js +10 -7
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +6 -5
- package/lib/Drawer/index.js +3 -2
- 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 +13 -13
- package/lib/FieldDisplaySetting/index.js +20 -20
- package/lib/FileEditor/files-previewer/index.js +16 -13
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +20 -12
- 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 +24 -17
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +16 -13
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +4 -2
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +31 -17
- package/lib/FileEditor/pc-editor/index.js +30 -22
- package/lib/FileFormatter/index.js +20 -27
- package/lib/FileItemFormatter/index.js +10 -7
- package/lib/FileUploader/index.js +46 -29
- package/lib/FormulaFormatter/index.js +44 -24
- package/lib/GeolocationEditor/index.js +32 -27
- package/lib/GeolocationEditor/map-editor-utils.js +23 -21
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +28 -22
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +77 -47
- 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 +25 -12
- package/lib/GeolocationEditor/pc-editor/index.js +41 -27
- package/lib/GeolocationEditor/pc-editor/location-editor.js +33 -28
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +67 -43
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +69 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +86 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +85 -39
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +26 -20
- package/lib/GeolocationEditor/pc-editor/province-editor.js +15 -8
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +8 -7
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +13 -5
- package/lib/Icon/index.js +13 -15
- package/lib/Icon/load-sprite.js +13 -2
- package/lib/IconButton/index.js +12 -13
- package/lib/ImageEditor/images-previewer/image-preview/index.js +22 -13
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +16 -13
- 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 +5 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +26 -12
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +10 -4
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +14 -12
- package/lib/ImagePreviewerLightbox/index.js +15 -19
- package/lib/ImageThumbnail/index.js +15 -12
- package/lib/InputItem/custom-input.js +55 -35
- package/lib/InputItem/custom-keyboard.js +42 -42
- package/lib/InputItem/index.js +82 -63
- package/lib/InputItem/input.js +9 -11
- 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 +13 -7
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +17 -19
- package/lib/List/list-item.js +59 -55
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +9 -8
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +6 -4
- package/lib/MobileFullScreenPage/header/index.js +10 -8
- package/lib/MobileFullScreenPage/index.js +12 -14
- package/lib/MobileModal/index.js +7 -8
- 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.css +0 -4
- 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/alert.js +2 -2
- package/lib/Modal/modal.js +28 -30
- package/lib/Modal/prompt.js +14 -14
- package/lib/MultipleSelectEditor/index.js +7 -7
- package/lib/MultipleSelectFormatter/index.js +9 -7
- 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 +5 -3
- package/lib/Picker/AbstractPicker.js +35 -33
- package/lib/Popover/index.js +9 -11
- package/lib/Popover/item.js +22 -24
- package/lib/Progress/index.js +18 -17
- package/lib/Radio/Radio.js +17 -15
- package/lib/Radio/RadioItem.js +23 -19
- package/lib/RateFormatter/index.js +15 -15
- package/lib/RoleStatusEditor/index.js +18 -19
- package/lib/RowExpand/index.js +7 -6
- package/lib/RowExpandDialog/body/index.js +57 -40
- package/lib/RowExpandDialog/column-content/index.js +10 -6
- package/lib/RowExpandDialog/header/index.js +12 -9
- package/lib/RowExpandDialog/index.js +59 -63
- package/lib/RowExpandEditor/add-btn/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/index.js +7 -6
- 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/index.js +7 -6
- 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/index.js +7 -6
- 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/index.js +7 -6
- 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/index.js +7 -6
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +38 -24
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +39 -25
- package/lib/RowExpandEditor/duration-editor/index.js +7 -6
- 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/index.js +7 -6
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +20 -10
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +25 -14
- package/lib/RowExpandEditor/file-editor/index.js +7 -6
- 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/index.js +7 -6
- 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/index.js +7 -6
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +26 -16
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +24 -14
- package/lib/RowExpandEditor/index.js +16 -11
- package/lib/RowExpandEditor/long-text-editor/index.js +7 -6
- 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/index.js +7 -6
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +20 -12
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +38 -27
- package/lib/RowExpandEditor/number-editor/index.js +7 -6
- 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/index.js +7 -6
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +26 -13
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +41 -25
- package/lib/RowExpandEditor/single-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +32 -21
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +37 -25
- package/lib/RowExpandEditor/text-editor/index.js +7 -6
- 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/index.js +7 -6
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +15 -7
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +20 -11
- package/lib/RowExpandFormatter/department-formatter/index.js +6 -3
- 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 +8 -5
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +14 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +51 -30
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +10 -9
- package/lib/RowExpandFormatter/index.js +52 -34
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +15 -9
- package/lib/RowExpandFormatter/link-formatter/index.js +25 -17
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +14 -13
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +9 -6
- package/lib/RowExpandView/body/index.js +43 -32
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +52 -53
- package/lib/SelectItem/index.js +7 -5
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +12 -10
- package/lib/SimpleLongTextFormatter/index.js +18 -12
- 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 +7 -7
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +26 -24
- package/lib/TabBar/index.js +28 -24
- package/lib/Tabs/index.js +13 -10
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +53 -48
- package/lib/Toast/index.js +9 -8
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/formatterConfig/index.js +3 -3
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +16 -13
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +47 -32
- package/lib/toaster/alert.js +8 -7
- package/lib/toaster/toast.js +4 -3
- package/lib/toaster/toastManager.js +13 -13
- package/lib/toaster/toaster.js +12 -9
- package/lib/utils/cell.js +11 -8
- package/lib/utils/class.js +3 -3
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +6 -5
- package/lib/utils/getLocale.js +11 -5
- package/lib/utils/object-utils.js +5 -4
- package/lib/utils/url.js +29 -22
- package/lib/utils/utils.js +6 -2
- package/package.json +2 -2
|
@@ -1,12 +1,11 @@
|
|
|
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _reactstrap = require("reactstrap");
|
|
12
11
|
var _lang = require("../../lang");
|
|
@@ -15,12 +14,14 @@ var _IconButton = _interopRequireDefault(require("../../IconButton"));
|
|
|
15
14
|
require("./index.css");
|
|
16
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
16
|
const Header = _ref => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
let {
|
|
18
|
+
title,
|
|
19
|
+
columns,
|
|
20
|
+
row,
|
|
21
|
+
onToggle,
|
|
22
|
+
copyURL,
|
|
23
|
+
children
|
|
24
|
+
} = _ref;
|
|
24
25
|
const renderTitle = (0, _react.useCallback)(() => {
|
|
25
26
|
const props = {
|
|
26
27
|
columns,
|
|
@@ -28,7 +29,9 @@ const Header = _ref => {
|
|
|
28
29
|
};
|
|
29
30
|
const CustomTitle = title;
|
|
30
31
|
if (/*#__PURE__*/_react.default.isValidElement(CustomTitle)) return /*#__PURE__*/_react.default.cloneElement(CustomTitle, props);
|
|
31
|
-
if ((0, _utils.isFunction)(CustomTitle)) return /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomTitle,
|
|
32
|
+
if ((0, _utils.isFunction)(CustomTitle)) return /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomTitle, {
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
32
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
33
36
|
className: "dtable-ui-row-expand-header-title text-truncate",
|
|
34
37
|
children: title
|
|
@@ -6,9 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
11
|
var _reactstrap = require("reactstrap");
|
|
@@ -21,50 +18,32 @@ var _lang = require("../lang");
|
|
|
21
18
|
var _cellComparer = require("../utils/cell-comparer");
|
|
22
19
|
require("./index.css");
|
|
23
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
const _excluded = ["saveImmediately", "readonly", "isInsertingRow", "zIndex", "title", "className", "valueKey", "layout", "row", "columns", "commit", "onToggle", "uploadFile", "copyURL", "children"];
|
|
25
21
|
const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
26
|
-
let
|
|
27
|
-
saveImmediately =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setAnimationEnd = _useState2[1];
|
|
52
|
-
const _useState3 = (0, _react.useState)(true),
|
|
53
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
54
|
-
isLoading = _useState4[0],
|
|
55
|
-
setLoading = _useState4[1];
|
|
56
|
-
const _useState5 = (0, _react.useState)(false),
|
|
57
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
58
|
-
isSaving = _useState6[0],
|
|
59
|
-
setSaving = _useState6[1];
|
|
60
|
-
const _useState7 = (0, _react.useState)({}),
|
|
61
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
62
|
-
row = _useState8[0],
|
|
63
|
-
setRow = _useState8[1];
|
|
64
|
-
const _useState9 = (0, _react.useState)([]),
|
|
65
|
-
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
66
|
-
columns = _useState0[0],
|
|
67
|
-
setColumns = _useState0[1];
|
|
22
|
+
let {
|
|
23
|
+
saveImmediately = true,
|
|
24
|
+
readonly = false,
|
|
25
|
+
isInsertingRow = false,
|
|
26
|
+
zIndex,
|
|
27
|
+
title,
|
|
28
|
+
className,
|
|
29
|
+
valueKey = 'name',
|
|
30
|
+
// name or key
|
|
31
|
+
layout = 'horizontal',
|
|
32
|
+
// horizontal or vertical
|
|
33
|
+
row: defaultRow,
|
|
34
|
+
columns: defaultColumns,
|
|
35
|
+
commit,
|
|
36
|
+
onToggle,
|
|
37
|
+
uploadFile,
|
|
38
|
+
copyURL,
|
|
39
|
+
children = [],
|
|
40
|
+
...otherProps
|
|
41
|
+
} = _ref;
|
|
42
|
+
const [isAnimationEnd, setAnimationEnd] = (0, _react.useState)(false);
|
|
43
|
+
const [isLoading, setLoading] = (0, _react.useState)(true);
|
|
44
|
+
const [isSaving, setSaving] = (0, _react.useState)(false);
|
|
45
|
+
const [row, setRow] = (0, _react.useState)({});
|
|
46
|
+
const [columns, setColumns] = (0, _react.useState)([]);
|
|
68
47
|
const modalRef = (0, _react.useRef)(null);
|
|
69
48
|
const isChangedRef = (0, _react.useRef)(false);
|
|
70
49
|
const update = (0, _react.useRef)({});
|
|
@@ -99,7 +78,8 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
99
78
|
const initRowData = (0, _react.useCallback)(() => {
|
|
100
79
|
setLoading(true);
|
|
101
80
|
setRow(defaultRow);
|
|
102
|
-
let validColumns = defaultColumns.map(c => (
|
|
81
|
+
let validColumns = defaultColumns.map(c => ({
|
|
82
|
+
...c,
|
|
103
83
|
editable: checkEditable(c, defaultRow),
|
|
104
84
|
width: 320
|
|
105
85
|
}));
|
|
@@ -115,9 +95,10 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
115
95
|
onToggle();
|
|
116
96
|
}, [isSaving, onToggle]);
|
|
117
97
|
const onSave = (0, _react.useCallback)(function (updated) {
|
|
118
|
-
let
|
|
119
|
-
successCallback
|
|
120
|
-
failCallback
|
|
98
|
+
let {
|
|
99
|
+
successCallback,
|
|
100
|
+
failCallback
|
|
101
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
121
102
|
commit(updated, columns, {
|
|
122
103
|
successCallback,
|
|
123
104
|
failCallback
|
|
@@ -132,15 +113,24 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
132
113
|
if (!(0, _cellComparer.isCellValueChanged)(oldValue, value, column.type)) return;
|
|
133
114
|
if (!saveImmediately || isInsertingRow) {
|
|
134
115
|
isChangedRef.current = true;
|
|
135
|
-
update.current =
|
|
136
|
-
|
|
116
|
+
update.current = {
|
|
117
|
+
...update.current,
|
|
118
|
+
...updated
|
|
119
|
+
};
|
|
120
|
+
setRow({
|
|
121
|
+
...row,
|
|
122
|
+
...updated
|
|
123
|
+
});
|
|
137
124
|
return;
|
|
138
125
|
}
|
|
139
126
|
onSave(updated, {
|
|
140
127
|
successCallback: () => {
|
|
141
128
|
isChangedRef.current = false;
|
|
142
129
|
update.current = {};
|
|
143
|
-
setRow(
|
|
130
|
+
setRow({
|
|
131
|
+
...row,
|
|
132
|
+
...updated
|
|
133
|
+
});
|
|
144
134
|
},
|
|
145
135
|
failCallback: () => {
|
|
146
136
|
_toaster.default.danger((0, _lang.getLocale)('Save_failed'));
|
|
@@ -158,7 +148,10 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
158
148
|
setSaving(false);
|
|
159
149
|
_toaster.default.danger((0, _lang.getLocale)('Save_failed'));
|
|
160
150
|
};
|
|
161
|
-
const newRow = isInsertingRow ?
|
|
151
|
+
const newRow = isInsertingRow ? {
|
|
152
|
+
...row,
|
|
153
|
+
...update.current
|
|
154
|
+
} : update.current;
|
|
162
155
|
onSave(newRow, {
|
|
163
156
|
successCallback,
|
|
164
157
|
failCallback
|
|
@@ -168,13 +161,15 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
168
161
|
// use setTimeout to make sure real dom rendered
|
|
169
162
|
setTimeout(() => {
|
|
170
163
|
let dom = modalRef.current.firstChild;
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
dom.style.
|
|
164
|
+
const {
|
|
165
|
+
width,
|
|
166
|
+
maxWidth,
|
|
167
|
+
marginLeft,
|
|
168
|
+
height
|
|
169
|
+
} = style;
|
|
170
|
+
dom.style.width = `${width}px`;
|
|
171
|
+
dom.style.maxWidth = `${maxWidth}px`;
|
|
172
|
+
dom.style.marginLeft = `${marginLeft}px`;
|
|
178
173
|
dom.style.height = height;
|
|
179
174
|
dom.style.marginRight = 'unset';
|
|
180
175
|
dom.style.marginTop = '28px';
|
|
@@ -228,7 +223,8 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
228
223
|
copyURL: copyURL,
|
|
229
224
|
onToggle: toggle,
|
|
230
225
|
children: children[0]
|
|
231
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_body.default,
|
|
226
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_body.default, {
|
|
227
|
+
...otherProps,
|
|
232
228
|
row: row,
|
|
233
229
|
columns: columns,
|
|
234
230
|
valueKey: valueKey,
|
|
@@ -236,7 +232,7 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
236
232
|
uploadFile: uploadFile,
|
|
237
233
|
onToggle: onToggle,
|
|
238
234
|
children: children[1]
|
|
239
|
-
})
|
|
235
|
+
}), (!saveImmediately || isInsertingRow) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.ModalFooter, {
|
|
240
236
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
|
|
241
237
|
onClick: toggle,
|
|
242
238
|
color: "secondary",
|
|
@@ -1,12 +1,11 @@
|
|
|
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
12
11
|
var _pcAddBtn = _interopRequireDefault(require("./pc-add-btn"));
|
|
@@ -16,14 +15,16 @@ const RowExpandAddBtn = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
16
15
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
17
16
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
18
17
|
query: "(min-width: 768px)",
|
|
19
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcAddBtn.default,
|
|
18
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcAddBtn.default, {
|
|
19
|
+
...props,
|
|
20
20
|
ref: ref
|
|
21
|
-
})
|
|
21
|
+
})
|
|
22
22
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
23
23
|
query: "(max-width: 768px)",
|
|
24
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbAddBtn.default,
|
|
24
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbAddBtn.default, {
|
|
25
|
+
...props,
|
|
25
26
|
ref: ref
|
|
26
|
-
})
|
|
27
|
+
})
|
|
27
28
|
})]
|
|
28
29
|
});
|
|
29
30
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
12
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
@@ -17,14 +16,16 @@ const RowExpandCheckboxEditor = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
17
16
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
18
17
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
19
18
|
query: "(min-width: 768px)",
|
|
20
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
19
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
20
|
+
...props,
|
|
21
21
|
ref: ref
|
|
22
|
-
})
|
|
22
|
+
})
|
|
23
23
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
24
24
|
query: "(max-width: 768px)",
|
|
25
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
25
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
26
|
+
...props,
|
|
26
27
|
ref: ref
|
|
27
|
-
})
|
|
28
|
+
})
|
|
28
29
|
})]
|
|
29
30
|
});
|
|
30
31
|
});
|
|
@@ -19,10 +19,11 @@ class RowExpandMBCheckboxEditor extends _react.default.Component {
|
|
|
19
19
|
this.editor = null;
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
const
|
|
23
|
-
column
|
|
24
|
-
value
|
|
25
|
-
className
|
|
22
|
+
const {
|
|
23
|
+
column,
|
|
24
|
+
value,
|
|
25
|
+
className
|
|
26
|
+
} = this.props;
|
|
26
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
27
28
|
className: (0, _classnames.default)('dtable-ui-mobile-row-expand-checkbox-editor-container', className),
|
|
28
29
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxEditor.default, {
|
|
@@ -13,19 +13,21 @@ class RowExpandPCCheckboxEditor extends _react.default.Component {
|
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.onCommit = newValue => {
|
|
16
|
-
const
|
|
17
|
-
columnIndex
|
|
18
|
-
updateTabIndex
|
|
19
|
-
onCommit
|
|
16
|
+
const {
|
|
17
|
+
columnIndex,
|
|
18
|
+
updateTabIndex,
|
|
19
|
+
onCommit
|
|
20
|
+
} = this.props;
|
|
20
21
|
updateTabIndex && updateTabIndex(columnIndex);
|
|
21
22
|
onCommit && onCommit(newValue);
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
render() {
|
|
25
|
-
const
|
|
26
|
-
isEditorFocus
|
|
27
|
-
column
|
|
28
|
-
value
|
|
26
|
+
const {
|
|
27
|
+
isEditorFocus,
|
|
28
|
+
column,
|
|
29
|
+
value
|
|
30
|
+
} = this.props;
|
|
29
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxEditor.default, {
|
|
30
32
|
className: "dtable-ui-row-expand-checkbox-editor mt-2",
|
|
31
33
|
column: column,
|
|
@@ -1,12 +1,11 @@
|
|
|
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
12
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
@@ -16,14 +15,16 @@ const RowExpandCollaboratorEditor = /*#__PURE__*/(0, _react.forwardRef)((props,
|
|
|
16
15
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
17
16
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
18
17
|
query: "(min-width: 768px)",
|
|
19
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
18
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
19
|
+
...props,
|
|
20
20
|
ref: ref
|
|
21
|
-
})
|
|
21
|
+
})
|
|
22
22
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
23
23
|
query: "(max-width: 768px)",
|
|
24
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
24
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
25
|
+
...props,
|
|
25
26
|
ref: ref
|
|
26
|
-
})
|
|
27
|
+
})
|
|
27
28
|
})]
|
|
28
29
|
});
|
|
29
30
|
});
|
|
@@ -17,16 +17,19 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
17
17
|
constructor(_props) {
|
|
18
18
|
super(_props);
|
|
19
19
|
this.initCollaborators = props => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const {
|
|
21
|
+
row,
|
|
22
|
+
column,
|
|
23
|
+
valueKey
|
|
24
|
+
} = props;
|
|
23
25
|
const emails = row[column[valueKey]] || [];
|
|
24
26
|
props.queryCollaborators && props.queryCollaborators(emails);
|
|
25
27
|
};
|
|
26
28
|
this.getCollaborators = () => {
|
|
27
|
-
const
|
|
28
|
-
getCollaborators
|
|
29
|
-
collaborators
|
|
29
|
+
const {
|
|
30
|
+
getCollaborators,
|
|
31
|
+
collaborators
|
|
32
|
+
} = this.props;
|
|
30
33
|
if (getCollaborators) return getCollaborators();
|
|
31
34
|
return collaborators || [];
|
|
32
35
|
};
|
|
@@ -66,13 +69,16 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
66
69
|
this.props.onCommit(newValue);
|
|
67
70
|
};
|
|
68
71
|
this.renderCollaborators = value => {
|
|
69
|
-
const
|
|
72
|
+
const {
|
|
73
|
+
emailCollaboratorMap
|
|
74
|
+
} = this.state;
|
|
70
75
|
if (Array.isArray(value) && value.length > 0) {
|
|
71
76
|
return value.map((email, index) => {
|
|
72
77
|
let collaborator = emailCollaboratorMap[email];
|
|
73
78
|
if (collaborator) {
|
|
74
|
-
const
|
|
75
|
-
email
|
|
79
|
+
const {
|
|
80
|
+
email
|
|
81
|
+
} = collaborator;
|
|
76
82
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollaboratorItem.default, {
|
|
77
83
|
collaborator: collaborator
|
|
78
84
|
}, email);
|
|
@@ -92,10 +98,11 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
92
98
|
text: (0, _lang.getLocale)('Add_collaborator')
|
|
93
99
|
});
|
|
94
100
|
};
|
|
95
|
-
const
|
|
96
|
-
_row
|
|
97
|
-
_column
|
|
98
|
-
_valueKey
|
|
101
|
+
const {
|
|
102
|
+
row: _row,
|
|
103
|
+
column: _column,
|
|
104
|
+
valueKey: _valueKey
|
|
105
|
+
} = this.props;
|
|
99
106
|
this.state = {
|
|
100
107
|
menuPosition: null,
|
|
101
108
|
value: _row[_column[_valueKey]] || [],
|
|
@@ -113,9 +120,11 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
113
120
|
}
|
|
114
121
|
}
|
|
115
122
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
const {
|
|
124
|
+
column,
|
|
125
|
+
row,
|
|
126
|
+
valueKey
|
|
127
|
+
} = nextProps;
|
|
119
128
|
if (row._id !== this.props.row._id) {
|
|
120
129
|
this.initCollaborators(nextProps);
|
|
121
130
|
this.setState({
|
|
@@ -130,12 +139,14 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
130
139
|
}
|
|
131
140
|
}
|
|
132
141
|
render() {
|
|
133
|
-
const
|
|
134
|
-
collaborators
|
|
135
|
-
column
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
142
|
+
const {
|
|
143
|
+
collaborators,
|
|
144
|
+
column
|
|
145
|
+
} = this.props;
|
|
146
|
+
const {
|
|
147
|
+
showEditor,
|
|
148
|
+
value
|
|
149
|
+
} = this.state;
|
|
139
150
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
140
151
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
141
152
|
className: "dtable-ui dtable-ui-mobile-row-expand-collaborators position-relative",
|
|
@@ -17,16 +17,19 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
17
17
|
constructor(_props) {
|
|
18
18
|
super(_props);
|
|
19
19
|
this.initCollaborators = props => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const {
|
|
21
|
+
row,
|
|
22
|
+
column,
|
|
23
|
+
valueKey
|
|
24
|
+
} = props;
|
|
23
25
|
const emails = row[column[valueKey]] || [];
|
|
24
26
|
props.queryCollaborators && props.queryCollaborators(emails);
|
|
25
27
|
};
|
|
26
28
|
this.getCollaborators = () => {
|
|
27
|
-
const
|
|
28
|
-
getCollaborators
|
|
29
|
-
collaborators
|
|
29
|
+
const {
|
|
30
|
+
getCollaborators,
|
|
31
|
+
collaborators
|
|
32
|
+
} = this.props;
|
|
30
33
|
if (getCollaborators) return getCollaborators();
|
|
31
34
|
return collaborators || [];
|
|
32
35
|
};
|
|
@@ -87,7 +90,9 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
87
90
|
this.props.onCommit(newValue);
|
|
88
91
|
};
|
|
89
92
|
this.removeCollaborator = index => {
|
|
90
|
-
let
|
|
93
|
+
let {
|
|
94
|
+
value
|
|
95
|
+
} = this.state;
|
|
91
96
|
let newValue = value.slice(0);
|
|
92
97
|
newValue.splice(index, 1);
|
|
93
98
|
this.setState({
|
|
@@ -96,10 +101,13 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
96
101
|
this.props.onCommit(newValue);
|
|
97
102
|
};
|
|
98
103
|
this.renderSelectedCollaborators = () => {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
const {
|
|
105
|
+
isEditorFocus
|
|
106
|
+
} = this.props;
|
|
107
|
+
const {
|
|
108
|
+
value,
|
|
109
|
+
emailCollaboratorMap
|
|
110
|
+
} = this.state;
|
|
103
111
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
104
112
|
tabIndex: 0,
|
|
105
113
|
onFocus: this.onFocus,
|
|
@@ -116,8 +124,9 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
116
124
|
children: value.map((email, index) => {
|
|
117
125
|
let collaborator = emailCollaboratorMap[email];
|
|
118
126
|
if (collaborator) {
|
|
119
|
-
const
|
|
120
|
-
email
|
|
127
|
+
const {
|
|
128
|
+
email
|
|
129
|
+
} = collaborator;
|
|
121
130
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollaboratorItem.default, {
|
|
122
131
|
collaborator: collaborator,
|
|
123
132
|
enableDeleteCollaborator: true,
|
|
@@ -144,10 +153,11 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
144
153
|
})
|
|
145
154
|
});
|
|
146
155
|
};
|
|
147
|
-
const
|
|
148
|
-
_row
|
|
149
|
-
_column
|
|
150
|
-
_valueKey
|
|
156
|
+
const {
|
|
157
|
+
row: _row,
|
|
158
|
+
column: _column,
|
|
159
|
+
valueKey: _valueKey
|
|
160
|
+
} = this.props;
|
|
151
161
|
this.state = {
|
|
152
162
|
menuPosition: null,
|
|
153
163
|
value: _row[_column[_valueKey]] || [],
|
|
@@ -167,9 +177,11 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
167
177
|
}
|
|
168
178
|
}
|
|
169
179
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
180
|
+
const {
|
|
181
|
+
column,
|
|
182
|
+
row,
|
|
183
|
+
valueKey
|
|
184
|
+
} = nextProps;
|
|
173
185
|
if (row._id !== this.props.row._id) {
|
|
174
186
|
this.initCollaborators(nextProps);
|
|
175
187
|
this.setState({
|
|
@@ -196,12 +208,14 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
196
208
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
197
209
|
}
|
|
198
210
|
render() {
|
|
199
|
-
const
|
|
200
|
-
collaborators
|
|
201
|
-
column
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
211
|
+
const {
|
|
212
|
+
collaborators,
|
|
213
|
+
column
|
|
214
|
+
} = this.props;
|
|
215
|
+
const {
|
|
216
|
+
showCollaboratorSelect,
|
|
217
|
+
value
|
|
218
|
+
} = this.state;
|
|
205
219
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
206
220
|
className: "position-relative mt-1 w-100",
|
|
207
221
|
ref: ref => this.collaboratorSelectRef = ref,
|
|
@@ -1,12 +1,11 @@
|
|
|
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
12
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
@@ -16,14 +15,16 @@ const RowExpandDateEditor = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
16
15
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
17
16
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
18
17
|
query: "(min-width: 768px)",
|
|
19
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
18
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
19
|
+
...props,
|
|
20
20
|
ref: ref
|
|
21
|
-
})
|
|
21
|
+
})
|
|
22
22
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
23
23
|
query: "(max-width: 768px)",
|
|
24
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
24
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
25
|
+
...props,
|
|
25
26
|
ref: ref
|
|
26
|
-
})
|
|
27
|
+
})
|
|
27
28
|
})]
|
|
28
29
|
});
|
|
29
30
|
});
|