dtable-ui-component 6.0.3 → 6.0.4
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/ButtonFormatter/index.js +8 -2
- package/lib/CheckboxEditor/index.css +8 -20
- package/lib/CheckboxEditor/index.js +98 -35
- package/lib/CheckboxFormatter/index.css +5 -0
- package/lib/CheckboxFormatter/index.js +9 -15
- 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 +27 -30
- package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +257 -0
- package/lib/CollaboratorItem/index.css +7 -1
- package/lib/CollaboratorItem/index.js +6 -2
- package/lib/Comment/body/comment.js +190 -0
- package/lib/Comment/body/index.css +95 -0
- package/lib/Comment/body/index.js +32 -0
- package/lib/Comment/footer/btns/index.css +40 -0
- package/lib/Comment/footer/btns/index.js +113 -0
- package/lib/Comment/footer/index.css +157 -0
- package/lib/Comment/footer/index.js +169 -0
- package/lib/Comment/footer/input/index.css +52 -0
- package/lib/Comment/footer/input/index.js +448 -0
- package/lib/Comment/footer/input/participant/index.css +0 -0
- package/lib/Comment/footer/input/participant/index.js +53 -0
- package/lib/Comment/footer/participants/index.css +22 -0
- package/lib/Comment/footer/participants/index.js +68 -0
- package/lib/Comment/footer/participants/participant/index.css +5 -0
- package/lib/Comment/footer/participants/participant/index.js +32 -0
- package/lib/Comment/footer/participants/participant-select/index.css +104 -0
- package/lib/Comment/footer/participants/participant-select/index.js +182 -0
- package/lib/Comment/index.css +19 -0
- package/lib/Comment/index.js +304 -0
- package/lib/Comment/model.js +25 -0
- package/lib/Comment/utils/common.js +62 -0
- package/lib/Comment/utils/index.js +27 -0
- package/lib/Comment/utils/utilities.js +176 -0
- package/lib/DTableColorPicker/index.css +1 -1
- package/lib/DTableCustomizeSelect/index.js +2 -2
- package/lib/DTableFiltersPopover/utils/index.js +1 -7
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
- package/lib/DTableGroupSelect/index.js +3 -3
- package/lib/DTableSelect/index.js +3 -1
- package/lib/DateEditor/index.js +14 -51
- package/lib/DateEditor/pc-date-editor-popover.js +149 -12
- package/lib/{common/delete-tip.js → DeleteTip/index.js} +12 -16
- package/lib/Department-editor/department-single-select.js +1 -1
- package/lib/Department-editor/index.js +3 -4
- package/lib/DepartmentSingleSelectFormatter/index.js +3 -2
- 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 +39 -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 +110 -0
- package/lib/EmailEditor/index.js +58 -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 +258 -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/cell-value-validator.js +17 -17
- 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 +240 -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/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/ImageFormatter/images-lazy-load.js +4 -2
- package/lib/ImageFormatter/index.js +8 -3
- package/lib/ImageThumbnail/index.css +20 -0
- package/lib/ImageThumbnail/index.js +137 -0
- package/lib/LinkEditor/index.js +2 -3
- package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
- package/lib/MultipleSelectEditor/index.js +16 -177
- package/lib/NumberEditor/index.js +63 -77
- package/lib/RoleStatusEditor/index.css +0 -2
- package/lib/RowExpandDialog/body/index.css +21 -0
- package/lib/RowExpandDialog/body/index.js +262 -0
- package/lib/RowExpandDialog/column-content/index.css +48 -0
- package/lib/RowExpandDialog/column-content/index.js +50 -0
- package/lib/RowExpandDialog/header/index.css +31 -0
- package/lib/RowExpandDialog/header/index.js +55 -0
- package/lib/RowExpandDialog/index.css +28 -0
- package/lib/RowExpandDialog/index.js +237 -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 +104 -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 +148 -0
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +17 -0
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +165 -0
- package/lib/RowExpandEditor/RowExpandImageEditor/index.css +11 -0
- package/lib/RowExpandEditor/RowExpandImageEditor/index.js +170 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +6 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +123 -0
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +44 -0
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +247 -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 +206 -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 +12 -13
- 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 +5 -5
- package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
- package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.css +2 -2
- package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.js +20 -20
- 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 +61 -0
- package/lib/RowExpandFormatter/index.css +28 -3
- package/lib/RowExpandFormatter/index.js +113 -131
- package/lib/SimpleLongTextFormatter/widgets/longTextEditor.css +2 -2
- package/lib/SingleSelectEditor/index.js +16 -156
- package/lib/SvgIcon/index.css +11 -0
- package/lib/SvgIcon/index.js +29 -0
- package/lib/TextEditor/index.js +112 -42
- package/lib/UploadProgress/index.js +38 -0
- package/lib/UrlEditor/index.js +61 -0
- package/lib/common/editor-base.js +52 -0
- package/lib/constants/file.js +96 -0
- package/lib/constants/index.js +27 -15
- package/lib/constants/key-codes.js +109 -0
- package/lib/css/cell-editor.css +18 -2
- package/lib/formatterConfig/base-formatter-config.js +23 -23
- package/lib/formatterConfig/index.js +3 -3
- package/lib/hooks/index.js +16 -0
- package/lib/index.js +81 -46
- package/lib/lang/index.js +19 -16
- package/lib/locales/de.json +167 -0
- package/lib/locales/en.json +167 -0
- package/lib/locales/es.json +167 -0
- package/lib/locales/fr.json +167 -0
- package/lib/locales/pt.json +167 -0
- package/lib/locales/ru.json +167 -0
- package/lib/locales/zh-CN.json +167 -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 +295 -0
- package/lib/toaster/toast.js +19 -15
- 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/hotkey.js +37 -0
- package/lib/utils/object-utils.js +61 -0
- package/lib/utils/url.js +127 -8
- package/lib/utils/utils.js +119 -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/RowExpandLinkFormatter/utils.js +0 -71
- package/lib/RowExpandUrlFormatter/index.css +0 -1
- package/lib/SingleSelectEditor/index.css +0 -14
- package/lib/common/modal-portal.js +0 -26
- 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/{common/delete-tip.css → DeleteTip/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
|
@@ -7,76 +7,46 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var _CheckboxFormatter = _interopRequireDefault(require("../CheckboxFormatter"));
|
|
13
|
-
var _DateFormatter = _interopRequireDefault(require("../DateFormatter"));
|
|
14
|
-
var _SingleSelectFormatter = _interopRequireDefault(require("../SingleSelectFormatter"));
|
|
15
|
-
var _MultipleSelectFormatter = _interopRequireDefault(require("../MultipleSelectFormatter"));
|
|
16
|
-
var _CollaboratorFormatter = _interopRequireDefault(require("../CollaboratorFormatter"));
|
|
17
|
-
var _LongTextFormatter = _interopRequireDefault(require("../LongTextFormatter"));
|
|
18
|
-
var _GeolocationFormatter = _interopRequireDefault(require("../GeolocationFormatter"));
|
|
19
|
-
var _CTimeFormatter = _interopRequireDefault(require("../CTimeFormatter"));
|
|
20
|
-
var _CreatorFormatter = _interopRequireDefault(require("../CreatorFormatter"));
|
|
21
|
-
var _LastModifierFormatter = _interopRequireDefault(require("../LastModifierFormatter"));
|
|
22
|
-
var _MTimeFormatter = _interopRequireDefault(require("../MTimeFormatter"));
|
|
23
|
-
var _AutoNumberFormatter = _interopRequireDefault(require("../AutoNumberFormatter"));
|
|
24
|
-
var _DurationFormatter = _interopRequireDefault(require("../DurationFormatter"));
|
|
25
|
-
var _ButtonFormatter = _interopRequireDefault(require("../ButtonFormatter"));
|
|
26
|
-
var _RowExpandUrlFormatter = _interopRequireDefault(require("../RowExpandUrlFormatter"));
|
|
27
|
-
var _RowExpandEmailFormatter = _interopRequireDefault(require("../RowExpandEmailFormatter"));
|
|
28
|
-
var _RowExpandRateFormatter = _interopRequireDefault(require("../RowExpandRateFormatter"));
|
|
29
|
-
var _RowExpandImageFormatter = _interopRequireDefault(require("../RowExpandImageFormatter"));
|
|
30
|
-
var _RowExpandFileFormatter = _interopRequireDefault(require("../RowExpandFileFormatter"));
|
|
31
|
-
var _RowExpandLinkFormatter = _interopRequireDefault(require("../RowExpandLinkFormatter"));
|
|
32
|
-
var _RowExpandFormulaFormatter = _interopRequireDefault(require("../RowExpandFormulaFormatter"));
|
|
33
|
-
var _DigitalSignFormatter = _interopRequireDefault(require("../DigitalSignFormatter"));
|
|
34
|
-
var _DepartmentSingleSelectFormatter = _interopRequireDefault(require("../DepartmentSingleSelectFormatter"));
|
|
35
|
-
var _constants = require("../constants");
|
|
10
|
+
var _dtableUtils = require("dtable-utils");
|
|
11
|
+
var _constants = require("./constants");
|
|
36
12
|
require("./index.css");
|
|
37
|
-
class
|
|
13
|
+
class RowExpandFormatter extends _react.default.Component {
|
|
38
14
|
constructor(_props) {
|
|
39
15
|
super(_props);
|
|
40
16
|
this.updateCollaborators = () => {
|
|
17
|
+
const {
|
|
18
|
+
column
|
|
19
|
+
} = this.props;
|
|
20
|
+
if (![_dtableUtils.CellType.CREATOR, _dtableUtils.CellType.LAST_MODIFIER, _dtableUtils.CellType.COLLABORATOR].includes(column.type)) return;
|
|
21
|
+
const collaborators = this.getCollaborators();
|
|
41
22
|
this.setState({
|
|
42
|
-
collaborators
|
|
23
|
+
collaborators
|
|
43
24
|
});
|
|
44
25
|
};
|
|
45
26
|
this.calculateCollaboratorData = props => {
|
|
46
27
|
const {
|
|
47
28
|
row,
|
|
48
|
-
column
|
|
29
|
+
column,
|
|
30
|
+
queryCollaborators
|
|
49
31
|
} = props;
|
|
50
|
-
if (column.type ===
|
|
32
|
+
if (column.type === _dtableUtils.CellType.CREATOR || column.type === _dtableUtils.CellType.LAST_MODIFIER) {
|
|
51
33
|
const email = row[column.name];
|
|
52
|
-
|
|
53
|
-
} else if (column.type ===
|
|
34
|
+
queryCollaborators && queryCollaborators(email);
|
|
35
|
+
} else if (column.type === _dtableUtils.CellType.COLLABORATOR) {
|
|
54
36
|
const emails = row[column.name];
|
|
55
37
|
if (Array.isArray(emails)) {
|
|
56
|
-
|
|
57
|
-
this.loadCollaborator(email);
|
|
58
|
-
});
|
|
38
|
+
queryCollaborators && queryCollaborators(emails);
|
|
59
39
|
}
|
|
60
40
|
}
|
|
61
41
|
};
|
|
62
|
-
this.
|
|
42
|
+
this.getCollaborators = () => {
|
|
63
43
|
const {
|
|
64
|
-
|
|
44
|
+
getCollaborators,
|
|
65
45
|
collaborators
|
|
66
46
|
} = this.props;
|
|
67
|
-
if (
|
|
68
|
-
return context.getCollaboratorsFromCache();
|
|
69
|
-
}
|
|
47
|
+
if (getCollaborators) return getCollaborators();
|
|
70
48
|
return collaborators || [];
|
|
71
49
|
};
|
|
72
|
-
this.loadCollaborator = email => {
|
|
73
|
-
const {
|
|
74
|
-
context
|
|
75
|
-
} = this.props;
|
|
76
|
-
if (context && context.loadCollaborator) {
|
|
77
|
-
context.loadCollaborator(email);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
50
|
this.renderEmpty = () => {
|
|
81
51
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
82
52
|
className: "d-flex align-items-center form-control disabled h-auto"
|
|
@@ -86,7 +56,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
86
56
|
let {
|
|
87
57
|
column,
|
|
88
58
|
row,
|
|
89
|
-
|
|
59
|
+
valueKey
|
|
90
60
|
} = this.props;
|
|
91
61
|
let {
|
|
92
62
|
type: columnType
|
|
@@ -94,178 +64,180 @@ class EditorFormatter extends _react.default.Component {
|
|
|
94
64
|
const {
|
|
95
65
|
collaborators
|
|
96
66
|
} = this.state;
|
|
97
|
-
const containerClassName = "dtable-".concat(columnType, "-formatter
|
|
98
|
-
let cellValue = row[column
|
|
67
|
+
const containerClassName = "dtable-ui-row-expand-".concat(columnType, "-formatter");
|
|
68
|
+
let cellValue = row[column[valueKey]];
|
|
69
|
+
const Formatter = this.component[columnType];
|
|
70
|
+
if (!Formatter) return null;
|
|
99
71
|
switch (columnType) {
|
|
100
|
-
case
|
|
72
|
+
case _dtableUtils.CellType.TEXT:
|
|
101
73
|
{
|
|
102
74
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
103
75
|
className: "form-control d-flex align-items-center w-100"
|
|
104
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
105
77
|
value: cellValue,
|
|
106
78
|
containerClassName: containerClassName
|
|
107
79
|
}));
|
|
108
80
|
}
|
|
109
|
-
case
|
|
81
|
+
case _dtableUtils.CellType.COLLABORATOR:
|
|
110
82
|
{
|
|
111
83
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
112
84
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
113
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
114
86
|
value: cellValue,
|
|
115
87
|
collaborators: collaborators,
|
|
116
88
|
containerClassName: containerClassName
|
|
117
89
|
}));
|
|
118
90
|
}
|
|
119
|
-
case
|
|
91
|
+
case _dtableUtils.CellType.LONG_TEXT:
|
|
120
92
|
{
|
|
121
|
-
if (!cellValue) return
|
|
93
|
+
if (!cellValue) return /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
+
className: "form-control d-flex align-items-center w-100"
|
|
95
|
+
});
|
|
122
96
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
123
97
|
className: "longtext-formatter-container"
|
|
124
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
125
99
|
value: cellValue,
|
|
126
100
|
containerClassName: containerClassName,
|
|
127
101
|
isSample: false
|
|
128
102
|
}));
|
|
129
103
|
}
|
|
130
|
-
case
|
|
104
|
+
case _dtableUtils.CellType.GEOLOCATION:
|
|
131
105
|
{
|
|
106
|
+
if (!cellValue) return null;
|
|
132
107
|
if (typeof cellValue !== 'object') return null;
|
|
133
108
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
134
|
-
className: "geolocation-formatter-container"
|
|
135
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
109
|
+
className: "dtable-ui-geolocation-formatter-container"
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
136
111
|
value: cellValue,
|
|
137
112
|
data: column.data,
|
|
138
113
|
containerClassName: containerClassName
|
|
139
114
|
}));
|
|
140
115
|
}
|
|
141
|
-
case
|
|
116
|
+
case _dtableUtils.CellType.NUMBER:
|
|
142
117
|
{
|
|
143
118
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
144
119
|
className: "form-control d-flex align-items-center",
|
|
145
120
|
style: {
|
|
146
121
|
width: 320
|
|
147
122
|
}
|
|
148
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
149
124
|
value: cellValue,
|
|
150
125
|
data: column.data,
|
|
151
126
|
containerClassName: containerClassName
|
|
152
127
|
}));
|
|
153
128
|
}
|
|
154
|
-
case
|
|
129
|
+
case _dtableUtils.CellType.DATE:
|
|
155
130
|
{
|
|
156
131
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
157
132
|
className: "form-control d-flex align-items-center",
|
|
158
133
|
style: {
|
|
159
134
|
width: 320
|
|
160
135
|
}
|
|
161
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
136
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
162
137
|
value: cellValue,
|
|
163
138
|
format: column.data.format,
|
|
164
139
|
containerClassName: containerClassName
|
|
165
140
|
}));
|
|
166
141
|
}
|
|
167
|
-
case
|
|
142
|
+
case _dtableUtils.CellType.CTIME:
|
|
168
143
|
{
|
|
169
144
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
170
145
|
className: "form-control d-flex align-items-center ctime-formatter-container",
|
|
171
146
|
style: {
|
|
172
147
|
width: 320
|
|
173
148
|
}
|
|
174
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
175
|
-
value:
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
150
|
+
value: cellValue,
|
|
176
151
|
containerClassName: containerClassName
|
|
177
152
|
}));
|
|
178
153
|
}
|
|
179
|
-
case
|
|
154
|
+
case _dtableUtils.CellType.MTIME:
|
|
180
155
|
{
|
|
181
156
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
182
157
|
className: "form-control d-flex align-items-center mtime-formatter-container",
|
|
183
158
|
style: {
|
|
184
159
|
width: 320
|
|
185
160
|
}
|
|
186
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
187
|
-
value:
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
162
|
+
value: cellValue,
|
|
188
163
|
containerClassName: containerClassName
|
|
189
164
|
}));
|
|
190
165
|
}
|
|
191
|
-
case
|
|
166
|
+
case _dtableUtils.CellType.MULTIPLE_SELECT:
|
|
192
167
|
{
|
|
193
|
-
|
|
168
|
+
var _column, _column$data;
|
|
169
|
+
const options = ((_column = column) === null || _column === void 0 ? void 0 : (_column$data = _column.data) === null || _column$data === void 0 ? void 0 : _column$data.options) || [];
|
|
194
170
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
195
171
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
196
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
172
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
197
173
|
value: cellValue,
|
|
198
174
|
options: options,
|
|
199
175
|
containerClassName: containerClassName
|
|
200
176
|
}));
|
|
201
177
|
}
|
|
202
|
-
case
|
|
178
|
+
case _dtableUtils.CellType.SINGLE_SELECT:
|
|
203
179
|
{
|
|
204
|
-
|
|
180
|
+
var _column2, _column2$data;
|
|
181
|
+
const options = ((_column2 = column) === null || _column2 === void 0 ? void 0 : (_column2$data = _column2.data) === null || _column2$data === void 0 ? void 0 : _column2$data.options) || [];
|
|
205
182
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
206
183
|
className: "form-control d-flex align-items-center w-100"
|
|
207
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
184
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
208
185
|
value: cellValue,
|
|
209
186
|
options: options,
|
|
210
187
|
containerClassName: containerClassName
|
|
211
188
|
}));
|
|
212
189
|
}
|
|
213
|
-
case
|
|
190
|
+
case _dtableUtils.CellType.FILE:
|
|
214
191
|
{
|
|
215
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
192
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
216
193
|
value: cellValue,
|
|
217
194
|
column: column,
|
|
218
195
|
downloadFile: this.props.downloadFile,
|
|
219
|
-
deleteFile: this.props.deleteFile
|
|
196
|
+
deleteFile: this.props.deleteFile,
|
|
197
|
+
config: this.props.config
|
|
220
198
|
});
|
|
221
199
|
}
|
|
222
|
-
case
|
|
200
|
+
case _dtableUtils.CellType.IMAGE:
|
|
223
201
|
{
|
|
224
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
202
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
225
203
|
value: cellValue,
|
|
226
204
|
column: column,
|
|
227
205
|
downloadImage: this.props.downloadImage,
|
|
228
206
|
deleteFile: this.props.deleteFile,
|
|
229
|
-
onRotateImage: this.props.onRotateImage
|
|
207
|
+
onRotateImage: this.props.onRotateImage,
|
|
208
|
+
config: this.props.config
|
|
230
209
|
});
|
|
231
210
|
}
|
|
232
|
-
case
|
|
211
|
+
case _dtableUtils.CellType.CHECKBOX:
|
|
233
212
|
{
|
|
234
|
-
var _column$
|
|
213
|
+
var _column$data2;
|
|
235
214
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
236
215
|
className: "checkbox-formatter-container"
|
|
237
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
216
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
238
217
|
value: cellValue,
|
|
239
|
-
checkboxStyle: ((_column$
|
|
218
|
+
checkboxStyle: ((_column$data2 = column.data) === null || _column$data2 === void 0 ? void 0 : _column$data2.checkbox_style) || {}
|
|
240
219
|
}));
|
|
241
220
|
}
|
|
242
|
-
case
|
|
243
|
-
|
|
244
|
-
return /*#__PURE__*/_react.default.createElement(_CreatorFormatter.default, {
|
|
245
|
-
collaborators: collaborators,
|
|
246
|
-
value: cellValue,
|
|
247
|
-
containerClassName: containerClassName
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
case _constants.CellType.LAST_MODIFIER:
|
|
221
|
+
case _dtableUtils.CellType.CREATOR:
|
|
222
|
+
case _dtableUtils.CellType.LAST_MODIFIER:
|
|
251
223
|
{
|
|
252
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
224
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
253
225
|
collaborators: collaborators,
|
|
254
226
|
value: cellValue,
|
|
255
227
|
containerClassName: containerClassName
|
|
256
228
|
});
|
|
257
229
|
}
|
|
258
|
-
case
|
|
259
|
-
case
|
|
230
|
+
case _dtableUtils.CellType.FORMULA:
|
|
231
|
+
case _dtableUtils.CellType.LINK_FORMULA:
|
|
260
232
|
{
|
|
261
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
233
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
262
234
|
value: cellValue,
|
|
263
235
|
column: column,
|
|
264
236
|
collaborators: collaborators,
|
|
265
237
|
containerClassName: containerClassName
|
|
266
238
|
});
|
|
267
239
|
}
|
|
268
|
-
case
|
|
240
|
+
case _dtableUtils.CellType.LINK:
|
|
269
241
|
{
|
|
270
242
|
// handle link column do not have column.data.display_column
|
|
271
243
|
const {
|
|
@@ -283,106 +255,117 @@ class EditorFormatter extends _react.default.Component {
|
|
|
283
255
|
...data,
|
|
284
256
|
display_column: {
|
|
285
257
|
key: display_column_key || '0000',
|
|
286
|
-
type: array_type ||
|
|
258
|
+
type: array_type || _dtableUtils.CellType.TEXT,
|
|
287
259
|
data: array_data || null
|
|
288
260
|
}
|
|
289
261
|
}
|
|
290
262
|
};
|
|
291
263
|
}
|
|
292
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
264
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
293
265
|
value: cellValue,
|
|
294
266
|
column: column,
|
|
295
267
|
collaborators: collaborators,
|
|
296
268
|
containerClassName: containerClassName,
|
|
297
|
-
renderEmpty:
|
|
269
|
+
renderEmpty: () => null
|
|
298
270
|
});
|
|
299
271
|
}
|
|
300
|
-
case
|
|
272
|
+
case _dtableUtils.CellType.AUTO_NUMBER:
|
|
301
273
|
{
|
|
302
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
274
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
303
275
|
value: cellValue,
|
|
304
276
|
containerClassName: containerClassName
|
|
305
277
|
});
|
|
306
278
|
}
|
|
307
|
-
case
|
|
279
|
+
case _dtableUtils.CellType.URL:
|
|
308
280
|
{
|
|
309
281
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
310
282
|
className: "form-control d-flex align-items-center w-100"
|
|
311
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
283
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
312
284
|
value: cellValue,
|
|
313
285
|
containerClassName: containerClassName
|
|
314
286
|
}));
|
|
315
287
|
}
|
|
316
|
-
case
|
|
288
|
+
case _dtableUtils.CellType.EMAIL:
|
|
317
289
|
{
|
|
318
290
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
319
291
|
className: "form-control d-flex align-items-center w-100"
|
|
320
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
292
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
321
293
|
value: cellValue,
|
|
322
294
|
containerClassName: containerClassName
|
|
323
295
|
}));
|
|
324
296
|
}
|
|
325
|
-
case
|
|
297
|
+
case _dtableUtils.CellType.DURATION:
|
|
326
298
|
{
|
|
327
299
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
328
300
|
className: "form-control d-flex align-items-center",
|
|
329
301
|
style: {
|
|
330
302
|
width: 320
|
|
331
303
|
}
|
|
332
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
304
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
333
305
|
value: cellValue,
|
|
334
306
|
format: column.data.duration_format,
|
|
335
307
|
containerClassName: containerClassName
|
|
336
308
|
}));
|
|
337
309
|
}
|
|
338
|
-
case
|
|
310
|
+
case _dtableUtils.CellType.RATE:
|
|
339
311
|
{
|
|
340
312
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
341
313
|
className: "form-control d-flex align-items-center",
|
|
342
314
|
style: {
|
|
343
315
|
width: 320
|
|
344
316
|
}
|
|
345
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
317
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
346
318
|
value: cellValue,
|
|
347
319
|
data: column.data,
|
|
348
320
|
containerClassName: containerClassName
|
|
349
321
|
}));
|
|
350
322
|
}
|
|
351
|
-
case
|
|
323
|
+
case _dtableUtils.CellType.BUTTON:
|
|
352
324
|
{
|
|
353
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
325
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
354
326
|
data: column.data,
|
|
355
327
|
containerClassName: containerClassName,
|
|
356
328
|
onClickButton: this.props.onClickButton
|
|
357
329
|
});
|
|
358
330
|
}
|
|
359
|
-
case
|
|
331
|
+
case _dtableUtils.CellType.DIGITAL_SIGN:
|
|
360
332
|
{
|
|
361
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
333
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
362
334
|
value: cellValue,
|
|
363
335
|
containerClassName: containerClassName,
|
|
364
336
|
config: this.props.config
|
|
365
337
|
});
|
|
366
338
|
}
|
|
367
|
-
case
|
|
339
|
+
case _dtableUtils.CellType.DEPARTMENT_SINGLE_SELECT:
|
|
368
340
|
{
|
|
369
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
341
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
370
342
|
value: cellValue,
|
|
371
343
|
departments: this.props.departments
|
|
372
344
|
});
|
|
373
345
|
}
|
|
374
346
|
default:
|
|
375
|
-
|
|
347
|
+
{
|
|
348
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
349
|
+
value: cellValue,
|
|
350
|
+
containerClassName: containerClassName,
|
|
351
|
+
config: this.props.config
|
|
352
|
+
});
|
|
353
|
+
}
|
|
376
354
|
}
|
|
377
355
|
};
|
|
378
356
|
this.state = {
|
|
379
|
-
collaborators: this.
|
|
357
|
+
collaborators: this.getCollaborators()
|
|
358
|
+
};
|
|
359
|
+
this.component = {
|
|
360
|
+
..._constants.DEFAULT_FORMATTER,
|
|
361
|
+
...this.props.component
|
|
380
362
|
};
|
|
381
363
|
}
|
|
382
364
|
componentDidMount() {
|
|
383
365
|
this.calculateCollaboratorData(this.props);
|
|
384
|
-
|
|
385
|
-
|
|
366
|
+
const eventBus = this.props.eventBus;
|
|
367
|
+
if (eventBus) {
|
|
368
|
+
this.unsubscribeCollaboratorsUpdated = eventBus.subscribe('collaborators-updated', this.updateCollaborators);
|
|
386
369
|
}
|
|
387
370
|
}
|
|
388
371
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
@@ -398,13 +381,12 @@ class EditorFormatter extends _react.default.Component {
|
|
|
398
381
|
className
|
|
399
382
|
} = this.props;
|
|
400
383
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
401
|
-
className: (0, _classnames.default)('dtable-ui dtable-row-expand-formatter',
|
|
402
|
-
[className]: className
|
|
403
|
-
})
|
|
384
|
+
className: (0, _classnames.default)('dtable-ui dtable-row-expand-formatter', className)
|
|
404
385
|
}, this.renderFormatter());
|
|
405
386
|
}
|
|
406
387
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
};
|
|
388
|
+
RowExpandFormatter.defaultProps = {
|
|
389
|
+
className: '',
|
|
390
|
+
valueKey: 'name'
|
|
391
|
+
};
|
|
392
|
+
var _default = exports.default = RowExpandFormatter;
|
|
@@ -210,14 +210,14 @@
|
|
|
210
210
|
display: flex;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
.longtext-modal-dialog-header
|
|
213
|
+
.longtext-modal-dialog-header .longtext-browser-warning {
|
|
214
214
|
margin-right: 4px;
|
|
215
215
|
display: inline-block;
|
|
216
216
|
line-height: 12px;
|
|
217
217
|
transform: scale(0.8);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
.longtext-modal-dialog-header
|
|
220
|
+
.longtext-modal-dialog-header .browser-warning-content {
|
|
221
221
|
line-height: 12px;
|
|
222
222
|
}
|
|
223
223
|
|