dtable-ui-component 6.0.126 → 7.0.0-xia.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ActionSheet/index.js +16 -14
- package/lib/ActivityIndicator/index.js +8 -7
- package/lib/AsyncUserSelect/index.js +19 -40
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +11 -9
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +3 -1
- 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 +4 -2
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +34 -25
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +7 -9
- package/lib/Comment/body/comment.js +18 -10
- package/lib/Comment/body/index.js +4 -2
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +20 -9
- package/lib/Comment/footer/input/index.js +50 -29
- package/lib/Comment/footer/input/participant/index.js +5 -4
- 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 +24 -8
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +21 -15
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +18 -22
- package/lib/DTableColorPicker/index.js +40 -55
- package/lib/DTableColorPicker/utils.js +6 -4
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +8 -6
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeCollaboratorSelect/index.js +20 -17
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +18 -16
- package/lib/DTableDropdownMenu/index.js +10 -8
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +50 -34
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +113 -63
- 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 +56 -35
- package/lib/DTableFiltersPopover/widgets/filter-item.js +171 -108
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +161 -136
- package/lib/DTableFiltersPopover/widgets/rate-item.js +20 -15
- package/lib/DTableGroupSelect/index.js +15 -11
- package/lib/DTableGroupSelect/select-option-group.js +32 -23
- package/lib/DTableIcon/index.js +7 -6
- package/lib/DTableIcon/svg-icon.js +7 -5
- package/lib/DTableModalHeader/index.css +3 -20
- package/lib/DTableModalHeader/index.js +3 -1
- package/lib/DTablePopover/index.js +15 -11
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +17 -8
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +5 -6
- package/lib/DTableSelect/index.js +22 -21
- package/lib/DTableSelect/utils.js +15 -7
- package/lib/DTableSubDropdownMenu/index.js +10 -8
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +8 -7
- package/lib/DateEditor/index.js +15 -20
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +45 -26
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +3 -1
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +23 -25
- package/lib/DepartmentSelectFilter/index.js +8 -6
- package/lib/DepartmentSingleSelectEditor/index.js +3 -1
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +47 -48
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +58 -36
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +3 -1
- package/lib/DigitalSignEditor/mb-editor/index.js +20 -12
- package/lib/DigitalSignEditor/pc-editor/index.js +24 -17
- package/lib/DigitalSignEditor/service.js +4 -2
- package/lib/DigitalSignEditor/signature-board/index.js +8 -5
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +5 -4
- 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 +12 -12
- package/lib/FieldDisplaySetting/index.js +10 -12
- package/lib/FileEditor/files-previewer/index.js +3 -1
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +18 -10
- 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 +21 -14
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +3 -1
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +3 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +25 -11
- package/lib/FileEditor/pc-editor/index.js +27 -19
- package/lib/FileFormatter/index.js +19 -26
- package/lib/FileItemFormatter/index.js +9 -6
- package/lib/FileUploader/index.js +45 -28
- package/lib/FormulaFormatter/index.js +29 -15
- package/lib/GeolocationEditor/index.js +12 -11
- package/lib/GeolocationEditor/map-editor-utils.js +15 -17
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +6 -4
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +68 -41
- 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 +23 -10
- package/lib/GeolocationEditor/pc-editor/index.js +20 -12
- package/lib/GeolocationEditor/pc-editor/location-editor.js +31 -26
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +54 -34
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +60 -36
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +62 -35
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +65 -36
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +25 -19
- package/lib/GeolocationEditor/pc-editor/province-editor.js +13 -6
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +7 -6
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +12 -4
- package/lib/Icon/index.js +5 -3
- package/lib/IconButton/index.js +6 -4
- package/lib/ImageEditor/images-previewer/image-preview/index.js +21 -12
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +3 -1
- 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 +3 -1
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +21 -7
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +13 -11
- package/lib/ImagePreviewerLightbox/index.js +13 -15
- package/lib/ImageThumbnail/index.js +13 -10
- package/lib/InputItem/custom-input.js +46 -26
- package/lib/InputItem/custom-keyboard.js +18 -15
- package/lib/InputItem/index.js +50 -34
- package/lib/InputItem/input.js +4 -2
- 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 +10 -5
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +8 -6
- package/lib/List/list-item.js +28 -22
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +8 -7
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +5 -3
- package/lib/MobileFullScreenPage/header/index.js +6 -4
- package/lib/MobileFullScreenPage/index.js +11 -13
- package/lib/MobileModal/index.js +3 -1
- 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.js +3 -1
- package/lib/MobileSelector/search/index.js +5 -3
- package/lib/MobileUpload/index.js +5 -4
- package/lib/Modal/modal.js +15 -14
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +3 -1
- package/lib/MultipleSelectFormatter/index.js +8 -6
- 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 +4 -2
- package/lib/Picker/AbstractPicker.js +27 -23
- package/lib/Popover/index.js +4 -3
- package/lib/Popover/item.js +9 -7
- package/lib/Progress/index.js +8 -9
- package/lib/Radio/Radio.js +8 -4
- package/lib/Radio/RadioItem.js +12 -8
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +17 -18
- package/lib/RowExpandDialog/body/index.js +49 -32
- package/lib/RowExpandDialog/column-content/index.js +9 -5
- package/lib/RowExpandDialog/header/index.js +8 -6
- package/lib/RowExpandDialog/index.js +34 -49
- 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/mb-editor/index.js +33 -22
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
- 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/mb-editor.js +11 -16
- package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +34 -20
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +35 -21
- 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/mb-editor/index.js +19 -9
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +24 -13
- 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/mb-editor/index.js +29 -17
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +25 -15
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +23 -13
- package/lib/RowExpandEditor/index.js +8 -4
- 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/mb-editor/index.js +19 -11
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +33 -22
- 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/mb-editor.js +25 -12
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +36 -20
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +28 -17
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +34 -22
- 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/mb-editor/index.js +13 -5
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +18 -9
- 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 +7 -4
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +12 -10
- package/lib/RowExpandFormatter/formula-formatter/index.js +34 -19
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +8 -7
- package/lib/RowExpandFormatter/index.js +41 -27
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +14 -8
- package/lib/RowExpandFormatter/link-formatter/index.js +19 -11
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +12 -11
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +7 -4
- package/lib/RowExpandView/body/index.js +35 -22
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +30 -42
- package/lib/SelectItem/index.js +8 -6
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +9 -7
- package/lib/SimpleLongTextFormatter/index.js +16 -10
- 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 +3 -1
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +16 -14
- package/lib/TabBar/index.js +21 -18
- package/lib/Tabs/index.js +3 -1
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +26 -19
- package/lib/Toast/index.js +4 -3
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +3 -1
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +42 -27
- package/lib/toaster/alert.js +7 -6
- package/lib/toaster/toast.js +3 -2
- package/lib/toaster/toastManager.js +4 -2
- package/lib/utils/cell.js +11 -8
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +3 -1
- package/lib/utils/url.js +31 -24
- package/lib/utils/utils.js +6 -2
- package/package.json +1 -1
|
@@ -50,12 +50,13 @@ class MapEditor extends _react.Component {
|
|
|
50
50
|
this.loadMineMapCallBack = () => {
|
|
51
51
|
if (!this.timer) {
|
|
52
52
|
this.timer = setTimeout(() => {
|
|
53
|
-
const
|
|
54
|
-
domainUrl
|
|
55
|
-
dataDomainUrl
|
|
56
|
-
serverDomainUrl
|
|
57
|
-
spriteUrl
|
|
58
|
-
serviceUrl
|
|
53
|
+
const {
|
|
54
|
+
domainUrl,
|
|
55
|
+
dataDomainUrl,
|
|
56
|
+
serverDomainUrl,
|
|
57
|
+
spriteUrl,
|
|
58
|
+
serviceUrl
|
|
59
|
+
} = (0, _mapEditorUtils.getMineMapUrl)();
|
|
59
60
|
window.minemap.domainUrl = domainUrl;
|
|
60
61
|
window.minemap.dataDomainUrl = dataDomainUrl;
|
|
61
62
|
window.minemap.serverDomainUrl = serverDomainUrl;
|
|
@@ -82,11 +83,14 @@ class MapEditor extends _react.Component {
|
|
|
82
83
|
minZoom: 3,
|
|
83
84
|
projection: 'MERCATOR'
|
|
84
85
|
});
|
|
85
|
-
let
|
|
86
|
-
lng
|
|
87
|
-
lat
|
|
88
|
-
zoom
|
|
89
|
-
|
|
86
|
+
let {
|
|
87
|
+
lng,
|
|
88
|
+
lat,
|
|
89
|
+
zoom
|
|
90
|
+
} = (0, _mapEditorUtils.getInitCenter)();
|
|
91
|
+
const {
|
|
92
|
+
value
|
|
93
|
+
} = this.state;
|
|
90
94
|
if ((0, _cell.isValidPosition)(value.lng, value.lat)) {
|
|
91
95
|
lng = value.lng;
|
|
92
96
|
lat = value.lat;
|
|
@@ -110,11 +114,14 @@ class MapEditor extends _react.Component {
|
|
|
110
114
|
this.map = new window.BMap.Map('geolocation-map-container', {
|
|
111
115
|
enableMapClick: false
|
|
112
116
|
});
|
|
113
|
-
let
|
|
114
|
-
lng
|
|
115
|
-
lat
|
|
116
|
-
zoom
|
|
117
|
-
|
|
117
|
+
let {
|
|
118
|
+
lng,
|
|
119
|
+
lat,
|
|
120
|
+
zoom
|
|
121
|
+
} = (0, _mapEditorUtils.getInitCenter)();
|
|
122
|
+
const {
|
|
123
|
+
value
|
|
124
|
+
} = this.state;
|
|
118
125
|
if ((0, _cell.isValidPosition)(value.lng, value.lat)) {
|
|
119
126
|
lng = value.lng;
|
|
120
127
|
lat = value.lat;
|
|
@@ -149,10 +156,11 @@ class MapEditor extends _react.Component {
|
|
|
149
156
|
this.setState({
|
|
150
157
|
isLoading: false
|
|
151
158
|
}, () => {
|
|
152
|
-
let
|
|
153
|
-
lng
|
|
154
|
-
lat
|
|
155
|
-
zoom
|
|
159
|
+
let {
|
|
160
|
+
lng,
|
|
161
|
+
lat,
|
|
162
|
+
zoom
|
|
163
|
+
} = (0, _mapEditorUtils.getInitCenter)();
|
|
156
164
|
this.map = new window.google.maps.Map(this.ref, {
|
|
157
165
|
zoom,
|
|
158
166
|
center: {
|
|
@@ -166,7 +174,9 @@ class MapEditor extends _react.Component {
|
|
|
166
174
|
rotateControl: false,
|
|
167
175
|
fullscreenControl: false
|
|
168
176
|
});
|
|
169
|
-
const
|
|
177
|
+
const {
|
|
178
|
+
value
|
|
179
|
+
} = this.state;
|
|
170
180
|
if (value.lng && value.lat) {
|
|
171
181
|
lng = value.lng;
|
|
172
182
|
lat = value.lat;
|
|
@@ -201,8 +211,10 @@ class MapEditor extends _react.Component {
|
|
|
201
211
|
});
|
|
202
212
|
};
|
|
203
213
|
this.setPropsValue = _ref => {
|
|
204
|
-
let
|
|
205
|
-
|
|
214
|
+
let {
|
|
215
|
+
lng,
|
|
216
|
+
lat
|
|
217
|
+
} = _ref;
|
|
206
218
|
if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) {
|
|
207
219
|
this.props.setValue(null);
|
|
208
220
|
return;
|
|
@@ -266,7 +278,9 @@ class MapEditor extends _react.Component {
|
|
|
266
278
|
event.preventDefault();
|
|
267
279
|
event.stopPropagation();
|
|
268
280
|
event.nativeEvent.stopImmediatePropagation();
|
|
269
|
-
const
|
|
281
|
+
const {
|
|
282
|
+
value
|
|
283
|
+
} = this.state;
|
|
270
284
|
const numericValue = (0, _dtableUtils.normalizeMapPoint)(value);
|
|
271
285
|
this.setPropsValue(numericValue);
|
|
272
286
|
this.setState({
|
|
@@ -283,8 +297,10 @@ class MapEditor extends _react.Component {
|
|
|
283
297
|
this.props.onSubmit();
|
|
284
298
|
};
|
|
285
299
|
this.rerenderMapMarker = _ref2 => {
|
|
286
|
-
let
|
|
287
|
-
|
|
300
|
+
let {
|
|
301
|
+
lng,
|
|
302
|
+
lat
|
|
303
|
+
} = _ref2;
|
|
288
304
|
if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) return;
|
|
289
305
|
if (this.map) {
|
|
290
306
|
if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP || this.mapType === _mapEditorUtils.MAP_TYPES.M_MAP) {
|
|
@@ -299,7 +315,9 @@ class MapEditor extends _react.Component {
|
|
|
299
315
|
this.addMarkerByPosition(lng, lat);
|
|
300
316
|
};
|
|
301
317
|
this.onBlur = () => {
|
|
302
|
-
const
|
|
318
|
+
const {
|
|
319
|
+
value
|
|
320
|
+
} = this.state;
|
|
303
321
|
const numericValue = (0, _dtableUtils.normalizeMapPoint)(value);
|
|
304
322
|
this.setState({
|
|
305
323
|
value: numericValue
|
|
@@ -351,9 +369,10 @@ class MapEditor extends _react.Component {
|
|
|
351
369
|
lng: '',
|
|
352
370
|
lat: ''
|
|
353
371
|
};
|
|
354
|
-
const
|
|
355
|
-
mapType
|
|
356
|
-
mapKey
|
|
372
|
+
const {
|
|
373
|
+
mapType,
|
|
374
|
+
mapKey
|
|
375
|
+
} = (0, _mapEditorUtils.getMapInfo)(props.config);
|
|
357
376
|
this.mapType = mapType;
|
|
358
377
|
this.mapKey = mapKey;
|
|
359
378
|
this.readOnly = props.readOnly;
|
|
@@ -389,10 +408,11 @@ class MapEditor extends _react.Component {
|
|
|
389
408
|
this.onSubmit();
|
|
390
409
|
}
|
|
391
410
|
render() {
|
|
392
|
-
const
|
|
393
|
-
isLoading
|
|
394
|
-
lng_lat
|
|
395
|
-
isShowLargeEditor
|
|
411
|
+
const {
|
|
412
|
+
isLoading,
|
|
413
|
+
value: lng_lat,
|
|
414
|
+
isShowLargeEditor
|
|
415
|
+
} = this.state;
|
|
396
416
|
const lat = lng_lat && !(0, _dtableUtils.isEmpty)(lng_lat.lat) ? lng_lat.lat : '';
|
|
397
417
|
const lng = lng_lat && !(0, _dtableUtils.isEmpty)(lng_lat.lng) ? lng_lat.lng : '';
|
|
398
418
|
if (!isShowLargeEditor) {
|
|
@@ -23,12 +23,13 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
23
23
|
this.loadMineMapCallBack = () => {
|
|
24
24
|
if (!this.timer) {
|
|
25
25
|
this.timer = setTimeout(() => {
|
|
26
|
-
const
|
|
27
|
-
domainUrl
|
|
28
|
-
dataDomainUrl
|
|
29
|
-
serverDomainUrl
|
|
30
|
-
spriteUrl
|
|
31
|
-
serviceUrl
|
|
26
|
+
const {
|
|
27
|
+
domainUrl,
|
|
28
|
+
dataDomainUrl,
|
|
29
|
+
serverDomainUrl,
|
|
30
|
+
spriteUrl,
|
|
31
|
+
serviceUrl
|
|
32
|
+
} = (0, _mapEditorUtils.getMineMapUrl)();
|
|
32
33
|
window.minemap.domainUrl = domainUrl;
|
|
33
34
|
window.minemap.dataDomainUrl = dataDomainUrl;
|
|
34
35
|
window.minemap.serverDomainUrl = serverDomainUrl;
|
|
@@ -55,11 +56,14 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
55
56
|
minZoom: 3,
|
|
56
57
|
projection: 'MERCATOR'
|
|
57
58
|
});
|
|
58
|
-
let
|
|
59
|
-
lng
|
|
60
|
-
lat
|
|
61
|
-
zoom
|
|
62
|
-
|
|
59
|
+
let {
|
|
60
|
+
lng,
|
|
61
|
+
lat,
|
|
62
|
+
zoom
|
|
63
|
+
} = (0, _mapEditorUtils.getInitCenter)();
|
|
64
|
+
const {
|
|
65
|
+
value
|
|
66
|
+
} = this.state;
|
|
63
67
|
if ((0, _cell.isValidPosition)(value.lng, value.lat)) {
|
|
64
68
|
lng = value.lng;
|
|
65
69
|
lat = value.lat;
|
|
@@ -81,11 +85,14 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
81
85
|
}, () => {
|
|
82
86
|
if (!window.BMap.Map) return;
|
|
83
87
|
this.map = new window.BMap.Map('geolocation-map-container-large');
|
|
84
|
-
let
|
|
85
|
-
lng
|
|
86
|
-
lat
|
|
87
|
-
zoom
|
|
88
|
-
|
|
88
|
+
let {
|
|
89
|
+
lng,
|
|
90
|
+
lat,
|
|
91
|
+
zoom
|
|
92
|
+
} = (0, _mapEditorUtils.getInitCenter)();
|
|
93
|
+
const {
|
|
94
|
+
value
|
|
95
|
+
} = this.state;
|
|
89
96
|
if ((0, _cell.isValidPosition)(value.lng, value.lat)) {
|
|
90
97
|
lng = value.lng;
|
|
91
98
|
lat = value.lat;
|
|
@@ -106,10 +113,11 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
106
113
|
this.setState({
|
|
107
114
|
isLoading: false
|
|
108
115
|
}, () => {
|
|
109
|
-
let
|
|
110
|
-
lng
|
|
111
|
-
lat
|
|
112
|
-
zoom
|
|
116
|
+
let {
|
|
117
|
+
lng,
|
|
118
|
+
lat,
|
|
119
|
+
zoom
|
|
120
|
+
} = (0, _mapEditorUtils.getInitCenter)();
|
|
113
121
|
this.map = new window.google.maps.Map(this.ref, {
|
|
114
122
|
zoom,
|
|
115
123
|
center: {
|
|
@@ -123,7 +131,9 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
123
131
|
rotateControl: false,
|
|
124
132
|
fullscreenControl: false
|
|
125
133
|
});
|
|
126
|
-
const
|
|
134
|
+
const {
|
|
135
|
+
value
|
|
136
|
+
} = this.state;
|
|
127
137
|
if (value.lng && value.lat) {
|
|
128
138
|
lng = value.lng;
|
|
129
139
|
lat = value.lat;
|
|
@@ -160,8 +170,10 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
160
170
|
}
|
|
161
171
|
};
|
|
162
172
|
this.setPropsValue = _ref => {
|
|
163
|
-
let
|
|
164
|
-
|
|
173
|
+
let {
|
|
174
|
+
lng,
|
|
175
|
+
lat
|
|
176
|
+
} = _ref;
|
|
165
177
|
if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) {
|
|
166
178
|
this.props.setValue(null);
|
|
167
179
|
return;
|
|
@@ -229,8 +241,10 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
229
241
|
}
|
|
230
242
|
};
|
|
231
243
|
this.rerenderMapMarker = _ref2 => {
|
|
232
|
-
let
|
|
233
|
-
|
|
244
|
+
let {
|
|
245
|
+
lng,
|
|
246
|
+
lat
|
|
247
|
+
} = _ref2;
|
|
234
248
|
if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) return;
|
|
235
249
|
if (this.map) {
|
|
236
250
|
if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP || this.mapType === _mapEditorUtils.MAP_TYPES.M_MAP) {
|
|
@@ -245,7 +259,9 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
245
259
|
this.addMarkerByPosition(lng, lat);
|
|
246
260
|
};
|
|
247
261
|
this.onBlur = () => {
|
|
248
|
-
const
|
|
262
|
+
const {
|
|
263
|
+
value
|
|
264
|
+
} = this.state;
|
|
249
265
|
const numericValue = (0, _dtableUtils.normalizeMapPoint)(value);
|
|
250
266
|
this.setState({
|
|
251
267
|
value: numericValue
|
|
@@ -283,7 +299,9 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
283
299
|
}
|
|
284
300
|
};
|
|
285
301
|
this.onSubmit = () => {
|
|
286
|
-
const
|
|
302
|
+
const {
|
|
303
|
+
value
|
|
304
|
+
} = this.state;
|
|
287
305
|
this.props.setValue(value);
|
|
288
306
|
this.props.onSubmit();
|
|
289
307
|
};
|
|
@@ -304,7 +322,9 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
304
322
|
event.preventDefault();
|
|
305
323
|
event.stopPropagation();
|
|
306
324
|
event.nativeEvent.stopImmediatePropagation();
|
|
307
|
-
const
|
|
325
|
+
const {
|
|
326
|
+
value
|
|
327
|
+
} = this.state;
|
|
308
328
|
this.props.setValue(value);
|
|
309
329
|
this.props.toggleFullScreen(event);
|
|
310
330
|
};
|
|
@@ -313,16 +333,19 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
313
333
|
e.nativeEvent.stopImmediatePropagation();
|
|
314
334
|
e.stopPropagation();
|
|
315
335
|
};
|
|
316
|
-
const
|
|
317
|
-
|
|
336
|
+
const {
|
|
337
|
+
readOnly,
|
|
338
|
+
config
|
|
339
|
+
} = props;
|
|
318
340
|
const _value = props.value || {
|
|
319
341
|
lng: '',
|
|
320
342
|
lat: ''
|
|
321
343
|
};
|
|
322
344
|
this.readOnly = readOnly;
|
|
323
|
-
const
|
|
324
|
-
mapType
|
|
325
|
-
mapKey
|
|
345
|
+
const {
|
|
346
|
+
mapType,
|
|
347
|
+
mapKey
|
|
348
|
+
} = (0, _mapEditorUtils.getMapInfo)(config);
|
|
326
349
|
this.mapType = mapType;
|
|
327
350
|
this.mapKey = mapKey;
|
|
328
351
|
this.map = null;
|
|
@@ -377,9 +400,10 @@ class LargeMapEditorDialog extends _react.default.Component {
|
|
|
377
400
|
this.map = null;
|
|
378
401
|
}
|
|
379
402
|
render() {
|
|
380
|
-
const
|
|
381
|
-
isLoading
|
|
382
|
-
lng_lat
|
|
403
|
+
const {
|
|
404
|
+
isLoading,
|
|
405
|
+
value: lng_lat
|
|
406
|
+
} = this.state;
|
|
383
407
|
const lat = lng_lat && !(0, _dtableUtils.isEmpty)(lng_lat.lat) ? lng_lat.lat : '';
|
|
384
408
|
const lng = lng_lat && !(0, _dtableUtils.isEmpty)(lng_lat.lng) ? lng_lat.lng : '';
|
|
385
409
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Modal, {
|
|
@@ -40,12 +40,17 @@ class MapSelectionEditor extends _react.Component {
|
|
|
40
40
|
this.map = new window.BMap.Map('geolocation-map-selection-container', {
|
|
41
41
|
enableMapClick: false
|
|
42
42
|
});
|
|
43
|
-
let
|
|
44
|
-
lng
|
|
45
|
-
lat
|
|
46
|
-
zoom
|
|
47
|
-
|
|
48
|
-
const
|
|
43
|
+
let {
|
|
44
|
+
lng,
|
|
45
|
+
lat,
|
|
46
|
+
zoom
|
|
47
|
+
} = (0, _mapEditorUtils.getInitCenter)(true);
|
|
48
|
+
const {
|
|
49
|
+
value
|
|
50
|
+
} = this.state;
|
|
51
|
+
const {
|
|
52
|
+
lngLat
|
|
53
|
+
} = value;
|
|
49
54
|
if ((0, _cell.isValidPosition)(lngLat.lng, lngLat.lat)) {
|
|
50
55
|
lng = lngLat.lng;
|
|
51
56
|
lat = lngLat.lat;
|
|
@@ -66,9 +71,11 @@ class MapSelectionEditor extends _react.Component {
|
|
|
66
71
|
const point = event.point;
|
|
67
72
|
const geoCoder = new window.BMap.Geocoder();
|
|
68
73
|
geoCoder.getLocation(point, result => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
const {
|
|
75
|
+
surroundingPois,
|
|
76
|
+
address,
|
|
77
|
+
point
|
|
78
|
+
} = result;
|
|
72
79
|
if (surroundingPois.length === 0) {
|
|
73
80
|
value.address = address;
|
|
74
81
|
value.lngLat = {
|
|
@@ -79,10 +86,12 @@ class MapSelectionEditor extends _react.Component {
|
|
|
79
86
|
value.title = '';
|
|
80
87
|
} else {
|
|
81
88
|
const position = surroundingPois[0];
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
const {
|
|
90
|
+
address,
|
|
91
|
+
title,
|
|
92
|
+
tags,
|
|
93
|
+
point
|
|
94
|
+
} = position;
|
|
86
95
|
value.address = address || '';
|
|
87
96
|
value.title = title || '';
|
|
88
97
|
value.tag = tags || [];
|
|
@@ -97,7 +106,9 @@ class MapSelectionEditor extends _react.Component {
|
|
|
97
106
|
});
|
|
98
107
|
};
|
|
99
108
|
this.addMarkerByPosition = value => {
|
|
100
|
-
const
|
|
109
|
+
const {
|
|
110
|
+
lngLat
|
|
111
|
+
} = value;
|
|
101
112
|
let point = new window.BMap.Point(lngLat.lng, lngLat.lat);
|
|
102
113
|
const marker = new window.BMap.Marker(point, {
|
|
103
114
|
offset: new window.BMap.Size(-2, -5)
|
|
@@ -150,9 +161,11 @@ class MapSelectionEditor extends _react.Component {
|
|
|
150
161
|
}
|
|
151
162
|
};
|
|
152
163
|
this.getLabelContent = value => {
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
164
|
+
const {
|
|
165
|
+
address,
|
|
166
|
+
title,
|
|
167
|
+
tag
|
|
168
|
+
} = value;
|
|
156
169
|
const tagContent = Array.isArray(tag) && tag.length > 0 ? tag[0] : '';
|
|
157
170
|
if (title) {
|
|
158
171
|
return "\n <div class='dtable-ui-selection-label-content' id='dtable-ui-selection-label-content'>\n <i class='dtable-font dtable-icon-down3'></i>\n <span class='label-title text-truncate' title=".concat(title, ">").concat(title, "</span>\n ").concat(tagContent && "<span class='label-tag'>".concat(tagContent, "</span>"), "\n <span class='dtable-font dtable-icon-x' id='selection-label-close'></span>\n <span class='label-address-tip'>").concat((0, _lang.getLocale)('Address'), "</span>\n <span class='label-address text-truncate' title=").concat(address, ">").concat(address, "</span>\n <div class='label-submit btn btn-primary' id='selection-label-submit'>").concat((0, _lang.getLocale)('Fill_in'), "</div>\n </div>\n ");
|
|
@@ -160,7 +173,9 @@ class MapSelectionEditor extends _react.Component {
|
|
|
160
173
|
return "\n <div class='dtable-ui-selection-label-content simple' id='dtable-ui-selection-label-content'>\n <i class='dtable-font dtable-icon-down3'></i>\n <span class='dtable-font dtable-icon-x' id='selection-label-close'></span>\n <span class='label-address text-truncate simple' title=".concat(address, ">").concat(address, "</span>\n <div class='label-submit btn btn-primary' id='selection-label-submit'>").concat((0, _lang.getLocale)('Fill_in'), "</div>\n </div>\n ");
|
|
161
174
|
};
|
|
162
175
|
this.getInitValue = () => {
|
|
163
|
-
const
|
|
176
|
+
const {
|
|
177
|
+
value
|
|
178
|
+
} = this.props;
|
|
164
179
|
if (!value || (0, _dtableUtils.isEmptyObject)(value)) {
|
|
165
180
|
return {
|
|
166
181
|
address: '',
|
|
@@ -172,7 +187,9 @@ class MapSelectionEditor extends _react.Component {
|
|
|
172
187
|
return value;
|
|
173
188
|
};
|
|
174
189
|
this.onSearch = () => {
|
|
175
|
-
const
|
|
190
|
+
const {
|
|
191
|
+
inputValue
|
|
192
|
+
} = this.state;
|
|
176
193
|
let options = {
|
|
177
194
|
onSearchComplete: results => {
|
|
178
195
|
const status = local.getStatus();
|
|
@@ -229,7 +246,9 @@ class MapSelectionEditor extends _react.Component {
|
|
|
229
246
|
event.preventDefault();
|
|
230
247
|
event.stopPropagation();
|
|
231
248
|
event.nativeEvent.stopImmediatePropagation();
|
|
232
|
-
const
|
|
249
|
+
const {
|
|
250
|
+
value
|
|
251
|
+
} = this.state;
|
|
233
252
|
this.props.setValue(value);
|
|
234
253
|
this.setState({
|
|
235
254
|
isShowLargeEditor: !this.state.isShowLargeEditor
|
|
@@ -252,9 +271,11 @@ class MapSelectionEditor extends _react.Component {
|
|
|
252
271
|
const geoCoder = new window.BMap.Geocoder();
|
|
253
272
|
geoCoder.getLocation(point, result => {
|
|
254
273
|
let value = {};
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
274
|
+
const {
|
|
275
|
+
surroundingPois,
|
|
276
|
+
address,
|
|
277
|
+
point
|
|
278
|
+
} = result;
|
|
258
279
|
if (surroundingPois.length === 0) {
|
|
259
280
|
value.address = address;
|
|
260
281
|
value.lngLat = {
|
|
@@ -265,10 +286,12 @@ class MapSelectionEditor extends _react.Component {
|
|
|
265
286
|
value.title = '';
|
|
266
287
|
} else {
|
|
267
288
|
const position = surroundingPois[0];
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
289
|
+
const {
|
|
290
|
+
address,
|
|
291
|
+
title,
|
|
292
|
+
tags,
|
|
293
|
+
point
|
|
294
|
+
} = position;
|
|
272
295
|
value.address = address || '';
|
|
273
296
|
value.title = title || '';
|
|
274
297
|
value.tag = tags || [];
|
|
@@ -297,7 +320,9 @@ class MapSelectionEditor extends _react.Component {
|
|
|
297
320
|
(0, _mapEditorUtils.locateCurrentPosition)(this.map, this.mapType, this.geolocationCallback);
|
|
298
321
|
};
|
|
299
322
|
this.renderSearchResults = () => {
|
|
300
|
-
const
|
|
323
|
+
const {
|
|
324
|
+
searchResults
|
|
325
|
+
} = this.state;
|
|
301
326
|
if (searchResults.length === 0) return null;
|
|
302
327
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
303
328
|
className: "search-results-container",
|
|
@@ -319,9 +344,10 @@ class MapSelectionEditor extends _react.Component {
|
|
|
319
344
|
const _value = this.getInitValue();
|
|
320
345
|
this.readOnly = props.readOnly;
|
|
321
346
|
const _inputValue = _value.title || _value.address || '';
|
|
322
|
-
const
|
|
323
|
-
mapType
|
|
324
|
-
mapKey
|
|
347
|
+
const {
|
|
348
|
+
mapType,
|
|
349
|
+
mapKey
|
|
350
|
+
} = (0, _mapEditorUtils.getMapInfo)(props.config);
|
|
325
351
|
this.state = {
|
|
326
352
|
isLoading: true,
|
|
327
353
|
value: _value,
|
|
@@ -350,10 +376,11 @@ class MapSelectionEditor extends _react.Component {
|
|
|
350
376
|
}
|
|
351
377
|
}
|
|
352
378
|
render() {
|
|
353
|
-
const
|
|
354
|
-
isLoading
|
|
355
|
-
inputValue
|
|
356
|
-
isShowLargeEditor
|
|
379
|
+
const {
|
|
380
|
+
isLoading,
|
|
381
|
+
inputValue,
|
|
382
|
+
isShowLargeEditor
|
|
383
|
+
} = this.state;
|
|
357
384
|
if (isShowLargeEditor) {
|
|
358
385
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_largeEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.props), {}, {
|
|
359
386
|
toggleFullScreen: this.toggleFullScreen
|