dtable-ui-component 6.0.126 → 7.0.0-xia.1
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 +16 -14
- package/lib/ActivityIndicator/index.js +8 -7
- package/lib/AsyncUserSelect/index.js +19 -40
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +11 -9
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +3 -1
- 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 +4 -2
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +34 -25
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +7 -9
- package/lib/Comment/body/comment.js +18 -10
- package/lib/Comment/body/index.js +4 -2
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +20 -9
- package/lib/Comment/footer/input/index.js +50 -29
- package/lib/Comment/footer/input/participant/index.js +5 -4
- 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 +24 -8
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +21 -15
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +18 -22
- package/lib/DTableColorPicker/index.js +40 -55
- package/lib/DTableColorPicker/utils.js +6 -4
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +8 -6
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeCollaboratorSelect/index.js +20 -17
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +18 -16
- package/lib/DTableDropdownMenu/index.js +10 -8
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +50 -34
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +113 -63
- 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 +56 -35
- package/lib/DTableFiltersPopover/widgets/filter-item.js +171 -108
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +161 -136
- package/lib/DTableFiltersPopover/widgets/rate-item.js +20 -15
- package/lib/DTableGroupSelect/index.js +15 -11
- package/lib/DTableGroupSelect/select-option-group.js +32 -23
- package/lib/DTableIcon/index.js +7 -6
- package/lib/DTableIcon/svg-icon.js +7 -5
- package/lib/DTableModalHeader/index.css +3 -20
- package/lib/DTableModalHeader/index.js +3 -1
- package/lib/DTablePopover/index.js +15 -11
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +17 -8
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +5 -6
- package/lib/DTableSelect/index.js +22 -21
- package/lib/DTableSelect/utils.js +15 -7
- package/lib/DTableSubDropdownMenu/index.js +10 -8
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +8 -7
- package/lib/DateEditor/index.js +15 -20
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +45 -26
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +3 -1
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +23 -25
- package/lib/DepartmentSelectFilter/index.js +8 -6
- package/lib/DepartmentSingleSelectEditor/index.js +3 -1
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +47 -48
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +58 -36
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +3 -1
- package/lib/DigitalSignEditor/mb-editor/index.js +20 -12
- package/lib/DigitalSignEditor/pc-editor/index.js +24 -17
- package/lib/DigitalSignEditor/service.js +4 -2
- package/lib/DigitalSignEditor/signature-board/index.js +8 -5
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +5 -4
- 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 +12 -12
- package/lib/FieldDisplaySetting/index.js +10 -12
- package/lib/FileEditor/files-previewer/index.js +3 -1
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +18 -10
- 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 +21 -14
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +3 -1
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +3 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +25 -11
- package/lib/FileEditor/pc-editor/index.js +27 -19
- package/lib/FileFormatter/index.js +19 -26
- package/lib/FileItemFormatter/index.js +9 -6
- package/lib/FileUploader/index.js +45 -28
- package/lib/FormulaFormatter/index.js +29 -15
- package/lib/GeolocationEditor/index.js +12 -11
- package/lib/GeolocationEditor/map-editor-utils.js +15 -17
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +6 -4
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +68 -41
- 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 +23 -10
- package/lib/GeolocationEditor/pc-editor/index.js +20 -12
- package/lib/GeolocationEditor/pc-editor/location-editor.js +31 -26
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +54 -34
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +60 -36
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +62 -35
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +65 -36
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +25 -19
- package/lib/GeolocationEditor/pc-editor/province-editor.js +13 -6
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +7 -6
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +12 -4
- package/lib/Icon/index.js +5 -3
- package/lib/IconButton/index.js +6 -4
- package/lib/ImageEditor/images-previewer/image-preview/index.js +21 -12
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +3 -1
- 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 +3 -1
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +21 -7
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +13 -11
- package/lib/ImagePreviewerLightbox/index.js +13 -15
- package/lib/ImageThumbnail/index.js +13 -10
- package/lib/InputItem/custom-input.js +46 -26
- package/lib/InputItem/custom-keyboard.js +18 -15
- package/lib/InputItem/index.js +50 -34
- package/lib/InputItem/input.js +4 -2
- 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 +10 -5
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +8 -6
- package/lib/List/list-item.js +28 -22
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +8 -7
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +5 -3
- package/lib/MobileFullScreenPage/header/index.js +6 -4
- package/lib/MobileFullScreenPage/index.js +11 -13
- package/lib/MobileModal/index.js +3 -1
- 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.js +3 -1
- package/lib/MobileSelector/search/index.js +5 -3
- package/lib/MobileUpload/index.js +5 -4
- package/lib/Modal/modal.js +15 -14
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +3 -1
- package/lib/MultipleSelectFormatter/index.js +8 -6
- 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 +4 -2
- package/lib/Picker/AbstractPicker.js +27 -23
- package/lib/Popover/index.js +4 -3
- package/lib/Popover/item.js +9 -7
- package/lib/Progress/index.js +8 -9
- package/lib/Radio/Radio.js +8 -4
- package/lib/Radio/RadioItem.js +12 -8
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +17 -18
- package/lib/RowExpandDialog/body/index.js +49 -32
- package/lib/RowExpandDialog/column-content/index.js +9 -5
- package/lib/RowExpandDialog/header/index.js +8 -6
- package/lib/RowExpandDialog/index.js +34 -49
- 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/mb-editor/index.js +33 -22
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
- 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/mb-editor.js +11 -16
- package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +34 -20
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +35 -21
- 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/mb-editor/index.js +19 -9
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +24 -13
- 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/mb-editor/index.js +29 -17
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +25 -15
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +23 -13
- package/lib/RowExpandEditor/index.js +8 -4
- 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/mb-editor/index.js +19 -11
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +33 -22
- 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/mb-editor.js +25 -12
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +36 -20
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +28 -17
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +34 -22
- 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/mb-editor/index.js +13 -5
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +18 -9
- 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 +7 -4
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +12 -10
- package/lib/RowExpandFormatter/formula-formatter/index.js +34 -19
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +8 -7
- package/lib/RowExpandFormatter/index.js +41 -27
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +14 -8
- package/lib/RowExpandFormatter/link-formatter/index.js +19 -11
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +12 -11
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +7 -4
- package/lib/RowExpandView/body/index.js +35 -22
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +30 -42
- package/lib/SelectItem/index.js +8 -6
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +9 -7
- package/lib/SimpleLongTextFormatter/index.js +16 -10
- 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 +3 -1
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +16 -14
- package/lib/TabBar/index.js +21 -18
- package/lib/Tabs/index.js +3 -1
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +26 -19
- package/lib/Toast/index.js +4 -3
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +3 -1
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +42 -27
- package/lib/toaster/alert.js +7 -6
- package/lib/toaster/toast.js +3 -2
- package/lib/toaster/toastManager.js +4 -2
- package/lib/utils/cell.js +11 -8
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +3 -1
- package/lib/utils/url.js +31 -24
- package/lib/utils/utils.js +6 -2
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
10
|
var _react = _interopRequireDefault(require("react"));
|
|
12
11
|
var _reactstrap = require("reactstrap");
|
|
13
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -65,10 +64,11 @@ class Body extends _react.default.Component {
|
|
|
65
64
|
this.fieldEditorOpen = false;
|
|
66
65
|
};
|
|
67
66
|
this.onHotKey = event => {
|
|
68
|
-
const
|
|
69
|
-
columns
|
|
70
|
-
onKeyDown
|
|
71
|
-
onToggle
|
|
67
|
+
const {
|
|
68
|
+
columns,
|
|
69
|
+
onKeyDown,
|
|
70
|
+
onToggle
|
|
71
|
+
} = this.props;
|
|
72
72
|
const readonly = Array.isArray(columns) && columns.length > 0 ? !columns.some(c => c.editable) : true;
|
|
73
73
|
const keyCode = event.keyCode;
|
|
74
74
|
// When opening field editor, all shortcuts in row expand dialog do not work
|
|
@@ -96,7 +96,9 @@ class Body extends _react.default.Component {
|
|
|
96
96
|
this.onPressTab = event => {
|
|
97
97
|
event.stopPropagation();
|
|
98
98
|
event.preventDefault();
|
|
99
|
-
const
|
|
99
|
+
const {
|
|
100
|
+
columns
|
|
101
|
+
} = this.props;
|
|
100
102
|
let tabIndex = this.state.tabIndex;
|
|
101
103
|
// Press tab, highlight next column;
|
|
102
104
|
if (event.shiftKey) {
|
|
@@ -127,30 +129,40 @@ class Body extends _react.default.Component {
|
|
|
127
129
|
this.props.getDownLoadFiles([{
|
|
128
130
|
url: imageItemUrl
|
|
129
131
|
}]).then(res => {
|
|
130
|
-
const
|
|
131
|
-
downloadUrl = _res$data$urls[0];
|
|
132
|
+
const [downloadUrl] = res.data.urls;
|
|
132
133
|
(0, _utils.downloadFile)(downloadUrl);
|
|
133
134
|
}).catch(error => {
|
|
134
135
|
// todo
|
|
135
136
|
});
|
|
136
137
|
};
|
|
137
138
|
this.getCellValue = _ref => {
|
|
138
|
-
let
|
|
139
|
-
|
|
139
|
+
let {
|
|
140
|
+
row,
|
|
141
|
+
column
|
|
142
|
+
} = _ref;
|
|
140
143
|
if (!row || !column) return null;
|
|
141
|
-
const
|
|
144
|
+
const {
|
|
145
|
+
valueKey
|
|
146
|
+
} = this.props;
|
|
142
147
|
return row[column[valueKey]];
|
|
143
148
|
};
|
|
144
149
|
this.renderColumnValue = (row, column, columnIndex, isEditorFocus) => {
|
|
145
|
-
const _this$
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
const _this$props = this.props,
|
|
151
|
+
{
|
|
152
|
+
component,
|
|
153
|
+
onChange
|
|
154
|
+
} = _this$props,
|
|
155
|
+
props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
156
|
+
const {
|
|
157
|
+
getDownLoadFiles
|
|
158
|
+
} = props;
|
|
159
|
+
const {
|
|
160
|
+
editable
|
|
161
|
+
} = column;
|
|
162
|
+
const {
|
|
163
|
+
editor,
|
|
164
|
+
formatter
|
|
165
|
+
} = component || {};
|
|
154
166
|
if (editable) {
|
|
155
167
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowExpandEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
156
168
|
column: column,
|
|
@@ -183,10 +195,11 @@ class Body extends _react.default.Component {
|
|
|
183
195
|
});
|
|
184
196
|
};
|
|
185
197
|
this.renderChildren = () => {
|
|
186
|
-
const
|
|
187
|
-
columns
|
|
188
|
-
row
|
|
189
|
-
children
|
|
198
|
+
const {
|
|
199
|
+
columns,
|
|
200
|
+
row,
|
|
201
|
+
children
|
|
202
|
+
} = this.props;
|
|
190
203
|
const props = {
|
|
191
204
|
columns,
|
|
192
205
|
row
|
|
@@ -216,10 +229,11 @@ class Body extends _react.default.Component {
|
|
|
216
229
|
window.removeEventListener('keydown', this.onHotKey);
|
|
217
230
|
}
|
|
218
231
|
render() {
|
|
219
|
-
const
|
|
220
|
-
columns
|
|
221
|
-
row
|
|
222
|
-
placeholder
|
|
232
|
+
const {
|
|
233
|
+
columns,
|
|
234
|
+
row,
|
|
235
|
+
placeholder
|
|
236
|
+
} = this.props;
|
|
223
237
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.ModalBody, {
|
|
224
238
|
className: "dtable-ui-row-expand-body",
|
|
225
239
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -228,12 +242,15 @@ class Body extends _react.default.Component {
|
|
|
228
242
|
children: [columns.length === 0 && placeholder && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
229
243
|
children: placeholder
|
|
230
244
|
}), columns.map((column, index) => {
|
|
231
|
-
const
|
|
232
|
-
|
|
245
|
+
const {
|
|
246
|
+
type,
|
|
247
|
+
data
|
|
248
|
+
} = column;
|
|
233
249
|
let isHasMore = false;
|
|
234
250
|
if (type === _dtableUtils.CellType.LINK_FORMULA) {
|
|
235
|
-
let
|
|
236
|
-
array_type
|
|
251
|
+
let {
|
|
252
|
+
array_type
|
|
253
|
+
} = data || {};
|
|
237
254
|
const value = this.getCellValue({
|
|
238
255
|
row,
|
|
239
256
|
column
|
|
@@ -13,12 +13,16 @@ var _DTableColumnIcon = _interopRequireDefault(require("../../DTableColumnIcon")
|
|
|
13
13
|
require("./index.css");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
const ColumnContent = _ref => {
|
|
16
|
-
let
|
|
17
|
-
|
|
16
|
+
let {
|
|
17
|
+
column,
|
|
18
|
+
children
|
|
19
|
+
} = _ref;
|
|
18
20
|
const descriptionRef = (0, _react.useRef)(null);
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const {
|
|
22
|
+
name,
|
|
23
|
+
key,
|
|
24
|
+
description
|
|
25
|
+
} = column;
|
|
22
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Row, {
|
|
23
27
|
className: "dtable-ui-row-expand-column-content pb-4",
|
|
24
28
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Col, {
|
|
@@ -15,12 +15,14 @@ var _IconButton = _interopRequireDefault(require("../../IconButton"));
|
|
|
15
15
|
require("./index.css");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
const Header = _ref => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
let {
|
|
19
|
+
title,
|
|
20
|
+
columns,
|
|
21
|
+
row,
|
|
22
|
+
onToggle,
|
|
23
|
+
copyURL,
|
|
24
|
+
children
|
|
25
|
+
} = _ref;
|
|
24
26
|
const renderTitle = (0, _react.useCallback)(() => {
|
|
25
27
|
const props = {
|
|
26
28
|
columns,
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
12
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -23,48 +22,31 @@ require("./index.css");
|
|
|
23
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
23
|
const _excluded = ["saveImmediately", "readonly", "isInsertingRow", "zIndex", "title", "className", "valueKey", "layout", "row", "columns", "commit", "onToggle", "uploadFile", "copyURL", "children"];
|
|
25
24
|
const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
_ref$children = _ref.children,
|
|
46
|
-
children = _ref$children === void 0 ? [] : _ref$children,
|
|
25
|
+
let {
|
|
26
|
+
saveImmediately = true,
|
|
27
|
+
readonly = false,
|
|
28
|
+
isInsertingRow = false,
|
|
29
|
+
zIndex,
|
|
30
|
+
title,
|
|
31
|
+
className,
|
|
32
|
+
valueKey = 'name',
|
|
33
|
+
// name or key
|
|
34
|
+
layout = 'horizontal',
|
|
35
|
+
// horizontal or vertical
|
|
36
|
+
row: defaultRow,
|
|
37
|
+
columns: defaultColumns,
|
|
38
|
+
commit,
|
|
39
|
+
onToggle,
|
|
40
|
+
uploadFile,
|
|
41
|
+
copyURL,
|
|
42
|
+
children = []
|
|
43
|
+
} = _ref,
|
|
47
44
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
54
|
-
isLoading = _useState4[0],
|
|
55
|
-
setLoading = _useState4[1];
|
|
56
|
-
const _useState5 = (0, _react.useState)(false),
|
|
57
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
58
|
-
isSaving = _useState6[0],
|
|
59
|
-
setSaving = _useState6[1];
|
|
60
|
-
const _useState7 = (0, _react.useState)({}),
|
|
61
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
62
|
-
row = _useState8[0],
|
|
63
|
-
setRow = _useState8[1];
|
|
64
|
-
const _useState9 = (0, _react.useState)([]),
|
|
65
|
-
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
66
|
-
columns = _useState0[0],
|
|
67
|
-
setColumns = _useState0[1];
|
|
45
|
+
const [isAnimationEnd, setAnimationEnd] = (0, _react.useState)(false);
|
|
46
|
+
const [isLoading, setLoading] = (0, _react.useState)(true);
|
|
47
|
+
const [isSaving, setSaving] = (0, _react.useState)(false);
|
|
48
|
+
const [row, setRow] = (0, _react.useState)({});
|
|
49
|
+
const [columns, setColumns] = (0, _react.useState)([]);
|
|
68
50
|
const modalRef = (0, _react.useRef)(null);
|
|
69
51
|
const isChangedRef = (0, _react.useRef)(false);
|
|
70
52
|
const update = (0, _react.useRef)({});
|
|
@@ -115,9 +97,10 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
115
97
|
onToggle();
|
|
116
98
|
}, [isSaving, onToggle]);
|
|
117
99
|
const onSave = (0, _react.useCallback)(function (updated) {
|
|
118
|
-
let
|
|
119
|
-
successCallback
|
|
120
|
-
failCallback
|
|
100
|
+
let {
|
|
101
|
+
successCallback,
|
|
102
|
+
failCallback
|
|
103
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
121
104
|
commit(updated, columns, {
|
|
122
105
|
successCallback,
|
|
123
106
|
failCallback
|
|
@@ -168,10 +151,12 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
168
151
|
// use setTimeout to make sure real dom rendered
|
|
169
152
|
setTimeout(() => {
|
|
170
153
|
let dom = modalRef.current.firstChild;
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
154
|
+
const {
|
|
155
|
+
width,
|
|
156
|
+
maxWidth,
|
|
157
|
+
marginLeft,
|
|
158
|
+
height
|
|
159
|
+
} = style;
|
|
175
160
|
dom.style.width = "".concat(width, "px");
|
|
176
161
|
dom.style.maxWidth = "".concat(maxWidth, "px");
|
|
177
162
|
dom.style.marginLeft = "".concat(marginLeft, "px");
|
|
@@ -19,10 +19,11 @@ class RowExpandMBCheckboxEditor extends _react.default.Component {
|
|
|
19
19
|
this.editor = null;
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
const
|
|
23
|
-
column
|
|
24
|
-
value
|
|
25
|
-
className
|
|
22
|
+
const {
|
|
23
|
+
column,
|
|
24
|
+
value,
|
|
25
|
+
className
|
|
26
|
+
} = this.props;
|
|
26
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
27
28
|
className: (0, _classnames.default)('dtable-ui-mobile-row-expand-checkbox-editor-container', className),
|
|
28
29
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxEditor.default, {
|
|
@@ -13,19 +13,21 @@ class RowExpandPCCheckboxEditor extends _react.default.Component {
|
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.onCommit = newValue => {
|
|
16
|
-
const
|
|
17
|
-
columnIndex
|
|
18
|
-
updateTabIndex
|
|
19
|
-
onCommit
|
|
16
|
+
const {
|
|
17
|
+
columnIndex,
|
|
18
|
+
updateTabIndex,
|
|
19
|
+
onCommit
|
|
20
|
+
} = this.props;
|
|
20
21
|
updateTabIndex && updateTabIndex(columnIndex);
|
|
21
22
|
onCommit && onCommit(newValue);
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
render() {
|
|
25
|
-
const
|
|
26
|
-
isEditorFocus
|
|
27
|
-
column
|
|
28
|
-
value
|
|
26
|
+
const {
|
|
27
|
+
isEditorFocus,
|
|
28
|
+
column,
|
|
29
|
+
value
|
|
30
|
+
} = this.props;
|
|
29
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxEditor.default, {
|
|
30
32
|
className: "dtable-ui-row-expand-checkbox-editor mt-2",
|
|
31
33
|
column: column,
|
|
@@ -17,16 +17,19 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
17
17
|
constructor(_props) {
|
|
18
18
|
super(_props);
|
|
19
19
|
this.initCollaborators = props => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const {
|
|
21
|
+
row,
|
|
22
|
+
column,
|
|
23
|
+
valueKey
|
|
24
|
+
} = props;
|
|
23
25
|
const emails = row[column[valueKey]] || [];
|
|
24
26
|
props.queryCollaborators && props.queryCollaborators(emails);
|
|
25
27
|
};
|
|
26
28
|
this.getCollaborators = () => {
|
|
27
|
-
const
|
|
28
|
-
getCollaborators
|
|
29
|
-
collaborators
|
|
29
|
+
const {
|
|
30
|
+
getCollaborators,
|
|
31
|
+
collaborators
|
|
32
|
+
} = this.props;
|
|
30
33
|
if (getCollaborators) return getCollaborators();
|
|
31
34
|
return collaborators || [];
|
|
32
35
|
};
|
|
@@ -66,13 +69,16 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
66
69
|
this.props.onCommit(newValue);
|
|
67
70
|
};
|
|
68
71
|
this.renderCollaborators = value => {
|
|
69
|
-
const
|
|
72
|
+
const {
|
|
73
|
+
emailCollaboratorMap
|
|
74
|
+
} = this.state;
|
|
70
75
|
if (Array.isArray(value) && value.length > 0) {
|
|
71
76
|
return value.map((email, index) => {
|
|
72
77
|
let collaborator = emailCollaboratorMap[email];
|
|
73
78
|
if (collaborator) {
|
|
74
|
-
const
|
|
75
|
-
email
|
|
79
|
+
const {
|
|
80
|
+
email
|
|
81
|
+
} = collaborator;
|
|
76
82
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollaboratorItem.default, {
|
|
77
83
|
collaborator: collaborator
|
|
78
84
|
}, email);
|
|
@@ -92,10 +98,11 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
92
98
|
text: (0, _lang.getLocale)('Add_collaborator')
|
|
93
99
|
});
|
|
94
100
|
};
|
|
95
|
-
const
|
|
96
|
-
_row
|
|
97
|
-
_column
|
|
98
|
-
_valueKey
|
|
101
|
+
const {
|
|
102
|
+
row: _row,
|
|
103
|
+
column: _column,
|
|
104
|
+
valueKey: _valueKey
|
|
105
|
+
} = this.props;
|
|
99
106
|
this.state = {
|
|
100
107
|
menuPosition: null,
|
|
101
108
|
value: _row[_column[_valueKey]] || [],
|
|
@@ -113,9 +120,11 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
113
120
|
}
|
|
114
121
|
}
|
|
115
122
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
const {
|
|
124
|
+
column,
|
|
125
|
+
row,
|
|
126
|
+
valueKey
|
|
127
|
+
} = nextProps;
|
|
119
128
|
if (row._id !== this.props.row._id) {
|
|
120
129
|
this.initCollaborators(nextProps);
|
|
121
130
|
this.setState({
|
|
@@ -130,12 +139,14 @@ class RowExpandMBCollaboratorEditor extends _react.default.Component {
|
|
|
130
139
|
}
|
|
131
140
|
}
|
|
132
141
|
render() {
|
|
133
|
-
const
|
|
134
|
-
collaborators
|
|
135
|
-
column
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
142
|
+
const {
|
|
143
|
+
collaborators,
|
|
144
|
+
column
|
|
145
|
+
} = this.props;
|
|
146
|
+
const {
|
|
147
|
+
showEditor,
|
|
148
|
+
value
|
|
149
|
+
} = this.state;
|
|
139
150
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
140
151
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
141
152
|
className: "dtable-ui dtable-ui-mobile-row-expand-collaborators position-relative",
|
|
@@ -17,16 +17,19 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
17
17
|
constructor(_props) {
|
|
18
18
|
super(_props);
|
|
19
19
|
this.initCollaborators = props => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const {
|
|
21
|
+
row,
|
|
22
|
+
column,
|
|
23
|
+
valueKey
|
|
24
|
+
} = props;
|
|
23
25
|
const emails = row[column[valueKey]] || [];
|
|
24
26
|
props.queryCollaborators && props.queryCollaborators(emails);
|
|
25
27
|
};
|
|
26
28
|
this.getCollaborators = () => {
|
|
27
|
-
const
|
|
28
|
-
getCollaborators
|
|
29
|
-
collaborators
|
|
29
|
+
const {
|
|
30
|
+
getCollaborators,
|
|
31
|
+
collaborators
|
|
32
|
+
} = this.props;
|
|
30
33
|
if (getCollaborators) return getCollaborators();
|
|
31
34
|
return collaborators || [];
|
|
32
35
|
};
|
|
@@ -87,7 +90,9 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
87
90
|
this.props.onCommit(newValue);
|
|
88
91
|
};
|
|
89
92
|
this.removeCollaborator = index => {
|
|
90
|
-
let
|
|
93
|
+
let {
|
|
94
|
+
value
|
|
95
|
+
} = this.state;
|
|
91
96
|
let newValue = value.slice(0);
|
|
92
97
|
newValue.splice(index, 1);
|
|
93
98
|
this.setState({
|
|
@@ -96,10 +101,13 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
96
101
|
this.props.onCommit(newValue);
|
|
97
102
|
};
|
|
98
103
|
this.renderSelectedCollaborators = () => {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
const {
|
|
105
|
+
isEditorFocus
|
|
106
|
+
} = this.props;
|
|
107
|
+
const {
|
|
108
|
+
value,
|
|
109
|
+
emailCollaboratorMap
|
|
110
|
+
} = this.state;
|
|
103
111
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
104
112
|
tabIndex: 0,
|
|
105
113
|
onFocus: this.onFocus,
|
|
@@ -116,8 +124,9 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
116
124
|
children: value.map((email, index) => {
|
|
117
125
|
let collaborator = emailCollaboratorMap[email];
|
|
118
126
|
if (collaborator) {
|
|
119
|
-
const
|
|
120
|
-
email
|
|
127
|
+
const {
|
|
128
|
+
email
|
|
129
|
+
} = collaborator;
|
|
121
130
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollaboratorItem.default, {
|
|
122
131
|
collaborator: collaborator,
|
|
123
132
|
enableDeleteCollaborator: true,
|
|
@@ -144,10 +153,11 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
144
153
|
})
|
|
145
154
|
});
|
|
146
155
|
};
|
|
147
|
-
const
|
|
148
|
-
_row
|
|
149
|
-
_column
|
|
150
|
-
_valueKey
|
|
156
|
+
const {
|
|
157
|
+
row: _row,
|
|
158
|
+
column: _column,
|
|
159
|
+
valueKey: _valueKey
|
|
160
|
+
} = this.props;
|
|
151
161
|
this.state = {
|
|
152
162
|
menuPosition: null,
|
|
153
163
|
value: _row[_column[_valueKey]] || [],
|
|
@@ -167,9 +177,11 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
167
177
|
}
|
|
168
178
|
}
|
|
169
179
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
180
|
+
const {
|
|
181
|
+
column,
|
|
182
|
+
row,
|
|
183
|
+
valueKey
|
|
184
|
+
} = nextProps;
|
|
173
185
|
if (row._id !== this.props.row._id) {
|
|
174
186
|
this.initCollaborators(nextProps);
|
|
175
187
|
this.setState({
|
|
@@ -196,12 +208,14 @@ class RowExpandPCCollaboratorEditor extends _react.default.Component {
|
|
|
196
208
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
197
209
|
}
|
|
198
210
|
render() {
|
|
199
|
-
const
|
|
200
|
-
collaborators
|
|
201
|
-
column
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
211
|
+
const {
|
|
212
|
+
collaborators,
|
|
213
|
+
column
|
|
214
|
+
} = this.props;
|
|
215
|
+
const {
|
|
216
|
+
showCollaboratorSelect,
|
|
217
|
+
value
|
|
218
|
+
} = this.state;
|
|
205
219
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
206
220
|
className: "position-relative mt-1 w-100",
|
|
207
221
|
ref: ref => this.collaboratorSelectRef = ref,
|
|
@@ -30,18 +30,22 @@ class RowExpandMBDateEditor extends _react.default.Component {
|
|
|
30
30
|
value
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const {
|
|
34
|
+
column,
|
|
35
|
+
row,
|
|
36
|
+
valueKey
|
|
37
|
+
} = props;
|
|
36
38
|
this.state = {
|
|
37
39
|
isShowEditor: false,
|
|
38
40
|
value: row[column[valueKey]]
|
|
39
41
|
};
|
|
40
42
|
}
|
|
41
43
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
const {
|
|
45
|
+
column,
|
|
46
|
+
row,
|
|
47
|
+
valueKey
|
|
48
|
+
} = nextProps;
|
|
45
49
|
if (row._id !== this.props.row._id) {
|
|
46
50
|
this.setState({
|
|
47
51
|
value: row[column[valueKey]],
|
|
@@ -50,12 +54,14 @@ class RowExpandMBDateEditor extends _react.default.Component {
|
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
render() {
|
|
53
|
-
let
|
|
54
|
-
column
|
|
55
|
-
lang
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
let {
|
|
58
|
+
column,
|
|
59
|
+
lang
|
|
60
|
+
} = this.props;
|
|
61
|
+
let {
|
|
62
|
+
value,
|
|
63
|
+
isShowEditor
|
|
64
|
+
} = this.state;
|
|
59
65
|
const format = (0, _columnUtils.getDateColumnFormat)(column);
|
|
60
66
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
61
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -57,19 +57,22 @@ class RowExpandPCDateEditor extends _react.default.Component {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
componentDidMount() {
|
|
60
|
-
const
|
|
61
|
-
column
|
|
62
|
-
row
|
|
63
|
-
valueKey
|
|
60
|
+
const {
|
|
61
|
+
column,
|
|
62
|
+
row,
|
|
63
|
+
valueKey
|
|
64
|
+
} = this.props;
|
|
64
65
|
this.setState({
|
|
65
66
|
value: row[column[valueKey]]
|
|
66
67
|
});
|
|
67
68
|
document.addEventListener('keydown', this.onKeyDown);
|
|
68
69
|
}
|
|
69
70
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
const {
|
|
72
|
+
column,
|
|
73
|
+
row,
|
|
74
|
+
valueKey
|
|
75
|
+
} = nextProps;
|
|
73
76
|
if (row._id !== this.props.row._id) {
|
|
74
77
|
this.setState({
|
|
75
78
|
value: row[column[valueKey]],
|
|
@@ -91,14 +94,16 @@ class RowExpandPCDateEditor extends _react.default.Component {
|
|
|
91
94
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
92
95
|
}
|
|
93
96
|
render() {
|
|
94
|
-
let
|
|
95
|
-
column
|
|
96
|
-
isInModal
|
|
97
|
-
isEditorFocus
|
|
98
|
-
lang
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
let {
|
|
98
|
+
column,
|
|
99
|
+
isInModal,
|
|
100
|
+
isEditorFocus,
|
|
101
|
+
lang
|
|
102
|
+
} = this.props;
|
|
103
|
+
let {
|
|
104
|
+
value,
|
|
105
|
+
isShowEditor
|
|
106
|
+
} = this.state;
|
|
102
107
|
const format = (0, _columnUtils.getDateColumnFormat)(column);
|
|
103
108
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
104
109
|
ref: ref => this.dateSelectRef = ref,
|