dtable-ui-component 5.3.0 → 5.3.1-beta
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/assets/dtable-font/dtable-font.eot +0 -0
- package/assets/dtable-font/dtable-font.svg +116 -0
- package/assets/dtable-font/dtable-font.ttf +0 -0
- package/assets/dtable-font/dtable-font.woff +0 -0
- package/assets/dtable-font/dtable-font.woff2 +0 -0
- package/assets/dtable-font.css +238 -6
- package/lib/CheckboxEditor/index.css +3 -20
- package/lib/CheckboxEditor/index.js +98 -35
- package/lib/CheckboxFormatter/index.js +6 -9
- package/lib/CollaboratorEditor/index.css +12 -35
- package/lib/CollaboratorEditor/index.js +18 -212
- package/lib/CollaboratorEditor/{mb-collaborator-editor-popover → mb-collaborator-editor}/index.js +26 -29
- package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +257 -0
- package/lib/CollaboratorItem/index.css +1 -1
- package/lib/CollaboratorItem/index.js +6 -2
- package/lib/DTableCustomizeCollaboratorSelect/index.css +1 -1
- package/lib/DTableCustomizeCollaboratorSelect/index.js +1 -1
- package/lib/DTableCustomizeSelect/index.css +2 -2
- package/lib/DTableCustomizeSelect/index.js +1 -1
- package/lib/DTableFiltersPopover/utils/index.js +1 -7
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +1 -1
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +2 -2
- package/lib/DTableSelect/index.js +3 -1
- package/lib/DTableSelect/utils.js +1 -1
- package/lib/DateEditor/index.js +14 -51
- package/lib/DateEditor/pc-date-editor-popover.js +145 -12
- package/lib/DeleteTip/index.js +50 -0
- package/lib/Department-editor/department-single-select.js +1 -1
- package/lib/Department-editor/index.js +3 -4
- package/lib/DepartmentSingleSelectFormatter/index.js +2 -1
- package/lib/DigitalSignEditor/constants.js +7 -0
- package/lib/DigitalSignEditor/index.css +69 -0
- package/lib/DigitalSignEditor/index.js +182 -0
- package/lib/DigitalSignEditor/service.js +38 -0
- package/lib/DigitalSignEditor/signature-board/index.css +35 -0
- package/lib/DigitalSignEditor/signature-board/index.js +135 -0
- package/lib/DigitalSignEditor/signature-board/signature-tool.js +396 -0
- package/lib/DigitalSignEditor/utils.js +29 -0
- package/lib/DurationEditor/index.js +111 -0
- package/lib/EmailEditor/index.js +59 -0
- package/lib/FileEditor/addition-previewer/index.css +1 -0
- package/lib/FileEditor/addition-previewer/index.js +52 -0
- package/lib/FileEditor/addition-previewer/local-file-addition/index.css +1 -0
- package/lib/FileEditor/addition-previewer/local-file-addition/index.js +252 -0
- package/lib/FileEditor/constants.js +7 -0
- package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +74 -0
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +5 -0
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +77 -0
- package/lib/FileEditor/files-previewer/file-previewer/index.css +88 -0
- package/lib/FileEditor/files-previewer/file-previewer/index.js +167 -0
- package/lib/FileEditor/files-previewer/index.css +56 -0
- package/lib/FileEditor/files-previewer/index.js +277 -0
- package/lib/FileEditor/index.css +6 -0
- package/lib/FileEditor/index.js +244 -11
- package/lib/FileEditor/utils.js +22 -0
- package/lib/FileItemFormatter/index.js +19 -20
- package/lib/FileUploader/index.css +9 -0
- package/lib/FileUploader/index.js +268 -14
- package/lib/FormulaFormatter/index.js +2 -1
- package/lib/FormulaFormatter/utils.js +0 -31
- package/lib/GeolocationEditor/country-editor.js +319 -0
- package/lib/GeolocationEditor/index.css +641 -0
- package/lib/GeolocationEditor/index.js +241 -0
- package/lib/GeolocationEditor/location-editor.js +368 -0
- package/lib/GeolocationEditor/map-editor/index.js +456 -0
- package/lib/GeolocationEditor/map-editor/large-editor/index.css +137 -0
- package/lib/GeolocationEditor/map-editor/large-editor/index.js +461 -0
- package/lib/GeolocationEditor/map-editor-utils.js +153 -0
- package/lib/GeolocationEditor/map-selection-editor/index.js +455 -0
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +1 -0
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +447 -0
- package/lib/GeolocationEditor/parse-geolocation.js +282 -0
- package/lib/GeolocationEditor/province-city-editor.js +292 -0
- package/lib/GeolocationEditor/province-editor.js +226 -0
- package/lib/GeolocationEditor/selector-header-item.js +28 -0
- package/lib/GeolocationEditor/selector-list.js +33 -0
- package/lib/GeolocationEditor/with-ref.js +27 -0
- package/lib/ImageEditor/addition-previewer/image-link/index.css +45 -0
- package/lib/ImageEditor/addition-previewer/image-link/index.js +73 -0
- package/lib/ImageEditor/addition-previewer/index.css +106 -0
- package/lib/ImageEditor/addition-previewer/index.js +63 -0
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +125 -0
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +254 -0
- package/lib/ImageEditor/constants.js +7 -0
- package/lib/ImageEditor/images-previewer/image-preview/index.css +59 -0
- package/lib/ImageEditor/images-previewer/image-preview/index.js +155 -0
- package/lib/ImageEditor/images-previewer/index.css +18 -0
- package/lib/ImageEditor/images-previewer/index.js +140 -0
- package/lib/ImageEditor/index.css +24 -0
- package/lib/ImageEditor/index.js +194 -0
- package/lib/ImageThumbnail/index.css +20 -0
- package/lib/ImageThumbnail/index.js +136 -0
- package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
- package/lib/MultipleSelectEditor/index.js +16 -177
- package/lib/NumberEditor/index.js +64 -77
- package/lib/RoleStatusEditor/index.css +3 -3
- package/lib/RoleStatusEditor/index.js +1 -1
- package/lib/RowExpandDialog/body/index.css +21 -0
- package/lib/RowExpandDialog/body/index.js +279 -0
- package/lib/RowExpandDialog/column-content/index.css +43 -0
- package/lib/RowExpandDialog/column-content/index.js +50 -0
- package/lib/RowExpandDialog/constants.js +114 -0
- package/lib/RowExpandDialog/header/index.css +31 -0
- package/lib/RowExpandDialog/header/index.js +33 -0
- package/lib/RowExpandDialog/index.css +24 -0
- package/lib/RowExpandDialog/index.js +268 -0
- package/lib/RowExpandDialog/utils.js +83 -0
- package/lib/RowExpandEditor/RowExpandAddBtn/index.css +22 -0
- package/lib/RowExpandEditor/RowExpandAddBtn/index.js +24 -0
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +18 -0
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +43 -0
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +5 -0
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +232 -0
- package/lib/RowExpandEditor/RowExpandDateEditor/index.js +130 -0
- package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +129 -0
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +13 -0
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +208 -0
- package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +105 -0
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +2 -0
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +125 -0
- package/lib/RowExpandEditor/RowExpandFileEditor/index.css +1 -0
- package/lib/RowExpandEditor/RowExpandFileEditor/index.js +146 -0
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +17 -0
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +165 -0
- package/lib/RowExpandEditor/RowExpandImageEditor/index.css +6 -0
- package/lib/RowExpandEditor/RowExpandImageEditor/index.js +170 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +6 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +124 -0
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +44 -0
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +224 -0
- package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +105 -0
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +13 -0
- package/lib/RowExpandEditor/RowExpandRateEditor/index.js +152 -0
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +58 -0
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +192 -0
- package/lib/RowExpandEditor/RowExpandTextEditor/index.css +4 -0
- package/lib/RowExpandEditor/RowExpandTextEditor/index.js +127 -0
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +31 -0
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +130 -0
- package/lib/RowExpandEditor/constants.js +44 -0
- package/lib/RowExpandEditor/index.css +0 -0
- package/lib/RowExpandEditor/index.js +32 -0
- package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +27 -0
- package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.css +1 -1
- package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.js +1 -1
- package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.css +6 -6
- package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.js +3 -1
- package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/row-expand-file-item-formatter.js +10 -11
- package/lib/{RowExpandFormulaFormatter → RowExpandFormatter/RowExpandFormulaFormatter}/index.js +11 -10
- package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.css +6 -6
- package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.js +1 -1
- package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/row-expand-image-item-formatter.js +3 -3
- package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
- package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.js +5 -5
- package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/utils.js +1 -1
- package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.css +1 -1
- package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +1 -0
- package/lib/{RowExpandUrlFormatter → RowExpandFormatter/RowExpandUrlFormatter}/index.js +4 -3
- package/lib/RowExpandFormatter/constants.js +60 -0
- package/lib/RowExpandFormatter/index.css +26 -0
- package/lib/RowExpandFormatter/index.js +84 -100
- package/lib/SingleSelectEditor/index.js +16 -156
- package/lib/TextEditor/index.js +113 -42
- package/lib/UploadProgress/index.js +38 -0
- package/lib/UrlEditor/index.js +62 -0
- package/lib/common/editor-base.js +53 -0
- package/lib/constants/file.js +96 -0
- package/lib/constants/index.js +34 -2
- package/lib/constants/key-codes.js +109 -0
- package/lib/css/cell-editor.css +18 -2
- package/lib/hooks/index.js +16 -0
- package/lib/index.js +74 -46
- package/lib/lang/index.js +16 -14
- package/lib/locales/de.json +163 -0
- package/lib/locales/en.json +163 -0
- package/lib/locales/es.json +163 -0
- package/lib/locales/fr.json +163 -0
- package/lib/locales/pt.json +163 -0
- package/lib/locales/ru.json +163 -0
- package/lib/locales/zh-CN.json +163 -0
- package/lib/select-editor/index.js +6 -6
- package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.js +3 -3
- package/lib/select-editor/pc-select-editor/index.css +85 -0
- package/lib/select-editor/pc-select-editor/index.js +290 -0
- package/lib/utils/cell-comparer.js +35 -0
- package/lib/utils/cell.js +55 -0
- package/lib/utils/column-utils.js +25 -0
- package/lib/utils/editor-utils.js +1 -6
- package/lib/utils/get-event-transfer.js +75 -0
- package/lib/utils/object-utils.js +61 -0
- package/lib/utils/url.js +119 -8
- package/lib/utils/utils.js +89 -2
- package/package.json +3 -2
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +0 -97
- package/lib/FileEditor/pc-files-addition/index.js +0 -1
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +0 -1
- package/lib/FileEditor/pc-files-preview/index.js +0 -1
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +0 -1
- 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/utils.js +0 -99
- package/lib/MultipleSelectEditor/index.css +0 -9
- package/lib/RowExpandUrlFormatter/index.css +0 -1
- package/lib/SingleSelectEditor/index.css +0 -14
- package/lib/locals/de.js +0 -103
- package/lib/locals/en.js +0 -104
- package/lib/locals/es.js +0 -103
- package/lib/locals/fr.js +0 -103
- package/lib/locals/pt.js +0 -103
- package/lib/locals/ru.js +0 -103
- package/lib/locals/zh-CN.js +0 -104
- package/lib/select-editor/pc-select-editor-popover/index.css +0 -71
- package/lib/select-editor/pc-select-editor-popover/index.js +0 -122
- /package/lib/CollaboratorEditor/{mb-collaborator-editor-popover → mb-collaborator-editor}/index.css +0 -0
- /package/lib/CollaboratorEditor/{pc-collaborator-editor-popover → pc-collaborator-editor}/index.css +0 -0
- /package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.css +0 -0
- /package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/value-display-utils.js +0 -0
- /package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.js +0 -0
- /package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.css +0 -0
|
@@ -0,0 +1,279 @@
|
|
|
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 _dtableUtils = require("dtable-utils");
|
|
12
|
+
var _constants = require("../constants");
|
|
13
|
+
var _utils = require("../utils");
|
|
14
|
+
var _columnContent = _interopRequireDefault(require("../column-content"));
|
|
15
|
+
var _RowExpandEditor = _interopRequireDefault(require("../../RowExpandEditor"));
|
|
16
|
+
var _RowExpandFormatter = _interopRequireDefault(require("../../RowExpandFormatter"));
|
|
17
|
+
require("./index.css");
|
|
18
|
+
class Body extends _react.default.Component {
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super(props);
|
|
21
|
+
this.setEditorRef = columnIndex => editor => {
|
|
22
|
+
this.editors[columnIndex] = editor;
|
|
23
|
+
};
|
|
24
|
+
this.onPressUpKey = () => {
|
|
25
|
+
const currentTop = this.getScrollTop();
|
|
26
|
+
if (currentTop === 0) return;
|
|
27
|
+
this.setScrollTop(currentTop - 20);
|
|
28
|
+
};
|
|
29
|
+
this.onPressDownKey = () => {
|
|
30
|
+
this.setScrollTop(this.getScrollTop() + 20);
|
|
31
|
+
};
|
|
32
|
+
this.scrollToFocus = () => {
|
|
33
|
+
if (!this.focusDom || !this.focusDom.current) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const content_scroll_top = this.getScrollTop();
|
|
37
|
+
const focus_offset_top = this.focusDom.current.offsetTop;
|
|
38
|
+
const focus_offset_height = this.focusDom.current.clientHeight;
|
|
39
|
+
if (focus_offset_top < content_scroll_top) {
|
|
40
|
+
this.setScrollTop(focus_offset_top - focus_offset_height);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (focus_offset_top > content_scroll_top + this.contentRef.clientHeight) {
|
|
44
|
+
this.setScrollTop(focus_offset_top - this.contentRef.clientHeight / 2);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
this.setScrollTop = scrollTop => {
|
|
49
|
+
if (this.contentRef) {
|
|
50
|
+
this.contentRef.scrollTop = scrollTop;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
this.getScrollTop = () => {
|
|
54
|
+
return this.contentRef ? this.contentRef.scrollTop : 0;
|
|
55
|
+
};
|
|
56
|
+
this.onEditorOpen = () => {
|
|
57
|
+
this.fieldEditorOpen = true;
|
|
58
|
+
};
|
|
59
|
+
this.onEditorClose = () => {
|
|
60
|
+
this.fieldEditorOpen = false;
|
|
61
|
+
};
|
|
62
|
+
this.onHotKey = event => {
|
|
63
|
+
const {
|
|
64
|
+
columns
|
|
65
|
+
} = this.props;
|
|
66
|
+
const readonly = Array.isArray(columns) && columns.length > 0 ? !columns.some(c => c.editable) : true;
|
|
67
|
+
const keyCode = event.keyCode;
|
|
68
|
+
// When opening field editor, all shortcuts in row expand dialog do not work
|
|
69
|
+
if (this.fieldEditorOpen === true) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (keyCode === _constants.keyCodes.Esc) {
|
|
73
|
+
this.props.onRowExpandCancel();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (keyCode === _constants.keyCodes.UpArrow) {
|
|
77
|
+
this.onPressUpKey();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (keyCode === _constants.keyCodes.DownArrow) {
|
|
81
|
+
this.onPressDownKey();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (keyCode === _constants.keyCodes.Tab && !readonly) {
|
|
85
|
+
this.onPressTab(event);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
this.onPressTab = event => {
|
|
89
|
+
event.stopPropagation();
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
const {
|
|
92
|
+
columns
|
|
93
|
+
} = this.props;
|
|
94
|
+
let tabIndex = this.state.tabIndex;
|
|
95
|
+
// Press tab, highlight next column;
|
|
96
|
+
if (event.shiftKey) {
|
|
97
|
+
tabIndex = tabIndex - 1;
|
|
98
|
+
while (columns[tabIndex] && !columns[tabIndex].editable) {
|
|
99
|
+
tabIndex--;
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
// Press shift + tab, highlight preview column
|
|
103
|
+
tabIndex = tabIndex + 1;
|
|
104
|
+
while (columns[tabIndex] && !columns[tabIndex].editable) {
|
|
105
|
+
tabIndex++;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
this.updateTabIndex(tabIndex);
|
|
109
|
+
};
|
|
110
|
+
this.updateTabIndex = tabIndex => {
|
|
111
|
+
if (tabIndex >= this.props.columns.length) {
|
|
112
|
+
tabIndex = 0;
|
|
113
|
+
}
|
|
114
|
+
if (tabIndex !== this.state.tabIndex) {
|
|
115
|
+
this.setState({
|
|
116
|
+
tabIndex
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
this.downloadImage = imageItemUrl => {
|
|
121
|
+
let rotateIndex = imageItemUrl.indexOf('?a=');
|
|
122
|
+
if (rotateIndex > -1) {
|
|
123
|
+
imageItemUrl = imageItemUrl.slice(0, rotateIndex);
|
|
124
|
+
}
|
|
125
|
+
let imageUrlSuffix = imageItemUrl.indexOf('?dl=1');
|
|
126
|
+
let downloadUrl = imageUrlSuffix !== -1 ? imageItemUrl : imageItemUrl + '?dl=1';
|
|
127
|
+
(0, _utils.downloadFile)(downloadUrl);
|
|
128
|
+
};
|
|
129
|
+
this.getCellValue = _ref => {
|
|
130
|
+
let {
|
|
131
|
+
row,
|
|
132
|
+
column
|
|
133
|
+
} = _ref;
|
|
134
|
+
if (!row || !column) return null;
|
|
135
|
+
const {
|
|
136
|
+
valueKey
|
|
137
|
+
} = this.props;
|
|
138
|
+
return row[column[valueKey]];
|
|
139
|
+
};
|
|
140
|
+
this.renderColumnValue = (row, column, columnIndex, isEditorFocus) => {
|
|
141
|
+
const {
|
|
142
|
+
eventBus,
|
|
143
|
+
departments,
|
|
144
|
+
userDepartmentIdsMap,
|
|
145
|
+
columns,
|
|
146
|
+
component,
|
|
147
|
+
valueKey,
|
|
148
|
+
collaborators,
|
|
149
|
+
getCollaborators,
|
|
150
|
+
queryCollaborators,
|
|
151
|
+
onChange,
|
|
152
|
+
uploadFile,
|
|
153
|
+
longTextEditorAPI,
|
|
154
|
+
config,
|
|
155
|
+
lang,
|
|
156
|
+
seafileEditorI18n
|
|
157
|
+
} = this.props;
|
|
158
|
+
const {
|
|
159
|
+
editable
|
|
160
|
+
} = column;
|
|
161
|
+
const {
|
|
162
|
+
editor,
|
|
163
|
+
formatter
|
|
164
|
+
} = component || {};
|
|
165
|
+
if (editable) {
|
|
166
|
+
return /*#__PURE__*/_react.default.createElement(_RowExpandEditor.default, {
|
|
167
|
+
column: column,
|
|
168
|
+
row: row,
|
|
169
|
+
columns: columns,
|
|
170
|
+
eventBus: eventBus,
|
|
171
|
+
departments: departments,
|
|
172
|
+
userDepartmentIdsMap: userDepartmentIdsMap,
|
|
173
|
+
component: editor,
|
|
174
|
+
isEditorFocus: isEditorFocus,
|
|
175
|
+
columnIndex: columnIndex,
|
|
176
|
+
valueKey: valueKey,
|
|
177
|
+
isInModal: true,
|
|
178
|
+
longTextEditorI18n: seafileEditorI18n,
|
|
179
|
+
lang: lang,
|
|
180
|
+
collaborators: collaborators,
|
|
181
|
+
config: config,
|
|
182
|
+
getCollaborators: getCollaborators,
|
|
183
|
+
queryCollaborators: queryCollaborators,
|
|
184
|
+
updateTabIndex: this.updateTabIndex,
|
|
185
|
+
onCommit: value => onChange(column, value),
|
|
186
|
+
onEditorOpen: this.onEditorOpen,
|
|
187
|
+
onEditorClose: this.onEditorClose,
|
|
188
|
+
uploadFile: uploadFile,
|
|
189
|
+
longTextEditorAPI: longTextEditorAPI
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return /*#__PURE__*/_react.default.createElement(_RowExpandFormatter.default, {
|
|
193
|
+
column: column,
|
|
194
|
+
row: row,
|
|
195
|
+
collaborators: collaborators,
|
|
196
|
+
config: config,
|
|
197
|
+
eventBus: eventBus,
|
|
198
|
+
departments: departments,
|
|
199
|
+
component: formatter,
|
|
200
|
+
valueKey: valueKey,
|
|
201
|
+
downloadImage: this.downloadImage,
|
|
202
|
+
getCollaborators: getCollaborators,
|
|
203
|
+
queryCollaborators: queryCollaborators
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
this.renderColumnContent = (row, column, columnIndex) => {
|
|
207
|
+
const isEditorFocus = columnIndex === this.state.tabIndex && column.editable;
|
|
208
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
209
|
+
ref: isEditorFocus ? this.focusDom : null
|
|
210
|
+
}, /*#__PURE__*/_react.default.createElement(_columnContent.default, {
|
|
211
|
+
column: column
|
|
212
|
+
}, this.renderColumnValue(row, column, columnIndex, isEditorFocus)));
|
|
213
|
+
};
|
|
214
|
+
this.state = {
|
|
215
|
+
tabIndex: 0
|
|
216
|
+
};
|
|
217
|
+
this.fieldEditorOpen = false;
|
|
218
|
+
this.focusDom = /*#__PURE__*/_react.default.createRef();
|
|
219
|
+
this.editors = [];
|
|
220
|
+
this.commentInputFocus = false;
|
|
221
|
+
this.contentRef = null;
|
|
222
|
+
}
|
|
223
|
+
componentDidMount() {
|
|
224
|
+
window.addEventListener('keydown', this.onHotKey);
|
|
225
|
+
}
|
|
226
|
+
componentDidUpdate(prevProps, prevState) {
|
|
227
|
+
if (prevState.tabIndex !== this.state.tabIndex) {
|
|
228
|
+
this.scrollToFocus();
|
|
229
|
+
}
|
|
230
|
+
if (prevState.isShowComment !== this.state.isShowComment) {
|
|
231
|
+
this.commentInputFocus = false;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
componentWillUnmount() {
|
|
235
|
+
window.removeEventListener('keydown', this.onHotKey);
|
|
236
|
+
}
|
|
237
|
+
render() {
|
|
238
|
+
const {
|
|
239
|
+
isInsertingRow,
|
|
240
|
+
columns,
|
|
241
|
+
row,
|
|
242
|
+
placeholder
|
|
243
|
+
} = this.props;
|
|
244
|
+
return /*#__PURE__*/_react.default.createElement(_reactstrap.ModalBody, {
|
|
245
|
+
className: "dtable-ui-row-expand-body"
|
|
246
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
247
|
+
className: "dtable-ui-row-expand-body-content",
|
|
248
|
+
ref: ref => this.contentRef = ref
|
|
249
|
+
}, columns.length === 0 && placeholder && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, placeholder), columns.map((column, index) => {
|
|
250
|
+
// Do not display creator, last_modifier, ctime, mtime when inserting row
|
|
251
|
+
if (isInsertingRow && !column.editable) return null;
|
|
252
|
+
const {
|
|
253
|
+
type,
|
|
254
|
+
data
|
|
255
|
+
} = column;
|
|
256
|
+
let isHasMore = false;
|
|
257
|
+
if (type === _dtableUtils.CellType.LINK_FORMULA) {
|
|
258
|
+
let {
|
|
259
|
+
array_type
|
|
260
|
+
} = data || {};
|
|
261
|
+
const value = this.getCellValue({
|
|
262
|
+
row,
|
|
263
|
+
column
|
|
264
|
+
});
|
|
265
|
+
const cellValue = (0, _utils.getFormulaArrayValue)(value, !(0, _utils.isArrayFormalColumn)(array_type));
|
|
266
|
+
if (cellValue.length >= 10) {
|
|
267
|
+
isHasMore = true;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
271
|
+
className: (0, _classnames.default)('dtable-ui-row-expand-item', {
|
|
272
|
+
'is-has-more': isHasMore
|
|
273
|
+
}),
|
|
274
|
+
key: column.key
|
|
275
|
+
}, this.renderColumnContent(row, column, index));
|
|
276
|
+
})));
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
var _default = exports.default = Body;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info {
|
|
2
|
+
padding-top: 9px;
|
|
3
|
+
height: fit-content;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .dtable-ui-header-icon {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
padding: 0 0.3125rem;
|
|
9
|
+
margin-left: -0.3125rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dtable-ui-header-icon .dtable-font {
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
color: #aaa;
|
|
15
|
+
cursor: default;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .dtable-ui-header-icon .dtable-font {
|
|
19
|
+
color: #212529a6;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .dtable-ui-row-expand-column-name {
|
|
23
|
+
color: #212529b3;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .cell-is-required {
|
|
27
|
+
color: #ff1920;
|
|
28
|
+
padding-left: 0.3125rem;
|
|
29
|
+
display: inline-block;
|
|
30
|
+
height: 21px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .dtable-ui-column-tip-icon {
|
|
34
|
+
color: #bdbdbd;
|
|
35
|
+
position: relative;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.dtable-ui-column-description-tip {
|
|
41
|
+
max-height: 300px;
|
|
42
|
+
overflow: auto;
|
|
43
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 _dtableUtils = require("dtable-utils");
|
|
11
|
+
require("./index.css");
|
|
12
|
+
const RowContent = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
column,
|
|
15
|
+
children
|
|
16
|
+
} = _ref;
|
|
17
|
+
const descriptionRef = (0, _react.useRef)(null);
|
|
18
|
+
const {
|
|
19
|
+
name,
|
|
20
|
+
type,
|
|
21
|
+
key,
|
|
22
|
+
description
|
|
23
|
+
} = column;
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_reactstrap.Row, {
|
|
25
|
+
className: "dtable-ui-row-expand-column-content pb-4"
|
|
26
|
+
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Col, {
|
|
27
|
+
md: 3,
|
|
28
|
+
className: "dtable-ui-row-expand-column-content-info d-flex"
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
30
|
+
className: "dtable-ui-header-icon",
|
|
31
|
+
id: "header-icon-".concat(key)
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
33
|
+
className: _dtableUtils.COLUMNS_ICON_CONFIG[type]
|
|
34
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
35
|
+
className: "dtable-ui-row-expand-column-name"
|
|
36
|
+
}, name || ''), description && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
37
|
+
className: "dtable-font dtable-icon-description dtable-ui-column-tip-icon ml-2",
|
|
38
|
+
ref: descriptionRef
|
|
39
|
+
}), descriptionRef.current && /*#__PURE__*/_react.default.createElement(_reactstrap.UncontrolledTooltip, {
|
|
40
|
+
innerClassName: "dtable-ui-column-description-tip",
|
|
41
|
+
popperClassName: "dtable-ui-row-expand-column-tip",
|
|
42
|
+
target: descriptionRef.current,
|
|
43
|
+
placement: "bottom",
|
|
44
|
+
fade: false
|
|
45
|
+
}, description))), /*#__PURE__*/_react.default.createElement(_reactstrap.Col, {
|
|
46
|
+
md: 9,
|
|
47
|
+
className: "d-flex align-items-center dtable-ui-row-expand-column-content-value"
|
|
48
|
+
}, children));
|
|
49
|
+
};
|
|
50
|
+
var _default = exports.default = RowContent;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.keyCodes = exports.ROW_EXPAND_FOCUS_STYLE = exports.ROW_EXPAND_BTN_FOCUS_STYLE = void 0;
|
|
7
|
+
const keyCodes = exports.keyCodes = {
|
|
8
|
+
Backspace: 8,
|
|
9
|
+
Tab: 9,
|
|
10
|
+
Enter: 13,
|
|
11
|
+
Shift: 16,
|
|
12
|
+
Ctrl: 17,
|
|
13
|
+
Alt: 18,
|
|
14
|
+
PauseBreak: 19,
|
|
15
|
+
CapsLock: 20,
|
|
16
|
+
Escape: 27,
|
|
17
|
+
Esc: 27,
|
|
18
|
+
Space: 32,
|
|
19
|
+
PageUp: 33,
|
|
20
|
+
PageDown: 34,
|
|
21
|
+
End: 35,
|
|
22
|
+
Home: 36,
|
|
23
|
+
LeftArrow: 37,
|
|
24
|
+
UpArrow: 38,
|
|
25
|
+
RightArrow: 39,
|
|
26
|
+
DownArrow: 40,
|
|
27
|
+
Insert: 45,
|
|
28
|
+
Delete: 46,
|
|
29
|
+
0: 48,
|
|
30
|
+
1: 49,
|
|
31
|
+
2: 50,
|
|
32
|
+
3: 51,
|
|
33
|
+
4: 52,
|
|
34
|
+
5: 53,
|
|
35
|
+
6: 54,
|
|
36
|
+
7: 55,
|
|
37
|
+
8: 56,
|
|
38
|
+
9: 57,
|
|
39
|
+
a: 65,
|
|
40
|
+
b: 66,
|
|
41
|
+
c: 67,
|
|
42
|
+
d: 68,
|
|
43
|
+
e: 69,
|
|
44
|
+
f: 70,
|
|
45
|
+
g: 71,
|
|
46
|
+
h: 72,
|
|
47
|
+
i: 73,
|
|
48
|
+
j: 74,
|
|
49
|
+
k: 75,
|
|
50
|
+
l: 76,
|
|
51
|
+
m: 77,
|
|
52
|
+
n: 78,
|
|
53
|
+
o: 79,
|
|
54
|
+
p: 80,
|
|
55
|
+
q: 81,
|
|
56
|
+
r: 82,
|
|
57
|
+
s: 83,
|
|
58
|
+
t: 84,
|
|
59
|
+
u: 85,
|
|
60
|
+
v: 86,
|
|
61
|
+
w: 87,
|
|
62
|
+
x: 88,
|
|
63
|
+
y: 89,
|
|
64
|
+
z: 90,
|
|
65
|
+
LeftWindowKey: 91,
|
|
66
|
+
RightWindowKey: 92,
|
|
67
|
+
SelectKey: 93,
|
|
68
|
+
NumPad0: 96,
|
|
69
|
+
NumPad1: 97,
|
|
70
|
+
NumPad2: 98,
|
|
71
|
+
NumPad3: 99,
|
|
72
|
+
NumPad4: 100,
|
|
73
|
+
NumPad5: 101,
|
|
74
|
+
NumPad6: 102,
|
|
75
|
+
NumPad7: 103,
|
|
76
|
+
NumPad8: 104,
|
|
77
|
+
NumPad9: 105,
|
|
78
|
+
Multiply: 106,
|
|
79
|
+
Add: 107,
|
|
80
|
+
Subtract: 109,
|
|
81
|
+
DecimalPoint: 110,
|
|
82
|
+
Divide: 111,
|
|
83
|
+
F1: 112,
|
|
84
|
+
F2: 113,
|
|
85
|
+
F3: 114,
|
|
86
|
+
F4: 115,
|
|
87
|
+
F5: 116,
|
|
88
|
+
F6: 117,
|
|
89
|
+
F7: 118,
|
|
90
|
+
F8: 119,
|
|
91
|
+
F9: 120,
|
|
92
|
+
F10: 121,
|
|
93
|
+
F12: 123,
|
|
94
|
+
NumLock: 144,
|
|
95
|
+
ScrollLock: 145,
|
|
96
|
+
SemiColon: 186,
|
|
97
|
+
EqualSign: 187,
|
|
98
|
+
Comma: 188,
|
|
99
|
+
Dash: 189,
|
|
100
|
+
Period: 190,
|
|
101
|
+
ForwardSlash: 191,
|
|
102
|
+
GraveAccent: 192,
|
|
103
|
+
OpenBracket: 219,
|
|
104
|
+
BackSlash: 220,
|
|
105
|
+
CloseBracket: 221,
|
|
106
|
+
SingleQuote: 222,
|
|
107
|
+
ChineseInputMethod: 229
|
|
108
|
+
};
|
|
109
|
+
const ROW_EXPAND_FOCUS_STYLE = exports.ROW_EXPAND_FOCUS_STYLE = {
|
|
110
|
+
border: '2px solid #3B88FD'
|
|
111
|
+
};
|
|
112
|
+
const ROW_EXPAND_BTN_FOCUS_STYLE = exports.ROW_EXPAND_BTN_FOCUS_STYLE = {
|
|
113
|
+
border: '2px solid #3B88FD'
|
|
114
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.dtable-ui-row-expand-header .dtable-ui-row-expand-header-close-list {
|
|
2
|
+
display: flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.dtable-ui-row-expand-header .dtable-ui-row-expand-header-close-list .header-close-list-btn {
|
|
6
|
+
height: 24px;
|
|
7
|
+
width: 24px;
|
|
8
|
+
padding: 0 5px;
|
|
9
|
+
margin: 0 2px;
|
|
10
|
+
color: #000;
|
|
11
|
+
opacity: 0.5;
|
|
12
|
+
font-weight: 700;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dtable-ui-row-expand-header .dtable-ui-row-expand-header-close-list .header-close-list-btn:hover {
|
|
16
|
+
opacity: 0.75;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.dtable-ui-row-expand-header .dtable-ui-row-expand-header-left-btns {
|
|
21
|
+
height: 24px;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dtable-ui-row-expand-header .dtable-ui-row-expand-header-left-btns .dtable-ui-row-expand-header-title {
|
|
28
|
+
max-width: 400px;
|
|
29
|
+
font-weight: normal;
|
|
30
|
+
}
|
|
31
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
require("./index.css");
|
|
12
|
+
const Header = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
onToggle,
|
|
15
|
+
title
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_reactstrap.ModalHeader, {
|
|
18
|
+
className: "d-print-none dtable-ui-row-expand-header",
|
|
19
|
+
close: /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
+
className: "dtable-ui-row-expand-header-close-list"
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
22
|
+
role: "button",
|
|
23
|
+
"aria-label": (0, _lang.getLocale)('Close_expanded_record'),
|
|
24
|
+
className: "dtable-font dtable-icon-x header-close-list-btn",
|
|
25
|
+
onClick: onToggle
|
|
26
|
+
}))
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
28
|
+
className: "dtable-ui-row-expand-header-left-btns"
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
className: "dtable-ui-row-expand-header-title text-truncate"
|
|
31
|
+
}, title)));
|
|
32
|
+
};
|
|
33
|
+
var _default = exports.default = Header;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.dtable-ui-row-expand-dialog {
|
|
2
|
+
margin: 28px 0 0 0;
|
|
3
|
+
transform: translate(0, 0) !important;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.dtable-ui-row-expand-dialog .modal-header {
|
|
7
|
+
padding: 6px 14px 6px 20px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.dtable-ui-row-expand-dialog .modal-content {
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dtable-ui-row-expand-dialog .dtable-ui-row-expand-content {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dtable-ui-row-expand-dialog .dtable-ui-row-expand-details {
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
}
|