dtable-ui-component 6.0.25-alpha.4 → 6.0.26-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 +17 -118
- package/lib/CheckboxEditor/lg.js +118 -0
- package/lib/CheckboxEditor/sm.js +101 -0
- package/lib/CollaboratorEditor/index.js +11 -4
- package/lib/CollaboratorEditor/{pc-collaborator-editor → lg}/index.js +2 -2
- package/lib/CollaboratorEditor/sm/index.css +41 -0
- package/lib/CollaboratorEditor/sm/index.js +87 -0
- package/lib/DTableCommonAddTool/index.js +1 -3
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +3 -3
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +4 -4
- package/lib/DateEditor/index.js +31 -30
- package/lib/DateEditor/{pc-date-editor-popover.js → large.js} +6 -6
- package/lib/DateEditor/sm/custom-rc-calendar.css +118 -0
- package/lib/DateEditor/sm/index.css +40 -0
- package/lib/DateEditor/{mb-date-editor-popover → sm}/index.js +15 -30
- package/lib/{Department-editor → DepartmentEditor}/constants.js +7 -0
- package/lib/{Department-editor → DepartmentEditor}/department-multiple-select/index.css +4 -1
- package/lib/{Department-editor → DepartmentEditor}/department-multiple-select/index.js +7 -4
- package/lib/DepartmentEditor/index.js +25 -0
- package/lib/{Department-editor → DepartmentEditor/lg}/department-single-select.js +10 -7
- package/lib/{Department-editor → DepartmentEditor/lg}/index.css +12 -3
- package/lib/{Department-editor → DepartmentEditor/lg}/index.js +8 -25
- package/lib/DepartmentEditor/sm/index.css +4 -0
- package/lib/DepartmentEditor/sm/index.js +220 -0
- package/lib/DigitalSignEditor/index.js +17 -173
- package/lib/DigitalSignEditor/lg/index.js +181 -0
- package/lib/DigitalSignEditor/sm/index.css +35 -0
- package/lib/DigitalSignEditor/sm/index.js +139 -0
- package/lib/FileEditor/files-previewer/index.js +16 -267
- package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/dropdown-menu.js +1 -1
- package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/file-name-editor/index.js +1 -1
- package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/index.css +0 -2
- package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/index.js +2 -2
- package/lib/FileEditor/files-previewer/lg/index.js +276 -0
- package/lib/FileEditor/files-previewer/sm/file-previewer/index.js +122 -0
- package/lib/FileEditor/files-previewer/sm/index.css +39 -0
- package/lib/FileEditor/files-previewer/sm/index.js +59 -0
- package/lib/FileEditor/index.css +0 -5
- package/lib/FileEditor/index.js +16 -264
- package/lib/FileEditor/lg/addition-previewer/index.css +1 -0
- package/lib/FileEditor/{addition-previewer → lg/addition-previewer}/index.js +1 -1
- package/lib/FileEditor/lg/addition-previewer/local-file-addition/index.css +1 -0
- package/lib/FileEditor/{addition-previewer → lg/addition-previewer}/local-file-addition/index.js +4 -4
- package/lib/FileEditor/lg/index.css +5 -0
- package/lib/FileEditor/lg/index.js +274 -0
- package/lib/FileEditor/sm/index.css +10 -0
- package/lib/FileEditor/sm/index.js +131 -0
- package/lib/FileFormatter/index.js +4 -4
- package/lib/FormulaFormatter/index.css +5 -5
- package/lib/GeolocationEditor/index.js +76 -231
- package/lib/GeolocationEditor/{country-editor.js → lg/country-editor.js} +5 -49
- package/lib/GeolocationEditor/{index.css → lg/index.css} +1 -2
- package/lib/GeolocationEditor/lg/index.js +247 -0
- package/lib/GeolocationEditor/{location-editor.js → lg/location-editor.js} +8 -41
- package/lib/GeolocationEditor/{map-editor → lg/map-editor}/index.js +6 -6
- package/lib/GeolocationEditor/{map-editor → lg/map-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/{map-selection-editor → lg/map-selection-editor}/index.js +7 -7
- package/lib/GeolocationEditor/{map-selection-editor → lg/map-selection-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/{province-city-editor.js → lg/province-city-editor.js} +7 -38
- package/lib/GeolocationEditor/{province-editor.js → lg/province-editor.js} +7 -31
- package/lib/GeolocationEditor/{selector-header-item.js → lg/selector-header-item.js} +1 -1
- package/lib/GeolocationEditor/map-editor-utils.js +6 -2
- package/lib/GeolocationEditor/sm/country-editor.js +70 -0
- package/lib/GeolocationEditor/sm/index.css +11 -0
- package/lib/GeolocationEditor/sm/index.js +125 -0
- package/lib/GeolocationEditor/sm/location-editor.js +93 -0
- package/lib/GeolocationEditor/sm/map-editor/index.css +11 -0
- package/lib/GeolocationEditor/sm/map-editor/index.js +469 -0
- package/lib/GeolocationEditor/sm/map-selection-editor/index.css +158 -0
- package/lib/GeolocationEditor/sm/map-selection-editor/index.js +525 -0
- package/lib/GeolocationEditor/sm/province-city-editor.js +68 -0
- package/lib/GeolocationEditor/sm/province-editor.js +67 -0
- package/lib/ImageEditor/images-previewer/image-preview/index.js +2 -2
- package/lib/ImageEditor/images-previewer/index.js +3 -3
- package/lib/ImageEditor/index.css +17 -16
- package/lib/ImageEditor/index.js +16 -184
- package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/image-link/index.js +1 -1
- package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/index.js +1 -1
- package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/local-image-addition/index.js +4 -4
- package/lib/ImageEditor/lg/images-previewer/index.js +140 -0
- package/lib/ImageEditor/lg/index.css +24 -0
- package/lib/ImageEditor/lg/index.js +194 -0
- package/lib/ImageEditor/sm/index.css +29 -0
- package/lib/ImageEditor/sm/index.js +131 -0
- package/lib/ImageThumbnail/index.js +2 -1
- package/lib/LinkEditor/pc-link-editor-popover/index.css +1 -1
- package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
- package/lib/MobileFullScreenPage/body/index.css +9 -0
- package/lib/MobileFullScreenPage/body/index.js +23 -0
- package/lib/MobileFullScreenPage/header/index.css +35 -0
- package/lib/MobileFullScreenPage/header/index.js +38 -0
- package/lib/MobileFullScreenPage/index.css +13 -0
- package/lib/MobileFullScreenPage/index.js +81 -0
- package/lib/MobileModal/index.js +41 -0
- package/lib/MobileOperationSheet/index.css +27 -0
- package/lib/MobileOperationSheet/index.js +92 -0
- package/lib/MobileSelectorEditor/empty/index.css +3 -0
- package/lib/MobileSelectorEditor/empty/index.js +23 -0
- package/lib/MobileSelectorEditor/index.css +32 -0
- package/lib/MobileSelectorEditor/index.js +57 -0
- package/lib/MobileSelectorEditor/option/index.css +28 -0
- package/lib/MobileSelectorEditor/option/index.js +36 -0
- package/lib/MobileSelectorEditor/options/index.css +8 -0
- package/lib/MobileSelectorEditor/options/index.js +18 -0
- package/lib/MobileSelectorEditor/search/index.css +7 -0
- package/lib/MobileSelectorEditor/search/index.js +26 -0
- package/lib/MobileUpload/index.css +1 -0
- package/lib/MobileUpload/index.js +160 -0
- package/lib/MultipleSelectEditor/index.js +3 -10
- package/lib/RowExpand/index.js +19 -0
- package/lib/{RowExpandDialog → RowExpand/lg}/body/index.js +4 -4
- package/lib/{RowExpandDialog → RowExpand/lg}/column-content/index.js +2 -2
- package/lib/{RowExpandDialog → RowExpand/lg}/header/index.js +3 -3
- package/lib/{RowExpandDialog → RowExpand/lg}/index.js +6 -6
- package/lib/RowExpand/sm/body/index.css +173 -0
- package/lib/RowExpand/sm/body/index.js +111 -0
- package/lib/RowExpand/sm/column-content/index.css +27 -0
- package/lib/RowExpand/sm/column-content/index.js +25 -0
- package/lib/RowExpand/sm/index.css +0 -0
- package/lib/RowExpand/sm/index.js +172 -0
- package/lib/RowExpandEditor/RightAngle/index.css +6 -0
- package/lib/RowExpandEditor/RightAngle/index.js +17 -0
- package/lib/RowExpandEditor/RowExpandAddBtn/index.js +12 -17
- package/lib/RowExpandEditor/RowExpandAddBtn/lg/index.js +26 -0
- package/lib/RowExpandEditor/RowExpandAddBtn/sm/index.css +3 -0
- package/lib/RowExpandEditor/RowExpandAddBtn/sm/index.js +19 -0
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +10 -33
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/lg.js +42 -0
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/sm/index.css +6 -0
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/sm/index.js +39 -0
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +10 -223
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/{index.css → lg/index.css} +1 -1
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/lg/index.js +231 -0
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/sm/index.css +9 -0
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/sm/index.js +163 -0
- package/lib/RowExpandEditor/RowExpandDateEditor/index.js +10 -121
- package/lib/RowExpandEditor/RowExpandDateEditor/lg.js +130 -0
- package/lib/RowExpandEditor/RowExpandDateEditor/sm.js +84 -0
- package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +11 -96
- package/lib/RowExpandEditor/RowExpandDepartmentEditor/lg.js +101 -0
- package/lib/RowExpandEditor/RowExpandDepartmentEditor/sm.js +65 -0
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +10 -199
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/{index.css → lg/index.css} +1 -1
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/lg/index.js +208 -0
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/sm/index.css +1 -0
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/sm/index.js +130 -0
- package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +11 -97
- package/lib/RowExpandEditor/RowExpandDurationEditor/lg.js +105 -0
- package/lib/RowExpandEditor/RowExpandDurationEditor/sm.js +71 -0
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +10 -116
- package/lib/RowExpandEditor/RowExpandEmailEditor/lg/index.css +1 -0
- package/lib/RowExpandEditor/RowExpandEmailEditor/lg/index.js +125 -0
- package/lib/RowExpandEditor/RowExpandEmailEditor/sm/index.css +1 -0
- package/lib/RowExpandEditor/RowExpandEmailEditor/sm/index.js +84 -0
- package/lib/RowExpandEditor/RowExpandFileEditor/index.js +10 -139
- package/lib/RowExpandEditor/RowExpandFileEditor/lg/index.css +1 -0
- package/lib/RowExpandEditor/RowExpandFileEditor/lg/index.js +148 -0
- package/lib/RowExpandEditor/RowExpandFileEditor/sm/index.js +116 -0
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +10 -156
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/lg/index.js +164 -0
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/sm/index.css +0 -0
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/sm/index.js +101 -0
- package/lib/RowExpandEditor/RowExpandImageEditor/index.js +10 -161
- package/lib/RowExpandEditor/RowExpandImageEditor/lg/index.js +170 -0
- package/lib/RowExpandEditor/RowExpandImageEditor/sm/index.css +25 -0
- package/lib/RowExpandEditor/RowExpandImageEditor/sm/index.js +109 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +11 -115
- package/lib/RowExpandEditor/RowExpandLongTextEditor/lg/index.js +123 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/sm/editor/index.css +10 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/sm/editor/index.js +80 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/sm/index.css +3 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/sm/index.js +91 -0
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +10 -238
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/{index.css → lg/index.css} +1 -1
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/lg/index.js +247 -0
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/sm/index.css +0 -0
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/sm/index.js +155 -0
- package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +10 -96
- package/lib/RowExpandEditor/RowExpandNumberEditor/lg.js +105 -0
- package/lib/RowExpandEditor/RowExpandNumberEditor/sm/index.css +3 -0
- package/lib/RowExpandEditor/RowExpandNumberEditor/sm/index.js +76 -0
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +21 -0
- package/lib/RowExpandEditor/RowExpandRateEditor/index.js +10 -142
- package/lib/RowExpandEditor/RowExpandRateEditor/lg.js +151 -0
- package/lib/RowExpandEditor/RowExpandRateEditor/sm.js +92 -0
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +11 -198
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/lg/index.js +206 -0
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/sm/index.css +8 -0
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/sm/index.js +134 -0
- package/lib/RowExpandEditor/RowExpandTextEditor/index.js +11 -128
- package/lib/RowExpandEditor/RowExpandTextEditor/lg/index.js +136 -0
- package/lib/RowExpandEditor/RowExpandTextEditor/sm/index.css +14 -0
- package/lib/RowExpandEditor/RowExpandTextEditor/sm/index.js +37 -0
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +10 -121
- package/lib/RowExpandEditor/RowExpandUrlEditor/lg/index.js +130 -0
- package/lib/RowExpandEditor/RowExpandUrlEditor/sm/index.css +17 -0
- package/lib/RowExpandEditor/RowExpandUrlEditor/sm/index.js +87 -0
- package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +10 -18
- package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/lg.js +27 -0
- package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/sm.js +20 -0
- package/lib/RowExpandFormatter/RowExpandEmailFormatter/index.css +4 -4
- package/lib/RowExpandFormatter/RowExpandRateFormatter/index.css +1 -1
- package/lib/RowExpandFormatter/index.css +18 -18
- package/lib/RowExpandFormatter/index.js +1 -1
- package/lib/SelectItem/index.js +57 -33
- package/lib/SingleSelectEditor/index.js +3 -10
- package/lib/SvgIcon/index.js +2 -1
- package/lib/constants/file.js +1 -0
- package/lib/constants/index.js +3 -2
- package/lib/index.js +53 -4
- package/lib/locales/zh-CN.json +1 -1
- package/lib/select-editor/index.js +19 -21
- package/lib/select-editor/{pc-select-editor → lg}/index.css +1 -1
- package/lib/select-editor/{pc-select-editor → lg}/index.js +10 -10
- package/lib/select-editor/sm/index.css +1 -0
- package/lib/select-editor/sm/index.js +104 -0
- package/lib/utils/get-event-transfer.js +2 -1
- package/lib/utils/utils.js +11 -2
- package/package.json +1 -1
- 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/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/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 → lg}/index.css +0 -0
- /package/lib/{Department-editor → DepartmentEditor}/selected-departments/index.css +0 -0
- /package/lib/{Department-editor → DepartmentEditor}/selected-departments/index.js +0 -0
- /package/lib/{Department-editor → DepartmentEditor}/utils.js +0 -0
- /package/lib/DigitalSignEditor/{index.css → lg/index.css} +0 -0
- /package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/file-name-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{map-editor → lg/map-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{map-selection-editor → lg/map-selection-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{parse-geolocation.js → lg/parse-geolocation.js} +0 -0
- /package/lib/GeolocationEditor/{selector-list.js → lg/selector-list.js} +0 -0
- /package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/image-link/index.css +0 -0
- /package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/index.css +0 -0
- /package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/local-image-addition/index.css +0 -0
- /package/lib/{RowExpandDialog → RowExpand/lg}/body/index.css +0 -0
- /package/lib/{RowExpandDialog → RowExpand/lg}/column-content/index.css +0 -0
- /package/lib/{RowExpandDialog → RowExpand/lg}/header/index.css +0 -0
- /package/lib/{RowExpandDialog → RowExpand/lg}/index.css +0 -0
- /package/lib/RowExpandEditor/RowExpandAddBtn/{index.css → lg/index.css} +0 -0
- /package/lib/RowExpandEditor/RowExpandGeolocationEditor/{index.css → lg/index.css} +0 -0
- /package/lib/RowExpandEditor/RowExpandImageEditor/{index.css → lg/index.css} +0 -0
- /package/lib/RowExpandEditor/RowExpandLongTextEditor/{index.css → lg/index.css} +0 -0
- /package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/{index.css → lg/index.css} +0 -0
- /package/lib/RowExpandEditor/RowExpandTextEditor/{index.css → lg/index.css} +0 -0
- /package/lib/RowExpandEditor/RowExpandUrlEditor/{index.css → lg/index.css} +0 -0
|
@@ -0,0 +1,247 @@
|
|
|
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 _dtableUtils = require("dtable-utils");
|
|
10
|
+
var _constants = require("../../constants");
|
|
11
|
+
var _objectUtils = _interopRequireDefault(require("../../utils/object-utils"));
|
|
12
|
+
var _locationEditor = _interopRequireDefault(require("./location-editor"));
|
|
13
|
+
var _mapEditor = _interopRequireDefault(require("./map-editor"));
|
|
14
|
+
var _mapSelectionEditor = _interopRequireDefault(require("./map-selection-editor"));
|
|
15
|
+
var _countryEditor = _interopRequireDefault(require("./country-editor"));
|
|
16
|
+
var _provinceEditor = _interopRequireDefault(require("./province-editor"));
|
|
17
|
+
var _provinceCityEditor = _interopRequireDefault(require("./province-city-editor"));
|
|
18
|
+
require("./index.css");
|
|
19
|
+
class Large extends _react.default.Component {
|
|
20
|
+
constructor(_props) {
|
|
21
|
+
super(_props);
|
|
22
|
+
this.onHotKey = e => {
|
|
23
|
+
if (e.keyCode === _constants.KeyCodes.Enter && e.target.tagName !== 'TEXTAREA') {
|
|
24
|
+
this.onSubmit();
|
|
25
|
+
} else if (e.keyCode === _constants.KeyCodes.Escape) {
|
|
26
|
+
if (this.props.isInModal) {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
this.onCancel();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
this.getValue = () => {
|
|
33
|
+
return this.value;
|
|
34
|
+
};
|
|
35
|
+
this.setValue = value => {
|
|
36
|
+
this.value = value;
|
|
37
|
+
};
|
|
38
|
+
this.onSubmit = () => {
|
|
39
|
+
if (_objectUtils.default.isSameObject(this.initValue, this.value)) {
|
|
40
|
+
this.onCancel();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.props.onCommit(this.value);
|
|
44
|
+
};
|
|
45
|
+
this.onCancel = () => {
|
|
46
|
+
this.props.onToggle && this.props.onToggle();
|
|
47
|
+
};
|
|
48
|
+
this.setEditorPosition = () => {
|
|
49
|
+
const {
|
|
50
|
+
isInModal
|
|
51
|
+
} = this.props;
|
|
52
|
+
const editorFormat = this.getGeoFormat();
|
|
53
|
+
if (this.ref && (editorFormat === _dtableUtils.GEOLOCATION_FORMAT.COUNTRY_REGION || editorFormat === _dtableUtils.GEOLOCATION_FORMAT.PROVINCE)) {
|
|
54
|
+
let height = 240;
|
|
55
|
+
let width = 200;
|
|
56
|
+
let left = this.ref.parentNode.getBoundingClientRect().x;
|
|
57
|
+
let top = this.ref.parentNode.getBoundingClientRect().y;
|
|
58
|
+
if (isInModal) {
|
|
59
|
+
left = 220;
|
|
60
|
+
}
|
|
61
|
+
if (top + height > window.innerHeight) {
|
|
62
|
+
top = window.innerHeight - height - 35;
|
|
63
|
+
}
|
|
64
|
+
this.setState({
|
|
65
|
+
editorPosition: {
|
|
66
|
+
top,
|
|
67
|
+
left,
|
|
68
|
+
width,
|
|
69
|
+
zIndex: 1000,
|
|
70
|
+
position: 'fixed'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (this.ref && editorFormat === _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY) {
|
|
76
|
+
let height = 215;
|
|
77
|
+
let width = 400;
|
|
78
|
+
let left = this.ref.parentNode.getBoundingClientRect().x;
|
|
79
|
+
let top = this.ref.parentNode.getBoundingClientRect().y;
|
|
80
|
+
if (isInModal) {
|
|
81
|
+
left = 220;
|
|
82
|
+
if (top + height + 35 + 200 > window.innerHeight) {
|
|
83
|
+
top = window.innerHeight - height - 235;
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
if (top + height + 200 > window.innerHeight) {
|
|
87
|
+
top = window.innerHeight - height - 200 - 5;
|
|
88
|
+
}
|
|
89
|
+
if (left + width > window.innerWidth) {
|
|
90
|
+
left = window.innerWidth - width - 10;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
this.setState({
|
|
94
|
+
editorPosition: {
|
|
95
|
+
top,
|
|
96
|
+
left,
|
|
97
|
+
width,
|
|
98
|
+
zIndex: 1000,
|
|
99
|
+
position: 'fixed'
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (this.ref) {
|
|
105
|
+
const isMapTypeEditor = editorFormat === _dtableUtils.GEOLOCATION_FORMAT.LNG_LAT || editorFormat === _dtableUtils.GEOLOCATION_FORMAT.MAP_SELECTION;
|
|
106
|
+
let width = isMapTypeEditor ? 500 : 400;
|
|
107
|
+
let height = isMapTypeEditor ? 454 : 310;
|
|
108
|
+
let geoEditorTop = 0;
|
|
109
|
+
let geoEditorLeft = 0;
|
|
110
|
+
if (isInModal) {
|
|
111
|
+
let innerHeight = window.innerHeight;
|
|
112
|
+
const offsetTop = this.ref.parentNode.getBoundingClientRect().y;
|
|
113
|
+
geoEditorTop = offsetTop;
|
|
114
|
+
geoEditorTop = height + geoEditorTop > innerHeight ? innerHeight - height - 30 : geoEditorTop;
|
|
115
|
+
geoEditorLeft = -30;
|
|
116
|
+
} else {
|
|
117
|
+
let {
|
|
118
|
+
offsetLeft,
|
|
119
|
+
offsetTop
|
|
120
|
+
} = this.ref.parentNode;
|
|
121
|
+
geoEditorLeft = offsetLeft - width;
|
|
122
|
+
geoEditorTop = offsetTop;
|
|
123
|
+
if (offsetLeft < width) {
|
|
124
|
+
geoEditorLeft = offsetLeft + this.props.column.width;
|
|
125
|
+
}
|
|
126
|
+
if (geoEditorLeft + width > window.innerWidth) {
|
|
127
|
+
geoEditorLeft = window.innerWidth - width;
|
|
128
|
+
}
|
|
129
|
+
if (offsetTop + height > window.innerHeight) {
|
|
130
|
+
geoEditorTop = window.innerHeight - height;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
this.setState({
|
|
134
|
+
editorPosition: {
|
|
135
|
+
top: geoEditorTop,
|
|
136
|
+
left: geoEditorLeft,
|
|
137
|
+
zIndex: 1000,
|
|
138
|
+
position: 'fixed'
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
this.getGeoFormat = () => {
|
|
144
|
+
const {
|
|
145
|
+
column
|
|
146
|
+
} = this.props;
|
|
147
|
+
let data = column.data || {};
|
|
148
|
+
return data.geo_format ? data.geo_format : _dtableUtils.DEFAULT_GEOLOCATION_FORMAT;
|
|
149
|
+
};
|
|
150
|
+
this.getLargeEditorState = () => {
|
|
151
|
+
var _this$editor, _this$editor$state;
|
|
152
|
+
return (_this$editor = this.editor) === null || _this$editor === void 0 ? void 0 : (_this$editor$state = _this$editor.state) === null || _this$editor$state === void 0 ? void 0 : _this$editor$state.isShowLargeEditor;
|
|
153
|
+
};
|
|
154
|
+
this.createEditor = () => {
|
|
155
|
+
const geoFormat = this.getGeoFormat();
|
|
156
|
+
const {
|
|
157
|
+
config,
|
|
158
|
+
column,
|
|
159
|
+
getCountryData,
|
|
160
|
+
getLocationData
|
|
161
|
+
} = this.props;
|
|
162
|
+
const props = {
|
|
163
|
+
column,
|
|
164
|
+
config,
|
|
165
|
+
value: this.value,
|
|
166
|
+
setValue: this.setValue,
|
|
167
|
+
onSubmit: this.onSubmit,
|
|
168
|
+
onCancel: this.onCancel
|
|
169
|
+
};
|
|
170
|
+
switch (geoFormat) {
|
|
171
|
+
case _dtableUtils.GEOLOCATION_FORMAT.LNG_LAT:
|
|
172
|
+
{
|
|
173
|
+
return /*#__PURE__*/_react.default.createElement(_mapEditor.default, Object.assign({}, props, {
|
|
174
|
+
ref: ref => this.editor = ref
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
case _dtableUtils.GEOLOCATION_FORMAT.MAP_SELECTION:
|
|
178
|
+
{
|
|
179
|
+
return /*#__PURE__*/_react.default.createElement(_mapSelectionEditor.default, Object.assign({}, props, {
|
|
180
|
+
ref: ref => this.editor = ref
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
case _dtableUtils.GEOLOCATION_FORMAT.COUNTRY_REGION:
|
|
184
|
+
{
|
|
185
|
+
return /*#__PURE__*/_react.default.createElement(_countryEditor.default, Object.assign({}, props, {
|
|
186
|
+
getData: getCountryData,
|
|
187
|
+
ref: ref => this.editor = ref
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE:
|
|
191
|
+
{
|
|
192
|
+
return /*#__PURE__*/_react.default.createElement(_provinceEditor.default, Object.assign({}, props, {
|
|
193
|
+
onPressTab: this.props.onPressTab,
|
|
194
|
+
getData: getLocationData,
|
|
195
|
+
ref: ref => this.editor = ref
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY:
|
|
199
|
+
{
|
|
200
|
+
return /*#__PURE__*/_react.default.createElement(_provinceCityEditor.default, Object.assign({}, props, {
|
|
201
|
+
getData: getLocationData,
|
|
202
|
+
ref: ref => this.editor = ref
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY_DISTRICT:
|
|
206
|
+
{
|
|
207
|
+
return /*#__PURE__*/_react.default.createElement(_locationEditor.default, Object.assign({}, props, {
|
|
208
|
+
getData: getLocationData,
|
|
209
|
+
ref: ref => this.editor = ref
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
default:
|
|
213
|
+
{
|
|
214
|
+
return /*#__PURE__*/_react.default.createElement(_locationEditor.default, Object.assign({}, props, {
|
|
215
|
+
isShowDetails: true,
|
|
216
|
+
getData: getLocationData,
|
|
217
|
+
ref: ref => this.editor = ref
|
|
218
|
+
}));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
this.value = _props.value || {};
|
|
223
|
+
this.initValue = this.value;
|
|
224
|
+
this.state = {
|
|
225
|
+
editorPosition: null
|
|
226
|
+
};
|
|
227
|
+
this.editor = null;
|
|
228
|
+
}
|
|
229
|
+
componentDidMount() {
|
|
230
|
+
this.setEditorPosition();
|
|
231
|
+
document.addEventListener('keydown', this.onHotKey, true);
|
|
232
|
+
}
|
|
233
|
+
componentWillUnmount() {
|
|
234
|
+
document.removeEventListener('keydown', this.onHotKey, true);
|
|
235
|
+
}
|
|
236
|
+
render() {
|
|
237
|
+
const {
|
|
238
|
+
editorPosition
|
|
239
|
+
} = this.state;
|
|
240
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
241
|
+
ref: ref => this.ref = ref,
|
|
242
|
+
style: editorPosition,
|
|
243
|
+
className: "dtable-ui-dtable-ui-geolocation-editor"
|
|
244
|
+
}, this.createEditor());
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
var _default = exports.default = Large;
|
|
@@ -8,13 +8,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _DTableCustomFooter = _interopRequireDefault(require("
|
|
11
|
+
var _DTableCustomFooter = _interopRequireDefault(require("../../DTableCustomFooter"));
|
|
12
12
|
var _selectorList = _interopRequireDefault(require("./selector-list"));
|
|
13
13
|
var _selectorHeaderItem = _interopRequireDefault(require("./selector-header-item"));
|
|
14
|
-
var _constants = require("
|
|
15
|
-
var _Loading = _interopRequireDefault(require("
|
|
14
|
+
var _constants = require("../../constants");
|
|
15
|
+
var _Loading = _interopRequireDefault(require("../../Loading"));
|
|
16
16
|
var _parseGeolocation = _interopRequireDefault(require("./parse-geolocation"));
|
|
17
|
-
var _lang = require("
|
|
17
|
+
var _lang = require("../../lang");
|
|
18
18
|
class LocationEditor extends _react.Component {
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
@@ -62,21 +62,6 @@ class LocationEditor extends _react.Component {
|
|
|
62
62
|
selectedItem: 'county'
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
this.getLocationData = () => {
|
|
66
|
-
const {
|
|
67
|
-
mediaUrl
|
|
68
|
-
} = window.dtable;
|
|
69
|
-
|
|
70
|
-
// get locations from server
|
|
71
|
-
return fetch("".concat(mediaUrl, "geo-data/cn-location.json")).then(res => {
|
|
72
|
-
return res.json();
|
|
73
|
-
}).catch(() => {
|
|
74
|
-
// get locations from local
|
|
75
|
-
return fetch('./geo-data/cn-location.json').then(res => {
|
|
76
|
-
return res.json();
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
65
|
this.onKeyDown = e => {
|
|
81
66
|
e.stopPropagation();
|
|
82
67
|
e.nativeEvent.stopImmediatePropagation();
|
|
@@ -217,26 +202,8 @@ class LocationEditor extends _react.Component {
|
|
|
217
202
|
this.timer = null;
|
|
218
203
|
}
|
|
219
204
|
UNSAFE_componentWillMount() {
|
|
220
|
-
|
|
221
|
-
this.
|
|
222
|
-
this.locations = data;
|
|
223
|
-
window.app.location = data;
|
|
224
|
-
const {
|
|
225
|
-
selectedProvince,
|
|
226
|
-
selectedCity,
|
|
227
|
-
selectedCounty,
|
|
228
|
-
selectedItem
|
|
229
|
-
} = this.initLocationSelecting(this.value);
|
|
230
|
-
this.setState({
|
|
231
|
-
isLoadingData: false,
|
|
232
|
-
selectedProvince,
|
|
233
|
-
selectedCity,
|
|
234
|
-
selectedCounty,
|
|
235
|
-
selectedItem
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
} else {
|
|
239
|
-
this.locations = window.app.location;
|
|
205
|
+
this.props.getData().then(data => {
|
|
206
|
+
this.locations = data;
|
|
240
207
|
const {
|
|
241
208
|
selectedProvince,
|
|
242
209
|
selectedCity,
|
|
@@ -250,7 +217,7 @@ class LocationEditor extends _react.Component {
|
|
|
250
217
|
selectedCounty,
|
|
251
218
|
selectedItem
|
|
252
219
|
});
|
|
253
|
-
}
|
|
220
|
+
});
|
|
254
221
|
}
|
|
255
222
|
render() {
|
|
256
223
|
const {
|
|
@@ -315,7 +282,7 @@ class LocationEditor extends _react.Component {
|
|
|
315
282
|
parent: selectedCity,
|
|
316
283
|
selectedItem: selectedCounty,
|
|
317
284
|
clickHandler: this.selectCounty
|
|
318
|
-
})))), this.props.
|
|
285
|
+
})))), this.props.isShowDetails && /*#__PURE__*/_react.default.createElement("div", {
|
|
319
286
|
className: "dtable-ui-geolocation-editor-item dtable-ui-geolocation-editor-detail"
|
|
320
287
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
321
288
|
className: "dtable-ui-geolocation-editor-item-left"
|
|
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _toaster = _interopRequireDefault(require("
|
|
11
|
-
var _Loading = _interopRequireDefault(require("
|
|
12
|
-
var _constants = require("
|
|
13
|
-
var _cell = require("
|
|
14
|
-
var _mapEditorUtils = require("
|
|
10
|
+
var _toaster = _interopRequireDefault(require("../../../toaster"));
|
|
11
|
+
var _Loading = _interopRequireDefault(require("../../../Loading"));
|
|
12
|
+
var _constants = require("../../../constants");
|
|
13
|
+
var _cell = require("../../../utils/cell");
|
|
14
|
+
var _mapEditorUtils = require("../../map-editor-utils");
|
|
15
15
|
var _largeEditor = _interopRequireDefault(require("./large-editor"));
|
|
16
|
-
var _lang = require("
|
|
16
|
+
var _lang = require("../../../lang");
|
|
17
17
|
class MapEditor extends _react.Component {
|
|
18
18
|
constructor(props) {
|
|
19
19
|
super(props);
|
|
@@ -7,12 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactstrap = require("reactstrap");
|
|
10
|
-
var _toaster = _interopRequireDefault(require("
|
|
11
|
-
var _Loading = _interopRequireDefault(require("
|
|
12
|
-
var _constants = require("
|
|
13
|
-
var _cell = require("
|
|
14
|
-
var _mapEditorUtils = require("
|
|
15
|
-
var _lang = require("
|
|
10
|
+
var _toaster = _interopRequireDefault(require("../../../../toaster"));
|
|
11
|
+
var _Loading = _interopRequireDefault(require("../../../../Loading"));
|
|
12
|
+
var _constants = require("../../../../constants");
|
|
13
|
+
var _cell = require("../../../../utils/cell");
|
|
14
|
+
var _mapEditorUtils = require("../../../map-editor-utils");
|
|
15
|
+
var _lang = require("../../../../lang");
|
|
16
16
|
require("./index.css");
|
|
17
17
|
class LargeMapEditorDialog extends _react.default.Component {
|
|
18
18
|
constructor(props) {
|
|
@@ -427,7 +427,7 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
427
427
|
}, (0, _lang.getLocale)('Submit'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
428
428
|
className: this.readOnly ? 'geolocation-map-read-only-container' : 'geolocation-map-container-large'
|
|
429
429
|
}, this.mapType && isLoading && /*#__PURE__*/_react.default.createElement(_Loading.default, null), !this.mapType && /*#__PURE__*/_react.default.createElement("div", {
|
|
430
|
-
className: "error-message d-flex justify-content-center mt-9"
|
|
430
|
+
className: "dtable-ui-geolocation-map-editor-error-message d-flex justify-content-center mt-9"
|
|
431
431
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
432
432
|
className: "alert-danger"
|
|
433
433
|
}, (0, _lang.getLocale)('The_map_plugin_is_not_properly_configured_contact_the_administrator'))), !isLoading && this.mapType && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -8,13 +8,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _dtableUtils = require("dtable-utils");
|
|
11
|
-
var _toaster = _interopRequireDefault(require("
|
|
12
|
-
var _Loading = _interopRequireDefault(require("
|
|
13
|
-
var _constants = require("
|
|
14
|
-
var _cell = require("
|
|
15
|
-
var _mapEditorUtils = require("
|
|
11
|
+
var _toaster = _interopRequireDefault(require("../../../toaster"));
|
|
12
|
+
var _Loading = _interopRequireDefault(require("../../../Loading"));
|
|
13
|
+
var _constants = require("../../../constants");
|
|
14
|
+
var _cell = require("../../../utils/cell");
|
|
15
|
+
var _mapEditorUtils = require("../../map-editor-utils");
|
|
16
16
|
var _largeEditor = _interopRequireDefault(require("./large-editor"));
|
|
17
|
-
var _lang = require("
|
|
17
|
+
var _lang = require("../../../lang");
|
|
18
18
|
class MapSelectionEditor extends _react.Component {
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
@@ -421,7 +421,7 @@ class MapSelectionEditor extends _react.Component {
|
|
|
421
421
|
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
422
422
|
className: this.readOnly ? 'geolocation-map-selection-read-only-container' : 'geolocation-map-selection-container'
|
|
423
423
|
}, this.mapType && isLoading && /*#__PURE__*/_react.default.createElement(_Loading.default, null), !this.mapType && /*#__PURE__*/_react.default.createElement("div", {
|
|
424
|
-
className: "error-message d-flex justify-content-center mt-9"
|
|
424
|
+
className: "dtable-ui-geolocation-map-editor-error-message d-flex justify-content-center mt-9"
|
|
425
425
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
426
426
|
className: "alert-danger"
|
|
427
427
|
}, (0, _lang.getLocale)('The_map_plugin_is_not_properly_configured_contact_the_administrator'))), !isLoading && this.mapType && /*#__PURE__*/_react.default.createElement("div", {
|
package/lib/GeolocationEditor/{map-selection-editor → lg/map-selection-editor}/large-editor/index.js
RENAMED
|
@@ -8,12 +8,12 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactstrap = require("reactstrap");
|
|
10
10
|
var _dtableUtils = require("dtable-utils");
|
|
11
|
-
var _toaster = _interopRequireDefault(require("
|
|
12
|
-
var _Loading = _interopRequireDefault(require("
|
|
13
|
-
var _constants = require("
|
|
14
|
-
var _cell = require("
|
|
15
|
-
var _mapEditorUtils = require("
|
|
16
|
-
var _lang = require("
|
|
11
|
+
var _toaster = _interopRequireDefault(require("../../../../toaster"));
|
|
12
|
+
var _Loading = _interopRequireDefault(require("../../../../Loading"));
|
|
13
|
+
var _constants = require("../../../../constants");
|
|
14
|
+
var _cell = require("../../../../utils/cell");
|
|
15
|
+
var _mapEditorUtils = require("../../../map-editor-utils");
|
|
16
|
+
var _lang = require("../../../../lang");
|
|
17
17
|
require("./index.css");
|
|
18
18
|
class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
19
19
|
constructor(props) {
|
|
@@ -413,7 +413,7 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
413
413
|
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
414
414
|
className: this.readOnly ? 'geolocation-map-read-only-container' : 'geolocation-map-container-large'
|
|
415
415
|
}, this.mapType && isLoading && /*#__PURE__*/_react.default.createElement(_Loading.default, null), !this.mapType && /*#__PURE__*/_react.default.createElement("div", {
|
|
416
|
-
className: "error-message d-flex justify-content-center mt-9"
|
|
416
|
+
className: "dtable-ui-geolocation-map-editor-error-message d-flex justify-content-center mt-9"
|
|
417
417
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
418
418
|
className: "alert-danger"
|
|
419
419
|
}, (0, _lang.getLocale)('The_map_plugin_is_not_properly_configured_contact_the_administrator'))), !isLoading && this.mapType && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -8,13 +8,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _DTableCustomFooter = _interopRequireDefault(require("
|
|
11
|
+
var _DTableCustomFooter = _interopRequireDefault(require("../../DTableCustomFooter"));
|
|
12
12
|
var _selectorList = _interopRequireDefault(require("./selector-list"));
|
|
13
13
|
var _selectorHeaderItem = _interopRequireDefault(require("./selector-header-item"));
|
|
14
|
-
var _Loading = _interopRequireDefault(require("
|
|
14
|
+
var _Loading = _interopRequireDefault(require("../../Loading"));
|
|
15
15
|
var _parseGeolocation = _interopRequireDefault(require("./parse-geolocation"));
|
|
16
|
-
var _constants = require("
|
|
17
|
-
var _lang = require("
|
|
16
|
+
var _constants = require("../../constants");
|
|
17
|
+
var _lang = require("../../lang");
|
|
18
18
|
class ProvinceCityEditor extends _react.Component {
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
@@ -50,21 +50,6 @@ class ProvinceCityEditor extends _react.Component {
|
|
|
50
50
|
selectedItem: 'city'
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
this.getLocationData = () => {
|
|
54
|
-
const {
|
|
55
|
-
mediaUrl
|
|
56
|
-
} = window.dtable;
|
|
57
|
-
|
|
58
|
-
// get locations from server
|
|
59
|
-
return fetch("".concat(mediaUrl, "geo-data/cn-location.json")).then(res => {
|
|
60
|
-
return res.json();
|
|
61
|
-
}).catch(() => {
|
|
62
|
-
// get locations from local
|
|
63
|
-
return fetch('./geo-data/cn-location.json').then(res => {
|
|
64
|
-
return res.json();
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
53
|
this.onToggleSelector = () => {
|
|
69
54
|
this.setState({
|
|
70
55
|
isShowSelector: !this.state.isShowSelector,
|
|
@@ -174,24 +159,8 @@ class ProvinceCityEditor extends _react.Component {
|
|
|
174
159
|
this.isComposing = false;
|
|
175
160
|
}
|
|
176
161
|
componentDidMount() {
|
|
177
|
-
|
|
178
|
-
this.
|
|
179
|
-
this.locations = data;
|
|
180
|
-
window.app.location = data;
|
|
181
|
-
const {
|
|
182
|
-
selectedProvince,
|
|
183
|
-
selectedCity,
|
|
184
|
-
selectedItem
|
|
185
|
-
} = this.initLocationSelecting(this.value);
|
|
186
|
-
this.setState({
|
|
187
|
-
isLoadingData: false,
|
|
188
|
-
selectedProvince,
|
|
189
|
-
selectedCity,
|
|
190
|
-
selectedItem
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
} else {
|
|
194
|
-
this.locations = window.app.location;
|
|
162
|
+
this.props.getData().then(data => {
|
|
163
|
+
this.locations = data;
|
|
195
164
|
const {
|
|
196
165
|
selectedProvince,
|
|
197
166
|
selectedCity,
|
|
@@ -203,7 +172,7 @@ class ProvinceCityEditor extends _react.Component {
|
|
|
203
172
|
selectedCity,
|
|
204
173
|
selectedItem
|
|
205
174
|
});
|
|
206
|
-
}
|
|
175
|
+
});
|
|
207
176
|
}
|
|
208
177
|
render() {
|
|
209
178
|
const {
|
|
@@ -7,28 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _DTableSearchInput = _interopRequireDefault(require("
|
|
11
|
-
var _constants = require("
|
|
12
|
-
var _Loading = _interopRequireDefault(require("
|
|
13
|
-
var _lang = require("
|
|
10
|
+
var _DTableSearchInput = _interopRequireDefault(require("../../DTableSearchInput"));
|
|
11
|
+
var _constants = require("../../constants");
|
|
12
|
+
var _Loading = _interopRequireDefault(require("../../Loading"));
|
|
13
|
+
var _lang = require("../../lang");
|
|
14
14
|
class ProvinceEditor extends _react.Component {
|
|
15
15
|
constructor(props) {
|
|
16
16
|
super(props);
|
|
17
|
-
this.getLocationData = () => {
|
|
18
|
-
// mediaUrl
|
|
19
|
-
const {
|
|
20
|
-
mediaUrl
|
|
21
|
-
} = window.dtable;
|
|
22
|
-
// get locations from server
|
|
23
|
-
return fetch("".concat(mediaUrl, "geo-data/cn-location.json")).then(res => {
|
|
24
|
-
return res.json();
|
|
25
|
-
}).catch(() => {
|
|
26
|
-
// get locations from local
|
|
27
|
-
return fetch('./geo-data/cn-location.json').then(res => {
|
|
28
|
-
return res.json();
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
17
|
this.onHotKey = e => {
|
|
33
18
|
if (e.keyCode === _constants.KeyCodes.Enter) {
|
|
34
19
|
this.onEnter(e);
|
|
@@ -179,22 +164,13 @@ class ProvinceEditor extends _react.Component {
|
|
|
179
164
|
this.itemHeight = 30;
|
|
180
165
|
}
|
|
181
166
|
componentDidMount() {
|
|
182
|
-
|
|
183
|
-
this.
|
|
184
|
-
this.locations = data;
|
|
185
|
-
window.app.location = data;
|
|
186
|
-
this.filteredProvince = this.locations.children;
|
|
187
|
-
this.setState({
|
|
188
|
-
isLoadingData: false
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
} else {
|
|
192
|
-
this.locations = window.app.location;
|
|
167
|
+
this.props.getData().then(data => {
|
|
168
|
+
this.locations = data;
|
|
193
169
|
this.filteredProvince = this.locations.children;
|
|
194
170
|
this.setState({
|
|
195
171
|
isLoadingData: false
|
|
196
172
|
});
|
|
197
|
-
}
|
|
173
|
+
});
|
|
198
174
|
document.addEventListener('keydown', this.onHotKey, true);
|
|
199
175
|
}
|
|
200
176
|
componentWillUnmount() {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _lang = require("
|
|
9
|
+
var _lang = require("../../lang");
|
|
10
10
|
class SelectorHeaderItem extends _react.default.Component {
|
|
11
11
|
render() {
|
|
12
12
|
const {
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.locateCurrentPosition = exports.loadMapSource = exports.getMineMapUrl = exports.getMapInfo = exports.getInitCenter = exports.MAP_TYPES = exports.DOMESTIC_MAP_TYPE = void 0;
|
|
6
|
+
exports.locateCurrentPosition = exports.loadMapSource = exports.getMineMapUrl = exports.getMapInfo = exports.getInitCenter = exports.MAP_TYPES = exports.INPUT_MODE_MAP = exports.DOMESTIC_MAP_TYPE = void 0;
|
|
7
|
+
const INPUT_MODE_MAP = exports.INPUT_MODE_MAP = {
|
|
8
|
+
ANY_LOCATION: 'any_location',
|
|
9
|
+
ONLY_MOBILE_POSITIONING: 'only_mobile_positioning'
|
|
10
|
+
};
|
|
7
11
|
const MAP_TYPES = exports.MAP_TYPES = {
|
|
8
12
|
B_MAP: 'b_map',
|
|
9
13
|
// baidu
|
|
@@ -99,7 +103,7 @@ const loadMapSource = (mapType, mapKey, callback) => {
|
|
|
99
103
|
let script = document.createElement('script');
|
|
100
104
|
script.type = 'text/javascript';
|
|
101
105
|
if (mapType === MAP_TYPES.B_MAP) {
|
|
102
|
-
scriptUrl = "https://api.map.baidu.com/api?v=3.0&ak=".concat(mapKey, "
|
|
106
|
+
scriptUrl = "https://api.map.baidu.com/api?v=3.0&ak=".concat(mapKey, "&callback=renderBaiduMap");
|
|
103
107
|
} else if (mapType === MAP_TYPES.G_MAP) {
|
|
104
108
|
scriptUrl = "https://maps.googleapis.com/maps/api/js?key=".concat(mapKey, "&callback=renderGoogleMap&libraries=&v=weekly");
|
|
105
109
|
} else {
|