dtable-ui-component 6.0.30 → 6.0.31
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 -116
- package/lib/CheckboxEditor/mb-editor.js +99 -0
- package/lib/CheckboxEditor/pc-editor.js +118 -0
- 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 +227 -0
- package/lib/{Department-editor → DepartmentSingleSelectEditor/pc-editor}/department-single-select.js +7 -7
- package/lib/{Department-editor → DepartmentSingleSelectEditor/pc-editor}/index.css +10 -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 +92 -230
- package/lib/GeolocationEditor/map-editor-utils.js +10 -4
- 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 -49
- 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 +73 -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/RowExpandDialog/column-content/index.js +2 -2
- package/lib/RowExpandDialog/index.js +2 -0
- 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 +36 -0
- package/lib/RowExpandEditor/{RowExpandCheckboxEditor/index.js → checkbox-editor/pc-editor.js} +9 -13
- 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} +44 -49
- 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 +17 -13
- 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/RowExpandView/body/index.css +173 -0
- package/lib/RowExpandView/body/index.js +111 -0
- package/lib/RowExpandView/column-content/index.css +27 -0
- package/lib/RowExpandView/column-content/index.js +25 -0
- package/lib/RowExpandView/index.css +3 -0
- package/lib/RowExpandView/index.js +178 -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 +2 -1
- package/lib/constants/index.js +3 -2
- package/lib/css/mb-cell-editor.css +1 -1
- package/lib/index.js +62 -6
- 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 +5 -5
- 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/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/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
|
@@ -7,28 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _DTableSearchInput = _interopRequireDefault(require("
|
|
11
|
-
var _constants = require("
|
|
12
|
-
var _Loading = _interopRequireDefault(require("
|
|
13
|
-
var _lang = require("
|
|
10
|
+
var _DTableSearchInput = _interopRequireDefault(require("../../DTableSearchInput"));
|
|
11
|
+
var _constants = require("../../constants");
|
|
12
|
+
var _Loading = _interopRequireDefault(require("../../Loading"));
|
|
13
|
+
var _lang = require("../../lang");
|
|
14
14
|
class ProvinceEditor extends _react.Component {
|
|
15
15
|
constructor(props) {
|
|
16
16
|
super(props);
|
|
17
|
-
this.getLocationData = () => {
|
|
18
|
-
// mediaUrl
|
|
19
|
-
const {
|
|
20
|
-
mediaUrl
|
|
21
|
-
} = window.dtable;
|
|
22
|
-
// get locations from server
|
|
23
|
-
return fetch("".concat(mediaUrl, "geo-data/cn-location.json")).then(res => {
|
|
24
|
-
return res.json();
|
|
25
|
-
}).catch(() => {
|
|
26
|
-
// get locations from local
|
|
27
|
-
return fetch('./geo-data/cn-location.json').then(res => {
|
|
28
|
-
return res.json();
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
17
|
this.onHotKey = e => {
|
|
33
18
|
if (e.keyCode === _constants.KeyCodes.Enter) {
|
|
34
19
|
this.onEnter(e);
|
|
@@ -179,22 +164,13 @@ class ProvinceEditor extends _react.Component {
|
|
|
179
164
|
this.itemHeight = 30;
|
|
180
165
|
}
|
|
181
166
|
componentDidMount() {
|
|
182
|
-
|
|
183
|
-
this.
|
|
184
|
-
this.locations = data;
|
|
185
|
-
window.app.location = data;
|
|
186
|
-
this.filteredProvince = this.locations.children;
|
|
187
|
-
this.setState({
|
|
188
|
-
isLoadingData: false
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
} else {
|
|
192
|
-
this.locations = window.app.location;
|
|
167
|
+
this.props.getData().then(data => {
|
|
168
|
+
this.locations = data;
|
|
193
169
|
this.filteredProvince = this.locations.children;
|
|
194
170
|
this.setState({
|
|
195
171
|
isLoadingData: false
|
|
196
172
|
});
|
|
197
|
-
}
|
|
173
|
+
});
|
|
198
174
|
document.addEventListener('keydown', this.onHotKey, true);
|
|
199
175
|
}
|
|
200
176
|
componentWillUnmount() {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _lang = require("
|
|
9
|
+
var _lang = require("../../lang");
|
|
10
10
|
class SelectorHeaderItem extends _react.default.Component {
|
|
11
11
|
render() {
|
|
12
12
|
const {
|
|
@@ -85,7 +85,7 @@ class ImagePreviewer extends _react.default.Component {
|
|
|
85
85
|
};
|
|
86
86
|
this.canDownLoad = props.canDownLoad;
|
|
87
87
|
const offsetWidth = document.body.offsetWidth;
|
|
88
|
-
this.containerSize = offsetWidth <
|
|
88
|
+
this.containerSize = offsetWidth < 768 ? (offsetWidth - 55) / 2 + 'px' : (offsetWidth - 80) / 3 + 'px';
|
|
89
89
|
this.position = {};
|
|
90
90
|
const {
|
|
91
91
|
mediaUrl
|
|
@@ -122,7 +122,7 @@ class ImagePreviewer extends _react.default.Component {
|
|
|
122
122
|
imageItemUrl
|
|
123
123
|
} = this.props;
|
|
124
124
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
-
style:
|
|
125
|
+
style: _constants.isMobile ? {
|
|
126
126
|
width: this.containerSize,
|
|
127
127
|
height: this.containerSize
|
|
128
128
|
} : {},
|
|
@@ -134,7 +134,7 @@ class ImagePreviewer extends _react.default.Component {
|
|
|
134
134
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
135
135
|
src: this.state.imageThumbnailUrl,
|
|
136
136
|
alt: ""
|
|
137
|
-
}), enterImageItemIndex === itemIndex && this.renderImageIcons()), enterImageItemIndex === itemIndex && /*#__PURE__*/_react.default.createElement(_reactstrap.Tooltip, {
|
|
137
|
+
}), enterImageItemIndex === itemIndex && this.renderImageIcons()), !_constants.isMobile && enterImageItemIndex === itemIndex && /*#__PURE__*/_react.default.createElement(_reactstrap.Tooltip, {
|
|
138
138
|
placement: "bottom",
|
|
139
139
|
isOpen: this.state.isTooltipOpen,
|
|
140
140
|
toggle: this.toggle,
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
10
|
var _ImagePreviewerLightbox = _interopRequireDefault(require("../../ImagePreviewerLightbox"));
|
|
10
11
|
var _imagePreview = _interopRequireDefault(require("./image-preview"));
|
|
11
12
|
var _DTableCommonAddTool = _interopRequireDefault(require("../../DTableCommonAddTool"));
|
|
@@ -90,13 +91,13 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
90
91
|
};
|
|
91
92
|
}
|
|
92
93
|
componentDidMount() {
|
|
93
|
-
if (
|
|
94
|
+
if (_constants.isMobile) {
|
|
94
95
|
window.history.pushState(null, null, '#');
|
|
95
96
|
window.addEventListener('popstate', this.handleHistoryBack, false);
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
componentWillUnmount() {
|
|
99
|
-
if (
|
|
100
|
+
if (_constants.isMobile) {
|
|
100
101
|
window.removeEventListener('popstate', this.handleHistoryBack, false);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
@@ -105,9 +106,13 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
105
106
|
value
|
|
106
107
|
} = this.props;
|
|
107
108
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
108
|
-
className:
|
|
109
|
+
className: (0, _classnames.default)('dtable-ui-image-previewer-container', {
|
|
110
|
+
'mt-0': value.length === 0 && _constants.isMobile
|
|
111
|
+
})
|
|
109
112
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
-
className:
|
|
113
|
+
className: (0, _classnames.default)('dtable-ui-image-previewer-wrapper', {
|
|
114
|
+
'd-none': value.length === 0 && _constants.isMobile
|
|
115
|
+
})
|
|
111
116
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
112
117
|
className: "dtable-ui-image-previewer-content"
|
|
113
118
|
}, value.length > 0 && value.map((imageItemUrl, index) => {
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
.dtable-ui-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
max-height: 620px;
|
|
1
|
+
.dtable-ui-file-open-external-browser {
|
|
2
|
+
flex: 1;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
min-height: 0;
|
|
8
7
|
overflow: hidden;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
.dtable-ui-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
.dtable-ui-file-open-external-browser .seatable-tip-danger {
|
|
11
|
+
margin: 16px;
|
|
12
|
+
text-align: center;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
.dtable-ui-image-
|
|
15
|
+
.dtable-ui-file-open-external-browser .image-container {
|
|
16
|
+
flex: 1;
|
|
17
17
|
display: flex;
|
|
18
|
-
|
|
18
|
+
justify-content: center;
|
|
19
|
+
align-items: flex-start;
|
|
20
|
+
margin: 0 10px;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
.dtable-ui-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
23
|
+
.dtable-ui-file-open-external-browser img {
|
|
24
|
+
width: 75%;
|
|
25
|
+
}
|
package/lib/ImageEditor/index.js
CHANGED
|
@@ -1,194 +1,35 @@
|
|
|
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
|
-
var _constants = require("../constants");
|
|
13
|
-
var _DTableModalHeader = _interopRequireDefault(require("../DTableModalHeader"));
|
|
14
|
-
var _lang = require("../lang");
|
|
15
|
-
var _constants2 = require("./constants");
|
|
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"));
|
|
16
13
|
require("./index.css");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} else {
|
|
39
|
-
if (type === 'localPicture') {
|
|
40
|
-
uploadLocalImageValue.splice(index, 1);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
_this.setState({
|
|
44
|
-
uploadLocalImageValue: uploadLocalImageValue,
|
|
45
|
-
isUpdated: true,
|
|
46
|
-
value: value
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
this.resetAdditionImage = () => {
|
|
50
|
-
this.setState({
|
|
51
|
-
uploadLocalImageValue: [],
|
|
52
|
-
imageLinkValue: []
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
this.toggle = e => {
|
|
56
|
-
e.stopPropagation();
|
|
57
|
-
if (this.state.isOpen && this.state.isUpdated) {
|
|
58
|
-
if (this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION) {
|
|
59
|
-
let {
|
|
60
|
-
value,
|
|
61
|
-
uploadLocalImageValue
|
|
62
|
-
} = this.state;
|
|
63
|
-
let newValue = value.concat(uploadLocalImageValue);
|
|
64
|
-
this.setState({
|
|
65
|
-
value: newValue
|
|
66
|
-
}, () => {
|
|
67
|
-
this.props.isInModal ? this.props.onCommit(this.getValue()) : this.props.onCommit();
|
|
68
|
-
});
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
this.props.isInModal ? this.props.onCommit(this.getValue()) : this.props.onCommit();
|
|
72
|
-
}
|
|
73
|
-
if (this.props.isInModal) {
|
|
74
|
-
this.props.onToggle();
|
|
75
|
-
}
|
|
76
|
-
const nextIsOpen = !this.state.isOpen;
|
|
77
|
-
this.setState({
|
|
78
|
-
isOpen: nextIsOpen
|
|
79
|
-
}, () => {
|
|
80
|
-
if (!nextIsOpen) {
|
|
81
|
-
this.props.onCommitCancel && this.props.onCommitCancel();
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
this.closeEditor = () => {
|
|
86
|
-
this.setState({
|
|
87
|
-
isOpen: false
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
this.togglePreviewer = type => {
|
|
91
|
-
this.setState({
|
|
92
|
-
editorView: type
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
this.fileUploadCompleted = fileMessage => {
|
|
96
|
-
let uploadLocalImageValue = this.state.uploadLocalImageValue.slice(0);
|
|
97
|
-
const imageUrl = fileMessage.url;
|
|
98
|
-
uploadLocalImageValue.push(imageUrl);
|
|
99
|
-
this.setState({
|
|
100
|
-
uploadLocalImageValue: uploadLocalImageValue,
|
|
101
|
-
isUpdated: true
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
this.addUploadedFile = fileMessageList => {
|
|
105
|
-
let uploadLocalImageValue = this.state.uploadLocalImageValue.slice(0);
|
|
106
|
-
// eslint-disable-next-line no-unused-vars
|
|
107
|
-
for (let fileMessage of fileMessageList) {
|
|
108
|
-
uploadLocalImageValue.push(fileMessage.url);
|
|
109
|
-
}
|
|
110
|
-
this.setState({
|
|
111
|
-
uploadLocalImageValue: uploadLocalImageValue,
|
|
112
|
-
isUpdated: true
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
this.renderHeader = () => {
|
|
116
|
-
let {
|
|
117
|
-
editorView
|
|
118
|
-
} = this.state;
|
|
119
|
-
if (this.props.isInModal) {
|
|
120
|
-
return /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Add_images'));
|
|
121
|
-
}
|
|
122
|
-
if (editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER) {
|
|
123
|
-
return /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('All_images'));
|
|
124
|
-
}
|
|
125
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
126
|
-
onClick: this.showImageListPreviewer
|
|
127
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
128
|
-
"aria-hidden": "true",
|
|
129
|
-
className: "dtable-font dtable-icon-return mr-2"
|
|
130
|
-
}), /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Add_images')));
|
|
131
|
-
};
|
|
132
|
-
this.showImageListPreviewer = () => {
|
|
133
|
-
let {
|
|
134
|
-
value,
|
|
135
|
-
uploadLocalImageValue,
|
|
136
|
-
imageLinkValue
|
|
137
|
-
} = this.state;
|
|
138
|
-
let newValue = value.concat(uploadLocalImageValue, imageLinkValue);
|
|
139
|
-
this.setState({
|
|
140
|
-
value: newValue
|
|
141
|
-
});
|
|
142
|
-
this.togglePreviewer(_constants.FILE_EDITOR_STATUS.PREVIEWER);
|
|
143
|
-
};
|
|
144
|
-
this.saveImageLink = imageUrl => {
|
|
145
|
-
this.setState({
|
|
146
|
-
imageLinkValue: imageUrl,
|
|
147
|
-
isUpdated: true
|
|
148
|
-
});
|
|
149
|
-
this.showImageListPreviewer();
|
|
150
|
-
};
|
|
151
|
-
this.uploadFile = (file, callback) => {
|
|
152
|
-
return this.props.uploadFile(file, _constants2.IMAGES_FOLDER, callback);
|
|
153
|
-
};
|
|
154
|
-
this.state = {
|
|
155
|
-
value: props.value || [],
|
|
156
|
-
editorView: this.getEditorView(),
|
|
157
|
-
isOpen: true,
|
|
158
|
-
isShowFileChooser: false,
|
|
159
|
-
uploadLocalImageValue: [],
|
|
160
|
-
imageLinkValue: [],
|
|
161
|
-
isUpdated: false
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
render() {
|
|
165
|
-
return /*#__PURE__*/_react.default.createElement(_reactstrap.Modal, {
|
|
166
|
-
className: "dtable-ui-image-editor-dialog",
|
|
167
|
-
contentClassName: "dtable-ui-image-editor-modal",
|
|
168
|
-
isOpen: this.state.isOpen,
|
|
169
|
-
toggle: this.toggle
|
|
170
|
-
}, /*#__PURE__*/_react.default.createElement(_DTableModalHeader.default, {
|
|
171
|
-
toggle: this.toggle
|
|
172
|
-
}, this.renderHeader()), /*#__PURE__*/_react.default.createElement(_reactstrap.ModalBody, {
|
|
173
|
-
className: "p-0"
|
|
174
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
-
className: "dtable-ui-image-editor-container"
|
|
176
|
-
}, this.state.editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER && /*#__PURE__*/_react.default.createElement(_imagesPreviewer.default, {
|
|
177
|
-
value: this.state.value,
|
|
178
|
-
togglePreviewer: this.togglePreviewer,
|
|
179
|
-
deleteImage: this.deleteImage,
|
|
180
|
-
resetAdditionImage: this.resetAdditionImage
|
|
181
|
-
}), this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION && /*#__PURE__*/_react.default.createElement(_additionPreviewer.default, {
|
|
182
|
-
deleteImage: this.deleteImage,
|
|
183
|
-
handleFilesChange: this.handleFilesChange,
|
|
184
|
-
uploadLocalImageValue: this.state.uploadLocalImageValue,
|
|
185
|
-
togglePreviewer: this.togglePreviewer,
|
|
186
|
-
saveImageLink: this.saveImageLink,
|
|
187
|
-
fileUploadCompleted: this.fileUploadCompleted,
|
|
188
|
-
addUploadedFile: this.addUploadedFile,
|
|
189
|
-
showImageListPreviewer: this.showImageListPreviewer,
|
|
190
|
-
uploadFile: this.uploadFile
|
|
191
|
-
}))));
|
|
192
|
-
}
|
|
193
|
-
}
|
|
14
|
+
const ImageEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
15
|
+
let {
|
|
16
|
+
isMobile,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
19
|
+
if (isMobile === false) return /*#__PURE__*/_react.default.createElement(_pcEditor.default, Object.assign({}, props, {
|
|
20
|
+
ref: ref
|
|
21
|
+
}));
|
|
22
|
+
if (isMobile === true) return /*#__PURE__*/_react.default.createElement(_mbEditor.default, Object.assign({}, props, {
|
|
23
|
+
ref: ref
|
|
24
|
+
}));
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
26
|
+
query: "(min-width: 768px)"
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement(_pcEditor.default, Object.assign({}, props, {
|
|
28
|
+
ref: ref
|
|
29
|
+
}))), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
30
|
+
query: "(max-width: 768px)"
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(_mbEditor.default, Object.assign({}, props, {
|
|
32
|
+
ref: ref
|
|
33
|
+
}))));
|
|
34
|
+
});
|
|
194
35
|
var _default = exports.default = ImageEditor;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.dtable-ui-mobile-image-editor .dtable-ui-image-previewer-container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
margin-top: 20px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.dtable-ui-mobile-image-editor .dtable-ui-image-previewer-container .dtable-ui-image-previewer-wrapper {
|
|
7
|
+
background-color: #fff;
|
|
8
|
+
width: 100%;
|
|
9
|
+
border-top: 1px solid rgb(233, 233, 233);
|
|
10
|
+
border-bottom: 1px solid rgb(233, 233, 233);
|
|
11
|
+
height: fit-content;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dtable-ui-mobile-image-editor .dtable-ui-image-previewer-container .dtable-ui-image-previewer-box {
|
|
15
|
+
margin-right: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.dtable-ui-mobile-image-editor .dtable-ui-image-previewer-container .dtable-ui-image-previewer-box:nth-child(even) {
|
|
19
|
+
margin-left: 15px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.dtable-ui-mobile-image-editor .dtable-ui-image-previewer-container .add-item-btn {
|
|
23
|
+
margin-top: 20px;
|
|
24
|
+
border-bottom: 1px solid #dedede;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dtable-ui-mobile-image-editor .dtable-ui-image-previewer-container .add-item-btn:hover {
|
|
28
|
+
background-color: #fff;
|
|
29
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
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 _ActivityIndicator = _interopRequireDefault(require("../../ActivityIndicator"));
|
|
11
|
+
var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
|
|
12
|
+
var _imagesPreviewer = _interopRequireDefault(require("../images-previewer"));
|
|
13
|
+
var _MobileUpload = _interopRequireDefault(require("../../MobileUpload"));
|
|
14
|
+
var _toaster = _interopRequireDefault(require("../../toaster"));
|
|
15
|
+
var _utils = require("../../utils/utils");
|
|
16
|
+
var _lang = require("../../lang");
|
|
17
|
+
require("./index.css");
|
|
18
|
+
const {
|
|
19
|
+
Header,
|
|
20
|
+
Body
|
|
21
|
+
} = _MobileFullScreenPage.default;
|
|
22
|
+
const MBImageEditor = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
value: oldValue,
|
|
25
|
+
column,
|
|
26
|
+
config,
|
|
27
|
+
onToggle,
|
|
28
|
+
onCommit,
|
|
29
|
+
uploadFile
|
|
30
|
+
} = _ref;
|
|
31
|
+
const [value, setValue] = (0, _react.useState)(oldValue || []);
|
|
32
|
+
const [isShowEditor, setShowEditor] = (0, _react.useState)(false);
|
|
33
|
+
const [uploadLocalImages, setUploadLocalImages] = (0, _react.useState)([]);
|
|
34
|
+
const [isUploading, setUploading] = (0, _react.useState)(false);
|
|
35
|
+
const uploadingFilesCount = (0, _react.useRef)(0);
|
|
36
|
+
const uploadedFilesCount = (0, _react.useRef)(0);
|
|
37
|
+
const {
|
|
38
|
+
mediaUrl
|
|
39
|
+
} = config || {};
|
|
40
|
+
const resetAdditionImage = (0, _react.useCallback)(() => {
|
|
41
|
+
setUploadLocalImages([]);
|
|
42
|
+
}, []);
|
|
43
|
+
const openEditor = (0, _react.useCallback)(() => {
|
|
44
|
+
setShowEditor(true);
|
|
45
|
+
}, []);
|
|
46
|
+
const closeEditor = (0, _react.useCallback)(() => {
|
|
47
|
+
setShowEditor(false);
|
|
48
|
+
}, []);
|
|
49
|
+
const deleteImage = (0, _react.useCallback)(index => {
|
|
50
|
+
const newValue = value.slice(0);
|
|
51
|
+
newValue.splice(index, 1);
|
|
52
|
+
setValue(newValue);
|
|
53
|
+
onCommit(newValue);
|
|
54
|
+
}, [value, onCommit]);
|
|
55
|
+
const onChange = (0, _react.useCallback)(() => {
|
|
56
|
+
const newValue = value.concat(uploadLocalImages);
|
|
57
|
+
setValue(newValue);
|
|
58
|
+
onCommit(newValue);
|
|
59
|
+
setShowEditor(false);
|
|
60
|
+
}, [value, uploadLocalImages, onCommit]);
|
|
61
|
+
const uploadImage = (0, _react.useCallback)(file => {
|
|
62
|
+
uploadFile(file).then(res => {
|
|
63
|
+
const fileInfo = res;
|
|
64
|
+
const newUploadLocalImages = uploadLocalImages.slice(0);
|
|
65
|
+
newUploadLocalImages.push(fileInfo.url);
|
|
66
|
+
setUploadLocalImages(newUploadLocalImages);
|
|
67
|
+
uploadedFilesCount.current = uploadedFilesCount.current + 1;
|
|
68
|
+
}).catch(error => {
|
|
69
|
+
let errMsg = (0, _utils.getErrorMsg)(error, true);
|
|
70
|
+
if (!error.response || error.response.status !== 403) {
|
|
71
|
+
_toaster.default.danger((0, _lang.getLocale)(errMsg));
|
|
72
|
+
}
|
|
73
|
+
uploadedFilesCount.current = uploadedFilesCount.current + 1;
|
|
74
|
+
});
|
|
75
|
+
}, [uploadFile, uploadLocalImages]);
|
|
76
|
+
const onFilesChange = (0, _react.useCallback)(function () {
|
|
77
|
+
let files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
78
|
+
setUploading(true);
|
|
79
|
+
uploadingFilesCount.current = files.length;
|
|
80
|
+
uploadedFilesCount.current = 0;
|
|
81
|
+
for (let i = 0; i < uploadingFilesCount.current; i++) {
|
|
82
|
+
const file = files[i];
|
|
83
|
+
const reader = new FileReader();
|
|
84
|
+
reader.readAsDataURL(file);
|
|
85
|
+
reader.addEventListener('load', () => {
|
|
86
|
+
uploadImage(file);
|
|
87
|
+
}, false);
|
|
88
|
+
reader.addEventListener('error', () => {
|
|
89
|
+
const message = (0, _lang.getLocale)('Image_loading_failed');
|
|
90
|
+
_toaster.default.warning(message);
|
|
91
|
+
uploadedFilesCount.current = uploadedFilesCount.current + 1;
|
|
92
|
+
}, false);
|
|
93
|
+
}
|
|
94
|
+
}, [uploadImage]);
|
|
95
|
+
(0, _react.useEffect)(() => {
|
|
96
|
+
if (uploadingFilesCount.current === uploadedFilesCount.current && uploadedFilesCount.current !== 0) {
|
|
97
|
+
uploadedFilesCount.current = 0;
|
|
98
|
+
uploadingFilesCount.current = 0;
|
|
99
|
+
onChange();
|
|
100
|
+
setUploading(false);
|
|
101
|
+
}
|
|
102
|
+
}, [uploadingFilesCount, uploadedFilesCount, onChange]);
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
|
|
104
|
+
onClose: onToggle,
|
|
105
|
+
className: "dtable-ui-mobile-image-editor"
|
|
106
|
+
}, /*#__PURE__*/_react.default.createElement(Header, {
|
|
107
|
+
onLeftClick: onToggle
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
109
|
+
"aria-hidden": "true",
|
|
110
|
+
className: "dtable-font dtable-icon-return"
|
|
111
|
+
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name)), /*#__PURE__*/_react.default.createElement(Body, null, (0, _utils.isIPhone)() && (0, _utils.isQQBuiltInBrowser)() ? /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
+
className: "dtable-ui-file-open-external-browser"
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
114
|
+
className: "seatable-tip-danger"
|
|
115
|
+
}, '不支持 QQ 内置浏览器上传图片或者文件'), /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
+
className: "image-container"
|
|
117
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
118
|
+
src: mediaUrl + 'img/qq-upload-tip.png',
|
|
119
|
+
alt: "Open browser tip"
|
|
120
|
+
}))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_imagesPreviewer.default, {
|
|
121
|
+
value: value,
|
|
122
|
+
resetAdditionImage: resetAdditionImage,
|
|
123
|
+
togglePreviewer: openEditor,
|
|
124
|
+
closeEditor: closeEditor,
|
|
125
|
+
deleteImage: deleteImage
|
|
126
|
+
}), isShowEditor && /*#__PURE__*/_react.default.createElement(_MobileUpload.default, {
|
|
127
|
+
type: "image",
|
|
128
|
+
onClose: closeEditor,
|
|
129
|
+
onChange: onFilesChange
|
|
130
|
+
}), isUploading && /*#__PURE__*/_react.default.createElement(_ActivityIndicator.default, {
|
|
131
|
+
toast: true,
|
|
132
|
+
text: (0, _lang.getLocale)('Images_are_uploading'),
|
|
133
|
+
animating: isUploading
|
|
134
|
+
}))));
|
|
135
|
+
};
|
|
136
|
+
var _default = exports.default = MBImageEditor;
|
package/lib/ImageEditor/{addition-previewer → pc-editor/addition-previewer}/image-link/index.js
RENAMED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactstrap = require("reactstrap");
|
|
10
|
-
var _lang = require("
|
|
10
|
+
var _lang = require("../../../../lang");
|
|
11
11
|
require("./index.css");
|
|
12
12
|
class ImageLink extends _react.default.Component {
|
|
13
13
|
constructor(props) {
|
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _localImageAddition = _interopRequireDefault(require("./local-image-addition"));
|
|
10
10
|
var _imageLink = _interopRequireDefault(require("./image-link"));
|
|
11
|
-
var _lang = require("
|
|
11
|
+
var _lang = require("../../../lang");
|
|
12
12
|
require("./index.css");
|
|
13
13
|
class AdditionPreviewer extends _react.default.Component {
|
|
14
14
|
constructor(props) {
|
|
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _UploadProgress = _interopRequireDefault(require("
|
|
12
|
-
var _url = require("
|
|
13
|
-
var _FileUploader = _interopRequireDefault(require("
|
|
14
|
-
var _lang = require("
|
|
11
|
+
var _UploadProgress = _interopRequireDefault(require("../../../../UploadProgress"));
|
|
12
|
+
var _url = require("../../../../utils/url");
|
|
13
|
+
var _FileUploader = _interopRequireDefault(require("../../../../FileUploader"));
|
|
14
|
+
var _lang = require("../../../../lang");
|
|
15
15
|
require("./index.css");
|
|
16
16
|
class LocalImageAddition extends _react.default.Component {
|
|
17
17
|
constructor(props) {
|