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
|
@@ -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 _reactstrap = require("reactstrap");
|
|
11
10
|
var _filesPreviewer = _interopRequireDefault(require("../files-previewer"));
|
|
@@ -27,9 +26,10 @@ class PCFileEditor extends _react.default.Component {
|
|
|
27
26
|
return this.state.value;
|
|
28
27
|
};
|
|
29
28
|
this.getEditorView = () => {
|
|
30
|
-
const
|
|
31
|
-
isInModal
|
|
32
|
-
value
|
|
29
|
+
const {
|
|
30
|
+
isInModal,
|
|
31
|
+
value
|
|
32
|
+
} = this.props;
|
|
33
33
|
return !value || value.length === 0 || isInModal ? _constants.FILE_EDITOR_STATUS.ADDITION : _constants.FILE_EDITOR_STATUS.PREVIEWER;
|
|
34
34
|
};
|
|
35
35
|
this.deleteImage = function (index) {
|
|
@@ -59,9 +59,10 @@ class PCFileEditor extends _react.default.Component {
|
|
|
59
59
|
e.stopPropagation();
|
|
60
60
|
if (this.state.isOpen && this.state.isUpdated) {
|
|
61
61
|
if (this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION) {
|
|
62
|
-
let
|
|
63
|
-
value
|
|
64
|
-
uploadLocalFileValue
|
|
62
|
+
let {
|
|
63
|
+
value,
|
|
64
|
+
uploadLocalFileValue
|
|
65
|
+
} = this.state;
|
|
65
66
|
let newValue = value.concat(uploadLocalFileValue);
|
|
66
67
|
this.setState({
|
|
67
68
|
value: newValue
|
|
@@ -111,11 +112,13 @@ class PCFileEditor extends _react.default.Component {
|
|
|
111
112
|
};
|
|
112
113
|
this.addUploadedFile = fileMessageList => {
|
|
113
114
|
const uploadLocalFileValue = [...this.state.uploadLocalFileValue, ...fileMessageList.map(_ref => {
|
|
114
|
-
let
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
let {
|
|
116
|
+
name,
|
|
117
|
+
size,
|
|
118
|
+
type,
|
|
119
|
+
url,
|
|
120
|
+
mtime
|
|
121
|
+
} = _ref;
|
|
119
122
|
return {
|
|
120
123
|
name,
|
|
121
124
|
size,
|
|
@@ -130,7 +133,9 @@ class PCFileEditor extends _react.default.Component {
|
|
|
130
133
|
});
|
|
131
134
|
};
|
|
132
135
|
this.renderHeader = () => {
|
|
133
|
-
let
|
|
136
|
+
let {
|
|
137
|
+
editorView
|
|
138
|
+
} = this.state;
|
|
134
139
|
// if (this.props.isInModal) {
|
|
135
140
|
// return (<span>{getLocale('Add_files')}</span>);
|
|
136
141
|
// }
|
|
@@ -150,10 +155,11 @@ class PCFileEditor extends _react.default.Component {
|
|
|
150
155
|
});
|
|
151
156
|
};
|
|
152
157
|
this.showImageListPreviewer = () => {
|
|
153
|
-
let
|
|
154
|
-
value
|
|
155
|
-
uploadLocalFileValue
|
|
156
|
-
imageLinkValue
|
|
158
|
+
let {
|
|
159
|
+
value,
|
|
160
|
+
uploadLocalFileValue,
|
|
161
|
+
imageLinkValue
|
|
162
|
+
} = this.state;
|
|
157
163
|
let newValue = value.concat(uploadLocalFileValue, imageLinkValue);
|
|
158
164
|
this.setState({
|
|
159
165
|
value: newValue
|
|
@@ -196,13 +202,15 @@ class PCFileEditor extends _react.default.Component {
|
|
|
196
202
|
let fileItem = newValue[index];
|
|
197
203
|
if (!this.props.renameFile) return;
|
|
198
204
|
this.props.renameFile(fileItem, newName).then(res => {
|
|
199
|
-
const
|
|
200
|
-
name = _res$data.name,
|
|
201
|
-
url = _res$data.url;
|
|
202
|
-
fileItem = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, fileItem), {}, {
|
|
205
|
+
const {
|
|
203
206
|
name,
|
|
204
207
|
url
|
|
205
|
-
}
|
|
208
|
+
} = res.data;
|
|
209
|
+
fileItem = {
|
|
210
|
+
...fileItem,
|
|
211
|
+
name,
|
|
212
|
+
url
|
|
213
|
+
};
|
|
206
214
|
newValue[index] = fileItem;
|
|
207
215
|
this.setState({
|
|
208
216
|
value: newValue
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
11
|
var _FileItemFormatter = _interopRequireDefault(require("../FileItemFormatter"));
|
|
@@ -15,33 +14,27 @@ var _url = require("../utils/url");
|
|
|
15
14
|
require("./index.css");
|
|
16
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
16
|
const FileFormatter = _ref => {
|
|
18
|
-
let
|
|
19
|
-
isSample =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const _useState = (0, _react.useState)(-1),
|
|
33
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
34
|
-
largeImageIndex = _useState2[0],
|
|
35
|
-
setLargeImageIndex = _useState2[1];
|
|
36
|
-
const _useState3 = (0, _react.useState)([]),
|
|
37
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
38
|
-
fileImageUrlList = _useState4[0],
|
|
39
|
-
setFileImageUrlList = _useState4[1];
|
|
17
|
+
let {
|
|
18
|
+
isSample = false,
|
|
19
|
+
value = [],
|
|
20
|
+
containerClassName = '',
|
|
21
|
+
renderItem,
|
|
22
|
+
isSupportOpenFile = false,
|
|
23
|
+
onOpenFile,
|
|
24
|
+
server,
|
|
25
|
+
workspaceID,
|
|
26
|
+
dtableUuid,
|
|
27
|
+
downloadImage
|
|
28
|
+
} = _ref;
|
|
29
|
+
const [largeImageIndex, setLargeImageIndex] = (0, _react.useState)(-1);
|
|
30
|
+
const [fileImageUrlList, setFileImageUrlList] = (0, _react.useState)([]);
|
|
40
31
|
const getFileItemImageUrlList = (0, _react.useCallback)(value => {
|
|
41
32
|
let newFileImageUrlList = [];
|
|
42
33
|
value.forEach(fileItem => {
|
|
43
|
-
const
|
|
44
|
-
|
|
34
|
+
const {
|
|
35
|
+
url,
|
|
36
|
+
name
|
|
37
|
+
} = fileItem;
|
|
45
38
|
let assetFileIndex = typeof url === 'string' ? url.indexOf('/asset') : -1;
|
|
46
39
|
if (assetFileIndex > -1) {
|
|
47
40
|
const isImage = (0, _url.imageCheck)(name);
|
|
@@ -97,7 +90,7 @@ const FileFormatter = _ref => {
|
|
|
97
90
|
file: item
|
|
98
91
|
}), value.length !== 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
99
92
|
className: "file-item-count",
|
|
100
|
-
children:
|
|
93
|
+
children: `+${value.length}`
|
|
101
94
|
})]
|
|
102
95
|
});
|
|
103
96
|
}
|
|
@@ -9,15 +9,18 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _url = require("../utils/url");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
const FileItemFormatter = _ref => {
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
let {
|
|
13
|
+
file,
|
|
14
|
+
config,
|
|
15
|
+
openFile
|
|
16
|
+
} = _ref;
|
|
17
|
+
const {
|
|
18
|
+
fileIconUrl,
|
|
19
|
+
isImage
|
|
20
|
+
} = (0, _url.getFileThumbnailInfo)(file, config);
|
|
18
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
19
22
|
onClick: () => openFile && openFile(file),
|
|
20
|
-
className:
|
|
23
|
+
className: `file-item-icon ${isImage ? 'img' : ''}`,
|
|
21
24
|
src: fileIconUrl,
|
|
22
25
|
alt: (file === null || file === void 0 ? void 0 : file.name) || ''
|
|
23
26
|
});
|
|
@@ -27,9 +27,10 @@ class FileUploader extends _react.default.Component {
|
|
|
27
27
|
this.uploadFileRef.click();
|
|
28
28
|
};
|
|
29
29
|
this.onDragEnter = e => {
|
|
30
|
-
const
|
|
31
|
-
isSupportDragDrop
|
|
32
|
-
updateParentTips
|
|
30
|
+
const {
|
|
31
|
+
isSupportDragDrop,
|
|
32
|
+
updateParentTips
|
|
33
|
+
} = this.props;
|
|
33
34
|
if (isSupportDragDrop) {
|
|
34
35
|
e.preventDefault();
|
|
35
36
|
this.enteredCounter++;
|
|
@@ -39,16 +40,19 @@ class FileUploader extends _react.default.Component {
|
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
this.onDragOver = e => {
|
|
42
|
-
const
|
|
43
|
+
const {
|
|
44
|
+
isSupportDragDrop
|
|
45
|
+
} = this.props;
|
|
43
46
|
if (isSupportDragDrop) {
|
|
44
47
|
e.stopPropagation();
|
|
45
48
|
e.preventDefault();
|
|
46
49
|
}
|
|
47
50
|
};
|
|
48
51
|
this.onDragLeave = e => {
|
|
49
|
-
const
|
|
50
|
-
isSupportDragDrop
|
|
51
|
-
updateParentTips
|
|
52
|
+
const {
|
|
53
|
+
isSupportDragDrop,
|
|
54
|
+
updateParentTips
|
|
55
|
+
} = this.props;
|
|
52
56
|
if (isSupportDragDrop) {
|
|
53
57
|
this.enteredCounter--;
|
|
54
58
|
if (this.enteredCounter === 0) {
|
|
@@ -57,10 +61,11 @@ class FileUploader extends _react.default.Component {
|
|
|
57
61
|
}
|
|
58
62
|
};
|
|
59
63
|
this.onDrop = event => {
|
|
60
|
-
const
|
|
61
|
-
isSupportDragDrop
|
|
62
|
-
updateParentTips
|
|
63
|
-
onCellTipShow
|
|
64
|
+
const {
|
|
65
|
+
isSupportDragDrop,
|
|
66
|
+
updateParentTips,
|
|
67
|
+
onCellTipShow
|
|
68
|
+
} = this.props;
|
|
64
69
|
if (isSupportDragDrop) {
|
|
65
70
|
this.enteredCounter = 0;
|
|
66
71
|
updateParentTips(false);
|
|
@@ -74,7 +79,9 @@ class FileUploader extends _react.default.Component {
|
|
|
74
79
|
}
|
|
75
80
|
};
|
|
76
81
|
this.onPaste = event => {
|
|
77
|
-
const
|
|
82
|
+
const {
|
|
83
|
+
isSupportPaste
|
|
84
|
+
} = this.props;
|
|
78
85
|
if (isSupportPaste) {
|
|
79
86
|
event.stopPropagation();
|
|
80
87
|
let cliperData = (0, _getEventTransfer.default)(event);
|
|
@@ -85,17 +92,19 @@ class FileUploader extends _react.default.Component {
|
|
|
85
92
|
}
|
|
86
93
|
};
|
|
87
94
|
this.onMouseEnter = () => {
|
|
88
|
-
const
|
|
89
|
-
updateParentTips
|
|
90
|
-
uploadType
|
|
95
|
+
const {
|
|
96
|
+
updateParentTips,
|
|
97
|
+
uploadType
|
|
98
|
+
} = this.props;
|
|
91
99
|
if (uploadType === 'image') {
|
|
92
100
|
if (updateParentTips) updateParentTips(true, uploadType);
|
|
93
101
|
}
|
|
94
102
|
};
|
|
95
103
|
this.onMouseLeave = () => {
|
|
96
|
-
const
|
|
97
|
-
updateParentTips
|
|
98
|
-
uploadType
|
|
104
|
+
const {
|
|
105
|
+
updateParentTips,
|
|
106
|
+
uploadType
|
|
107
|
+
} = this.props;
|
|
99
108
|
if (uploadType === 'image') {
|
|
100
109
|
if (updateParentTips) updateParentTips(false, uploadType);
|
|
101
110
|
}
|
|
@@ -106,10 +115,11 @@ class FileUploader extends _react.default.Component {
|
|
|
106
115
|
this.handleFilesChange = function (files) {
|
|
107
116
|
let isPasteUpload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
108
117
|
const _this = _this2;
|
|
109
|
-
const
|
|
110
|
-
uploadType
|
|
111
|
-
updateUploadFileList
|
|
112
|
-
onCellTipShow
|
|
118
|
+
const {
|
|
119
|
+
uploadType,
|
|
120
|
+
updateUploadFileList,
|
|
121
|
+
onCellTipShow
|
|
122
|
+
} = _this2.props;
|
|
113
123
|
let uploadFileList = [];
|
|
114
124
|
let dealFileCnt = 0;
|
|
115
125
|
let allFileLen = files.length;
|
|
@@ -127,7 +137,7 @@ class FileUploader extends _react.default.Component {
|
|
|
127
137
|
for (let i = 0; i < allFileLen; i++) {
|
|
128
138
|
let uploadFile = files[i];
|
|
129
139
|
if (isPasteUpload && uploadFile.name === 'image.png') {
|
|
130
|
-
let newName =
|
|
140
|
+
let newName = `image-${(0, _dayjs.default)().format('YYYY-MM-DD-HH-mm')}.png`;
|
|
131
141
|
uploadFile = new File([uploadFile], newName, {
|
|
132
142
|
type: uploadFile.type
|
|
133
143
|
});
|
|
@@ -187,7 +197,9 @@ class FileUploader extends _react.default.Component {
|
|
|
187
197
|
});
|
|
188
198
|
};
|
|
189
199
|
this.handleFileChange = (fileMessage, callback) => {
|
|
190
|
-
const
|
|
200
|
+
const {
|
|
201
|
+
onFileUploadFailed
|
|
202
|
+
} = this.props;
|
|
191
203
|
this.uploadFile(fileMessage).then(res => {
|
|
192
204
|
const data = res;
|
|
193
205
|
this.uploadFileMessage({
|
|
@@ -208,9 +220,10 @@ class FileUploader extends _react.default.Component {
|
|
|
208
220
|
});
|
|
209
221
|
};
|
|
210
222
|
this.uploadFileMessage = _ref => {
|
|
211
|
-
let
|
|
212
|
-
data =
|
|
213
|
-
fileMessage
|
|
223
|
+
let {
|
|
224
|
+
data = {},
|
|
225
|
+
fileMessage
|
|
226
|
+
} = _ref;
|
|
214
227
|
fileMessage.name = data.name;
|
|
215
228
|
fileMessage.isUploading = false;
|
|
216
229
|
fileMessage.size = data.size;
|
|
@@ -226,7 +239,9 @@ class FileUploader extends _react.default.Component {
|
|
|
226
239
|
this.handleFileChange(fileMessage);
|
|
227
240
|
};
|
|
228
241
|
this.onUploadProgress = (event, fileMessage) => {
|
|
229
|
-
const
|
|
242
|
+
const {
|
|
243
|
+
onFileUploadProgress
|
|
244
|
+
} = this.props;
|
|
230
245
|
let uploadPercent = Math.floor(event.loaded / event.total * 100);
|
|
231
246
|
fileMessage.percent = uploadPercent;
|
|
232
247
|
if (onFileUploadProgress) onFileUploadProgress(fileMessage);
|
|
@@ -241,7 +256,9 @@ class FileUploader extends _react.default.Component {
|
|
|
241
256
|
};
|
|
242
257
|
}
|
|
243
258
|
render() {
|
|
244
|
-
const
|
|
259
|
+
const {
|
|
260
|
+
uploadType
|
|
261
|
+
} = this.props;
|
|
245
262
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
246
263
|
onDragEnter: this.onDragEnter,
|
|
247
264
|
onDragOver: this.onDragOver,
|
|
@@ -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 _baseFormatterConfig = _interopRequireDefault(require("../formatterConfig/base-formatter-config"));
|
|
@@ -32,10 +31,12 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
33
|
this.renderCellValue = (cellValue, resultType) => {
|
|
35
|
-
const
|
|
34
|
+
const {
|
|
35
|
+
containerClassName
|
|
36
|
+
} = this.props;
|
|
36
37
|
const gridCellClassName = this.getGridCellClassName(resultType);
|
|
37
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
38
|
-
className:
|
|
39
|
+
className: `dtable-ui cell-formatter-container formula-formatter ${containerClassName} ${gridCellClassName}`,
|
|
39
40
|
title: cellValue,
|
|
40
41
|
"aria-label": cellValue,
|
|
41
42
|
children: cellValue
|
|
@@ -45,13 +46,18 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
45
46
|
return this.renderCellValue(errorValue, resultType);
|
|
46
47
|
};
|
|
47
48
|
this.renderOtherColumnFormatter = () => {
|
|
48
|
-
const
|
|
49
|
-
value
|
|
50
|
-
column
|
|
51
|
-
collaborators
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
49
|
+
const {
|
|
50
|
+
value,
|
|
51
|
+
column,
|
|
52
|
+
collaborators
|
|
53
|
+
} = this.props;
|
|
54
|
+
const {
|
|
55
|
+
data: columnData
|
|
56
|
+
} = column;
|
|
57
|
+
const {
|
|
58
|
+
array_type,
|
|
59
|
+
array_data
|
|
60
|
+
} = columnData;
|
|
55
61
|
if (!array_type || array_type === _dtableUtils.CellType.LINK) {
|
|
56
62
|
return null;
|
|
57
63
|
}
|
|
@@ -66,7 +72,7 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
66
72
|
if (!Array.isArray(value)) {
|
|
67
73
|
cellValue = (0, _cellValueValidator.default)(value, array_type) ? [value] : [];
|
|
68
74
|
}
|
|
69
|
-
const contentItemClassName =
|
|
75
|
+
const contentItemClassName = `formula-formatter-content-item ${_isSimpleCellFormatterColumn ? 'simple-cell-formatter' : ''}`;
|
|
70
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
71
77
|
className: "dtable-ui formula-formatter multiple",
|
|
72
78
|
children: cellValue.map((v, index) => {
|
|
@@ -74,7 +80,7 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
74
80
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
75
81
|
className: contentItemClassName,
|
|
76
82
|
children: this.createColumnFormatter(Formatter, formatterProps)
|
|
77
|
-
},
|
|
83
|
+
}, `formula-formatter-content-item-${index}`);
|
|
78
84
|
})
|
|
79
85
|
});
|
|
80
86
|
};
|
|
@@ -82,7 +88,9 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
82
88
|
switch (array_type) {
|
|
83
89
|
case _dtableUtils.CellType.DURATION:
|
|
84
90
|
{
|
|
85
|
-
const
|
|
91
|
+
const {
|
|
92
|
+
duration_format
|
|
93
|
+
} = array_data;
|
|
86
94
|
return {
|
|
87
95
|
format: duration_format
|
|
88
96
|
};
|
|
@@ -97,30 +105,42 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
97
105
|
}
|
|
98
106
|
default:
|
|
99
107
|
{
|
|
100
|
-
return
|
|
108
|
+
return {
|
|
109
|
+
...array_data,
|
|
101
110
|
collaborators
|
|
102
|
-
}
|
|
111
|
+
};
|
|
103
112
|
}
|
|
104
113
|
}
|
|
105
114
|
};
|
|
106
115
|
}
|
|
107
116
|
createColumnFormatter(Formatter, formatterProps) {
|
|
108
117
|
if (/*#__PURE__*/_react.default.isValidElement(Formatter)) {
|
|
109
|
-
return /*#__PURE__*/_react.default.cloneElement(Formatter,
|
|
118
|
+
return /*#__PURE__*/_react.default.cloneElement(Formatter, {
|
|
119
|
+
...formatterProps
|
|
120
|
+
});
|
|
110
121
|
} else if ((0, _utils2.isFunction)(Formatter)) {
|
|
111
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Formatter,
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Formatter, {
|
|
123
|
+
...formatterProps
|
|
124
|
+
});
|
|
112
125
|
}
|
|
113
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextFormatter.default,
|
|
126
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextFormatter.default, {
|
|
127
|
+
...formatterProps
|
|
128
|
+
});
|
|
114
129
|
}
|
|
115
130
|
render() {
|
|
116
|
-
const
|
|
117
|
-
column
|
|
118
|
-
collaborators
|
|
119
|
-
|
|
131
|
+
const {
|
|
132
|
+
column,
|
|
133
|
+
collaborators
|
|
134
|
+
} = this.props;
|
|
135
|
+
const {
|
|
136
|
+
data
|
|
137
|
+
} = column;
|
|
120
138
|
let value = this.props.value;
|
|
121
139
|
if (!data || !value && value !== 0 && value !== false) return null;
|
|
122
|
-
const
|
|
123
|
-
|
|
140
|
+
const {
|
|
141
|
+
array_type,
|
|
142
|
+
result_type: resultType
|
|
143
|
+
} = data;
|
|
124
144
|
if (_dtableUtils.DISPLAY_INTERNAL_ERRORS.includes(value)) {
|
|
125
145
|
return this.renderInternalErrorValue(value, resultType);
|
|
126
146
|
}
|
|
@@ -6,33 +6,34 @@ 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
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
13
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
14
12
|
var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
15
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["isMobile", "config"];
|
|
17
14
|
const GeolocationEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
let {
|
|
16
|
+
isMobile,
|
|
17
|
+
config: propsConfig,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
21
20
|
const config = (0, _react.useMemo)(() => {
|
|
22
21
|
var _window;
|
|
23
|
-
return
|
|
22
|
+
return {
|
|
23
|
+
...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
|
|
24
|
+
...propsConfig
|
|
25
|
+
};
|
|
24
26
|
}, [propsConfig]);
|
|
25
27
|
const getLocationData = (0, _react.useCallback)(() => {
|
|
26
28
|
var _window2, _window2$app;
|
|
27
29
|
if ((_window2 = window) !== null && _window2 !== void 0 && (_window2$app = _window2.app) !== null && _window2$app !== void 0 && _window2$app.location) return new Promise((resolve, reject) => {
|
|
28
30
|
resolve(window.app.location);
|
|
29
31
|
});
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return fetch("".concat(server).concat(mediaUrl, "geo-data/cn-location.json").replaceAll('//', '/')).then(res => {
|
|
32
|
+
const {
|
|
33
|
+
server = '',
|
|
34
|
+
mediaUrl = ''
|
|
35
|
+
} = config || {};
|
|
36
|
+
return fetch(`${server}${mediaUrl}geo-data/cn-location.json`.replaceAll('//', '/')).then(res => {
|
|
36
37
|
// get locations from server
|
|
37
38
|
return res.json();
|
|
38
39
|
}).catch(() => {
|
|
@@ -49,16 +50,16 @@ const GeolocationEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
49
50
|
if (lang !== 'cn' && window.app.countryListEn) return new Promise((resolve, reject) => {
|
|
50
51
|
resolve(window.app.countryListEn);
|
|
51
52
|
});
|
|
52
|
-
const
|
|
53
|
-
mediaUrl =
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
const {
|
|
54
|
+
mediaUrl = '',
|
|
55
|
+
server = ''
|
|
56
|
+
} = config;
|
|
56
57
|
const geoFileName = lang === 'cn' ? 'cn-region-location' : 'en-region-location';
|
|
57
|
-
return fetch(
|
|
58
|
+
return fetch(`${server}${mediaUrl}geo-data/${geoFileName}.json`.replaceAll('//', '/')).then(res => {
|
|
58
59
|
return res.json();
|
|
59
60
|
}).catch(() => {
|
|
60
61
|
// get locations from local
|
|
61
|
-
return fetch(
|
|
62
|
+
return fetch(`./geo-data/${geoFileName}.json`).then(res => {
|
|
62
63
|
return res.json();
|
|
63
64
|
});
|
|
64
65
|
}).then(res => {
|
|
@@ -71,35 +72,39 @@ const GeolocationEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
71
72
|
return data;
|
|
72
73
|
});
|
|
73
74
|
}, [config]);
|
|
74
|
-
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
75
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
76
|
+
...props,
|
|
75
77
|
config: config,
|
|
76
78
|
getLocationData: getLocationData,
|
|
77
79
|
getCountryData: getCountryData,
|
|
78
80
|
ref: ref
|
|
79
|
-
})
|
|
80
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
81
|
+
});
|
|
82
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
83
|
+
...props,
|
|
81
84
|
config: config,
|
|
82
85
|
getLocationData: getLocationData,
|
|
83
86
|
getCountryData: getCountryData,
|
|
84
87
|
ref: ref
|
|
85
|
-
})
|
|
88
|
+
});
|
|
86
89
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
87
90
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
88
91
|
query: "(min-width: 768px)",
|
|
89
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
92
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
93
|
+
...props,
|
|
90
94
|
config: config,
|
|
91
95
|
getLocationData: getLocationData,
|
|
92
96
|
getCountryData: getCountryData,
|
|
93
97
|
ref: ref
|
|
94
|
-
})
|
|
98
|
+
})
|
|
95
99
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
96
100
|
query: "(max-width: 768px)",
|
|
97
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
101
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
102
|
+
...props,
|
|
98
103
|
config: config,
|
|
99
104
|
getLocationData: getLocationData,
|
|
100
105
|
getCountryData: getCountryData,
|
|
101
106
|
ref: ref
|
|
102
|
-
})
|
|
107
|
+
})
|
|
103
108
|
})]
|
|
104
109
|
});
|
|
105
110
|
});
|