dtable-ui-component 6.0.30 → 6.0.32-beta
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/BodyPortal/index.js +29 -0
- package/lib/CheckboxEditor/index.js +24 -116
- package/lib/CheckboxEditor/mb-editor.js +99 -0
- package/lib/CheckboxEditor/pc-editor.js +118 -0
- package/lib/CollaboratorEditor/index.js +23 -11
- package/lib/CollaboratorEditor/mb-editor/index.css +41 -0
- package/lib/CollaboratorEditor/mb-editor/index.js +88 -0
- package/lib/DTableCommonAddTool/index.js +1 -3
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +6 -6
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +6 -6
- package/lib/DateEditor/index.js +69 -95
- package/lib/DateEditor/mb-editor/custom-rc-calendar.css +118 -0
- package/lib/DateEditor/mb-editor/index.css +39 -0
- package/lib/DateEditor/mb-editor/index.js +215 -0
- package/lib/DateEditor/{pc-date-editor-popover.js → pc-editor.js} +9 -9
- package/lib/{Department-editor/department-multiple-select → DepartmentMultipleSelectEditor}/index.js +6 -6
- package/lib/DepartmentSingleSelectEditor/index.js +34 -0
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.css +4 -0
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +227 -0
- package/lib/{Department-editor → DepartmentSingleSelectEditor/pc-editor}/department-single-select.js +7 -7
- package/lib/{Department-editor → DepartmentSingleSelectEditor/pc-editor}/index.css +10 -3
- package/lib/{Department-editor → DepartmentSingleSelectEditor/pc-editor}/index.js +8 -25
- package/lib/DigitalSignEditor/index.js +24 -171
- package/lib/DigitalSignEditor/mb-editor/index.css +35 -0
- package/lib/DigitalSignEditor/mb-editor/index.js +144 -0
- package/lib/DigitalSignEditor/pc-editor/index.js +181 -0
- package/lib/FileEditor/files-previewer/index.js +26 -268
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +122 -0
- package/lib/FileEditor/files-previewer/mb-previewer/index.css +39 -0
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +64 -0
- package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/dropdown-menu.js +1 -1
- package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/file-name-editor/index.js +1 -1
- package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/index.css +0 -2
- package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/index.js +2 -2
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +276 -0
- package/lib/FileEditor/index.css +0 -5
- package/lib/FileEditor/index.js +26 -265
- package/lib/FileEditor/mb-editor/index.css +10 -0
- package/lib/FileEditor/mb-editor/index.js +136 -0
- package/lib/FileEditor/pc-editor/addition-previewer/index.css +1 -0
- package/lib/FileEditor/{addition-previewer → pc-editor/addition-previewer}/index.js +1 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.css +1 -0
- package/lib/FileEditor/{addition-previewer → pc-editor/addition-previewer}/local-file-addition/index.js +4 -4
- package/lib/FileEditor/pc-editor/index.css +5 -0
- package/lib/FileEditor/pc-editor/index.js +274 -0
- package/lib/FormulaFormatter/index.css +5 -5
- package/lib/GeolocationEditor/index.js +92 -230
- package/lib/GeolocationEditor/map-editor-utils.js +10 -4
- package/lib/GeolocationEditor/mb-editor/country-editor.js +79 -0
- package/lib/GeolocationEditor/mb-editor/index.css +11 -0
- package/lib/GeolocationEditor/mb-editor/index.js +125 -0
- package/lib/GeolocationEditor/mb-editor/location-editor.js +101 -0
- package/lib/GeolocationEditor/mb-editor/map-editor/index.css +11 -0
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +474 -0
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.css +158 -0
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +530 -0
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +77 -0
- package/lib/GeolocationEditor/mb-editor/province-editor.js +76 -0
- package/lib/GeolocationEditor/{country-editor.js → pc-editor/country-editor.js} +5 -49
- package/lib/GeolocationEditor/{index.css → pc-editor/index.css} +3 -4
- package/lib/GeolocationEditor/pc-editor/index.js +247 -0
- package/lib/GeolocationEditor/{location-editor.js → pc-editor/location-editor.js} +8 -41
- package/lib/GeolocationEditor/{map-editor → pc-editor/map-editor}/index.js +6 -6
- package/lib/GeolocationEditor/{map-editor → pc-editor/map-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/{map-selection-editor → pc-editor/map-selection-editor}/index.js +7 -7
- package/lib/GeolocationEditor/{map-selection-editor → pc-editor/map-selection-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/{province-city-editor.js → pc-editor/province-city-editor.js} +7 -38
- package/lib/GeolocationEditor/{province-editor.js → pc-editor/province-editor.js} +7 -31
- package/lib/GeolocationEditor/{selector-header-item.js → pc-editor/selector-header-item.js} +1 -1
- package/lib/ImageEditor/images-previewer/image-preview/index.js +3 -3
- package/lib/ImageEditor/images-previewer/index.js +9 -4
- package/lib/ImageEditor/index.css +17 -16
- package/lib/ImageEditor/index.js +26 -185
- package/lib/ImageEditor/mb-editor/index.css +29 -0
- package/lib/ImageEditor/mb-editor/index.js +136 -0
- package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/image-link/index.js +1 -1
- package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/index.js +1 -1
- package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/local-image-addition/index.js +4 -4
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +140 -0
- package/lib/ImageEditor/pc-editor/index.css +24 -0
- package/lib/ImageEditor/pc-editor/index.js +194 -0
- package/lib/ImageThumbnail/index.js +2 -1
- package/lib/LinkEditor/index.js +5 -5
- package/lib/LinkEditor/{mb-link-editor-popover → mb-popover}/index.css +1 -1
- package/lib/MobileFullScreenPage/body/index.css +9 -0
- package/lib/MobileFullScreenPage/body/index.js +23 -0
- package/lib/MobileFullScreenPage/header/index.css +39 -0
- package/lib/MobileFullScreenPage/header/index.js +38 -0
- package/lib/MobileFullScreenPage/index.css +13 -0
- package/lib/MobileFullScreenPage/index.js +73 -0
- package/lib/MobileModal/index.js +41 -0
- package/lib/MobileOperationSheet/index.css +27 -0
- package/lib/MobileOperationSheet/index.js +92 -0
- package/lib/MobileSelector/empty/index.css +3 -0
- package/lib/MobileSelector/empty/index.js +23 -0
- package/lib/MobileSelector/index.css +32 -0
- package/lib/MobileSelector/index.js +57 -0
- package/lib/MobileSelector/option/index.css +28 -0
- package/lib/MobileSelector/option/index.js +36 -0
- package/lib/MobileSelector/options/index.css +8 -0
- package/lib/MobileSelector/options/index.js +18 -0
- package/lib/MobileSelector/search/index.css +7 -0
- package/lib/MobileSelector/search/index.js +26 -0
- package/lib/MobileUpload/index.css +1 -0
- package/lib/MobileUpload/index.js +160 -0
- package/lib/MultipleSelectEditor/index.js +9 -14
- package/lib/RowExpand/index.js +24 -0
- package/lib/RowExpandDialog/column-content/index.js +2 -2
- package/lib/RowExpandDialog/index.js +2 -0
- package/lib/RowExpandEditor/add-btn/index.js +24 -0
- package/lib/RowExpandEditor/add-btn/mb-add-btn/index.css +3 -0
- package/lib/RowExpandEditor/add-btn/mb-add-btn/index.js +19 -0
- package/lib/RowExpandEditor/{RowExpandAddBtn → add-btn/pc-add-btn}/index.js +6 -4
- package/lib/RowExpandEditor/checkbox-editor/index.js +25 -0
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.css +6 -0
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +36 -0
- package/lib/RowExpandEditor/{RowExpandCheckboxEditor/index.js → checkbox-editor/pc-editor.js} +9 -13
- package/lib/RowExpandEditor/collaborator-editor/index.js +24 -0
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.css +9 -0
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +163 -0
- package/lib/RowExpandEditor/{RowExpandCollaboratorEditor → collaborator-editor/pc-editor}/index.css +1 -1
- package/lib/RowExpandEditor/{RowExpandCollaboratorEditor → collaborator-editor/pc-editor}/index.js +6 -7
- package/lib/RowExpandEditor/constants.js +34 -34
- package/lib/RowExpandEditor/date-editor/index.js +24 -0
- package/lib/RowExpandEditor/date-editor/mb-editor.js +82 -0
- package/lib/RowExpandEditor/{RowExpandDateEditor/index.js → date-editor/pc-editor.js} +2 -2
- package/lib/RowExpandEditor/department-editor/index.js +24 -0
- package/lib/RowExpandEditor/department-editor/mb-editor.js +65 -0
- package/lib/RowExpandEditor/{RowExpandDepartmentEditor/index.js → department-editor/pc-editor.js} +44 -49
- package/lib/RowExpandEditor/digital-sign-editor/index.js +24 -0
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.css +1 -0
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +130 -0
- package/lib/RowExpandEditor/{RowExpandDigitalSignEditor → digital-sign-editor/pc-editor}/index.css +1 -1
- package/lib/RowExpandEditor/{RowExpandDigitalSignEditor → digital-sign-editor/pc-editor}/index.js +11 -11
- package/lib/RowExpandEditor/duration-editor/index.js +24 -0
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +71 -0
- package/lib/RowExpandEditor/{RowExpandDurationEditor/index.js → duration-editor/pc-editor.js} +2 -2
- package/lib/RowExpandEditor/email-editor/index.js +24 -0
- package/lib/RowExpandEditor/email-editor/mb-editor/index.css +1 -0
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +84 -0
- package/lib/RowExpandEditor/email-editor/pc-editor/index.css +1 -0
- package/lib/RowExpandEditor/{RowExpandEmailEditor → email-editor/pc-editor}/index.js +3 -3
- package/lib/RowExpandEditor/file-editor/index.js +24 -0
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +114 -0
- package/lib/RowExpandEditor/file-editor/pc-editor/index.css +1 -0
- package/lib/RowExpandEditor/{RowExpandFileEditor → file-editor/pc-editor}/index.js +9 -9
- package/lib/RowExpandEditor/geolocation-editor/index.js +24 -0
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +100 -0
- package/lib/RowExpandEditor/{RowExpandGeolocationEditor → geolocation-editor/pc-editor}/index.js +17 -13
- package/lib/RowExpandEditor/image-editor/index.js +24 -0
- package/lib/RowExpandEditor/image-editor/mb-editor/index.css +30 -0
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +109 -0
- package/lib/RowExpandEditor/{RowExpandImageEditor → image-editor/pc-editor}/index.js +9 -9
- package/lib/RowExpandEditor/long-text-editor/index.js +24 -0
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.css +10 -0
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +74 -0
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.css +3 -0
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +91 -0
- package/lib/RowExpandEditor/{RowExpandLongTextEditor → long-text-editor/pc-editor}/index.js +7 -7
- package/lib/RowExpandEditor/multiple-select-editor/index.js +24 -0
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +154 -0
- package/lib/RowExpandEditor/{RowExpandMultipleSelectEditor → multiple-select-editor/pc-editor}/index.css +1 -1
- package/lib/RowExpandEditor/{RowExpandMultipleSelectEditor → multiple-select-editor/pc-editor}/index.js +6 -6
- package/lib/RowExpandEditor/number-editor/index.js +24 -0
- package/lib/RowExpandEditor/number-editor/mb-editor/index.css +3 -0
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +76 -0
- package/lib/RowExpandEditor/{RowExpandNumberEditor/index.js → number-editor/pc-editor.js} +2 -2
- package/lib/RowExpandEditor/rate-editor/index.css +34 -0
- package/lib/RowExpandEditor/rate-editor/index.js +25 -0
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +92 -0
- package/lib/RowExpandEditor/{RowExpandRateEditor/index.js → rate-editor/pc-editor.js} +2 -3
- package/lib/RowExpandEditor/right-angle/index.css +6 -0
- package/lib/RowExpandEditor/right-angle/index.js +17 -0
- package/lib/RowExpandEditor/single-select-editor/index.js +24 -0
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.css +8 -0
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +134 -0
- package/lib/RowExpandEditor/{RowExpandSingleSelectorEditor → single-select-editor/pc-editor}/index.js +17 -17
- package/lib/RowExpandEditor/text-editor/index.js +24 -0
- package/lib/RowExpandEditor/text-editor/mb-editor/index.css +14 -0
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +37 -0
- package/lib/RowExpandEditor/{RowExpandTextEditor → text-editor/pc-editor}/index.js +7 -7
- package/lib/RowExpandEditor/url-editor/index.js +24 -0
- package/lib/RowExpandEditor/url-editor/mb-editor/index.css +17 -0
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +87 -0
- package/lib/RowExpandEditor/{RowExpandUrlEditor → url-editor/pc-editor}/index.js +6 -6
- package/lib/RowExpandFormatter/constants.js +17 -17
- package/lib/RowExpandFormatter/department-formatter/index.js +19 -0
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +20 -0
- package/lib/RowExpandFormatter/{RowExpandDepartmentFormatter/index.js → department-formatter/pc-formatter.js} +2 -2
- package/lib/RowExpandFormatter/{RowExpandEmailFormatter → email-formatter}/index.css +4 -4
- package/lib/RowExpandFormatter/index.css +33 -18
- package/lib/RowExpandFormatter/index.js +1 -1
- package/lib/RowExpandFormatter/rate-formatter/index.css +5 -0
- package/lib/RowExpandView/body/index.css +173 -0
- package/lib/RowExpandView/body/index.js +111 -0
- package/lib/RowExpandView/column-content/index.css +27 -0
- package/lib/RowExpandView/column-content/index.js +25 -0
- package/lib/RowExpandView/index.css +3 -0
- package/lib/RowExpandView/index.js +178 -0
- package/lib/SelectItem/index.js +57 -33
- package/lib/{Department-editor/selected-departments → SelectedDepartments}/index.css +0 -1
- package/lib/{Department-editor/selected-departments → SelectedDepartments}/index.js +3 -3
- package/lib/SingleSelectEditor/index.js +9 -14
- package/lib/SvgIcon/index.js +2 -1
- package/lib/constants/index.js +3 -2
- package/lib/css/mb-cell-editor.css +1 -1
- package/lib/index.js +62 -6
- package/lib/locales/de.json +4 -1
- package/lib/locales/en.json +4 -1
- package/lib/locales/es.json +4 -1
- package/lib/locales/fr.json +4 -1
- package/lib/locales/pt.json +4 -1
- package/lib/locales/ru.json +4 -1
- package/lib/locales/zh-CN.json +4 -1
- package/lib/select-editor/index.js +27 -20
- package/lib/select-editor/mb-editor/index.css +1 -0
- package/lib/select-editor/mb-editor/index.js +105 -0
- package/lib/select-editor/{pc-select-editor → pc-editor}/index.css +1 -1
- package/lib/select-editor/{pc-select-editor → pc-editor}/index.js +7 -7
- package/lib/utils/editor-utils.js +6 -2
- package/lib/utils/get-event-transfer.js +2 -1
- package/lib/utils/utils.js +11 -2
- package/package.json +5 -5
- package/lib/CollaboratorEditor/mb-collaborator-editor/index.css +0 -85
- package/lib/CollaboratorEditor/mb-collaborator-editor/index.js +0 -148
- package/lib/DateEditor/mb-date-editor-popover/custom-rc-calendar.css +0 -118
- package/lib/DateEditor/mb-date-editor-popover/index.css +0 -45
- package/lib/DateEditor/mb-date-editor-popover/index.js +0 -226
- package/lib/FileEditor/addition-previewer/index.css +0 -1
- package/lib/FileEditor/addition-previewer/local-file-addition/index.css +0 -1
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +0 -2
- package/lib/RowExpandEditor/RowExpandFileEditor/index.css +0 -1
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +0 -13
- package/lib/RowExpandFormatter/RowExpandRateFormatter/index.css +0 -5
- package/lib/select-editor/mb-select-editor/index.css +0 -127
- package/lib/select-editor/mb-select-editor/index.js +0 -197
- package/lib/select-editor/select-editor-option.js +0 -84
- /package/lib/CollaboratorEditor/{pc-collaborator-editor → pc-editor}/index.css +0 -0
- /package/lib/CollaboratorEditor/{pc-collaborator-editor → pc-editor}/index.js +0 -0
- /package/lib/{Department-editor/department-multiple-select → DepartmentMultipleSelectEditor}/index.css +0 -0
- /package/lib/DigitalSignEditor/{index.css → pc-editor/index.css} +0 -0
- /package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/file-name-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{map-editor → pc-editor/map-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{map-selection-editor → pc-editor/map-selection-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{parse-geolocation.js → pc-editor/parse-geolocation.js} +0 -0
- /package/lib/GeolocationEditor/{selector-list.js → pc-editor/selector-list.js} +0 -0
- /package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/image-link/index.css +0 -0
- /package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/index.css +0 -0
- /package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/local-image-addition/index.css +0 -0
- /package/lib/LinkEditor/{mb-link-editor-popover → mb-popover}/index.js +0 -0
- /package/lib/LinkEditor/{pc-link-editor-popover → pc-popover}/index.css +0 -0
- /package/lib/LinkEditor/{pc-link-editor-popover → pc-popover}/index.js +0 -0
- /package/lib/RowExpandEditor/{RowExpandAddBtn → add-btn/pc-add-btn}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandCheckboxEditor → checkbox-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandGeolocationEditor → geolocation-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandImageEditor → image-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandLongTextEditor → long-text-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandSingleSelectorEditor → single-select-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandTextEditor → text-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandUrlEditor → url-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandEmailFormatter → email-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandFileFormatter → file-formatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandFileFormatter → file-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandFileFormatter → file-formatter}/row-expand-file-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandFormulaFormatter → formula-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandImageFormatter → image-formatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandImageFormatter → image-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandImageFormatter → image-formatter}/row-expand-image-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandLinkFormatter → link-formatter}/collaborator-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandLinkFormatter → link-formatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandLinkFormatter → link-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandLinkFormatter → link-formatter}/value-display-utils.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandRateFormatter → rate-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandUrlFormatter → url-formatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandUrlFormatter → url-formatter}/index.js +0 -0
- /package/lib/{Department-editor/constants.js → constants/departments.js} +0 -0
- /package/lib/{Department-editor/utils.js → utils/departments.js} +0 -0
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactstrap = require("reactstrap");
|
|
10
|
+
var _dtableUtils = require("dtable-utils");
|
|
11
|
+
var _InputItem = _interopRequireDefault(require("../../../InputItem"));
|
|
12
|
+
var _toaster = _interopRequireDefault(require("../../../toaster"));
|
|
13
|
+
var _MobileFullScreenPage = _interopRequireDefault(require("../../../MobileFullScreenPage"));
|
|
14
|
+
var _mapEditorUtils = require("../../map-editor-utils");
|
|
15
|
+
var _cell = require("../../../utils/cell");
|
|
16
|
+
var _lang = require("../../../lang");
|
|
17
|
+
var _Loading = _interopRequireDefault(require("../../../Loading"));
|
|
18
|
+
require("./index.css");
|
|
19
|
+
const {
|
|
20
|
+
Header,
|
|
21
|
+
Body
|
|
22
|
+
} = _MobileFullScreenPage.default;
|
|
23
|
+
const getInputMode = column => {
|
|
24
|
+
const data = column.data;
|
|
25
|
+
if (!data) return _mapEditorUtils.INPUT_MODE_MAP.ANY_LOCATION;
|
|
26
|
+
return data.input_mode || _mapEditorUtils.INPUT_MODE_MAP.ANY_LOCATION;
|
|
27
|
+
};
|
|
28
|
+
const getInitValue = value => {
|
|
29
|
+
if (!value || (0, _dtableUtils.isEmptyObject)(value) || !value.address) {
|
|
30
|
+
return {
|
|
31
|
+
address: '',
|
|
32
|
+
title: '',
|
|
33
|
+
tag: '',
|
|
34
|
+
lngLat: {}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return value;
|
|
38
|
+
};
|
|
39
|
+
class MapSelectionEditor extends _react.default.Component {
|
|
40
|
+
constructor(props) {
|
|
41
|
+
super(props);
|
|
42
|
+
this.addMarkerByPosition = value => {
|
|
43
|
+
const {
|
|
44
|
+
lngLat
|
|
45
|
+
} = value;
|
|
46
|
+
let point = new window.BMap.Point(lngLat.lng, lngLat.lat);
|
|
47
|
+
const marker = new window.BMap.Marker(point, {
|
|
48
|
+
offset: new window.BMap.Size(-2, -5)
|
|
49
|
+
});
|
|
50
|
+
if (this.map) {
|
|
51
|
+
this.map.clearOverlays();
|
|
52
|
+
this.map.addOverlay(marker);
|
|
53
|
+
this.map.centerAndZoom(point, 10);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
this.realTimePositioning = (error, point) => {
|
|
57
|
+
if (error) {
|
|
58
|
+
_toaster.default.danger((0, _lang.getLocale)('Positioning_failed'));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const geoCoder = new window.BMap.Geocoder();
|
|
62
|
+
let value = {};
|
|
63
|
+
geoCoder.getLocation(point, result => {
|
|
64
|
+
const {
|
|
65
|
+
surroundingPois,
|
|
66
|
+
address,
|
|
67
|
+
point
|
|
68
|
+
} = result;
|
|
69
|
+
if (surroundingPois.length === 0) {
|
|
70
|
+
value.address = address;
|
|
71
|
+
value.lngLat = {
|
|
72
|
+
lng: point.lng,
|
|
73
|
+
lat: point.lat
|
|
74
|
+
};
|
|
75
|
+
value.tag = [];
|
|
76
|
+
value.title = '';
|
|
77
|
+
} else {
|
|
78
|
+
const position = surroundingPois[0];
|
|
79
|
+
const {
|
|
80
|
+
address,
|
|
81
|
+
title,
|
|
82
|
+
tags,
|
|
83
|
+
point
|
|
84
|
+
} = position;
|
|
85
|
+
value.address = address || '';
|
|
86
|
+
value.title = title || '';
|
|
87
|
+
value.tag = tags || [];
|
|
88
|
+
value.lngLat = {
|
|
89
|
+
lng: point.lng,
|
|
90
|
+
lat: point.lat
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
this.setState({
|
|
94
|
+
isShowLabel: true,
|
|
95
|
+
selectedSelection: value,
|
|
96
|
+
inputValue: value.title || value.address
|
|
97
|
+
});
|
|
98
|
+
this.addMarkerByPosition(value);
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
this.renderBaiduMap = () => {
|
|
102
|
+
this.setState({
|
|
103
|
+
isLoading: false
|
|
104
|
+
}, () => {
|
|
105
|
+
if (!window.BMap.Map) return;
|
|
106
|
+
setTimeout(() => {
|
|
107
|
+
this.map = new window.BMap.Map('dtable-ui-mobile-geolocation-map-container');
|
|
108
|
+
let {
|
|
109
|
+
lng,
|
|
110
|
+
lat,
|
|
111
|
+
zoom
|
|
112
|
+
} = (0, _mapEditorUtils.getInitCenter)();
|
|
113
|
+
const {
|
|
114
|
+
value
|
|
115
|
+
} = this.state;
|
|
116
|
+
const {
|
|
117
|
+
lngLat
|
|
118
|
+
} = value;
|
|
119
|
+
if ((0, _cell.isValidPosition)(lngLat.lng, lngLat.lat)) {
|
|
120
|
+
lng = lngLat.lng;
|
|
121
|
+
lat = lngLat.lat;
|
|
122
|
+
this.setState({
|
|
123
|
+
isShowLabel: true,
|
|
124
|
+
selectedSelection: value
|
|
125
|
+
});
|
|
126
|
+
this.addMarkerByPosition(value);
|
|
127
|
+
}
|
|
128
|
+
let point = new window.BMap.Point(lng, lat);
|
|
129
|
+
this.map.centerAndZoom(point, zoom);
|
|
130
|
+
this.map.enableScrollWheelZoom(true);
|
|
131
|
+
// normal map selection
|
|
132
|
+
this.canSelectPosition && this.map.addEventListener('click', event => {
|
|
133
|
+
let value = {};
|
|
134
|
+
const point = event.point;
|
|
135
|
+
const geoCoder = new window.BMap.Geocoder();
|
|
136
|
+
geoCoder.getLocation(point, result => {
|
|
137
|
+
const {
|
|
138
|
+
surroundingPois,
|
|
139
|
+
address,
|
|
140
|
+
point
|
|
141
|
+
} = result;
|
|
142
|
+
if (surroundingPois.length === 0) {
|
|
143
|
+
value.address = address;
|
|
144
|
+
value.lngLat = {
|
|
145
|
+
lng: point.lng,
|
|
146
|
+
lat: point.lat
|
|
147
|
+
};
|
|
148
|
+
value.tag = [];
|
|
149
|
+
value.title = '';
|
|
150
|
+
} else {
|
|
151
|
+
const position = surroundingPois[0];
|
|
152
|
+
const {
|
|
153
|
+
address,
|
|
154
|
+
title,
|
|
155
|
+
tags,
|
|
156
|
+
point
|
|
157
|
+
} = position;
|
|
158
|
+
value.address = address || '';
|
|
159
|
+
value.title = title || '';
|
|
160
|
+
value.tag = tags || [];
|
|
161
|
+
value.lngLat = {
|
|
162
|
+
lng: point.lng,
|
|
163
|
+
lat: point.lat
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
this.setState({
|
|
167
|
+
isShowLabel: true,
|
|
168
|
+
selectedSelection: value,
|
|
169
|
+
inputValue: value.title || value.address
|
|
170
|
+
});
|
|
171
|
+
this.addMarkerByPosition(value);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
// for mobile device real-time positioning, use current position
|
|
175
|
+
!this.canSelectPosition && (0, _mapEditorUtils.locateCurrentPosition)(this.map, this.mapType, this.realTimePositioning);
|
|
176
|
+
}, 1);
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
this.geolocationCallback = (error, point) => {
|
|
180
|
+
if (error) {
|
|
181
|
+
_toaster.default.danger((0, _lang.getLocale)('Positioning_failed'));
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const geoCoder = new window.BMap.Geocoder();
|
|
185
|
+
geoCoder.getLocation(point, result => {
|
|
186
|
+
let value = {};
|
|
187
|
+
const {
|
|
188
|
+
surroundingPois,
|
|
189
|
+
address,
|
|
190
|
+
point
|
|
191
|
+
} = result;
|
|
192
|
+
if (surroundingPois.length === 0) {
|
|
193
|
+
value.address = address;
|
|
194
|
+
value.lngLat = {
|
|
195
|
+
lng: point.lng,
|
|
196
|
+
lat: point.lat
|
|
197
|
+
};
|
|
198
|
+
value.tag = [];
|
|
199
|
+
value.title = '';
|
|
200
|
+
} else {
|
|
201
|
+
const position = surroundingPois[0];
|
|
202
|
+
const {
|
|
203
|
+
address,
|
|
204
|
+
title,
|
|
205
|
+
tags,
|
|
206
|
+
point
|
|
207
|
+
} = position;
|
|
208
|
+
value.address = address || '';
|
|
209
|
+
value.title = title || '';
|
|
210
|
+
value.tag = tags || [];
|
|
211
|
+
value.lngLat = {
|
|
212
|
+
lng: point.lng,
|
|
213
|
+
lat: point.lat
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
this.setState({
|
|
217
|
+
isShowLabel: true,
|
|
218
|
+
selectedSelection: value
|
|
219
|
+
});
|
|
220
|
+
this.addMarkerByPosition(value);
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
this.isEmptySelection = value => {
|
|
224
|
+
return !value.title && !value.address && !value.tag && (0, _dtableUtils.isEmptyObject)(value.lngLat);
|
|
225
|
+
};
|
|
226
|
+
this.clearSearchNumerical = () => {
|
|
227
|
+
this.setState({
|
|
228
|
+
inputValue: '',
|
|
229
|
+
value: {}
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
this.onChange = inputValue => {
|
|
233
|
+
this.setState({
|
|
234
|
+
inputValue
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
this.onZoomIn = () => {
|
|
238
|
+
if (!this.map) return;
|
|
239
|
+
const currentZoom = this.map.getZoom();
|
|
240
|
+
this.map.setZoom(currentZoom + 1);
|
|
241
|
+
};
|
|
242
|
+
this.onZoomOut = () => {
|
|
243
|
+
if (!this.map) return;
|
|
244
|
+
const currentZoom = this.map.getZoom();
|
|
245
|
+
this.map.setZoom(currentZoom - 1);
|
|
246
|
+
};
|
|
247
|
+
this.onLocateCurrentPosition = () => {
|
|
248
|
+
(0, _mapEditorUtils.locateCurrentPosition)(this.map, this.mapType, this.geolocationCallback);
|
|
249
|
+
};
|
|
250
|
+
this.onClickSelection = result => {
|
|
251
|
+
this.setState({
|
|
252
|
+
searchResults: [],
|
|
253
|
+
inputValue: result.title || result.address,
|
|
254
|
+
selectedSelection: result,
|
|
255
|
+
isShowSearchView: false,
|
|
256
|
+
isShowLabel: true
|
|
257
|
+
}, () => {
|
|
258
|
+
this.addMarkerByPosition(result);
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
this.onCommit = () => {
|
|
262
|
+
const {
|
|
263
|
+
value
|
|
264
|
+
} = this.state;
|
|
265
|
+
const isEmptyMapSelection = this.isEmptySelection(value);
|
|
266
|
+
this.props.onCommit(isEmptyMapSelection ? '' : value);
|
|
267
|
+
};
|
|
268
|
+
this.onClose = () => {
|
|
269
|
+
this.props.onToggle();
|
|
270
|
+
};
|
|
271
|
+
this.onFillIn = () => {
|
|
272
|
+
const {
|
|
273
|
+
selectedSelection
|
|
274
|
+
} = this.state;
|
|
275
|
+
this.setState({
|
|
276
|
+
value: selectedSelection,
|
|
277
|
+
isShowLabel: false
|
|
278
|
+
}, () => {
|
|
279
|
+
_toaster.default.success((0, _lang.getLocale)('Successfully_filled_in'));
|
|
280
|
+
this.onCommit();
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
this.onCloseLabel = e => {
|
|
284
|
+
e.stopPropagation();
|
|
285
|
+
this.map.clearOverlays();
|
|
286
|
+
this.setState({
|
|
287
|
+
isShowLabel: false,
|
|
288
|
+
selectedSelection: {},
|
|
289
|
+
inputValue: ''
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
this.onSearch = e => {
|
|
293
|
+
e.stopPropagation();
|
|
294
|
+
const {
|
|
295
|
+
inputValue
|
|
296
|
+
} = this.state;
|
|
297
|
+
if (!inputValue) return;
|
|
298
|
+
const options = {
|
|
299
|
+
onSearchComplete: results => {
|
|
300
|
+
const status = local.getStatus();
|
|
301
|
+
if (status !== window.BMAP_STATUS_SUCCESS) {
|
|
302
|
+
_toaster.default.danger((0, _lang.getLocale)('Search_failed_please_enter_detailed_address'));
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
let searchResults = [];
|
|
306
|
+
for (let i = 0; i < results.getCurrentNumPois(); i++) {
|
|
307
|
+
const value = results.getPoi(i);
|
|
308
|
+
let position = {};
|
|
309
|
+
position.address = value.address || '';
|
|
310
|
+
position.title = value.title || '';
|
|
311
|
+
position.tag = value.tags || [];
|
|
312
|
+
position.lngLat = {
|
|
313
|
+
lng: value.point.lng,
|
|
314
|
+
lat: value.point.lat
|
|
315
|
+
};
|
|
316
|
+
searchResults.push(position);
|
|
317
|
+
}
|
|
318
|
+
this.setState({
|
|
319
|
+
searchResults,
|
|
320
|
+
isShowSearchView: true,
|
|
321
|
+
isShowLabel: false
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
let local = new window.BMap.LocalSearch(this.map, options);
|
|
326
|
+
local.search(inputValue);
|
|
327
|
+
};
|
|
328
|
+
this.renderSearchResult = () => {
|
|
329
|
+
const {
|
|
330
|
+
searchResults
|
|
331
|
+
} = this.state;
|
|
332
|
+
if (searchResults.length === 0) return null;
|
|
333
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
334
|
+
className: "dtable-ui-mobile-map-selection-editor-search-results"
|
|
335
|
+
}, searchResults.map((result, index) => {
|
|
336
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
337
|
+
className: "dtable-ui-mobile-map-selection-editor-search-result",
|
|
338
|
+
key: index,
|
|
339
|
+
onClick: this.onClickSelection.bind(this, result)
|
|
340
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
341
|
+
className: "dtable-ui-mobile-map-selection-editor-search-result-title"
|
|
342
|
+
}, result.title || ''), /*#__PURE__*/_react.default.createElement("span", {
|
|
343
|
+
className: "dtable-ui-mobile-map-selection-editor-search-result-address"
|
|
344
|
+
}, result.address || ''));
|
|
345
|
+
}));
|
|
346
|
+
};
|
|
347
|
+
this.renderLabel = () => {
|
|
348
|
+
const {
|
|
349
|
+
selectedSelection
|
|
350
|
+
} = this.state;
|
|
351
|
+
const {
|
|
352
|
+
address,
|
|
353
|
+
title,
|
|
354
|
+
tag
|
|
355
|
+
} = selectedSelection;
|
|
356
|
+
const tagContent = Array.isArray(tag) && tag.length > 0 ? tag[0] : '';
|
|
357
|
+
if (title) {
|
|
358
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
359
|
+
className: "dtable-ui-mobile-geolocation-map-editor-label"
|
|
360
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
361
|
+
className: "dtable-ui-mobile-geolocation-map-editor-label-title",
|
|
362
|
+
title: title
|
|
363
|
+
}, title), tagContent && /*#__PURE__*/_react.default.createElement("span", {
|
|
364
|
+
className: "dtable-ui-mobile-geolocation-map-editor-label-tag"
|
|
365
|
+
}, tagContent), /*#__PURE__*/_react.default.createElement("span", {
|
|
366
|
+
className: "dtable-font dtable-icon-x",
|
|
367
|
+
onClick: this.onCloseLabel
|
|
368
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
369
|
+
className: "dtable-ui-mobile-geolocation-map-editor-label-address-tip"
|
|
370
|
+
}, (0, _lang.getLocale)('Address')), /*#__PURE__*/_react.default.createElement("span", {
|
|
371
|
+
className: "dtable-ui-mobile-geolocation-map-editor-label-address",
|
|
372
|
+
title: address
|
|
373
|
+
}, address), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
|
|
374
|
+
className: "dtable-ui-mobile-geolocation-map-editor-label-btn",
|
|
375
|
+
color: "primary",
|
|
376
|
+
size: "sm",
|
|
377
|
+
onClick: this.onFillIn
|
|
378
|
+
}, (0, _lang.getLocale)('Fill_in')));
|
|
379
|
+
}
|
|
380
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
381
|
+
className: "dtable-ui-mobile-geolocation-map-editor-label simple"
|
|
382
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
383
|
+
className: "dtable-font dtable-icon-x",
|
|
384
|
+
onClick: this.onCloseLabel
|
|
385
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
386
|
+
className: "dtable-ui-mobile-geolocation-map-editor-label-address text-truncate simple",
|
|
387
|
+
title: address
|
|
388
|
+
}, address), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
|
|
389
|
+
className: "dtable-ui-mobile-geolocation-map-editor-label-btn simple",
|
|
390
|
+
color: "primary",
|
|
391
|
+
size: "sm",
|
|
392
|
+
onClick: this.onFillIn
|
|
393
|
+
}, (0, _lang.getLocale)('Fill_in')));
|
|
394
|
+
};
|
|
395
|
+
this.renderMap = () => {
|
|
396
|
+
const {
|
|
397
|
+
isLoading,
|
|
398
|
+
inputValue,
|
|
399
|
+
isShowSearchView,
|
|
400
|
+
isShowLabel
|
|
401
|
+
} = this.state;
|
|
402
|
+
if (isLoading) return /*#__PURE__*/_react.default.createElement("div", {
|
|
403
|
+
className: "w-100 h-100 d-flex align-items-center justify-content-center"
|
|
404
|
+
}, /*#__PURE__*/_react.default.createElement(_Loading.default, null));
|
|
405
|
+
if (!this.mapType) {
|
|
406
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
407
|
+
className: "dtable-ui-geolocation-map-editor-error-message d-flex justify-content-center align-items-center w-100 h-100"
|
|
408
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
409
|
+
className: "alert-danger"
|
|
410
|
+
}, (0, _lang.getLocale)('The_map_plugin_is_not_properly_configured_contact_the_administrator')));
|
|
411
|
+
}
|
|
412
|
+
if (this.mapType !== _mapEditorUtils.MAP_TYPES.B_MAP) {
|
|
413
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
414
|
+
className: "dtable-ui-geolocation-map-editor-error-message d-flex justify-content-center align-items-center w-100 h-100"
|
|
415
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
416
|
+
className: "alert-danger"
|
|
417
|
+
}, (0, _lang.getLocale)('This_map_type_currently_does_not_support_map_point_selection')));
|
|
418
|
+
}
|
|
419
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.canSelectPosition && /*#__PURE__*/_react.default.createElement("div", {
|
|
420
|
+
className: "dtable-ui-mobile-geolocation-map-editor-input-container"
|
|
421
|
+
}, /*#__PURE__*/_react.default.createElement(_InputItem.default, {
|
|
422
|
+
type: "text",
|
|
423
|
+
className: "dtable-ui-mobile-geolocation-map-editor-input",
|
|
424
|
+
style: {
|
|
425
|
+
marginTop: 0
|
|
426
|
+
},
|
|
427
|
+
value: inputValue,
|
|
428
|
+
onChange: this.onChange,
|
|
429
|
+
clear: true,
|
|
430
|
+
placeholder: (0, _lang.getLocale)('Please_enter_the_address')
|
|
431
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
432
|
+
className: "dtable-ui-mobile-geolocation-map-editor-search-btn",
|
|
433
|
+
onClick: this.onSearch
|
|
434
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
435
|
+
className: "dtable-font dtable-icon-search"
|
|
436
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
437
|
+
className: "dtable-ui-mobile-geolocation-map-editor-map"
|
|
438
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
439
|
+
className: "w-100 h-100",
|
|
440
|
+
ref: ref => this.ref = ref,
|
|
441
|
+
id: "dtable-ui-mobile-geolocation-map-container"
|
|
442
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
443
|
+
className: "dtable-ui-geolocation-map-controller"
|
|
444
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
445
|
+
className: "dtable-ui-geolocation-locate-control",
|
|
446
|
+
onClick: this.onLocateCurrentPosition
|
|
447
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
448
|
+
className: "dtable-font dtable-icon-current-location"
|
|
449
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
450
|
+
className: "dtable-ui-geolocation-zoom-control"
|
|
451
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
452
|
+
className: "dtable-ui-geolocation-zoom-control-btn",
|
|
453
|
+
onClick: this.onZoomIn
|
|
454
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
455
|
+
"aria-hidden": "true",
|
|
456
|
+
className: "dtable-font dtable-icon-enlarge"
|
|
457
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
458
|
+
className: "dtable-ui-geolocation-zoom-control-btn",
|
|
459
|
+
onClick: this.onZoomOut
|
|
460
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
461
|
+
"aria-hidden": "true",
|
|
462
|
+
className: "dtable-font dtable-icon-narrow"
|
|
463
|
+
})))), isShowSearchView && this.renderSearchResult()), isShowLabel && this.renderLabel());
|
|
464
|
+
};
|
|
465
|
+
const {
|
|
466
|
+
value: _value,
|
|
467
|
+
config,
|
|
468
|
+
column
|
|
469
|
+
} = props;
|
|
470
|
+
const oldValue = _value || {};
|
|
471
|
+
const {
|
|
472
|
+
mapType,
|
|
473
|
+
mapKey
|
|
474
|
+
} = (0, _mapEditorUtils.getMapInfo)(config);
|
|
475
|
+
this.mapType = mapType;
|
|
476
|
+
this.mapKey = mapKey;
|
|
477
|
+
const mode = getInputMode(column);
|
|
478
|
+
this.canSelectPosition = mode === _mapEditorUtils.INPUT_MODE_MAP.ANY_LOCATION;
|
|
479
|
+
const initValue = getInitValue(_value);
|
|
480
|
+
this.map = null;
|
|
481
|
+
this.state = {
|
|
482
|
+
isLoading: true,
|
|
483
|
+
value: oldValue,
|
|
484
|
+
inputValue: initValue.title || initValue.address || '',
|
|
485
|
+
isShowSearchView: false,
|
|
486
|
+
isShowLabel: false,
|
|
487
|
+
searchResults: [],
|
|
488
|
+
selectedSelection: {}
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
componentDidMount() {
|
|
492
|
+
if (this.mapType !== _mapEditorUtils.MAP_TYPES.B_MAP) {
|
|
493
|
+
this.setState({
|
|
494
|
+
isLoading: false
|
|
495
|
+
});
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
if (!window.BMap) {
|
|
499
|
+
window.renderBaiduMap = () => this.renderBaiduMap();
|
|
500
|
+
(0, _mapEditorUtils.loadMapSource)(this.mapType, this.mapKey);
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
this.renderBaiduMap();
|
|
504
|
+
}
|
|
505
|
+
componentWillUnmount() {
|
|
506
|
+
let center = {};
|
|
507
|
+
if (!this.map) return;
|
|
508
|
+
center.zoom = this.map.getZoom();
|
|
509
|
+
const coordinate = this.map.getCenter();
|
|
510
|
+
center.lng = coordinate.lng;
|
|
511
|
+
center.lat = coordinate.lat;
|
|
512
|
+
this.mineMapMarker = null;
|
|
513
|
+
localStorage.setItem('geolocation-map-center', JSON.stringify(center));
|
|
514
|
+
this.map = null;
|
|
515
|
+
}
|
|
516
|
+
render() {
|
|
517
|
+
const {
|
|
518
|
+
column
|
|
519
|
+
} = this.props;
|
|
520
|
+
return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
|
|
521
|
+
className: "dtable-ui-mobile-geolocation-map-selection-editor",
|
|
522
|
+
onClose: this.onClose
|
|
523
|
+
}, /*#__PURE__*/_react.default.createElement(Header, {
|
|
524
|
+
onLeftClick: this.onClose
|
|
525
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
526
|
+
className: "dtable-font dtable-icon-return"
|
|
527
|
+
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name)), /*#__PURE__*/_react.default.createElement(Body, null, this.renderMap()));
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
var _default = exports.default = MapSelectionEditor;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _Picker = _interopRequireDefault(require("../../Picker"));
|
|
11
|
+
var _List = _interopRequireDefault(require("../../List"));
|
|
12
|
+
var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
|
|
13
|
+
var _lang = require("../../lang");
|
|
14
|
+
const {
|
|
15
|
+
Header,
|
|
16
|
+
Body
|
|
17
|
+
} = _MobileFullScreenPage.default;
|
|
18
|
+
const ProvinceCityEditor = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
column,
|
|
21
|
+
value: oldValue,
|
|
22
|
+
getData,
|
|
23
|
+
onToggle,
|
|
24
|
+
onCommit
|
|
25
|
+
} = _ref;
|
|
26
|
+
const [value, setValue] = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '', (oldValue === null || oldValue === void 0 ? void 0 : oldValue.city) || '']);
|
|
27
|
+
const [isLoading, setLoading] = (0, _react.useState)(true);
|
|
28
|
+
const locations = (0, _react.useRef)([]);
|
|
29
|
+
(0, _react.useEffect)(() => {
|
|
30
|
+
getData().then(data => {
|
|
31
|
+
locations.current = data;
|
|
32
|
+
setLoading(false);
|
|
33
|
+
});
|
|
34
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
|
+
}, []);
|
|
36
|
+
const onValueChange = (0, _react.useCallback)(newValue => {
|
|
37
|
+
if (value === newValue) return;
|
|
38
|
+
setValue(newValue);
|
|
39
|
+
}, [value]);
|
|
40
|
+
const onSubmit = (0, _react.useCallback)(() => {
|
|
41
|
+
if (value[0] !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || value[1] !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.city)) {
|
|
42
|
+
onCommit({
|
|
43
|
+
province: value[0],
|
|
44
|
+
city: value[1]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
onToggle();
|
|
48
|
+
}, [value, oldValue, onCommit, onToggle]);
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
|
|
50
|
+
onToggle: onToggle
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(Header, {
|
|
52
|
+
onLeftClick: onToggle,
|
|
53
|
+
onRightClick: onSubmit
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name), /*#__PURE__*/_react.default.createElement("span", {
|
|
55
|
+
style: {
|
|
56
|
+
color: '#f09f3f'
|
|
57
|
+
}
|
|
58
|
+
}, (0, _lang.getLocale)('Submit'))), /*#__PURE__*/_react.default.createElement(Body, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
className: "dtable-ui-mobile-row-expand-subtitle"
|
|
60
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Address_information'))), /*#__PURE__*/_react.default.createElement(_Picker.default, {
|
|
61
|
+
className: "dtable-ui-mobile-geolocation-editor-picker",
|
|
62
|
+
data: isLoading ? [] : locations.current,
|
|
63
|
+
value: value,
|
|
64
|
+
format: "",
|
|
65
|
+
onChange: onValueChange,
|
|
66
|
+
cascade: true,
|
|
67
|
+
title: (0, _lang.getLocale)('Address_information'),
|
|
68
|
+
extra: (0, _lang.getLocale)('Select_location'),
|
|
69
|
+
onOk: e => onValueChange(e),
|
|
70
|
+
okText: (0, _lang.getLocale)('Done'),
|
|
71
|
+
dismissText: (0, _lang.getLocale)('Cancel'),
|
|
72
|
+
cols: 2
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_List.default.Item, {
|
|
74
|
+
arrow: "horizontal"
|
|
75
|
+
}, value.join(' ') || (0, _lang.getLocale)('Select_location')))));
|
|
76
|
+
};
|
|
77
|
+
var _default = exports.default = ProvinceCityEditor;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _Picker = _interopRequireDefault(require("../../Picker"));
|
|
11
|
+
var _List = _interopRequireDefault(require("../../List"));
|
|
12
|
+
var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
|
|
13
|
+
var _lang = require("../../lang");
|
|
14
|
+
const {
|
|
15
|
+
Header,
|
|
16
|
+
Body
|
|
17
|
+
} = _MobileFullScreenPage.default;
|
|
18
|
+
const ProvinceEditor = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
column,
|
|
21
|
+
value: oldValue,
|
|
22
|
+
getData,
|
|
23
|
+
onToggle,
|
|
24
|
+
onCommit
|
|
25
|
+
} = _ref;
|
|
26
|
+
const [value, setValue] = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '']);
|
|
27
|
+
const [isLoading, setLoading] = (0, _react.useState)(true);
|
|
28
|
+
const locations = (0, _react.useRef)([]);
|
|
29
|
+
(0, _react.useEffect)(() => {
|
|
30
|
+
getData().then(data => {
|
|
31
|
+
locations.current = data;
|
|
32
|
+
setLoading(false);
|
|
33
|
+
});
|
|
34
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
|
+
}, []);
|
|
36
|
+
const onValueChange = (0, _react.useCallback)(newValue => {
|
|
37
|
+
if (value[0] === newValue[0]) return;
|
|
38
|
+
setValue(newValue);
|
|
39
|
+
}, [value]);
|
|
40
|
+
const onSubmit = (0, _react.useCallback)(() => {
|
|
41
|
+
if (value[0] !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.province)) {
|
|
42
|
+
onCommit({
|
|
43
|
+
province: value[0]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
onToggle();
|
|
47
|
+
}, [value, oldValue, onCommit, onToggle]);
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
|
|
49
|
+
onClose: onToggle
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(Header, {
|
|
51
|
+
onLeftClick: onToggle,
|
|
52
|
+
onRightClick: onSubmit
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name), /*#__PURE__*/_react.default.createElement("span", {
|
|
54
|
+
style: {
|
|
55
|
+
color: '#f09f3f'
|
|
56
|
+
}
|
|
57
|
+
}, (0, _lang.getLocale)('Submit'))), /*#__PURE__*/_react.default.createElement(Body, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
className: "dtable-ui-mobile-row-expand-subtitle"
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Address_information'))), /*#__PURE__*/_react.default.createElement(_Picker.default, {
|
|
60
|
+
className: "dtable-ui-mobile-geolocation-editor-picker",
|
|
61
|
+
data: isLoading ? [] : locations.current,
|
|
62
|
+
value: value,
|
|
63
|
+
format: "",
|
|
64
|
+
onChange: onValueChange,
|
|
65
|
+
cascade: true,
|
|
66
|
+
title: (0, _lang.getLocale)('Address_information'),
|
|
67
|
+
extra: (0, _lang.getLocale)('Select_location'),
|
|
68
|
+
onOk: e => onValueChange(e),
|
|
69
|
+
okText: (0, _lang.getLocale)('Done'),
|
|
70
|
+
dismissText: (0, _lang.getLocale)('Cancel'),
|
|
71
|
+
cols: 1
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_List.default.Item, {
|
|
73
|
+
arrow: "horizontal"
|
|
74
|
+
}, value[0] || (0, _lang.getLocale)('Select_location')))));
|
|
75
|
+
};
|
|
76
|
+
var _default = exports.default = ProvinceEditor;
|