dtable-ui-component 5.3.1-beta → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/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/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 -244
- 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 +0 -26
- package/lib/RowExpandFormatter/index.js +100 -84
- 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 +5 -5
- package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/utils.js +1 -1
- 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 +14 -16
- 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 -119
- package/lib/utils/utils.js +2 -89
- package/package.json +2 -3
- package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +0 -257
- 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 -279
- package/lib/RowExpandDialog/column-content/index.css +0 -43
- package/lib/RowExpandDialog/column-content/index.js +0 -50
- package/lib/RowExpandDialog/constants.js +0 -114
- package/lib/RowExpandDialog/header/index.css +0 -31
- package/lib/RowExpandDialog/header/index.js +0 -33
- package/lib/RowExpandDialog/index.css +0 -24
- package/lib/RowExpandDialog/index.js +0 -268
- package/lib/RowExpandDialog/utils.js +0 -83
- 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 -124
- 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 -163
- package/lib/locales/en.json +0 -163
- package/lib/locales/es.json +0 -163
- package/lib/locales/fr.json +0 -163
- package/lib/locales/pt.json +0 -163
- package/lib/locales/ru.json +0 -163
- package/lib/locales/zh-CN.json +0 -163
- 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/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,252 +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 _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _UploadProgress = _interopRequireDefault(require("../../../UploadProgress"));
|
|
13
|
-
var _url = require("../../../utils/url");
|
|
14
|
-
var _FileUploader = _interopRequireDefault(require("../../../FileUploader"));
|
|
15
|
-
var _lang = require("../../../lang");
|
|
16
|
-
require("./index.css");
|
|
17
|
-
class LocalFileAddition extends _react.default.Component {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.setFileTipShow = isFileTipShow => {
|
|
21
|
-
this.setState({
|
|
22
|
-
isFileTipShow: isFileTipShow
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
this.updateUploadFileList = fileListInfo => {
|
|
26
|
-
if (!fileListInfo) {
|
|
27
|
-
this.setState({
|
|
28
|
-
thumbnailSrcList: []
|
|
29
|
-
});
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
this.setState({
|
|
33
|
-
thumbnailSrcList: fileListInfo
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
this.onFileUploadSuccess = fileMessage => {
|
|
37
|
-
this.hideDeleteIcon();
|
|
38
|
-
let {
|
|
39
|
-
thumbnailSrcList
|
|
40
|
-
} = this.state;
|
|
41
|
-
const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
|
|
42
|
-
thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
|
|
43
|
-
if (thumbnailSrcList.every(fileItem => !fileItem.isUploading)) {
|
|
44
|
-
this.setState({
|
|
45
|
-
thumbnailSrcList: []
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
this.props.fileUploadCompleted(fileMessage);
|
|
49
|
-
};
|
|
50
|
-
this.onFileUploadProgress = fileMessage => {
|
|
51
|
-
let {
|
|
52
|
-
thumbnailSrcList
|
|
53
|
-
} = this.state;
|
|
54
|
-
const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
|
|
55
|
-
thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
|
|
56
|
-
this.setState({
|
|
57
|
-
thumbnailSrcList
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
this.onFileUploadFailed = fileMessage => {
|
|
61
|
-
let {
|
|
62
|
-
thumbnailSrcList
|
|
63
|
-
} = this.state;
|
|
64
|
-
const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
|
|
65
|
-
thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
|
|
66
|
-
this.setState({
|
|
67
|
-
thumbnailSrcList
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
this.findUploadFileIndex = uploadFileMessage => {
|
|
71
|
-
let {
|
|
72
|
-
thumbnailSrcList
|
|
73
|
-
} = this.state;
|
|
74
|
-
let uploadFileIndex = thumbnailSrcList.findIndex(item => item.name === uploadFileMessage.file.name);
|
|
75
|
-
return uploadFileIndex;
|
|
76
|
-
};
|
|
77
|
-
this.deleteFile = (event, index) => {
|
|
78
|
-
this.props.deleteFile(index, 'localFile');
|
|
79
|
-
};
|
|
80
|
-
this.showDeleteIcon = (event, index) => {
|
|
81
|
-
this.setState({
|
|
82
|
-
isShowDeleteIcon: true,
|
|
83
|
-
enterFileIndex: index
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
this.hideDeleteIcon = () => {
|
|
87
|
-
this.setState({
|
|
88
|
-
isShowDeleteIcon: false,
|
|
89
|
-
enterFileIndex: -1
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
this.fileUploadAgain = (event, fileMessage) => {
|
|
93
|
-
this.uploaderFileRef.reuploadFile(fileMessage);
|
|
94
|
-
};
|
|
95
|
-
this.tooltipToggle = () => {
|
|
96
|
-
if (this.state.tooltipOpen) {
|
|
97
|
-
this.setState({
|
|
98
|
-
isShowDeleteIcon: false,
|
|
99
|
-
enterFileIndex: -1
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
this.setState({
|
|
103
|
-
tooltipOpen: !this.state.tooltipOpen
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
this.renderMultipleFilesArr = () => {
|
|
107
|
-
let {
|
|
108
|
-
thumbnailSrcList
|
|
109
|
-
} = this.state;
|
|
110
|
-
let fileArr = [];
|
|
111
|
-
if (Array.isArray(this.props.uploadLocalFileValue)) {
|
|
112
|
-
let uploadedFileList = this.renderUploadedFile();
|
|
113
|
-
if (uploadedFileList) {
|
|
114
|
-
fileArr.push(...uploadedFileList);
|
|
115
|
-
}
|
|
116
|
-
if (Array.isArray(thumbnailSrcList) && thumbnailSrcList.length > 0) {
|
|
117
|
-
let thumbnailList = thumbnailSrcList.map((fileThumbnailItem, index) => {
|
|
118
|
-
let uploadFile = fileThumbnailItem.percent === 100 && !fileThumbnailItem.isErrorTip;
|
|
119
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
120
|
-
key: "dtable-ui-image-wrapper-circle".concat(index)
|
|
121
|
-
}, fileThumbnailItem.isUploading && /*#__PURE__*/_react.default.createElement("div", {
|
|
122
|
-
className: "dtable-ui-image-wrapper"
|
|
123
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
-
className: "dtable-ui-image-upload-percent"
|
|
125
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
126
|
-
src: fileThumbnailItem.fileIconUrl,
|
|
127
|
-
style: {
|
|
128
|
-
position: 'absolute',
|
|
129
|
-
zIndex: "".concat(uploadFile ? 3 : 1),
|
|
130
|
-
maxHeight: '100%'
|
|
131
|
-
},
|
|
132
|
-
alt: ""
|
|
133
|
-
}), fileThumbnailItem.percent < 100 && /*#__PURE__*/_react.default.createElement(_UploadProgress.default, {
|
|
134
|
-
uploadPercent: fileThumbnailItem.percent || 0
|
|
135
|
-
}), uploadFile && /*#__PURE__*/_react.default.createElement("div", {
|
|
136
|
-
className: "dtable-ui-image-upload-success"
|
|
137
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
138
|
-
className: "dtable-ui-image-upload-success-scale"
|
|
139
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
140
|
-
className: "dtable-ui-image-upload-success-tip"
|
|
141
|
-
}, (0, _lang.getLocale)('Indexing')))), /*#__PURE__*/_react.default.createElement("div", {
|
|
142
|
-
className: "dtable-ui-image-upload-mask"
|
|
143
|
-
}), fileThumbnailItem.isErrorTip && /*#__PURE__*/_react.default.createElement("div", {
|
|
144
|
-
className: "dtable-ui-image-upload-error-tip"
|
|
145
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Network_Error')), /*#__PURE__*/_react.default.createElement("span", {
|
|
146
|
-
className: "dtable-ui-image-upload-again",
|
|
147
|
-
onClick: event => this.fileUploadAgain(event, fileThumbnailItem)
|
|
148
|
-
}, (0, _lang.getLocale)('Re_upload'))))));
|
|
149
|
-
});
|
|
150
|
-
fileArr.push(...thumbnailList);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return fileArr;
|
|
154
|
-
};
|
|
155
|
-
this.renderUploadedFile = () => {
|
|
156
|
-
const {
|
|
157
|
-
config,
|
|
158
|
-
uploadLocalFileValue
|
|
159
|
-
} = this.props;
|
|
160
|
-
let uploadedFileList = [];
|
|
161
|
-
uploadedFileList = uploadLocalFileValue.length > 0 && uploadLocalFileValue.map((fileItem, index) => {
|
|
162
|
-
let {
|
|
163
|
-
fileIconUrl
|
|
164
|
-
} = (0, _url.getFileThumbnailInfo)(fileItem, config);
|
|
165
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
-
key: 'dtable-ui-image-wrapper-' + index,
|
|
167
|
-
className: "dtable-ui-image-wrapper",
|
|
168
|
-
id: "file-content-tip-".concat(index),
|
|
169
|
-
onMouseEnter: event => this.showDeleteIcon(event, index),
|
|
170
|
-
onMouseLeave: this.hideDeleteIcon
|
|
171
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
172
|
-
className: "dtable-ui-image-content"
|
|
173
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
174
|
-
src: fileIconUrl,
|
|
175
|
-
alt: "",
|
|
176
|
-
style: {
|
|
177
|
-
maxHeight: '100%'
|
|
178
|
-
}
|
|
179
|
-
})), this.state.isShowDeleteIcon && this.state.enterFileIndex === index && /*#__PURE__*/_react.default.createElement("div", {
|
|
180
|
-
className: "dtable-delete-image-icon",
|
|
181
|
-
onClick: event => this.deleteFile(event, index)
|
|
182
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
183
|
-
className: "image-delete-span"
|
|
184
|
-
}, "x")), this.state.isShowDeleteIcon && this.state.enterFileIndex === index && /*#__PURE__*/_react.default.createElement(_reactstrap.Tooltip, {
|
|
185
|
-
toggle: this.tooltipToggle,
|
|
186
|
-
delay: {
|
|
187
|
-
show: 0,
|
|
188
|
-
hide: 0
|
|
189
|
-
},
|
|
190
|
-
target: "file-content-tip-".concat(index),
|
|
191
|
-
placement: "bottom",
|
|
192
|
-
isOpen: this.state.tooltipOpen
|
|
193
|
-
}, fileItem.name));
|
|
194
|
-
});
|
|
195
|
-
return uploadedFileList;
|
|
196
|
-
};
|
|
197
|
-
this.renderUploadFileWrapper = fileArr => {
|
|
198
|
-
let {
|
|
199
|
-
isFileTipShow
|
|
200
|
-
} = this.state;
|
|
201
|
-
let editorContent = fileArr.length === 0 ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
-
className: "dtable-ui-image-tip-addition ".concat(isFileTipShow ? 'dtable-ui-image-drop-active' : '')
|
|
203
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
204
|
-
className: "dtable-ui-dtable-ui-image-add-icon"
|
|
205
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
206
|
-
"aria-hidden": "true",
|
|
207
|
-
className: "dtable-font dtable-icon-add-files"
|
|
208
|
-
})), isFileTipShow ? /*#__PURE__*/_react.default.createElement("div", {
|
|
209
|
-
className: "dtable-ui-image-add-span"
|
|
210
|
-
}, (0, _lang.getLocale)('Drag_and_drop_to_add_a_file')) : /*#__PURE__*/_react.default.createElement("div", {
|
|
211
|
-
className: "dtable-ui-image-add-span"
|
|
212
|
-
}, (0, _lang.getLocale)('Drag_and_drop_files_or_click_here_to_add')))) : /*#__PURE__*/_react.default.createElement("div", {
|
|
213
|
-
className: "dtable-ui-image-add-box"
|
|
214
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
215
|
-
className: "dtable-ui-image-add-button ".concat(isFileTipShow ? 'dtable-ui-image-wrapper-drop-active' : '')
|
|
216
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
217
|
-
"aria-hidden": "true",
|
|
218
|
-
className: "dtable-font dtable-icon-add-table"
|
|
219
|
-
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
220
|
-
className: "dtable-ui-image-add-span"
|
|
221
|
-
}, (0, _lang.getLocale)('Upload'))));
|
|
222
|
-
return /*#__PURE__*/_react.default.createElement(_FileUploader.default, {
|
|
223
|
-
uploadType: "file",
|
|
224
|
-
isSupportDragDrop: true,
|
|
225
|
-
className: fileArr.length === 0 ? (0, _classnames.default)('dtable-ui-image-upload-container', {
|
|
226
|
-
'dtable-ui-image-upload-container-active': isFileTipShow
|
|
227
|
-
}) : 'dtable-ui-image-wrapper',
|
|
228
|
-
updateParentTips: this.setFileTipShow,
|
|
229
|
-
onFileUploadSuccess: this.onFileUploadSuccess,
|
|
230
|
-
onFileUploadProgress: this.onFileUploadProgress,
|
|
231
|
-
updateUploadFileList: this.updateUploadFileList,
|
|
232
|
-
onFileUploadFailed: this.onFileUploadFailed,
|
|
233
|
-
ref: ref => this.uploaderFileRef = ref,
|
|
234
|
-
uploadFile: this.props.uploadFile
|
|
235
|
-
}, editorContent);
|
|
236
|
-
};
|
|
237
|
-
this.state = {
|
|
238
|
-
isFileTipShow: false,
|
|
239
|
-
isShowDeleteIcon: false,
|
|
240
|
-
enterFileIndex: -1,
|
|
241
|
-
tooltipOpen: false,
|
|
242
|
-
uploadMessageList: [],
|
|
243
|
-
thumbnailSrcList: [],
|
|
244
|
-
reUploadFile: null
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
render() {
|
|
248
|
-
let fileArr = this.renderMultipleFilesArr();
|
|
249
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, fileArr, this.renderUploadFileWrapper(fileArr));
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
var _default = exports.default = LocalFileAddition;
|
|
@@ -1,74 +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 _lang = require("../../../lang");
|
|
11
|
-
class FileDropdownMenu extends _react.default.Component {
|
|
12
|
-
constructor(props) {
|
|
13
|
-
super(props);
|
|
14
|
-
this.onDropdownToggleClick = e => {
|
|
15
|
-
e.preventDefault();
|
|
16
|
-
e.stopPropagation();
|
|
17
|
-
this.setState({
|
|
18
|
-
isItemMenuShow: !this.state.isItemMenuShow
|
|
19
|
-
}, () => {
|
|
20
|
-
if (this.state.isItemMenuShow) {
|
|
21
|
-
this.props.freezeItem();
|
|
22
|
-
} else {
|
|
23
|
-
this.props.unFreezeItem();
|
|
24
|
-
this.props.resetState();
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
this.onDeleteFile = event => {
|
|
29
|
-
this.props.resetState();
|
|
30
|
-
this.props.onDeleteFile(this.props.itemIndex);
|
|
31
|
-
};
|
|
32
|
-
this.onRenameFile = event => {
|
|
33
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
34
|
-
this.props.onRenameFile();
|
|
35
|
-
};
|
|
36
|
-
this.state = {
|
|
37
|
-
isItemMenuShow: false,
|
|
38
|
-
isRenameDialogShow: false
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
render() {
|
|
42
|
-
const {
|
|
43
|
-
onRenameFile,
|
|
44
|
-
onDeleteFile
|
|
45
|
-
} = this.props;
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement(_reactstrap.Dropdown, {
|
|
47
|
-
isOpen: this.state.isItemMenuShow,
|
|
48
|
-
toggle: this.onDropdownToggleClick,
|
|
49
|
-
className: "file-dropdown-menu"
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement(_reactstrap.DropdownToggle, {
|
|
51
|
-
tag: "span",
|
|
52
|
-
role: "button",
|
|
53
|
-
"data-toggle": "dropdown",
|
|
54
|
-
"aria-expanded": this.state.isItemMenuShow,
|
|
55
|
-
className: "file-dropdown-icon",
|
|
56
|
-
title: (0, _lang.getLocale)('More_operations'),
|
|
57
|
-
"aria-label": (0, _lang.getLocale)('More_operations')
|
|
58
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
59
|
-
"aria-hidden": "true",
|
|
60
|
-
className: "dtable-font dtable-icon-more-vertical file-dropdown-more"
|
|
61
|
-
})), /*#__PURE__*/_react.default.createElement(_reactstrap.DropdownMenu, {
|
|
62
|
-
className: "dtable-dropdown-menu dropdown-menu"
|
|
63
|
-
}, onRenameFile && /*#__PURE__*/_react.default.createElement(_reactstrap.DropdownItem, {
|
|
64
|
-
onClick: this.onRenameFile
|
|
65
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
66
|
-
className: "item-icon dtable-font dtable-icon-rename"
|
|
67
|
-
}), (0, _lang.getLocale)('Rename')), onDeleteFile && /*#__PURE__*/_react.default.createElement(_reactstrap.DropdownItem, {
|
|
68
|
-
onClick: this.onDeleteFile
|
|
69
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
70
|
-
className: "item-icon dtable-font dtable-icon-delete"
|
|
71
|
-
}), (0, _lang.getLocale)('Delete'))));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
var _default = exports.default = FileDropdownMenu;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactstrap = require("reactstrap");
|
|
10
|
-
var _constants = require("../../../../constants");
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class FileNameEditor extends _react.Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
this.onMouseDown = e => {
|
|
16
|
-
if (this.fileNameRef && !this.fileNameRef.contains(e.target)) {
|
|
17
|
-
this.onSave();
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
this.onChange = e => {
|
|
21
|
-
this.setState({
|
|
22
|
-
fileName: e.target.value
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
this.onKeyDown = e => {
|
|
26
|
-
e.stopPropagation();
|
|
27
|
-
if (e.keyCode === _constants.KeyCodes.Enter) {
|
|
28
|
-
e.preventDefault();
|
|
29
|
-
this.onSave();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
this.onSave = () => {
|
|
33
|
-
const {
|
|
34
|
-
renameFile,
|
|
35
|
-
name,
|
|
36
|
-
closeRenameFile,
|
|
37
|
-
itemIndex
|
|
38
|
-
} = this.props;
|
|
39
|
-
let newName = this.state.fileName.trim();
|
|
40
|
-
if (newName === name || newName === '') {
|
|
41
|
-
closeRenameFile();
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
this.unSaved = false;
|
|
45
|
-
renameFile(itemIndex, newName);
|
|
46
|
-
closeRenameFile();
|
|
47
|
-
};
|
|
48
|
-
this.state = {
|
|
49
|
-
fileName: props.name || ''
|
|
50
|
-
};
|
|
51
|
-
this.unSaved = true;
|
|
52
|
-
}
|
|
53
|
-
componentDidMount() {
|
|
54
|
-
document.addEventListener('mousedown', this.onMouseDown);
|
|
55
|
-
}
|
|
56
|
-
componentWillUnmount() {
|
|
57
|
-
if (this.unSaved) {
|
|
58
|
-
this.onSave();
|
|
59
|
-
}
|
|
60
|
-
document.removeEventListener('mousedown', this.onMouseDown);
|
|
61
|
-
}
|
|
62
|
-
render() {
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
className: "pt-1",
|
|
65
|
-
ref: ref => this.fileNameRef = ref
|
|
66
|
-
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
|
|
67
|
-
className: "dtable-ui-file-name-input",
|
|
68
|
-
type: "text",
|
|
69
|
-
value: this.state.fileName,
|
|
70
|
-
onChange: this.onChange,
|
|
71
|
-
onKeyDown: this.onKeyDown,
|
|
72
|
-
onBlur: this.onSave,
|
|
73
|
-
autoFocus: true
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
var _default = exports.default = FileNameEditor;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
.dtable-ui-file-editor-previewer-box {
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 48px;
|
|
4
|
-
width: 100%;
|
|
5
|
-
padding: 0px 16px;
|
|
6
|
-
justify-content: space-between;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.dtable-ui-file-editor-previewer-box.dtable-ui-file-editor-previewer-box-highlight {
|
|
10
|
-
background-color: #f5f5f5;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.dtable-ui-file-editor-previewer-box .dtable-ui-file-editor-previewer-item {
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
width: calc(100% - 56px);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.dtable-ui-file-editor-previewer-box .dtable-ui-file-editor-previewer-item .dtable-ui-file-editor-previewer-icon {
|
|
20
|
-
height: 100%;
|
|
21
|
-
line-height: 48px;
|
|
22
|
-
margin-right: 5px;
|
|
23
|
-
flex-shrink: 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.dtable-ui-file-editor-previewer-box .dtable-ui-file-editor-previewer-item .dtable-ui-file-editor-previewer-icon img {
|
|
27
|
-
width: 36px;
|
|
28
|
-
height: 36px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.dtable-ui-file-editor-previewer-box .dtable-ui-file-editor-previewer-item .dtable-ui-file-editor-previewer-info {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.dtable-ui-file-editor-previewer-box .dtable-ui-file-editor-previewer-item .dtable-ui-file-editor-previewer-item-name {
|
|
37
|
-
max-width: 480px;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
text-overflow: ellipsis;
|
|
40
|
-
white-space: nowrap;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.dtable-ui-file-editor-previewer-box .dtable-ui-file-editor-previewer-item .dtable-ui-file-editor-preview-item-detail {
|
|
44
|
-
color: #c0c0c0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.dtable-ui-file-editor-previewer-box .dtable-ui-file-editor-preview-item-detail .file-upload-time {
|
|
48
|
-
white-space: pre-wrap;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.dtable-ui-file-editor-previewer-operation {
|
|
52
|
-
display: flex;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
align-items: center;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.dtable-ui-file-editor-previewer-operation .file-dropdown-menu .file-dropdown-icon {
|
|
58
|
-
display: flex;
|
|
59
|
-
justify-content: center;
|
|
60
|
-
align-items: center;
|
|
61
|
-
height: 24px;
|
|
62
|
-
width: 24px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.file-dropdown-menu .file-dropdown-icon .dtable-icon-more-vertical {
|
|
66
|
-
font-size: 14px;
|
|
67
|
-
color: #999;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.dtable-ui-file-editor-previewer-operation .file-download-icon,
|
|
71
|
-
.file-dropdown-menu .file-dropdown-icon .file-dropdown-more {
|
|
72
|
-
width: 24px;
|
|
73
|
-
height: 24px;
|
|
74
|
-
display: flex;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
align-items: center;
|
|
77
|
-
font-size: 14px;
|
|
78
|
-
color: #999;
|
|
79
|
-
cursor: pointer;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.file-dropdown-menu .file-dropdown-icon:hover .file-dropdown-more,
|
|
83
|
-
.dtable-ui-file-editor-previewer-operation .file-download-icon:hover {
|
|
84
|
-
color: #000;
|
|
85
|
-
opacity: 0.75;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
@@ -1,167 +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 _dropdownMenu = _interopRequireDefault(require("./dropdown-menu"));
|
|
11
|
-
var _fileNameEditor = _interopRequireDefault(require("./file-name-editor"));
|
|
12
|
-
var _utils = require("../../utils");
|
|
13
|
-
var _url = require("../../../utils/url");
|
|
14
|
-
require("./index.css");
|
|
15
|
-
class FilePreviewer extends _react.default.Component {
|
|
16
|
-
constructor(props) {
|
|
17
|
-
super(props);
|
|
18
|
-
this.fileItemMouseEnter = () => {
|
|
19
|
-
if (!this.props.isItemFreezed) {
|
|
20
|
-
this.setState({
|
|
21
|
-
isShowOperation: true,
|
|
22
|
-
highlight: true
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
this.fileItemMouseLeave = () => {
|
|
27
|
-
if (!this.props.isItemFreezed) {
|
|
28
|
-
this.setState({
|
|
29
|
-
isShowOperation: false,
|
|
30
|
-
highlight: false
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
this.handleFileClick = () => {
|
|
35
|
-
let {
|
|
36
|
-
fileItem
|
|
37
|
-
} = this.props;
|
|
38
|
-
let openFileUrl = fileItem.url;
|
|
39
|
-
let assetFileIndex = openFileUrl.indexOf('/asset');
|
|
40
|
-
if (assetFileIndex > -1 && (0, _url.imageCheck)(fileItem.name)) {
|
|
41
|
-
this.props.showLargeImage(fileItem.url);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
this.downloadFile = e => {
|
|
46
|
-
e.stopPropagation();
|
|
47
|
-
let downloadUrl = this.props.fileItem.url;
|
|
48
|
-
this.props.downloadFile(downloadUrl);
|
|
49
|
-
};
|
|
50
|
-
this.onSelectFile = () => {
|
|
51
|
-
const {
|
|
52
|
-
fileItem
|
|
53
|
-
} = this.props;
|
|
54
|
-
this.props.onSelectFiles(fileItem.name);
|
|
55
|
-
};
|
|
56
|
-
this.closeRenameFile = () => {
|
|
57
|
-
if (this.state.isShowRename) {
|
|
58
|
-
this.setState({
|
|
59
|
-
isShowRename: false
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
this.openRenameFile = () => {
|
|
64
|
-
this.setState({
|
|
65
|
-
isShowRename: true
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
this.resetState = () => {
|
|
69
|
-
this.setState({
|
|
70
|
-
isShowOperation: false,
|
|
71
|
-
highlight: false
|
|
72
|
-
});
|
|
73
|
-
this.props.unFreezeItem();
|
|
74
|
-
};
|
|
75
|
-
this.state = {
|
|
76
|
-
isShowRename: false,
|
|
77
|
-
isShowOperation: false,
|
|
78
|
-
highlight: false,
|
|
79
|
-
errorMessage: ''
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
render() {
|
|
83
|
-
const {
|
|
84
|
-
fileItem,
|
|
85
|
-
isItemFreezed,
|
|
86
|
-
isSelectMultipleFiles,
|
|
87
|
-
isSelected,
|
|
88
|
-
config
|
|
89
|
-
} = this.props;
|
|
90
|
-
const {
|
|
91
|
-
isShowRename,
|
|
92
|
-
isShowOperation,
|
|
93
|
-
highlight
|
|
94
|
-
} = this.state;
|
|
95
|
-
const {
|
|
96
|
-
fileIconUrl
|
|
97
|
-
} = (0, _url.getFileThumbnailInfo)(fileItem, config);
|
|
98
|
-
const errorMessage = '';
|
|
99
|
-
const uploadTime = (0, _utils.getFileUploadTime)(fileItem);
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
-
className: "dtable-ui-file-editor-previewer-box ".concat(highlight ? 'dtable-ui-file-editor-previewer-box-highlight' : ''),
|
|
102
|
-
onMouseEnter: this.fileItemMouseEnter,
|
|
103
|
-
onMouseLeave: this.fileItemMouseLeave
|
|
104
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
105
|
-
className: "dtable-ui-file-editor-previewer-item"
|
|
106
|
-
}, isSelectMultipleFiles && /*#__PURE__*/_react.default.createElement("input", {
|
|
107
|
-
onChange: this.onSelectFile,
|
|
108
|
-
checked: isSelected,
|
|
109
|
-
className: "mr-2",
|
|
110
|
-
type: "checkbox"
|
|
111
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
-
className: "dtable-ui-file-editor-previewer-icon"
|
|
113
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
114
|
-
alt: "",
|
|
115
|
-
src: fileIconUrl
|
|
116
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
117
|
-
className: "dtable-ui-file-editor-previewer-info"
|
|
118
|
-
}, isShowRename ? /*#__PURE__*/_react.default.createElement(_fileNameEditor.default, {
|
|
119
|
-
itemIndex: this.props.itemIndex,
|
|
120
|
-
name: fileItem.name,
|
|
121
|
-
renameFile: this.props.renameFile,
|
|
122
|
-
closeRenameFile: this.closeRenameFile
|
|
123
|
-
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
-
className: "dtable-ui-file-editor-previewer-item-name ".concat(fileItem.type === 'dir' ? 'dtable-ui-file-editor-previewer-item-name-height' : ''),
|
|
125
|
-
ref: ref => this.renameRef = ref
|
|
126
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
127
|
-
onClick: this.props.renameFile ? this.handleFileClick : () => {}
|
|
128
|
-
}, fileItem.name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
129
|
-
className: "dtable-ui-file-editor-preview-item-detail d-flex"
|
|
130
|
-
}, uploadTime && /*#__PURE__*/_react.default.createElement("span", {
|
|
131
|
-
className: "file-upload-time"
|
|
132
|
-
}, "".concat(uploadTime, ", ")), fileItem.size > -1 && /*#__PURE__*/_react.default.createElement("span", null, (0, _utils.bytesToSize)(fileItem.size))))), !isShowRename && isItemFreezed && /*#__PURE__*/_react.default.createElement(_reactstrap.UncontrolledTooltip, {
|
|
133
|
-
delay: {
|
|
134
|
-
show: 0,
|
|
135
|
-
hide: 0
|
|
136
|
-
},
|
|
137
|
-
placement: "bottom",
|
|
138
|
-
target: this.renameRef
|
|
139
|
-
}, fileItem.name), isShowOperation && /*#__PURE__*/_react.default.createElement("div", {
|
|
140
|
-
className: "dtable-ui-file-editor-previewer-operation"
|
|
141
|
-
}, this.props.downloadFile && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, fileItem.type === 'file' && !errorMessage && /*#__PURE__*/_react.default.createElement("span", {
|
|
142
|
-
"aria-hidden": "true",
|
|
143
|
-
className: "dtable-font dtable-icon-download file-download-icon",
|
|
144
|
-
onClick: this.downloadFile
|
|
145
|
-
}), fileItem.type === 'file' && errorMessage && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
146
|
-
"aria-hidden": "true",
|
|
147
|
-
className: "dtable-font dtable-icon-download disable file-download-icon",
|
|
148
|
-
ref: ref => this.disabledDownloadRef = ref
|
|
149
|
-
}), /*#__PURE__*/_react.default.createElement(_reactstrap.UncontrolledTooltip, {
|
|
150
|
-
delay: {
|
|
151
|
-
show: 0,
|
|
152
|
-
hide: 0
|
|
153
|
-
},
|
|
154
|
-
placement: "bottom",
|
|
155
|
-
target: this.disabledDownloadRef
|
|
156
|
-
}, errorMessage))), (this.props.deleteFile || this.props.renameFile) && /*#__PURE__*/_react.default.createElement(_dropdownMenu.default, {
|
|
157
|
-
fileItem: fileItem,
|
|
158
|
-
freezeItem: this.props.freezeItem,
|
|
159
|
-
unFreezeItem: this.props.unFreezeItem,
|
|
160
|
-
resetState: this.resetState,
|
|
161
|
-
itemIndex: this.props.itemIndex,
|
|
162
|
-
onDeleteFile: this.props.deleteFile ? this.props.deleteFile : null,
|
|
163
|
-
onRenameFile: this.props.renameFile ? this.openRenameFile : null
|
|
164
|
-
})));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
var _default = exports.default = FilePreviewer;
|