dtable-ui-component 5.3.1-beta6 → 5.3.2
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/CheckboxEditor/index.css +20 -3
- package/lib/CheckboxEditor/index.js +35 -98
- package/lib/CheckboxFormatter/index.js +9 -6
- package/lib/CollaboratorEditor/index.css +35 -12
- package/lib/CollaboratorEditor/index.js +212 -18
- package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.js +29 -26
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +97 -0
- package/lib/CollaboratorItem/index.css +1 -1
- package/lib/CollaboratorItem/index.js +2 -6
- package/lib/DTableFiltersPopover/utils/index.js +7 -1
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
- package/lib/DTableGroupSelect/select-option-group.css +17 -17
- package/lib/DTableGroupSelect/select-option-group.js +1 -1
- package/lib/DTableSelect/index.js +1 -3
- package/lib/DateEditor/index.js +51 -14
- package/lib/DateEditor/pc-date-editor-popover.js +12 -145
- package/lib/Department-editor/department-single-select.js +1 -1
- package/lib/Department-editor/index.js +4 -3
- package/lib/DepartmentSingleSelectFormatter/index.js +1 -2
- package/lib/FileEditor/index.js +11 -258
- package/lib/FileEditor/pc-files-addition/index.js +1 -0
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +1 -0
- package/lib/FileEditor/pc-files-preview/index.js +1 -0
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +1 -0
- package/lib/FileItemFormatter/assets/file/192/excel.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/file.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/music.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/pdf.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/pic.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/ppt.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/txt.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/video.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/word.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/excel.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/file.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/music.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/pdf.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/pic.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/ppt.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/txt.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/video.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/word.png +0 -0
- package/lib/FileItemFormatter/assets/folder/folder-192.png +0 -0
- package/lib/FileItemFormatter/assets/folder/folder-24.png +0 -0
- package/lib/FileItemFormatter/index.js +20 -19
- package/lib/FileItemFormatter/utils.js +99 -0
- package/lib/FileUploader/index.js +14 -268
- package/lib/FormulaFormatter/index.js +1 -2
- package/lib/FormulaFormatter/utils.js +31 -0
- package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
- package/lib/MultipleSelectEditor/index.css +9 -0
- package/lib/MultipleSelectEditor/index.js +177 -16
- package/lib/NumberEditor/index.js +77 -64
- package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.css +1 -1
- package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.js +1 -1
- package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.css +6 -6
- package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.js +1 -3
- package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/row-expand-file-item-formatter.js +11 -10
- package/lib/RowExpandFormatter/index.css +1 -27
- package/lib/RowExpandFormatter/index.js +100 -83
- package/lib/{RowExpandFormatter/RowExpandFormulaFormatter → RowExpandFormulaFormatter}/index.js +10 -11
- package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.css +6 -6
- package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.js +1 -1
- package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/row-expand-image-item-formatter.js +3 -3
- package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
- package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.js +6 -6
- package/lib/RowExpandLinkFormatter/utils.js +71 -0
- package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.css +1 -1
- package/lib/RowExpandUrlFormatter/index.css +1 -0
- package/lib/{RowExpandFormatter/RowExpandUrlFormatter → RowExpandUrlFormatter}/index.js +3 -4
- package/lib/SingleSelectEditor/index.css +14 -0
- package/lib/SingleSelectEditor/index.js +156 -16
- package/lib/TextEditor/index.js +42 -113
- package/lib/constants/index.js +2 -34
- package/lib/css/cell-editor.css +2 -18
- package/lib/index.js +46 -74
- package/lib/lang/index.js +16 -19
- package/lib/locals/de.js +103 -0
- package/lib/locals/en.js +104 -0
- package/lib/locals/es.js +103 -0
- package/lib/locals/fr.js +103 -0
- package/lib/locals/pt.js +103 -0
- package/lib/locals/ru.js +103 -0
- package/lib/locals/zh-CN.js +104 -0
- package/lib/select-editor/index.js +6 -6
- package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.js +3 -3
- package/lib/select-editor/pc-select-editor-popover/index.css +71 -0
- package/lib/select-editor/pc-select-editor-popover/index.js +122 -0
- package/lib/utils/editor-utils.js +6 -1
- package/lib/utils/url.js +8 -121
- package/lib/utils/utils.js +2 -145
- package/package.json +2 -3
- package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +0 -257
- package/lib/Comment/body/comment.js +0 -190
- package/lib/Comment/body/index.css +0 -95
- package/lib/Comment/body/index.js +0 -32
- package/lib/Comment/footer/btns/index.css +0 -40
- package/lib/Comment/footer/btns/index.js +0 -113
- package/lib/Comment/footer/index.css +0 -157
- package/lib/Comment/footer/index.js +0 -170
- package/lib/Comment/footer/input/index.css +0 -52
- package/lib/Comment/footer/input/index.js +0 -448
- package/lib/Comment/footer/input/participant/index.css +0 -0
- package/lib/Comment/footer/input/participant/index.js +0 -53
- package/lib/Comment/footer/participants/index.css +0 -22
- package/lib/Comment/footer/participants/index.js +0 -68
- package/lib/Comment/footer/participants/participant/index.css +0 -5
- package/lib/Comment/footer/participants/participant/index.js +0 -32
- package/lib/Comment/footer/participants/participant-select/index.css +0 -104
- package/lib/Comment/footer/participants/participant-select/index.js +0 -182
- package/lib/Comment/index.css +0 -19
- package/lib/Comment/index.js +0 -305
- package/lib/Comment/model.js +0 -25
- package/lib/Comment/utils/common.js +0 -62
- package/lib/Comment/utils/index.js +0 -27
- package/lib/Comment/utils/utilities.js +0 -176
- package/lib/DeleteTip/index.js +0 -50
- package/lib/DigitalSignEditor/constants.js +0 -7
- package/lib/DigitalSignEditor/index.css +0 -69
- package/lib/DigitalSignEditor/index.js +0 -182
- package/lib/DigitalSignEditor/service.js +0 -38
- package/lib/DigitalSignEditor/signature-board/index.css +0 -35
- package/lib/DigitalSignEditor/signature-board/index.js +0 -135
- package/lib/DigitalSignEditor/signature-board/signature-tool.js +0 -396
- package/lib/DigitalSignEditor/utils.js +0 -29
- package/lib/DurationEditor/index.js +0 -111
- package/lib/EmailEditor/index.js +0 -59
- package/lib/FileEditor/addition-previewer/index.css +0 -1
- package/lib/FileEditor/addition-previewer/index.js +0 -52
- package/lib/FileEditor/addition-previewer/local-file-addition/index.css +0 -1
- package/lib/FileEditor/addition-previewer/local-file-addition/index.js +0 -252
- package/lib/FileEditor/constants.js +0 -7
- package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +0 -74
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +0 -5
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +0 -77
- package/lib/FileEditor/files-previewer/file-previewer/index.css +0 -88
- package/lib/FileEditor/files-previewer/file-previewer/index.js +0 -167
- package/lib/FileEditor/files-previewer/index.css +0 -56
- package/lib/FileEditor/files-previewer/index.js +0 -277
- package/lib/FileEditor/index.css +0 -6
- package/lib/FileEditor/utils.js +0 -22
- package/lib/FileUploader/index.css +0 -9
- package/lib/GeolocationEditor/country-editor.js +0 -319
- package/lib/GeolocationEditor/index.css +0 -641
- package/lib/GeolocationEditor/index.js +0 -241
- package/lib/GeolocationEditor/location-editor.js +0 -368
- package/lib/GeolocationEditor/map-editor/index.js +0 -456
- package/lib/GeolocationEditor/map-editor/large-editor/index.css +0 -137
- package/lib/GeolocationEditor/map-editor/large-editor/index.js +0 -461
- package/lib/GeolocationEditor/map-editor-utils.js +0 -153
- package/lib/GeolocationEditor/map-selection-editor/index.js +0 -455
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +0 -1
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +0 -447
- package/lib/GeolocationEditor/parse-geolocation.js +0 -282
- package/lib/GeolocationEditor/province-city-editor.js +0 -292
- package/lib/GeolocationEditor/province-editor.js +0 -226
- package/lib/GeolocationEditor/selector-header-item.js +0 -28
- package/lib/GeolocationEditor/selector-list.js +0 -33
- package/lib/GeolocationEditor/with-ref.js +0 -27
- package/lib/ImageEditor/addition-previewer/image-link/index.css +0 -45
- package/lib/ImageEditor/addition-previewer/image-link/index.js +0 -73
- package/lib/ImageEditor/addition-previewer/index.css +0 -106
- package/lib/ImageEditor/addition-previewer/index.js +0 -63
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +0 -125
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +0 -254
- package/lib/ImageEditor/constants.js +0 -7
- package/lib/ImageEditor/images-previewer/image-preview/index.css +0 -59
- package/lib/ImageEditor/images-previewer/image-preview/index.js +0 -155
- package/lib/ImageEditor/images-previewer/index.css +0 -18
- package/lib/ImageEditor/images-previewer/index.js +0 -140
- package/lib/ImageEditor/index.css +0 -24
- package/lib/ImageEditor/index.js +0 -194
- package/lib/ImageThumbnail/index.css +0 -20
- package/lib/ImageThumbnail/index.js +0 -136
- package/lib/RowExpandDialog/body/index.css +0 -21
- package/lib/RowExpandDialog/body/index.js +0 -262
- package/lib/RowExpandDialog/column-content/index.css +0 -44
- package/lib/RowExpandDialog/column-content/index.js +0 -50
- package/lib/RowExpandDialog/header/index.css +0 -31
- package/lib/RowExpandDialog/header/index.js +0 -55
- package/lib/RowExpandDialog/index.css +0 -24
- package/lib/RowExpandDialog/index.js +0 -252
- package/lib/RowExpandEditor/RowExpandAddBtn/index.css +0 -22
- package/lib/RowExpandEditor/RowExpandAddBtn/index.js +0 -24
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +0 -18
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +0 -43
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +0 -5
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +0 -232
- package/lib/RowExpandEditor/RowExpandDateEditor/index.js +0 -130
- package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +0 -129
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +0 -13
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +0 -208
- package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +0 -105
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +0 -2
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +0 -125
- package/lib/RowExpandEditor/RowExpandFileEditor/index.css +0 -1
- package/lib/RowExpandEditor/RowExpandFileEditor/index.js +0 -146
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +0 -17
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +0 -165
- package/lib/RowExpandEditor/RowExpandImageEditor/index.css +0 -6
- package/lib/RowExpandEditor/RowExpandImageEditor/index.js +0 -170
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +0 -6
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +0 -123
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +0 -44
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +0 -224
- package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +0 -105
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +0 -13
- package/lib/RowExpandEditor/RowExpandRateEditor/index.js +0 -152
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +0 -58
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +0 -192
- package/lib/RowExpandEditor/RowExpandTextEditor/index.css +0 -4
- package/lib/RowExpandEditor/RowExpandTextEditor/index.js +0 -127
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +0 -31
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +0 -130
- package/lib/RowExpandEditor/constants.js +0 -44
- package/lib/RowExpandEditor/index.css +0 -0
- package/lib/RowExpandEditor/index.js +0 -32
- package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +0 -27
- package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +0 -1
- package/lib/RowExpandFormatter/constants.js +0 -60
- package/lib/UploadProgress/index.js +0 -38
- package/lib/UrlEditor/index.js +0 -62
- package/lib/common/editor-base.js +0 -53
- package/lib/constants/file.js +0 -96
- package/lib/constants/key-codes.js +0 -109
- package/lib/hooks/index.js +0 -16
- package/lib/locales/de.json +0 -167
- package/lib/locales/en.json +0 -167
- package/lib/locales/es.json +0 -167
- package/lib/locales/fr.json +0 -167
- package/lib/locales/pt.json +0 -167
- package/lib/locales/ru.json +0 -167
- package/lib/locales/zh-CN.json +0 -167
- package/lib/select-editor/pc-select-editor/index.css +0 -85
- package/lib/select-editor/pc-select-editor/index.js +0 -290
- package/lib/utils/cell-comparer.js +0 -35
- package/lib/utils/cell.js +0 -55
- package/lib/utils/column-utils.js +0 -25
- package/lib/utils/get-event-transfer.js +0 -75
- package/lib/utils/hotkey.js +0 -37
- package/lib/utils/object-utils.js +0 -61
- /package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.css +0 -0
- /package/lib/CollaboratorEditor/{pc-collaborator-editor → pc-collaborator-editor-popover}/index.css +0 -0
- /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.css +0 -0
- /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/value-display-utils.js +0 -0
- /package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.js +0 -0
- /package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.css +0 -0
|
@@ -1,140 +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 _ImagePreviewerLightbox = _interopRequireDefault(require("../../ImagePreviewerLightbox"));
|
|
10
|
-
var _imagePreview = _interopRequireDefault(require("./image-preview"));
|
|
11
|
-
var _DTableCommonAddTool = _interopRequireDefault(require("../../DTableCommonAddTool"));
|
|
12
|
-
var _utils = require("../../utils/utils");
|
|
13
|
-
var _constants = require("../../constants");
|
|
14
|
-
var _lang = require("../../lang");
|
|
15
|
-
require("./index.css");
|
|
16
|
-
class ImagesPreviewer extends _react.default.Component {
|
|
17
|
-
constructor(props) {
|
|
18
|
-
super(props);
|
|
19
|
-
this.handleHistoryBack = e => {
|
|
20
|
-
if (this.state.isShowLargeImage) {
|
|
21
|
-
this.hideLargeImage();
|
|
22
|
-
} else if (this.props.closeEditor) {
|
|
23
|
-
this.props.closeEditor();
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
this.showLargeImage = itemUrl => {
|
|
27
|
-
let {
|
|
28
|
-
value
|
|
29
|
-
} = this.props;
|
|
30
|
-
this.setState({
|
|
31
|
-
isShowLargeImage: true,
|
|
32
|
-
largeImageIndex: value.indexOf(itemUrl)
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
this.hideLargeImage = () => {
|
|
36
|
-
this.setState({
|
|
37
|
-
isShowLargeImage: false,
|
|
38
|
-
largeImageIndex: ''
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
this.moveNext = () => {
|
|
42
|
-
let images = this.props.value;
|
|
43
|
-
this.setState(prevState => ({
|
|
44
|
-
largeImageIndex: (prevState.largeImageIndex + 1) % images.length
|
|
45
|
-
}));
|
|
46
|
-
};
|
|
47
|
-
this.movePrev = () => {
|
|
48
|
-
let images = this.props.value;
|
|
49
|
-
this.setState(prevState => ({
|
|
50
|
-
largeImageIndex: (prevState.largeImageIndex + images.length - 1) % images.length
|
|
51
|
-
}));
|
|
52
|
-
};
|
|
53
|
-
this.togglePreviewer = () => {
|
|
54
|
-
this.props.togglePreviewer(_constants.FILE_EDITOR_STATUS.ADDITION);
|
|
55
|
-
this.props.resetAdditionImage();
|
|
56
|
-
};
|
|
57
|
-
this.deleteImage = (index, type) => {
|
|
58
|
-
this.props.deleteImage(index, type);
|
|
59
|
-
const {
|
|
60
|
-
value
|
|
61
|
-
} = this.props;
|
|
62
|
-
if (index > value.length - 2) {
|
|
63
|
-
if (value.length - 2 < 0) {
|
|
64
|
-
this.hideLargeImage();
|
|
65
|
-
} else {
|
|
66
|
-
this.setState({
|
|
67
|
-
largeImageIndex: 0
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
this.downloadImage = imageItemUrl => {
|
|
73
|
-
let rotateIndex = imageItemUrl.indexOf('?a=');
|
|
74
|
-
if (rotateIndex > -1) {
|
|
75
|
-
imageItemUrl = imageItemUrl.slice(0, rotateIndex);
|
|
76
|
-
}
|
|
77
|
-
let imageUrlSuffix = imageItemUrl.indexOf('?dl=1');
|
|
78
|
-
let downloadUrl = imageUrlSuffix !== -1 ? imageItemUrl : imageItemUrl + '?dl=1';
|
|
79
|
-
(0, _utils.downloadFile)(downloadUrl);
|
|
80
|
-
};
|
|
81
|
-
this.setImageItemIndex = index => {
|
|
82
|
-
this.setState({
|
|
83
|
-
enterImageItemIndex: index
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
this.state = {
|
|
87
|
-
isShowLargeImage: false,
|
|
88
|
-
largeImageIndex: '',
|
|
89
|
-
enterImageItemIndex: -1
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
componentDidMount() {
|
|
93
|
-
if (window.isMobile) {
|
|
94
|
-
window.history.pushState(null, null, '#');
|
|
95
|
-
window.addEventListener('popstate', this.handleHistoryBack, false);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
componentWillUnmount() {
|
|
99
|
-
if (window.isMobile) {
|
|
100
|
-
window.removeEventListener('popstate', this.handleHistoryBack, false);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
render() {
|
|
104
|
-
let {
|
|
105
|
-
value
|
|
106
|
-
} = this.props;
|
|
107
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
108
|
-
className: "dtable-ui-image-previewer-container"
|
|
109
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
-
className: "dtable-ui-image-previewer-wrapper ".concat(value.length === 0 && window.isMobile ? 'd-none' : '')
|
|
111
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
-
className: "dtable-ui-image-previewer-content"
|
|
113
|
-
}, value.length > 0 && value.map((imageItemUrl, index) => {
|
|
114
|
-
return /*#__PURE__*/_react.default.createElement(_imagePreview.default, {
|
|
115
|
-
key: imageItemUrl + index,
|
|
116
|
-
imageItemUrl: imageItemUrl,
|
|
117
|
-
value: value,
|
|
118
|
-
itemIndex: index,
|
|
119
|
-
deleteImage: this.props.deleteImage,
|
|
120
|
-
showLargeImage: this.showLargeImage,
|
|
121
|
-
downloadImage: this.downloadImage,
|
|
122
|
-
enterImageItemIndex: this.state.enterImageItemIndex,
|
|
123
|
-
setImageItemIndex: this.setImageItemIndex
|
|
124
|
-
});
|
|
125
|
-
}))), this.state.isShowLargeImage && /*#__PURE__*/_react.default.createElement(_ImagePreviewerLightbox.default, {
|
|
126
|
-
imageItems: value,
|
|
127
|
-
imageIndex: this.state.largeImageIndex,
|
|
128
|
-
closeImagePopup: this.hideLargeImage,
|
|
129
|
-
moveToPrevImage: this.movePrev,
|
|
130
|
-
moveToNextImage: this.moveNext,
|
|
131
|
-
deleteImage: this.props.deleteImage ? this.deleteImage : null,
|
|
132
|
-
downloadImage: this.downloadImage,
|
|
133
|
-
onRotateImage: this.props.onRotateImage
|
|
134
|
-
}), /*#__PURE__*/_react.default.createElement(_DTableCommonAddTool.default, {
|
|
135
|
-
callBack: this.togglePreviewer,
|
|
136
|
-
footerName: (0, _lang.getLocale)('Add_images')
|
|
137
|
-
}));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
var _default = exports.default = ImagesPreviewer;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.dtable-ui-image-editor-dialog {
|
|
2
|
-
max-width: 620px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.dtable-ui-image-editor-modal {
|
|
6
|
-
width: 620px;
|
|
7
|
-
max-height: 620px;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.dtable-ui-image-editor-container {
|
|
12
|
-
width: 100%;
|
|
13
|
-
background-color: #fff;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.dtable-ui-image-addition-container {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: row;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.dtable-ui-image-editor-dialog .dtable-icon-return {
|
|
22
|
-
color: #666666;
|
|
23
|
-
font-size: 14px;
|
|
24
|
-
}
|
package/lib/ImageEditor/index.js
DELETED
|
@@ -1,194 +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 _imagesPreviewer = _interopRequireDefault(require("./images-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
|
-
require("./index.css");
|
|
17
|
-
class ImageEditor extends _react.default.Component {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
var _this;
|
|
20
|
-
super(props);
|
|
21
|
-
_this = this;
|
|
22
|
-
this.getValue = () => {
|
|
23
|
-
return this.state.value;
|
|
24
|
-
};
|
|
25
|
-
this.getEditorView = () => {
|
|
26
|
-
const {
|
|
27
|
-
isInModal,
|
|
28
|
-
value
|
|
29
|
-
} = this.props;
|
|
30
|
-
return !value || value.length === 0 || isInModal ? _constants.FILE_EDITOR_STATUS.ADDITION : _constants.FILE_EDITOR_STATUS.PREVIEWER;
|
|
31
|
-
};
|
|
32
|
-
this.deleteImage = function (index) {
|
|
33
|
-
let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
34
|
-
let uploadLocalImageValue = _this.state.uploadLocalImageValue.slice(0);
|
|
35
|
-
let value = _this.state.value.slice(0);
|
|
36
|
-
if (_this.state.editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER) {
|
|
37
|
-
value.splice(index, 1);
|
|
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
|
-
}
|
|
194
|
-
var _default = exports.default = ImageEditor;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
.dtable-ui-image-thumbnail {
|
|
2
|
-
height: 100px;
|
|
3
|
-
width: 100px;
|
|
4
|
-
border: 2px solid #ededed;
|
|
5
|
-
border-radius: 4px;
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
margin: 5px;
|
|
11
|
-
position: relative;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.dtable-ui-image-thumbnail .dtable-ui-image-icons-choice {
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.dtable-ui-image-thumbnail:hover .dtable-ui-image-icons-choice {
|
|
19
|
-
display: flex;
|
|
20
|
-
}
|
|
@@ -1,136 +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 _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _url = require("../utils/url");
|
|
12
|
-
var _DeleteTip = _interopRequireDefault(require("../DeleteTip"));
|
|
13
|
-
var _lang = require("../lang");
|
|
14
|
-
require("./index.css");
|
|
15
|
-
class ImageThumbnail extends _react.default.Component {
|
|
16
|
-
constructor(props) {
|
|
17
|
-
super(props);
|
|
18
|
-
this.getUrl = src => {
|
|
19
|
-
if ((0, _url.checkSVGImage)(src)) {
|
|
20
|
-
this.setState({
|
|
21
|
-
imageThumbnailUrl: src
|
|
22
|
-
});
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const imageThumbnailUrl = (0, _url.getImageThumbnailUrl)(src);
|
|
26
|
-
(0, _url.checkImgExists)(imageThumbnailUrl).then(() => {
|
|
27
|
-
this.setState({
|
|
28
|
-
imageThumbnailUrl
|
|
29
|
-
});
|
|
30
|
-
}).catch(() => {
|
|
31
|
-
this.setState({
|
|
32
|
-
imageThumbnailUrl: this.imageLoadingFailedUrl
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
this.onClick = () => {
|
|
37
|
-
this.props.onClick(this.props.index);
|
|
38
|
-
};
|
|
39
|
-
this.downloadImage = e => {
|
|
40
|
-
e.stopPropagation();
|
|
41
|
-
this.props.downloadImage(this.props.src);
|
|
42
|
-
};
|
|
43
|
-
this.deleteImage = () => {
|
|
44
|
-
this.closeTip();
|
|
45
|
-
this.props.deleteImage(this.props.index);
|
|
46
|
-
};
|
|
47
|
-
this.onClickDelete = e => {
|
|
48
|
-
e.stopPropagation();
|
|
49
|
-
this.position = {
|
|
50
|
-
top: e.clientY,
|
|
51
|
-
left: e.clientX
|
|
52
|
-
};
|
|
53
|
-
this.setState({
|
|
54
|
-
showTip: true
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
this.closeTip = () => {
|
|
58
|
-
this.setState({
|
|
59
|
-
showTip: false
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
this.toggle = () => {
|
|
63
|
-
this.setState({
|
|
64
|
-
isTooltipOpen: !this.state.isTooltipOpen
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
this.state = {
|
|
68
|
-
imageThumbnailUrl: '',
|
|
69
|
-
showTip: false,
|
|
70
|
-
isTooltipOpen: false
|
|
71
|
-
};
|
|
72
|
-
this.ref = null;
|
|
73
|
-
const {
|
|
74
|
-
mediaUrl = ''
|
|
75
|
-
} = props.config || {};
|
|
76
|
-
this.imageLoadingFailedUrl = "".concat(mediaUrl, "img/image-loading-failed.png");
|
|
77
|
-
}
|
|
78
|
-
componentDidMount() {
|
|
79
|
-
this.getUrl(this.props.src);
|
|
80
|
-
}
|
|
81
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
82
|
-
if (nextProps.src !== this.props.src) {
|
|
83
|
-
this.getUrl(nextProps.src);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
render() {
|
|
87
|
-
const {
|
|
88
|
-
index,
|
|
89
|
-
downloadImage,
|
|
90
|
-
src,
|
|
91
|
-
className
|
|
92
|
-
} = this.props;
|
|
93
|
-
const {
|
|
94
|
-
imageThumbnailUrl
|
|
95
|
-
} = this.state;
|
|
96
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
97
|
-
className: (0, _classnames.default)('dtable-ui-image-thumbnail', className),
|
|
98
|
-
onClick: this.onClick,
|
|
99
|
-
ref: ref => this.ref = ref
|
|
100
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
101
|
-
src: imageThumbnailUrl,
|
|
102
|
-
id: "item-image-".concat(index),
|
|
103
|
-
alt: ""
|
|
104
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
105
|
-
className: "dtable-ui-image-icons-choice"
|
|
106
|
-
}, downloadImage && /*#__PURE__*/_react.default.createElement("span", {
|
|
107
|
-
className: "image-icon",
|
|
108
|
-
onClick: this.downloadImage
|
|
109
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
110
|
-
"aria-hidden": "true",
|
|
111
|
-
className: "dtable-font dtable-icon-download"
|
|
112
|
-
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
113
|
-
className: "image-icon",
|
|
114
|
-
onClick: this.onClickDelete
|
|
115
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
116
|
-
"aria-hidden": "true",
|
|
117
|
-
className: "dtable-font dtable-icon-fork-number"
|
|
118
|
-
})))), this.state.showTip && /*#__PURE__*/_react.default.createElement(_DeleteTip.default, {
|
|
119
|
-
position: this.position,
|
|
120
|
-
toggle: this.closeTip,
|
|
121
|
-
deleteImage: this.deleteImage,
|
|
122
|
-
deleteTip: (0, _lang.getLocale)('Are_you_sure_you_want_to_delete_this_image')
|
|
123
|
-
}), this.ref && /*#__PURE__*/_react.default.createElement(_reactstrap.Tooltip, {
|
|
124
|
-
placement: "bottom",
|
|
125
|
-
isOpen: this.state.isTooltipOpen,
|
|
126
|
-
toggle: this.toggle,
|
|
127
|
-
target: this.ref,
|
|
128
|
-
delay: {
|
|
129
|
-
show: 0,
|
|
130
|
-
hide: 0
|
|
131
|
-
},
|
|
132
|
-
fade: false
|
|
133
|
-
}, (0, _url.getFileName)(src)));
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
var _default = exports.default = ImageThumbnail;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.dtable-ui-row-expand-body {
|
|
2
|
-
flex: 1;
|
|
3
|
-
padding: 0;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.dtable-ui-row-expand-body .dtable-ui-row-expand-body-content {
|
|
10
|
-
flex: 1 1;
|
|
11
|
-
overflow-y: scroll;
|
|
12
|
-
padding: 30px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.dtable-ui-row-expand-body .dtable-ui-row-expand-item {
|
|
16
|
-
min-height: 56px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.dtable-ui-row-expand-body .dtable-ui-row-expand-item:first-child {
|
|
20
|
-
margin-top: 2px;
|
|
21
|
-
}
|