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
|
@@ -34,17 +34,21 @@ class RowExpandPCNumberEditor extends _react.default.Component {
|
|
|
34
34
|
isShowEditor: false
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const {
|
|
38
|
+
column,
|
|
39
|
+
row,
|
|
40
|
+
isEditorFocus
|
|
41
|
+
} = props;
|
|
40
42
|
this.state = {
|
|
41
43
|
isShowEditor: isEditorFocus || false,
|
|
42
44
|
value: row[column.key]
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
+
const {
|
|
49
|
+
column,
|
|
50
|
+
row
|
|
51
|
+
} = nextProps;
|
|
48
52
|
if (row._id !== this.props.row._id) {
|
|
49
53
|
this.setState({
|
|
50
54
|
value: row[column.key],
|
|
@@ -62,12 +66,14 @@ class RowExpandPCNumberEditor extends _react.default.Component {
|
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
render() {
|
|
65
|
-
let
|
|
66
|
-
column
|
|
67
|
-
isInModal
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
let {
|
|
70
|
+
column,
|
|
71
|
+
isInModal
|
|
72
|
+
} = this.props;
|
|
73
|
+
let {
|
|
74
|
+
value,
|
|
75
|
+
isShowEditor
|
|
76
|
+
} = this.state;
|
|
71
77
|
if (isShowEditor) {
|
|
72
78
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NumberEditor.default, {
|
|
73
79
|
isInModal: isInModal,
|
|
@@ -79,8 +85,9 @@ class RowExpandPCNumberEditor extends _react.default.Component {
|
|
|
79
85
|
}
|
|
80
86
|
let formatValue = '';
|
|
81
87
|
if ((0, _dtableUtils.isNumber)(value)) {
|
|
82
|
-
let
|
|
83
|
-
data =
|
|
88
|
+
let {
|
|
89
|
+
data = {}
|
|
90
|
+
} = column;
|
|
84
91
|
formatValue = (0, _dtableUtils.getNumberDisplayString)(value, data);
|
|
85
92
|
}
|
|
86
93
|
return /*#__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"));
|
|
@@ -17,14 +16,16 @@ const RowExpandRateEditor = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
17
16
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
18
17
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
19
18
|
query: "(min-width: 768px)",
|
|
20
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
19
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
20
|
+
...props,
|
|
21
21
|
ref: ref
|
|
22
|
-
})
|
|
22
|
+
})
|
|
23
23
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
24
24
|
query: "(max-width: 768px)",
|
|
25
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
25
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
26
|
+
...props,
|
|
26
27
|
ref: ref
|
|
27
|
-
})
|
|
28
|
+
})
|
|
28
29
|
})]
|
|
29
30
|
});
|
|
30
31
|
});
|
|
@@ -13,7 +13,9 @@ class RowExpandMBRateEditor extends _react.default.Component {
|
|
|
13
13
|
super(props);
|
|
14
14
|
this.onChangeRateNumber = index => {
|
|
15
15
|
if (!this.canEdit) return;
|
|
16
|
-
const
|
|
16
|
+
const {
|
|
17
|
+
value
|
|
18
|
+
} = this.state;
|
|
17
19
|
const newValue = value === index ? '' : index;
|
|
18
20
|
this.setState({
|
|
19
21
|
value: newValue
|
|
@@ -21,12 +23,17 @@ class RowExpandMBRateEditor extends _react.default.Component {
|
|
|
21
23
|
this.props.onCommit(newValue);
|
|
22
24
|
};
|
|
23
25
|
this.getRateMaxStar = () => {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const {
|
|
27
|
+
value
|
|
28
|
+
} = this.state;
|
|
29
|
+
const {
|
|
30
|
+
column
|
|
31
|
+
} = this.props;
|
|
32
|
+
const {
|
|
33
|
+
rate_max_number,
|
|
34
|
+
rate_style_color,
|
|
35
|
+
rate_style_type
|
|
36
|
+
} = column.data || {};
|
|
30
37
|
const rateShowType = rate_style_type ? rate_style_type : 'dtable-icon-rate';
|
|
31
38
|
let rateList = [];
|
|
32
39
|
for (let i = 0; i < rate_max_number; i++) {
|
|
@@ -42,7 +49,7 @@ class RowExpandMBRateEditor extends _react.default.Component {
|
|
|
42
49
|
'rate-item-active': value >= rateItemIndex
|
|
43
50
|
}),
|
|
44
51
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
45
|
-
className:
|
|
52
|
+
className: `dtable-font ${rateShowType}`
|
|
46
53
|
})
|
|
47
54
|
}, i);
|
|
48
55
|
rateList.push(rateItem);
|
|
@@ -52,14 +59,20 @@ class RowExpandMBRateEditor extends _react.default.Component {
|
|
|
52
59
|
this.state = {
|
|
53
60
|
value: props.value || ''
|
|
54
61
|
};
|
|
55
|
-
let
|
|
56
|
-
|
|
62
|
+
let {
|
|
63
|
+
column: _column
|
|
64
|
+
} = this.props;
|
|
65
|
+
const {
|
|
66
|
+
editable
|
|
67
|
+
} = _column;
|
|
57
68
|
this.canEdit = editable;
|
|
58
69
|
}
|
|
59
70
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
const {
|
|
72
|
+
column,
|
|
73
|
+
row,
|
|
74
|
+
valueKey
|
|
75
|
+
} = nextProps;
|
|
63
76
|
if (row._id !== this.props.row._id) {
|
|
64
77
|
this.setState({
|
|
65
78
|
value: row[column[valueKey]] || ''
|
|
@@ -5,7 +5,6 @@ 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
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _lang = require("../../lang");
|
|
@@ -15,12 +14,14 @@ class RowExpandPCRateEditor extends _react.default.Component {
|
|
|
15
14
|
super(props);
|
|
16
15
|
this.onKeyDown = event => {
|
|
17
16
|
event.stopPropagation();
|
|
18
|
-
const
|
|
19
|
-
isEditorFocus
|
|
20
|
-
column
|
|
17
|
+
const {
|
|
18
|
+
isEditorFocus,
|
|
19
|
+
column
|
|
20
|
+
} = this.props;
|
|
21
21
|
if (!isEditorFocus || !this.canEdit) return;
|
|
22
|
-
const
|
|
23
|
-
rate_max_number
|
|
22
|
+
const {
|
|
23
|
+
rate_max_number
|
|
24
|
+
} = column.data || {};
|
|
24
25
|
const currentInputNum = Number(event.key);
|
|
25
26
|
const isValidNumber = currentInputNum <= rate_max_number;
|
|
26
27
|
if (isValidNumber) {
|
|
@@ -30,7 +31,9 @@ class RowExpandPCRateEditor extends _react.default.Component {
|
|
|
30
31
|
this.onChangeRateNumber = index => {
|
|
31
32
|
this.props.updateTabIndex(this.props.columnIndex);
|
|
32
33
|
if (!this.canEdit) return;
|
|
33
|
-
const
|
|
34
|
+
const {
|
|
35
|
+
value
|
|
36
|
+
} = this.state;
|
|
34
37
|
let newValue = value === index ? '' : index;
|
|
35
38
|
this.setState({
|
|
36
39
|
value: newValue
|
|
@@ -52,16 +55,22 @@ class RowExpandPCRateEditor extends _react.default.Component {
|
|
|
52
55
|
}
|
|
53
56
|
};
|
|
54
57
|
this.getRateMaxStar = () => {
|
|
55
|
-
const
|
|
56
|
-
enterRateItemIndex
|
|
57
|
-
value
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
const {
|
|
59
|
+
enterRateItemIndex,
|
|
60
|
+
value
|
|
61
|
+
} = this.state;
|
|
62
|
+
const {
|
|
63
|
+
column
|
|
64
|
+
} = this.props;
|
|
65
|
+
const {
|
|
66
|
+
rate_max_number,
|
|
67
|
+
rate_style_color,
|
|
68
|
+
rate_style_type
|
|
69
|
+
} = column.data || {};
|
|
63
70
|
const rateShowType = rate_style_type ? rate_style_type : 'dtable-icon-rate';
|
|
64
|
-
const
|
|
71
|
+
const {
|
|
72
|
+
editable
|
|
73
|
+
} = column;
|
|
65
74
|
let rateList = [];
|
|
66
75
|
for (let i = 0; i < rate_max_number; i++) {
|
|
67
76
|
const rateItemIndex = i + 1;
|
|
@@ -71,10 +80,11 @@ class RowExpandPCRateEditor extends _react.default.Component {
|
|
|
71
80
|
};
|
|
72
81
|
let style = itemStyle;
|
|
73
82
|
if (enterRateItemIndex >= rateItemIndex) {
|
|
74
|
-
style =
|
|
83
|
+
style = {
|
|
84
|
+
...itemStyle,
|
|
75
85
|
color: rate_style_color,
|
|
76
86
|
opacity: 0.4
|
|
77
|
-
}
|
|
87
|
+
};
|
|
78
88
|
}
|
|
79
89
|
let rateItem = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
80
90
|
onMouseEnter: this.onMouseEnterRateItem.bind(this, rateItemIndex),
|
|
@@ -83,7 +93,7 @@ class RowExpandPCRateEditor extends _react.default.Component {
|
|
|
83
93
|
style: style,
|
|
84
94
|
className: value >= rateItemIndex ? 'rate-item-active' : '',
|
|
85
95
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
86
|
-
className:
|
|
96
|
+
className: `dtable-font ${rateShowType}`
|
|
87
97
|
})
|
|
88
98
|
}, i);
|
|
89
99
|
rateList.push(rateItem);
|
|
@@ -94,14 +104,20 @@ class RowExpandPCRateEditor extends _react.default.Component {
|
|
|
94
104
|
value: props.value || '',
|
|
95
105
|
enterRateItemIndex: -1
|
|
96
106
|
};
|
|
97
|
-
let
|
|
98
|
-
|
|
107
|
+
let {
|
|
108
|
+
column: _column
|
|
109
|
+
} = this.props;
|
|
110
|
+
const {
|
|
111
|
+
editable: _editable
|
|
112
|
+
} = _column;
|
|
99
113
|
this.canEdit = _editable;
|
|
100
114
|
}
|
|
101
115
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
116
|
+
const {
|
|
117
|
+
column,
|
|
118
|
+
row,
|
|
119
|
+
valueKey
|
|
120
|
+
} = nextProps;
|
|
105
121
|
if (row._id !== this.props.row._id) {
|
|
106
122
|
this.setState({
|
|
107
123
|
value: row[column[valueKey]] || ''
|
|
@@ -126,7 +142,7 @@ class RowExpandPCRateEditor extends _react.default.Component {
|
|
|
126
142
|
style: style,
|
|
127
143
|
onKeyDown: this.onKeyDown,
|
|
128
144
|
onFocus: this.props.updateTabIndex.bind(this, this.props.columnIndex),
|
|
129
|
-
"aria-label":
|
|
145
|
+
"aria-label": `${this.state.value}, ${(0, _lang.getLocale)('Press_the_number_keys_to_enter_the_corresponding_value')}`,
|
|
130
146
|
className: (0, _classnames.default)('form-control dtable-ui dtable-ui-row-expand-rate-editor', {
|
|
131
147
|
'disabled': !this.canEdit
|
|
132
148
|
}),
|
|
@@ -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 RowExpandSingleSelectEditor = /*#__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
|
});
|
|
@@ -5,7 +5,6 @@ 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
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _dtableUtils = require("dtable-utils");
|
|
11
10
|
var _SingleSelectEditor = _interopRequireDefault(require("../../../SingleSelectEditor"));
|
|
@@ -21,14 +20,19 @@ class RowExpandMBSingleSelectEditor extends _react.default.Component {
|
|
|
21
20
|
constructor(_props) {
|
|
22
21
|
super(_props);
|
|
23
22
|
this.getOptions = props => {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const {
|
|
24
|
+
column,
|
|
25
|
+
row,
|
|
26
|
+
columns
|
|
27
|
+
} = props;
|
|
27
28
|
const options = (0, _dtableUtils.getColumnOptions)(column);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const {
|
|
30
|
+
data
|
|
31
|
+
} = column;
|
|
32
|
+
const {
|
|
33
|
+
cascade_column_key,
|
|
34
|
+
cascade_settings
|
|
35
|
+
} = data || {};
|
|
32
36
|
if (cascade_column_key && Array.isArray(columns)) {
|
|
33
37
|
const cascadeColumn = columns.find(c => c.key === cascade_column_key);
|
|
34
38
|
if (cascadeColumn) {
|
|
@@ -65,12 +69,15 @@ class RowExpandMBSingleSelectEditor extends _react.default.Component {
|
|
|
65
69
|
this.toggleEditor(false);
|
|
66
70
|
};
|
|
67
71
|
this.renderOption = () => {
|
|
68
|
-
const
|
|
72
|
+
const {
|
|
73
|
+
value
|
|
74
|
+
} = this.state;
|
|
69
75
|
let option = this.options.find(o => o[this.key] === value);
|
|
70
|
-
option =
|
|
76
|
+
option = {
|
|
71
77
|
name: (0, _lang.getLocale)(_constants.DELETED_OPTION_TIPS),
|
|
72
|
-
color: _constants.DELETED_OPTION_BACKGROUND_COLOR
|
|
73
|
-
|
|
78
|
+
color: _constants.DELETED_OPTION_BACKGROUND_COLOR,
|
|
79
|
+
...option
|
|
80
|
+
};
|
|
74
81
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
75
82
|
children: value ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
76
83
|
style: {
|
|
@@ -93,8 +100,10 @@ class RowExpandMBSingleSelectEditor extends _react.default.Component {
|
|
|
93
100
|
this.options = this.getOptions(_props);
|
|
94
101
|
}
|
|
95
102
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
96
|
-
const
|
|
97
|
-
|
|
103
|
+
const {
|
|
104
|
+
value,
|
|
105
|
+
column
|
|
106
|
+
} = nextProps;
|
|
98
107
|
if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
|
|
99
108
|
this.options = this.getOptions(nextProps);
|
|
100
109
|
this.setState({
|
|
@@ -104,13 +113,15 @@ class RowExpandMBSingleSelectEditor extends _react.default.Component {
|
|
|
104
113
|
}
|
|
105
114
|
}
|
|
106
115
|
render() {
|
|
107
|
-
const
|
|
108
|
-
column
|
|
109
|
-
isSupportNewOption
|
|
110
|
-
onAddNewOption
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
const {
|
|
117
|
+
column,
|
|
118
|
+
isSupportNewOption,
|
|
119
|
+
onAddNewOption
|
|
120
|
+
} = this.props;
|
|
121
|
+
const {
|
|
122
|
+
showEditor,
|
|
123
|
+
value
|
|
124
|
+
} = this.state;
|
|
114
125
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
115
126
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
116
127
|
className: "dtable-ui dtable-ui-mobile-row-expand-options-editor position-relative",
|
|
@@ -18,14 +18,19 @@ class RowExpandPCSingleSelectEditor extends _react.default.Component {
|
|
|
18
18
|
constructor(_props) {
|
|
19
19
|
super(_props);
|
|
20
20
|
this.getOptions = props => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const {
|
|
22
|
+
column,
|
|
23
|
+
row,
|
|
24
|
+
columns
|
|
25
|
+
} = props;
|
|
24
26
|
const options = (0, _dtableUtils.getColumnOptions)(column);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const {
|
|
28
|
+
data
|
|
29
|
+
} = column;
|
|
30
|
+
const {
|
|
31
|
+
cascade_column_key,
|
|
32
|
+
cascade_settings
|
|
33
|
+
} = data || {};
|
|
29
34
|
if (cascade_column_key && Array.isArray(columns)) {
|
|
30
35
|
const cascadeColumn = columns.find(c => c.key === cascade_column_key);
|
|
31
36
|
if (cascadeColumn) {
|
|
@@ -86,11 +91,14 @@ class RowExpandPCSingleSelectEditor extends _react.default.Component {
|
|
|
86
91
|
this.toggleSingleSelect(false);
|
|
87
92
|
};
|
|
88
93
|
this.renderOption = () => {
|
|
89
|
-
const
|
|
90
|
-
isEditorFocus
|
|
91
|
-
classNamePrefix
|
|
92
|
-
placeholder
|
|
93
|
-
|
|
94
|
+
const {
|
|
95
|
+
isEditorFocus,
|
|
96
|
+
classNamePrefix,
|
|
97
|
+
placeholder
|
|
98
|
+
} = this.props;
|
|
99
|
+
const {
|
|
100
|
+
value
|
|
101
|
+
} = this.state;
|
|
94
102
|
const option = this.options.find(o => o[this.key] === value);
|
|
95
103
|
const optionStyle = option ? {
|
|
96
104
|
backgroundColor: option.color,
|
|
@@ -106,15 +114,15 @@ class RowExpandPCSingleSelectEditor extends _react.default.Component {
|
|
|
106
114
|
ref: ref => this.selectRef = ref,
|
|
107
115
|
className: (0, _classnames.default)('dtable-ui dtable-ui-row-expand-select-editor custom-select', {
|
|
108
116
|
'focus': isEditorFocus,
|
|
109
|
-
[
|
|
117
|
+
[`${classNamePrefix}-select-editor`]: classNamePrefix
|
|
110
118
|
}),
|
|
111
119
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
112
120
|
className: (0, _classnames.default)('dtable-ui-row-expand-select-editor-inner', {
|
|
113
|
-
[
|
|
121
|
+
[`${classNamePrefix}-select-editor-inner`]: classNamePrefix
|
|
114
122
|
}),
|
|
115
123
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
116
124
|
className: (0, _classnames.default)('', {
|
|
117
|
-
[
|
|
125
|
+
[`${classNamePrefix}-select-editor-inner-container`]: classNamePrefix
|
|
118
126
|
}),
|
|
119
127
|
children: [value && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
120
128
|
className: "dtable-ui-select-option",
|
|
@@ -145,8 +153,10 @@ class RowExpandPCSingleSelectEditor extends _react.default.Component {
|
|
|
145
153
|
document.addEventListener('keydown', this.onKeyDown);
|
|
146
154
|
}
|
|
147
155
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
148
|
-
const
|
|
149
|
-
|
|
156
|
+
const {
|
|
157
|
+
value,
|
|
158
|
+
column
|
|
159
|
+
} = nextProps;
|
|
150
160
|
if (value !== this.props.value || !_objectUtils.default.isSameObject(column, this.props.column)) {
|
|
151
161
|
this.options = this.getOptions(nextProps);
|
|
152
162
|
this.setState({
|
|
@@ -170,14 +180,16 @@ class RowExpandPCSingleSelectEditor extends _react.default.Component {
|
|
|
170
180
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
171
181
|
}
|
|
172
182
|
render() {
|
|
173
|
-
const
|
|
174
|
-
isSupportNewOption
|
|
175
|
-
onAddNewOption
|
|
176
|
-
column
|
|
177
|
-
classNamePrefix
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
183
|
+
const {
|
|
184
|
+
isSupportNewOption,
|
|
185
|
+
onAddNewOption,
|
|
186
|
+
column,
|
|
187
|
+
classNamePrefix
|
|
188
|
+
} = this.props;
|
|
189
|
+
const {
|
|
190
|
+
isShowEditor,
|
|
191
|
+
value
|
|
192
|
+
} = this.state;
|
|
181
193
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
182
194
|
className: "position-relative w-100",
|
|
183
195
|
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 RowExpandTextEditor = /*#__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
|
});
|
|
@@ -19,10 +19,11 @@ class RowExpandMBTextEditor extends _react.default.Component {
|
|
|
19
19
|
this.editor = null;
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
const
|
|
23
|
-
readOnly
|
|
24
|
-
column
|
|
25
|
-
value
|
|
22
|
+
const {
|
|
23
|
+
readOnly,
|
|
24
|
+
column,
|
|
25
|
+
value
|
|
26
|
+
} = this.props;
|
|
26
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
27
28
|
className: "dtable-ui-mobile-row-expand-input-editor-container",
|
|
28
29
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextEditor.default, {
|
|
@@ -35,9 +35,10 @@ class RowExpandPCTextEditor extends _react.default.Component {
|
|
|
35
35
|
}, 1);
|
|
36
36
|
};
|
|
37
37
|
this.onCommit = () => {
|
|
38
|
-
const
|
|
39
|
-
isRequired
|
|
40
|
-
column
|
|
38
|
+
const {
|
|
39
|
+
isRequired,
|
|
40
|
+
column
|
|
41
|
+
} = this.props;
|
|
41
42
|
const value = this.editor.getValue();
|
|
42
43
|
if (isRequired && (0, _columnUtils.isEnableCheckFormat)(column)) {
|
|
43
44
|
this.checked = true;
|
|
@@ -46,7 +47,9 @@ class RowExpandPCTextEditor extends _react.default.Component {
|
|
|
46
47
|
this.props.onCommit(value);
|
|
47
48
|
};
|
|
48
49
|
this.checkField = () => {
|
|
49
|
-
const
|
|
50
|
+
const {
|
|
51
|
+
column
|
|
52
|
+
} = this.props;
|
|
50
53
|
const text = this.editor.getValue();
|
|
51
54
|
this.validValue = (0, _cell.checkValueConformityFormat)(column.data, text);
|
|
52
55
|
this.setState({
|
|
@@ -60,10 +63,11 @@ class RowExpandPCTextEditor extends _react.default.Component {
|
|
|
60
63
|
this.blurInput();
|
|
61
64
|
return;
|
|
62
65
|
}
|
|
63
|
-
const
|
|
64
|
-
selectionStart
|
|
65
|
-
selectionEnd
|
|
66
|
-
value
|
|
66
|
+
const {
|
|
67
|
+
selectionStart,
|
|
68
|
+
selectionEnd,
|
|
69
|
+
value
|
|
70
|
+
} = event.currentTarget;
|
|
67
71
|
if (event.keyCode === _constants.KeyCodes.ChineseInputMethod || event.keyCode === _constants.KeyCodes.LeftArrow && selectionStart === 0 || event.keyCode === _constants.KeyCodes.RightArrow && selectionEnd === value.length) {
|
|
68
72
|
event.stopPropagation();
|
|
69
73
|
}
|
|
@@ -89,13 +93,17 @@ class RowExpandPCTextEditor extends _react.default.Component {
|
|
|
89
93
|
this.checkingField = null;
|
|
90
94
|
}
|
|
91
95
|
componentDidMount() {
|
|
92
|
-
const
|
|
96
|
+
const {
|
|
97
|
+
isEditorFocus
|
|
98
|
+
} = this.props;
|
|
93
99
|
if (isEditorFocus) {
|
|
94
100
|
this.focusInput();
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
98
|
-
const
|
|
104
|
+
const {
|
|
105
|
+
isEditorFocus
|
|
106
|
+
} = nextProps;
|
|
99
107
|
if (isEditorFocus && !this.props.isEditorFocus) {
|
|
100
108
|
this.focusInput();
|
|
101
109
|
} else if (!isEditorFocus && this.props.isEditorFocus) {
|
|
@@ -103,11 +111,14 @@ class RowExpandPCTextEditor extends _react.default.Component {
|
|
|
103
111
|
}
|
|
104
112
|
}
|
|
105
113
|
render() {
|
|
106
|
-
const
|
|
107
|
-
readOnly
|
|
108
|
-
column
|
|
109
|
-
value
|
|
110
|
-
|
|
114
|
+
const {
|
|
115
|
+
readOnly,
|
|
116
|
+
column,
|
|
117
|
+
value
|
|
118
|
+
} = this.props;
|
|
119
|
+
const {
|
|
120
|
+
inconformityFormat
|
|
121
|
+
} = this.state;
|
|
111
122
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
112
123
|
className: "dtable-ui-row-expand-simple-text-editor-container",
|
|
113
124
|
ref: this.setEditorRef,
|