dtable-ui-component 6.0.125 → 6.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ActionSheet/index.js +14 -16
- package/lib/ActivityIndicator/index.js +7 -8
- package/lib/AsyncUserSelect/index.css +5 -0
- package/lib/AsyncUserSelect/index.js +40 -19
- package/lib/AsyncUserSelect/user-item.js +5 -6
- package/lib/AutoNumberFormatter/index.js +3 -4
- package/lib/Badge/index.js +9 -11
- package/lib/ButtonFormatter/index.js +6 -8
- package/lib/CTimeFormatter/index.js +3 -4
- package/lib/CheckboxEditor/index.js +1 -3
- package/lib/CheckboxEditor/mb-editor.js +9 -20
- package/lib/CheckboxEditor/pc-editor.js +12 -24
- package/lib/CheckboxFormatter/index.js +4 -5
- package/lib/CollaboratorEditor/index.js +2 -4
- package/lib/CollaboratorEditor/mb-editor/index.js +11 -19
- package/lib/CollaboratorEditor/pc-editor/index.js +25 -34
- package/lib/CollaboratorFormatter/index.js +8 -10
- package/lib/CollaboratorItem/index.js +4 -5
- package/lib/CollapsibleSettingLayout/index.js +9 -7
- package/lib/Comment/body/comment.js +10 -18
- package/lib/Comment/body/index.js +2 -4
- package/lib/Comment/footer/btns/index.js +4 -7
- package/lib/Comment/footer/index.js +9 -20
- package/lib/Comment/footer/input/index.js +29 -50
- package/lib/Comment/footer/input/participant/index.js +4 -5
- package/lib/Comment/footer/participants/index.js +4 -5
- package/lib/Comment/footer/participants/participant/index.js +1 -3
- package/lib/Comment/footer/participants/participant-select/index.js +8 -24
- package/lib/Comment/index.js +39 -57
- package/lib/Comment/utils/utilities.js +15 -21
- package/lib/CreatorFormatter/index.js +6 -8
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +23 -19
- package/lib/DTableColorPicker/index.css +0 -2
- package/lib/DTableColorPicker/index.js +56 -41
- package/lib/DTableColorPicker/utils.js +4 -6
- package/lib/DTableColumnIcon/index.js +6 -7
- package/lib/DTableCommonAddTool/index.css +1 -3
- package/lib/DTableCommonAddTool/index.js +6 -8
- package/lib/DTableCustomFooter/index.css +1 -3
- package/lib/DTableCustomFooter/index.js +1 -3
- package/lib/DTableCustomizeCollaboratorSelect/index.js +17 -20
- package/lib/DTableCustomizeSelect/index.js +19 -24
- package/lib/DTableDropdownItem/index.js +16 -18
- package/lib/DTableDropdownMenu/index.js +8 -10
- package/lib/DTableEmptyTip/index.js +4 -5
- package/lib/DTableFiltersPopover/index.css +0 -2
- package/lib/DTableFiltersPopover/index.js +26 -41
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +1 -3
- package/lib/DTableFiltersPopover/utils/index.js +63 -113
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +8 -9
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +16 -13
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +18 -15
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +8 -14
- package/lib/DTableFiltersPopover/widgets/filter-group.js +34 -55
- package/lib/DTableFiltersPopover/widgets/filter-item.js +107 -170
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +136 -161
- package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
- package/lib/DTableGroupSelect/index.js +11 -15
- package/lib/DTableGroupSelect/select-option-group.js +23 -32
- package/lib/DTableIcon/index.js +6 -7
- package/lib/DTableIcon/svg-icon.js +5 -7
- package/lib/DTableModalHeader/index.js +1 -3
- package/lib/DTablePopover/index.js +13 -16
- package/lib/DTableRadio/index.js +10 -9
- package/lib/DTableRadioGroup/index.js +8 -17
- package/lib/DTableSearchInput/index.js +19 -29
- package/lib/DTableSelect/dtable-select-label.js +6 -5
- package/lib/DTableSelect/index.js +21 -22
- package/lib/DTableSelect/utils.js +7 -15
- package/lib/DTableSubDropdownMenu/index.js +8 -10
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.css +0 -1
- package/lib/DTableSwitch/index.js +12 -11
- package/lib/DTableToolTip/index.js +7 -8
- package/lib/DateEditor/index.js +20 -15
- package/lib/DateEditor/mb-editor/index.js +18 -31
- package/lib/DateEditor/pc-editor.js +26 -45
- package/lib/DateFormatter/index.js +4 -5
- package/lib/DatePicker/index.js +9 -15
- package/lib/DatePicker/utils.js +1 -3
- package/lib/DeleteTip/index.js +5 -6
- package/lib/DepartmentMultipleSelectEditor/index.js +25 -23
- package/lib/DepartmentSelectFilter/index.js +6 -8
- package/lib/DepartmentSingleSelectEditor/index.js +1 -3
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +48 -47
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +36 -58
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -19
- package/lib/DepartmentSingleSelectFormatter/index.js +4 -6
- package/lib/DigitalSignEditor/index.js +1 -3
- package/lib/DigitalSignEditor/mb-editor/index.js +12 -20
- package/lib/DigitalSignEditor/pc-editor/index.js +17 -24
- package/lib/DigitalSignEditor/service.js +2 -4
- package/lib/DigitalSignEditor/signature-board/index.js +5 -8
- package/lib/DigitalSignEditor/utils.js +2 -4
- package/lib/DigitalSignFormatter/index.js +12 -15
- package/lib/DigitalSignFormatter/utils.js +4 -5
- package/lib/DurationEditor/index.js +21 -31
- package/lib/DurationFormatter/index.js +4 -5
- package/lib/EditEditorButton/index.js +1 -3
- package/lib/EmailFormatter/index.js +3 -4
- package/lib/FieldDisplaySetting/field-item.js +12 -12
- package/lib/FieldDisplaySetting/index.js +11 -9
- package/lib/FileEditor/files-previewer/index.js +1 -3
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +10 -18
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +7 -8
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +3 -4
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +5 -6
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +14 -21
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +29 -57
- package/lib/FileEditor/index.js +1 -3
- package/lib/FileEditor/mb-editor/index.js +28 -20
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +11 -25
- package/lib/FileEditor/pc-editor/index.js +19 -27
- package/lib/FileFormatter/index.js +26 -19
- package/lib/FileItemFormatter/index.js +6 -9
- package/lib/FileUploader/index.js +28 -45
- package/lib/FormulaFormatter/index.js +15 -29
- package/lib/GeolocationEditor/index.js +11 -12
- package/lib/GeolocationEditor/map-editor-utils.js +17 -15
- package/lib/GeolocationEditor/mb-editor/country-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/index.js +4 -6
- package/lib/GeolocationEditor/mb-editor/location-editor.js +18 -15
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +41 -68
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +50 -89
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/province-editor.js +17 -14
- package/lib/GeolocationEditor/pc-editor/country-editor.js +10 -23
- package/lib/GeolocationEditor/pc-editor/index.js +12 -20
- package/lib/GeolocationEditor/pc-editor/location-editor.js +26 -31
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +34 -54
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +36 -60
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +35 -62
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +36 -65
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +19 -25
- package/lib/GeolocationEditor/pc-editor/province-editor.js +6 -13
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +5 -6
- package/lib/GeolocationEditor/pc-editor/selector-list.js +6 -7
- package/lib/GeolocationFormatter/index.js +4 -5
- package/lib/HtmlLongTextFormatter/index.js +4 -12
- package/lib/Icon/index.js +3 -5
- package/lib/IconButton/index.js +4 -6
- package/lib/ImageEditor/images-previewer/image-preview/index.js +12 -21
- package/lib/ImageEditor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/index.js +1 -3
- package/lib/ImageEditor/mb-editor/index.js +28 -20
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +2 -6
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +7 -21
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/pc-editor/index.js +11 -16
- package/lib/ImageFormatter/images-lazy-load.js +19 -11
- package/lib/ImageFormatter/index.js +11 -13
- package/lib/ImagePreviewerLightbox/index.js +15 -13
- package/lib/ImageThumbnail/index.js +10 -13
- package/lib/InputItem/custom-input.js +26 -46
- package/lib/InputItem/custom-keyboard.js +15 -18
- package/lib/InputItem/index.js +34 -50
- package/lib/InputItem/input.js +2 -4
- package/lib/LastModifierFormatter/index.js +6 -8
- package/lib/LinkEditor/index.js +33 -53
- package/lib/LinkEditor/link-editor-option.js +3 -4
- package/lib/LinkEditor/mb-popover/index.js +9 -22
- package/lib/LinkEditor/pc-popover/index.js +5 -10
- package/lib/LinkFormatter/index.js +21 -37
- package/lib/List/index.js +6 -8
- package/lib/List/list-item.js +22 -28
- package/lib/LongTextFormatter/index.js +4 -5
- package/lib/MBEditorHeader/index.js +7 -8
- package/lib/MTimeFormatter/index.js +3 -4
- package/lib/MobileFullScreenPage/body/index.js +3 -5
- package/lib/MobileFullScreenPage/header/index.js +4 -6
- package/lib/MobileFullScreenPage/index.js +13 -11
- package/lib/MobileModal/index.js +1 -3
- package/lib/MobileOperationSheet/index.js +7 -8
- package/lib/MobileSelector/empty/index.js +1 -3
- package/lib/MobileSelector/index.js +5 -7
- package/lib/MobileSelector/option/index.js +3 -5
- package/lib/MobileSelector/options/index.js +1 -3
- package/lib/MobileSelector/search/index.js +3 -5
- package/lib/MobileUpload/index.js +4 -5
- package/lib/Modal/modal.js +14 -15
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +1 -3
- package/lib/MultipleSelectFormatter/index.js +6 -8
- package/lib/NotificationPopover/index.css +1 -6
- package/lib/NotificationPopover/index.js +6 -7
- package/lib/NumberEditor/index.js +12 -21
- package/lib/NumberFormatter/index.js +4 -5
- package/lib/PhoneNumberLink/index.js +2 -4
- package/lib/Picker/AbstractPicker.js +23 -27
- package/lib/Popover/index.js +3 -4
- package/lib/Popover/item.js +7 -9
- package/lib/Progress/index.js +9 -8
- package/lib/Radio/Radio.js +4 -8
- package/lib/Radio/RadioItem.js +8 -12
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +18 -17
- package/lib/RowExpandDialog/body/index.js +32 -49
- package/lib/RowExpandDialog/column-content/index.js +5 -9
- package/lib/RowExpandDialog/header/index.js +6 -8
- package/lib/RowExpandDialog/index.js +49 -34
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +8 -10
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +22 -33
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +26 -40
- package/lib/RowExpandEditor/date-editor/mb-editor.js +12 -18
- package/lib/RowExpandEditor/date-editor/pc-editor.js +15 -20
- package/lib/RowExpandEditor/department-editor/mb-editor.js +16 -11
- package/lib/RowExpandEditor/department-editor/pc-editor.js +19 -14
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +20 -34
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +21 -35
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +10 -17
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +13 -19
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +9 -19
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +13 -24
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +18 -31
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +17 -29
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +13 -26
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +15 -25
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +13 -23
- package/lib/RowExpandEditor/index.js +4 -8
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +17 -18
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +10 -16
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +11 -19
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +22 -33
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +8 -14
- package/lib/RowExpandEditor/number-editor/pc-editor.js +13 -20
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +12 -25
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +20 -36
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +17 -28
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +22 -34
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +15 -26
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +5 -13
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +9 -18
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -4
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +2 -4
- package/lib/RowExpandFormatter/email-formatter/index.js +4 -7
- package/lib/RowExpandFormatter/file-formatter/index.js +8 -9
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +10 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +19 -34
- package/lib/RowExpandFormatter/image-formatter/index.js +9 -11
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +7 -8
- package/lib/RowExpandFormatter/index.js +27 -41
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +8 -14
- package/lib/RowExpandFormatter/link-formatter/index.js +11 -19
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +3 -5
- package/lib/RowExpandFormatter/rate-formatter/index.js +11 -12
- package/lib/RowExpandFormatter/text/index.js +4 -5
- package/lib/RowExpandFormatter/url-formatter/index.js +4 -7
- package/lib/RowExpandView/body/index.js +22 -35
- package/lib/RowExpandView/column-content/index.js +3 -7
- package/lib/RowExpandView/index.js +42 -30
- package/lib/SelectItem/index.js +5 -7
- package/lib/SelectOptionGroup/index.css +3 -3
- package/lib/SelectOptionGroup/index.js +31 -40
- package/lib/SelectedDepartments/index.js +7 -9
- package/lib/SimpleLongTextFormatter/index.js +10 -16
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +3 -4
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +12 -21
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -4
- package/lib/SingleSelectEditor/index.js +1 -3
- package/lib/SingleSelectFormatter/index.js +8 -9
- package/lib/TabBar/Tab.js +14 -16
- package/lib/TabBar/index.js +18 -21
- package/lib/Tabs/index.js +1 -3
- package/lib/TextEditor/index.js +14 -23
- package/lib/TextFormatter/index.js +3 -4
- package/lib/TextareaItem/index.js +19 -26
- package/lib/Toast/index.js +3 -4
- package/lib/UrlFormatter/index.js +3 -4
- package/lib/common/editor-base.js +7 -12
- package/lib/hooks/common-hooks.js +2 -4
- package/lib/select-editor/index.js +1 -3
- package/lib/select-editor/mb-editor/index.js +17 -28
- package/lib/select-editor/pc-editor/index.js +27 -42
- package/lib/toaster/alert.js +6 -7
- package/lib/toaster/toast.js +2 -3
- package/lib/toaster/toastManager.js +2 -4
- package/lib/utils/cell.js +8 -11
- package/lib/utils/column-utils.js +8 -14
- package/lib/utils/departments.js +1 -3
- package/lib/utils/url.js +24 -31
- package/lib/utils/utils.js +2 -6
- package/package.json +8 -8
|
@@ -17,10 +17,8 @@ var _lang = require("../../../lang");
|
|
|
17
17
|
var _Loading = _interopRequireDefault(require("../../../Loading"));
|
|
18
18
|
require("./index.css");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
Body
|
|
23
|
-
} = _MobileFullScreenPage.default;
|
|
20
|
+
const Header = _MobileFullScreenPage.default.Header,
|
|
21
|
+
Body = _MobileFullScreenPage.default.Body;
|
|
24
22
|
const getInputMode = column => {
|
|
25
23
|
const data = column.data;
|
|
26
24
|
if (!data) return _mapEditorUtils.INPUT_MODE_MAP.ANY_LOCATION;
|
|
@@ -41,9 +39,7 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
41
39
|
constructor(props) {
|
|
42
40
|
super(props);
|
|
43
41
|
this.addMarkerByPosition = value => {
|
|
44
|
-
const
|
|
45
|
-
lngLat
|
|
46
|
-
} = value;
|
|
42
|
+
const lngLat = value.lngLat;
|
|
47
43
|
let point = new window.BMap.Point(lngLat.lng, lngLat.lat);
|
|
48
44
|
const marker = new window.BMap.Marker(point, {
|
|
49
45
|
offset: new window.BMap.Size(-2, -5)
|
|
@@ -62,11 +58,9 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
62
58
|
const geoCoder = new window.BMap.Geocoder();
|
|
63
59
|
let value = {};
|
|
64
60
|
geoCoder.getLocation(point, result => {
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
point
|
|
69
|
-
} = result;
|
|
61
|
+
const surroundingPois = result.surroundingPois,
|
|
62
|
+
address = result.address,
|
|
63
|
+
point = result.point;
|
|
70
64
|
if (surroundingPois.length === 0) {
|
|
71
65
|
value.address = address;
|
|
72
66
|
value.lngLat = {
|
|
@@ -77,12 +71,10 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
77
71
|
value.title = '';
|
|
78
72
|
} else {
|
|
79
73
|
const position = surroundingPois[0];
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
point
|
|
85
|
-
} = position;
|
|
74
|
+
const address = position.address,
|
|
75
|
+
title = position.title,
|
|
76
|
+
tags = position.tags,
|
|
77
|
+
point = position.point;
|
|
86
78
|
value.address = address || '';
|
|
87
79
|
value.title = title || '';
|
|
88
80
|
value.tag = tags || [];
|
|
@@ -106,17 +98,12 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
106
98
|
if (!window.BMap.Map) return;
|
|
107
99
|
setTimeout(() => {
|
|
108
100
|
this.map = new window.BMap.Map('dtable-ui-mobile-geolocation-map-container');
|
|
109
|
-
let
|
|
110
|
-
lng,
|
|
111
|
-
lat,
|
|
112
|
-
zoom
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
value
|
|
116
|
-
} = this.state;
|
|
117
|
-
const {
|
|
118
|
-
lngLat
|
|
119
|
-
} = value;
|
|
101
|
+
let _getInitCenter = (0, _mapEditorUtils.getInitCenter)(),
|
|
102
|
+
lng = _getInitCenter.lng,
|
|
103
|
+
lat = _getInitCenter.lat,
|
|
104
|
+
zoom = _getInitCenter.zoom;
|
|
105
|
+
const value = this.state.value;
|
|
106
|
+
const lngLat = value.lngLat;
|
|
120
107
|
if ((0, _cell.isValidPosition)(lngLat.lng, lngLat.lat)) {
|
|
121
108
|
lng = lngLat.lng;
|
|
122
109
|
lat = lngLat.lat;
|
|
@@ -135,11 +122,9 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
135
122
|
const point = event.point;
|
|
136
123
|
const geoCoder = new window.BMap.Geocoder();
|
|
137
124
|
geoCoder.getLocation(point, result => {
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
point
|
|
142
|
-
} = result;
|
|
125
|
+
const surroundingPois = result.surroundingPois,
|
|
126
|
+
address = result.address,
|
|
127
|
+
point = result.point;
|
|
143
128
|
if (surroundingPois.length === 0) {
|
|
144
129
|
value.address = address;
|
|
145
130
|
value.lngLat = {
|
|
@@ -150,12 +135,10 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
150
135
|
value.title = '';
|
|
151
136
|
} else {
|
|
152
137
|
const position = surroundingPois[0];
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
point
|
|
158
|
-
} = position;
|
|
138
|
+
const address = position.address,
|
|
139
|
+
title = position.title,
|
|
140
|
+
tags = position.tags,
|
|
141
|
+
point = position.point;
|
|
159
142
|
value.address = address || '';
|
|
160
143
|
value.title = title || '';
|
|
161
144
|
value.tag = tags || [];
|
|
@@ -185,11 +168,9 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
185
168
|
const geoCoder = new window.BMap.Geocoder();
|
|
186
169
|
geoCoder.getLocation(point, result => {
|
|
187
170
|
let value = {};
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
point
|
|
192
|
-
} = result;
|
|
171
|
+
const surroundingPois = result.surroundingPois,
|
|
172
|
+
address = result.address,
|
|
173
|
+
point = result.point;
|
|
193
174
|
if (surroundingPois.length === 0) {
|
|
194
175
|
value.address = address;
|
|
195
176
|
value.lngLat = {
|
|
@@ -200,12 +181,10 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
200
181
|
value.title = '';
|
|
201
182
|
} else {
|
|
202
183
|
const position = surroundingPois[0];
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
point
|
|
208
|
-
} = position;
|
|
184
|
+
const address = position.address,
|
|
185
|
+
title = position.title,
|
|
186
|
+
tags = position.tags,
|
|
187
|
+
point = position.point;
|
|
209
188
|
value.address = address || '';
|
|
210
189
|
value.title = title || '';
|
|
211
190
|
value.tag = tags || [];
|
|
@@ -260,9 +239,7 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
260
239
|
});
|
|
261
240
|
};
|
|
262
241
|
this.onCommit = () => {
|
|
263
|
-
const
|
|
264
|
-
value
|
|
265
|
-
} = this.state;
|
|
242
|
+
const value = this.state.value;
|
|
266
243
|
const isEmptyMapSelection = this.isEmptySelection(value);
|
|
267
244
|
this.props.onCommit(isEmptyMapSelection ? '' : value);
|
|
268
245
|
};
|
|
@@ -270,9 +247,7 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
270
247
|
this.props.onToggle();
|
|
271
248
|
};
|
|
272
249
|
this.onFillIn = () => {
|
|
273
|
-
const
|
|
274
|
-
selectedSelection
|
|
275
|
-
} = this.state;
|
|
250
|
+
const selectedSelection = this.state.selectedSelection;
|
|
276
251
|
this.setState({
|
|
277
252
|
value: selectedSelection,
|
|
278
253
|
isShowLabel: false
|
|
@@ -292,9 +267,7 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
292
267
|
};
|
|
293
268
|
this.onSearch = e => {
|
|
294
269
|
e.stopPropagation();
|
|
295
|
-
const
|
|
296
|
-
inputValue
|
|
297
|
-
} = this.state;
|
|
270
|
+
const inputValue = this.state.inputValue;
|
|
298
271
|
if (!inputValue) return;
|
|
299
272
|
const options = {
|
|
300
273
|
onSearchComplete: results => {
|
|
@@ -327,9 +300,7 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
327
300
|
local.search(inputValue);
|
|
328
301
|
};
|
|
329
302
|
this.renderSearchResult = () => {
|
|
330
|
-
const
|
|
331
|
-
searchResults
|
|
332
|
-
} = this.state;
|
|
303
|
+
const searchResults = this.state.searchResults;
|
|
333
304
|
if (searchResults.length === 0) return null;
|
|
334
305
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
335
306
|
className: "dtable-ui-mobile-map-selection-editor-search-results",
|
|
@@ -349,14 +320,10 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
349
320
|
});
|
|
350
321
|
};
|
|
351
322
|
this.renderLabel = () => {
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
address,
|
|
357
|
-
title,
|
|
358
|
-
tag
|
|
359
|
-
} = selectedSelection;
|
|
323
|
+
const selectedSelection = this.state.selectedSelection;
|
|
324
|
+
const address = selectedSelection.address,
|
|
325
|
+
title = selectedSelection.title,
|
|
326
|
+
tag = selectedSelection.tag;
|
|
360
327
|
const tagContent = Array.isArray(tag) && tag.length > 0 ? tag[0] : '';
|
|
361
328
|
if (title) {
|
|
362
329
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -406,12 +373,11 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
406
373
|
});
|
|
407
374
|
};
|
|
408
375
|
this.renderMap = () => {
|
|
409
|
-
const
|
|
410
|
-
isLoading,
|
|
411
|
-
inputValue,
|
|
412
|
-
isShowSearchView,
|
|
413
|
-
isShowLabel
|
|
414
|
-
} = this.state;
|
|
376
|
+
const _this$state = this.state,
|
|
377
|
+
isLoading = _this$state.isLoading,
|
|
378
|
+
inputValue = _this$state.inputValue,
|
|
379
|
+
isShowSearchView = _this$state.isShowSearchView,
|
|
380
|
+
isShowLabel = _this$state.isShowLabel;
|
|
415
381
|
if (isLoading) return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
416
382
|
className: "w-100 h-100 d-flex align-items-center justify-content-center",
|
|
417
383
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.default, {})
|
|
@@ -490,16 +456,13 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
490
456
|
}), isShowLabel && this.renderLabel()]
|
|
491
457
|
});
|
|
492
458
|
};
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
column
|
|
497
|
-
} = props;
|
|
459
|
+
const _value = props.value,
|
|
460
|
+
config = props.config,
|
|
461
|
+
column = props.column;
|
|
498
462
|
const oldValue = _value || {};
|
|
499
|
-
const
|
|
500
|
-
mapType,
|
|
501
|
-
mapKey
|
|
502
|
-
} = (0, _mapEditorUtils.getMapInfo)(config);
|
|
463
|
+
const _getMapInfo = (0, _mapEditorUtils.getMapInfo)(config),
|
|
464
|
+
mapType = _getMapInfo.mapType,
|
|
465
|
+
mapKey = _getMapInfo.mapKey;
|
|
503
466
|
this.mapType = mapType;
|
|
504
467
|
this.mapKey = mapKey;
|
|
505
468
|
const mode = getInputMode(column);
|
|
@@ -542,9 +505,7 @@ class MapSelectionEditor extends _react.default.Component {
|
|
|
542
505
|
this.map = null;
|
|
543
506
|
}
|
|
544
507
|
render() {
|
|
545
|
-
const
|
|
546
|
-
column
|
|
547
|
-
} = this.props;
|
|
508
|
+
const column = this.props.column;
|
|
548
509
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MobileFullScreenPage.default, {
|
|
549
510
|
className: "dtable-ui-mobile-geolocation-map-selection-editor",
|
|
550
511
|
onClose: this.onClose,
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _Picker = _interopRequireDefault(require("../../Picker"));
|
|
11
12
|
var _List = _interopRequireDefault(require("../../List"));
|
|
12
13
|
var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
|
|
13
14
|
var _lang = require("../../lang");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
Body
|
|
18
|
-
} = _MobileFullScreenPage.default;
|
|
16
|
+
const Header = _MobileFullScreenPage.default.Header,
|
|
17
|
+
Body = _MobileFullScreenPage.default.Body;
|
|
19
18
|
const ProvinceCityEditor = _ref => {
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
let column = _ref.column,
|
|
20
|
+
oldValue = _ref.value,
|
|
21
|
+
getData = _ref.getData,
|
|
22
|
+
onToggle = _ref.onToggle,
|
|
23
|
+
onCommit = _ref.onCommit;
|
|
24
|
+
const _useState = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '', (oldValue === null || oldValue === void 0 ? void 0 : oldValue.city) || '']),
|
|
25
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
|
+
value = _useState2[0],
|
|
27
|
+
setValue = _useState2[1];
|
|
28
|
+
const _useState3 = (0, _react.useState)(true),
|
|
29
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
30
|
+
isLoading = _useState4[0],
|
|
31
|
+
setLoading = _useState4[1];
|
|
29
32
|
const locations = (0, _react.useRef)([]);
|
|
30
33
|
(0, _react.useEffect)(() => {
|
|
31
34
|
getData().then(data => {
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _Picker = _interopRequireDefault(require("../../Picker"));
|
|
11
12
|
var _List = _interopRequireDefault(require("../../List"));
|
|
12
13
|
var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
|
|
13
14
|
var _lang = require("../../lang");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
Body
|
|
18
|
-
} = _MobileFullScreenPage.default;
|
|
16
|
+
const Header = _MobileFullScreenPage.default.Header,
|
|
17
|
+
Body = _MobileFullScreenPage.default.Body;
|
|
19
18
|
const ProvinceEditor = _ref => {
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
let column = _ref.column,
|
|
20
|
+
oldValue = _ref.value,
|
|
21
|
+
getData = _ref.getData,
|
|
22
|
+
onToggle = _ref.onToggle,
|
|
23
|
+
onCommit = _ref.onCommit;
|
|
24
|
+
const _useState = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '']),
|
|
25
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
|
+
value = _useState2[0],
|
|
27
|
+
setValue = _useState2[1];
|
|
28
|
+
const _useState3 = (0, _react.useState)(true),
|
|
29
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
30
|
+
isLoading = _useState4[0],
|
|
31
|
+
setLoading = _useState4[1];
|
|
29
32
|
const locations = (0, _react.useRef)([]);
|
|
30
33
|
(0, _react.useEffect)(() => {
|
|
31
34
|
getData().then(data => {
|
|
@@ -31,9 +31,7 @@ class CountryEditor extends _react.Component {
|
|
|
31
31
|
this.onDownArrow = e => {
|
|
32
32
|
e.preventDefault();
|
|
33
33
|
e.stopPropagation();
|
|
34
|
-
let
|
|
35
|
-
highlightIndexes
|
|
36
|
-
} = this.state;
|
|
34
|
+
let highlightIndexes = this.state.highlightIndexes;
|
|
37
35
|
const continents = Object.keys(this.filteredCountry);
|
|
38
36
|
if (continents.length === 0) return;
|
|
39
37
|
const continent = continents[highlightIndexes[0]];
|
|
@@ -55,9 +53,7 @@ class CountryEditor extends _react.Component {
|
|
|
55
53
|
this.onUpArrow = e => {
|
|
56
54
|
e.preventDefault();
|
|
57
55
|
e.stopPropagation();
|
|
58
|
-
let
|
|
59
|
-
highlightIndexes
|
|
60
|
-
} = this.state;
|
|
56
|
+
let highlightIndexes = this.state.highlightIndexes;
|
|
61
57
|
const continents = Object.keys(this.filteredCountry);
|
|
62
58
|
if (continents.length === 0) return;
|
|
63
59
|
if (highlightIndexes[1] === 0 && highlightIndexes[0] !== 0) {
|
|
@@ -95,9 +91,7 @@ class CountryEditor extends _react.Component {
|
|
|
95
91
|
});
|
|
96
92
|
this.props.onSubmit();
|
|
97
93
|
} else {
|
|
98
|
-
const
|
|
99
|
-
highlightIndexes
|
|
100
|
-
} = this.state;
|
|
94
|
+
const highlightIndexes = this.state.highlightIndexes;
|
|
101
95
|
const continents = Object.keys(this.filteredCountry);
|
|
102
96
|
if (continents.length > 0) {
|
|
103
97
|
const continent = continents[highlightIndexes[0]];
|
|
@@ -117,9 +111,7 @@ class CountryEditor extends _react.Component {
|
|
|
117
111
|
};
|
|
118
112
|
this.onMenuMouseLeave = (continentIndex, countryIndex) => {
|
|
119
113
|
this.timer = setTimeout(() => {
|
|
120
|
-
const
|
|
121
|
-
highlightIndexes
|
|
122
|
-
} = this.state;
|
|
114
|
+
const highlightIndexes = this.state.highlightIndexes;
|
|
123
115
|
if (highlightIndexes[0] === continentIndex && highlightIndexes[1] === countryIndex) {
|
|
124
116
|
this.setState({
|
|
125
117
|
highlightIndexes: [0, -1]
|
|
@@ -152,10 +144,9 @@ class CountryEditor extends _react.Component {
|
|
|
152
144
|
return continentsList;
|
|
153
145
|
};
|
|
154
146
|
this.createCountryList = (continent, continentIndex) => {
|
|
155
|
-
const
|
|
156
|
-
value,
|
|
157
|
-
highlightIndexes
|
|
158
|
-
} = this.state;
|
|
147
|
+
const _this$state = this.state,
|
|
148
|
+
value = _this$state.value,
|
|
149
|
+
highlightIndexes = _this$state.highlightIndexes;
|
|
159
150
|
let countryList = this.filteredCountry[continent].map((country, index) => {
|
|
160
151
|
const isHighlight = highlightIndexes[0] === continentIndex && highlightIndexes[1] === index;
|
|
161
152
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -222,10 +213,8 @@ class CountryEditor extends _react.Component {
|
|
|
222
213
|
}
|
|
223
214
|
};
|
|
224
215
|
this.countryReg = null;
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
value: _value
|
|
228
|
-
} = props;
|
|
216
|
+
const column = props.column,
|
|
217
|
+
_value = props.value;
|
|
229
218
|
const columnData = column.data || {};
|
|
230
219
|
this.lang = columnData.lang === 'cn' ? 'cn' : 'en';
|
|
231
220
|
this.state = {
|
|
@@ -257,9 +246,7 @@ class CountryEditor extends _react.Component {
|
|
|
257
246
|
}
|
|
258
247
|
}
|
|
259
248
|
render() {
|
|
260
|
-
const
|
|
261
|
-
isLoadingData
|
|
262
|
-
} = this.state;
|
|
249
|
+
const isLoadingData = this.state.isLoadingData;
|
|
263
250
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
264
251
|
className: "dtable-ui-geolocation-country-editor",
|
|
265
252
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -48,9 +48,7 @@ class PCGeolocationEditor extends _react.default.Component {
|
|
|
48
48
|
this.props.onToggle && this.props.onToggle();
|
|
49
49
|
};
|
|
50
50
|
this.setEditorPosition = () => {
|
|
51
|
-
const
|
|
52
|
-
isInModal
|
|
53
|
-
} = this.props;
|
|
51
|
+
const isInModal = this.props.isInModal;
|
|
54
52
|
const editorFormat = this.getGeoFormat();
|
|
55
53
|
if (this.ref && (editorFormat === _dtableUtils.GEOLOCATION_FORMAT.COUNTRY_REGION || editorFormat === _dtableUtils.GEOLOCATION_FORMAT.PROVINCE)) {
|
|
56
54
|
let height = 240;
|
|
@@ -116,10 +114,9 @@ class PCGeolocationEditor extends _react.default.Component {
|
|
|
116
114
|
geoEditorTop = height + geoEditorTop > innerHeight ? innerHeight - height - 30 : geoEditorTop;
|
|
117
115
|
geoEditorLeft = -30;
|
|
118
116
|
} else {
|
|
119
|
-
let
|
|
120
|
-
offsetLeft,
|
|
121
|
-
offsetTop
|
|
122
|
-
} = this.ref.parentNode;
|
|
117
|
+
let _this$ref$parentNode = this.ref.parentNode,
|
|
118
|
+
offsetLeft = _this$ref$parentNode.offsetLeft,
|
|
119
|
+
offsetTop = _this$ref$parentNode.offsetTop;
|
|
123
120
|
geoEditorLeft = offsetLeft - width;
|
|
124
121
|
geoEditorTop = offsetTop;
|
|
125
122
|
if (offsetLeft < width) {
|
|
@@ -143,9 +140,7 @@ class PCGeolocationEditor extends _react.default.Component {
|
|
|
143
140
|
}
|
|
144
141
|
};
|
|
145
142
|
this.getGeoFormat = () => {
|
|
146
|
-
const
|
|
147
|
-
column
|
|
148
|
-
} = this.props;
|
|
143
|
+
const column = this.props.column;
|
|
149
144
|
let data = column.data || {};
|
|
150
145
|
return data.geo_format ? data.geo_format : _dtableUtils.DEFAULT_GEOLOCATION_FORMAT;
|
|
151
146
|
};
|
|
@@ -155,13 +150,12 @@ class PCGeolocationEditor extends _react.default.Component {
|
|
|
155
150
|
};
|
|
156
151
|
this.createEditor = () => {
|
|
157
152
|
const geoFormat = this.getGeoFormat();
|
|
158
|
-
const
|
|
159
|
-
config,
|
|
160
|
-
column,
|
|
161
|
-
getCountryData,
|
|
162
|
-
getLocationData,
|
|
163
|
-
toggleLargeMap
|
|
164
|
-
} = this.props;
|
|
153
|
+
const _this$props = this.props,
|
|
154
|
+
config = _this$props.config,
|
|
155
|
+
column = _this$props.column,
|
|
156
|
+
getCountryData = _this$props.getCountryData,
|
|
157
|
+
getLocationData = _this$props.getLocationData,
|
|
158
|
+
toggleLargeMap = _this$props.toggleLargeMap;
|
|
165
159
|
const props = {
|
|
166
160
|
column,
|
|
167
161
|
config,
|
|
@@ -239,9 +233,7 @@ class PCGeolocationEditor extends _react.default.Component {
|
|
|
239
233
|
document.removeEventListener('keydown', this.onHotKey, true);
|
|
240
234
|
}
|
|
241
235
|
render() {
|
|
242
|
-
const
|
|
243
|
-
editorPosition
|
|
244
|
-
} = this.state;
|
|
236
|
+
const editorPosition = this.state.editorPosition;
|
|
245
237
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
246
238
|
ref: ref => this.ref = ref,
|
|
247
239
|
style: editorPosition,
|
|
@@ -13,7 +13,7 @@ var _selectorList = _interopRequireDefault(require("./selector-list"));
|
|
|
13
13
|
var _selectorHeaderItem = _interopRequireDefault(require("./selector-header-item"));
|
|
14
14
|
var _constants = require("../../constants");
|
|
15
15
|
var _Loading = _interopRequireDefault(require("../../Loading"));
|
|
16
|
-
var
|
|
16
|
+
var _parseGeolocation2 = _interopRequireDefault(require("./parse-geolocation"));
|
|
17
17
|
var _lang = require("../../lang");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
class LocationEditor extends _react.Component {
|
|
@@ -116,10 +116,9 @@ class LocationEditor extends _react.Component {
|
|
|
116
116
|
this.props.setValue(this.value);
|
|
117
117
|
};
|
|
118
118
|
this.selectSelectorType = type => {
|
|
119
|
-
const
|
|
120
|
-
selectedProvince,
|
|
121
|
-
selectedCity
|
|
122
|
-
} = this.state;
|
|
119
|
+
const _this$state = this.state,
|
|
120
|
+
selectedProvince = _this$state.selectedProvince,
|
|
121
|
+
selectedCity = _this$state.selectedCity;
|
|
123
122
|
if (!selectedProvince) return;
|
|
124
123
|
if (type === 'county' && !selectedCity) return;
|
|
125
124
|
this.setState({
|
|
@@ -146,12 +145,11 @@ class LocationEditor extends _react.Component {
|
|
|
146
145
|
this.timer = null;
|
|
147
146
|
const value = this.parseRef.value;
|
|
148
147
|
if (this.isComposing) return;
|
|
149
|
-
const
|
|
150
|
-
province,
|
|
151
|
-
city,
|
|
152
|
-
district,
|
|
153
|
-
detail
|
|
154
|
-
} = (0, _parseGeolocation.default)(this.locations, value);
|
|
148
|
+
const _parseGeolocation = (0, _parseGeolocation2.default)(this.locations, value),
|
|
149
|
+
province = _parseGeolocation.province,
|
|
150
|
+
city = _parseGeolocation.city,
|
|
151
|
+
district = _parseGeolocation.district,
|
|
152
|
+
detail = _parseGeolocation.detail;
|
|
155
153
|
if (this.detailInfo) {
|
|
156
154
|
this.detailInfo.value = detail || '';
|
|
157
155
|
this.value = Object.assign({}, this.value, {
|
|
@@ -173,11 +171,10 @@ class LocationEditor extends _react.Component {
|
|
|
173
171
|
this.isComposing = false;
|
|
174
172
|
};
|
|
175
173
|
this.onSubmit = () => {
|
|
176
|
-
const
|
|
177
|
-
province,
|
|
178
|
-
city,
|
|
179
|
-
district
|
|
180
|
-
} = this.value;
|
|
174
|
+
const _this$value = this.value,
|
|
175
|
+
province = _this$value.province,
|
|
176
|
+
city = _this$value.city,
|
|
177
|
+
district = _this$value.district;
|
|
181
178
|
if (!province || !city || !district) {
|
|
182
179
|
const errMessage = (0, _lang.getLocale)('Province/City/District_must_be_filled_in');
|
|
183
180
|
this.setState({
|
|
@@ -205,12 +202,11 @@ class LocationEditor extends _react.Component {
|
|
|
205
202
|
UNSAFE_componentWillMount() {
|
|
206
203
|
this.props.getData().then(data => {
|
|
207
204
|
this.locations = data;
|
|
208
|
-
const
|
|
209
|
-
selectedProvince,
|
|
210
|
-
selectedCity,
|
|
211
|
-
selectedCounty,
|
|
212
|
-
selectedItem
|
|
213
|
-
} = this.initLocationSelecting(this.value);
|
|
205
|
+
const _this$initLocationSel = this.initLocationSelecting(this.value),
|
|
206
|
+
selectedProvince = _this$initLocationSel.selectedProvince,
|
|
207
|
+
selectedCity = _this$initLocationSel.selectedCity,
|
|
208
|
+
selectedCounty = _this$initLocationSel.selectedCounty,
|
|
209
|
+
selectedItem = _this$initLocationSel.selectedItem;
|
|
214
210
|
this.setState({
|
|
215
211
|
isLoadingData: false,
|
|
216
212
|
selectedProvince,
|
|
@@ -221,15 +217,14 @@ class LocationEditor extends _react.Component {
|
|
|
221
217
|
});
|
|
222
218
|
}
|
|
223
219
|
render() {
|
|
224
|
-
const
|
|
225
|
-
selectedItem,
|
|
226
|
-
selectedCity,
|
|
227
|
-
selectedProvince,
|
|
228
|
-
selectedCounty,
|
|
229
|
-
isShowSelector,
|
|
230
|
-
isLoadingData,
|
|
231
|
-
location
|
|
232
|
-
} = this.state;
|
|
220
|
+
const _this$state2 = this.state,
|
|
221
|
+
selectedItem = _this$state2.selectedItem,
|
|
222
|
+
selectedCity = _this$state2.selectedCity,
|
|
223
|
+
selectedProvince = _this$state2.selectedProvince,
|
|
224
|
+
selectedCounty = _this$state2.selectedCounty,
|
|
225
|
+
isShowSelector = _this$state2.isShowSelector,
|
|
226
|
+
isLoadingData = _this$state2.isLoadingData,
|
|
227
|
+
location = _this$state2.location;
|
|
233
228
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
234
229
|
children: [!isLoadingData ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
235
230
|
onClick: this.onClick,
|