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
|
@@ -6,34 +6,37 @@ 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 _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
13
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
14
12
|
var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
15
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["isMobile"];
|
|
17
14
|
const DepartmentSingleSelectEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
let {
|
|
16
|
+
isMobile,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
19
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
20
|
+
...props,
|
|
21
21
|
ref: ref
|
|
22
|
-
})
|
|
23
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
22
|
+
});
|
|
23
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
24
|
+
...props,
|
|
24
25
|
ref: ref
|
|
25
|
-
})
|
|
26
|
+
});
|
|
26
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
27
28
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
28
29
|
query: '(min-width: 768px)',
|
|
29
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
31
|
+
...props,
|
|
30
32
|
ref: ref
|
|
31
|
-
})
|
|
33
|
+
})
|
|
32
34
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
33
35
|
query: '(max-width: 768px)',
|
|
34
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
36
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
37
|
+
...props,
|
|
35
38
|
ref: ref
|
|
36
|
-
})
|
|
39
|
+
})
|
|
37
40
|
})]
|
|
38
41
|
});
|
|
39
42
|
});
|
|
@@ -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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _dtableUtils = require("dtable-utils");
|
|
12
11
|
var _List = _interopRequireDefault(require("../../List"));
|
|
@@ -18,37 +17,25 @@ var _lang = require("../../lang");
|
|
|
18
17
|
require("./index.css");
|
|
19
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
19
|
const Item = _List.default.Item;
|
|
21
|
-
const
|
|
22
|
-
|
|
20
|
+
const {
|
|
21
|
+
Header,
|
|
22
|
+
Body
|
|
23
|
+
} = _MobileFullScreenPage.default;
|
|
23
24
|
const MBDepartmentSingleSelectEditor = _ref => {
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
isSupportMultiple =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
value = _useState2[0],
|
|
39
|
-
setValue = _useState2[1];
|
|
40
|
-
const _useState3 = (0, _react.useState)([]),
|
|
41
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
42
|
-
departments = _useState4[0],
|
|
43
|
-
setDepartments = _useState4[1];
|
|
44
|
-
const _useState5 = (0, _react.useState)(''),
|
|
45
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
46
|
-
parentId = _useState6[0],
|
|
47
|
-
setParentId = _useState6[1];
|
|
48
|
-
const _useState7 = (0, _react.useState)([]),
|
|
49
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
50
|
-
topParentIds = _useState8[0],
|
|
51
|
-
setTopParentIds = _useState8[1];
|
|
25
|
+
let {
|
|
26
|
+
value: oldValue,
|
|
27
|
+
column,
|
|
28
|
+
isSupportMultiple = false,
|
|
29
|
+
isFilterEditor = false,
|
|
30
|
+
userDepartmentIdsMap = {},
|
|
31
|
+
departments: initialDepartments = [],
|
|
32
|
+
onCommit,
|
|
33
|
+
onClose
|
|
34
|
+
} = _ref;
|
|
35
|
+
const [value, setValue] = (0, _react.useState)(oldValue ? oldValue : isSupportMultiple ? [] : '');
|
|
36
|
+
const [departments, setDepartments] = (0, _react.useState)([]);
|
|
37
|
+
const [parentId, setParentId] = (0, _react.useState)('');
|
|
38
|
+
const [topParentIds, setTopParentIds] = (0, _react.useState)([]);
|
|
52
39
|
const initColumnData = (0, _react.useMemo)(() => {
|
|
53
40
|
const data = column.data || {};
|
|
54
41
|
const enableSelectRange = data.enable_select_range || false;
|
|
@@ -66,8 +53,10 @@ const MBDepartmentSingleSelectEditor = _ref => {
|
|
|
66
53
|
}, [isFilterEditor, value, onCommit, onClose]);
|
|
67
54
|
const onDepartmentClick = (0, _react.useCallback)((event, department) => {
|
|
68
55
|
event.preventDefault();
|
|
69
|
-
const
|
|
70
|
-
|
|
56
|
+
const {
|
|
57
|
+
id,
|
|
58
|
+
hasChild
|
|
59
|
+
} = department;
|
|
71
60
|
if (event.target && event.target.className.indexOf('am-list-arrow') > -1) {
|
|
72
61
|
if (!hasChild) return;
|
|
73
62
|
setParentId(id);
|
|
@@ -111,7 +100,9 @@ const MBDepartmentSingleSelectEditor = _ref => {
|
|
|
111
100
|
onClose && onClose();
|
|
112
101
|
return;
|
|
113
102
|
}
|
|
114
|
-
const
|
|
103
|
+
const {
|
|
104
|
+
enableSelectRange
|
|
105
|
+
} = initColumnData;
|
|
115
106
|
if (topParentIds.includes(parentId) && enableSelectRange) {
|
|
116
107
|
setParentId('');
|
|
117
108
|
return;
|
|
@@ -128,7 +119,9 @@ const MBDepartmentSingleSelectEditor = _ref => {
|
|
|
128
119
|
});
|
|
129
120
|
}, [isFilterEditor, departments, parentId]);
|
|
130
121
|
const renderDepartments = (0, _react.useCallback)(() => {
|
|
131
|
-
const
|
|
122
|
+
const {
|
|
123
|
+
enableSelectRange
|
|
124
|
+
} = initColumnData;
|
|
132
125
|
let currentDepartments = [];
|
|
133
126
|
if (enableSelectRange && !parentId && !isFilterEditor) {
|
|
134
127
|
currentDepartments = departments.filter(department => topParentIds.includes(department.id));
|
|
@@ -148,8 +141,10 @@ const MBDepartmentSingleSelectEditor = _ref => {
|
|
|
148
141
|
renderHeader: () => (0, _lang.getLocale)('Select_department'),
|
|
149
142
|
children: [isFilterEditor && parentId === -1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
150
143
|
children: _departments2.DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map((option, index) => {
|
|
151
|
-
const
|
|
152
|
-
|
|
144
|
+
const {
|
|
145
|
+
type,
|
|
146
|
+
name
|
|
147
|
+
} = option;
|
|
153
148
|
const isChecked = isSupportMultiple ? value.includes(type) : value === type;
|
|
154
149
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Item, {
|
|
155
150
|
multipleLine: true,
|
|
@@ -163,12 +158,14 @@ const MBDepartmentSingleSelectEditor = _ref => {
|
|
|
163
158
|
label: (0, _lang.getLocale)(name)
|
|
164
159
|
})
|
|
165
160
|
})
|
|
166
|
-
},
|
|
161
|
+
}, `department-range-item-${index}`);
|
|
167
162
|
})
|
|
168
163
|
}), currentDepartments.map((department, index) => {
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
const {
|
|
165
|
+
hasChild,
|
|
166
|
+
name,
|
|
167
|
+
id
|
|
168
|
+
} = department;
|
|
172
169
|
const isChecked = isSupportMultiple ? value.includes(id) : value === id;
|
|
173
170
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Item, {
|
|
174
171
|
arrow: hasChild ? 'horizontal' : '',
|
|
@@ -183,19 +180,21 @@ const MBDepartmentSingleSelectEditor = _ref => {
|
|
|
183
180
|
label: name
|
|
184
181
|
})
|
|
185
182
|
})
|
|
186
|
-
},
|
|
183
|
+
}, `department-item-${index}`);
|
|
187
184
|
})]
|
|
188
185
|
});
|
|
189
186
|
}, [initColumnData, parentId, isFilterEditor, isSupportMultiple, departments, value, topParentIds, onParentDepartmentClick, onDepartmentClick]);
|
|
190
187
|
(0, _react.useEffect)(() => {
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
const {
|
|
189
|
+
enableSelectRange,
|
|
190
|
+
selectedRange,
|
|
191
|
+
specificDepartments
|
|
192
|
+
} = initColumnData;
|
|
194
193
|
if (enableSelectRange && !isFilterEditor) {
|
|
195
|
-
const
|
|
196
|
-
current_user_department_ids =
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
const {
|
|
195
|
+
current_user_department_ids = [],
|
|
196
|
+
current_user_department_and_sub_ids = []
|
|
197
|
+
} = userDepartmentIdsMap;
|
|
199
198
|
let targetDepartments = [];
|
|
200
199
|
let topParentIds = [];
|
|
201
200
|
let canExpand = true;
|
|
@@ -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 _dtableUtils = require("dtable-utils");
|
|
12
11
|
var _Loading = _interopRequireDefault(require("../../Loading"));
|
|
@@ -21,8 +20,9 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
21
20
|
_this = this;
|
|
22
21
|
this.resetMenuStyle = () => {
|
|
23
22
|
if (!this.departmentsRef) return;
|
|
24
|
-
const
|
|
25
|
-
bottom
|
|
23
|
+
const {
|
|
24
|
+
bottom
|
|
25
|
+
} = this.departmentsRef.getBoundingClientRect();
|
|
26
26
|
if (bottom > window.innerHeight) {
|
|
27
27
|
const currentTop = this.departmentsRef.style.top || 0;
|
|
28
28
|
this.departmentsRef.style.top = parseInt(currentTop) - bottom + window.innerHeight + 'px';
|
|
@@ -37,14 +37,14 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
37
37
|
};
|
|
38
38
|
this.initRangeDepartments = function (userDepartmentIdsMap) {
|
|
39
39
|
let departments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
40
|
-
const
|
|
41
|
-
selectedRange
|
|
42
|
-
specificDepartments
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
current_user_department_ids =
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
const {
|
|
41
|
+
selectedRange,
|
|
42
|
+
specificDepartments
|
|
43
|
+
} = _this.getSelectedRange();
|
|
44
|
+
const {
|
|
45
|
+
current_user_department_ids = [],
|
|
46
|
+
current_user_department_and_sub_ids = []
|
|
47
|
+
} = userDepartmentIdsMap || {};
|
|
48
48
|
let targetDepartments = [];
|
|
49
49
|
let topParentIds = [];
|
|
50
50
|
if (selectedRange === _dtableUtils.DEPARTMENT_SELECT_RANGE_MAP.CURRENT_USER_DEPARTMENT) {
|
|
@@ -65,7 +65,9 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
67
|
this.getSelectedRange = () => {
|
|
68
|
-
const
|
|
68
|
+
const {
|
|
69
|
+
column
|
|
70
|
+
} = this.props;
|
|
69
71
|
const data = column.data || {};
|
|
70
72
|
const selectedRange = data.selected_range || '';
|
|
71
73
|
const specificDepartments = data.specific_departments || [];
|
|
@@ -86,9 +88,13 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
86
88
|
};
|
|
87
89
|
this.onChangeSearch = event => {
|
|
88
90
|
const newSearchValue = event.target.value;
|
|
89
|
-
const
|
|
91
|
+
const {
|
|
92
|
+
searchVal
|
|
93
|
+
} = this.state;
|
|
90
94
|
if (searchVal === newSearchValue) return;
|
|
91
|
-
const
|
|
95
|
+
const {
|
|
96
|
+
departments
|
|
97
|
+
} = this.state;
|
|
92
98
|
this.validDepartments = (0, _departments.searchDepartments)(departments, newSearchValue);
|
|
93
99
|
this.setState({
|
|
94
100
|
searchVal: newSearchValue
|
|
@@ -97,9 +103,10 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
97
103
|
this.onSelectDepartment = (event, selectedValue) => {
|
|
98
104
|
event.stopPropagation();
|
|
99
105
|
event.nativeEvent.stopImmediatePropagation();
|
|
100
|
-
const
|
|
101
|
-
onCommit
|
|
102
|
-
value
|
|
106
|
+
const {
|
|
107
|
+
onCommit,
|
|
108
|
+
value
|
|
109
|
+
} = this.props;
|
|
103
110
|
const newValue = selectedValue === value ? '' : selectedValue;
|
|
104
111
|
onCommit(newValue);
|
|
105
112
|
};
|
|
@@ -119,19 +126,23 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
119
126
|
});
|
|
120
127
|
};
|
|
121
128
|
this.renderDepartment = (department, subDepartments, level, hasNextLevel) => {
|
|
122
|
-
const
|
|
129
|
+
const {
|
|
130
|
+
value
|
|
131
|
+
} = this.props;
|
|
123
132
|
const newLevel = level + 1;
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
133
|
+
const {
|
|
134
|
+
hasChild,
|
|
135
|
+
isExpanded,
|
|
136
|
+
name,
|
|
137
|
+
id
|
|
138
|
+
} = department;
|
|
128
139
|
const isChecked = value === id;
|
|
129
140
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
130
141
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
131
142
|
className: "department-item",
|
|
132
143
|
onClick: event => this.onSelectDepartment(event, id),
|
|
133
144
|
style: {
|
|
134
|
-
paddingLeft:
|
|
145
|
+
paddingLeft: `${newLevel * 15 + 10}px`
|
|
135
146
|
},
|
|
136
147
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
137
148
|
className: "department-item-left-content d-flex align-items-center",
|
|
@@ -140,7 +151,7 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
140
151
|
role: "button",
|
|
141
152
|
className: "department-item-fold-btn",
|
|
142
153
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
143
|
-
className:
|
|
154
|
+
className: `dtable-font expand dtable-icon-down3 ${isExpanded ? '' : 'rotate-270'}`
|
|
144
155
|
})
|
|
145
156
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
146
157
|
style: {
|
|
@@ -160,7 +171,9 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
160
171
|
}, id);
|
|
161
172
|
};
|
|
162
173
|
this.renderAllDepartments = () => {
|
|
163
|
-
const
|
|
174
|
+
const {
|
|
175
|
+
departments
|
|
176
|
+
} = this.state;
|
|
164
177
|
const topDepartment = departments.find(department => department.parent_id === -1);
|
|
165
178
|
const subDepartments = departments.filter(department => department.parent_id !== -1);
|
|
166
179
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
@@ -168,20 +181,24 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
168
181
|
});
|
|
169
182
|
};
|
|
170
183
|
this.renderSpecificDepartments = () => {
|
|
171
|
-
const
|
|
184
|
+
const {
|
|
185
|
+
departments
|
|
186
|
+
} = this.state;
|
|
172
187
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
173
188
|
children: [this.validDepartments.length === 0 && this.renderEmptyTip(), this.validDepartments.length > 0 && this.validDepartments.map(department => {
|
|
174
|
-
const value =
|
|
189
|
+
const value = {
|
|
190
|
+
...department,
|
|
175
191
|
hasChild: false
|
|
176
|
-
}
|
|
192
|
+
};
|
|
177
193
|
return this.renderDepartment(value, departments, -1, false);
|
|
178
194
|
})]
|
|
179
195
|
});
|
|
180
196
|
};
|
|
181
197
|
this.renderCurrentDepartmentsAndSub = () => {
|
|
182
|
-
const
|
|
183
|
-
departments
|
|
184
|
-
topParentIds
|
|
198
|
+
const {
|
|
199
|
+
departments,
|
|
200
|
+
topParentIds
|
|
201
|
+
} = this.state;
|
|
185
202
|
const nextLevelDepartment = this.validDepartments.find(department => topParentIds.includes(department.parent_id));
|
|
186
203
|
const hasNextLevel = !!nextLevelDepartment;
|
|
187
204
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -199,12 +216,16 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
199
216
|
});
|
|
200
217
|
};
|
|
201
218
|
this.renderMenuContent = () => {
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
219
|
+
const {
|
|
220
|
+
searchVal
|
|
221
|
+
} = this.state;
|
|
222
|
+
const {
|
|
223
|
+
enableSelectRange,
|
|
224
|
+
renderUserDepartmentOptions
|
|
225
|
+
} = this.props;
|
|
226
|
+
const {
|
|
227
|
+
selectedRange
|
|
228
|
+
} = this.getSelectedRange();
|
|
208
229
|
let menuContent = this.renderAllDepartments();
|
|
209
230
|
if (enableSelectRange && [_dtableUtils.DEPARTMENT_SELECT_RANGE_MAP.CURRENT_USER_DEPARTMENT, _dtableUtils.DEPARTMENT_SELECT_RANGE_MAP.SPECIFIC_DEPARTMENTS].includes(selectedRange) || searchVal) {
|
|
210
231
|
menuContent = this.renderSpecificDepartments();
|
|
@@ -230,10 +251,11 @@ class DepartmentSingleSelect extends _react.Component {
|
|
|
230
251
|
setTimeout(() => {
|
|
231
252
|
this.resetMenuStyle();
|
|
232
253
|
}, 1);
|
|
233
|
-
const
|
|
234
|
-
enableSelectRange
|
|
235
|
-
userDepartmentIdsMap
|
|
236
|
-
departments
|
|
254
|
+
const {
|
|
255
|
+
enableSelectRange,
|
|
256
|
+
userDepartmentIdsMap,
|
|
257
|
+
departments
|
|
258
|
+
} = this.props;
|
|
237
259
|
if (enableSelectRange) {
|
|
238
260
|
this.initRangeDepartments(userDepartmentIdsMap, departments);
|
|
239
261
|
} else {
|
|
@@ -15,7 +15,9 @@ class PCDepartmentSingleSelectEditor extends _react.Component {
|
|
|
15
15
|
constructor(props) {
|
|
16
16
|
super(props);
|
|
17
17
|
this.onCommit = value => {
|
|
18
|
-
const
|
|
18
|
+
const {
|
|
19
|
+
onCommit
|
|
20
|
+
} = this.props;
|
|
19
21
|
this.setState({
|
|
20
22
|
value
|
|
21
23
|
}, () => {
|
|
@@ -27,10 +29,12 @@ class PCDepartmentSingleSelectEditor extends _react.Component {
|
|
|
27
29
|
updated[this.props.column.key] = this.state.value;
|
|
28
30
|
return updated;
|
|
29
31
|
};
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const {
|
|
33
|
+
column,
|
|
34
|
+
isInModal,
|
|
35
|
+
value: _value,
|
|
36
|
+
height
|
|
37
|
+
} = props;
|
|
34
38
|
const editorWidth = column.width > 300 ? column.width : 300;
|
|
35
39
|
const data = column.data || {};
|
|
36
40
|
this.state = {
|
|
@@ -46,9 +50,10 @@ class PCDepartmentSingleSelectEditor extends _react.Component {
|
|
|
46
50
|
componentDidMount() {
|
|
47
51
|
if (this.isRowExpand) {
|
|
48
52
|
let menuStyle = {};
|
|
49
|
-
const
|
|
50
|
-
top
|
|
51
|
-
left
|
|
53
|
+
const {
|
|
54
|
+
top,
|
|
55
|
+
left
|
|
56
|
+
} = this.outerRef.getBoundingClientRect();
|
|
52
57
|
if (top > 330) {
|
|
53
58
|
menuStyle.top = -200;
|
|
54
59
|
}
|
|
@@ -61,11 +66,12 @@ class PCDepartmentSingleSelectEditor extends _react.Component {
|
|
|
61
66
|
}
|
|
62
67
|
}
|
|
63
68
|
render() {
|
|
64
|
-
const
|
|
65
|
-
target
|
|
66
|
-
column
|
|
67
|
-
userDepartmentIdsMap
|
|
68
|
-
departments
|
|
69
|
+
const {
|
|
70
|
+
target,
|
|
71
|
+
column,
|
|
72
|
+
userDepartmentIdsMap,
|
|
73
|
+
departments
|
|
74
|
+
} = this.props;
|
|
69
75
|
const dom = /*#__PURE__*/(0, _jsxRuntime.jsx)(_departmentSingleSelect.default, {
|
|
70
76
|
column: column,
|
|
71
77
|
value: this.state.value,
|
|
@@ -11,10 +11,12 @@ var _lang = require("../lang");
|
|
|
11
11
|
require("./index.css");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function DepartmentSingleSelectFormatter(props) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const {
|
|
15
|
+
value,
|
|
16
|
+
departments,
|
|
17
|
+
containerClassName,
|
|
18
|
+
tip
|
|
19
|
+
} = props;
|
|
18
20
|
if (!value || !Array.isArray(departments)) return null;
|
|
19
21
|
const deletedTip = tip || (0, _lang.getLocale)('Deleted_department');
|
|
20
22
|
const department = departments.find(department => department.id === value);
|
|
@@ -6,34 +6,37 @@ 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 _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
13
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
14
12
|
var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
15
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["isMobile"];
|
|
17
14
|
const DigitalSignEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
let {
|
|
16
|
+
isMobile,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
19
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
20
|
+
...props,
|
|
21
21
|
ref: ref
|
|
22
|
-
})
|
|
23
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
22
|
+
});
|
|
23
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
24
|
+
...props,
|
|
24
25
|
ref: ref
|
|
25
|
-
})
|
|
26
|
+
});
|
|
26
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
27
28
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
28
29
|
query: "(min-width: 768px)",
|
|
29
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
31
|
+
...props,
|
|
30
32
|
ref: ref
|
|
31
|
-
})
|
|
33
|
+
})
|
|
32
34
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
33
35
|
query: "(max-width: 768px)",
|
|
34
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
36
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
37
|
+
...props,
|
|
35
38
|
ref: ref
|
|
36
|
-
})
|
|
39
|
+
})
|
|
37
40
|
})]
|
|
38
41
|
});
|
|
39
42
|
});
|
|
@@ -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 _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
|
|
12
11
|
var _signatureBoard = _interopRequireDefault(require("../signature-board"));
|
|
@@ -18,8 +17,10 @@ var _lang = require("../../lang");
|
|
|
18
17
|
var _utils2 = require("../../utils/utils");
|
|
19
18
|
require("./index.css");
|
|
20
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const
|
|
22
|
-
|
|
20
|
+
const {
|
|
21
|
+
Header,
|
|
22
|
+
Body
|
|
23
|
+
} = _MobileFullScreenPage.default;
|
|
23
24
|
class MBDigitalSignEditor extends _react.Component {
|
|
24
25
|
constructor(props) {
|
|
25
26
|
super(props);
|
|
@@ -85,11 +86,14 @@ class MBDigitalSignEditor extends _react.Component {
|
|
|
85
86
|
this.state = {
|
|
86
87
|
saving: false
|
|
87
88
|
};
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
const {
|
|
90
|
+
uploadFile,
|
|
91
|
+
config,
|
|
92
|
+
value
|
|
93
|
+
} = props;
|
|
94
|
+
const {
|
|
95
|
+
username
|
|
96
|
+
} = config || {};
|
|
93
97
|
this.value = value || {};
|
|
94
98
|
this.digitalService = new _service.default({
|
|
95
99
|
uploadFile,
|
|
@@ -98,14 +102,18 @@ class MBDigitalSignEditor extends _react.Component {
|
|
|
98
102
|
this.signatureBoard = null;
|
|
99
103
|
}
|
|
100
104
|
render() {
|
|
101
|
-
const
|
|
102
|
-
value
|
|
103
|
-
config
|
|
104
|
-
column
|
|
105
|
-
|
|
106
|
-
const
|
|
105
|
+
const {
|
|
106
|
+
value,
|
|
107
|
+
config,
|
|
108
|
+
column
|
|
109
|
+
} = this.props;
|
|
110
|
+
const {
|
|
111
|
+
saving
|
|
112
|
+
} = this.state;
|
|
113
|
+
const signImageUrl = (0, _url.generateCurrentBaseImageUrl)({
|
|
114
|
+
...config,
|
|
107
115
|
partUrl: _utils.default.getSignImageUrl(value)
|
|
108
|
-
})
|
|
116
|
+
});
|
|
109
117
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MobileFullScreenPage.default, {
|
|
110
118
|
className: "dtable-ui dtable-ui-mobile-digital-sign-editor",
|
|
111
119
|
zIndex: 101,
|