dtable-ui-component 6.0.103 → 6.0.105-beta.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 +35 -42
- package/lib/ActivityIndicator/index.js +9 -9
- package/lib/AsyncUserSelect/index.js +3 -3
- package/lib/Badge/index.js +31 -27
- package/lib/CheckboxEditor/index.js +14 -15
- package/lib/CollaboratorEditor/index.js +15 -16
- package/lib/CollaboratorEditor/pc-editor/index.js +1 -1
- package/lib/CollapsibleSettingLayout/index.js +1 -1
- package/lib/Comment/body/comment.js +1 -1
- package/lib/Comment/body/index.js +9 -7
- package/lib/Comment/footer/index.js +1 -1
- package/lib/Comment/footer/input/index.js +5 -5
- package/lib/Comment/footer/input/participant/index.js +1 -1
- package/lib/Comment/footer/participants/participant-select/index.js +2 -2
- package/lib/Comment/utils/utilities.js +1 -1
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +6 -8
- package/lib/DTableColorPicker/index.js +12 -13
- package/lib/DTableColorPicker/utils.js +1 -1
- package/lib/DTableCommonAddTool/index.js +2 -2
- package/lib/DTableFiltersPopover/index.js +1 -1
- package/lib/DTableFiltersPopover/utils/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-group.js +2 -2
- package/lib/DTableFiltersPopover/widgets/filter-item.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/rate-item.js +5 -5
- package/lib/DTableGroupSelect/select-option-group.js +1 -1
- package/lib/DTableIcon/index.js +4 -4
- package/lib/DTableIcon/svg-icon.js +5 -5
- package/lib/DTableModalHeader/index.js +8 -6
- package/lib/DTableRadioGroup/index.js +3 -3
- package/lib/DTableSelect/dtable-select-label.js +1 -1
- package/lib/DTableSelect/utils.js +36 -55
- package/lib/DateEditor/index.js +10 -13
- package/lib/DateEditor/pc-editor.js +1 -1
- package/lib/DatePicker/utils.js +4 -4
- package/lib/DepartmentMultipleSelectEditor/index.js +3 -3
- package/lib/DepartmentSelectFilter/index.js +2 -5
- package/lib/DepartmentSingleSelectEditor/index.js +14 -15
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +2 -2
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +6 -6
- package/lib/DigitalSignEditor/index.js +14 -15
- package/lib/DigitalSignEditor/mb-editor/index.js +4 -4
- package/lib/DigitalSignEditor/pc-editor/index.js +6 -7
- package/lib/DigitalSignEditor/service.js +1 -1
- package/lib/DigitalSignEditor/signature-board/index.js +2 -2
- package/lib/DigitalSignFormatter/utils.js +1 -1
- package/lib/Drawer/index.js +2 -3
- package/lib/FieldDisplaySetting/field-item.js +1 -1
- package/lib/FieldDisplaySetting/index.js +9 -11
- package/lib/FileEditor/files-previewer/index.js +14 -15
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +2 -2
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +3 -3
- package/lib/FileEditor/index.js +14 -15
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +6 -6
- package/lib/FileEditor/pc-editor/index.js +3 -3
- package/lib/FileFormatter/index.js +2 -1
- package/lib/FileItemFormatter/index.js +1 -1
- package/lib/FileUploader/index.js +1 -1
- package/lib/FormulaFormatter/index.js +9 -15
- package/lib/GeolocationEditor/index.js +19 -23
- package/lib/GeolocationEditor/map-editor-utils.js +6 -10
- package/lib/GeolocationEditor/mb-editor/index.js +24 -27
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +6 -9
- package/lib/GeolocationEditor/pc-editor/country-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/index.js +15 -21
- package/lib/GeolocationEditor/pc-editor/location-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +9 -13
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +6 -9
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +7 -24
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +3 -20
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +1 -1
- package/lib/GeolocationEditor/pc-editor/province-editor.js +2 -2
- package/lib/GeolocationEditor/pc-editor/selector-list.js +1 -1
- package/lib/HtmlLongTextFormatter/index.js +1 -1
- package/lib/Icon/index.js +17 -13
- package/lib/Icon/load-sprite.js +2 -13
- package/lib/IconButton/index.js +14 -11
- package/lib/ImageEditor/images-previewer/image-preview/index.js +1 -1
- package/lib/ImageEditor/index.js +14 -15
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +2 -2
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +5 -5
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +1 -1
- package/lib/ImageFormatter/index.js +1 -1
- package/lib/ImageThumbnail/index.js +2 -2
- package/lib/InputItem/custom-input.js +9 -9
- package/lib/InputItem/custom-keyboard.js +37 -34
- package/lib/InputItem/index.js +49 -52
- package/lib/InputItem/input.js +13 -9
- package/lib/LinkEditor/pc-popover/index.js +2 -3
- package/lib/List/index.js +21 -17
- package/lib/List/list-item.js +52 -50
- package/lib/MBEditorHeader/index.js +1 -1
- package/lib/MobileFullScreenPage/body/index.js +1 -1
- package/lib/MobileFullScreenPage/header/index.js +4 -4
- package/lib/MobileFullScreenPage/index.js +1 -1
- package/lib/MobileModal/index.js +10 -7
- package/lib/Modal/alert.js +2 -2
- package/lib/Modal/modal.js +31 -28
- package/lib/Modal/prompt.js +10 -10
- package/lib/MultipleSelectEditor/index.js +8 -6
- package/lib/MultipleSelectFormatter/index.js +1 -1
- package/lib/PhoneNumberLink/index.js +1 -1
- package/lib/Picker/AbstractPicker.js +28 -26
- package/lib/Popover/index.js +12 -9
- package/lib/Popover/item.js +26 -22
- package/lib/Progress/index.js +8 -10
- package/lib/Radio/Radio.js +15 -13
- package/lib/Radio/RadioItem.js +18 -18
- package/lib/RateFormatter/index.js +2 -2
- package/lib/RoleStatusEditor/index.js +1 -1
- package/lib/RowExpand/index.js +6 -7
- package/lib/RowExpandDialog/body/index.js +14 -14
- package/lib/RowExpandDialog/column-content/index.js +1 -1
- package/lib/RowExpandDialog/header/index.js +3 -4
- package/lib/RowExpandDialog/index.js +32 -43
- package/lib/RowExpandEditor/add-btn/index.js +6 -7
- package/lib/RowExpandEditor/checkbox-editor/index.js +6 -7
- package/lib/RowExpandEditor/collaborator-editor/index.js +6 -7
- package/lib/RowExpandEditor/date-editor/index.js +6 -7
- package/lib/RowExpandEditor/department-editor/index.js +6 -7
- package/lib/RowExpandEditor/digital-sign-editor/index.js +6 -7
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +4 -4
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +4 -4
- package/lib/RowExpandEditor/duration-editor/index.js +6 -7
- package/lib/RowExpandEditor/email-editor/index.js +6 -7
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +1 -1
- package/lib/RowExpandEditor/file-editor/index.js +6 -7
- package/lib/RowExpandEditor/geolocation-editor/index.js +6 -7
- package/lib/RowExpandEditor/image-editor/index.js +6 -7
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +1 -1
- package/lib/RowExpandEditor/index.js +10 -11
- package/lib/RowExpandEditor/long-text-editor/index.js +6 -7
- package/lib/RowExpandEditor/multiple-select-editor/index.js +6 -7
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +1 -1
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +5 -5
- package/lib/RowExpandEditor/number-editor/index.js +6 -7
- package/lib/RowExpandEditor/rate-editor/index.js +6 -7
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +1 -1
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +5 -5
- package/lib/RowExpandEditor/single-select-editor/index.js +6 -7
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +4 -4
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +3 -3
- package/lib/RowExpandEditor/text-editor/index.js +6 -7
- package/lib/RowExpandEditor/url-editor/index.js +6 -7
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +2 -2
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +2 -2
- package/lib/RowExpandFormatter/department-formatter/index.js +3 -6
- package/lib/RowExpandFormatter/email-formatter/index.js +1 -1
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +2 -2
- package/lib/RowExpandFormatter/formula-formatter/index.js +11 -17
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +2 -2
- package/lib/RowExpandFormatter/index.js +7 -11
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +1 -1
- package/lib/RowExpandFormatter/link-formatter/index.js +6 -6
- package/lib/RowExpandFormatter/rate-formatter/index.js +2 -2
- package/lib/RowExpandFormatter/url-formatter/index.js +2 -2
- package/lib/RowExpandView/body/index.js +15 -13
- package/lib/RowExpandView/index.js +28 -39
- package/lib/SelectOptionGroup/index.js +1 -1
- package/lib/SelectedDepartments/index.js +3 -3
- package/lib/SimpleLongTextFormatter/index.js +2 -2
- package/lib/SingleSelectEditor/index.js +8 -6
- package/lib/TabBar/Tab.js +10 -10
- package/lib/TabBar/index.js +6 -7
- package/lib/Tabs/index.js +9 -10
- package/lib/TextareaItem/index.js +45 -43
- package/lib/Toast/index.js +5 -5
- package/lib/formatterConfig/index.js +3 -3
- package/lib/select-editor/index.js +14 -15
- package/lib/select-editor/pc-editor/index.js +5 -5
- package/lib/toaster/alert.js +1 -1
- package/lib/toaster/toast.js +1 -1
- package/lib/toaster/toastManager.js +15 -12
- package/lib/toaster/toaster.js +9 -12
- package/lib/utils/class.js +3 -3
- package/lib/utils/departments.js +4 -3
- package/lib/utils/getLocale.js +5 -11
- package/lib/utils/object-utils.js +5 -5
- package/lib/utils/url.js +4 -4
- package/package.json +3 -4
|
@@ -5,6 +5,7 @@ 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"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _reactstrap = require("reactstrap");
|
|
10
11
|
var _filesPreviewer = _interopRequireDefault(require("../files-previewer"));
|
|
@@ -206,11 +207,10 @@ class PCFileEditor extends _react.default.Component {
|
|
|
206
207
|
name,
|
|
207
208
|
url
|
|
208
209
|
} = res.data;
|
|
209
|
-
fileItem = {
|
|
210
|
-
...fileItem,
|
|
210
|
+
fileItem = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, fileItem), {}, {
|
|
211
211
|
name,
|
|
212
212
|
url
|
|
213
|
-
};
|
|
213
|
+
});
|
|
214
214
|
newValue[index] = fileItem;
|
|
215
215
|
this.setState({
|
|
216
216
|
value: newValue
|
|
@@ -66,6 +66,7 @@ const FileFormatter = _ref => {
|
|
|
66
66
|
if (!onOpenFile) window.open(previewerUrl, '_blank');
|
|
67
67
|
onOpenFile(previewerUrl);
|
|
68
68
|
}
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
70
|
}, [fileImageUrlList, isSupportOpenFile, showLargeImage]);
|
|
70
71
|
const moveNext = (0, _react.useCallback)(() => {
|
|
71
72
|
setLargeImageIndex(prevIndex => (prevIndex + 1) % fileImageUrlList.length);
|
|
@@ -88,7 +89,7 @@ const FileFormatter = _ref => {
|
|
|
88
89
|
file: item
|
|
89
90
|
}), value.length !== 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
90
91
|
className: "file-item-count",
|
|
91
|
-
children:
|
|
92
|
+
children: "+".concat(value.length)
|
|
92
93
|
})]
|
|
93
94
|
});
|
|
94
95
|
}
|
|
@@ -20,7 +20,7 @@ const FileItemFormatter = _ref => {
|
|
|
20
20
|
} = (0, _url.getFileThumbnailInfo)(file, config);
|
|
21
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
22
22
|
onClick: () => openFile && openFile(file),
|
|
23
|
-
className:
|
|
23
|
+
className: "file-item-icon ".concat(isImage ? 'img' : ''),
|
|
24
24
|
src: fileIconUrl,
|
|
25
25
|
alt: (file === null || file === void 0 ? void 0 : file.name) || ''
|
|
26
26
|
});
|
|
@@ -137,7 +137,7 @@ class FileUploader extends _react.default.Component {
|
|
|
137
137
|
for (let i = 0; i < allFileLen; i++) {
|
|
138
138
|
let uploadFile = files[i];
|
|
139
139
|
if (isPasteUpload && uploadFile.name === 'image.png') {
|
|
140
|
-
let newName =
|
|
140
|
+
let newName = "image-".concat((0, _dayjs.default)().format('YYYY-MM-DD-HH-mm'), ".png");
|
|
141
141
|
uploadFile = new File([uploadFile], newName, {
|
|
142
142
|
type: uploadFile.type
|
|
143
143
|
});
|
|
@@ -5,6 +5,7 @@ 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"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _dtableUtils = require("dtable-utils");
|
|
10
11
|
var _baseFormatterConfig = _interopRequireDefault(require("../formatterConfig/base-formatter-config"));
|
|
@@ -36,7 +37,7 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
36
37
|
} = this.props;
|
|
37
38
|
const gridCellClassName = this.getGridCellClassName(resultType);
|
|
38
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
39
|
-
className:
|
|
40
|
+
className: "dtable-ui cell-formatter-container formula-formatter ".concat(containerClassName, " ").concat(gridCellClassName),
|
|
40
41
|
title: cellValue,
|
|
41
42
|
"aria-label": cellValue,
|
|
42
43
|
children: cellValue
|
|
@@ -72,7 +73,7 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
72
73
|
if (!Array.isArray(value)) {
|
|
73
74
|
cellValue = (0, _cellValueValidator.default)(value, array_type) ? [value] : [];
|
|
74
75
|
}
|
|
75
|
-
const contentItemClassName =
|
|
76
|
+
const contentItemClassName = "formula-formatter-content-item ".concat(_isSimpleCellFormatterColumn ? 'simple-cell-formatter' : '');
|
|
76
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
77
78
|
className: "dtable-ui formula-formatter multiple",
|
|
78
79
|
children: cellValue.map((v, index) => {
|
|
@@ -80,7 +81,7 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
80
81
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
81
82
|
className: contentItemClassName,
|
|
82
83
|
children: this.createColumnFormatter(Formatter, formatterProps)
|
|
83
|
-
},
|
|
84
|
+
}, "formula-formatter-content-item-".concat(index));
|
|
84
85
|
})
|
|
85
86
|
});
|
|
86
87
|
};
|
|
@@ -105,27 +106,20 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
105
106
|
}
|
|
106
107
|
default:
|
|
107
108
|
{
|
|
108
|
-
return {
|
|
109
|
-
...array_data,
|
|
109
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, array_data), {}, {
|
|
110
110
|
collaborators
|
|
111
|
-
};
|
|
111
|
+
});
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
createColumnFormatter(Formatter, formatterProps) {
|
|
117
117
|
if (/*#__PURE__*/_react.default.isValidElement(Formatter)) {
|
|
118
|
-
return /*#__PURE__*/_react.default.cloneElement(Formatter, {
|
|
119
|
-
...formatterProps
|
|
120
|
-
});
|
|
118
|
+
return /*#__PURE__*/_react.default.cloneElement(Formatter, (0, _objectSpread2.default)({}, formatterProps));
|
|
121
119
|
} else if ((0, _utils2.isFunction)(Formatter)) {
|
|
122
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Formatter, {
|
|
123
|
-
...formatterProps
|
|
124
|
-
});
|
|
120
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Formatter, (0, _objectSpread2.default)({}, formatterProps));
|
|
125
121
|
}
|
|
126
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextFormatter.default, {
|
|
127
|
-
...formatterProps
|
|
128
|
-
});
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextFormatter.default, (0, _objectSpread2.default)({}, formatterProps));
|
|
129
123
|
}
|
|
130
124
|
render() {
|
|
131
125
|
const {
|
|
@@ -6,23 +6,23 @@ 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"));
|
|
9
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
12
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
11
13
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
12
14
|
var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
13
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
const _excluded = ["isMobile", "config"];
|
|
14
17
|
const GeolocationEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
15
18
|
let {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
isMobile,
|
|
20
|
+
config: propsConfig
|
|
21
|
+
} = _ref,
|
|
22
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
20
23
|
const config = (0, _react.useMemo)(() => {
|
|
21
24
|
var _window;
|
|
22
|
-
return {
|
|
23
|
-
...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
|
|
24
|
-
...propsConfig
|
|
25
|
-
};
|
|
25
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (_window = window) === null || _window === void 0 ? void 0 : _window.dtable), propsConfig);
|
|
26
26
|
}, [propsConfig]);
|
|
27
27
|
const getLocationData = (0, _react.useCallback)(() => {
|
|
28
28
|
var _window2, _window2$app;
|
|
@@ -33,7 +33,7 @@ const GeolocationEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
33
33
|
server = '',
|
|
34
34
|
mediaUrl = ''
|
|
35
35
|
} = config || {};
|
|
36
|
-
return fetch(
|
|
36
|
+
return fetch("".concat(server).concat(mediaUrl, "geo-data/cn-location.json").replaceAll('//', '/')).then(res => {
|
|
37
37
|
// get locations from server
|
|
38
38
|
return res.json();
|
|
39
39
|
}).catch(() => {
|
|
@@ -55,11 +55,11 @@ const GeolocationEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
55
55
|
server = ''
|
|
56
56
|
} = config;
|
|
57
57
|
const geoFileName = lang === 'cn' ? 'cn-region-location' : 'en-region-location';
|
|
58
|
-
return fetch(
|
|
58
|
+
return fetch("".concat(server).concat(mediaUrl, "geo-data/").concat(geoFileName, ".json").replaceAll('//', '/')).then(res => {
|
|
59
59
|
return res.json();
|
|
60
60
|
}).catch(() => {
|
|
61
61
|
// get locations from local
|
|
62
|
-
return fetch(
|
|
62
|
+
return fetch("./geo-data/".concat(geoFileName, ".json")).then(res => {
|
|
63
63
|
return res.json();
|
|
64
64
|
});
|
|
65
65
|
}).then(res => {
|
|
@@ -72,39 +72,35 @@ const GeolocationEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
72
72
|
return data;
|
|
73
73
|
});
|
|
74
74
|
}, [config]);
|
|
75
|
-
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
76
|
-
...props,
|
|
75
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
77
76
|
config: config,
|
|
78
77
|
getLocationData: getLocationData,
|
|
79
78
|
getCountryData: getCountryData,
|
|
80
79
|
ref: ref
|
|
81
|
-
});
|
|
82
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
83
|
-
...props,
|
|
80
|
+
}));
|
|
81
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
84
82
|
config: config,
|
|
85
83
|
getLocationData: getLocationData,
|
|
86
84
|
getCountryData: getCountryData,
|
|
87
85
|
ref: ref
|
|
88
|
-
});
|
|
86
|
+
}));
|
|
89
87
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
90
88
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
91
89
|
query: "(min-width: 768px)",
|
|
92
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
93
|
-
...props,
|
|
90
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
94
91
|
config: config,
|
|
95
92
|
getLocationData: getLocationData,
|
|
96
93
|
getCountryData: getCountryData,
|
|
97
94
|
ref: ref
|
|
98
|
-
})
|
|
95
|
+
}))
|
|
99
96
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
100
97
|
query: "(max-width: 768px)",
|
|
101
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
102
|
-
...props,
|
|
98
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
103
99
|
config: config,
|
|
104
100
|
getLocationData: getLocationData,
|
|
105
101
|
getCountryData: getCountryData,
|
|
106
102
|
ref: ref
|
|
107
|
-
})
|
|
103
|
+
}))
|
|
108
104
|
})]
|
|
109
105
|
});
|
|
110
106
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.locateCurrentPosition = exports.loadMapSource = exports.getMineMapUrl = exports.getMapInfo = exports.getInitCenter = exports.MAP_TYPES = exports.INPUT_MODE_MAP = exports.DOMESTIC_MAP_TYPE = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
7
9
|
const INPUT_MODE_MAP = exports.INPUT_MODE_MAP = {
|
|
8
10
|
ANY_LOCATION: 'any_location',
|
|
9
11
|
ONLY_MOBILE_POSITIONING: 'only_mobile_positioning'
|
|
@@ -30,10 +32,7 @@ const getMineMapUrl = function () {
|
|
|
30
32
|
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
33
|
const {
|
|
32
34
|
dtableMineMapCustomConfig = {}
|
|
33
|
-
} = {
|
|
34
|
-
...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
|
|
35
|
-
...config
|
|
36
|
-
};
|
|
35
|
+
} = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (_window = window) === null || _window === void 0 ? void 0 : _window.dtable), config);
|
|
37
36
|
const {
|
|
38
37
|
domain_url = '',
|
|
39
38
|
data_domain_url = '',
|
|
@@ -77,10 +76,7 @@ const getMapInfo = function () {
|
|
|
77
76
|
dtableBaiduMapKey: baiduMapKey,
|
|
78
77
|
dtableGoogleMapKey: googleMapKey,
|
|
79
78
|
dtableMineMapKey: mineMapKey
|
|
80
|
-
} = {
|
|
81
|
-
...((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.dtable),
|
|
82
|
-
...config
|
|
83
|
-
};
|
|
79
|
+
} = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.dtable), config);
|
|
84
80
|
let mapType;
|
|
85
81
|
let mapKey;
|
|
86
82
|
if (baiduMapKey) {
|
|
@@ -105,9 +101,9 @@ const loadMapSource = (mapType, mapKey, callback) => {
|
|
|
105
101
|
let script = document.createElement('script');
|
|
106
102
|
script.type = 'text/javascript';
|
|
107
103
|
if (mapType === MAP_TYPES.B_MAP) {
|
|
108
|
-
scriptUrl =
|
|
104
|
+
scriptUrl = "https://api.map.baidu.com/api?v=3.0&ak=".concat(mapKey, "&callback=renderBaiduMap");
|
|
109
105
|
} else if (mapType === MAP_TYPES.G_MAP) {
|
|
110
|
-
scriptUrl =
|
|
106
|
+
scriptUrl = "https://maps.googleapis.com/maps/api/js?key=".concat(mapKey, "&callback=renderGoogleMap&libraries=&v=weekly");
|
|
111
107
|
} else {
|
|
112
108
|
scriptUrl = 'https://minemap.minedata.cn/minemapapi/v2.1.1/minemap.js';
|
|
113
109
|
let link = document.createElement('link');
|
|
@@ -6,6 +6,8 @@ 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"));
|
|
9
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
12
|
var _dtableUtils = require("dtable-utils");
|
|
11
13
|
var _countryEditor = _interopRequireDefault(require("./country-editor"));
|
|
@@ -16,6 +18,7 @@ var _mapEditor = _interopRequireDefault(require("./map-editor"));
|
|
|
16
18
|
var _mapSelectionEditor = _interopRequireDefault(require("./map-selection-editor"));
|
|
17
19
|
require("./index.css");
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
const _excluded = ["column", "config", "getLocationData", "getCountryData"];
|
|
19
22
|
const transLocationData = data => {
|
|
20
23
|
if (Object.prototype.toString.call(data) === '[object Object]') {
|
|
21
24
|
const name = data.name;
|
|
@@ -32,6 +35,7 @@ const transLocationData = data => {
|
|
|
32
35
|
};
|
|
33
36
|
const transCountryData = data => {
|
|
34
37
|
let _data = [];
|
|
38
|
+
// eslint-disable-next-line
|
|
35
39
|
for (let key in data) {
|
|
36
40
|
let obj = {};
|
|
37
41
|
let children = [];
|
|
@@ -52,12 +56,12 @@ const transCountryData = data => {
|
|
|
52
56
|
};
|
|
53
57
|
const MBGeolocationEditor = _ref => {
|
|
54
58
|
let {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
column,
|
|
60
|
+
config,
|
|
61
|
+
getLocationData,
|
|
62
|
+
getCountryData
|
|
63
|
+
} = _ref,
|
|
64
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
61
65
|
const format = (0, _react.useMemo)(() => {
|
|
62
66
|
let data = column.data || {};
|
|
63
67
|
return data.geo_format ? data.geo_format : _dtableUtils.DEFAULT_GEOLOCATION_FORMAT;
|
|
@@ -73,60 +77,53 @@ const MBGeolocationEditor = _ref => {
|
|
|
73
77
|
switch (format) {
|
|
74
78
|
case _dtableUtils.GEOLOCATION_FORMAT.LNG_LAT:
|
|
75
79
|
{
|
|
76
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mapEditor.default, {
|
|
77
|
-
...props,
|
|
80
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mapEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
78
81
|
config: config,
|
|
79
82
|
column: column
|
|
80
|
-
});
|
|
83
|
+
}));
|
|
81
84
|
}
|
|
82
85
|
case _dtableUtils.GEOLOCATION_FORMAT.MAP_SELECTION:
|
|
83
86
|
{
|
|
84
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mapSelectionEditor.default, {
|
|
85
|
-
...props,
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mapSelectionEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
86
88
|
config: config,
|
|
87
89
|
column: column
|
|
88
|
-
});
|
|
90
|
+
}));
|
|
89
91
|
}
|
|
90
92
|
case _dtableUtils.GEOLOCATION_FORMAT.COUNTRY_REGION:
|
|
91
93
|
{
|
|
92
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_countryEditor.default, {
|
|
93
|
-
...props,
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_countryEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
94
95
|
getData: _getCountryData,
|
|
95
96
|
column: column
|
|
96
|
-
});
|
|
97
|
+
}));
|
|
97
98
|
}
|
|
98
99
|
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE:
|
|
99
100
|
{
|
|
100
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_provinceEditor.default, {
|
|
101
|
-
...props,
|
|
101
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_provinceEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
102
102
|
getData: getData,
|
|
103
103
|
column: column
|
|
104
|
-
});
|
|
104
|
+
}));
|
|
105
105
|
}
|
|
106
106
|
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY:
|
|
107
107
|
{
|
|
108
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_provinceCityEditor.default, {
|
|
109
|
-
...props,
|
|
108
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_provinceCityEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
110
109
|
getData: getData,
|
|
111
110
|
column: column
|
|
112
|
-
});
|
|
111
|
+
}));
|
|
113
112
|
}
|
|
114
113
|
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY_DISTRICT:
|
|
115
114
|
{
|
|
116
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_locationEditor.default, {
|
|
117
|
-
...props,
|
|
115
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_locationEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
118
116
|
getData: getData,
|
|
119
117
|
column: column
|
|
120
|
-
});
|
|
118
|
+
}));
|
|
121
119
|
}
|
|
122
120
|
default:
|
|
123
121
|
{
|
|
124
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_locationEditor.default, {
|
|
125
|
-
...props,
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_locationEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
126
123
|
isShowDetails: true,
|
|
127
124
|
getData: getData,
|
|
128
125
|
column: column
|
|
129
|
-
});
|
|
126
|
+
}));
|
|
130
127
|
}
|
|
131
128
|
}
|
|
132
129
|
};
|
|
@@ -5,6 +5,7 @@ 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"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _dtableUtils = require("dtable-utils");
|
|
10
11
|
var _InputItem = _interopRequireDefault(require("../../../InputItem"));
|
|
@@ -119,9 +120,7 @@ class MapEditor extends _react.default.Component {
|
|
|
119
120
|
};
|
|
120
121
|
this.geolocationCallback = (error, point) => {
|
|
121
122
|
if (!error) {
|
|
122
|
-
this.setValue({
|
|
123
|
-
...point
|
|
124
|
-
});
|
|
123
|
+
this.setValue((0, _objectSpread2.default)({}, point));
|
|
125
124
|
this.addMarkerByPosition(point.lng, point.lat);
|
|
126
125
|
if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP) {
|
|
127
126
|
this.map.setCenter({
|
|
@@ -302,10 +301,9 @@ class MapEditor extends _react.default.Component {
|
|
|
302
301
|
});
|
|
303
302
|
};
|
|
304
303
|
this.handleLatitudeChange = value => {
|
|
305
|
-
const newValue = {
|
|
306
|
-
...this.state.value,
|
|
304
|
+
const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.value), {}, {
|
|
307
305
|
lat: value
|
|
308
|
-
};
|
|
306
|
+
});
|
|
309
307
|
this.setState({
|
|
310
308
|
value: newValue
|
|
311
309
|
}, () => {
|
|
@@ -314,10 +312,9 @@ class MapEditor extends _react.default.Component {
|
|
|
314
312
|
});
|
|
315
313
|
};
|
|
316
314
|
this.handleLongitudeChange = value => {
|
|
317
|
-
const newValue = {
|
|
318
|
-
...this.state.value,
|
|
315
|
+
const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.value), {}, {
|
|
319
316
|
lng: value
|
|
320
|
-
};
|
|
317
|
+
});
|
|
321
318
|
this.setState({
|
|
322
319
|
value: newValue
|
|
323
320
|
}, () => {
|
|
@@ -159,14 +159,14 @@ class CountryEditor extends _react.Component {
|
|
|
159
159
|
let countryList = this.filteredCountry[continent].map((country, index) => {
|
|
160
160
|
const isHighlight = highlightIndexes[0] === continentIndex && highlightIndexes[1] === index;
|
|
161
161
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
162
|
-
className:
|
|
162
|
+
className: "geolocation-region-editor-country ".concat(isHighlight ? 'geolocation-region-editor-province-highlight' : ''),
|
|
163
163
|
onMouseEnter: () => this.onMenuMouseEnter(continentIndex, index),
|
|
164
164
|
onMouseLeave: () => this.onMenuMouseLeave(continentIndex, index),
|
|
165
165
|
title: country,
|
|
166
166
|
"aria-label": country,
|
|
167
167
|
onClick: () => this.onClick(country),
|
|
168
168
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
169
|
-
className:
|
|
169
|
+
className: "icon ".concat(value === country ? 'dtable-font dtable-icon-check-mark' : '')
|
|
170
170
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
171
171
|
className: "country-name",
|
|
172
172
|
children: country
|
|
@@ -5,6 +5,7 @@ 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"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _dtableUtils = require("dtable-utils");
|
|
10
11
|
var _constants = require("../../constants");
|
|
@@ -172,61 +173,54 @@ class PCGeolocationEditor extends _react.default.Component {
|
|
|
172
173
|
switch (geoFormat) {
|
|
173
174
|
case _dtableUtils.GEOLOCATION_FORMAT.LNG_LAT:
|
|
174
175
|
{
|
|
175
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mapEditor.default, {
|
|
176
|
-
...props,
|
|
176
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mapEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
177
177
|
toggleLargeMap: toggleLargeMap,
|
|
178
178
|
ref: ref => this.editor = ref
|
|
179
|
-
});
|
|
179
|
+
}));
|
|
180
180
|
}
|
|
181
181
|
case _dtableUtils.GEOLOCATION_FORMAT.MAP_SELECTION:
|
|
182
182
|
{
|
|
183
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mapSelectionEditor.default, {
|
|
184
|
-
...props,
|
|
183
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mapSelectionEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
185
184
|
toggleLargeMap: toggleLargeMap,
|
|
186
185
|
ref: ref => this.editor = ref
|
|
187
|
-
});
|
|
186
|
+
}));
|
|
188
187
|
}
|
|
189
188
|
case _dtableUtils.GEOLOCATION_FORMAT.COUNTRY_REGION:
|
|
190
189
|
{
|
|
191
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_countryEditor.default, {
|
|
192
|
-
...props,
|
|
190
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_countryEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
193
191
|
getData: getCountryData,
|
|
194
192
|
ref: ref => this.editor = ref
|
|
195
|
-
});
|
|
193
|
+
}));
|
|
196
194
|
}
|
|
197
195
|
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE:
|
|
198
196
|
{
|
|
199
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_provinceEditor.default, {
|
|
200
|
-
...props,
|
|
197
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_provinceEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
201
198
|
onPressTab: this.props.onPressTab,
|
|
202
199
|
getData: getLocationData,
|
|
203
200
|
ref: ref => this.editor = ref
|
|
204
|
-
});
|
|
201
|
+
}));
|
|
205
202
|
}
|
|
206
203
|
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY:
|
|
207
204
|
{
|
|
208
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_provinceCityEditor.default, {
|
|
209
|
-
...props,
|
|
205
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_provinceCityEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
210
206
|
getData: getLocationData,
|
|
211
207
|
ref: ref => this.editor = ref
|
|
212
|
-
});
|
|
208
|
+
}));
|
|
213
209
|
}
|
|
214
210
|
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY_DISTRICT:
|
|
215
211
|
{
|
|
216
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_locationEditor.default, {
|
|
217
|
-
...props,
|
|
212
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_locationEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
218
213
|
getData: getLocationData,
|
|
219
214
|
ref: ref => this.editor = ref
|
|
220
|
-
});
|
|
215
|
+
}));
|
|
221
216
|
}
|
|
222
217
|
default:
|
|
223
218
|
{
|
|
224
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_locationEditor.default, {
|
|
225
|
-
...props,
|
|
219
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_locationEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
226
220
|
isShowDetails: true,
|
|
227
221
|
getData: getLocationData,
|
|
228
222
|
ref: ref => this.editor = ref
|
|
229
|
-
});
|
|
223
|
+
}));
|
|
230
224
|
}
|
|
231
225
|
}
|
|
232
226
|
};
|
|
@@ -191,7 +191,7 @@ class LocationEditor extends _react.Component {
|
|
|
191
191
|
this.locations = {};
|
|
192
192
|
this.state = {
|
|
193
193
|
isShowSelector: false,
|
|
194
|
-
location:
|
|
194
|
+
location: "".concat(this.value.province || '').concat(this.value.city || '').concat(this.value.district || ''),
|
|
195
195
|
selectedProvince: null,
|
|
196
196
|
selectedCity: null,
|
|
197
197
|
selectedCounty: null,
|
|
@@ -243,7 +243,7 @@ class LocationEditor extends _react.Component {
|
|
|
243
243
|
className: "dtable-ui-geolocation-editor-item-right",
|
|
244
244
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
245
245
|
onClick: this.onToggleSelector,
|
|
246
|
-
className:
|
|
246
|
+
className: "dtable-ui-geolocation-editor-selector text-truncate ".concat(isShowSelector ? 'focus' : ''),
|
|
247
247
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
248
248
|
className: "selected-option-show",
|
|
249
249
|
children: location ? location : (0, _lang.getLocale)('Select_province_city_district')
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _dtableUtils = require("dtable-utils");
|
|
11
12
|
var _toaster = _interopRequireDefault(require("../../../toaster"));
|
|
@@ -139,9 +140,7 @@ class MapEditor extends _react.Component {
|
|
|
139
140
|
};
|
|
140
141
|
this.geolocationCallback = (error, point) => {
|
|
141
142
|
if (!error) {
|
|
142
|
-
this.setValue({
|
|
143
|
-
...point
|
|
144
|
-
});
|
|
143
|
+
this.setValue((0, _objectSpread2.default)({}, point));
|
|
145
144
|
this.addMarkerByPosition(point.lng, point.lat);
|
|
146
145
|
if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP) {
|
|
147
146
|
this.map.setCenter({
|
|
@@ -325,10 +324,9 @@ class MapEditor extends _react.Component {
|
|
|
325
324
|
});
|
|
326
325
|
};
|
|
327
326
|
this.onChangeLatitude = event => {
|
|
328
|
-
const newValue = {
|
|
329
|
-
...this.state.value,
|
|
327
|
+
const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.value), {}, {
|
|
330
328
|
lat: event.target.value
|
|
331
|
-
};
|
|
329
|
+
});
|
|
332
330
|
this.setState({
|
|
333
331
|
value: newValue
|
|
334
332
|
}, () => {
|
|
@@ -337,10 +335,9 @@ class MapEditor extends _react.Component {
|
|
|
337
335
|
});
|
|
338
336
|
};
|
|
339
337
|
this.onChangeLongitude = event => {
|
|
340
|
-
const newValue = {
|
|
341
|
-
...this.state.value,
|
|
338
|
+
const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.value), {}, {
|
|
342
339
|
lng: event.target.value
|
|
343
|
-
};
|
|
340
|
+
});
|
|
344
341
|
this.setState({
|
|
345
342
|
value: newValue
|
|
346
343
|
}, () => {
|
|
@@ -515,12 +512,11 @@ class MapEditor extends _react.Component {
|
|
|
515
512
|
})]
|
|
516
513
|
});
|
|
517
514
|
}
|
|
518
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_largeEditor.default, {
|
|
519
|
-
...this.props,
|
|
515
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_largeEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.props), {}, {
|
|
520
516
|
value: this.state.value,
|
|
521
517
|
setValue: this.setValue,
|
|
522
518
|
toggleFullScreen: this.toggleFullScreen
|
|
523
|
-
});
|
|
519
|
+
}));
|
|
524
520
|
}
|
|
525
521
|
}
|
|
526
522
|
var _default = exports.default = MapEditor;
|