dtable-ui-component 6.0.126-beta.s1 → 6.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ActionSheet/index.js +14 -16
- package/lib/ActivityIndicator/index.js +7 -8
- package/lib/AsyncUserSelect/index.css +19 -46
- package/lib/AsyncUserSelect/index.js +58 -41
- package/lib/AsyncUserSelect/user-item.js +5 -6
- package/lib/AutoNumberFormatter/index.js +3 -4
- package/lib/Badge/index.js +9 -11
- package/lib/ButtonFormatter/index.js +6 -8
- package/lib/CTimeFormatter/index.js +3 -4
- package/lib/CheckboxEditor/index.js +1 -3
- package/lib/CheckboxEditor/mb-editor.js +9 -20
- package/lib/CheckboxEditor/pc-editor.js +12 -24
- package/lib/CheckboxFormatter/index.js +4 -5
- package/lib/CollaboratorEditor/index.js +2 -4
- package/lib/CollaboratorEditor/mb-editor/index.js +11 -19
- package/lib/CollaboratorEditor/pc-editor/index.js +25 -34
- package/lib/CollaboratorFormatter/index.js +8 -10
- package/lib/CollaboratorItem/index.js +4 -5
- package/lib/CollapsibleSettingLayout/index.js +9 -7
- package/lib/Comment/body/comment.js +10 -18
- package/lib/Comment/body/index.js +2 -4
- package/lib/Comment/footer/btns/index.js +4 -7
- package/lib/Comment/footer/index.js +9 -20
- package/lib/Comment/footer/input/index.js +29 -50
- package/lib/Comment/footer/input/participant/index.js +4 -5
- package/lib/Comment/footer/participants/index.js +4 -5
- package/lib/Comment/footer/participants/participant/index.js +1 -3
- package/lib/Comment/footer/participants/participant-select/index.js +8 -24
- package/lib/Comment/index.js +39 -57
- package/lib/Comment/utils/utilities.js +15 -21
- package/lib/CreatorFormatter/index.js +6 -8
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +23 -19
- package/lib/DTableColorPicker/index.css +0 -2
- package/lib/DTableColorPicker/index.js +56 -41
- package/lib/DTableColorPicker/utils.js +4 -6
- package/lib/DTableColumnIcon/index.js +6 -7
- package/lib/DTableCommonAddTool/index.css +1 -3
- package/lib/DTableCommonAddTool/index.js +6 -8
- package/lib/DTableCustomFooter/index.css +1 -3
- package/lib/DTableCustomFooter/index.js +1 -3
- package/lib/DTableCustomizeCollaboratorSelect/index.js +17 -20
- package/lib/DTableCustomizeSelect/index.css +43 -67
- package/lib/DTableCustomizeSelect/index.js +29 -40
- package/lib/DTableDropdownItem/index.js +16 -18
- package/lib/DTableDropdownMenu/index.js +8 -10
- package/lib/DTableEmptyTip/index.js +4 -5
- package/lib/DTableFiltersPopover/index.css +0 -2
- package/lib/DTableFiltersPopover/index.js +26 -41
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -5
- package/lib/DTableFiltersPopover/utils/index.js +63 -113
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -10
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +16 -13
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +18 -15
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +8 -14
- package/lib/DTableFiltersPopover/widgets/filter-group.js +34 -55
- package/lib/DTableFiltersPopover/widgets/filter-item.js +107 -170
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +136 -161
- package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
- package/lib/DTableGroupSelect/index.css +5 -31
- package/lib/DTableGroupSelect/index.js +13 -17
- package/lib/DTableGroupSelect/select-option-group.css +15 -11
- package/lib/DTableGroupSelect/select-option-group.js +31 -43
- package/lib/DTableIcon/index.js +6 -7
- package/lib/DTableIcon/svg-icon.js +5 -7
- package/lib/DTableModalHeader/index.js +1 -3
- package/lib/DTablePopover/index.js +13 -16
- package/lib/DTableRadio/index.js +10 -9
- package/lib/DTableRadioGroup/index.js +8 -17
- package/lib/DTableSearchInput/index.js +19 -29
- package/lib/DTableSelect/dtable-select-label.css +4 -4
- package/lib/DTableSelect/dtable-select-label.js +7 -6
- package/lib/DTableSelect/index.js +24 -25
- package/lib/DTableSelect/user-select.css +46 -7
- package/lib/DTableSelect/utils.js +82 -179
- package/lib/DTableSubDropdownMenu/index.js +8 -10
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.css +0 -1
- package/lib/DTableSwitch/index.js +12 -11
- package/lib/DTableToolTip/index.js +7 -8
- package/lib/DateEditor/index.js +20 -15
- package/lib/DateEditor/mb-editor/index.js +18 -31
- package/lib/DateEditor/pc-editor.js +26 -45
- package/lib/DateFormatter/index.js +4 -5
- package/lib/DatePicker/index.js +9 -15
- package/lib/DatePicker/utils.js +1 -3
- package/lib/DeleteTip/index.js +5 -6
- package/lib/DepartmentMultipleSelectEditor/index.js +25 -23
- package/lib/DepartmentSelectFilter/index.js +6 -8
- package/lib/DepartmentSingleSelectEditor/index.js +1 -3
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +48 -47
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +36 -58
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -19
- package/lib/DepartmentSingleSelectFormatter/index.js +4 -6
- package/lib/DigitalSignEditor/index.js +1 -3
- package/lib/DigitalSignEditor/mb-editor/index.js +12 -20
- package/lib/DigitalSignEditor/pc-editor/index.js +17 -24
- package/lib/DigitalSignEditor/service.js +2 -4
- package/lib/DigitalSignEditor/signature-board/index.js +5 -8
- package/lib/DigitalSignEditor/utils.js +2 -4
- package/lib/DigitalSignFormatter/index.js +12 -15
- package/lib/DigitalSignFormatter/utils.js +4 -5
- package/lib/DurationEditor/index.js +21 -31
- package/lib/DurationFormatter/index.js +4 -5
- package/lib/EditEditorButton/index.js +1 -3
- package/lib/EmailFormatter/index.js +3 -4
- package/lib/FieldDisplaySetting/field-item.js +12 -12
- package/lib/FieldDisplaySetting/index.js +11 -9
- package/lib/FileEditor/files-previewer/index.js +1 -3
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +10 -18
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +7 -8
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +3 -4
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +5 -6
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +14 -21
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +29 -57
- package/lib/FileEditor/index.js +1 -3
- package/lib/FileEditor/mb-editor/index.js +28 -20
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +11 -25
- package/lib/FileEditor/pc-editor/index.js +19 -27
- package/lib/FileFormatter/index.js +26 -19
- package/lib/FileItemFormatter/index.js +6 -9
- package/lib/FileUploader/index.js +28 -45
- package/lib/FormulaFormatter/index.js +15 -29
- package/lib/GeolocationEditor/index.js +11 -12
- package/lib/GeolocationEditor/map-editor-utils.js +17 -15
- package/lib/GeolocationEditor/mb-editor/country-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/index.js +4 -6
- package/lib/GeolocationEditor/mb-editor/location-editor.js +18 -15
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +41 -68
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +50 -89
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/province-editor.js +17 -14
- package/lib/GeolocationEditor/pc-editor/country-editor.js +10 -23
- package/lib/GeolocationEditor/pc-editor/index.js +12 -20
- package/lib/GeolocationEditor/pc-editor/location-editor.js +26 -31
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +34 -54
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +36 -60
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +35 -62
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +36 -65
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +19 -25
- package/lib/GeolocationEditor/pc-editor/province-editor.js +6 -13
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +5 -6
- package/lib/GeolocationEditor/pc-editor/selector-list.js +6 -7
- package/lib/GeolocationFormatter/index.js +4 -5
- package/lib/HtmlLongTextFormatter/index.js +4 -12
- package/lib/Icon/index.js +3 -5
- package/lib/IconButton/index.js +4 -6
- package/lib/ImageEditor/images-previewer/image-preview/index.js +12 -21
- package/lib/ImageEditor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/index.js +1 -3
- package/lib/ImageEditor/mb-editor/index.js +28 -20
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +2 -6
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +7 -21
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/pc-editor/index.js +11 -16
- package/lib/ImageFormatter/images-lazy-load.js +19 -11
- package/lib/ImageFormatter/index.js +11 -13
- package/lib/ImagePreviewerLightbox/index.js +15 -13
- package/lib/ImageThumbnail/index.js +10 -13
- package/lib/InputItem/custom-input.js +26 -46
- package/lib/InputItem/custom-keyboard.js +15 -18
- package/lib/InputItem/index.js +34 -50
- package/lib/InputItem/input.js +2 -4
- package/lib/LastModifierFormatter/index.js +6 -8
- package/lib/LinkEditor/index.js +33 -53
- package/lib/LinkEditor/link-editor-option.js +3 -4
- package/lib/LinkEditor/mb-popover/index.js +9 -22
- package/lib/LinkEditor/pc-popover/index.js +5 -10
- package/lib/LinkFormatter/index.js +21 -37
- package/lib/List/index.js +6 -8
- package/lib/List/list-item.js +22 -28
- package/lib/LongTextFormatter/index.js +4 -5
- package/lib/MBEditorHeader/index.js +7 -8
- package/lib/MTimeFormatter/index.js +3 -4
- package/lib/MobileFullScreenPage/body/index.js +3 -5
- package/lib/MobileFullScreenPage/header/index.js +4 -6
- package/lib/MobileFullScreenPage/index.js +13 -11
- package/lib/MobileModal/index.js +1 -3
- package/lib/MobileOperationSheet/index.js +7 -8
- package/lib/MobileSelector/empty/index.js +1 -3
- package/lib/MobileSelector/index.js +5 -7
- package/lib/MobileSelector/option/index.js +3 -5
- package/lib/MobileSelector/options/index.js +1 -3
- package/lib/MobileSelector/search/index.js +3 -5
- package/lib/MobileUpload/index.js +4 -5
- package/lib/Modal/modal.js +14 -15
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +1 -3
- package/lib/MultipleSelectFormatter/index.js +6 -8
- package/lib/NotificationPopover/index.css +1 -6
- package/lib/NotificationPopover/index.js +6 -7
- package/lib/NumberEditor/index.js +12 -21
- package/lib/NumberFormatter/index.js +4 -5
- package/lib/PhoneNumberLink/index.js +2 -4
- package/lib/Picker/AbstractPicker.js +23 -27
- package/lib/Popover/index.js +3 -4
- package/lib/Popover/item.js +7 -9
- package/lib/Progress/index.js +9 -8
- package/lib/Radio/Radio.js +4 -8
- package/lib/Radio/RadioItem.js +8 -12
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +18 -17
- package/lib/RowExpandDialog/body/index.js +32 -49
- package/lib/RowExpandDialog/column-content/index.js +5 -9
- package/lib/RowExpandDialog/header/index.js +6 -8
- package/lib/RowExpandDialog/index.js +49 -34
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +8 -10
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +22 -33
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +26 -40
- package/lib/RowExpandEditor/date-editor/mb-editor.js +12 -18
- package/lib/RowExpandEditor/date-editor/pc-editor.js +15 -20
- package/lib/RowExpandEditor/department-editor/mb-editor.js +16 -11
- package/lib/RowExpandEditor/department-editor/pc-editor.js +19 -14
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +20 -34
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +21 -35
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +10 -17
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +13 -19
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +9 -19
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +13 -24
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +18 -31
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +17 -29
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +13 -26
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +15 -25
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +13 -23
- package/lib/RowExpandEditor/index.js +4 -8
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +17 -18
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +10 -16
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +11 -19
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +22 -33
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +8 -14
- package/lib/RowExpandEditor/number-editor/pc-editor.js +13 -20
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +12 -25
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +20 -36
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +17 -28
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +22 -34
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +15 -26
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +5 -13
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +9 -18
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -4
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +2 -4
- package/lib/RowExpandFormatter/email-formatter/index.js +4 -7
- package/lib/RowExpandFormatter/file-formatter/index.js +8 -9
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +10 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +19 -34
- package/lib/RowExpandFormatter/image-formatter/index.js +9 -11
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +7 -8
- package/lib/RowExpandFormatter/index.js +27 -41
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +8 -14
- package/lib/RowExpandFormatter/link-formatter/index.js +11 -19
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +3 -5
- package/lib/RowExpandFormatter/rate-formatter/index.js +11 -12
- package/lib/RowExpandFormatter/text/index.js +4 -5
- package/lib/RowExpandFormatter/url-formatter/index.js +4 -7
- package/lib/RowExpandView/body/index.js +22 -35
- package/lib/RowExpandView/column-content/index.js +3 -7
- package/lib/RowExpandView/index.js +42 -30
- package/lib/SelectItem/index.js +5 -7
- package/lib/SelectOptionGroup/index.css +25 -53
- package/lib/SelectOptionGroup/index.js +36 -84
- package/lib/SelectedDepartments/index.js +7 -9
- package/lib/SimpleLongTextFormatter/index.js +10 -16
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +3 -4
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +12 -21
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -4
- package/lib/SingleSelectEditor/index.js +1 -3
- package/lib/SingleSelectFormatter/index.js +8 -9
- package/lib/TabBar/Tab.js +14 -16
- package/lib/TabBar/index.js +18 -21
- package/lib/Tabs/index.js +1 -3
- package/lib/TextEditor/index.js +14 -23
- package/lib/TextFormatter/index.js +3 -4
- package/lib/TextareaItem/index.js +19 -26
- package/lib/Toast/index.js +3 -4
- package/lib/UrlFormatter/index.js +3 -4
- package/lib/common/editor-base.js +7 -12
- package/lib/hooks/common-hooks.js +2 -4
- package/lib/index.js +0 -7
- package/lib/select-editor/index.js +1 -3
- package/lib/select-editor/mb-editor/index.js +17 -28
- package/lib/select-editor/pc-editor/index.js +27 -42
- package/lib/toaster/alert.js +6 -7
- package/lib/toaster/toast.js +2 -3
- package/lib/toaster/toastManager.js +2 -4
- package/lib/utils/cell.js +8 -11
- package/lib/utils/column-utils.js +8 -14
- package/lib/utils/departments.js +1 -3
- package/lib/utils/url.js +24 -31
- package/lib/utils/utils.js +2 -6
- package/package.json +8 -8
- package/lib/DTableCustomizeSearchInput/index.css +0 -81
- package/lib/DTableCustomizeSearchInput/index.js +0 -141
- package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +0 -109
- package/lib/DTableCustomizeSelect/select-option-group/index.css +0 -134
- package/lib/DTableCustomizeSelect/select-option-group/index.js +0 -260
- package/lib/DTableCustomizeSelect/select-option-group/option.js +0 -48
- package/lib/DTableCustomizeSelect/util.js +0 -12
- package/lib/DTableSelect/select-dropdown-indicator/index.css +0 -16
- package/lib/DTableSelect/select-dropdown-indicator/index.js +0 -26
- package/lib/DTableSelect/select-style.js +0 -133
- package/lib/assets/icons/close.svg +0 -1
- package/lib/assets/icons/down.svg +0 -3
|
@@ -31,14 +31,11 @@ class RowExpandMBGeolocationEditor extends _react.default.Component {
|
|
|
31
31
|
this.props.onCommit(value);
|
|
32
32
|
};
|
|
33
33
|
this.getLocationInfo = value => {
|
|
34
|
-
const
|
|
35
|
-
column,
|
|
36
|
-
config
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
dtableBaiduMapKey,
|
|
40
|
-
dtableMineMapKey
|
|
41
|
-
} = config;
|
|
34
|
+
const _this$props = this.props,
|
|
35
|
+
column = _this$props.column,
|
|
36
|
+
config = _this$props.config;
|
|
37
|
+
const dtableBaiduMapKey = config.dtableBaiduMapKey,
|
|
38
|
+
dtableMineMapKey = config.dtableMineMapKey;
|
|
42
39
|
const isBaiduMap = !!(dtableBaiduMapKey || dtableMineMapKey);
|
|
43
40
|
return (0, _dtableUtils.getGeolocationDisplayString)(value, column.data, {
|
|
44
41
|
isBaiduMap,
|
|
@@ -46,9 +43,7 @@ class RowExpandMBGeolocationEditor extends _react.default.Component {
|
|
|
46
43
|
});
|
|
47
44
|
};
|
|
48
45
|
this.renderGeoLocation = () => {
|
|
49
|
-
const
|
|
50
|
-
value
|
|
51
|
-
} = this.state;
|
|
46
|
+
const value = this.state.value;
|
|
52
47
|
const text = (0, _dtableUtils.isEmptyObject)(value) ? (0, _lang.getLocale)('Edit_Location') : this.getLocationInfo(value);
|
|
53
48
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_addBtn.default, {
|
|
54
49
|
onClick: this.openEditor,
|
|
@@ -56,22 +51,18 @@ class RowExpandMBGeolocationEditor extends _react.default.Component {
|
|
|
56
51
|
className: "py-4"
|
|
57
52
|
});
|
|
58
53
|
};
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
valueKey
|
|
63
|
-
} = props;
|
|
54
|
+
const row = props.row,
|
|
55
|
+
_column = props.column,
|
|
56
|
+
valueKey = props.valueKey;
|
|
64
57
|
this.state = {
|
|
65
58
|
isShowEditor: false,
|
|
66
59
|
value: row[_column[valueKey]] || {}
|
|
67
60
|
};
|
|
68
61
|
}
|
|
69
62
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
valueKey
|
|
74
|
-
} = nextProps;
|
|
63
|
+
const column = nextProps.column,
|
|
64
|
+
row = nextProps.row,
|
|
65
|
+
valueKey = nextProps.valueKey;
|
|
75
66
|
if (row._id !== this.props.row._id) {
|
|
76
67
|
this.setState({
|
|
77
68
|
value: row[column[valueKey]] || {},
|
|
@@ -80,14 +71,11 @@ class RowExpandMBGeolocationEditor extends _react.default.Component {
|
|
|
80
71
|
}
|
|
81
72
|
}
|
|
82
73
|
render() {
|
|
83
|
-
const
|
|
84
|
-
column,
|
|
85
|
-
row,
|
|
86
|
-
config
|
|
87
|
-
|
|
88
|
-
const {
|
|
89
|
-
value
|
|
90
|
-
} = this.state;
|
|
74
|
+
const _this$props2 = this.props,
|
|
75
|
+
column = _this$props2.column,
|
|
76
|
+
row = _this$props2.row,
|
|
77
|
+
config = _this$props2.config;
|
|
78
|
+
const value = this.state.value;
|
|
91
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
92
80
|
children: [this.renderGeoLocation(), this.state.isShowEditor && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeolocationEditor.default, {
|
|
93
81
|
column: column,
|
|
@@ -69,12 +69,8 @@ class RowExpandPCGeolocationEditor extends _react.default.Component {
|
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
71
|
this.renderGeoLocation = () => {
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
} = this.props;
|
|
75
|
-
let {
|
|
76
|
-
value
|
|
77
|
-
} = this.state;
|
|
72
|
+
let isEditorFocus = this.props.isEditorFocus;
|
|
73
|
+
let value = this.state.value;
|
|
78
74
|
if (!(0, _dtableUtils.isEmptyObject)(value)) {
|
|
79
75
|
const displayContent = this.getLocationInfo(value);
|
|
80
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -97,18 +93,14 @@ class RowExpandPCGeolocationEditor extends _react.default.Component {
|
|
|
97
93
|
});
|
|
98
94
|
};
|
|
99
95
|
this.getLocationInfo = value => {
|
|
100
|
-
const
|
|
101
|
-
column
|
|
102
|
-
} = this.props;
|
|
96
|
+
const column = this.props.column;
|
|
103
97
|
return (0, _dtableUtils.getGeolocationDisplayString)(value, column.data, {
|
|
104
98
|
hyphen: ' '
|
|
105
99
|
});
|
|
106
100
|
};
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
valueKey
|
|
111
|
-
} = props;
|
|
101
|
+
const row = props.row,
|
|
102
|
+
_column = props.column,
|
|
103
|
+
valueKey = props.valueKey;
|
|
112
104
|
this.state = {
|
|
113
105
|
isShowEditor: false,
|
|
114
106
|
value: row[_column[valueKey]] || {}
|
|
@@ -121,11 +113,9 @@ class RowExpandPCGeolocationEditor extends _react.default.Component {
|
|
|
121
113
|
document.addEventListener('keydown', this.onKeyDown);
|
|
122
114
|
}
|
|
123
115
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
valueKey
|
|
128
|
-
} = nextProps;
|
|
116
|
+
const column = nextProps.column,
|
|
117
|
+
row = nextProps.row,
|
|
118
|
+
valueKey = nextProps.valueKey;
|
|
129
119
|
if (row._id !== this.props.row._id) {
|
|
130
120
|
this.setState({
|
|
131
121
|
value: row[column[valueKey]] || {},
|
|
@@ -148,13 +138,10 @@ class RowExpandPCGeolocationEditor extends _react.default.Component {
|
|
|
148
138
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
149
139
|
}
|
|
150
140
|
render() {
|
|
151
|
-
const
|
|
152
|
-
column,
|
|
153
|
-
config
|
|
154
|
-
|
|
155
|
-
const {
|
|
156
|
-
value
|
|
157
|
-
} = this.state;
|
|
141
|
+
const _this$props = this.props,
|
|
142
|
+
column = _this$props.column,
|
|
143
|
+
config = _this$props.config;
|
|
144
|
+
const value = this.state.value;
|
|
158
145
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
159
146
|
ref: ref => this.editorContainer = ref,
|
|
160
147
|
className: "mt-2",
|
|
@@ -41,12 +41,8 @@ class RowExpandMBImageEditor extends _react.default.Component {
|
|
|
41
41
|
this.props.onCommit(updatedValue);
|
|
42
42
|
};
|
|
43
43
|
this.renderImages = () => {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
} = this.state;
|
|
47
|
-
const {
|
|
48
|
-
config
|
|
49
|
-
} = this.props;
|
|
44
|
+
const value = this.state.value;
|
|
45
|
+
const config = this.props.config;
|
|
50
46
|
return value.map((src, index) => {
|
|
51
47
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageThumbnail.default, {
|
|
52
48
|
index: index,
|
|
@@ -58,22 +54,18 @@ class RowExpandMBImageEditor extends _react.default.Component {
|
|
|
58
54
|
}, "image-".concat(index));
|
|
59
55
|
});
|
|
60
56
|
};
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
valueKey
|
|
65
|
-
} = props;
|
|
57
|
+
const column = props.column,
|
|
58
|
+
row = props.row,
|
|
59
|
+
valueKey = props.valueKey;
|
|
66
60
|
this.state = {
|
|
67
61
|
isShowEditor: false,
|
|
68
62
|
value: row[column[valueKey]] || []
|
|
69
63
|
};
|
|
70
64
|
}
|
|
71
65
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
valueKey
|
|
76
|
-
} = nextProps;
|
|
66
|
+
const column = nextProps.column,
|
|
67
|
+
row = nextProps.row,
|
|
68
|
+
valueKey = nextProps.valueKey;
|
|
77
69
|
if (row._id !== this.props.row._id) {
|
|
78
70
|
this.setState({
|
|
79
71
|
value: row[column[valueKey]] || [],
|
|
@@ -82,15 +74,13 @@ class RowExpandMBImageEditor extends _react.default.Component {
|
|
|
82
74
|
}
|
|
83
75
|
}
|
|
84
76
|
render() {
|
|
85
|
-
const
|
|
86
|
-
column,
|
|
87
|
-
config,
|
|
88
|
-
uploadFile
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
value
|
|
93
|
-
} = this.state;
|
|
77
|
+
const _this$props = this.props,
|
|
78
|
+
column = _this$props.column,
|
|
79
|
+
config = _this$props.config,
|
|
80
|
+
uploadFile = _this$props.uploadFile;
|
|
81
|
+
const _this$state = this.state,
|
|
82
|
+
isShowEditor = _this$state.isShowEditor,
|
|
83
|
+
value = _this$state.value;
|
|
94
84
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
95
85
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
96
86
|
className: "dtable-ui-mobile-row-expand-image position-relative",
|
|
@@ -65,14 +65,11 @@ 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
|
-
|
|
73
|
-
let {
|
|
74
|
-
imageContainer
|
|
75
|
-
} = this.state;
|
|
68
|
+
let _this$props = this.props,
|
|
69
|
+
column = _this$props.column,
|
|
70
|
+
row = _this$props.row,
|
|
71
|
+
valueKey = _this$props.valueKey;
|
|
72
|
+
let imageContainer = this.state.imageContainer;
|
|
76
73
|
return imageContainer ? imageContainer : row[column[valueKey]];
|
|
77
74
|
};
|
|
78
75
|
this.deleteImage = index => {
|
|
@@ -85,9 +82,7 @@ class RowExpandPCImageEditor extends _react.default.Component {
|
|
|
85
82
|
this.props.onCommit(updatedValue);
|
|
86
83
|
};
|
|
87
84
|
this.getImageArray = value => {
|
|
88
|
-
const
|
|
89
|
-
config
|
|
90
|
-
} = this.props;
|
|
85
|
+
const config = this.props.config;
|
|
91
86
|
return value.map((imageSrc, index) => {
|
|
92
87
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageThumbnail.default, {
|
|
93
88
|
index: index,
|
|
@@ -108,11 +103,9 @@ class RowExpandPCImageEditor extends _react.default.Component {
|
|
|
108
103
|
document.addEventListener('keydown', this.onKeyDown);
|
|
109
104
|
}
|
|
110
105
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
valueKey
|
|
115
|
-
} = nextProps;
|
|
106
|
+
const column = nextProps.column,
|
|
107
|
+
row = nextProps.row,
|
|
108
|
+
valueKey = nextProps.valueKey;
|
|
116
109
|
if (row._id !== this.props.row._id) {
|
|
117
110
|
this.setState({
|
|
118
111
|
imageContainer: row[column[valueKey]] || [],
|
|
@@ -135,13 +128,10 @@ class RowExpandPCImageEditor extends _react.default.Component {
|
|
|
135
128
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
136
129
|
}
|
|
137
130
|
render() {
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
isShowImageEditor,
|
|
143
|
-
largeImageIndex
|
|
144
|
-
} = this.state;
|
|
131
|
+
const isEditorFocus = this.props.isEditorFocus;
|
|
132
|
+
let _this$state = this.state,
|
|
133
|
+
isShowImageEditor = _this$state.isShowImageEditor,
|
|
134
|
+
largeImageIndex = _this$state.largeImageIndex;
|
|
145
135
|
let value = this.getValue();
|
|
146
136
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
147
137
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -12,18 +12,14 @@ var _constants = require("./constants");
|
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
const _excluded = ["column", "component"];
|
|
14
14
|
const RowExpandEditor = _ref => {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
component
|
|
18
|
-
} = _ref,
|
|
15
|
+
let column = _ref.column,
|
|
16
|
+
component = _ref.component,
|
|
19
17
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
20
18
|
const components = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _constants.CELL_EDITOR_MAP), component);
|
|
21
19
|
const Editor = components[column.type];
|
|
22
20
|
if (!Editor) return null;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
valueKey
|
|
26
|
-
} = props;
|
|
21
|
+
const row = props.row,
|
|
22
|
+
valueKey = props.valueKey;
|
|
27
23
|
const value = row[column[valueKey]];
|
|
28
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Editor, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
29
25
|
value: value,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _seafileEditor = require("@seafile/seafile-editor");
|
|
11
12
|
var _TextareaItem = _interopRequireDefault(require("../../../../TextareaItem"));
|
|
@@ -13,18 +14,17 @@ var _MobileFullScreenPage = _interopRequireDefault(require("../../../../MobileFu
|
|
|
13
14
|
var _lang = require("../../../../lang");
|
|
14
15
|
require("./index.css");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
Body
|
|
19
|
-
} = _MobileFullScreenPage.default;
|
|
17
|
+
const Header = _MobileFullScreenPage.default.Header,
|
|
18
|
+
Body = _MobileFullScreenPage.default.Body;
|
|
20
19
|
const Editor = _ref => {
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
let oldValue = _ref.value,
|
|
21
|
+
title = _ref.title,
|
|
22
|
+
onToggle = _ref.onToggle,
|
|
23
|
+
onChange = _ref.onChange;
|
|
24
|
+
const _useState = (0, _react.useState)(oldValue || ''),
|
|
25
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
|
+
value = _useState2[0],
|
|
27
|
+
setValue = _useState2[1];
|
|
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,12 +34,11 @@ 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
|
|
42
|
-
} = (0, _seafileEditor.getPreviewContent)(value);
|
|
37
|
+
const _getPreviewContent = (0, _seafileEditor.getPreviewContent)(value),
|
|
38
|
+
previewText = _getPreviewContent.previewText,
|
|
39
|
+
images = _getPreviewContent.images,
|
|
40
|
+
links = _getPreviewContent.links,
|
|
41
|
+
checklist = _getPreviewContent.checklist;
|
|
43
42
|
const newValue = Object.assign({}, {
|
|
44
43
|
text: value,
|
|
45
44
|
preview: previewText,
|
|
@@ -48,15 +48,12 @@ 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
|
-
|
|
57
|
-
column: currentColumn,
|
|
58
|
-
row: currentRow
|
|
59
|
-
} = this.props;
|
|
51
|
+
const column = nextProps.column,
|
|
52
|
+
row = nextProps.row,
|
|
53
|
+
valueKey = nextProps.valueKey;
|
|
54
|
+
const _this$props = this.props,
|
|
55
|
+
currentColumn = _this$props.column,
|
|
56
|
+
currentRow = _this$props.row;
|
|
60
57
|
const value = row[column[valueKey]];
|
|
61
58
|
const currentValue = currentRow[currentColumn[valueKey]];
|
|
62
59
|
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)) {
|
|
@@ -64,13 +61,10 @@ class RowExpandMBLongTextEditor extends _react.default.Component {
|
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
63
|
render() {
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
innerHtml,
|
|
72
|
-
isShowEditor
|
|
73
|
-
} = this.state;
|
|
64
|
+
const column = this.props.column;
|
|
65
|
+
const _this$state = this.state,
|
|
66
|
+
innerHtml = _this$state.innerHtml,
|
|
67
|
+
isShowEditor = _this$state.isShowEditor;
|
|
74
68
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
75
69
|
children: [innerHtml ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
76
70
|
className: "dtable-ui-mobile-long-text-formatter article py-2",
|
|
@@ -47,9 +47,7 @@ class RowExpandPCLongTextEditor extends _react.default.Component {
|
|
|
47
47
|
this.editorRef.current.closeEditor();
|
|
48
48
|
};
|
|
49
49
|
this.onClick = () => {
|
|
50
|
-
const
|
|
51
|
-
columnIndex
|
|
52
|
-
} = this.props;
|
|
50
|
+
const columnIndex = this.props.columnIndex;
|
|
53
51
|
this.props.updateTabIndex && this.props.updateTabIndex(columnIndex);
|
|
54
52
|
};
|
|
55
53
|
this.state = {
|
|
@@ -63,17 +61,14 @@ class RowExpandPCLongTextEditor extends _react.default.Component {
|
|
|
63
61
|
}
|
|
64
62
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
65
63
|
var _this$editorRef, _this$editorRef$curre;
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
row: currentRow,
|
|
75
|
-
isEditorFocus
|
|
76
|
-
} = this.props;
|
|
64
|
+
const column = nextProps.column,
|
|
65
|
+
row = nextProps.row,
|
|
66
|
+
nextIsEditorFocus = nextProps.isEditorFocus,
|
|
67
|
+
valueKey = nextProps.valueKey;
|
|
68
|
+
const _this$props = this.props,
|
|
69
|
+
currentColumn = _this$props.column,
|
|
70
|
+
currentRow = _this$props.row,
|
|
71
|
+
isEditorFocus = _this$props.isEditorFocus;
|
|
77
72
|
const value = row[column[valueKey]];
|
|
78
73
|
const currentValue = currentRow[currentColumn[valueKey]];
|
|
79
74
|
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)) {
|
|
@@ -91,15 +86,13 @@ class RowExpandPCLongTextEditor extends _react.default.Component {
|
|
|
91
86
|
}
|
|
92
87
|
}
|
|
93
88
|
render() {
|
|
94
|
-
const
|
|
95
|
-
column,
|
|
96
|
-
longTextEditorAPI,
|
|
97
|
-
longTextEditorI18n
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
value
|
|
102
|
-
} = this.state;
|
|
89
|
+
const _this$props2 = this.props,
|
|
90
|
+
column = _this$props2.column,
|
|
91
|
+
longTextEditorAPI = _this$props2.longTextEditorAPI,
|
|
92
|
+
longTextEditorI18n = _this$props2.longTextEditorI18n;
|
|
93
|
+
const _this$state = this.state,
|
|
94
|
+
isLoading = _this$state.isLoading,
|
|
95
|
+
value = _this$state.value;
|
|
103
96
|
if (isLoading) return null;
|
|
104
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Suspense, {
|
|
105
98
|
fallback: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -19,9 +19,7 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
|
|
|
19
19
|
constructor(_props) {
|
|
20
20
|
super(_props);
|
|
21
21
|
this.getOptions = props => {
|
|
22
|
-
const
|
|
23
|
-
column
|
|
24
|
-
} = props;
|
|
22
|
+
const column = props.column;
|
|
25
23
|
return (0, _dtableUtils.getColumnOptions)(column);
|
|
26
24
|
};
|
|
27
25
|
this.toggleEditor = value => {
|
|
@@ -65,9 +63,7 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
|
|
|
65
63
|
this.props.onCommit(newValue);
|
|
66
64
|
};
|
|
67
65
|
this.renderOptions = () => {
|
|
68
|
-
const
|
|
69
|
-
value
|
|
70
|
-
} = this.state;
|
|
66
|
+
const value = this.state.value;
|
|
71
67
|
let displayOptions = [];
|
|
72
68
|
if (Array.isArray(value)) {
|
|
73
69
|
const selectedOptions = this.options.filter(option => value.includes(option[this.key]));
|
|
@@ -114,10 +110,8 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
|
|
|
114
110
|
this.options = this.getOptions(_props);
|
|
115
111
|
}
|
|
116
112
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
column
|
|
120
|
-
} = nextProps;
|
|
113
|
+
const value = nextProps.value,
|
|
114
|
+
column = nextProps.column;
|
|
121
115
|
if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
|
|
122
116
|
this.options = this.getOptions(nextProps);
|
|
123
117
|
this.setState({
|
|
@@ -127,15 +121,13 @@ class RowExpandMBMultipleSelectEditor extends _react.default.Component {
|
|
|
127
121
|
}
|
|
128
122
|
}
|
|
129
123
|
render() {
|
|
130
|
-
const
|
|
131
|
-
column,
|
|
132
|
-
isSupportNewOption,
|
|
133
|
-
onAddNewOption
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
value
|
|
138
|
-
} = this.state;
|
|
124
|
+
const _this$props = this.props,
|
|
125
|
+
column = _this$props.column,
|
|
126
|
+
isSupportNewOption = _this$props.isSupportNewOption,
|
|
127
|
+
onAddNewOption = _this$props.onAddNewOption;
|
|
128
|
+
const _this$state = this.state,
|
|
129
|
+
showEditor = _this$state.showEditor,
|
|
130
|
+
value = _this$state.value;
|
|
139
131
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
140
132
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
141
133
|
className: "dtable-ui dtable-ui-mobile-row-expand-options-editor position-relative",
|
|
@@ -18,9 +18,7 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
18
18
|
constructor(_props) {
|
|
19
19
|
super(_props);
|
|
20
20
|
this.getOptions = props => {
|
|
21
|
-
const
|
|
22
|
-
column
|
|
23
|
-
} = props;
|
|
21
|
+
const column = props.column;
|
|
24
22
|
return (0, _dtableUtils.getColumnOptions)(column);
|
|
25
23
|
};
|
|
26
24
|
this.onKeyDown = e => {
|
|
@@ -51,10 +49,9 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
51
49
|
this.onToggleSelect = e => {
|
|
52
50
|
e.preventDefault();
|
|
53
51
|
e.stopPropagation();
|
|
54
|
-
const
|
|
55
|
-
updateTabIndex,
|
|
56
|
-
columnIndex
|
|
57
|
-
} = this.props;
|
|
52
|
+
const _this$props = this.props,
|
|
53
|
+
updateTabIndex = _this$props.updateTabIndex,
|
|
54
|
+
columnIndex = _this$props.columnIndex;
|
|
58
55
|
updateTabIndex && updateTabIndex(columnIndex);
|
|
59
56
|
this.toggleSingleSelect(true);
|
|
60
57
|
};
|
|
@@ -62,10 +59,9 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
62
59
|
this.toggleSingleSelect(false);
|
|
63
60
|
};
|
|
64
61
|
this.onFocus = () => {
|
|
65
|
-
const
|
|
66
|
-
updateTabIndex,
|
|
67
|
-
columnIndex
|
|
68
|
-
} = this.props;
|
|
62
|
+
const _this$props2 = this.props,
|
|
63
|
+
updateTabIndex = _this$props2.updateTabIndex,
|
|
64
|
+
columnIndex = _this$props2.columnIndex;
|
|
69
65
|
updateTabIndex && updateTabIndex(columnIndex);
|
|
70
66
|
};
|
|
71
67
|
this.onChange = option => {
|
|
@@ -87,9 +83,7 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
87
83
|
this.onChange(option);
|
|
88
84
|
};
|
|
89
85
|
this.getMultipleSelectList = () => {
|
|
90
|
-
const
|
|
91
|
-
value
|
|
92
|
-
} = this.state;
|
|
86
|
+
const value = this.state.value;
|
|
93
87
|
if (!Array.isArray(value)) return [];
|
|
94
88
|
const selectedOptions = this.options.filter(option => value.includes(option[this.key]));
|
|
95
89
|
const selectedOptionIds = selectedOptions.map(option => option[this.key]);
|
|
@@ -150,11 +144,10 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
150
144
|
}));
|
|
151
145
|
};
|
|
152
146
|
this.renderOptions = () => {
|
|
153
|
-
const
|
|
154
|
-
isEditorFocus,
|
|
155
|
-
classNamePrefix,
|
|
156
|
-
placeholder
|
|
157
|
-
} = this.props;
|
|
147
|
+
const _this$props3 = this.props,
|
|
148
|
+
isEditorFocus = _this$props3.isEditorFocus,
|
|
149
|
+
classNamePrefix = _this$props3.classNamePrefix,
|
|
150
|
+
placeholder = _this$props3.placeholder;
|
|
158
151
|
const options = this.getMultipleSelectList();
|
|
159
152
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
160
153
|
tabIndex: 0,
|
|
@@ -201,10 +194,8 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
201
194
|
document.addEventListener('keydown', this.onKeyDown);
|
|
202
195
|
}
|
|
203
196
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
column
|
|
207
|
-
} = nextProps;
|
|
197
|
+
const value = nextProps.value,
|
|
198
|
+
column = nextProps.column;
|
|
208
199
|
if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
|
|
209
200
|
this.options = this.getOptions(nextProps);
|
|
210
201
|
this.setState({
|
|
@@ -227,16 +218,14 @@ class RowExpandPCMultipleSelectEditor extends _react.default.Component {
|
|
|
227
218
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
228
219
|
}
|
|
229
220
|
render() {
|
|
230
|
-
const
|
|
231
|
-
column,
|
|
232
|
-
isSupportNewOption,
|
|
233
|
-
onAddNewOption,
|
|
234
|
-
classNamePrefix
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
value
|
|
239
|
-
} = this.state;
|
|
221
|
+
const _this$props4 = this.props,
|
|
222
|
+
column = _this$props4.column,
|
|
223
|
+
isSupportNewOption = _this$props4.isSupportNewOption,
|
|
224
|
+
onAddNewOption = _this$props4.onAddNewOption,
|
|
225
|
+
classNamePrefix = _this$props4.classNamePrefix;
|
|
226
|
+
const _this$state = this.state,
|
|
227
|
+
showSelectPopover = _this$state.showSelectPopover,
|
|
228
|
+
value = _this$state.value;
|
|
240
229
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
241
230
|
className: "position-relative w-100",
|
|
242
231
|
ref: ref => this.ref = ref,
|
|
@@ -35,28 +35,22 @@ class RowExpandMBNumberEditor extends _react.default.Component {
|
|
|
35
35
|
isShowEditor: false
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
row
|
|
41
|
-
} = props;
|
|
38
|
+
const column = props.column,
|
|
39
|
+
row = props.row;
|
|
42
40
|
this.state = {
|
|
43
41
|
isShowEditor: false,
|
|
44
42
|
value: row[column.key]
|
|
45
43
|
};
|
|
46
44
|
}
|
|
47
45
|
render() {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
value,
|
|
53
|
-
isShowEditor
|
|
54
|
-
} = this.state;
|
|
46
|
+
const column = this.props.column;
|
|
47
|
+
const _this$state = this.state,
|
|
48
|
+
value = _this$state.value,
|
|
49
|
+
isShowEditor = _this$state.isShowEditor;
|
|
55
50
|
let formatValue = '';
|
|
56
51
|
if (!isShowEditor && (0, _dtableUtils.isNumber)(value)) {
|
|
57
|
-
const
|
|
58
|
-
data = {}
|
|
59
|
-
} = column;
|
|
52
|
+
const _column$data = column.data,
|
|
53
|
+
data = _column$data === void 0 ? {} : _column$data;
|
|
60
54
|
formatValue = (0, _dtableUtils.getNumberDisplayString)(value, data);
|
|
61
55
|
}
|
|
62
56
|
const dom = isShowEditor ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_NumberEditor.default, {
|