dtable-ui-component 6.0.125 → 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 +5 -0
- package/lib/AsyncUserSelect/index.js +40 -19
- 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.js +19 -24
- 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 +1 -3
- package/lib/DTableFiltersPopover/utils/index.js +63 -113
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +8 -9
- 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.js +136 -161
- package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
- package/lib/DTableGroupSelect/index.js +11 -15
- package/lib/DTableGroupSelect/select-option-group.js +23 -32
- 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.js +6 -5
- package/lib/DTableSelect/index.js +21 -22
- package/lib/DTableSelect/utils.js +7 -15
- 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 +3 -3
- package/lib/SelectOptionGroup/index.js +31 -40
- 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/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
|
@@ -41,9 +41,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
41
41
|
};
|
|
42
42
|
this.onFileUploadSuccess = fileMessage => {
|
|
43
43
|
this.hideDeleteIcon();
|
|
44
|
-
let
|
|
45
|
-
thumbnailSrcList
|
|
46
|
-
} = this.state;
|
|
44
|
+
let thumbnailSrcList = this.state.thumbnailSrcList;
|
|
47
45
|
const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
|
|
48
46
|
thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
|
|
49
47
|
if (thumbnailSrcList.every(fileItem => !fileItem.isUploading)) {
|
|
@@ -54,9 +52,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
54
52
|
this.props.fileUploadCompleted(fileMessage);
|
|
55
53
|
};
|
|
56
54
|
this.onFileUploadFailed = uploadedFileInfo => {
|
|
57
|
-
let
|
|
58
|
-
thumbnailSrcList
|
|
59
|
-
} = this.state;
|
|
55
|
+
let thumbnailSrcList = this.state.thumbnailSrcList;
|
|
60
56
|
const findUploadFileIndex = this.findUploadFileIndex(uploadedFileInfo);
|
|
61
57
|
thumbnailSrcList.splice(findUploadFileIndex, 1, uploadedFileInfo);
|
|
62
58
|
this.setState({
|
|
@@ -64,9 +60,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
64
60
|
});
|
|
65
61
|
};
|
|
66
62
|
this.findUploadFileIndex = fileMessage => {
|
|
67
|
-
let
|
|
68
|
-
thumbnailSrcList
|
|
69
|
-
} = this.state;
|
|
63
|
+
let thumbnailSrcList = this.state.thumbnailSrcList;
|
|
70
64
|
let uploadFileIndex = thumbnailSrcList.findIndex(item => item.name === fileMessage.file.name);
|
|
71
65
|
return uploadFileIndex;
|
|
72
66
|
};
|
|
@@ -77,9 +71,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
77
71
|
});
|
|
78
72
|
return;
|
|
79
73
|
}
|
|
80
|
-
let
|
|
81
|
-
uploadMessageList
|
|
82
|
-
} = this.state;
|
|
74
|
+
let uploadMessageList = this.state.uploadMessageList;
|
|
83
75
|
let newUploadMessageList = uploadMessageList.slice(0);
|
|
84
76
|
let uploadFile = uploadMessageList.find(item => item.uploadName === uploadMessage.uploadName);
|
|
85
77
|
if (uploadFile) {
|
|
@@ -113,9 +105,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
113
105
|
});
|
|
114
106
|
};
|
|
115
107
|
this.renderMultipleFilesArr = () => {
|
|
116
|
-
let
|
|
117
|
-
thumbnailSrcList
|
|
118
|
-
} = this.state;
|
|
108
|
+
let thumbnailSrcList = this.state.thumbnailSrcList;
|
|
119
109
|
let imageArr = [];
|
|
120
110
|
if (Array.isArray(this.props.uploadLocalImageValue)) {
|
|
121
111
|
let uploadedFileList = this.renderUploadedFile();
|
|
@@ -170,9 +160,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
170
160
|
return imageArr;
|
|
171
161
|
};
|
|
172
162
|
this.renderUploadedFile = () => {
|
|
173
|
-
const
|
|
174
|
-
uploadLocalImageValue
|
|
175
|
-
} = this.props;
|
|
163
|
+
const uploadLocalImageValue = this.props.uploadLocalImageValue;
|
|
176
164
|
let uploadedFileList = [];
|
|
177
165
|
uploadedFileList = uploadLocalImageValue.length > 0 && uploadLocalImageValue.map((imgSrc, index) => {
|
|
178
166
|
let imageThumbnailUrl = (0, _url.getImageThumbnailUrl)(imgSrc);
|
|
@@ -202,9 +190,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
202
190
|
return uploadedFileList;
|
|
203
191
|
};
|
|
204
192
|
this.renderUploadFileWrapper = imageArr => {
|
|
205
|
-
let
|
|
206
|
-
isImageTipShow
|
|
207
|
-
} = this.state;
|
|
193
|
+
let isImageTipShow = this.state.isImageTipShow;
|
|
208
194
|
let editorContent;
|
|
209
195
|
let className = imageArr.length === 0 ? "dtable-ui-image-upload-container ".concat(isImageTipShow ? 'dtable-ui-image-upload-container-active' : '') : 'dtable-ui-image-wrapper';
|
|
210
196
|
if (imageArr.length === 0) {
|
|
@@ -25,9 +25,7 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
this.showLargeImage = itemUrl => {
|
|
28
|
-
let
|
|
29
|
-
value
|
|
30
|
-
} = this.props;
|
|
28
|
+
let value = this.props.value;
|
|
31
29
|
this.setState({
|
|
32
30
|
isShowLargeImage: true,
|
|
33
31
|
largeImageIndex: value.indexOf(itemUrl)
|
|
@@ -57,9 +55,7 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
57
55
|
};
|
|
58
56
|
this.deleteImage = (index, type) => {
|
|
59
57
|
this.props.deleteImage(index, type);
|
|
60
|
-
const
|
|
61
|
-
value
|
|
62
|
-
} = this.props;
|
|
58
|
+
const value = this.props.value;
|
|
63
59
|
if (index > value.length - 2) {
|
|
64
60
|
if (value.length - 2 < 0) {
|
|
65
61
|
this.hideLargeImage();
|
|
@@ -102,9 +98,7 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
102
98
|
}
|
|
103
99
|
}
|
|
104
100
|
render() {
|
|
105
|
-
let
|
|
106
|
-
value
|
|
107
|
-
} = this.props;
|
|
101
|
+
let value = this.props.value;
|
|
108
102
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
109
103
|
className: "dtable-ui-image-previewer-container",
|
|
110
104
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -24,10 +24,9 @@ class PCImageEditor extends _react.default.Component {
|
|
|
24
24
|
return this.state.value;
|
|
25
25
|
};
|
|
26
26
|
this.getEditorView = () => {
|
|
27
|
-
const
|
|
28
|
-
isInModal,
|
|
29
|
-
value
|
|
30
|
-
} = this.props;
|
|
27
|
+
const _this$props = this.props,
|
|
28
|
+
isInModal = _this$props.isInModal,
|
|
29
|
+
value = _this$props.value;
|
|
31
30
|
return !value || value.length === 0 || isInModal ? _constants.FILE_EDITOR_STATUS.ADDITION : _constants.FILE_EDITOR_STATUS.PREVIEWER;
|
|
32
31
|
};
|
|
33
32
|
this.deleteImage = function (index) {
|
|
@@ -57,10 +56,9 @@ class PCImageEditor extends _react.default.Component {
|
|
|
57
56
|
e.stopPropagation();
|
|
58
57
|
if (this.state.isOpen && this.state.isUpdated) {
|
|
59
58
|
if (this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION) {
|
|
60
|
-
let
|
|
61
|
-
value,
|
|
62
|
-
uploadLocalImageValue
|
|
63
|
-
} = this.state;
|
|
59
|
+
let _this$state = this.state,
|
|
60
|
+
value = _this$state.value,
|
|
61
|
+
uploadLocalImageValue = _this$state.uploadLocalImageValue;
|
|
64
62
|
let newValue = value.concat(uploadLocalImageValue);
|
|
65
63
|
this.setState({
|
|
66
64
|
value: newValue
|
|
@@ -114,9 +112,7 @@ class PCImageEditor extends _react.default.Component {
|
|
|
114
112
|
});
|
|
115
113
|
};
|
|
116
114
|
this.renderHeader = () => {
|
|
117
|
-
let
|
|
118
|
-
editorView
|
|
119
|
-
} = this.state;
|
|
115
|
+
let editorView = this.state.editorView;
|
|
120
116
|
if (this.props.isInModal) {
|
|
121
117
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
122
118
|
children: (0, _lang.getLocale)('Add_images')
|
|
@@ -138,11 +134,10 @@ class PCImageEditor extends _react.default.Component {
|
|
|
138
134
|
});
|
|
139
135
|
};
|
|
140
136
|
this.showImageListPreviewer = () => {
|
|
141
|
-
let
|
|
142
|
-
value,
|
|
143
|
-
uploadLocalImageValue,
|
|
144
|
-
imageLinkValue
|
|
145
|
-
} = this.state;
|
|
137
|
+
let _this$state2 = this.state,
|
|
138
|
+
value = _this$state2.value,
|
|
139
|
+
uploadLocalImageValue = _this$state2.uploadLocalImageValue,
|
|
140
|
+
imageLinkValue = _this$state2.imageLinkValue;
|
|
146
141
|
let newValue = value.concat(uploadLocalImageValue, imageLinkValue);
|
|
147
142
|
this.setState({
|
|
148
143
|
value: newValue
|
|
@@ -1,26 +1,34 @@
|
|
|
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 _Loading = _interopRequireDefault(require("../Loading"));
|
|
11
12
|
var _url = require("../utils/url");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
const ImagesLazyLoad = _ref => {
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
15
|
+
let images = _ref.images,
|
|
16
|
+
server = _ref.server,
|
|
17
|
+
onImageClick = _ref.onImageClick,
|
|
18
|
+
renderItem = _ref.renderItem,
|
|
19
|
+
dtableUuid = _ref.dtableUuid;
|
|
20
|
+
const _useState = (0, _react.useState)(images),
|
|
21
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
22
|
+
currentImages = _useState2[0],
|
|
23
|
+
setCurrentImages = _useState2[1];
|
|
24
|
+
const _useState3 = (0, _react.useState)([]),
|
|
25
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
26
|
+
loadedImages = _useState4[0],
|
|
27
|
+
setLoadedImages = _useState4[1];
|
|
28
|
+
const _useState5 = (0, _react.useState)(0),
|
|
29
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
30
|
+
loadedCount = _useState6[0],
|
|
31
|
+
setLoadedCount = _useState6[1];
|
|
24
32
|
const lazyLoadImage = (url, resolve, reject) => {
|
|
25
33
|
if (!url) {
|
|
26
34
|
reject('img path is required');
|
|
@@ -63,20 +63,18 @@ class ImageFormatter extends _react.default.Component {
|
|
|
63
63
|
this.canRotate = props.rotateImage && !props.readOnly;
|
|
64
64
|
}
|
|
65
65
|
render() {
|
|
66
|
-
const
|
|
67
|
-
isSample,
|
|
68
|
-
value,
|
|
69
|
-
server,
|
|
70
|
-
containerClassName,
|
|
71
|
-
lightboxClassName,
|
|
72
|
-
readOnly,
|
|
73
|
-
dtableUuid
|
|
74
|
-
} = this.props;
|
|
66
|
+
const _this$props = this.props,
|
|
67
|
+
isSample = _this$props.isSample,
|
|
68
|
+
value = _this$props.value,
|
|
69
|
+
server = _this$props.server,
|
|
70
|
+
containerClassName = _this$props.containerClassName,
|
|
71
|
+
lightboxClassName = _this$props.lightboxClassName,
|
|
72
|
+
readOnly = _this$props.readOnly,
|
|
73
|
+
dtableUuid = _this$props.dtableUuid;
|
|
75
74
|
const className = (0, _classnames.default)('dtable-ui cell-formatter-container image-formatter', containerClassName);
|
|
76
|
-
const
|
|
77
|
-
isPreviewImage,
|
|
78
|
-
previewImageIndex
|
|
79
|
-
} = this.state;
|
|
75
|
+
const _this$state = this.state,
|
|
76
|
+
isPreviewImage = _this$state.isPreviewImage,
|
|
77
|
+
previewImageIndex = _this$state.previewImageIndex;
|
|
80
78
|
if (!Array.isArray(value) || value.length === 0) {
|
|
81
79
|
return null;
|
|
82
80
|
}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
11
|
var _reactImageLightbox = _interopRequireDefault(require("@seafile/react-image-lightbox"));
|
|
@@ -14,18 +15,16 @@ require("@seafile/react-image-lightbox/style.css");
|
|
|
14
15
|
require("./index.css");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
function ImagePreviewerLightbox(props) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onRotateImage
|
|
28
|
-
} = props;
|
|
18
|
+
const imageItems = props.imageItems,
|
|
19
|
+
imageIndex = props.imageIndex,
|
|
20
|
+
readOnly = props.readOnly,
|
|
21
|
+
className = props.className,
|
|
22
|
+
server = props.server,
|
|
23
|
+
workspaceID = props.workspaceID,
|
|
24
|
+
dtableUuid = props.dtableUuid,
|
|
25
|
+
deleteImage = props.deleteImage,
|
|
26
|
+
downloadImage = props.downloadImage,
|
|
27
|
+
onRotateImage = props.onRotateImage;
|
|
29
28
|
const imageSrcList = imageItems.map(src => {
|
|
30
29
|
let name = '';
|
|
31
30
|
try {
|
|
@@ -58,7 +57,10 @@ function ImagePreviewerLightbox(props) {
|
|
|
58
57
|
};
|
|
59
58
|
});
|
|
60
59
|
const imagesLength = imageSrcList.length;
|
|
61
|
-
const
|
|
60
|
+
const _React$useState = _react.default.useState(imageIndex || 0),
|
|
61
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
62
|
+
currentImageIndex = _React$useState2[0],
|
|
63
|
+
setCurrentImageIndex = _React$useState2[1];
|
|
62
64
|
const imageItem = imageSrcList[currentImageIndex];
|
|
63
65
|
const URL = imageItem ? imageItem.thumbnail : '';
|
|
64
66
|
const imageName = imageItem ? imageItem.name : '';
|
|
@@ -66,9 +66,9 @@ class ImageThumbnail extends _react.default.Component {
|
|
|
66
66
|
showTip: false
|
|
67
67
|
};
|
|
68
68
|
this.ref = null;
|
|
69
|
-
const {
|
|
70
|
-
mediaUrl =
|
|
71
|
-
|
|
69
|
+
const _ref = props.config || {},
|
|
70
|
+
_ref$mediaUrl = _ref.mediaUrl,
|
|
71
|
+
mediaUrl = _ref$mediaUrl === void 0 ? '' : _ref$mediaUrl;
|
|
72
72
|
this.imageLoadingFailedUrl = "".concat(mediaUrl, "img/image-loading-failed.png");
|
|
73
73
|
}
|
|
74
74
|
componentDidMount() {
|
|
@@ -80,16 +80,13 @@ class ImageThumbnail extends _react.default.Component {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
render() {
|
|
83
|
-
const
|
|
84
|
-
index,
|
|
85
|
-
downloadImage,
|
|
86
|
-
src,
|
|
87
|
-
className,
|
|
88
|
-
name
|
|
89
|
-
|
|
90
|
-
const {
|
|
91
|
-
imageThumbnailUrl
|
|
92
|
-
} = this.state;
|
|
83
|
+
const _this$props = this.props,
|
|
84
|
+
index = _this$props.index,
|
|
85
|
+
downloadImage = _this$props.downloadImage,
|
|
86
|
+
src = _this$props.src,
|
|
87
|
+
className = _this$props.className,
|
|
88
|
+
name = _this$props.name;
|
|
89
|
+
const imageThumbnailUrl = this.state.imageThumbnailUrl;
|
|
93
90
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
94
91
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
95
92
|
className: (0, _classnames.default)('dtable-ui-image-thumbnail', className),
|
|
@@ -50,9 +50,7 @@ class NumberInput extends React.Component {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
this.doBlur = ev => {
|
|
53
|
-
const
|
|
54
|
-
value
|
|
55
|
-
} = this.state;
|
|
53
|
+
const value = this.state.value;
|
|
56
54
|
if (ev.target !== this.inputRef) {
|
|
57
55
|
this.onInputBlur(value);
|
|
58
56
|
}
|
|
@@ -72,9 +70,7 @@ class NumberInput extends React.Component {
|
|
|
72
70
|
if (IS_REACT_16) {
|
|
73
71
|
this.keyBoard = null;
|
|
74
72
|
}
|
|
75
|
-
const
|
|
76
|
-
focus
|
|
77
|
-
} = this.state;
|
|
73
|
+
const focus = this.state.focus;
|
|
78
74
|
if (focus) {
|
|
79
75
|
this.setState({
|
|
80
76
|
focus: false
|
|
@@ -86,9 +82,7 @@ class NumberInput extends React.Component {
|
|
|
86
82
|
}
|
|
87
83
|
};
|
|
88
84
|
this.onInputFocus = () => {
|
|
89
|
-
const
|
|
90
|
-
value
|
|
91
|
-
} = this.state;
|
|
85
|
+
const value = this.state.value;
|
|
92
86
|
this.props.onFocus(value);
|
|
93
87
|
this.setState({
|
|
94
88
|
focus: true
|
|
@@ -100,9 +94,8 @@ class NumberInput extends React.Component {
|
|
|
100
94
|
const keyBoardHeight = customNumberKeyboard.antmKeyboard.offsetHeight;
|
|
101
95
|
this.getContainer().style.height = "".concat(keyBoardHeight, "px");
|
|
102
96
|
if (this.inputRef) {
|
|
103
|
-
const
|
|
104
|
-
bottom
|
|
105
|
-
} = this.inputRef.getBoundingClientRect();
|
|
97
|
+
const _this$inputRef$getBou = this.inputRef.getBoundingClientRect(),
|
|
98
|
+
bottom = _this$inputRef$getBou.bottom;
|
|
106
99
|
const clientHeight = window.innerHeight;
|
|
107
100
|
// 计算输入框距离视窗的底部距离
|
|
108
101
|
const distance = clientHeight - bottom;
|
|
@@ -125,16 +118,10 @@ class NumberInput extends React.Component {
|
|
|
125
118
|
});
|
|
126
119
|
};
|
|
127
120
|
this.onKeyboardClick = KeyboardItemValue => {
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
} = this.props;
|
|
131
|
-
const {
|
|
132
|
-
value
|
|
133
|
-
} = this.state;
|
|
121
|
+
const maxLength = this.props.maxLength;
|
|
122
|
+
const value = this.state.value;
|
|
134
123
|
// tslint:disable-next-line:no-this-assignment
|
|
135
|
-
const
|
|
136
|
-
onChange
|
|
137
|
-
} = this;
|
|
124
|
+
const onChange = this.onChange;
|
|
138
125
|
let valueAfterChange;
|
|
139
126
|
// 删除键
|
|
140
127
|
if (KeyboardItemValue === 'delete') {
|
|
@@ -193,9 +180,7 @@ class NumberInput extends React.Component {
|
|
|
193
180
|
// this focus may invocked by users page button click, so this click may trigger blurEventListener at the same time
|
|
194
181
|
this.renderCustomKeyboard();
|
|
195
182
|
this.removeBlurListener();
|
|
196
|
-
const
|
|
197
|
-
focus
|
|
198
|
-
} = this.state;
|
|
183
|
+
const focus = this.state.focus;
|
|
199
184
|
if (!focus) {
|
|
200
185
|
this.onInputFocus();
|
|
201
186
|
}
|
|
@@ -223,15 +208,14 @@ class NumberInput extends React.Component {
|
|
|
223
208
|
this.unLinkInput();
|
|
224
209
|
}
|
|
225
210
|
getComponent() {
|
|
226
|
-
const
|
|
227
|
-
confirmLabel,
|
|
228
|
-
backspaceLabel,
|
|
229
|
-
cancelKeyboardLabel,
|
|
230
|
-
keyboardPrefixCls,
|
|
231
|
-
moneyKeyboardWrapProps,
|
|
232
|
-
moneyKeyboardHeader,
|
|
233
|
-
disabledKeys
|
|
234
|
-
} = this.props;
|
|
211
|
+
const _this$props = this.props,
|
|
212
|
+
confirmLabel = _this$props.confirmLabel,
|
|
213
|
+
backspaceLabel = _this$props.backspaceLabel,
|
|
214
|
+
cancelKeyboardLabel = _this$props.cancelKeyboardLabel,
|
|
215
|
+
keyboardPrefixCls = _this$props.keyboardPrefixCls,
|
|
216
|
+
moneyKeyboardWrapProps = _this$props.moneyKeyboardWrapProps,
|
|
217
|
+
moneyKeyboardHeader = _this$props.moneyKeyboardHeader,
|
|
218
|
+
disabledKeys = _this$props.disabledKeys;
|
|
235
219
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_customKeyboard.default, {
|
|
236
220
|
ref: this.saveRef,
|
|
237
221
|
onClick: this.onKeyboardClick,
|
|
@@ -245,9 +229,7 @@ class NumberInput extends React.Component {
|
|
|
245
229
|
});
|
|
246
230
|
}
|
|
247
231
|
getContainer() {
|
|
248
|
-
const
|
|
249
|
-
keyboardPrefixCls
|
|
250
|
-
} = this.props;
|
|
232
|
+
const keyboardPrefixCls = this.props.keyboardPrefixCls;
|
|
251
233
|
let container = document.querySelector("#".concat(keyboardPrefixCls, "-container"));
|
|
252
234
|
if (!container) {
|
|
253
235
|
container = document.createElement('div');
|
|
@@ -276,16 +258,14 @@ class NumberInput extends React.Component {
|
|
|
276
258
|
return this.keyBoard;
|
|
277
259
|
}
|
|
278
260
|
render() {
|
|
279
|
-
const
|
|
280
|
-
placeholder,
|
|
281
|
-
disabled,
|
|
282
|
-
editable,
|
|
283
|
-
moneyKeyboardAlign
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
value
|
|
288
|
-
} = this.state;
|
|
261
|
+
const _this$props2 = this.props,
|
|
262
|
+
placeholder = _this$props2.placeholder,
|
|
263
|
+
disabled = _this$props2.disabled,
|
|
264
|
+
editable = _this$props2.editable,
|
|
265
|
+
moneyKeyboardAlign = _this$props2.moneyKeyboardAlign;
|
|
266
|
+
const _this$state = this.state,
|
|
267
|
+
focus = _this$state.focus,
|
|
268
|
+
value = _this$state.value;
|
|
289
269
|
const preventKeyboard = disabled || !editable;
|
|
290
270
|
const fakeInputCls = (0, _classnames.default)('fake-input', {
|
|
291
271
|
focus,
|
|
@@ -33,16 +33,14 @@ function includes(arr, item) {
|
|
|
33
33
|
class KeyboardItem extends React.Component {
|
|
34
34
|
render() {
|
|
35
35
|
const _this$props = this.props,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
iconOnly
|
|
45
|
-
} = _this$props,
|
|
36
|
+
prefixCls = _this$props.prefixCls,
|
|
37
|
+
onClick = _this$props.onClick,
|
|
38
|
+
className = _this$props.className,
|
|
39
|
+
disabled = _this$props.disabled,
|
|
40
|
+
children = _this$props.children,
|
|
41
|
+
tdRef = _this$props.tdRef,
|
|
42
|
+
label = _this$props.label,
|
|
43
|
+
iconOnly = _this$props.iconOnly,
|
|
46
44
|
restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
47
45
|
let value = children;
|
|
48
46
|
if (className === 'keyboard-delete') {
|
|
@@ -114,14 +112,13 @@ class CustomKeyboard extends React.Component {
|
|
|
114
112
|
};
|
|
115
113
|
}
|
|
116
114
|
render() {
|
|
117
|
-
const
|
|
118
|
-
prefixCls,
|
|
119
|
-
confirmLabel,
|
|
120
|
-
backspaceLabel,
|
|
121
|
-
cancelKeyboardLabel,
|
|
122
|
-
wrapProps,
|
|
123
|
-
header
|
|
124
|
-
} = this.props;
|
|
115
|
+
const _this$props2 = this.props,
|
|
116
|
+
prefixCls = _this$props2.prefixCls,
|
|
117
|
+
confirmLabel = _this$props2.confirmLabel,
|
|
118
|
+
backspaceLabel = _this$props2.backspaceLabel,
|
|
119
|
+
cancelKeyboardLabel = _this$props2.cancelKeyboardLabel,
|
|
120
|
+
wrapProps = _this$props2.wrapProps,
|
|
121
|
+
header = _this$props2.header;
|
|
125
122
|
const wrapperCls = (0, _classnames.default)("".concat(prefixCls, "-wrapper"), "".concat(prefixCls, "-wrapper-hide"));
|
|
126
123
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
127
124
|
className: wrapperCls,
|
package/lib/InputItem/index.js
CHANGED
|
@@ -33,9 +33,7 @@ class InputItem extends React.Component {
|
|
|
33
33
|
_this = this;
|
|
34
34
|
this.onInputChange = e => {
|
|
35
35
|
const el = e.target;
|
|
36
|
-
const
|
|
37
|
-
value: rawVal
|
|
38
|
-
} = el;
|
|
36
|
+
const rawVal = el.value;
|
|
39
37
|
let prePos = 0;
|
|
40
38
|
try {
|
|
41
39
|
// some input type do not support selection, see https://html.spec.whatwg.org/multipage/input.html#do-not-apply
|
|
@@ -43,12 +41,9 @@ class InputItem extends React.Component {
|
|
|
43
41
|
} catch (error) {
|
|
44
42
|
console.warn('Get selection error:', error);
|
|
45
43
|
}
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const {
|
|
50
|
-
type
|
|
51
|
-
} = this.props;
|
|
44
|
+
const _this$state$value = this.state.value,
|
|
45
|
+
preCtrlVal = _this$state$value === void 0 ? '' : _this$state$value;
|
|
46
|
+
const type = this.props.type;
|
|
52
47
|
let ctrlValue = rawVal;
|
|
53
48
|
switch (type) {
|
|
54
49
|
case 'bankCard':
|
|
@@ -96,9 +91,7 @@ class InputItem extends React.Component {
|
|
|
96
91
|
this.handleOnChange = function (value) {
|
|
97
92
|
let isMutated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
98
93
|
let adjustPos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
|
|
99
|
-
const
|
|
100
|
-
onChange
|
|
101
|
-
} = _this.props;
|
|
94
|
+
const onChange = _this.props.onChange;
|
|
102
95
|
if (!('value' in _this.props)) {
|
|
103
96
|
_this.setState({
|
|
104
97
|
value
|
|
@@ -224,48 +217,39 @@ class InputItem extends React.Component {
|
|
|
224
217
|
render() {
|
|
225
218
|
const props = (0, _objectSpread2.default)({}, this.props);
|
|
226
219
|
delete props.updatePlaceholder;
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
disabledKeys
|
|
247
|
-
} = props,
|
|
220
|
+
const prefixCls = props.prefixCls,
|
|
221
|
+
prefixListCls = props.prefixListCls,
|
|
222
|
+
editable = props.editable,
|
|
223
|
+
style = props.style,
|
|
224
|
+
clear = props.clear,
|
|
225
|
+
children = props.children,
|
|
226
|
+
error = props.error,
|
|
227
|
+
className = props.className,
|
|
228
|
+
extra = props.extra,
|
|
229
|
+
labelNumber = props.labelNumber,
|
|
230
|
+
type = props.type,
|
|
231
|
+
onExtraClick = props.onExtraClick,
|
|
232
|
+
onErrorClick = props.onErrorClick,
|
|
233
|
+
moneyKeyboardAlign = props.moneyKeyboardAlign,
|
|
234
|
+
moneyKeyboardWrapProps = props.moneyKeyboardWrapProps,
|
|
235
|
+
moneyKeyboardHeader = props.moneyKeyboardHeader,
|
|
236
|
+
onVirtualKeyboardConfirm = props.onVirtualKeyboardConfirm,
|
|
237
|
+
autoAdjustHeight = props.autoAdjustHeight,
|
|
238
|
+
disabledKeys = props.disabledKeys,
|
|
248
239
|
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
} = restProps;
|
|
254
|
-
const {
|
|
255
|
-
value
|
|
256
|
-
} = this.state;
|
|
240
|
+
const name = restProps.name,
|
|
241
|
+
disabled = restProps.disabled,
|
|
242
|
+
maxLength = restProps.maxLength;
|
|
243
|
+
const value = this.state.value;
|
|
257
244
|
|
|
258
245
|
// tslint:disable-next-line:variable-name
|
|
259
246
|
const _locale = (0, _getLocale.getComponentLocale)(this.props, this.context, 'InputItem', () => require('./locale/zh_CN'));
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
focus,
|
|
267
|
-
placeholder
|
|
268
|
-
} = this.state;
|
|
247
|
+
const confirmLabel = _locale.confirmLabel,
|
|
248
|
+
backspaceLabel = _locale.backspaceLabel,
|
|
249
|
+
cancelKeyboardLabel = _locale.cancelKeyboardLabel;
|
|
250
|
+
const _this$state = this.state,
|
|
251
|
+
focus = _this$state.focus,
|
|
252
|
+
placeholder = _this$state.placeholder;
|
|
269
253
|
const wrapCls = (0, _classnames.default)("".concat(prefixListCls, "-item"), "".concat(prefixCls, "-item"), "".concat(prefixListCls, "-item-middle"), className, {
|
|
270
254
|
["".concat(prefixCls, "-disabled")]: disabled,
|
|
271
255
|
["".concat(prefixCls, "-error")]: error,
|
package/lib/InputItem/input.js
CHANGED
|
@@ -36,10 +36,8 @@ class Input extends React.Component {
|
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
38
|
const _this$props = this.props,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onFocus
|
|
42
|
-
} = _this$props,
|
|
39
|
+
onBlur = _this$props.onBlur,
|
|
40
|
+
onFocus = _this$props.onFocus,
|
|
43
41
|
restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
44
42
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread2.default)({
|
|
45
43
|
ref: el => this.inputRef = el,
|
|
@@ -20,10 +20,9 @@ class LastModifierFormatter extends _react.default.PureComponent {
|
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
22
|
this.getCollaborators = () => {
|
|
23
|
-
let
|
|
24
|
-
value,
|
|
25
|
-
collaborators
|
|
26
|
-
} = this.props;
|
|
23
|
+
let _this$props = this.props,
|
|
24
|
+
value = _this$props.value,
|
|
25
|
+
collaborators = _this$props.collaborators;
|
|
27
26
|
if (!Array.isArray(value)) {
|
|
28
27
|
value = [value];
|
|
29
28
|
}
|
|
@@ -43,10 +42,9 @@ class LastModifierFormatter extends _react.default.PureComponent {
|
|
|
43
42
|
};
|
|
44
43
|
}
|
|
45
44
|
render() {
|
|
46
|
-
const
|
|
47
|
-
containerClassName,
|
|
48
|
-
value
|
|
49
|
-
} = this.props;
|
|
45
|
+
const _this$props2 = this.props,
|
|
46
|
+
containerClassName = _this$props2.containerClassName,
|
|
47
|
+
value = _this$props2.value;
|
|
50
48
|
const classname = (0, _classnames.default)('dtable-ui cell-formatter-container last-modified-formatter', containerClassName);
|
|
51
49
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
52
50
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|