dtable-ui-component 6.0.29-beta2 → 6.0.29-beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/BodyPortal/index.js +29 -0
- package/lib/CheckboxEditor/index.js +24 -118
- package/lib/CheckboxEditor/mb-editor.js +101 -0
- package/lib/CheckboxEditor/pc-editor.js +118 -0
- package/lib/CheckboxFormatter/index.css +1 -1
- package/lib/CheckboxFormatter/index.js +10 -25
- package/lib/CollaboratorEditor/index.js +23 -11
- package/lib/CollaboratorEditor/mb-editor/index.css +41 -0
- package/lib/CollaboratorEditor/mb-editor/index.js +88 -0
- package/lib/DTableCommonAddTool/index.js +1 -3
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +6 -6
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +6 -6
- package/lib/DateEditor/index.js +69 -95
- package/lib/DateEditor/mb-editor/custom-rc-calendar.css +118 -0
- package/lib/DateEditor/mb-editor/index.css +39 -0
- package/lib/DateEditor/mb-editor/index.js +215 -0
- package/lib/DateEditor/{pc-date-editor-popover.js → pc-editor.js} +9 -9
- package/lib/{Department-editor/department-multiple-select → DepartmentMultipleSelectEditor}/index.js +6 -6
- package/lib/DepartmentSingleSelectEditor/index.js +34 -0
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.css +4 -0
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +230 -0
- package/lib/{Department-editor → DepartmentSingleSelectEditor/pc-editor}/department-single-select.js +6 -6
- package/lib/{Department-editor → DepartmentSingleSelectEditor/pc-editor}/index.css +8 -3
- package/lib/{Department-editor → DepartmentSingleSelectEditor/pc-editor}/index.js +8 -25
- package/lib/DigitalSignEditor/index.js +24 -171
- package/lib/DigitalSignEditor/mb-editor/index.css +35 -0
- package/lib/DigitalSignEditor/mb-editor/index.js +144 -0
- package/lib/DigitalSignEditor/pc-editor/index.js +181 -0
- package/lib/FileEditor/files-previewer/index.js +26 -268
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +122 -0
- package/lib/FileEditor/files-previewer/mb-previewer/index.css +39 -0
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +64 -0
- package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/dropdown-menu.js +1 -1
- package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/file-name-editor/index.js +1 -1
- package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/index.css +0 -2
- package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/index.js +2 -2
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +276 -0
- package/lib/FileEditor/index.css +0 -5
- package/lib/FileEditor/index.js +26 -265
- package/lib/FileEditor/mb-editor/index.css +10 -0
- package/lib/FileEditor/mb-editor/index.js +136 -0
- package/lib/FileEditor/pc-editor/addition-previewer/index.css +1 -0
- package/lib/FileEditor/{addition-previewer → pc-editor/addition-previewer}/index.js +1 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.css +1 -0
- package/lib/FileEditor/{addition-previewer → pc-editor/addition-previewer}/local-file-addition/index.js +4 -4
- package/lib/FileEditor/pc-editor/index.css +5 -0
- package/lib/FileEditor/pc-editor/index.js +274 -0
- package/lib/FormulaFormatter/index.css +5 -5
- package/lib/GeolocationEditor/index.js +90 -230
- package/lib/GeolocationEditor/map-editor-utils.js +6 -2
- package/lib/GeolocationEditor/mb-editor/country-editor.js +79 -0
- package/lib/GeolocationEditor/mb-editor/index.css +11 -0
- package/lib/GeolocationEditor/mb-editor/index.js +125 -0
- package/lib/GeolocationEditor/mb-editor/location-editor.js +101 -0
- package/lib/GeolocationEditor/mb-editor/map-editor/index.css +11 -0
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +474 -0
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.css +158 -0
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +530 -0
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +77 -0
- package/lib/GeolocationEditor/mb-editor/province-editor.js +76 -0
- package/lib/GeolocationEditor/{country-editor.js → pc-editor/country-editor.js} +5 -50
- package/lib/GeolocationEditor/{index.css → pc-editor/index.css} +3 -4
- package/lib/GeolocationEditor/pc-editor/index.js +247 -0
- package/lib/GeolocationEditor/{location-editor.js → pc-editor/location-editor.js} +8 -41
- package/lib/GeolocationEditor/{map-editor → pc-editor/map-editor}/index.js +6 -6
- package/lib/GeolocationEditor/{map-editor → pc-editor/map-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/{map-selection-editor → pc-editor/map-selection-editor}/index.js +7 -7
- package/lib/GeolocationEditor/{map-selection-editor → pc-editor/map-selection-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/{province-city-editor.js → pc-editor/province-city-editor.js} +7 -38
- package/lib/GeolocationEditor/{province-editor.js → pc-editor/province-editor.js} +7 -31
- package/lib/GeolocationEditor/{selector-header-item.js → pc-editor/selector-header-item.js} +1 -1
- package/lib/ImageEditor/images-previewer/image-preview/index.js +3 -3
- package/lib/ImageEditor/images-previewer/index.js +9 -4
- package/lib/ImageEditor/index.css +17 -16
- package/lib/ImageEditor/index.js +26 -185
- package/lib/ImageEditor/mb-editor/index.css +29 -0
- package/lib/ImageEditor/mb-editor/index.js +136 -0
- package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/image-link/index.js +1 -1
- package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/index.js +1 -1
- package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/local-image-addition/index.js +4 -4
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +140 -0
- package/lib/ImageEditor/pc-editor/index.css +24 -0
- package/lib/ImageEditor/pc-editor/index.js +194 -0
- package/lib/ImageThumbnail/index.js +2 -1
- package/lib/LinkEditor/index.js +5 -5
- package/lib/LinkEditor/{mb-link-editor-popover → mb-popover}/index.css +1 -1
- package/lib/MobileFullScreenPage/body/index.css +9 -0
- package/lib/MobileFullScreenPage/body/index.js +23 -0
- package/lib/MobileFullScreenPage/header/index.css +39 -0
- package/lib/MobileFullScreenPage/header/index.js +38 -0
- package/lib/MobileFullScreenPage/index.css +13 -0
- package/lib/MobileFullScreenPage/index.js +81 -0
- package/lib/MobileModal/index.js +41 -0
- package/lib/MobileOperationSheet/index.css +27 -0
- package/lib/MobileOperationSheet/index.js +92 -0
- package/lib/MobileSelector/empty/index.css +3 -0
- package/lib/MobileSelector/empty/index.js +23 -0
- package/lib/MobileSelector/index.css +32 -0
- package/lib/MobileSelector/index.js +57 -0
- package/lib/MobileSelector/option/index.css +28 -0
- package/lib/MobileSelector/option/index.js +36 -0
- package/lib/MobileSelector/options/index.css +8 -0
- package/lib/MobileSelector/options/index.js +18 -0
- package/lib/MobileSelector/search/index.css +7 -0
- package/lib/MobileSelector/search/index.js +26 -0
- package/lib/MobileUpload/index.css +1 -0
- package/lib/MobileUpload/index.js +160 -0
- package/lib/MultipleSelectEditor/index.js +9 -14
- package/lib/RowExpand/index.js +24 -0
- package/lib/RowExpand/mb-expand/body/index.css +173 -0
- package/lib/RowExpand/mb-expand/body/index.js +111 -0
- package/lib/RowExpand/mb-expand/column-content/index.css +27 -0
- package/lib/RowExpand/mb-expand/column-content/index.js +25 -0
- package/lib/RowExpand/mb-expand/index.css +0 -0
- package/lib/RowExpand/mb-expand/index.js +178 -0
- package/lib/{RowExpandDialog → RowExpand/pc-expand}/body/index.js +4 -4
- package/lib/{RowExpandDialog → RowExpand/pc-expand}/column-content/index.js +2 -2
- package/lib/{RowExpandDialog → RowExpand/pc-expand}/header/index.js +3 -3
- package/lib/{RowExpandDialog → RowExpand/pc-expand}/index.js +8 -6
- package/lib/RowExpandEditor/add-btn/index.js +24 -0
- package/lib/RowExpandEditor/add-btn/mb-add-btn/index.css +3 -0
- package/lib/RowExpandEditor/add-btn/mb-add-btn/index.js +19 -0
- package/lib/RowExpandEditor/{RowExpandAddBtn → add-btn/pc-add-btn}/index.js +6 -4
- package/lib/RowExpandEditor/checkbox-editor/index.js +25 -0
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.css +6 -0
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +39 -0
- package/lib/RowExpandEditor/{RowExpandCheckboxEditor/index.js → checkbox-editor/pc-editor.js} +2 -3
- package/lib/RowExpandEditor/collaborator-editor/index.js +24 -0
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.css +9 -0
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +163 -0
- package/lib/RowExpandEditor/{RowExpandCollaboratorEditor → collaborator-editor/pc-editor}/index.css +1 -1
- package/lib/RowExpandEditor/{RowExpandCollaboratorEditor → collaborator-editor/pc-editor}/index.js +6 -7
- package/lib/RowExpandEditor/constants.js +34 -34
- package/lib/RowExpandEditor/date-editor/index.js +24 -0
- package/lib/RowExpandEditor/date-editor/mb-editor.js +82 -0
- package/lib/RowExpandEditor/{RowExpandDateEditor/index.js → date-editor/pc-editor.js} +2 -2
- package/lib/RowExpandEditor/department-editor/index.js +24 -0
- package/lib/RowExpandEditor/department-editor/mb-editor.js +65 -0
- package/lib/RowExpandEditor/{RowExpandDepartmentEditor/index.js → department-editor/pc-editor.js} +11 -14
- package/lib/RowExpandEditor/digital-sign-editor/index.js +24 -0
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.css +1 -0
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +130 -0
- package/lib/RowExpandEditor/{RowExpandDigitalSignEditor → digital-sign-editor/pc-editor}/index.css +1 -1
- package/lib/RowExpandEditor/{RowExpandDigitalSignEditor → digital-sign-editor/pc-editor}/index.js +11 -11
- package/lib/RowExpandEditor/duration-editor/index.js +24 -0
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +71 -0
- package/lib/RowExpandEditor/{RowExpandDurationEditor/index.js → duration-editor/pc-editor.js} +2 -2
- package/lib/RowExpandEditor/email-editor/index.js +24 -0
- package/lib/RowExpandEditor/email-editor/mb-editor/index.css +1 -0
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +84 -0
- package/lib/RowExpandEditor/email-editor/pc-editor/index.css +1 -0
- package/lib/RowExpandEditor/{RowExpandEmailEditor → email-editor/pc-editor}/index.js +3 -3
- package/lib/RowExpandEditor/file-editor/index.js +24 -0
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +114 -0
- package/lib/RowExpandEditor/file-editor/pc-editor/index.css +1 -0
- package/lib/RowExpandEditor/{RowExpandFileEditor → file-editor/pc-editor}/index.js +9 -9
- package/lib/RowExpandEditor/geolocation-editor/index.js +24 -0
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +100 -0
- package/lib/RowExpandEditor/{RowExpandGeolocationEditor → geolocation-editor/pc-editor}/index.js +10 -11
- package/lib/RowExpandEditor/image-editor/index.js +24 -0
- package/lib/RowExpandEditor/image-editor/mb-editor/index.css +30 -0
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +109 -0
- package/lib/RowExpandEditor/{RowExpandImageEditor → image-editor/pc-editor}/index.js +9 -9
- package/lib/RowExpandEditor/long-text-editor/index.js +24 -0
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.css +10 -0
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +80 -0
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.css +3 -0
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +91 -0
- package/lib/RowExpandEditor/{RowExpandLongTextEditor → long-text-editor/pc-editor}/index.js +7 -7
- package/lib/RowExpandEditor/multiple-select-editor/index.js +24 -0
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +154 -0
- package/lib/RowExpandEditor/{RowExpandMultipleSelectEditor → multiple-select-editor/pc-editor}/index.css +1 -1
- package/lib/RowExpandEditor/{RowExpandMultipleSelectEditor → multiple-select-editor/pc-editor}/index.js +6 -6
- package/lib/RowExpandEditor/number-editor/index.js +24 -0
- package/lib/RowExpandEditor/number-editor/mb-editor/index.css +3 -0
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +76 -0
- package/lib/RowExpandEditor/{RowExpandNumberEditor/index.js → number-editor/pc-editor.js} +2 -2
- package/lib/RowExpandEditor/rate-editor/index.css +34 -0
- package/lib/RowExpandEditor/rate-editor/index.js +25 -0
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +92 -0
- package/lib/RowExpandEditor/{RowExpandRateEditor/index.js → rate-editor/pc-editor.js} +2 -3
- package/lib/RowExpandEditor/right-angle/index.css +6 -0
- package/lib/RowExpandEditor/right-angle/index.js +17 -0
- package/lib/RowExpandEditor/single-select-editor/index.js +24 -0
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.css +8 -0
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +134 -0
- package/lib/RowExpandEditor/{RowExpandSingleSelectorEditor → single-select-editor/pc-editor}/index.js +17 -17
- package/lib/RowExpandEditor/text-editor/index.js +24 -0
- package/lib/RowExpandEditor/text-editor/mb-editor/index.css +14 -0
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +37 -0
- package/lib/RowExpandEditor/{RowExpandTextEditor → text-editor/pc-editor}/index.js +7 -7
- package/lib/RowExpandEditor/url-editor/index.js +24 -0
- package/lib/RowExpandEditor/url-editor/mb-editor/index.css +17 -0
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +87 -0
- package/lib/RowExpandEditor/{RowExpandUrlEditor → url-editor/pc-editor}/index.js +6 -6
- package/lib/RowExpandFormatter/constants.js +17 -17
- package/lib/RowExpandFormatter/department-formatter/index.js +19 -0
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +20 -0
- package/lib/RowExpandFormatter/{RowExpandDepartmentFormatter/index.js → department-formatter/pc-formatter.js} +2 -2
- package/lib/RowExpandFormatter/{RowExpandEmailFormatter → email-formatter}/index.css +4 -4
- package/lib/RowExpandFormatter/index.css +33 -18
- package/lib/RowExpandFormatter/index.js +1 -1
- package/lib/RowExpandFormatter/rate-formatter/index.css +5 -0
- package/lib/SelectItem/index.js +57 -33
- package/lib/{Department-editor/selected-departments → SelectedDepartments}/index.css +0 -1
- package/lib/{Department-editor/selected-departments → SelectedDepartments}/index.js +3 -3
- package/lib/SingleSelectEditor/index.js +9 -14
- package/lib/SvgIcon/index.js +15 -20
- package/lib/constants/index.js +3 -2
- package/lib/css/mb-cell-editor.css +1 -1
- package/lib/index.js +71 -8
- package/lib/locales/de.json +3 -1
- package/lib/locales/en.json +3 -1
- package/lib/locales/es.json +3 -1
- package/lib/locales/fr.json +3 -1
- package/lib/locales/pt.json +3 -1
- package/lib/locales/ru.json +3 -1
- package/lib/locales/zh-CN.json +3 -1
- package/lib/select-editor/index.js +27 -20
- package/lib/select-editor/mb-editor/index.css +1 -0
- package/lib/select-editor/mb-editor/index.js +105 -0
- package/lib/select-editor/{pc-select-editor → pc-editor}/index.css +1 -1
- package/lib/select-editor/{pc-select-editor → pc-editor}/index.js +7 -7
- package/lib/utils/editor-utils.js +6 -2
- package/lib/utils/get-event-transfer.js +2 -1
- package/lib/utils/utils.js +11 -2
- package/package.json +2 -2
- package/lib/CollaboratorEditor/mb-collaborator-editor/index.css +0 -85
- package/lib/CollaboratorEditor/mb-collaborator-editor/index.js +0 -148
- package/lib/DateEditor/mb-date-editor-popover/custom-rc-calendar.css +0 -118
- package/lib/DateEditor/mb-date-editor-popover/index.css +0 -45
- package/lib/DateEditor/mb-date-editor-popover/index.js +0 -226
- package/lib/FileEditor/addition-previewer/index.css +0 -1
- package/lib/FileEditor/addition-previewer/local-file-addition/index.css +0 -1
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +0 -2
- package/lib/RowExpandEditor/RowExpandFileEditor/index.css +0 -1
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +0 -13
- package/lib/RowExpandFormatter/RowExpandRateFormatter/index.css +0 -5
- package/lib/assets/icons/check.svg +0 -12
- package/lib/assets/icons/cross.svg +0 -13
- package/lib/assets/icons/dot.svg +0 -9
- package/lib/select-editor/mb-select-editor/index.css +0 -127
- package/lib/select-editor/mb-select-editor/index.js +0 -197
- package/lib/select-editor/select-editor-option.js +0 -84
- /package/lib/CollaboratorEditor/{pc-collaborator-editor → pc-editor}/index.css +0 -0
- /package/lib/CollaboratorEditor/{pc-collaborator-editor → pc-editor}/index.js +0 -0
- /package/lib/{Department-editor/department-multiple-select → DepartmentMultipleSelectEditor}/index.css +0 -0
- /package/lib/DigitalSignEditor/{index.css → pc-editor/index.css} +0 -0
- /package/lib/FileEditor/files-previewer/{file-previewer → pc-previewer/file-previewer}/file-name-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{map-editor → pc-editor/map-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{map-selection-editor → pc-editor/map-selection-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{parse-geolocation.js → pc-editor/parse-geolocation.js} +0 -0
- /package/lib/GeolocationEditor/{selector-list.js → pc-editor/selector-list.js} +0 -0
- /package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/image-link/index.css +0 -0
- /package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/index.css +0 -0
- /package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/local-image-addition/index.css +0 -0
- /package/lib/LinkEditor/{mb-link-editor-popover → mb-popover}/index.js +0 -0
- /package/lib/LinkEditor/{pc-link-editor-popover → pc-popover}/index.css +0 -0
- /package/lib/LinkEditor/{pc-link-editor-popover → pc-popover}/index.js +0 -0
- /package/lib/{RowExpandDialog → RowExpand/pc-expand}/body/index.css +0 -0
- /package/lib/{RowExpandDialog → RowExpand/pc-expand}/column-content/index.css +0 -0
- /package/lib/{RowExpandDialog → RowExpand/pc-expand}/header/index.css +0 -0
- /package/lib/{RowExpandDialog → RowExpand/pc-expand}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandAddBtn → add-btn/pc-add-btn}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandCheckboxEditor → checkbox-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandGeolocationEditor → geolocation-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandImageEditor → image-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandLongTextEditor → long-text-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandSingleSelectorEditor → single-select-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandTextEditor → text-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandEditor/{RowExpandUrlEditor → url-editor/pc-editor}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandEmailFormatter → email-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandFileFormatter → file-formatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandFileFormatter → file-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandFileFormatter → file-formatter}/row-expand-file-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandFormulaFormatter → formula-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandImageFormatter → image-formatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandImageFormatter → image-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandImageFormatter → image-formatter}/row-expand-image-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandLinkFormatter → link-formatter}/collaborator-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandLinkFormatter → link-formatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandLinkFormatter → link-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandLinkFormatter → link-formatter}/value-display-utils.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandRateFormatter → rate-formatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{RowExpandUrlFormatter → url-formatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{RowExpandUrlFormatter → url-formatter}/index.js +0 -0
- /package/lib/{Department-editor/constants.js → constants/departments.js} +0 -0
- /package/lib/{Department-editor/utils.js → utils/departments.js} +0 -0
|
@@ -1,240 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (e.keyCode === _constants.KeyCodes.Enter && e.target.tagName !== 'TEXTAREA') {
|
|
24
|
-
this.onSubmit();
|
|
25
|
-
} else if (e.keyCode === _constants.KeyCodes.Escape) {
|
|
26
|
-
if (this.props.isInModal) {
|
|
27
|
-
e.stopPropagation();
|
|
28
|
-
this.onCancel();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
this.getValue = () => {
|
|
33
|
-
return this.value;
|
|
34
|
-
};
|
|
35
|
-
this.setValue = value => {
|
|
36
|
-
this.value = value;
|
|
37
|
-
};
|
|
38
|
-
this.onSubmit = () => {
|
|
39
|
-
if (_objectUtils.default.isSameObject(this.initValue, this.value)) {
|
|
40
|
-
this.onCancel();
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
this.props.onCommit(this.value);
|
|
44
|
-
};
|
|
45
|
-
this.onCancel = () => {
|
|
46
|
-
this.props.onCommitCancel && this.props.onCommitCancel();
|
|
47
|
-
};
|
|
48
|
-
this.setEditorPosition = () => {
|
|
49
|
-
const {
|
|
50
|
-
isInModal
|
|
51
|
-
} = this.props;
|
|
52
|
-
const editorFormat = this.getGeoFormat();
|
|
53
|
-
if (this.ref && (editorFormat === _dtableUtils.GEOLOCATION_FORMAT.COUNTRY_REGION || editorFormat === _dtableUtils.GEOLOCATION_FORMAT.PROVINCE)) {
|
|
54
|
-
let height = 240;
|
|
55
|
-
let width = 200;
|
|
56
|
-
let left = this.ref.parentNode.getBoundingClientRect().x;
|
|
57
|
-
let top = this.ref.parentNode.getBoundingClientRect().y;
|
|
58
|
-
if (isInModal) {
|
|
59
|
-
left = 220;
|
|
60
|
-
}
|
|
61
|
-
if (top + height > window.innerHeight) {
|
|
62
|
-
top = window.innerHeight - height - 35;
|
|
63
|
-
}
|
|
64
|
-
this.setState({
|
|
65
|
-
editorPosition: {
|
|
66
|
-
top,
|
|
67
|
-
left,
|
|
68
|
-
width,
|
|
69
|
-
zIndex: 1000,
|
|
70
|
-
position: 'fixed'
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (this.ref && editorFormat === _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY) {
|
|
76
|
-
let height = 215;
|
|
77
|
-
let width = 400;
|
|
78
|
-
let left = this.ref.parentNode.getBoundingClientRect().x;
|
|
79
|
-
let top = this.ref.parentNode.getBoundingClientRect().y;
|
|
80
|
-
if (isInModal) {
|
|
81
|
-
left = 220;
|
|
82
|
-
if (top + height + 35 + 200 > window.innerHeight) {
|
|
83
|
-
top = window.innerHeight - height - 235;
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
if (top + height + 200 > window.innerHeight) {
|
|
87
|
-
top = window.innerHeight - height - 200 - 5;
|
|
88
|
-
}
|
|
89
|
-
if (left + width > window.innerWidth) {
|
|
90
|
-
left = window.innerWidth - width - 10;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
this.setState({
|
|
94
|
-
editorPosition: {
|
|
95
|
-
top,
|
|
96
|
-
left,
|
|
97
|
-
width,
|
|
98
|
-
zIndex: 1000,
|
|
99
|
-
position: 'fixed'
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (this.ref) {
|
|
105
|
-
const isMapTypeEditor = editorFormat === _dtableUtils.GEOLOCATION_FORMAT.LNG_LAT || editorFormat === _dtableUtils.GEOLOCATION_FORMAT.MAP_SELECTION;
|
|
106
|
-
let width = isMapTypeEditor ? 500 : 400;
|
|
107
|
-
let height = isMapTypeEditor ? 454 : 310;
|
|
108
|
-
let geoEditorTop = 0;
|
|
109
|
-
let geoEditorLeft = 0;
|
|
110
|
-
if (isInModal) {
|
|
111
|
-
let innerHeight = window.innerHeight;
|
|
112
|
-
const offsetTop = this.ref.parentNode.getBoundingClientRect().y;
|
|
113
|
-
geoEditorTop = offsetTop;
|
|
114
|
-
geoEditorTop = height + geoEditorTop > innerHeight ? innerHeight - height - 30 : geoEditorTop;
|
|
115
|
-
geoEditorLeft = -30;
|
|
116
|
-
} else {
|
|
117
|
-
let {
|
|
118
|
-
offsetLeft,
|
|
119
|
-
offsetTop
|
|
120
|
-
} = this.ref.parentNode;
|
|
121
|
-
geoEditorLeft = offsetLeft - width;
|
|
122
|
-
geoEditorTop = offsetTop;
|
|
123
|
-
if (offsetLeft < width) {
|
|
124
|
-
geoEditorLeft = offsetLeft + this.props.column.width;
|
|
125
|
-
}
|
|
126
|
-
if (geoEditorLeft + width > window.innerWidth) {
|
|
127
|
-
geoEditorLeft = window.innerWidth - width;
|
|
128
|
-
}
|
|
129
|
-
if (offsetTop + height > window.innerHeight) {
|
|
130
|
-
geoEditorTop = window.innerHeight - height;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
this.setState({
|
|
134
|
-
editorPosition: {
|
|
135
|
-
top: geoEditorTop,
|
|
136
|
-
left: geoEditorLeft,
|
|
137
|
-
zIndex: 1000,
|
|
138
|
-
position: 'fixed'
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
this.getGeoFormat = () => {
|
|
144
|
-
const {
|
|
145
|
-
column
|
|
146
|
-
} = this.props;
|
|
147
|
-
let data = column.data || {};
|
|
148
|
-
return data.geo_format ? data.geo_format : _dtableUtils.DEFAULT_GEOLOCATION_FORMAT;
|
|
149
|
-
};
|
|
150
|
-
this.getLargeEditorState = () => {
|
|
151
|
-
var _this$editor, _this$editor$state;
|
|
152
|
-
return (_this$editor = this.editor) === null || _this$editor === void 0 ? void 0 : (_this$editor$state = _this$editor.state) === null || _this$editor$state === void 0 ? void 0 : _this$editor$state.isShowLargeEditor;
|
|
153
|
-
};
|
|
154
|
-
this.createEditor = () => {
|
|
155
|
-
const geoFormat = this.getGeoFormat();
|
|
156
|
-
const {
|
|
157
|
-
config,
|
|
158
|
-
column
|
|
159
|
-
} = this.props;
|
|
160
|
-
const props = {
|
|
161
|
-
column,
|
|
162
|
-
config,
|
|
163
|
-
value: this.value,
|
|
164
|
-
setValue: this.setValue,
|
|
165
|
-
onSubmit: this.onSubmit,
|
|
166
|
-
onCancel: this.onCancel
|
|
167
|
-
};
|
|
168
|
-
switch (geoFormat) {
|
|
169
|
-
case _dtableUtils.GEOLOCATION_FORMAT.LNG_LAT:
|
|
170
|
-
{
|
|
171
|
-
return /*#__PURE__*/_react.default.createElement(_mapEditor.default, Object.assign({}, props, {
|
|
172
|
-
ref: ref => this.editor = ref
|
|
173
|
-
}));
|
|
174
|
-
}
|
|
175
|
-
case _dtableUtils.GEOLOCATION_FORMAT.MAP_SELECTION:
|
|
176
|
-
{
|
|
177
|
-
return /*#__PURE__*/_react.default.createElement(_mapSelectionEditor.default, Object.assign({}, props, {
|
|
178
|
-
ref: ref => this.editor = ref
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
181
|
-
case _dtableUtils.GEOLOCATION_FORMAT.COUNTRY_REGION:
|
|
182
|
-
{
|
|
183
|
-
return /*#__PURE__*/_react.default.createElement(_countryEditor.default, Object.assign({}, props, {
|
|
184
|
-
ref: ref => this.editor = ref
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
187
|
-
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE:
|
|
188
|
-
{
|
|
189
|
-
return /*#__PURE__*/_react.default.createElement(_provinceEditor.default, Object.assign({}, props, {
|
|
190
|
-
onPressTab: this.props.onPressTab,
|
|
191
|
-
ref: ref => this.editor = ref
|
|
192
|
-
}));
|
|
193
|
-
}
|
|
194
|
-
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY:
|
|
195
|
-
{
|
|
196
|
-
return /*#__PURE__*/_react.default.createElement(_provinceCityEditor.default, Object.assign({}, props, {
|
|
197
|
-
ref: ref => this.editor = ref
|
|
198
|
-
}));
|
|
199
|
-
}
|
|
200
|
-
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY_DISTRICT:
|
|
201
|
-
{
|
|
202
|
-
return /*#__PURE__*/_react.default.createElement(_locationEditor.default, Object.assign({}, props, {
|
|
203
|
-
ref: ref => this.editor = ref
|
|
204
|
-
}));
|
|
205
|
-
}
|
|
206
|
-
default:
|
|
207
|
-
{
|
|
208
|
-
return /*#__PURE__*/_react.default.createElement(_locationEditor.default, Object.assign({}, props, {
|
|
209
|
-
isShowAddressDetail: true,
|
|
210
|
-
ref: ref => this.editor = ref
|
|
211
|
-
}));
|
|
212
|
-
}
|
|
213
|
-
}
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
11
|
+
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
12
|
+
var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
13
|
+
const GeolocationEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
14
|
+
let {
|
|
15
|
+
isMobile,
|
|
16
|
+
config: propsConfig,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
19
|
+
const config = (0, _react.useMemo)(() => {
|
|
20
|
+
var _window;
|
|
21
|
+
return {
|
|
22
|
+
...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
|
|
23
|
+
...propsConfig
|
|
214
24
|
};
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
25
|
+
}, [propsConfig]);
|
|
26
|
+
const getLocationData = (0, _react.useCallback)(() => {
|
|
27
|
+
var _window2, _window2$app;
|
|
28
|
+
if ((_window2 = window) !== null && _window2 !== void 0 && (_window2$app = _window2.app) !== null && _window2$app !== void 0 && _window2$app.location) return new Promise((resolve, reject) => {
|
|
29
|
+
resolve(window.app.location);
|
|
30
|
+
});
|
|
31
|
+
const {
|
|
32
|
+
mediaUrl
|
|
33
|
+
} = config || {};
|
|
34
|
+
return fetch("".concat(mediaUrl, "geo-data/cn-location.json")).then(res => {
|
|
35
|
+
// get locations from server
|
|
36
|
+
return res.json();
|
|
37
|
+
}).catch(() => {
|
|
38
|
+
// get locations from local
|
|
39
|
+
return fetch('./geo-data/cn-location.json').then(res => {
|
|
40
|
+
return res.json();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}, [config]);
|
|
44
|
+
const getCountryData = (0, _react.useCallback)(lang => {
|
|
45
|
+
if (lang === 'cn' && window.app.countryListCn) return new Promise((resolve, reject) => {
|
|
46
|
+
resolve(window.app.countryListCn);
|
|
47
|
+
});
|
|
48
|
+
if (lang !== 'cn' && window.app.countryListEn) return new Promise((resolve, reject) => {
|
|
49
|
+
resolve(window.app.countryListEn);
|
|
50
|
+
});
|
|
230
51
|
const {
|
|
231
|
-
|
|
232
|
-
} =
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
52
|
+
mediaUrl
|
|
53
|
+
} = config;
|
|
54
|
+
const geoFileName = lang === 'cn' ? 'cn-region-location' : 'en-region-location';
|
|
55
|
+
return fetch("".concat(mediaUrl, "geo-data/").concat(geoFileName, ".json")).then(res => {
|
|
56
|
+
return res.json();
|
|
57
|
+
}).catch(() => {
|
|
58
|
+
// get locations from local
|
|
59
|
+
return fetch("./geo-data/".concat(geoFileName, ".json")).then(res => {
|
|
60
|
+
return res.json();
|
|
61
|
+
});
|
|
62
|
+
}).then(res => {
|
|
63
|
+
const data = res || {};
|
|
64
|
+
if (lang === 'cn') {
|
|
65
|
+
window.app.countryListCn = data;
|
|
66
|
+
} else {
|
|
67
|
+
window.app.countryListEn = data;
|
|
68
|
+
}
|
|
69
|
+
return data;
|
|
70
|
+
});
|
|
71
|
+
}, [config]);
|
|
72
|
+
if (isMobile === false) return /*#__PURE__*/_react.default.createElement(_pcEditor.default, Object.assign({}, props, {
|
|
73
|
+
config: config,
|
|
74
|
+
getLocationData: getLocationData,
|
|
75
|
+
getCountryData: getCountryData,
|
|
76
|
+
ref: ref
|
|
77
|
+
}));
|
|
78
|
+
if (isMobile === true) return /*#__PURE__*/_react.default.createElement(_mbEditor.default, Object.assign({}, props, {
|
|
79
|
+
config: config,
|
|
80
|
+
getLocationData: getLocationData,
|
|
81
|
+
getCountryData: getCountryData,
|
|
82
|
+
ref: ref
|
|
83
|
+
}));
|
|
84
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
85
|
+
query: "(min-width: 768px)"
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement(_pcEditor.default, Object.assign({}, props, {
|
|
87
|
+
config: config,
|
|
88
|
+
getLocationData: getLocationData,
|
|
89
|
+
getCountryData: getCountryData,
|
|
90
|
+
ref: ref
|
|
91
|
+
}))), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
92
|
+
query: "(max-width: 768px)"
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_mbEditor.default, Object.assign({}, props, {
|
|
94
|
+
config: config,
|
|
95
|
+
getLocationData: getLocationData,
|
|
96
|
+
getCountryData: getCountryData,
|
|
97
|
+
ref: ref
|
|
98
|
+
}))));
|
|
99
|
+
});
|
|
240
100
|
var _default = exports.default = GeolocationEditor;
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.locateCurrentPosition = exports.loadMapSource = exports.getMineMapUrl = exports.getMapInfo = exports.getInitCenter = exports.MAP_TYPES = exports.DOMESTIC_MAP_TYPE = void 0;
|
|
6
|
+
exports.locateCurrentPosition = exports.loadMapSource = exports.getMineMapUrl = exports.getMapInfo = exports.getInitCenter = exports.MAP_TYPES = exports.INPUT_MODE_MAP = exports.DOMESTIC_MAP_TYPE = void 0;
|
|
7
|
+
const INPUT_MODE_MAP = exports.INPUT_MODE_MAP = {
|
|
8
|
+
ANY_LOCATION: 'any_location',
|
|
9
|
+
ONLY_MOBILE_POSITIONING: 'only_mobile_positioning'
|
|
10
|
+
};
|
|
7
11
|
const MAP_TYPES = exports.MAP_TYPES = {
|
|
8
12
|
B_MAP: 'b_map',
|
|
9
13
|
// baidu
|
|
@@ -101,7 +105,7 @@ const loadMapSource = (mapType, mapKey, callback) => {
|
|
|
101
105
|
let script = document.createElement('script');
|
|
102
106
|
script.type = 'text/javascript';
|
|
103
107
|
if (mapType === MAP_TYPES.B_MAP) {
|
|
104
|
-
scriptUrl = "https://api.map.baidu.com/api?v=3.0&ak=".concat(mapKey, "
|
|
108
|
+
scriptUrl = "https://api.map.baidu.com/api?v=3.0&ak=".concat(mapKey, "&callback=renderBaiduMap");
|
|
105
109
|
} else if (mapType === MAP_TYPES.G_MAP) {
|
|
106
110
|
scriptUrl = "https://maps.googleapis.com/maps/api/js?key=".concat(mapKey, "&callback=renderGoogleMap&libraries=&v=weekly");
|
|
107
111
|
} else {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _picker = _interopRequireDefault(require("antd-mobile/lib/picker"));
|
|
10
|
+
var _list = _interopRequireDefault(require("antd-mobile/lib/list"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
|
|
13
|
+
var _lang = require("../../lang");
|
|
14
|
+
const {
|
|
15
|
+
Header,
|
|
16
|
+
Body
|
|
17
|
+
} = _MobileFullScreenPage.default;
|
|
18
|
+
const CountryEditor = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
column,
|
|
21
|
+
value: oldValue,
|
|
22
|
+
getData,
|
|
23
|
+
onToggle,
|
|
24
|
+
onCommit
|
|
25
|
+
} = _ref;
|
|
26
|
+
const [value, setValue] = (0, _react.useState)([]);
|
|
27
|
+
const [isLoading, setLoading] = (0, _react.useState)(true);
|
|
28
|
+
const locations = (0, _react.useRef)([]);
|
|
29
|
+
(0, _react.useEffect)(() => {
|
|
30
|
+
getData().then(data => {
|
|
31
|
+
locations.current = data;
|
|
32
|
+
const continent = data.find(a => a.children.find(b => b.value === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.country_region) || ''));
|
|
33
|
+
const value = [(continent === null || continent === void 0 ? void 0 : continent.value) || '', (oldValue === null || oldValue === void 0 ? void 0 : oldValue.country_region) || ''];
|
|
34
|
+
setValue(value);
|
|
35
|
+
setLoading(false);
|
|
36
|
+
});
|
|
37
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
+
}, []);
|
|
39
|
+
const onValueChange = (0, _react.useCallback)(newValue => {
|
|
40
|
+
if (value === newValue) return;
|
|
41
|
+
setValue(newValue);
|
|
42
|
+
}, [value]);
|
|
43
|
+
const onSubmit = (0, _react.useCallback)(() => {
|
|
44
|
+
if (value[1] !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.country_region)) {
|
|
45
|
+
onCommit({
|
|
46
|
+
country_region: value[1]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
onToggle();
|
|
50
|
+
}, [value, oldValue, onCommit, onToggle]);
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
|
|
52
|
+
onClose: onToggle
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(Header, {
|
|
54
|
+
onLeftClick: onToggle,
|
|
55
|
+
onRightClick: onSubmit
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name), /*#__PURE__*/_react.default.createElement("span", {
|
|
57
|
+
style: {
|
|
58
|
+
color: '#f09f3f'
|
|
59
|
+
}
|
|
60
|
+
}, (0, _lang.getLocale)('Submit'))), /*#__PURE__*/_react.default.createElement(Body, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: "dtable-ui-mobile-row-expand-subtitle"
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Address_information'))), /*#__PURE__*/_react.default.createElement(_picker.default, {
|
|
63
|
+
className: "dtable-ui-mobile-geolocation-editor-picker",
|
|
64
|
+
data: isLoading ? [] : locations.current,
|
|
65
|
+
value: value,
|
|
66
|
+
format: "",
|
|
67
|
+
onChange: onValueChange,
|
|
68
|
+
cascade: true,
|
|
69
|
+
title: (0, _lang.getLocale)('Address_information'),
|
|
70
|
+
extra: (0, _lang.getLocale)('Select_location'),
|
|
71
|
+
onOk: e => onValueChange(e),
|
|
72
|
+
okText: (0, _lang.getLocale)('Done'),
|
|
73
|
+
dismissText: (0, _lang.getLocale)('Cancel'),
|
|
74
|
+
cols: 2
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_list.default.Item, {
|
|
76
|
+
arrow: "horizontal"
|
|
77
|
+
}, value[1] || (0, _lang.getLocale)('Select_location')))));
|
|
78
|
+
};
|
|
79
|
+
var _default = exports.default = CountryEditor;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.dtable-ui-mobile-geolocation-editor-picker .am-picker-popup-content .am-picker-popup-header-left {
|
|
2
|
+
color: #666666;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.dtable-ui-mobile-geolocation-editor-picker .am-picker-popup-content .am-picker-popup-title {
|
|
6
|
+
color: #212529;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.dtable-ui-mobile-geolocation-editor-picker .am-picker-popup-content .am-picker-popup-header-right {
|
|
10
|
+
color: #e5a252;
|
|
11
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _dtableUtils = require("dtable-utils");
|
|
11
|
+
var _countryEditor = _interopRequireDefault(require("./country-editor"));
|
|
12
|
+
var _provinceEditor = _interopRequireDefault(require("./province-editor"));
|
|
13
|
+
var _provinceCityEditor = _interopRequireDefault(require("./province-city-editor"));
|
|
14
|
+
var _locationEditor = _interopRequireDefault(require("./location-editor"));
|
|
15
|
+
var _mapEditor = _interopRequireDefault(require("./map-editor"));
|
|
16
|
+
var _mapSelectionEditor = _interopRequireDefault(require("./map-selection-editor"));
|
|
17
|
+
require("./index.css");
|
|
18
|
+
const transLocationData = data => {
|
|
19
|
+
if (Object.prototype.toString.call(data) === '[object Object]') {
|
|
20
|
+
const name = data.name;
|
|
21
|
+
data.label = name;
|
|
22
|
+
data.value = name;
|
|
23
|
+
data.name = null;
|
|
24
|
+
if (data.children) {
|
|
25
|
+
data.children.map(child => {
|
|
26
|
+
return transLocationData(child);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return data.children;
|
|
31
|
+
};
|
|
32
|
+
const transCountryData = data => {
|
|
33
|
+
let _data = [];
|
|
34
|
+
for (let key in data) {
|
|
35
|
+
let obj = {};
|
|
36
|
+
let children = [];
|
|
37
|
+
obj.label = key;
|
|
38
|
+
obj.value = key;
|
|
39
|
+
obj.name = null;
|
|
40
|
+
data[key].forEach(item => {
|
|
41
|
+
let obj = {};
|
|
42
|
+
obj.label = item;
|
|
43
|
+
obj.value = item;
|
|
44
|
+
obj.name = null;
|
|
45
|
+
children.push(obj);
|
|
46
|
+
});
|
|
47
|
+
obj.children = children;
|
|
48
|
+
_data.push(obj);
|
|
49
|
+
}
|
|
50
|
+
return _data;
|
|
51
|
+
};
|
|
52
|
+
const MBGeolocationEditor = _ref => {
|
|
53
|
+
let {
|
|
54
|
+
column,
|
|
55
|
+
config,
|
|
56
|
+
getLocationData,
|
|
57
|
+
getCountryData,
|
|
58
|
+
...props
|
|
59
|
+
} = _ref;
|
|
60
|
+
const format = (0, _react.useMemo)(() => {
|
|
61
|
+
let data = column.data || {};
|
|
62
|
+
return data.geo_format ? data.geo_format : _dtableUtils.DEFAULT_GEOLOCATION_FORMAT;
|
|
63
|
+
}, [column]);
|
|
64
|
+
const getData = (0, _react.useCallback)(() => {
|
|
65
|
+
return getLocationData().then(data => transLocationData(data));
|
|
66
|
+
}, [getLocationData]);
|
|
67
|
+
const _getCountryData = (0, _react.useCallback)(() => {
|
|
68
|
+
const columnData = column.data || {};
|
|
69
|
+
const lang = columnData.lang === 'cn' ? 'cn' : 'en';
|
|
70
|
+
return getCountryData(lang).then(data => transCountryData(data));
|
|
71
|
+
}, [column, getCountryData]);
|
|
72
|
+
switch (format) {
|
|
73
|
+
case _dtableUtils.GEOLOCATION_FORMAT.LNG_LAT:
|
|
74
|
+
{
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_mapEditor.default, Object.assign({}, props, {
|
|
76
|
+
config: config,
|
|
77
|
+
column: column
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
case _dtableUtils.GEOLOCATION_FORMAT.MAP_SELECTION:
|
|
81
|
+
{
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_mapSelectionEditor.default, Object.assign({}, props, {
|
|
83
|
+
config: config,
|
|
84
|
+
column: column
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
case _dtableUtils.GEOLOCATION_FORMAT.COUNTRY_REGION:
|
|
88
|
+
{
|
|
89
|
+
return /*#__PURE__*/_react.default.createElement(_countryEditor.default, Object.assign({}, props, {
|
|
90
|
+
getData: _getCountryData,
|
|
91
|
+
column: column
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE:
|
|
95
|
+
{
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement(_provinceEditor.default, Object.assign({}, props, {
|
|
97
|
+
getData: getData,
|
|
98
|
+
column: column
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY:
|
|
102
|
+
{
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_provinceCityEditor.default, Object.assign({}, props, {
|
|
104
|
+
getData: getData,
|
|
105
|
+
column: column
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
case _dtableUtils.GEOLOCATION_FORMAT.PROVINCE_CITY_DISTRICT:
|
|
109
|
+
{
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_locationEditor.default, Object.assign({}, props, {
|
|
111
|
+
getData: getData,
|
|
112
|
+
column: column
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
default:
|
|
116
|
+
{
|
|
117
|
+
return /*#__PURE__*/_react.default.createElement(_locationEditor.default, Object.assign({}, props, {
|
|
118
|
+
isShowDetails: true,
|
|
119
|
+
getData: getData,
|
|
120
|
+
column: column
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
var _default = exports.default = MBGeolocationEditor;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _inputItem = _interopRequireDefault(require("antd-mobile/lib/input-item"));
|
|
10
|
+
var _picker = _interopRequireDefault(require("antd-mobile/lib/picker"));
|
|
11
|
+
var _list = _interopRequireDefault(require("antd-mobile/lib/list"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
|
|
14
|
+
var _lang = require("../../lang");
|
|
15
|
+
var _objectUtils = _interopRequireDefault(require("../../utils/object-utils"));
|
|
16
|
+
const {
|
|
17
|
+
Header,
|
|
18
|
+
Body
|
|
19
|
+
} = _MobileFullScreenPage.default;
|
|
20
|
+
const LocationEditor = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
isShowDetails,
|
|
23
|
+
column,
|
|
24
|
+
value: oldValue,
|
|
25
|
+
getData,
|
|
26
|
+
onToggle,
|
|
27
|
+
onCommit
|
|
28
|
+
} = _ref;
|
|
29
|
+
let initValue = [(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '', (oldValue === null || oldValue === void 0 ? void 0 : oldValue.city) || '', (oldValue === null || oldValue === void 0 ? void 0 : oldValue.district) || ''];
|
|
30
|
+
if (isShowDetails) {
|
|
31
|
+
initValue.push((oldValue === null || oldValue === void 0 ? void 0 : oldValue.detail) || '');
|
|
32
|
+
}
|
|
33
|
+
const [value, setValue] = (0, _react.useState)(initValue);
|
|
34
|
+
const [isLoading, setLoading] = (0, _react.useState)(true);
|
|
35
|
+
const locations = (0, _react.useRef)([]);
|
|
36
|
+
(0, _react.useEffect)(() => {
|
|
37
|
+
getData().then(data => {
|
|
38
|
+
locations.current = data;
|
|
39
|
+
setLoading(false);
|
|
40
|
+
});
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
+
}, []);
|
|
43
|
+
const onValueChange = (0, _react.useCallback)(newValue => {
|
|
44
|
+
if (value === newValue) return;
|
|
45
|
+
setValue(newValue);
|
|
46
|
+
}, [value]);
|
|
47
|
+
const onAddressChange = (0, _react.useCallback)(address => {
|
|
48
|
+
const newValue = value.slice(0, 3);
|
|
49
|
+
newValue.push(address);
|
|
50
|
+
setValue(newValue);
|
|
51
|
+
}, [value]);
|
|
52
|
+
const onSubmit = (0, _react.useCallback)(() => {
|
|
53
|
+
let newValue = {
|
|
54
|
+
province: value[0],
|
|
55
|
+
city: value[1],
|
|
56
|
+
district: value[2]
|
|
57
|
+
};
|
|
58
|
+
if (isShowDetails) {
|
|
59
|
+
newValue['detail'] = value[3];
|
|
60
|
+
}
|
|
61
|
+
if (!_objectUtils.default.isSameObject(newValue, oldValue)) {
|
|
62
|
+
onCommit(newValue);
|
|
63
|
+
}
|
|
64
|
+
onToggle();
|
|
65
|
+
}, [isShowDetails, value, oldValue, onCommit, onToggle]);
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
|
|
67
|
+
onToggle: onToggle
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(Header, {
|
|
69
|
+
onLeftClick: onToggle,
|
|
70
|
+
onRightClick: onSubmit
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name), /*#__PURE__*/_react.default.createElement("span", {
|
|
72
|
+
style: {
|
|
73
|
+
color: '#f09f3f'
|
|
74
|
+
}
|
|
75
|
+
}, (0, _lang.getLocale)('Submit'))), /*#__PURE__*/_react.default.createElement(Body, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
+
className: "dtable-ui-mobile-row-expand-subtitle"
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Address_information'))), /*#__PURE__*/_react.default.createElement(_picker.default, {
|
|
78
|
+
className: "dtable-ui-mobile-geolocation-editor-picker",
|
|
79
|
+
data: isLoading ? [] : locations.current,
|
|
80
|
+
value: value.slice(0, 3),
|
|
81
|
+
format: "",
|
|
82
|
+
onChange: onValueChange,
|
|
83
|
+
cascade: true,
|
|
84
|
+
title: (0, _lang.getLocale)('Address_information'),
|
|
85
|
+
extra: (0, _lang.getLocale)('Select_location'),
|
|
86
|
+
onOk: e => onValueChange(e),
|
|
87
|
+
okText: (0, _lang.getLocale)('Done'),
|
|
88
|
+
dismissText: (0, _lang.getLocale)('Cancel'),
|
|
89
|
+
cols: 3
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(_list.default.Item, {
|
|
91
|
+
arrow: "horizontal"
|
|
92
|
+
}, value.slice(0, 3).join(' ') || (0, _lang.getLocale)('Select_location'))), isShowDetails && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
+
className: "dtable-ui-mobile-row-expand-subtitle"
|
|
94
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Detailed_address'))), /*#__PURE__*/_react.default.createElement(_inputItem.default, {
|
|
95
|
+
placeholder: (0, _lang.getLocale)('Detailed_address_placeholder'),
|
|
96
|
+
value: value[3],
|
|
97
|
+
onChange: onAddressChange,
|
|
98
|
+
moneyKeyboardAlign: "left"
|
|
99
|
+
}))));
|
|
100
|
+
};
|
|
101
|
+
var _default = exports.default = LocationEditor;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.dtable-ui-mobile-geolocation-map-editor .dtable-ui-mobile-geolocation-map-editor-input-container {
|
|
2
|
+
height: 60px;
|
|
3
|
+
padding-top: 16px;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dtable-ui-mobile-geolocation-map-editor .dtable-ui-mobile-geolocation-map-editor-map {
|
|
8
|
+
flex: 1;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|