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
|
@@ -65,11 +65,14 @@ class RowExpandPCImageEditor extends _react.default.Component {
|
|
|
65
65
|
this.setLargeImageIndex(-1);
|
|
66
66
|
};
|
|
67
67
|
this.getValue = () => {
|
|
68
|
-
let
|
|
69
|
-
column
|
|
70
|
-
row
|
|
71
|
-
valueKey
|
|
72
|
-
|
|
68
|
+
let {
|
|
69
|
+
column,
|
|
70
|
+
row,
|
|
71
|
+
valueKey
|
|
72
|
+
} = this.props;
|
|
73
|
+
let {
|
|
74
|
+
imageContainer
|
|
75
|
+
} = this.state;
|
|
73
76
|
return imageContainer ? imageContainer : row[column[valueKey]];
|
|
74
77
|
};
|
|
75
78
|
this.deleteImage = index => {
|
|
@@ -82,7 +85,9 @@ class RowExpandPCImageEditor extends _react.default.Component {
|
|
|
82
85
|
this.props.onCommit(updatedValue);
|
|
83
86
|
};
|
|
84
87
|
this.getImageArray = value => {
|
|
85
|
-
const
|
|
88
|
+
const {
|
|
89
|
+
config
|
|
90
|
+
} = this.props;
|
|
86
91
|
return value.map((imageSrc, index) => {
|
|
87
92
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageThumbnail.default, {
|
|
88
93
|
index: index,
|
|
@@ -90,7 +95,7 @@ class RowExpandPCImageEditor extends _react.default.Component {
|
|
|
90
95
|
onClick: this.setLargeImageIndex,
|
|
91
96
|
deleteImage: this.deleteImage,
|
|
92
97
|
config: config
|
|
93
|
-
},
|
|
98
|
+
}, `image-${index}`);
|
|
94
99
|
});
|
|
95
100
|
};
|
|
96
101
|
this.state = {
|
|
@@ -103,9 +108,11 @@ class RowExpandPCImageEditor extends _react.default.Component {
|
|
|
103
108
|
document.addEventListener('keydown', this.onKeyDown);
|
|
104
109
|
}
|
|
105
110
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
const {
|
|
112
|
+
column,
|
|
113
|
+
row,
|
|
114
|
+
valueKey
|
|
115
|
+
} = nextProps;
|
|
109
116
|
if (row._id !== this.props.row._id) {
|
|
110
117
|
this.setState({
|
|
111
118
|
imageContainer: row[column[valueKey]] || [],
|
|
@@ -128,10 +135,13 @@ class RowExpandPCImageEditor extends _react.default.Component {
|
|
|
128
135
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
129
136
|
}
|
|
130
137
|
render() {
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
138
|
+
const {
|
|
139
|
+
isEditorFocus
|
|
140
|
+
} = this.props;
|
|
141
|
+
let {
|
|
142
|
+
isShowImageEditor,
|
|
143
|
+
largeImageIndex
|
|
144
|
+
} = this.state;
|
|
135
145
|
let value = this.getValue();
|
|
136
146
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
137
147
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -5,25 +5,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
var _constants = require("./constants");
|
|
12
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
const _excluded = ["column", "component"];
|
|
14
11
|
const RowExpandEditor = _ref => {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
let {
|
|
13
|
+
column,
|
|
14
|
+
component,
|
|
15
|
+
...props
|
|
16
|
+
} = _ref;
|
|
17
|
+
const components = {
|
|
18
|
+
..._constants.CELL_EDITOR_MAP,
|
|
19
|
+
...component
|
|
20
|
+
};
|
|
19
21
|
const Editor = components[column.type];
|
|
20
22
|
if (!Editor) return null;
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
+
const {
|
|
24
|
+
row,
|
|
25
|
+
valueKey
|
|
26
|
+
} = props;
|
|
23
27
|
const value = row[column[valueKey]];
|
|
24
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Editor,
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Editor, {
|
|
29
|
+
...props,
|
|
25
30
|
value: value,
|
|
26
31
|
column: column
|
|
27
|
-
})
|
|
32
|
+
});
|
|
28
33
|
};
|
|
29
34
|
var _default = exports.default = RowExpandEditor;
|
|
@@ -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 RowExpandLongTextEditor = /*#__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
|
});
|
|
@@ -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 _seafileEditor = require("@seafile/seafile-editor");
|
|
12
11
|
var _TextareaItem = _interopRequireDefault(require("../../../../TextareaItem"));
|
|
@@ -14,17 +13,18 @@ var _MobileFullScreenPage = _interopRequireDefault(require("../../../../MobileFu
|
|
|
14
13
|
var _lang = require("../../../../lang");
|
|
15
14
|
require("./index.css");
|
|
16
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
const {
|
|
17
|
+
Header,
|
|
18
|
+
Body
|
|
19
|
+
} = _MobileFullScreenPage.default;
|
|
19
20
|
const Editor = _ref => {
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
setValue = _useState2[1];
|
|
21
|
+
let {
|
|
22
|
+
value: oldValue,
|
|
23
|
+
title,
|
|
24
|
+
onToggle,
|
|
25
|
+
onChange
|
|
26
|
+
} = _ref;
|
|
27
|
+
const [value, setValue] = (0, _react.useState)(oldValue || '');
|
|
28
28
|
const hasUnSaved = (0, _react.useRef)(false);
|
|
29
29
|
const rowCounts = (0, _react.useMemo)(() => document.body.offsetWidth < 768 ? 10 : 20, []);
|
|
30
30
|
const handleTextChange = (0, _react.useCallback)(newValue => {
|
|
@@ -34,11 +34,12 @@ const Editor = _ref => {
|
|
|
34
34
|
}, [value]);
|
|
35
35
|
const onSave = (0, _react.useCallback)(() => {
|
|
36
36
|
if (!hasUnSaved.current) return;
|
|
37
|
-
const
|
|
38
|
-
previewText
|
|
39
|
-
images
|
|
40
|
-
links
|
|
41
|
-
checklist
|
|
37
|
+
const {
|
|
38
|
+
previewText,
|
|
39
|
+
images,
|
|
40
|
+
links,
|
|
41
|
+
checklist
|
|
42
|
+
} = (0, _seafileEditor.getPreviewContent)(value);
|
|
42
43
|
const newValue = Object.assign({}, {
|
|
43
44
|
text: value,
|
|
44
45
|
preview: previewText,
|
|
@@ -48,12 +48,15 @@ class RowExpandMBLongTextEditor extends _react.default.Component {
|
|
|
48
48
|
}
|
|
49
49
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
50
50
|
var _this$editorRef, _this$editorRef$curre;
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
const {
|
|
52
|
+
column,
|
|
53
|
+
row,
|
|
54
|
+
valueKey
|
|
55
|
+
} = nextProps;
|
|
56
|
+
const {
|
|
57
|
+
column: currentColumn,
|
|
58
|
+
row: currentRow
|
|
59
|
+
} = this.props;
|
|
57
60
|
const value = row[column[valueKey]];
|
|
58
61
|
const currentValue = currentRow[currentColumn[valueKey]];
|
|
59
62
|
if (value !== currentValue && !((_this$editorRef = this.editorRef) !== null && _this$editorRef !== void 0 && (_this$editorRef$curre = _this$editorRef.current) !== null && _this$editorRef$curre !== void 0 && _this$editorRef$curre.enableEdit)) {
|
|
@@ -61,10 +64,13 @@ class RowExpandMBLongTextEditor extends _react.default.Component {
|
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
render() {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
const {
|
|
68
|
+
column
|
|
69
|
+
} = this.props;
|
|
70
|
+
const {
|
|
71
|
+
innerHtml,
|
|
72
|
+
isShowEditor
|
|
73
|
+
} = this.state;
|
|
68
74
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
69
75
|
children: [innerHtml ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
70
76
|
className: "dtable-ui-mobile-long-text-formatter article py-2",
|
|
@@ -47,7 +47,9 @@ class RowExpandPCLongTextEditor extends _react.default.Component {
|
|
|
47
47
|
this.editorRef.current.closeEditor();
|
|
48
48
|
};
|
|
49
49
|
this.onClick = () => {
|
|
50
|
-
const
|
|
50
|
+
const {
|
|
51
|
+
columnIndex
|
|
52
|
+
} = this.props;
|
|
51
53
|
this.props.updateTabIndex && this.props.updateTabIndex(columnIndex);
|
|
52
54
|
};
|
|
53
55
|
this.state = {
|
|
@@ -61,14 +63,17 @@ class RowExpandPCLongTextEditor extends _react.default.Component {
|
|
|
61
63
|
}
|
|
62
64
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
63
65
|
var _this$editorRef, _this$editorRef$curre;
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
const {
|
|
67
|
+
column,
|
|
68
|
+
row,
|
|
69
|
+
isEditorFocus: nextIsEditorFocus,
|
|
70
|
+
valueKey
|
|
71
|
+
} = nextProps;
|
|
72
|
+
const {
|
|
73
|
+
column: currentColumn,
|
|
74
|
+
row: currentRow,
|
|
75
|
+
isEditorFocus
|
|
76
|
+
} = this.props;
|
|
72
77
|
const value = row[column[valueKey]];
|
|
73
78
|
const currentValue = currentRow[currentColumn[valueKey]];
|
|
74
79
|
if (value !== currentValue && !((_this$editorRef = this.editorRef) !== null && _this$editorRef !== void 0 && (_this$editorRef$curre = _this$editorRef.current) !== null && _this$editorRef$curre !== void 0 && _this$editorRef$curre.enableEdit)) {
|
|
@@ -86,13 +91,15 @@ class RowExpandPCLongTextEditor extends _react.default.Component {
|
|
|
86
91
|
}
|
|
87
92
|
}
|
|
88
93
|
render() {
|
|
89
|
-
const
|
|
90
|
-
column
|
|
91
|
-
longTextEditorAPI
|
|
92
|
-
longTextEditorI18n
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
const {
|
|
95
|
+
column,
|
|
96
|
+
longTextEditorAPI,
|
|
97
|
+
longTextEditorI18n
|
|
98
|
+
} = this.props;
|
|
99
|
+
const {
|
|
100
|
+
isLoading,
|
|
101
|
+
value
|
|
102
|
+
} = this.state;
|
|
96
103
|
if (isLoading) return null;
|
|
97
104
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Suspense, {
|
|
98
105
|
fallback: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -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 RowExpandMultipleSelectEditor = /*#__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
|
});
|
|
@@ -19,7 +19,9 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
|
|
|
19
19
|
constructor(_props) {
|
|
20
20
|
super(_props);
|
|
21
21
|
this.getOptions = props => {
|
|
22
|
-
const
|
|
22
|
+
const {
|
|
23
|
+
column
|
|
24
|
+
} = props;
|
|
23
25
|
return (0, _dtableUtils.getColumnOptions)(column);
|
|
24
26
|
};
|
|
25
27
|
this.toggleEditor = value => {
|
|
@@ -63,7 +65,9 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
|
|
|
63
65
|
this.props.onCommit(newValue);
|
|
64
66
|
};
|
|
65
67
|
this.renderOptions = () => {
|
|
66
|
-
const
|
|
68
|
+
const {
|
|
69
|
+
value
|
|
70
|
+
} = this.state;
|
|
67
71
|
let displayOptions = [];
|
|
68
72
|
if (Array.isArray(value)) {
|
|
69
73
|
const selectedOptions = this.options.filter(option => value.includes(option[this.key]));
|
|
@@ -86,7 +90,7 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
|
|
|
86
90
|
onRemove: this.removeOption.bind(this, {
|
|
87
91
|
[this.key]: optionId
|
|
88
92
|
})
|
|
89
|
-
},
|
|
93
|
+
}, `deleted-${index}`);
|
|
90
94
|
}));
|
|
91
95
|
}
|
|
92
96
|
if (displayOptions.length === 0) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_addBtn.default, {
|
|
@@ -110,8 +114,10 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
|
|
|
110
114
|
this.options = this.getOptions(_props);
|
|
111
115
|
}
|
|
112
116
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
113
|
-
const
|
|
114
|
-
|
|
117
|
+
const {
|
|
118
|
+
value,
|
|
119
|
+
column
|
|
120
|
+
} = nextProps;
|
|
115
121
|
if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
|
|
116
122
|
this.options = this.getOptions(nextProps);
|
|
117
123
|
this.setState({
|
|
@@ -121,13 +127,15 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
|
|
|
121
127
|
}
|
|
122
128
|
}
|
|
123
129
|
render() {
|
|
124
|
-
const
|
|
125
|
-
column
|
|
126
|
-
isSupportNewOption
|
|
127
|
-
onAddNewOption
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
const {
|
|
131
|
+
column,
|
|
132
|
+
isSupportNewOption,
|
|
133
|
+
onAddNewOption
|
|
134
|
+
} = this.props;
|
|
135
|
+
const {
|
|
136
|
+
showEditor,
|
|
137
|
+
value
|
|
138
|
+
} = this.state;
|
|
131
139
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
132
140
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
133
141
|
className: "dtable-ui dtable-ui-mobile-row-expand-options-editor position-relative",
|
|
@@ -18,7 +18,9 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
18
18
|
constructor(_props) {
|
|
19
19
|
super(_props);
|
|
20
20
|
this.getOptions = props => {
|
|
21
|
-
const
|
|
21
|
+
const {
|
|
22
|
+
column
|
|
23
|
+
} = props;
|
|
22
24
|
return (0, _dtableUtils.getColumnOptions)(column);
|
|
23
25
|
};
|
|
24
26
|
this.onKeyDown = e => {
|
|
@@ -49,9 +51,10 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
49
51
|
this.onToggleSelect = e => {
|
|
50
52
|
e.preventDefault();
|
|
51
53
|
e.stopPropagation();
|
|
52
|
-
const
|
|
53
|
-
updateTabIndex
|
|
54
|
-
columnIndex
|
|
54
|
+
const {
|
|
55
|
+
updateTabIndex,
|
|
56
|
+
columnIndex
|
|
57
|
+
} = this.props;
|
|
55
58
|
updateTabIndex && updateTabIndex(columnIndex);
|
|
56
59
|
this.toggleSingleSelect(true);
|
|
57
60
|
};
|
|
@@ -59,9 +62,10 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
59
62
|
this.toggleSingleSelect(false);
|
|
60
63
|
};
|
|
61
64
|
this.onFocus = () => {
|
|
62
|
-
const
|
|
63
|
-
updateTabIndex
|
|
64
|
-
columnIndex
|
|
65
|
+
const {
|
|
66
|
+
updateTabIndex,
|
|
67
|
+
columnIndex
|
|
68
|
+
} = this.props;
|
|
65
69
|
updateTabIndex && updateTabIndex(columnIndex);
|
|
66
70
|
};
|
|
67
71
|
this.onChange = option => {
|
|
@@ -83,7 +87,9 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
83
87
|
this.onChange(option);
|
|
84
88
|
};
|
|
85
89
|
this.getMultipleSelectList = () => {
|
|
86
|
-
const
|
|
90
|
+
const {
|
|
91
|
+
value
|
|
92
|
+
} = this.state;
|
|
87
93
|
if (!Array.isArray(value)) return [];
|
|
88
94
|
const selectedOptions = this.options.filter(option => value.includes(option[this.key]));
|
|
89
95
|
const selectedOptionIds = selectedOptions.map(option => option[this.key]);
|
|
@@ -140,14 +146,15 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
140
146
|
})
|
|
141
147
|
})
|
|
142
148
|
})]
|
|
143
|
-
},
|
|
149
|
+
}, `deleted-multiple-select-${index}`);
|
|
144
150
|
}));
|
|
145
151
|
};
|
|
146
152
|
this.renderOptions = () => {
|
|
147
|
-
const
|
|
148
|
-
isEditorFocus
|
|
149
|
-
classNamePrefix
|
|
150
|
-
placeholder
|
|
153
|
+
const {
|
|
154
|
+
isEditorFocus,
|
|
155
|
+
classNamePrefix,
|
|
156
|
+
placeholder
|
|
157
|
+
} = this.props;
|
|
151
158
|
const options = this.getMultipleSelectList();
|
|
152
159
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
153
160
|
tabIndex: 0,
|
|
@@ -156,19 +163,19 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
156
163
|
ref: ref => this.multipleSelectOptionsRef = ref,
|
|
157
164
|
className: (0, _classnames.default)('dtable-ui dtable-ui-row-expand-select-editor custom-select', {
|
|
158
165
|
'focus': isEditorFocus,
|
|
159
|
-
[
|
|
166
|
+
[`${classNamePrefix}-select-editor`]: classNamePrefix
|
|
160
167
|
}),
|
|
161
168
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
162
169
|
className: (0, _classnames.default)('dtable-ui-row-expand-select-editor-inner', {
|
|
163
|
-
[
|
|
170
|
+
[`${classNamePrefix}-select-editor-inner`]: classNamePrefix
|
|
164
171
|
}),
|
|
165
172
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
166
173
|
className: (0, _classnames.default)('', {
|
|
167
|
-
[
|
|
174
|
+
[`${classNamePrefix}-select-editor-inner-container`]: classNamePrefix
|
|
168
175
|
}),
|
|
169
176
|
children: [options.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
170
177
|
className: (0, _classnames.default)('dtable-ui-row-expand-select-options', {
|
|
171
|
-
[
|
|
178
|
+
[`${classNamePrefix}-select-editor-options`]: classNamePrefix
|
|
172
179
|
}),
|
|
173
180
|
children: options
|
|
174
181
|
}), options.length === 0 && placeholder && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
@@ -194,8 +201,10 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
194
201
|
document.addEventListener('keydown', this.onKeyDown);
|
|
195
202
|
}
|
|
196
203
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
197
|
-
const
|
|
198
|
-
|
|
204
|
+
const {
|
|
205
|
+
value,
|
|
206
|
+
column
|
|
207
|
+
} = nextProps;
|
|
199
208
|
if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
|
|
200
209
|
this.options = this.getOptions(nextProps);
|
|
201
210
|
this.setState({
|
|
@@ -218,14 +227,16 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
218
227
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
219
228
|
}
|
|
220
229
|
render() {
|
|
221
|
-
const
|
|
222
|
-
column
|
|
223
|
-
isSupportNewOption
|
|
224
|
-
onAddNewOption
|
|
225
|
-
classNamePrefix
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
230
|
+
const {
|
|
231
|
+
column,
|
|
232
|
+
isSupportNewOption,
|
|
233
|
+
onAddNewOption,
|
|
234
|
+
classNamePrefix
|
|
235
|
+
} = this.props;
|
|
236
|
+
const {
|
|
237
|
+
showSelectPopover,
|
|
238
|
+
value
|
|
239
|
+
} = this.state;
|
|
229
240
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
230
241
|
className: "position-relative w-100",
|
|
231
242
|
ref: ref => this.ref = 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 RowExpandNumberEditor = /*#__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
|
});
|
|
@@ -35,22 +35,28 @@ class RowExpandMBNumberEditor extends _react.default.Component {
|
|
|
35
35
|
isShowEditor: false
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const {
|
|
39
|
+
column,
|
|
40
|
+
row
|
|
41
|
+
} = props;
|
|
40
42
|
this.state = {
|
|
41
43
|
isShowEditor: false,
|
|
42
44
|
value: row[column.key]
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
render() {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const {
|
|
49
|
+
column
|
|
50
|
+
} = this.props;
|
|
51
|
+
const {
|
|
52
|
+
value,
|
|
53
|
+
isShowEditor
|
|
54
|
+
} = this.state;
|
|
50
55
|
let formatValue = '';
|
|
51
56
|
if (!isShowEditor && (0, _dtableUtils.isNumber)(value)) {
|
|
52
|
-
const
|
|
53
|
-
data =
|
|
57
|
+
const {
|
|
58
|
+
data = {}
|
|
59
|
+
} = column;
|
|
54
60
|
formatValue = (0, _dtableUtils.getNumberDisplayString)(value, data);
|
|
55
61
|
}
|
|
56
62
|
const dom = isShowEditor ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_NumberEditor.default, {
|