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
package/lib/ActionSheet/index.js
CHANGED
|
@@ -6,7 +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
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var React = _interopRequireWildcard(require("react"));
|
|
12
11
|
var _client = require("react-dom/client");
|
|
@@ -24,16 +23,18 @@ const SHARE = 'SHARE';
|
|
|
24
23
|
function noop() {}
|
|
25
24
|
const queue = [];
|
|
26
25
|
function createActionSheet(flag, config, callback) {
|
|
27
|
-
const props =
|
|
26
|
+
const props = {
|
|
28
27
|
prefixCls: 'am-action-sheet',
|
|
29
|
-
cancelButtonText: '取消'
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
cancelButtonText: '取消',
|
|
29
|
+
...config
|
|
30
|
+
};
|
|
31
|
+
const {
|
|
32
|
+
prefixCls,
|
|
33
|
+
className,
|
|
34
|
+
transitionName,
|
|
35
|
+
maskTransitionName,
|
|
36
|
+
maskClosable = true
|
|
37
|
+
} = props;
|
|
37
38
|
const div = document.createElement('div');
|
|
38
39
|
document.body.appendChild(div);
|
|
39
40
|
const root = (0, _client.createRoot)(div);
|
|
@@ -61,19 +62,20 @@ function createActionSheet(flag, config, callback) {
|
|
|
61
62
|
close();
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
badges =
|
|
65
|
+
const {
|
|
66
|
+
title,
|
|
67
|
+
message,
|
|
68
|
+
options,
|
|
69
|
+
destructiveButtonIndex,
|
|
70
|
+
cancelButtonIndex,
|
|
71
|
+
cancelButtonText,
|
|
72
|
+
badges = []
|
|
73
|
+
} = props;
|
|
72
74
|
const titleMsg = [title ? /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
|
|
73
|
-
className:
|
|
75
|
+
className: `${prefixCls}-title`,
|
|
74
76
|
children: title
|
|
75
77
|
}, "0") : null, message ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
76
|
-
className:
|
|
78
|
+
className: `${prefixCls}-message`,
|
|
77
79
|
children: message
|
|
78
80
|
}, "1") : null];
|
|
79
81
|
let children = null;
|
|
@@ -86,54 +88,60 @@ function createActionSheet(flag, config, callback) {
|
|
|
86
88
|
if (badges && badges.length > 0) {
|
|
87
89
|
badges.forEach(element => {
|
|
88
90
|
if (element.index >= 0) {
|
|
89
|
-
badgesMap[element.index] = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default,
|
|
91
|
+
badgesMap[element.index] = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Badge.default, {
|
|
92
|
+
...element
|
|
93
|
+
});
|
|
90
94
|
}
|
|
91
95
|
});
|
|
92
96
|
}
|
|
93
|
-
children = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div",
|
|
97
|
+
children = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
98
|
+
...(0, _getDataAttr.default)(props),
|
|
94
99
|
children: [titleMsg, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
95
|
-
className:
|
|
100
|
+
className: `${prefixCls}-button-list`,
|
|
96
101
|
role: "group",
|
|
97
102
|
children: normalOptions.map((item, index) => {
|
|
98
103
|
const itemProps = {
|
|
99
|
-
className: (0, _classnames.default)(
|
|
100
|
-
[
|
|
101
|
-
[
|
|
104
|
+
className: (0, _classnames.default)(`${prefixCls}-button-list-item`, {
|
|
105
|
+
[`${prefixCls}-destructive-button`]: destructiveButtonIndex === index,
|
|
106
|
+
[`${prefixCls}-cancel-button`]: cancelButtonIndex === index
|
|
102
107
|
}),
|
|
103
108
|
onClick: () => cb(index),
|
|
104
109
|
role: 'button'
|
|
105
110
|
};
|
|
106
|
-
let bContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("div",
|
|
111
|
+
let bContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
112
|
+
...itemProps,
|
|
107
113
|
children: item
|
|
108
|
-
})
|
|
114
|
+
});
|
|
109
115
|
// 仅在设置徽标的情况下修改dom结构
|
|
110
116
|
if (badgesMap[index]) {
|
|
111
|
-
bContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div",
|
|
112
|
-
|
|
117
|
+
bContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
118
|
+
...itemProps,
|
|
119
|
+
className: `${itemProps.className} ${prefixCls}-button-list-badge`,
|
|
113
120
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
114
|
-
className:
|
|
121
|
+
className: `${prefixCls}-button-list-item-content`,
|
|
115
122
|
children: item
|
|
116
123
|
}), badgesMap[index]]
|
|
117
|
-
})
|
|
124
|
+
});
|
|
118
125
|
}
|
|
119
126
|
let bItem = /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
|
|
120
|
-
activeClassName:
|
|
127
|
+
activeClassName: `${prefixCls}-button-list-item-active`,
|
|
121
128
|
children: bContent
|
|
122
129
|
}, index);
|
|
123
130
|
if (cancelButtonIndex === index || destructiveButtonIndex === index) {
|
|
124
131
|
bItem = /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
|
|
125
|
-
activeClassName:
|
|
126
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div",
|
|
132
|
+
activeClassName: `${prefixCls}-button-list-item-active`,
|
|
133
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
134
|
+
...itemProps,
|
|
127
135
|
children: [item, cancelButtonIndex === index ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
128
|
-
className:
|
|
136
|
+
className: `${prefixCls}-cancel-button-mask`
|
|
129
137
|
}) : null]
|
|
130
|
-
})
|
|
138
|
+
})
|
|
131
139
|
}, index);
|
|
132
140
|
}
|
|
133
141
|
return bItem;
|
|
134
142
|
})
|
|
135
143
|
})]
|
|
136
|
-
})
|
|
144
|
+
});
|
|
137
145
|
break;
|
|
138
146
|
case SHARE:
|
|
139
147
|
mode = 'share';
|
|
@@ -141,43 +149,44 @@ function createActionSheet(flag, config, callback) {
|
|
|
141
149
|
const createList = function (item, index) {
|
|
142
150
|
let rowIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
143
151
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
144
|
-
className:
|
|
152
|
+
className: `${prefixCls}-share-list-item`,
|
|
145
153
|
role: "button",
|
|
146
154
|
onClick: () => cb(index, rowIndex),
|
|
147
155
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
148
|
-
className:
|
|
156
|
+
className: `${prefixCls}-share-list-item-icon`,
|
|
149
157
|
children: item.icon
|
|
150
158
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
151
|
-
className:
|
|
159
|
+
className: `${prefixCls}-share-list-item-title`,
|
|
152
160
|
children: item.title
|
|
153
161
|
})]
|
|
154
162
|
}, index);
|
|
155
163
|
};
|
|
156
|
-
children = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div",
|
|
164
|
+
children = /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
165
|
+
...(0, _getDataAttr.default)(props),
|
|
157
166
|
children: [titleMsg, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
158
|
-
className:
|
|
167
|
+
className: `${prefixCls}-share`,
|
|
159
168
|
children: [multipleLine ? options.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
160
|
-
className:
|
|
169
|
+
className: `${prefixCls}-share-list`,
|
|
161
170
|
children: item.map((ii, ind) => createList(ii, ind, index))
|
|
162
171
|
}, index)) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
163
|
-
className:
|
|
172
|
+
className: `${prefixCls}-share-list`,
|
|
164
173
|
children: options.map((item, index) => createList(item, index))
|
|
165
174
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
|
|
166
|
-
activeClassName:
|
|
175
|
+
activeClassName: `${prefixCls}-share-cancel-button-active`,
|
|
167
176
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
168
|
-
className:
|
|
177
|
+
className: `${prefixCls}-share-cancel-button`,
|
|
169
178
|
role: "button",
|
|
170
179
|
onClick: () => cb(-1),
|
|
171
180
|
children: cancelButtonText
|
|
172
181
|
})
|
|
173
182
|
})]
|
|
174
183
|
})]
|
|
175
|
-
})
|
|
184
|
+
});
|
|
176
185
|
break;
|
|
177
186
|
default:
|
|
178
187
|
break;
|
|
179
188
|
}
|
|
180
|
-
const rootCls = (0, _classnames.default)(
|
|
189
|
+
const rootCls = (0, _classnames.default)(`${prefixCls}-${mode}`, className);
|
|
181
190
|
root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcDialog.default, {
|
|
182
191
|
visible: true,
|
|
183
192
|
title: "",
|
|
@@ -14,36 +14,37 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
14
14
|
|
|
15
15
|
class ActivityIndicator extends React.Component {
|
|
16
16
|
render() {
|
|
17
|
-
const
|
|
18
|
-
prefixCls
|
|
19
|
-
className
|
|
20
|
-
animating
|
|
21
|
-
toast
|
|
22
|
-
size
|
|
23
|
-
text
|
|
17
|
+
const {
|
|
18
|
+
prefixCls,
|
|
19
|
+
className,
|
|
20
|
+
animating,
|
|
21
|
+
toast,
|
|
22
|
+
size,
|
|
23
|
+
text
|
|
24
|
+
} = this.props;
|
|
24
25
|
const wrapClass = (0, _classnames.default)(prefixCls, className, {
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
26
|
+
[`${prefixCls}-lg`]: size === 'large',
|
|
27
|
+
[`${prefixCls}-sm`]: size === 'small',
|
|
28
|
+
[`${prefixCls}-toast`]: !!toast
|
|
28
29
|
});
|
|
29
|
-
const spinnerClass = (0, _classnames.default)(
|
|
30
|
-
[
|
|
30
|
+
const spinnerClass = (0, _classnames.default)(`${prefixCls}-spinner`, {
|
|
31
|
+
[`${prefixCls}-spinner-lg`]: !!toast || size === 'large'
|
|
31
32
|
});
|
|
32
33
|
if (animating) {
|
|
33
34
|
if (toast) {
|
|
34
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
35
36
|
className: wrapClass,
|
|
36
37
|
children: text ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
37
|
-
className:
|
|
38
|
+
className: `${prefixCls}-content`,
|
|
38
39
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
39
40
|
className: spinnerClass,
|
|
40
41
|
"aria-hidden": "true"
|
|
41
42
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
42
|
-
className:
|
|
43
|
+
className: `${prefixCls}-toast`,
|
|
43
44
|
children: text
|
|
44
45
|
})]
|
|
45
46
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
46
|
-
className:
|
|
47
|
+
className: `${prefixCls}-content`,
|
|
47
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
48
49
|
className: spinnerClass,
|
|
49
50
|
"aria-label": "Loading"
|
|
@@ -57,7 +58,7 @@ class ActivityIndicator extends React.Component {
|
|
|
57
58
|
className: spinnerClass,
|
|
58
59
|
"aria-hidden": "true"
|
|
59
60
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
60
|
-
className:
|
|
61
|
+
className: `${prefixCls}-tip`,
|
|
61
62
|
children: text
|
|
62
63
|
})]
|
|
63
64
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _ModalPortal = _interopRequireDefault(require("../ModalPortal"));
|
|
@@ -17,49 +16,24 @@ var _DTableIcon = _interopRequireDefault(require("../DTableIcon"));
|
|
|
17
16
|
require("./index.css");
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
18
|
const AsyncUserSelect = _ref => {
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
emptyPlaceholder =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
setIsPopoverOpen = _useState2[1];
|
|
39
|
-
const _useState3 = (0, _react.useState)(''),
|
|
40
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
41
|
-
searchValue = _useState4[0],
|
|
42
|
-
setSearchValue = _useState4[1];
|
|
43
|
-
const _useState5 = (0, _react.useState)([]),
|
|
44
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
45
|
-
searchedUsers = _useState6[0],
|
|
46
|
-
setSearchedUsers = _useState6[1];
|
|
47
|
-
const _useState7 = (0, _react.useState)(-1),
|
|
48
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
49
|
-
highlightIndex = _useState8[0],
|
|
50
|
-
setHighlightIndex = _useState8[1];
|
|
51
|
-
const _useState9 = (0, _react.useState)(0),
|
|
52
|
-
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
53
|
-
maxItemNum = _useState0[0],
|
|
54
|
-
setMaxItemNum = _useState0[1];
|
|
55
|
-
const _useState1 = (0, _react.useState)(0),
|
|
56
|
-
_useState10 = (0, _slicedToArray2.default)(_useState1, 2),
|
|
57
|
-
itemHeight = _useState10[0],
|
|
58
|
-
setItemHeight = _useState10[1];
|
|
59
|
-
const _useState11 = (0, _react.useState)(null),
|
|
60
|
-
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
61
|
-
popoverPosition = _useState12[0],
|
|
62
|
-
setPopoverPosition = _useState12[1];
|
|
19
|
+
let {
|
|
20
|
+
className,
|
|
21
|
+
emptyPlaceholder = '',
|
|
22
|
+
searchPlaceholder = '',
|
|
23
|
+
isMulti = true,
|
|
24
|
+
enableShowIDInOrgWhenSearchUser = false,
|
|
25
|
+
selectedUsers = [],
|
|
26
|
+
loadOptions,
|
|
27
|
+
modifySelectedUsers,
|
|
28
|
+
showDeptBtn = false
|
|
29
|
+
} = _ref;
|
|
30
|
+
const [isPopoverOpen, setIsPopoverOpen] = (0, _react.useState)(false);
|
|
31
|
+
const [searchValue, setSearchValue] = (0, _react.useState)('');
|
|
32
|
+
const [searchedUsers, setSearchedUsers] = (0, _react.useState)([]);
|
|
33
|
+
const [highlightIndex, setHighlightIndex] = (0, _react.useState)(-1);
|
|
34
|
+
const [maxItemNum, setMaxItemNum] = (0, _react.useState)(0);
|
|
35
|
+
const [itemHeight, setItemHeight] = (0, _react.useState)(0);
|
|
36
|
+
const [popoverPosition, setPopoverPosition] = (0, _react.useState)(null);
|
|
63
37
|
const selectorRef = (0, _react.useRef)(null);
|
|
64
38
|
const userSelectContainerRef = (0, _react.useRef)(null);
|
|
65
39
|
const userListContainerRef = (0, _react.useRef)(null);
|
|
@@ -249,7 +223,7 @@ const AsyncUserSelect = _ref => {
|
|
|
249
223
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
|
|
250
224
|
user: user,
|
|
251
225
|
deleteUser: deselectUser
|
|
252
|
-
},
|
|
226
|
+
}, `dtable-ui-user-selector-selected-user-${index}`);
|
|
253
227
|
}), selectedUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
254
228
|
className: "dtable-ui-user-select-placeholder",
|
|
255
229
|
children: emptyPlaceholder || (0, _lang.getLocale)('Search_users')
|
|
@@ -291,7 +265,7 @@ const AsyncUserSelect = _ref => {
|
|
|
291
265
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
|
|
292
266
|
user: user,
|
|
293
267
|
enableShowIDInOrgWhenSearchUser: enableShowIDInOrgWhenSearchUser
|
|
294
|
-
},
|
|
268
|
+
}, `dtable-ui-user-selector-searched-user-${index}`), selectedUsers.find(u => u.email === user.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
295
269
|
className: "dtable-ui-collaborator-check-icon",
|
|
296
270
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
297
271
|
className: "dtable-font dtable-icon-check",
|
|
@@ -10,11 +10,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _lang = require("../lang");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
const UserItem = _ref => {
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
enableShowIDInOrgWhenSearchUser =
|
|
13
|
+
let {
|
|
14
|
+
className,
|
|
15
|
+
user,
|
|
16
|
+
deleteUser,
|
|
17
|
+
enableShowIDInOrgWhenSearchUser = false
|
|
18
|
+
} = _ref;
|
|
18
19
|
const name = (0, _react.useMemo)(() => (user === null || user === void 0 ? void 0 : user.name) || '', [user]);
|
|
19
20
|
const avatarUrl = (0, _react.useMemo)(() => (user === null || user === void 0 ? void 0 : user.avatar_url) || '', [user]);
|
|
20
21
|
const idInOrg = (0, _react.useMemo)(() => (user === null || user === void 0 ? void 0 : user.id_in_org) || '', [user]);
|
|
@@ -11,9 +11,10 @@ require("./index.css");
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
class AutoNumberFormatter extends _react.default.Component {
|
|
13
13
|
render() {
|
|
14
|
-
const
|
|
15
|
-
containerClassName
|
|
16
|
-
value
|
|
14
|
+
const {
|
|
15
|
+
containerClassName,
|
|
16
|
+
value
|
|
17
|
+
} = this.props;
|
|
17
18
|
let classname = (0, _classnames.default)('dtable-ui cell-formatter-container auto-number-formatter', containerClassName);
|
|
18
19
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
19
20
|
title: value,
|
package/lib/Badge/index.js
CHANGED
|
@@ -1,63 +1,61 @@
|
|
|
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
10
|
var React = _interopRequireWildcard(require("react"));
|
|
13
11
|
require("./index.css");
|
|
14
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const _excluded = ["className", "prefixCls", "children", "text", "size", "overflowCount", "dot", "corner", "hot"];
|
|
16
13
|
class Badge extends React.Component {
|
|
17
14
|
render() {
|
|
18
15
|
// tslint:disable:prefer-const
|
|
19
|
-
let
|
|
20
|
-
className
|
|
21
|
-
prefixCls
|
|
22
|
-
children
|
|
23
|
-
text
|
|
24
|
-
size
|
|
25
|
-
overflowCount
|
|
26
|
-
dot
|
|
27
|
-
corner
|
|
28
|
-
hot
|
|
29
|
-
restProps
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
prefixCls,
|
|
19
|
+
children,
|
|
20
|
+
text,
|
|
21
|
+
size,
|
|
22
|
+
overflowCount,
|
|
23
|
+
dot,
|
|
24
|
+
corner,
|
|
25
|
+
hot,
|
|
26
|
+
...restProps
|
|
27
|
+
} = this.props;
|
|
30
28
|
// eslint-disable-next-line no-self-assign
|
|
31
29
|
overflowCount = overflowCount;
|
|
32
|
-
text = typeof text === 'number' && text > overflowCount ?
|
|
30
|
+
text = typeof text === 'number' && text > overflowCount ? `${overflowCount}+` : text;
|
|
33
31
|
|
|
34
32
|
// dot mode don't need text
|
|
35
33
|
if (dot) {
|
|
36
34
|
text = '';
|
|
37
35
|
}
|
|
38
36
|
const scrollNumberCls = (0, _classnames.default)({
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
37
|
+
[`${prefixCls}-dot`]: dot,
|
|
38
|
+
[`${prefixCls}-dot-large`]: dot && size === 'large',
|
|
39
|
+
[`${prefixCls}-text`]: !dot && !corner,
|
|
40
|
+
[`${prefixCls}-corner`]: corner,
|
|
41
|
+
[`${prefixCls}-corner-large`]: corner && size === 'large'
|
|
44
42
|
});
|
|
45
43
|
const badgeCls = (0, _classnames.default)(prefixCls, className, {
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
44
|
+
[`${prefixCls}-not-a-wrapper`]: !children,
|
|
45
|
+
[`${prefixCls}-corner-wrapper`]: corner,
|
|
46
|
+
[`${prefixCls}-hot`]: !!hot,
|
|
47
|
+
[`${prefixCls}-corner-wrapper-large`]: corner && size === 'large'
|
|
50
48
|
});
|
|
51
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
52
50
|
className: badgeCls,
|
|
53
51
|
children: [children, (text || dot) &&
|
|
54
52
|
/*#__PURE__*/
|
|
55
53
|
// tslint:disable-next-line:jsx-no-multiline-js
|
|
56
|
-
(0, _jsxRuntime.jsx)("sup",
|
|
57
|
-
className: scrollNumberCls
|
|
58
|
-
|
|
54
|
+
(0, _jsxRuntime.jsx)("sup", {
|
|
55
|
+
className: scrollNumberCls,
|
|
56
|
+
...restProps,
|
|
59
57
|
children: text
|
|
60
|
-
})
|
|
58
|
+
})]
|
|
61
59
|
});
|
|
62
60
|
}
|
|
63
61
|
}
|
|
@@ -21,12 +21,14 @@ class ButtonFormatter extends _react.default.Component {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
let
|
|
25
|
-
data
|
|
26
|
-
containerClassName
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
let {
|
|
25
|
+
data,
|
|
26
|
+
containerClassName
|
|
27
|
+
} = this.props;
|
|
28
|
+
const {
|
|
29
|
+
button_color,
|
|
30
|
+
button_name
|
|
31
|
+
} = data || {};
|
|
30
32
|
const colorObj = _dtableUtils.SELECT_OPTION_COLORS.find(item => item.COLOR === button_color) || _dtableUtils.SELECT_OPTION_COLORS[0];
|
|
31
33
|
const color = colorObj.TEXT_COLOR === WHITE ? WHITE : '#666666';
|
|
32
34
|
const btnStyle = {
|
|
@@ -18,9 +18,10 @@ class CTimeFormatter extends _react.default.Component {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
let
|
|
22
|
-
date
|
|
23
|
-
containerClassName
|
|
21
|
+
let {
|
|
22
|
+
value: date,
|
|
23
|
+
containerClassName
|
|
24
|
+
} = this.props;
|
|
24
25
|
let classname = (0, _classnames.default)('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
|
|
25
26
|
if (date) {
|
|
26
27
|
date = this.formatDate(date);
|
|
@@ -6,35 +6,38 @@ 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
|
require("./index.css");
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["isMobile"];
|
|
18
15
|
const CheckboxEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
let {
|
|
17
|
+
isMobile,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
20
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
21
|
+
...props,
|
|
22
22
|
ref: ref
|
|
23
|
-
})
|
|
24
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
23
|
+
});
|
|
24
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
25
|
+
...props,
|
|
25
26
|
ref: ref
|
|
26
|
-
})
|
|
27
|
+
});
|
|
27
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
28
29
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
29
30
|
query: "(min-width: 768px)",
|
|
30
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
32
|
+
...props,
|
|
31
33
|
ref: ref
|
|
32
|
-
})
|
|
34
|
+
})
|
|
33
35
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
34
36
|
query: "(max-width: 768px)",
|
|
35
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
38
|
+
...props,
|
|
36
39
|
ref: ref
|
|
37
|
-
})
|
|
40
|
+
})
|
|
38
41
|
})]
|
|
39
42
|
});
|
|
40
43
|
});
|
|
@@ -15,7 +15,9 @@ class MBCheckboxEditor extends _react.Component {
|
|
|
15
15
|
constructor(props) {
|
|
16
16
|
super(props);
|
|
17
17
|
this.getValue = () => {
|
|
18
|
-
const
|
|
18
|
+
const {
|
|
19
|
+
value
|
|
20
|
+
} = this.state;
|
|
19
21
|
return value;
|
|
20
22
|
};
|
|
21
23
|
this.updateValue = value => {
|
|
@@ -27,14 +29,18 @@ class MBCheckboxEditor extends _react.Component {
|
|
|
27
29
|
});
|
|
28
30
|
};
|
|
29
31
|
this.onChangeCheckboxValue = event => {
|
|
30
|
-
const
|
|
32
|
+
const {
|
|
33
|
+
readOnly
|
|
34
|
+
} = this.props;
|
|
31
35
|
if (readOnly) return;
|
|
32
36
|
if (event) {
|
|
33
37
|
event.stopPropagation();
|
|
34
38
|
event.nativeEvent.stopImmediatePropagation();
|
|
35
39
|
event.persist();
|
|
36
40
|
}
|
|
37
|
-
const
|
|
41
|
+
const {
|
|
42
|
+
value
|
|
43
|
+
} = this.state;
|
|
38
44
|
const newValue = !value;
|
|
39
45
|
this.setState({
|
|
40
46
|
value: newValue
|
|
@@ -57,7 +63,9 @@ class MBCheckboxEditor extends _react.Component {
|
|
|
57
63
|
};
|
|
58
64
|
}
|
|
59
65
|
componentDidUpdate(prevProps) {
|
|
60
|
-
const
|
|
66
|
+
const {
|
|
67
|
+
value
|
|
68
|
+
} = this.props;
|
|
61
69
|
if (value !== prevProps.value) {
|
|
62
70
|
this.setState({
|
|
63
71
|
value
|
|
@@ -66,11 +74,14 @@ class MBCheckboxEditor extends _react.Component {
|
|
|
66
74
|
}
|
|
67
75
|
render() {
|
|
68
76
|
var _column$data;
|
|
69
|
-
const
|
|
70
|
-
className
|
|
71
|
-
style
|
|
72
|
-
column
|
|
73
|
-
|
|
77
|
+
const {
|
|
78
|
+
className,
|
|
79
|
+
style,
|
|
80
|
+
column
|
|
81
|
+
} = this.props;
|
|
82
|
+
const {
|
|
83
|
+
value
|
|
84
|
+
} = this.state;
|
|
74
85
|
let checkboxStyle = column === null || column === void 0 ? void 0 : (_column$data = column.data) === null || _column$data === void 0 ? void 0 : _column$data.checkbox_style;
|
|
75
86
|
if (!checkboxStyle || Object.keys(checkboxStyle).length < 2) {
|
|
76
87
|
checkboxStyle = _constants.DEFAULT_CHECKBOX_MARK_STYLE;
|