dtable-ui-component 6.0.29-beta9 → 6.0.29
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 +196 -0
- package/lib/ActionSheet/style/index.css +377 -0
- package/lib/ActivityIndicator/index.css +110 -0
- package/lib/ActivityIndicator/index.js +76 -0
- package/lib/Badge/index.css +98 -0
- package/lib/Badge/index.js +65 -0
- package/lib/CheckboxEditor/index.js +116 -24
- package/lib/CollaboratorEditor/index.js +11 -23
- package/lib/CollaboratorEditor/mb-collaborator-editor/index.css +85 -0
- package/lib/CollaboratorEditor/mb-collaborator-editor/index.js +148 -0
- package/lib/DTableCommonAddTool/index.js +3 -1
- 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 +95 -69
- package/lib/DateEditor/mb-date-editor-popover/custom-rc-calendar.css +118 -0
- package/lib/DateEditor/mb-date-editor-popover/index.css +45 -0
- package/lib/DateEditor/mb-date-editor-popover/index.js +226 -0
- package/lib/DateEditor/{pc-editor.js → pc-date-editor-popover.js} +9 -9
- package/lib/DatePicker/index.js +120 -0
- package/lib/DatePicker/locale/en_US.js +14 -0
- package/lib/DatePicker/locale/ru_RU.js +14 -0
- package/lib/DatePicker/locale/sv_SE.js +14 -0
- package/lib/DatePicker/locale/zh_CN.js +14 -0
- package/lib/DatePicker/style/index.css +298 -0
- package/lib/DatePicker/utils.js +36 -0
- package/lib/{DepartmentMultipleSelectEditor → Department-editor/department-multiple-select}/index.js +6 -6
- package/lib/{DepartmentSingleSelectEditor/pc-editor → Department-editor}/department-single-select.js +7 -7
- package/lib/{DepartmentSingleSelectEditor/pc-editor → Department-editor}/index.css +3 -10
- package/lib/{DepartmentSingleSelectEditor/pc-editor → Department-editor}/index.js +25 -8
- package/lib/{SelectedDepartments → Department-editor/selected-departments}/index.css +1 -0
- package/lib/{SelectedDepartments → Department-editor/selected-departments}/index.js +3 -3
- package/lib/DigitalSignEditor/index.js +171 -24
- package/lib/Drawer/index.css +144 -0
- package/lib/Drawer/index.js +21 -0
- package/lib/FileEditor/addition-previewer/index.css +1 -0
- package/lib/FileEditor/{pc-editor/addition-previewer → addition-previewer}/index.js +1 -1
- package/lib/FileEditor/addition-previewer/local-file-addition/index.css +1 -0
- package/lib/FileEditor/{pc-editor/addition-previewer → addition-previewer}/local-file-addition/index.js +4 -4
- package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/dropdown-menu.js +1 -1
- package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/file-name-editor/index.js +1 -1
- package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/index.css +2 -0
- package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/index.js +2 -2
- package/lib/FileEditor/files-previewer/index.js +268 -26
- package/lib/FileEditor/index.css +5 -0
- package/lib/FileEditor/index.js +265 -26
- package/lib/FormulaFormatter/index.css +5 -5
- package/lib/GeolocationEditor/{pc-editor/country-editor.js → country-editor.js} +49 -5
- package/lib/GeolocationEditor/{pc-editor/index.css → index.css} +4 -3
- package/lib/GeolocationEditor/index.js +230 -90
- package/lib/GeolocationEditor/{pc-editor/location-editor.js → location-editor.js} +41 -8
- package/lib/GeolocationEditor/{pc-editor/map-editor → map-editor}/index.js +6 -6
- package/lib/GeolocationEditor/{pc-editor/map-editor → map-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/map-editor-utils.js +4 -10
- package/lib/GeolocationEditor/{pc-editor/map-selection-editor → map-selection-editor}/index.js +7 -7
- package/lib/GeolocationEditor/{pc-editor/map-selection-editor → map-selection-editor}/large-editor/index.js +7 -7
- package/lib/GeolocationEditor/{pc-editor/province-city-editor.js → province-city-editor.js} +38 -7
- package/lib/GeolocationEditor/{pc-editor/province-editor.js → province-editor.js} +31 -7
- package/lib/GeolocationEditor/{pc-editor/selector-header-item.js → selector-header-item.js} +1 -1
- package/lib/Icon/index.css +50 -0
- package/lib/Icon/index.js +35 -0
- package/lib/Icon/load-sprite.js +56 -0
- package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/image-link/index.js +1 -1
- package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/index.js +1 -1
- package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/local-image-addition/index.js +4 -4
- package/lib/ImageEditor/images-previewer/image-preview/index.js +3 -3
- package/lib/ImageEditor/images-previewer/index.js +4 -9
- package/lib/ImageEditor/index.css +16 -17
- package/lib/ImageEditor/index.js +185 -26
- package/lib/ImageThumbnail/index.js +1 -2
- package/lib/InputItem/custom-input.js +321 -0
- package/lib/InputItem/custom-keyboard.js +162 -0
- package/lib/InputItem/index.js +389 -0
- package/lib/InputItem/input.js +45 -0
- package/lib/InputItem/locale/en_US.js +12 -0
- package/lib/InputItem/locale/ru_RU.js +12 -0
- package/lib/InputItem/locale/sv_SE.js +12 -0
- package/lib/InputItem/locale/zh_CN.js +12 -0
- package/lib/InputItem/portal.js +23 -0
- package/lib/InputItem/style/index.css +524 -0
- package/lib/LinkEditor/index.js +5 -5
- package/lib/LinkEditor/{mb-popover → mb-link-editor-popover}/index.css +1 -1
- package/lib/List/index.css +389 -0
- package/lib/List/index.js +41 -0
- package/lib/List/list-item.js +169 -0
- package/lib/Modal/alert.js +86 -0
- package/lib/Modal/index.js +16 -0
- package/lib/Modal/modal.js +118 -0
- package/lib/Modal/operation.js +81 -0
- package/lib/Modal/prompt.js +211 -0
- package/lib/Modal/style/index.css +593 -0
- package/lib/MultipleSelectEditor/index.js +14 -9
- package/lib/Picker/AbstractPicker.js +190 -0
- package/lib/Picker/index.js +28 -0
- package/lib/Picker/locale/en_US.js +12 -0
- package/lib/Picker/locale/ru_RU.js +12 -0
- package/lib/Picker/locale/sv_SE.js +12 -0
- package/lib/Picker/locale/zh_CN.js +12 -0
- package/lib/Picker/popupProps.js +12 -0
- package/lib/Picker/style/index.css +145 -0
- package/lib/Popover/index.js +63 -0
- package/lib/Popover/item.js +55 -0
- package/lib/Popover/style/index.css +233 -0
- package/lib/Progress/index.css +24 -0
- package/lib/Progress/index.js +66 -0
- package/lib/Radio/Radio.js +47 -0
- package/lib/Radio/RadioItem.js +57 -0
- package/lib/Radio/index.css +92 -0
- package/lib/Radio/index.js +12 -0
- package/lib/RowExpandDialog/column-content/index.js +2 -2
- package/lib/RowExpandDialog/index.js +0 -2
- package/lib/RowExpandEditor/{add-btn/pc-add-btn → RowExpandAddBtn}/index.js +4 -6
- package/lib/RowExpandEditor/{checkbox-editor/pc-editor.js → RowExpandCheckboxEditor/index.js} +13 -9
- package/lib/RowExpandEditor/{collaborator-editor/pc-editor → RowExpandCollaboratorEditor}/index.css +1 -1
- package/lib/RowExpandEditor/{collaborator-editor/pc-editor → RowExpandCollaboratorEditor}/index.js +7 -6
- package/lib/RowExpandEditor/{date-editor/pc-editor.js → RowExpandDateEditor/index.js} +2 -2
- package/lib/RowExpandEditor/{department-editor/pc-editor.js → RowExpandDepartmentEditor/index.js} +49 -44
- package/lib/RowExpandEditor/{digital-sign-editor/pc-editor → RowExpandDigitalSignEditor}/index.css +1 -1
- package/lib/RowExpandEditor/{digital-sign-editor/pc-editor → RowExpandDigitalSignEditor}/index.js +11 -11
- package/lib/RowExpandEditor/{duration-editor/pc-editor.js → RowExpandDurationEditor/index.js} +2 -2
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +2 -0
- package/lib/RowExpandEditor/{email-editor/pc-editor → RowExpandEmailEditor}/index.js +3 -3
- package/lib/RowExpandEditor/RowExpandFileEditor/index.css +1 -0
- package/lib/RowExpandEditor/{file-editor/pc-editor → RowExpandFileEditor}/index.js +9 -9
- package/lib/RowExpandEditor/{geolocation-editor/pc-editor → RowExpandGeolocationEditor}/index.js +13 -17
- package/lib/RowExpandEditor/{image-editor/pc-editor → RowExpandImageEditor}/index.js +9 -9
- package/lib/RowExpandEditor/{long-text-editor/pc-editor → RowExpandLongTextEditor}/index.js +7 -7
- package/lib/RowExpandEditor/{multiple-select-editor/pc-editor → RowExpandMultipleSelectEditor}/index.css +1 -1
- package/lib/RowExpandEditor/{multiple-select-editor/pc-editor → RowExpandMultipleSelectEditor}/index.js +6 -6
- package/lib/RowExpandEditor/{number-editor/pc-editor.js → RowExpandNumberEditor/index.js} +2 -2
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +13 -0
- package/lib/RowExpandEditor/{rate-editor/pc-editor.js → RowExpandRateEditor/index.js} +3 -2
- package/lib/RowExpandEditor/{single-select-editor/pc-editor → RowExpandSingleSelectorEditor}/index.js +17 -17
- package/lib/RowExpandEditor/{text-editor/pc-editor → RowExpandTextEditor}/index.js +7 -7
- package/lib/RowExpandEditor/{url-editor/pc-editor → RowExpandUrlEditor}/index.js +6 -6
- package/lib/RowExpandEditor/constants.js +34 -34
- package/lib/RowExpandFormatter/{department-formatter/pc-formatter.js → RowExpandDepartmentFormatter/index.js} +2 -2
- package/lib/RowExpandFormatter/{email-formatter → RowExpandEmailFormatter}/index.css +4 -4
- package/lib/RowExpandFormatter/RowExpandRateFormatter/index.css +5 -0
- package/lib/RowExpandFormatter/constants.js +17 -17
- package/lib/RowExpandFormatter/index.css +18 -33
- package/lib/RowExpandFormatter/index.js +1 -1
- package/lib/SelectItem/index.js +33 -57
- package/lib/SingleSelectEditor/index.js +14 -9
- package/lib/SvgIcon/index.js +1 -2
- package/lib/TabBar/Tab.js +76 -0
- package/lib/TabBar/index.css +142 -0
- package/lib/TabBar/index.js +129 -0
- package/lib/Tabs/index.css +453 -0
- package/lib/Tabs/index.js +39 -0
- package/lib/TextareaItem/index.css +235 -0
- package/lib/TextareaItem/index.js +231 -0
- package/lib/Toast/index.css +67 -0
- package/lib/Toast/index.js +131 -0
- package/lib/_util/class.js +34 -0
- package/lib/_util/closest.js +17 -0
- package/lib/_util/exenv.js +8 -0
- package/lib/_util/getDataAttr.js +15 -0
- package/lib/_util/getLocale.js +42 -0
- package/lib/constants/index.js +2 -3
- package/lib/css/am.css +390 -0
- package/lib/css/mb-cell-editor.css +1 -1
- package/lib/index.js +100 -51
- package/lib/locales/de.json +1 -3
- package/lib/locales/en.json +1 -3
- package/lib/locales/es.json +1 -3
- package/lib/locales/fr.json +1 -3
- package/lib/locales/pt.json +1 -3
- package/lib/locales/ru.json +1 -3
- package/lib/locales/zh-CN.json +1 -3
- package/lib/select-editor/index.js +20 -27
- package/lib/select-editor/mb-select-editor/index.css +127 -0
- package/lib/select-editor/mb-select-editor/index.js +197 -0
- package/lib/select-editor/{pc-editor → pc-select-editor}/index.css +1 -1
- package/lib/select-editor/{pc-editor → pc-select-editor}/index.js +7 -7
- package/lib/select-editor/select-editor-option.js +84 -0
- package/lib/utils/editor-utils.js +2 -6
- package/lib/utils/get-event-transfer.js +1 -2
- package/lib/utils/utils.js +2 -11
- package/package.json +25 -16
- package/lib/BodyPortal/index.js +0 -29
- package/lib/CheckboxEditor/mb-editor.js +0 -99
- package/lib/CheckboxEditor/pc-editor.js +0 -118
- package/lib/CollaboratorEditor/mb-editor/index.css +0 -41
- package/lib/CollaboratorEditor/mb-editor/index.js +0 -88
- package/lib/DateEditor/mb-editor/custom-rc-calendar.css +0 -118
- package/lib/DateEditor/mb-editor/index.css +0 -39
- package/lib/DateEditor/mb-editor/index.js +0 -215
- package/lib/DepartmentSingleSelectEditor/index.js +0 -34
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.css +0 -4
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +0 -230
- package/lib/DigitalSignEditor/mb-editor/index.css +0 -35
- package/lib/DigitalSignEditor/mb-editor/index.js +0 -144
- package/lib/DigitalSignEditor/pc-editor/index.js +0 -181
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +0 -122
- package/lib/FileEditor/files-previewer/mb-previewer/index.css +0 -39
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +0 -64
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +0 -276
- package/lib/FileEditor/mb-editor/index.css +0 -10
- package/lib/FileEditor/mb-editor/index.js +0 -136
- package/lib/FileEditor/pc-editor/addition-previewer/index.css +0 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.css +0 -1
- package/lib/FileEditor/pc-editor/index.css +0 -5
- package/lib/FileEditor/pc-editor/index.js +0 -274
- package/lib/GeolocationEditor/mb-editor/country-editor.js +0 -79
- package/lib/GeolocationEditor/mb-editor/index.css +0 -11
- package/lib/GeolocationEditor/mb-editor/index.js +0 -125
- package/lib/GeolocationEditor/mb-editor/location-editor.js +0 -101
- package/lib/GeolocationEditor/mb-editor/map-editor/index.css +0 -11
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +0 -474
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.css +0 -158
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +0 -530
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +0 -77
- package/lib/GeolocationEditor/mb-editor/province-editor.js +0 -76
- package/lib/GeolocationEditor/pc-editor/index.js +0 -247
- package/lib/ImageEditor/mb-editor/index.css +0 -29
- package/lib/ImageEditor/mb-editor/index.js +0 -136
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +0 -140
- package/lib/ImageEditor/pc-editor/index.css +0 -24
- package/lib/ImageEditor/pc-editor/index.js +0 -194
- package/lib/MobileFullScreenPage/body/index.css +0 -9
- package/lib/MobileFullScreenPage/body/index.js +0 -23
- package/lib/MobileFullScreenPage/header/index.css +0 -39
- package/lib/MobileFullScreenPage/header/index.js +0 -38
- package/lib/MobileFullScreenPage/index.css +0 -13
- package/lib/MobileFullScreenPage/index.js +0 -73
- package/lib/MobileModal/index.js +0 -41
- package/lib/MobileOperationSheet/index.css +0 -27
- package/lib/MobileOperationSheet/index.js +0 -92
- package/lib/MobileSelector/empty/index.css +0 -3
- package/lib/MobileSelector/empty/index.js +0 -23
- package/lib/MobileSelector/index.css +0 -32
- package/lib/MobileSelector/index.js +0 -57
- package/lib/MobileSelector/option/index.css +0 -28
- package/lib/MobileSelector/option/index.js +0 -36
- package/lib/MobileSelector/options/index.css +0 -8
- package/lib/MobileSelector/options/index.js +0 -18
- package/lib/MobileSelector/search/index.css +0 -7
- package/lib/MobileSelector/search/index.js +0 -26
- package/lib/MobileUpload/index.css +0 -1
- package/lib/MobileUpload/index.js +0 -160
- package/lib/RowExpand/index.js +0 -24
- package/lib/RowExpandEditor/add-btn/index.js +0 -24
- package/lib/RowExpandEditor/add-btn/mb-add-btn/index.css +0 -3
- package/lib/RowExpandEditor/add-btn/mb-add-btn/index.js +0 -19
- package/lib/RowExpandEditor/checkbox-editor/index.js +0 -25
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.css +0 -6
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +0 -36
- package/lib/RowExpandEditor/collaborator-editor/index.js +0 -24
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.css +0 -9
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +0 -163
- package/lib/RowExpandEditor/date-editor/index.js +0 -24
- package/lib/RowExpandEditor/date-editor/mb-editor.js +0 -82
- package/lib/RowExpandEditor/department-editor/index.js +0 -24
- package/lib/RowExpandEditor/department-editor/mb-editor.js +0 -65
- package/lib/RowExpandEditor/digital-sign-editor/index.js +0 -24
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.css +0 -1
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +0 -130
- package/lib/RowExpandEditor/duration-editor/index.js +0 -24
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +0 -71
- package/lib/RowExpandEditor/email-editor/index.js +0 -24
- package/lib/RowExpandEditor/email-editor/mb-editor/index.css +0 -1
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +0 -84
- package/lib/RowExpandEditor/email-editor/pc-editor/index.css +0 -1
- package/lib/RowExpandEditor/file-editor/index.js +0 -24
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +0 -114
- package/lib/RowExpandEditor/file-editor/pc-editor/index.css +0 -1
- package/lib/RowExpandEditor/geolocation-editor/index.js +0 -24
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +0 -100
- package/lib/RowExpandEditor/image-editor/index.js +0 -24
- package/lib/RowExpandEditor/image-editor/mb-editor/index.css +0 -30
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +0 -109
- package/lib/RowExpandEditor/long-text-editor/index.js +0 -24
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.css +0 -10
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +0 -80
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.css +0 -3
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +0 -91
- package/lib/RowExpandEditor/multiple-select-editor/index.js +0 -24
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +0 -154
- package/lib/RowExpandEditor/number-editor/index.js +0 -24
- package/lib/RowExpandEditor/number-editor/mb-editor/index.css +0 -3
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +0 -76
- package/lib/RowExpandEditor/rate-editor/index.css +0 -34
- package/lib/RowExpandEditor/rate-editor/index.js +0 -25
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +0 -92
- package/lib/RowExpandEditor/right-angle/index.css +0 -6
- package/lib/RowExpandEditor/right-angle/index.js +0 -17
- package/lib/RowExpandEditor/single-select-editor/index.js +0 -24
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.css +0 -8
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +0 -134
- package/lib/RowExpandEditor/text-editor/index.js +0 -24
- package/lib/RowExpandEditor/text-editor/mb-editor/index.css +0 -14
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +0 -37
- package/lib/RowExpandEditor/url-editor/index.js +0 -24
- package/lib/RowExpandEditor/url-editor/mb-editor/index.css +0 -17
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +0 -87
- package/lib/RowExpandFormatter/department-formatter/index.js +0 -19
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +0 -20
- package/lib/RowExpandFormatter/rate-formatter/index.css +0 -5
- package/lib/RowExpandView/body/index.css +0 -173
- package/lib/RowExpandView/body/index.js +0 -111
- package/lib/RowExpandView/column-content/index.css +0 -27
- package/lib/RowExpandView/column-content/index.js +0 -25
- package/lib/RowExpandView/index.css +0 -3
- package/lib/RowExpandView/index.js +0 -178
- package/lib/select-editor/mb-editor/index.css +0 -1
- package/lib/select-editor/mb-editor/index.js +0 -105
- /package/lib/CollaboratorEditor/{pc-editor → pc-collaborator-editor}/index.css +0 -0
- /package/lib/CollaboratorEditor/{pc-editor → pc-collaborator-editor}/index.js +0 -0
- /package/lib/{constants/departments.js → Department-editor/constants.js} +0 -0
- /package/lib/{DepartmentMultipleSelectEditor → Department-editor/department-multiple-select}/index.css +0 -0
- /package/lib/{utils/departments.js → Department-editor/utils.js} +0 -0
- /package/lib/DigitalSignEditor/{pc-editor/index.css → index.css} +0 -0
- /package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/file-name-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{pc-editor/map-editor → map-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{pc-editor/map-selection-editor → map-selection-editor}/large-editor/index.css +0 -0
- /package/lib/GeolocationEditor/{pc-editor/parse-geolocation.js → parse-geolocation.js} +0 -0
- /package/lib/GeolocationEditor/{pc-editor/selector-list.js → selector-list.js} +0 -0
- /package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/image-link/index.css +0 -0
- /package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/index.css +0 -0
- /package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/local-image-addition/index.css +0 -0
- /package/lib/LinkEditor/{mb-popover → mb-link-editor-popover}/index.js +0 -0
- /package/lib/LinkEditor/{pc-popover → pc-link-editor-popover}/index.css +0 -0
- /package/lib/LinkEditor/{pc-popover → pc-link-editor-popover}/index.js +0 -0
- /package/lib/RowExpandEditor/{add-btn/pc-add-btn → RowExpandAddBtn}/index.css +0 -0
- /package/lib/RowExpandEditor/{checkbox-editor → RowExpandCheckboxEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{geolocation-editor/pc-editor → RowExpandGeolocationEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{image-editor/pc-editor → RowExpandImageEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{long-text-editor/pc-editor → RowExpandLongTextEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{single-select-editor/pc-editor → RowExpandSingleSelectorEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{text-editor/pc-editor → RowExpandTextEditor}/index.css +0 -0
- /package/lib/RowExpandEditor/{url-editor/pc-editor → RowExpandUrlEditor}/index.css +0 -0
- /package/lib/RowExpandFormatter/{email-formatter → RowExpandEmailFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{file-formatter → RowExpandFileFormatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{file-formatter → RowExpandFileFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{file-formatter → RowExpandFileFormatter}/row-expand-file-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{formula-formatter → RowExpandFormulaFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{image-formatter → RowExpandImageFormatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{image-formatter → RowExpandImageFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{image-formatter → RowExpandImageFormatter}/row-expand-image-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/collaborator-item-formatter.js +0 -0
- /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/value-display-utils.js +0 -0
- /package/lib/RowExpandFormatter/{rate-formatter → RowExpandRateFormatter}/index.js +0 -0
- /package/lib/RowExpandFormatter/{url-formatter → RowExpandUrlFormatter}/index.css +0 -0
- /package/lib/RowExpandFormatter/{url-formatter → RowExpandUrlFormatter}/index.js +0 -0
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactstrap = require("reactstrap");
|
|
10
|
-
var _filesPreviewer = _interopRequireDefault(require("../files-previewer"));
|
|
11
|
-
var _additionPreviewer = _interopRequireDefault(require("./addition-previewer"));
|
|
12
|
-
var _constants = require("../../constants");
|
|
13
|
-
var _DTableModalHeader = _interopRequireDefault(require("../../DTableModalHeader"));
|
|
14
|
-
var _lang = require("../../lang");
|
|
15
|
-
var _constants2 = require("../constants");
|
|
16
|
-
var _utils = require("../../utils/utils");
|
|
17
|
-
var _toaster = _interopRequireDefault(require("../../toaster"));
|
|
18
|
-
require("./index.css");
|
|
19
|
-
class PCFileEditor extends _react.default.Component {
|
|
20
|
-
constructor(props) {
|
|
21
|
-
var _this;
|
|
22
|
-
super(props);
|
|
23
|
-
_this = this;
|
|
24
|
-
this.getValue = () => {
|
|
25
|
-
return this.state.value;
|
|
26
|
-
};
|
|
27
|
-
this.getEditorView = () => {
|
|
28
|
-
const {
|
|
29
|
-
isInModal,
|
|
30
|
-
value
|
|
31
|
-
} = this.props;
|
|
32
|
-
return !value || value.length === 0 || isInModal ? _constants.FILE_EDITOR_STATUS.ADDITION : _constants.FILE_EDITOR_STATUS.PREVIEWER;
|
|
33
|
-
};
|
|
34
|
-
this.deleteImage = function (index) {
|
|
35
|
-
let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
36
|
-
let uploadLocalFileValue = _this.state.uploadLocalFileValue.slice(0);
|
|
37
|
-
let value = _this.state.value.slice(0);
|
|
38
|
-
if (_this.state.editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER) {
|
|
39
|
-
value.splice(index, 1);
|
|
40
|
-
} else {
|
|
41
|
-
if (type === 'localPicture') {
|
|
42
|
-
uploadLocalFileValue.splice(index, 1);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
_this.setState({
|
|
46
|
-
uploadLocalFileValue: uploadLocalFileValue,
|
|
47
|
-
isUpdated: true,
|
|
48
|
-
value: value
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
this.resetAdditionImage = () => {
|
|
52
|
-
this.setState({
|
|
53
|
-
uploadLocalFileValue: [],
|
|
54
|
-
imageLinkValue: []
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
this.toggle = e => {
|
|
58
|
-
e.stopPropagation();
|
|
59
|
-
if (this.state.isOpen && this.state.isUpdated) {
|
|
60
|
-
if (this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION) {
|
|
61
|
-
let {
|
|
62
|
-
value,
|
|
63
|
-
uploadLocalFileValue
|
|
64
|
-
} = this.state;
|
|
65
|
-
let newValue = value.concat(uploadLocalFileValue);
|
|
66
|
-
this.setState({
|
|
67
|
-
value: newValue
|
|
68
|
-
}, () => {
|
|
69
|
-
this.props.isInModal ? this.props.onCommit(this.getValue()) : this.props.onCommit();
|
|
70
|
-
});
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
this.props.isInModal ? this.props.onCommit(this.getValue()) : this.props.onCommit();
|
|
74
|
-
}
|
|
75
|
-
if (this.props.isInModal) {
|
|
76
|
-
this.props.onToggle();
|
|
77
|
-
}
|
|
78
|
-
const nextIsOpen = !this.state.isOpen;
|
|
79
|
-
this.setState({
|
|
80
|
-
isOpen: nextIsOpen
|
|
81
|
-
}, () => {
|
|
82
|
-
if (!nextIsOpen) {
|
|
83
|
-
this.props.onCommitCancel && this.props.onCommitCancel();
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
this.closeEditor = () => {
|
|
88
|
-
this.setState({
|
|
89
|
-
isOpen: false
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
this.togglePreviewer = type => {
|
|
93
|
-
this.setState({
|
|
94
|
-
editorView: type
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
this.fileUploadCompleted = fileMessage => {
|
|
98
|
-
let uploadLocalFileValue = this.state.uploadLocalFileValue.slice(0);
|
|
99
|
-
let fileUploadMessage = {
|
|
100
|
-
name: fileMessage.name,
|
|
101
|
-
size: fileMessage.size,
|
|
102
|
-
type: fileMessage.type,
|
|
103
|
-
url: fileMessage.url,
|
|
104
|
-
upload_time: fileMessage.upload_time
|
|
105
|
-
};
|
|
106
|
-
uploadLocalFileValue.push(fileUploadMessage);
|
|
107
|
-
this.setState({
|
|
108
|
-
uploadLocalFileValue: uploadLocalFileValue,
|
|
109
|
-
isUpdated: true
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
this.addUploadedFile = fileMessageList => {
|
|
113
|
-
const uploadLocalFileValue = [...this.state.uploadLocalFileValue, ...fileMessageList.map(_ref => {
|
|
114
|
-
let {
|
|
115
|
-
name,
|
|
116
|
-
size,
|
|
117
|
-
type,
|
|
118
|
-
url,
|
|
119
|
-
mtime
|
|
120
|
-
} = _ref;
|
|
121
|
-
return {
|
|
122
|
-
name,
|
|
123
|
-
size,
|
|
124
|
-
type: type || 'file',
|
|
125
|
-
url,
|
|
126
|
-
upload_time: mtime
|
|
127
|
-
};
|
|
128
|
-
})];
|
|
129
|
-
this.setState({
|
|
130
|
-
uploadLocalFileValue,
|
|
131
|
-
isUpdated: true
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
this.renderHeader = () => {
|
|
135
|
-
let {
|
|
136
|
-
editorView
|
|
137
|
-
} = this.state;
|
|
138
|
-
// if (this.props.isInModal) {
|
|
139
|
-
// return (<span>{getLocale('Add_files')}</span>);
|
|
140
|
-
// }
|
|
141
|
-
if (editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER) {
|
|
142
|
-
return /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('All_files'));
|
|
143
|
-
}
|
|
144
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
145
|
-
onClick: this.showImageListPreviewer
|
|
146
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
147
|
-
"aria-hidden": "true",
|
|
148
|
-
className: "dtable-font dtable-icon-return mr-2"
|
|
149
|
-
}), /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Add_files')));
|
|
150
|
-
};
|
|
151
|
-
this.showImageListPreviewer = () => {
|
|
152
|
-
let {
|
|
153
|
-
value,
|
|
154
|
-
uploadLocalFileValue,
|
|
155
|
-
imageLinkValue
|
|
156
|
-
} = this.state;
|
|
157
|
-
let newValue = value.concat(uploadLocalFileValue, imageLinkValue);
|
|
158
|
-
this.setState({
|
|
159
|
-
value: newValue
|
|
160
|
-
});
|
|
161
|
-
this.togglePreviewer(_constants.FILE_EDITOR_STATUS.PREVIEWER);
|
|
162
|
-
};
|
|
163
|
-
this.uploadFile = (file, callback) => {
|
|
164
|
-
return this.props.uploadFile(file, _constants2.FILES_FOLDER, callback);
|
|
165
|
-
};
|
|
166
|
-
this.resetFileValue = () => {
|
|
167
|
-
this.setState({
|
|
168
|
-
uploadLocalFileValue: []
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
|
-
this.deleteFile = (index, type) => {
|
|
172
|
-
let uploadLocalFileValue = this.state.uploadLocalFileValue.slice(0);
|
|
173
|
-
let value = this.state.value.slice(0);
|
|
174
|
-
if (this.state.editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER) {
|
|
175
|
-
value.splice(index, 1);
|
|
176
|
-
} else {
|
|
177
|
-
if (type === 'localFile') {
|
|
178
|
-
uploadLocalFileValue.splice(index, 1);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
this.setState({
|
|
182
|
-
uploadLocalFileValue: uploadLocalFileValue,
|
|
183
|
-
isUpdated: true,
|
|
184
|
-
value: value
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
this.deleteFilesByPreviewer = fileList => {
|
|
188
|
-
const result = this.state.value.filter(file => !fileList.includes(file.name));
|
|
189
|
-
this.setState({
|
|
190
|
-
isUpdated: true,
|
|
191
|
-
value: result
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
|
-
this.onRenameFile = (index, newName) => {
|
|
195
|
-
let newValue = this.state.value.slice(0);
|
|
196
|
-
let fileItem = newValue[index];
|
|
197
|
-
if (!this.props.renameFile) return;
|
|
198
|
-
this.props.renameFile(fileItem, newName).then(res => {
|
|
199
|
-
const {
|
|
200
|
-
name,
|
|
201
|
-
url
|
|
202
|
-
} = res.data;
|
|
203
|
-
fileItem = {
|
|
204
|
-
...fileItem,
|
|
205
|
-
name,
|
|
206
|
-
url
|
|
207
|
-
};
|
|
208
|
-
newValue[index] = fileItem;
|
|
209
|
-
this.setState({
|
|
210
|
-
value: newValue
|
|
211
|
-
});
|
|
212
|
-
}).catch(error => {
|
|
213
|
-
const errorMessage = (0, _utils.getErrorMsg)(error);
|
|
214
|
-
if (!error.response || error.response.status !== 403) {
|
|
215
|
-
_toaster.default.danger((0, _lang.getLocale)(errorMessage));
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
};
|
|
219
|
-
this.onRotateImage = (url, degree) => {
|
|
220
|
-
this.props.rotateImage(url, degree).then(res => {
|
|
221
|
-
// todo
|
|
222
|
-
}).catch(error => {
|
|
223
|
-
const errorMessage = (0, _utils.getErrorMsg)(error);
|
|
224
|
-
if (!error.response || error.response.status !== 403) {
|
|
225
|
-
_toaster.default.danger((0, _lang.getLocale)(errorMessage));
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
};
|
|
229
|
-
this.state = {
|
|
230
|
-
value: props.value || [],
|
|
231
|
-
editorView: this.getEditorView(),
|
|
232
|
-
isOpen: true,
|
|
233
|
-
isShowFileChooser: false,
|
|
234
|
-
uploadLocalFileValue: [],
|
|
235
|
-
imageLinkValue: [],
|
|
236
|
-
isUpdated: false
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
render() {
|
|
240
|
-
return /*#__PURE__*/_react.default.createElement(_reactstrap.Modal, {
|
|
241
|
-
className: "dtable-ui-image-editor-dialog dtable-ui-file-editor-dialog",
|
|
242
|
-
contentClassName: "dtable-ui-image-editor-modal",
|
|
243
|
-
isOpen: this.state.isOpen,
|
|
244
|
-
toggle: this.toggle
|
|
245
|
-
}, /*#__PURE__*/_react.default.createElement(_DTableModalHeader.default, {
|
|
246
|
-
toggle: this.toggle
|
|
247
|
-
}, this.renderHeader()), /*#__PURE__*/_react.default.createElement(_reactstrap.ModalBody, {
|
|
248
|
-
className: "p-0"
|
|
249
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
250
|
-
className: "dtable-ui-image-editor-container dtable-ui-file-editor-container"
|
|
251
|
-
}, this.state.editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER && /*#__PURE__*/_react.default.createElement(_filesPreviewer.default, {
|
|
252
|
-
value: this.state.value,
|
|
253
|
-
config: this.props.config,
|
|
254
|
-
togglePreviewer: this.togglePreviewer,
|
|
255
|
-
deleteFile: this.deleteFile,
|
|
256
|
-
deleteFiles: this.deleteFilesByPreviewer,
|
|
257
|
-
renameFile: this.props.renameFile ? this.onRenameFile : null,
|
|
258
|
-
resetFileValue: this.resetFileValue,
|
|
259
|
-
rotateImage: this.props.rotateImage ? this.onRotateImage : null,
|
|
260
|
-
getDownLoadFiles: this.props.getDownLoadFiles || (() => {})
|
|
261
|
-
}), this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION && /*#__PURE__*/_react.default.createElement(_additionPreviewer.default, {
|
|
262
|
-
config: this.props.config,
|
|
263
|
-
deleteImage: this.deleteImage,
|
|
264
|
-
handleFilesChange: this.handleFilesChange,
|
|
265
|
-
uploadLocalFileValue: this.state.uploadLocalFileValue,
|
|
266
|
-
togglePreviewer: this.togglePreviewer,
|
|
267
|
-
fileUploadCompleted: this.fileUploadCompleted,
|
|
268
|
-
addUploadedFile: this.addUploadedFile,
|
|
269
|
-
showImageListPreviewer: this.showImageListPreviewer,
|
|
270
|
-
uploadFile: this.uploadFile
|
|
271
|
-
}))));
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
var _default = exports.default = PCFileEditor;
|
|
@@ -1,79 +0,0 @@
|
|
|
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;
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
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;
|
|
@@ -1,101 +0,0 @@
|
|
|
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;
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|