dtable-ui-component 7.0.13 → 7.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ActionSheet/index.js +58 -49
- package/lib/ActivityIndicator/index.js +17 -16
- package/lib/AsyncUserSelect/index.js +20 -46
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +27 -29
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +16 -13
- package/lib/CheckboxEditor/mb-editor.js +20 -9
- package/lib/CheckboxEditor/pc-editor.js +24 -12
- package/lib/CheckboxFormatter/index.js +5 -4
- package/lib/CollaboratorEditor/index.js +17 -14
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +35 -26
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +8 -10
- package/lib/Comment/body/comment.js +19 -11
- package/lib/Comment/body/index.js +8 -8
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +21 -10
- package/lib/Comment/footer/input/index.js +55 -34
- package/lib/Comment/footer/input/participant/index.js +6 -5
- package/lib/Comment/footer/participants/index.js +5 -4
- package/lib/Comment/footer/participants/participant/index.js +3 -1
- package/lib/Comment/footer/participants/participant-select/index.js +26 -10
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +22 -16
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +26 -28
- package/lib/DTableColorPicker/index.js +53 -67
- package/lib/DTableColorPicker/utils.js +7 -5
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +10 -8
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeSearchInput/index.js +41 -26
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +28 -24
- package/lib/DTableDropdownMenu/index.js +17 -14
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +42 -27
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +114 -64
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
- package/lib/DTableFiltersPopover/widgets/filter-group.js +57 -36
- package/lib/DTableFiltersPopover/widgets/filter-item.js +165 -106
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +162 -137
- package/lib/DTableFiltersPopover/widgets/rate-item.js +25 -20
- package/lib/DTableIcon/index.js +11 -10
- package/lib/DTableIcon/svg-icon.js +11 -9
- package/lib/DTableModalHeader/index.js +7 -7
- package/lib/DTablePopover/index.js +16 -12
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +20 -11
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +6 -7
- package/lib/DTableSelect/index.js +26 -25
- package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
- package/lib/DTableSelect/utils.js +83 -47
- package/lib/DTableSubDropdownMenu/index.js +16 -12
- package/lib/DTableSubDropdownToggle/index.js +16 -17
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +12 -11
- package/lib/DateEditor/index.js +28 -30
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +46 -27
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +7 -5
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +26 -28
- package/lib/DepartmentSelectFilter/index.js +13 -8
- package/lib/DepartmentSingleSelectEditor/index.js +16 -13
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +49 -50
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +64 -42
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +16 -13
- package/lib/DigitalSignEditor/mb-editor/index.js +24 -16
- package/lib/DigitalSignEditor/pc-editor/index.js +31 -23
- package/lib/DigitalSignEditor/service.js +5 -3
- package/lib/DigitalSignEditor/signature-board/index.js +10 -7
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +6 -5
- package/lib/Drawer/index.js +3 -2
- package/lib/DurationEditor/index.js +31 -21
- package/lib/DurationFormatter/index.js +5 -4
- package/lib/EditEditorButton/index.js +3 -1
- package/lib/EmailFormatter/index.js +4 -3
- package/lib/FieldDisplaySetting/field-item.js +13 -13
- package/lib/FieldDisplaySetting/index.js +20 -20
- package/lib/FileEditor/files-previewer/index.js +16 -13
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +20 -12
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +24 -17
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +16 -13
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +4 -2
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +31 -17
- package/lib/FileEditor/pc-editor/index.js +30 -22
- package/lib/FileFormatter/index.js +20 -27
- package/lib/FileItemFormatter/index.js +10 -7
- package/lib/FileUploader/index.js +46 -29
- package/lib/FormulaFormatter/index.js +44 -24
- package/lib/GeolocationEditor/index.js +32 -27
- package/lib/GeolocationEditor/map-editor-utils.js +23 -21
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +28 -22
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +77 -47
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
- package/lib/GeolocationEditor/pc-editor/country-editor.js +25 -12
- package/lib/GeolocationEditor/pc-editor/index.js +41 -27
- package/lib/GeolocationEditor/pc-editor/location-editor.js +33 -28
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +67 -43
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +69 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +86 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +85 -39
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +26 -20
- package/lib/GeolocationEditor/pc-editor/province-editor.js +15 -8
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +8 -7
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +13 -5
- package/lib/Icon/index.js +13 -15
- package/lib/Icon/load-sprite.js +13 -2
- package/lib/IconButton/index.js +12 -13
- package/lib/ImageEditor/images-previewer/image-preview/index.js +22 -13
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +16 -13
- package/lib/ImageEditor/mb-editor/index.js +20 -28
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +5 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +26 -12
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +10 -4
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +14 -12
- package/lib/ImagePreviewerLightbox/index.js +15 -19
- package/lib/ImageThumbnail/index.js +15 -12
- package/lib/InputItem/custom-input.js +55 -35
- package/lib/InputItem/custom-keyboard.js +42 -42
- package/lib/InputItem/index.js +82 -63
- package/lib/InputItem/input.js +9 -11
- package/lib/LastModifierFormatter/index.js +8 -6
- package/lib/LinkEditor/index.js +53 -33
- package/lib/LinkEditor/link-editor-option.js +4 -3
- package/lib/LinkEditor/mb-popover/index.js +22 -9
- package/lib/LinkEditor/pc-popover/index.js +13 -7
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +17 -19
- package/lib/List/list-item.js +59 -55
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +9 -8
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +6 -4
- package/lib/MobileFullScreenPage/header/index.js +10 -8
- package/lib/MobileFullScreenPage/index.js +12 -14
- package/lib/MobileModal/index.js +7 -8
- package/lib/MobileOperationSheet/index.js +8 -7
- package/lib/MobileSelector/empty/index.js +3 -1
- package/lib/MobileSelector/index.js +7 -5
- package/lib/MobileSelector/option/index.js +5 -3
- package/lib/MobileSelector/options/index.css +0 -4
- package/lib/MobileSelector/options/index.js +3 -1
- package/lib/MobileSelector/search/index.js +5 -3
- package/lib/MobileUpload/index.js +5 -4
- package/lib/Modal/alert.js +2 -2
- package/lib/Modal/modal.js +28 -30
- package/lib/Modal/prompt.js +14 -14
- package/lib/MultipleSelectEditor/index.js +7 -7
- package/lib/MultipleSelectFormatter/index.js +9 -7
- package/lib/NotificationPopover/index.js +5 -4
- package/lib/NumberEditor/index.js +21 -12
- package/lib/NumberFormatter/index.js +5 -4
- package/lib/PhoneNumberLink/index.js +5 -3
- package/lib/Picker/AbstractPicker.js +35 -33
- package/lib/Popover/index.js +9 -11
- package/lib/Popover/item.js +22 -24
- package/lib/Progress/index.js +18 -17
- package/lib/Radio/Radio.js +17 -15
- package/lib/Radio/RadioItem.js +23 -19
- package/lib/RateFormatter/index.js +15 -15
- package/lib/RoleStatusEditor/index.js +18 -19
- package/lib/RowExpand/index.js +7 -6
- package/lib/RowExpandDialog/body/index.js +57 -40
- package/lib/RowExpandDialog/column-content/index.js +10 -6
- package/lib/RowExpandDialog/header/index.js +12 -9
- package/lib/RowExpandDialog/index.js +59 -63
- package/lib/RowExpandEditor/add-btn/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
- package/lib/RowExpandEditor/collaborator-editor/index.js +7 -6
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
- package/lib/RowExpandEditor/date-editor/index.js +7 -6
- package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
- package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
- package/lib/RowExpandEditor/department-editor/index.js +7 -6
- package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
- package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
- package/lib/RowExpandEditor/digital-sign-editor/index.js +7 -6
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +38 -24
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +39 -25
- package/lib/RowExpandEditor/duration-editor/index.js +7 -6
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
- package/lib/RowExpandEditor/email-editor/index.js +7 -6
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +20 -10
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +25 -14
- package/lib/RowExpandEditor/file-editor/index.js +7 -6
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/geolocation-editor/index.js +7 -6
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
- package/lib/RowExpandEditor/image-editor/index.js +7 -6
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +26 -16
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +24 -14
- package/lib/RowExpandEditor/index.js +16 -11
- package/lib/RowExpandEditor/long-text-editor/index.js +7 -6
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/multiple-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +20 -12
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +38 -27
- package/lib/RowExpandEditor/number-editor/index.js +7 -6
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
- package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
- package/lib/RowExpandEditor/rate-editor/index.js +7 -6
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +26 -13
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +41 -25
- package/lib/RowExpandEditor/single-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +32 -21
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +37 -25
- package/lib/RowExpandEditor/text-editor/index.js +7 -6
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
- package/lib/RowExpandEditor/url-editor/index.js +7 -6
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +15 -7
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +20 -11
- package/lib/RowExpandFormatter/department-formatter/index.js +6 -3
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
- package/lib/RowExpandFormatter/email-formatter/index.js +8 -5
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +14 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +51 -30
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +10 -9
- package/lib/RowExpandFormatter/index.js +52 -34
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +15 -9
- package/lib/RowExpandFormatter/link-formatter/index.js +25 -17
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +14 -13
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +9 -6
- package/lib/RowExpandView/body/index.js +43 -32
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +52 -53
- package/lib/SelectItem/index.js +7 -5
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +12 -10
- package/lib/SimpleLongTextFormatter/index.js +18 -12
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
- package/lib/SingleSelectEditor/index.js +7 -7
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +26 -24
- package/lib/TabBar/index.js +28 -24
- package/lib/Tabs/index.js +13 -10
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +53 -48
- package/lib/Toast/index.js +9 -8
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/formatterConfig/index.js +3 -3
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +16 -13
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +47 -32
- package/lib/toaster/alert.js +8 -7
- package/lib/toaster/toast.js +4 -3
- package/lib/toaster/toastManager.js +13 -13
- package/lib/toaster/toaster.js +12 -9
- package/lib/utils/cell.js +11 -8
- package/lib/utils/class.js +3 -3
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +6 -5
- package/lib/utils/getLocale.js +11 -5
- package/lib/utils/object-utils.js +5 -4
- package/lib/utils/url.js +29 -22
- package/lib/utils/utils.js +6 -2
- package/package.json +2 -2
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _dtableUtils = require("dtable-utils");
|
|
12
11
|
var _toaster = _interopRequireDefault(require("../../../toaster"));
|
|
@@ -40,12 +39,17 @@ class MapSelectionEditor extends _react.Component {
|
|
|
40
39
|
this.map = new window.BMap.Map('geolocation-map-selection-container', {
|
|
41
40
|
enableMapClick: false
|
|
42
41
|
});
|
|
43
|
-
let
|
|
44
|
-
lng
|
|
45
|
-
lat
|
|
46
|
-
zoom
|
|
47
|
-
|
|
48
|
-
const
|
|
42
|
+
let {
|
|
43
|
+
lng,
|
|
44
|
+
lat,
|
|
45
|
+
zoom
|
|
46
|
+
} = (0, _mapEditorUtils.getInitCenter)(true);
|
|
47
|
+
const {
|
|
48
|
+
value
|
|
49
|
+
} = this.state;
|
|
50
|
+
const {
|
|
51
|
+
lngLat
|
|
52
|
+
} = value;
|
|
49
53
|
if ((0, _cell.isValidPosition)(lngLat.lng, lngLat.lat)) {
|
|
50
54
|
lng = lngLat.lng;
|
|
51
55
|
lat = lngLat.lat;
|
|
@@ -66,9 +70,11 @@ class MapSelectionEditor extends _react.Component {
|
|
|
66
70
|
const point = event.point;
|
|
67
71
|
const geoCoder = new window.BMap.Geocoder();
|
|
68
72
|
geoCoder.getLocation(point, result => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
const {
|
|
74
|
+
surroundingPois,
|
|
75
|
+
address,
|
|
76
|
+
point
|
|
77
|
+
} = result;
|
|
72
78
|
if (surroundingPois.length === 0) {
|
|
73
79
|
value.address = address;
|
|
74
80
|
value.lngLat = {
|
|
@@ -79,10 +85,12 @@ class MapSelectionEditor extends _react.Component {
|
|
|
79
85
|
value.title = '';
|
|
80
86
|
} else {
|
|
81
87
|
const position = surroundingPois[0];
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
const {
|
|
89
|
+
address,
|
|
90
|
+
title,
|
|
91
|
+
tags,
|
|
92
|
+
point
|
|
93
|
+
} = position;
|
|
86
94
|
value.address = address || '';
|
|
87
95
|
value.title = title || '';
|
|
88
96
|
value.tag = tags || [];
|
|
@@ -97,7 +105,9 @@ class MapSelectionEditor extends _react.Component {
|
|
|
97
105
|
});
|
|
98
106
|
};
|
|
99
107
|
this.addMarkerByPosition = value => {
|
|
100
|
-
const
|
|
108
|
+
const {
|
|
109
|
+
lngLat
|
|
110
|
+
} = value;
|
|
101
111
|
let point = new window.BMap.Point(lngLat.lng, lngLat.lat);
|
|
102
112
|
const marker = new window.BMap.Marker(point, {
|
|
103
113
|
offset: new window.BMap.Size(-2, -5)
|
|
@@ -115,7 +125,7 @@ class MapSelectionEditor extends _react.Component {
|
|
|
115
125
|
backgroundColor: '#ffffff',
|
|
116
126
|
boxShadow: '1px 2px 1px rgba(0,0,0,.15)',
|
|
117
127
|
padding: '3px 10px',
|
|
118
|
-
transform:
|
|
128
|
+
transform: `translate(-50%, ${translateY})`,
|
|
119
129
|
borderRadius: '3px',
|
|
120
130
|
fontWeight: '500',
|
|
121
131
|
left: '7px'
|
|
@@ -150,17 +160,38 @@ class MapSelectionEditor extends _react.Component {
|
|
|
150
160
|
}
|
|
151
161
|
};
|
|
152
162
|
this.getLabelContent = value => {
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
const {
|
|
164
|
+
address,
|
|
165
|
+
title,
|
|
166
|
+
tag
|
|
167
|
+
} = value;
|
|
156
168
|
const tagContent = Array.isArray(tag) && tag.length > 0 ? tag[0] : '';
|
|
157
169
|
if (title) {
|
|
158
|
-
return
|
|
170
|
+
return `
|
|
171
|
+
<div class='dtable-ui-selection-label-content' id='dtable-ui-selection-label-content'>
|
|
172
|
+
<i class='dtable-font dtable-icon-down3'></i>
|
|
173
|
+
<span class='label-title text-truncate' title=${title}>${title}</span>
|
|
174
|
+
${tagContent && `<span class='label-tag'>${tagContent}</span>`}
|
|
175
|
+
<span class='dtable-font dtable-icon-x' id='selection-label-close'></span>
|
|
176
|
+
<span class='label-address-tip'>${(0, _lang.getLocale)('Address')}</span>
|
|
177
|
+
<span class='label-address text-truncate' title=${address}>${address}</span>
|
|
178
|
+
<div class='label-submit btn btn-primary' id='selection-label-submit'>${(0, _lang.getLocale)('Fill_in')}</div>
|
|
179
|
+
</div>
|
|
180
|
+
`;
|
|
159
181
|
}
|
|
160
|
-
return
|
|
182
|
+
return `
|
|
183
|
+
<div class='dtable-ui-selection-label-content simple' id='dtable-ui-selection-label-content'>
|
|
184
|
+
<i class='dtable-font dtable-icon-down3'></i>
|
|
185
|
+
<span class='dtable-font dtable-icon-x' id='selection-label-close'></span>
|
|
186
|
+
<span class='label-address text-truncate simple' title=${address}>${address}</span>
|
|
187
|
+
<div class='label-submit btn btn-primary' id='selection-label-submit'>${(0, _lang.getLocale)('Fill_in')}</div>
|
|
188
|
+
</div>
|
|
189
|
+
`;
|
|
161
190
|
};
|
|
162
191
|
this.getInitValue = () => {
|
|
163
|
-
const
|
|
192
|
+
const {
|
|
193
|
+
value
|
|
194
|
+
} = this.props;
|
|
164
195
|
if (!value || (0, _dtableUtils.isEmptyObject)(value)) {
|
|
165
196
|
return {
|
|
166
197
|
address: '',
|
|
@@ -172,7 +203,9 @@ class MapSelectionEditor extends _react.Component {
|
|
|
172
203
|
return value;
|
|
173
204
|
};
|
|
174
205
|
this.onSearch = () => {
|
|
175
|
-
const
|
|
206
|
+
const {
|
|
207
|
+
inputValue
|
|
208
|
+
} = this.state;
|
|
176
209
|
let options = {
|
|
177
210
|
onSearchComplete: results => {
|
|
178
211
|
const status = local.getStatus();
|
|
@@ -229,7 +262,9 @@ class MapSelectionEditor extends _react.Component {
|
|
|
229
262
|
event.preventDefault();
|
|
230
263
|
event.stopPropagation();
|
|
231
264
|
event.nativeEvent.stopImmediatePropagation();
|
|
232
|
-
const
|
|
265
|
+
const {
|
|
266
|
+
value
|
|
267
|
+
} = this.state;
|
|
233
268
|
this.props.setValue(value);
|
|
234
269
|
this.setState({
|
|
235
270
|
isShowLargeEditor: !this.state.isShowLargeEditor
|
|
@@ -252,9 +287,11 @@ class MapSelectionEditor extends _react.Component {
|
|
|
252
287
|
const geoCoder = new window.BMap.Geocoder();
|
|
253
288
|
geoCoder.getLocation(point, result => {
|
|
254
289
|
let value = {};
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
290
|
+
const {
|
|
291
|
+
surroundingPois,
|
|
292
|
+
address,
|
|
293
|
+
point
|
|
294
|
+
} = result;
|
|
258
295
|
if (surroundingPois.length === 0) {
|
|
259
296
|
value.address = address;
|
|
260
297
|
value.lngLat = {
|
|
@@ -265,10 +302,12 @@ class MapSelectionEditor extends _react.Component {
|
|
|
265
302
|
value.title = '';
|
|
266
303
|
} else {
|
|
267
304
|
const position = surroundingPois[0];
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
305
|
+
const {
|
|
306
|
+
address,
|
|
307
|
+
title,
|
|
308
|
+
tags,
|
|
309
|
+
point
|
|
310
|
+
} = position;
|
|
272
311
|
value.address = address || '';
|
|
273
312
|
value.title = title || '';
|
|
274
313
|
value.tag = tags || [];
|
|
@@ -297,7 +336,9 @@ class MapSelectionEditor extends _react.Component {
|
|
|
297
336
|
(0, _mapEditorUtils.locateCurrentPosition)(this.map, this.mapType, this.geolocationCallback);
|
|
298
337
|
};
|
|
299
338
|
this.renderSearchResults = () => {
|
|
300
|
-
const
|
|
339
|
+
const {
|
|
340
|
+
searchResults
|
|
341
|
+
} = this.state;
|
|
301
342
|
if (searchResults.length === 0) return null;
|
|
302
343
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
303
344
|
className: "search-results-container",
|
|
@@ -319,9 +360,10 @@ class MapSelectionEditor extends _react.Component {
|
|
|
319
360
|
const _value = this.getInitValue();
|
|
320
361
|
this.readOnly = props.readOnly;
|
|
321
362
|
const _inputValue = _value.title || _value.address || '';
|
|
322
|
-
const
|
|
323
|
-
mapType
|
|
324
|
-
mapKey
|
|
363
|
+
const {
|
|
364
|
+
mapType,
|
|
365
|
+
mapKey
|
|
366
|
+
} = (0, _mapEditorUtils.getMapInfo)(props.config);
|
|
325
367
|
this.state = {
|
|
326
368
|
isLoading: true,
|
|
327
369
|
value: _value,
|
|
@@ -350,14 +392,16 @@ class MapSelectionEditor extends _react.Component {
|
|
|
350
392
|
}
|
|
351
393
|
}
|
|
352
394
|
render() {
|
|
353
|
-
const
|
|
354
|
-
isLoading
|
|
355
|
-
inputValue
|
|
356
|
-
isShowLargeEditor
|
|
395
|
+
const {
|
|
396
|
+
isLoading,
|
|
397
|
+
inputValue,
|
|
398
|
+
isShowLargeEditor
|
|
399
|
+
} = this.state;
|
|
357
400
|
if (isShowLargeEditor) {
|
|
358
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_largeEditor.default,
|
|
401
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_largeEditor.default, {
|
|
402
|
+
...this.props,
|
|
359
403
|
toggleFullScreen: this.toggleFullScreen
|
|
360
|
-
})
|
|
404
|
+
});
|
|
361
405
|
}
|
|
362
406
|
if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP || this.mapType === _mapEditorUtils.MAP_TYPES.M_MAP) {
|
|
363
407
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
@@ -27,12 +27,17 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
27
27
|
this.map = new window.BMap.Map('geolocation-map-selection-container-large', {
|
|
28
28
|
enableMapClick: false
|
|
29
29
|
});
|
|
30
|
-
let
|
|
31
|
-
lng
|
|
32
|
-
lat
|
|
33
|
-
zoom
|
|
34
|
-
|
|
35
|
-
const
|
|
30
|
+
let {
|
|
31
|
+
lng,
|
|
32
|
+
lat,
|
|
33
|
+
zoom
|
|
34
|
+
} = (0, _mapEditorUtils.getInitCenter)(true);
|
|
35
|
+
const {
|
|
36
|
+
value
|
|
37
|
+
} = this.state;
|
|
38
|
+
const {
|
|
39
|
+
lngLat
|
|
40
|
+
} = value;
|
|
36
41
|
if ((0, _cell.isValidPosition)(lngLat === null || lngLat === void 0 ? void 0 : lngLat.lng, lngLat === null || lngLat === void 0 ? void 0 : lngLat.lat)) {
|
|
37
42
|
lng = lngLat.lng;
|
|
38
43
|
lat = lngLat.lat;
|
|
@@ -53,9 +58,11 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
53
58
|
const point = event.point;
|
|
54
59
|
const geoCoder = new window.BMap.Geocoder();
|
|
55
60
|
geoCoder.getLocation(point, result => {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
const {
|
|
62
|
+
surroundingPois,
|
|
63
|
+
address,
|
|
64
|
+
point
|
|
65
|
+
} = result;
|
|
59
66
|
if (surroundingPois.length === 0) {
|
|
60
67
|
value.address = address;
|
|
61
68
|
value.lngLat = {
|
|
@@ -66,10 +73,12 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
66
73
|
value.title = '';
|
|
67
74
|
} else {
|
|
68
75
|
const position = surroundingPois[0];
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
const {
|
|
77
|
+
address,
|
|
78
|
+
title,
|
|
79
|
+
tags,
|
|
80
|
+
point
|
|
81
|
+
} = position;
|
|
73
82
|
value.address = address || '';
|
|
74
83
|
value.title = title || '';
|
|
75
84
|
value.tag = tags || [];
|
|
@@ -84,7 +93,9 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
84
93
|
});
|
|
85
94
|
};
|
|
86
95
|
this.addMarkerByPosition = value => {
|
|
87
|
-
const
|
|
96
|
+
const {
|
|
97
|
+
lngLat
|
|
98
|
+
} = value;
|
|
88
99
|
let point = new window.BMap.Point(lngLat.lng, lngLat.lat);
|
|
89
100
|
const marker = new window.BMap.Marker(point, {
|
|
90
101
|
offset: new window.BMap.Size(-2, -5)
|
|
@@ -102,7 +113,7 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
102
113
|
backgroundColor: '#ffffff',
|
|
103
114
|
boxShadow: '1px 2px 1px rgba(0,0,0,.15)',
|
|
104
115
|
padding: '3px 10px',
|
|
105
|
-
transform:
|
|
116
|
+
transform: `translate(-50%, ${translateY})`,
|
|
106
117
|
borderRadius: '3px',
|
|
107
118
|
fontWeight: '500',
|
|
108
119
|
left: '7px'
|
|
@@ -137,18 +148,39 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
137
148
|
}
|
|
138
149
|
};
|
|
139
150
|
this.getLabelContent = value => {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
151
|
+
const {
|
|
152
|
+
address,
|
|
153
|
+
title,
|
|
154
|
+
tag
|
|
155
|
+
} = value;
|
|
143
156
|
const tagContent = Array.isArray(tag) && tag.length > 0 ? tag[0] : '';
|
|
144
157
|
if (title) {
|
|
145
|
-
return
|
|
158
|
+
return `
|
|
159
|
+
<div class='dtable-ui-selection-label-content' id='dtable-ui-selection-label-content'>
|
|
160
|
+
<i class='dtable-font dtable-icon-down3'></i>
|
|
161
|
+
<span class='label-title text-truncate' title=${title}>${title}</span>
|
|
162
|
+
${tagContent && `<span class='label-tag'>${tagContent}</span>`}
|
|
163
|
+
<span class='dtable-font dtable-icon-x' id='selection-label-close'></span>
|
|
164
|
+
<span class='label-address-tip'>${(0, _lang.getLocale)('Address')}</span>
|
|
165
|
+
<span class='label-address text-truncate' title=${address}>${address}</span>
|
|
166
|
+
<div class='label-submit btn btn-primary' id='selection-label-submit'>${(0, _lang.getLocale)('Fill_in')}</div>
|
|
167
|
+
</div>
|
|
168
|
+
`;
|
|
146
169
|
} else {
|
|
147
|
-
return
|
|
170
|
+
return `
|
|
171
|
+
<div class='dtable-ui-selection-label-content simple' id='dtable-ui-selection-label-content'>
|
|
172
|
+
<i class='dtable-font dtable-icon-down3'></i>
|
|
173
|
+
<span class='dtable-font dtable-icon-x' id='selection-label-close'></span>
|
|
174
|
+
<span class='label-address text-truncate simple' title=${address}>${address}</span>
|
|
175
|
+
<div class='label-submit btn btn-primary' id='selection-label-submit'>${(0, _lang.getLocale)('Fill_in')}</div>
|
|
176
|
+
</div>
|
|
177
|
+
`;
|
|
148
178
|
}
|
|
149
179
|
};
|
|
150
180
|
this.getInitValue = () => {
|
|
151
|
-
const
|
|
181
|
+
const {
|
|
182
|
+
value
|
|
183
|
+
} = this.props;
|
|
152
184
|
if (!value || (0, _dtableUtils.isEmptyObject)(value)) {
|
|
153
185
|
return {
|
|
154
186
|
address: '',
|
|
@@ -160,7 +192,9 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
160
192
|
return value;
|
|
161
193
|
};
|
|
162
194
|
this.onSearch = () => {
|
|
163
|
-
const
|
|
195
|
+
const {
|
|
196
|
+
inputValue
|
|
197
|
+
} = this.state;
|
|
164
198
|
let options = {
|
|
165
199
|
onSearchComplete: results => {
|
|
166
200
|
const status = local.getStatus();
|
|
@@ -223,12 +257,16 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
223
257
|
event.preventDefault();
|
|
224
258
|
event.stopPropagation();
|
|
225
259
|
event.nativeEvent.stopImmediatePropagation();
|
|
226
|
-
const
|
|
260
|
+
const {
|
|
261
|
+
value
|
|
262
|
+
} = this.state;
|
|
227
263
|
this.props.setValue(value);
|
|
228
264
|
this.props.toggleFullScreen(event);
|
|
229
265
|
};
|
|
230
266
|
this.renderSearchResults = () => {
|
|
231
|
-
const
|
|
267
|
+
const {
|
|
268
|
+
searchResults
|
|
269
|
+
} = this.state;
|
|
232
270
|
if (searchResults.length === 0) return null;
|
|
233
271
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
234
272
|
className: "search-results-container",
|
|
@@ -269,9 +307,11 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
269
307
|
const geoCoder = new window.BMap.Geocoder();
|
|
270
308
|
geoCoder.getLocation(point, result => {
|
|
271
309
|
let value = {};
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
310
|
+
const {
|
|
311
|
+
surroundingPois,
|
|
312
|
+
address,
|
|
313
|
+
point
|
|
314
|
+
} = result;
|
|
275
315
|
if (surroundingPois.length === 0) {
|
|
276
316
|
value.address = address;
|
|
277
317
|
value.lngLat = {
|
|
@@ -282,10 +322,12 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
282
322
|
value.title = '';
|
|
283
323
|
} else {
|
|
284
324
|
const position = surroundingPois[0];
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
325
|
+
const {
|
|
326
|
+
address,
|
|
327
|
+
title,
|
|
328
|
+
tags,
|
|
329
|
+
point
|
|
330
|
+
} = position;
|
|
289
331
|
value.address = address || '';
|
|
290
332
|
value.title = title || '';
|
|
291
333
|
value.tag = tags || [];
|
|
@@ -300,13 +342,16 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
300
342
|
_toaster.default.danger((0, _lang.getLocale)('Positioning_failed'));
|
|
301
343
|
}
|
|
302
344
|
};
|
|
303
|
-
const
|
|
304
|
-
|
|
345
|
+
const {
|
|
346
|
+
readOnly,
|
|
347
|
+
config
|
|
348
|
+
} = props;
|
|
305
349
|
const _value = this.getInitValue();
|
|
306
350
|
const _inputValue = _value.title || _value.address || '';
|
|
307
|
-
const
|
|
308
|
-
mapType
|
|
309
|
-
mapKey
|
|
351
|
+
const {
|
|
352
|
+
mapType,
|
|
353
|
+
mapKey
|
|
354
|
+
} = (0, _mapEditorUtils.getMapInfo)(config);
|
|
310
355
|
this.readOnly = readOnly;
|
|
311
356
|
this.state = {
|
|
312
357
|
isLoading: true,
|
|
@@ -342,9 +387,10 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
|
|
|
342
387
|
}
|
|
343
388
|
}
|
|
344
389
|
render() {
|
|
345
|
-
const
|
|
346
|
-
isLoading
|
|
347
|
-
inputValue
|
|
390
|
+
const {
|
|
391
|
+
isLoading,
|
|
392
|
+
inputValue
|
|
393
|
+
} = this.state;
|
|
348
394
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Modal, {
|
|
349
395
|
size: "lg",
|
|
350
396
|
isOpen: true,
|
|
@@ -12,7 +12,7 @@ var _DTableCustomFooter = _interopRequireDefault(require("../../DTableCustomFoot
|
|
|
12
12
|
var _selectorList = _interopRequireDefault(require("./selector-list"));
|
|
13
13
|
var _selectorHeaderItem = _interopRequireDefault(require("./selector-header-item"));
|
|
14
14
|
var _Loading = _interopRequireDefault(require("../../Loading"));
|
|
15
|
-
var
|
|
15
|
+
var _parseGeolocation = _interopRequireDefault(require("./parse-geolocation"));
|
|
16
16
|
var _constants = require("../../constants");
|
|
17
17
|
var _lang = require("../../lang");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -84,7 +84,9 @@ class ProvinceCityEditor extends _react.Component {
|
|
|
84
84
|
this.props.setValue(this.value);
|
|
85
85
|
};
|
|
86
86
|
this.selectSelectorType = type => {
|
|
87
|
-
const
|
|
87
|
+
const {
|
|
88
|
+
selectedProvince
|
|
89
|
+
} = this.state;
|
|
88
90
|
if (!selectedProvince) return;
|
|
89
91
|
this.setState({
|
|
90
92
|
selectedItem: type
|
|
@@ -104,9 +106,10 @@ class ProvinceCityEditor extends _react.Component {
|
|
|
104
106
|
this.timer = null;
|
|
105
107
|
const value = this.parseRef.value;
|
|
106
108
|
if (this.isComposing) return;
|
|
107
|
-
const
|
|
108
|
-
province
|
|
109
|
-
city
|
|
109
|
+
const {
|
|
110
|
+
province,
|
|
111
|
+
city
|
|
112
|
+
} = (0, _parseGeolocation.default)(this.locations, value);
|
|
110
113
|
this.value = Object.assign({}, this.value);
|
|
111
114
|
this.props.setValue(this.value);
|
|
112
115
|
if (!province) return;
|
|
@@ -129,9 +132,10 @@ class ProvinceCityEditor extends _react.Component {
|
|
|
129
132
|
}
|
|
130
133
|
};
|
|
131
134
|
this.onSubmit = () => {
|
|
132
|
-
const
|
|
133
|
-
province
|
|
134
|
-
city
|
|
135
|
+
const {
|
|
136
|
+
province,
|
|
137
|
+
city
|
|
138
|
+
} = this.value;
|
|
135
139
|
if (!province || !city) {
|
|
136
140
|
const errMessage = (0, _lang.getLocale)('Province/City_must_be_filled_in');
|
|
137
141
|
this.setState({
|
|
@@ -158,10 +162,11 @@ class ProvinceCityEditor extends _react.Component {
|
|
|
158
162
|
componentDidMount() {
|
|
159
163
|
this.props.getData().then(data => {
|
|
160
164
|
this.locations = data;
|
|
161
|
-
const
|
|
162
|
-
selectedProvince
|
|
163
|
-
selectedCity
|
|
164
|
-
selectedItem
|
|
165
|
+
const {
|
|
166
|
+
selectedProvince,
|
|
167
|
+
selectedCity,
|
|
168
|
+
selectedItem
|
|
169
|
+
} = this.initLocationSelecting(this.value);
|
|
165
170
|
this.setState({
|
|
166
171
|
isLoadingData: false,
|
|
167
172
|
selectedProvince,
|
|
@@ -171,13 +176,14 @@ class ProvinceCityEditor extends _react.Component {
|
|
|
171
176
|
});
|
|
172
177
|
}
|
|
173
178
|
render() {
|
|
174
|
-
const
|
|
175
|
-
selectedItem
|
|
176
|
-
selectedCity
|
|
177
|
-
selectedProvince
|
|
178
|
-
isShowSelector
|
|
179
|
-
isLoadingData
|
|
180
|
-
location
|
|
179
|
+
const {
|
|
180
|
+
selectedItem,
|
|
181
|
+
selectedCity,
|
|
182
|
+
selectedProvince,
|
|
183
|
+
isShowSelector,
|
|
184
|
+
isLoadingData,
|
|
185
|
+
location
|
|
186
|
+
} = this.state;
|
|
181
187
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
182
188
|
children: [!isLoadingData ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
183
189
|
onClick: this.onClick,
|
|
@@ -191,7 +197,7 @@ class ProvinceCityEditor extends _react.Component {
|
|
|
191
197
|
className: "dtable-ui-geolocation-editor-item-right",
|
|
192
198
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
193
199
|
onClick: this.onToggleSelector,
|
|
194
|
-
className:
|
|
200
|
+
className: `dtable-ui-geolocation-editor-selector text-truncate ${isShowSelector ? 'focus' : ''}`,
|
|
195
201
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
196
202
|
className: "selected-option-show",
|
|
197
203
|
children: location ? location : (0, _lang.getLocale)('Select_province_city')
|
|
@@ -46,7 +46,9 @@ class ProvinceEditor extends _react.Component {
|
|
|
46
46
|
this.onUpArrow = e => {
|
|
47
47
|
e.preventDefault();
|
|
48
48
|
e.stopPropagation();
|
|
49
|
-
let
|
|
49
|
+
let {
|
|
50
|
+
highlightIndex
|
|
51
|
+
} = this.state;
|
|
50
52
|
if (highlightIndex > 0) {
|
|
51
53
|
this.setState({
|
|
52
54
|
highlightIndex: highlightIndex - 1
|
|
@@ -60,7 +62,9 @@ class ProvinceEditor extends _react.Component {
|
|
|
60
62
|
this.onDownArrow = e => {
|
|
61
63
|
e.preventDefault();
|
|
62
64
|
e.stopPropagation();
|
|
63
|
-
let
|
|
65
|
+
let {
|
|
66
|
+
highlightIndex
|
|
67
|
+
} = this.state;
|
|
64
68
|
if (highlightIndex < this.filteredProvince.length - 1) {
|
|
65
69
|
this.setState({
|
|
66
70
|
highlightIndex: highlightIndex + 1
|
|
@@ -120,12 +124,13 @@ class ProvinceEditor extends _react.Component {
|
|
|
120
124
|
}, 300);
|
|
121
125
|
};
|
|
122
126
|
this.createProvinceList = () => {
|
|
123
|
-
const
|
|
124
|
-
value
|
|
125
|
-
highlightIndex
|
|
127
|
+
const {
|
|
128
|
+
value,
|
|
129
|
+
highlightIndex
|
|
130
|
+
} = this.state;
|
|
126
131
|
let provinceList = this.filteredProvince.map((item, index) => {
|
|
127
132
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
128
|
-
className:
|
|
133
|
+
className: `geolocation-region-editor-province ${highlightIndex === index ? 'geolocation-region-editor-province-highlight' : ''}`,
|
|
129
134
|
title: item.name,
|
|
130
135
|
"aria-label": item.name,
|
|
131
136
|
onClick: () => this.onClick(item.name),
|
|
@@ -135,7 +140,7 @@ class ProvinceEditor extends _react.Component {
|
|
|
135
140
|
className: "province-name",
|
|
136
141
|
children: item.name
|
|
137
142
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
138
|
-
className:
|
|
143
|
+
className: `icon ${value === item.name ? 'province-selected-icon dtable-font dtable-icon-check-mark' : ''}`
|
|
139
144
|
})]
|
|
140
145
|
}, item.alphabetic + index);
|
|
141
146
|
});
|
|
@@ -178,7 +183,9 @@ class ProvinceEditor extends _react.Component {
|
|
|
178
183
|
}
|
|
179
184
|
}
|
|
180
185
|
render() {
|
|
181
|
-
const
|
|
186
|
+
const {
|
|
187
|
+
isLoadingData
|
|
188
|
+
} = this.state;
|
|
182
189
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
183
190
|
className: "dtable-ui-geolocation-province-editor",
|
|
184
191
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -10,11 +10,12 @@ var _lang = require("../../lang");
|
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
class SelectorHeaderItem extends _react.default.Component {
|
|
12
12
|
render() {
|
|
13
|
-
const
|
|
14
|
-
type
|
|
15
|
-
clickHandler
|
|
16
|
-
selectedType
|
|
17
|
-
selectedItem
|
|
13
|
+
const {
|
|
14
|
+
type,
|
|
15
|
+
clickHandler,
|
|
16
|
+
selectedType,
|
|
17
|
+
selectedItem
|
|
18
|
+
} = this.props;
|
|
18
19
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
19
20
|
className: 'dtable-ui-geolocation-selector-header-item ' + (selectedType === type ? 'selected-dtable-ui-geolocation-selector-header-item' : ''),
|
|
20
21
|
onClick: () => {
|
|
@@ -9,12 +9,13 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
class SelectorList extends _react.default.Component {
|
|
11
11
|
render() {
|
|
12
|
-
const
|
|
13
|
-
clickHandler
|
|
14
|
-
type
|
|
15
|
-
selectedItem
|
|
16
|
-
parent
|
|
17
|
-
doubleClickHandler
|
|
12
|
+
const {
|
|
13
|
+
clickHandler,
|
|
14
|
+
type,
|
|
15
|
+
selectedItem,
|
|
16
|
+
parent,
|
|
17
|
+
doubleClickHandler
|
|
18
|
+
} = this.props;
|
|
18
19
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
19
20
|
className: "dtable-ui-geolocation-selector-list",
|
|
20
21
|
children: parent.children.map((item, index) => {
|
|
@@ -24,7 +25,7 @@ class SelectorList extends _react.default.Component {
|
|
|
24
25
|
onDoubleClick: () => {
|
|
25
26
|
doubleClickHandler && doubleClickHandler(item);
|
|
26
27
|
},
|
|
27
|
-
className:
|
|
28
|
+
className: `dtable-ui-geolocation-selector-list-item ${type === 'province' ? 'province-item' : ''} ${isSelected ? 'selected-list-item' : ''}`,
|
|
28
29
|
children: item.name
|
|
29
30
|
}, type + '-item-' + index);
|
|
30
31
|
})
|