dtable-ui-component 5.3.1-beta6 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/CheckboxEditor/index.css +20 -3
- package/lib/CheckboxEditor/index.js +35 -98
- package/lib/CheckboxFormatter/index.js +9 -6
- package/lib/CollaboratorEditor/index.css +35 -12
- package/lib/CollaboratorEditor/index.js +212 -18
- package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.js +29 -26
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +97 -0
- package/lib/CollaboratorItem/index.css +1 -1
- package/lib/CollaboratorItem/index.js +2 -6
- package/lib/DTableFiltersPopover/utils/index.js +7 -1
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
- package/lib/DTableGroupSelect/select-option-group.css +17 -17
- package/lib/DTableGroupSelect/select-option-group.js +1 -1
- package/lib/DTableSelect/index.js +1 -3
- package/lib/DateEditor/index.js +51 -14
- package/lib/DateEditor/pc-date-editor-popover.js +12 -145
- package/lib/Department-editor/department-single-select.js +1 -1
- package/lib/Department-editor/index.js +4 -3
- package/lib/DepartmentSingleSelectFormatter/index.js +1 -2
- package/lib/FileEditor/index.js +11 -258
- package/lib/FileEditor/pc-files-addition/index.js +1 -0
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +1 -0
- package/lib/FileEditor/pc-files-preview/index.js +1 -0
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +1 -0
- package/lib/FileItemFormatter/assets/file/192/excel.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/file.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/music.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/pdf.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/pic.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/ppt.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/txt.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/video.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/word.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/excel.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/file.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/music.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/pdf.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/pic.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/ppt.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/txt.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/video.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/word.png +0 -0
- package/lib/FileItemFormatter/assets/folder/folder-192.png +0 -0
- package/lib/FileItemFormatter/assets/folder/folder-24.png +0 -0
- package/lib/FileItemFormatter/index.js +20 -19
- package/lib/FileItemFormatter/utils.js +99 -0
- package/lib/FileUploader/index.js +14 -268
- package/lib/FormulaFormatter/index.js +1 -2
- package/lib/FormulaFormatter/utils.js +31 -0
- package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
- package/lib/MultipleSelectEditor/index.css +9 -0
- package/lib/MultipleSelectEditor/index.js +177 -16
- package/lib/NumberEditor/index.js +77 -64
- package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.css +1 -1
- package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.js +1 -1
- package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.css +6 -6
- package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.js +1 -3
- package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/row-expand-file-item-formatter.js +11 -10
- package/lib/RowExpandFormatter/index.css +1 -27
- package/lib/RowExpandFormatter/index.js +100 -83
- package/lib/{RowExpandFormatter/RowExpandFormulaFormatter → RowExpandFormulaFormatter}/index.js +10 -11
- package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.css +6 -6
- package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.js +1 -1
- package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/row-expand-image-item-formatter.js +3 -3
- package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
- package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.js +6 -6
- package/lib/RowExpandLinkFormatter/utils.js +71 -0
- package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.css +1 -1
- package/lib/RowExpandUrlFormatter/index.css +1 -0
- package/lib/{RowExpandFormatter/RowExpandUrlFormatter → RowExpandUrlFormatter}/index.js +3 -4
- package/lib/SingleSelectEditor/index.css +14 -0
- package/lib/SingleSelectEditor/index.js +156 -16
- package/lib/TextEditor/index.js +42 -113
- package/lib/constants/index.js +2 -34
- package/lib/css/cell-editor.css +2 -18
- package/lib/index.js +46 -74
- package/lib/lang/index.js +16 -19
- package/lib/locals/de.js +103 -0
- package/lib/locals/en.js +104 -0
- package/lib/locals/es.js +103 -0
- package/lib/locals/fr.js +103 -0
- package/lib/locals/pt.js +103 -0
- package/lib/locals/ru.js +103 -0
- package/lib/locals/zh-CN.js +104 -0
- package/lib/select-editor/index.js +6 -6
- package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.js +3 -3
- package/lib/select-editor/pc-select-editor-popover/index.css +71 -0
- package/lib/select-editor/pc-select-editor-popover/index.js +122 -0
- package/lib/utils/editor-utils.js +6 -1
- package/lib/utils/url.js +8 -121
- package/lib/utils/utils.js +2 -145
- package/package.json +2 -3
- package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +0 -257
- package/lib/Comment/body/comment.js +0 -190
- package/lib/Comment/body/index.css +0 -95
- package/lib/Comment/body/index.js +0 -32
- package/lib/Comment/footer/btns/index.css +0 -40
- package/lib/Comment/footer/btns/index.js +0 -113
- package/lib/Comment/footer/index.css +0 -157
- package/lib/Comment/footer/index.js +0 -170
- package/lib/Comment/footer/input/index.css +0 -52
- package/lib/Comment/footer/input/index.js +0 -448
- package/lib/Comment/footer/input/participant/index.css +0 -0
- package/lib/Comment/footer/input/participant/index.js +0 -53
- package/lib/Comment/footer/participants/index.css +0 -22
- package/lib/Comment/footer/participants/index.js +0 -68
- package/lib/Comment/footer/participants/participant/index.css +0 -5
- package/lib/Comment/footer/participants/participant/index.js +0 -32
- package/lib/Comment/footer/participants/participant-select/index.css +0 -104
- package/lib/Comment/footer/participants/participant-select/index.js +0 -182
- package/lib/Comment/index.css +0 -19
- package/lib/Comment/index.js +0 -305
- package/lib/Comment/model.js +0 -25
- package/lib/Comment/utils/common.js +0 -62
- package/lib/Comment/utils/index.js +0 -27
- package/lib/Comment/utils/utilities.js +0 -176
- package/lib/DeleteTip/index.js +0 -50
- package/lib/DigitalSignEditor/constants.js +0 -7
- package/lib/DigitalSignEditor/index.css +0 -69
- package/lib/DigitalSignEditor/index.js +0 -182
- package/lib/DigitalSignEditor/service.js +0 -38
- package/lib/DigitalSignEditor/signature-board/index.css +0 -35
- package/lib/DigitalSignEditor/signature-board/index.js +0 -135
- package/lib/DigitalSignEditor/signature-board/signature-tool.js +0 -396
- package/lib/DigitalSignEditor/utils.js +0 -29
- package/lib/DurationEditor/index.js +0 -111
- package/lib/EmailEditor/index.js +0 -59
- package/lib/FileEditor/addition-previewer/index.css +0 -1
- package/lib/FileEditor/addition-previewer/index.js +0 -52
- package/lib/FileEditor/addition-previewer/local-file-addition/index.css +0 -1
- package/lib/FileEditor/addition-previewer/local-file-addition/index.js +0 -252
- package/lib/FileEditor/constants.js +0 -7
- package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +0 -74
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +0 -5
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +0 -77
- package/lib/FileEditor/files-previewer/file-previewer/index.css +0 -88
- package/lib/FileEditor/files-previewer/file-previewer/index.js +0 -167
- package/lib/FileEditor/files-previewer/index.css +0 -56
- package/lib/FileEditor/files-previewer/index.js +0 -277
- package/lib/FileEditor/index.css +0 -6
- package/lib/FileEditor/utils.js +0 -22
- package/lib/FileUploader/index.css +0 -9
- package/lib/GeolocationEditor/country-editor.js +0 -319
- package/lib/GeolocationEditor/index.css +0 -641
- package/lib/GeolocationEditor/index.js +0 -241
- package/lib/GeolocationEditor/location-editor.js +0 -368
- package/lib/GeolocationEditor/map-editor/index.js +0 -456
- package/lib/GeolocationEditor/map-editor/large-editor/index.css +0 -137
- package/lib/GeolocationEditor/map-editor/large-editor/index.js +0 -461
- package/lib/GeolocationEditor/map-editor-utils.js +0 -153
- package/lib/GeolocationEditor/map-selection-editor/index.js +0 -455
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +0 -1
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +0 -447
- package/lib/GeolocationEditor/parse-geolocation.js +0 -282
- package/lib/GeolocationEditor/province-city-editor.js +0 -292
- package/lib/GeolocationEditor/province-editor.js +0 -226
- package/lib/GeolocationEditor/selector-header-item.js +0 -28
- package/lib/GeolocationEditor/selector-list.js +0 -33
- package/lib/GeolocationEditor/with-ref.js +0 -27
- package/lib/ImageEditor/addition-previewer/image-link/index.css +0 -45
- package/lib/ImageEditor/addition-previewer/image-link/index.js +0 -73
- package/lib/ImageEditor/addition-previewer/index.css +0 -106
- package/lib/ImageEditor/addition-previewer/index.js +0 -63
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +0 -125
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +0 -254
- package/lib/ImageEditor/constants.js +0 -7
- package/lib/ImageEditor/images-previewer/image-preview/index.css +0 -59
- package/lib/ImageEditor/images-previewer/image-preview/index.js +0 -155
- package/lib/ImageEditor/images-previewer/index.css +0 -18
- package/lib/ImageEditor/images-previewer/index.js +0 -140
- package/lib/ImageEditor/index.css +0 -24
- package/lib/ImageEditor/index.js +0 -194
- package/lib/ImageThumbnail/index.css +0 -20
- package/lib/ImageThumbnail/index.js +0 -136
- package/lib/RowExpandDialog/body/index.css +0 -21
- package/lib/RowExpandDialog/body/index.js +0 -262
- package/lib/RowExpandDialog/column-content/index.css +0 -44
- package/lib/RowExpandDialog/column-content/index.js +0 -50
- package/lib/RowExpandDialog/header/index.css +0 -31
- package/lib/RowExpandDialog/header/index.js +0 -55
- package/lib/RowExpandDialog/index.css +0 -24
- package/lib/RowExpandDialog/index.js +0 -252
- package/lib/RowExpandEditor/RowExpandAddBtn/index.css +0 -22
- package/lib/RowExpandEditor/RowExpandAddBtn/index.js +0 -24
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +0 -18
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +0 -43
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +0 -5
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +0 -232
- package/lib/RowExpandEditor/RowExpandDateEditor/index.js +0 -130
- package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +0 -129
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +0 -13
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +0 -208
- package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +0 -105
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +0 -2
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +0 -125
- package/lib/RowExpandEditor/RowExpandFileEditor/index.css +0 -1
- package/lib/RowExpandEditor/RowExpandFileEditor/index.js +0 -146
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +0 -17
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +0 -165
- package/lib/RowExpandEditor/RowExpandImageEditor/index.css +0 -6
- package/lib/RowExpandEditor/RowExpandImageEditor/index.js +0 -170
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +0 -6
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +0 -123
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +0 -44
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +0 -224
- package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +0 -105
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +0 -13
- package/lib/RowExpandEditor/RowExpandRateEditor/index.js +0 -152
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +0 -58
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +0 -192
- package/lib/RowExpandEditor/RowExpandTextEditor/index.css +0 -4
- package/lib/RowExpandEditor/RowExpandTextEditor/index.js +0 -127
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +0 -31
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +0 -130
- package/lib/RowExpandEditor/constants.js +0 -44
- package/lib/RowExpandEditor/index.css +0 -0
- package/lib/RowExpandEditor/index.js +0 -32
- package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +0 -27
- package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +0 -1
- package/lib/RowExpandFormatter/constants.js +0 -60
- package/lib/UploadProgress/index.js +0 -38
- package/lib/UrlEditor/index.js +0 -62
- package/lib/common/editor-base.js +0 -53
- package/lib/constants/file.js +0 -96
- package/lib/constants/key-codes.js +0 -109
- package/lib/hooks/index.js +0 -16
- package/lib/locales/de.json +0 -167
- package/lib/locales/en.json +0 -167
- package/lib/locales/es.json +0 -167
- package/lib/locales/fr.json +0 -167
- package/lib/locales/pt.json +0 -167
- package/lib/locales/ru.json +0 -167
- package/lib/locales/zh-CN.json +0 -167
- package/lib/select-editor/pc-select-editor/index.css +0 -85
- package/lib/select-editor/pc-select-editor/index.js +0 -290
- package/lib/utils/cell-comparer.js +0 -35
- package/lib/utils/cell.js +0 -55
- package/lib/utils/column-utils.js +0 -25
- package/lib/utils/get-event-transfer.js +0 -75
- package/lib/utils/hotkey.js +0 -37
- package/lib/utils/object-utils.js +0 -61
- /package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.css +0 -0
- /package/lib/CollaboratorEditor/{pc-collaborator-editor → pc-collaborator-editor-popover}/index.css +0 -0
- /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.css +0 -0
- /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/value-display-utils.js +0 -0
- /package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.js +0 -0
- /package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.css +0 -0
|
@@ -7,46 +7,76 @@ 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 _TextFormatter = _interopRequireDefault(require("../TextFormatter"));
|
|
11
|
+
var _NumberFormatter = _interopRequireDefault(require("../NumberFormatter"));
|
|
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"));
|
|
10
35
|
var _constants = require("../constants");
|
|
11
|
-
var _constants2 = require("./constants");
|
|
12
36
|
require("./index.css");
|
|
13
|
-
class
|
|
37
|
+
class EditorFormatter extends _react.default.Component {
|
|
14
38
|
constructor(_props) {
|
|
15
39
|
super(_props);
|
|
16
40
|
this.updateCollaborators = () => {
|
|
17
|
-
const {
|
|
18
|
-
column
|
|
19
|
-
} = this.props;
|
|
20
|
-
if (![_constants.CellType.CREATOR, _constants.CellType.LAST_MODIFIER, _constants.CellType.COLLABORATOR].includes(column.type)) return;
|
|
21
|
-
const collaborators = this.getCollaborators();
|
|
22
41
|
this.setState({
|
|
23
|
-
collaborators
|
|
42
|
+
collaborators: this.getCollaborator()
|
|
24
43
|
});
|
|
25
44
|
};
|
|
26
45
|
this.calculateCollaboratorData = props => {
|
|
27
46
|
const {
|
|
28
47
|
row,
|
|
29
|
-
column
|
|
30
|
-
queryCollaborators
|
|
48
|
+
column
|
|
31
49
|
} = props;
|
|
32
50
|
if (column.type === _constants.CellType.CREATOR || column.type === _constants.CellType.LAST_MODIFIER) {
|
|
33
51
|
const email = row[column.name];
|
|
34
|
-
|
|
52
|
+
this.loadCollaborator(email);
|
|
35
53
|
} else if (column.type === _constants.CellType.COLLABORATOR) {
|
|
36
54
|
const emails = row[column.name];
|
|
37
55
|
if (Array.isArray(emails)) {
|
|
38
|
-
|
|
56
|
+
emails.forEach(email => {
|
|
57
|
+
this.loadCollaborator(email);
|
|
58
|
+
});
|
|
39
59
|
}
|
|
40
60
|
}
|
|
41
61
|
};
|
|
42
|
-
this.
|
|
62
|
+
this.getCollaborator = () => {
|
|
43
63
|
const {
|
|
44
|
-
|
|
64
|
+
context,
|
|
45
65
|
collaborators
|
|
46
66
|
} = this.props;
|
|
47
|
-
if (
|
|
67
|
+
if (context && context.getCollaboratorsFromCache) {
|
|
68
|
+
return context.getCollaboratorsFromCache();
|
|
69
|
+
}
|
|
48
70
|
return collaborators || [];
|
|
49
71
|
};
|
|
72
|
+
this.loadCollaborator = email => {
|
|
73
|
+
const {
|
|
74
|
+
context
|
|
75
|
+
} = this.props;
|
|
76
|
+
if (context && context.loadCollaborator) {
|
|
77
|
+
context.loadCollaborator(email);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
50
80
|
this.renderEmpty = () => {
|
|
51
81
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
52
82
|
className: "d-flex align-items-center form-control disabled h-auto"
|
|
@@ -56,7 +86,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
56
86
|
let {
|
|
57
87
|
column,
|
|
58
88
|
row,
|
|
59
|
-
|
|
89
|
+
className
|
|
60
90
|
} = this.props;
|
|
61
91
|
let {
|
|
62
92
|
type: columnType
|
|
@@ -64,15 +94,14 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
64
94
|
const {
|
|
65
95
|
collaborators
|
|
66
96
|
} = this.state;
|
|
67
|
-
const containerClassName = "dtable-
|
|
68
|
-
let cellValue = row[column[
|
|
69
|
-
const Formatter = this.component[columnType];
|
|
97
|
+
const containerClassName = "dtable-".concat(columnType, "-formatter ").concat(className || '');
|
|
98
|
+
let cellValue = row[column.key] !== null && row[column.key] !== undefined ? row[column.key] : row[column.name];
|
|
70
99
|
switch (columnType) {
|
|
71
100
|
case _constants.CellType.TEXT:
|
|
72
101
|
{
|
|
73
102
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
74
103
|
className: "form-control d-flex align-items-center w-100"
|
|
75
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
104
|
+
}, /*#__PURE__*/_react.default.createElement(_TextFormatter.default, {
|
|
76
105
|
value: cellValue,
|
|
77
106
|
containerClassName: containerClassName
|
|
78
107
|
}));
|
|
@@ -81,7 +110,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
81
110
|
{
|
|
82
111
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
83
112
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
84
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(_CollaboratorFormatter.default, {
|
|
85
114
|
value: cellValue,
|
|
86
115
|
collaborators: collaborators,
|
|
87
116
|
containerClassName: containerClassName
|
|
@@ -89,12 +118,10 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
89
118
|
}
|
|
90
119
|
case _constants.CellType.LONG_TEXT:
|
|
91
120
|
{
|
|
92
|
-
if (!cellValue) return
|
|
93
|
-
className: "form-control d-flex align-items-center w-100"
|
|
94
|
-
});
|
|
121
|
+
if (!cellValue) return null;
|
|
95
122
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
123
|
className: "longtext-formatter-container"
|
|
97
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
124
|
+
}, /*#__PURE__*/_react.default.createElement(_LongTextFormatter.default, {
|
|
98
125
|
value: cellValue,
|
|
99
126
|
containerClassName: containerClassName,
|
|
100
127
|
isSample: false
|
|
@@ -102,11 +129,10 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
102
129
|
}
|
|
103
130
|
case _constants.CellType.GEOLOCATION:
|
|
104
131
|
{
|
|
105
|
-
if (!cellValue) return null;
|
|
106
132
|
if (typeof cellValue !== 'object') return null;
|
|
107
133
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
108
|
-
className: "
|
|
109
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
134
|
+
className: "geolocation-formatter-container"
|
|
135
|
+
}, /*#__PURE__*/_react.default.createElement(_GeolocationFormatter.default, {
|
|
110
136
|
value: cellValue,
|
|
111
137
|
data: column.data,
|
|
112
138
|
containerClassName: containerClassName
|
|
@@ -119,7 +145,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
119
145
|
style: {
|
|
120
146
|
width: 320
|
|
121
147
|
}
|
|
122
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
148
|
+
}, /*#__PURE__*/_react.default.createElement(_NumberFormatter.default, {
|
|
123
149
|
value: cellValue,
|
|
124
150
|
data: column.data,
|
|
125
151
|
containerClassName: containerClassName
|
|
@@ -132,7 +158,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
132
158
|
style: {
|
|
133
159
|
width: 320
|
|
134
160
|
}
|
|
135
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement(_DateFormatter.default, {
|
|
136
162
|
value: cellValue,
|
|
137
163
|
format: column.data.format,
|
|
138
164
|
containerClassName: containerClassName
|
|
@@ -145,8 +171,8 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
145
171
|
style: {
|
|
146
172
|
width: 320
|
|
147
173
|
}
|
|
148
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
149
|
-
value:
|
|
174
|
+
}, /*#__PURE__*/_react.default.createElement(_CTimeFormatter.default, {
|
|
175
|
+
value: row._ctime,
|
|
150
176
|
containerClassName: containerClassName
|
|
151
177
|
}));
|
|
152
178
|
}
|
|
@@ -157,18 +183,17 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
157
183
|
style: {
|
|
158
184
|
width: 320
|
|
159
185
|
}
|
|
160
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
161
|
-
value:
|
|
186
|
+
}, /*#__PURE__*/_react.default.createElement(_MTimeFormatter.default, {
|
|
187
|
+
value: row._mtime,
|
|
162
188
|
containerClassName: containerClassName
|
|
163
189
|
}));
|
|
164
190
|
}
|
|
165
191
|
case _constants.CellType.MULTIPLE_SELECT:
|
|
166
192
|
{
|
|
167
|
-
|
|
168
|
-
const options = ((_column = column) === null || _column === void 0 ? void 0 : (_column$data = _column.data) === null || _column$data === void 0 ? void 0 : _column$data.options) || [];
|
|
193
|
+
const options = column.data ? column.data.options : [];
|
|
169
194
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
170
195
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
171
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
196
|
+
}, /*#__PURE__*/_react.default.createElement(_MultipleSelectFormatter.default, {
|
|
172
197
|
value: cellValue,
|
|
173
198
|
options: options,
|
|
174
199
|
containerClassName: containerClassName
|
|
@@ -176,11 +201,10 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
176
201
|
}
|
|
177
202
|
case _constants.CellType.SINGLE_SELECT:
|
|
178
203
|
{
|
|
179
|
-
|
|
180
|
-
const options = ((_column2 = column) === null || _column2 === void 0 ? void 0 : (_column2$data = _column2.data) === null || _column2$data === void 0 ? void 0 : _column2$data.options) || [];
|
|
204
|
+
const options = column.data ? column.data.options : [];
|
|
181
205
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
182
206
|
className: "form-control d-flex align-items-center w-100"
|
|
183
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
207
|
+
}, /*#__PURE__*/_react.default.createElement(_SingleSelectFormatter.default, {
|
|
184
208
|
value: cellValue,
|
|
185
209
|
options: options,
|
|
186
210
|
containerClassName: containerClassName
|
|
@@ -188,39 +212,44 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
188
212
|
}
|
|
189
213
|
case _constants.CellType.FILE:
|
|
190
214
|
{
|
|
191
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
215
|
+
return /*#__PURE__*/_react.default.createElement(_RowExpandFileFormatter.default, {
|
|
192
216
|
value: cellValue,
|
|
193
217
|
column: column,
|
|
194
218
|
downloadFile: this.props.downloadFile,
|
|
195
|
-
deleteFile: this.props.deleteFile
|
|
196
|
-
config: this.props.config
|
|
219
|
+
deleteFile: this.props.deleteFile
|
|
197
220
|
});
|
|
198
221
|
}
|
|
199
222
|
case _constants.CellType.IMAGE:
|
|
200
223
|
{
|
|
201
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
224
|
+
return /*#__PURE__*/_react.default.createElement(_RowExpandImageFormatter.default, {
|
|
202
225
|
value: cellValue,
|
|
203
226
|
column: column,
|
|
204
227
|
downloadImage: this.props.downloadImage,
|
|
205
228
|
deleteFile: this.props.deleteFile,
|
|
206
|
-
onRotateImage: this.props.onRotateImage
|
|
207
|
-
config: this.props.config
|
|
229
|
+
onRotateImage: this.props.onRotateImage
|
|
208
230
|
});
|
|
209
231
|
}
|
|
210
232
|
case _constants.CellType.CHECKBOX:
|
|
211
233
|
{
|
|
212
|
-
var _column$
|
|
234
|
+
var _column$data;
|
|
213
235
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
214
236
|
className: "checkbox-formatter-container"
|
|
215
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
237
|
+
}, /*#__PURE__*/_react.default.createElement(_CheckboxFormatter.default, {
|
|
216
238
|
value: cellValue,
|
|
217
|
-
checkboxStyle: ((_column$
|
|
239
|
+
checkboxStyle: ((_column$data = column.data) === null || _column$data === void 0 ? void 0 : _column$data.checkbox_style) || {}
|
|
218
240
|
}));
|
|
219
241
|
}
|
|
220
242
|
case _constants.CellType.CREATOR:
|
|
243
|
+
{
|
|
244
|
+
return /*#__PURE__*/_react.default.createElement(_CreatorFormatter.default, {
|
|
245
|
+
collaborators: collaborators,
|
|
246
|
+
value: cellValue,
|
|
247
|
+
containerClassName: containerClassName
|
|
248
|
+
});
|
|
249
|
+
}
|
|
221
250
|
case _constants.CellType.LAST_MODIFIER:
|
|
222
251
|
{
|
|
223
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
252
|
+
return /*#__PURE__*/_react.default.createElement(_LastModifierFormatter.default, {
|
|
224
253
|
collaborators: collaborators,
|
|
225
254
|
value: cellValue,
|
|
226
255
|
containerClassName: containerClassName
|
|
@@ -229,7 +258,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
229
258
|
case _constants.CellType.FORMULA:
|
|
230
259
|
case _constants.CellType.LINK_FORMULA:
|
|
231
260
|
{
|
|
232
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
261
|
+
return /*#__PURE__*/_react.default.createElement(_RowExpandFormulaFormatter.default, {
|
|
233
262
|
value: cellValue,
|
|
234
263
|
column: column,
|
|
235
264
|
collaborators: collaborators,
|
|
@@ -260,17 +289,17 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
260
289
|
}
|
|
261
290
|
};
|
|
262
291
|
}
|
|
263
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
292
|
+
return /*#__PURE__*/_react.default.createElement(_RowExpandLinkFormatter.default, {
|
|
264
293
|
value: cellValue,
|
|
265
294
|
column: column,
|
|
266
295
|
collaborators: collaborators,
|
|
267
296
|
containerClassName: containerClassName,
|
|
268
|
-
renderEmpty:
|
|
297
|
+
renderEmpty: this.renderEmpty
|
|
269
298
|
});
|
|
270
299
|
}
|
|
271
300
|
case _constants.CellType.AUTO_NUMBER:
|
|
272
301
|
{
|
|
273
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
302
|
+
return /*#__PURE__*/_react.default.createElement(_AutoNumberFormatter.default, {
|
|
274
303
|
value: cellValue,
|
|
275
304
|
containerClassName: containerClassName
|
|
276
305
|
});
|
|
@@ -279,7 +308,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
279
308
|
{
|
|
280
309
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
281
310
|
className: "form-control d-flex align-items-center w-100"
|
|
282
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
311
|
+
}, /*#__PURE__*/_react.default.createElement(_RowExpandUrlFormatter.default, {
|
|
283
312
|
value: cellValue,
|
|
284
313
|
containerClassName: containerClassName
|
|
285
314
|
}));
|
|
@@ -288,7 +317,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
288
317
|
{
|
|
289
318
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
290
319
|
className: "form-control d-flex align-items-center w-100"
|
|
291
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
320
|
+
}, /*#__PURE__*/_react.default.createElement(_RowExpandEmailFormatter.default, {
|
|
292
321
|
value: cellValue,
|
|
293
322
|
containerClassName: containerClassName
|
|
294
323
|
}));
|
|
@@ -300,7 +329,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
300
329
|
style: {
|
|
301
330
|
width: 320
|
|
302
331
|
}
|
|
303
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
332
|
+
}, /*#__PURE__*/_react.default.createElement(_DurationFormatter.default, {
|
|
304
333
|
value: cellValue,
|
|
305
334
|
format: column.data.duration_format,
|
|
306
335
|
containerClassName: containerClassName
|
|
@@ -313,7 +342,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
313
342
|
style: {
|
|
314
343
|
width: 320
|
|
315
344
|
}
|
|
316
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
345
|
+
}, /*#__PURE__*/_react.default.createElement(_RowExpandRateFormatter.default, {
|
|
317
346
|
value: cellValue,
|
|
318
347
|
data: column.data,
|
|
319
348
|
containerClassName: containerClassName
|
|
@@ -321,7 +350,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
321
350
|
}
|
|
322
351
|
case _constants.CellType.BUTTON:
|
|
323
352
|
{
|
|
324
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
353
|
+
return /*#__PURE__*/_react.default.createElement(_ButtonFormatter.default, {
|
|
325
354
|
data: column.data,
|
|
326
355
|
containerClassName: containerClassName,
|
|
327
356
|
onClickButton: this.props.onClickButton
|
|
@@ -329,7 +358,7 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
329
358
|
}
|
|
330
359
|
case _constants.CellType.DIGITAL_SIGN:
|
|
331
360
|
{
|
|
332
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
361
|
+
return /*#__PURE__*/_react.default.createElement(_DigitalSignFormatter.default, {
|
|
333
362
|
value: cellValue,
|
|
334
363
|
containerClassName: containerClassName,
|
|
335
364
|
config: this.props.config
|
|
@@ -337,37 +366,23 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
337
366
|
}
|
|
338
367
|
case _constants.CellType.DEPARTMENT_SINGLE_SELECT:
|
|
339
368
|
{
|
|
340
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
369
|
+
return /*#__PURE__*/_react.default.createElement(_DepartmentSingleSelectFormatter.default, {
|
|
341
370
|
value: cellValue,
|
|
342
371
|
departments: this.props.departments
|
|
343
372
|
});
|
|
344
373
|
}
|
|
345
374
|
default:
|
|
346
|
-
|
|
347
|
-
if (Formatter) {
|
|
348
|
-
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
349
|
-
value: cellValue,
|
|
350
|
-
containerClassName: containerClassName,
|
|
351
|
-
config: this.props.config
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
return null;
|
|
355
|
-
}
|
|
375
|
+
return null;
|
|
356
376
|
}
|
|
357
377
|
};
|
|
358
378
|
this.state = {
|
|
359
|
-
collaborators: this.
|
|
360
|
-
};
|
|
361
|
-
this.component = {
|
|
362
|
-
..._constants2.DEFAULT_FORMATTER,
|
|
363
|
-
...this.props.component
|
|
379
|
+
collaborators: this.getCollaborator()
|
|
364
380
|
};
|
|
365
381
|
}
|
|
366
382
|
componentDidMount() {
|
|
367
383
|
this.calculateCollaboratorData(this.props);
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
this.unsubscribeCollaboratorsUpdated = eventBus.subscribe('collaborators-updated', this.updateCollaborators);
|
|
384
|
+
if (this.props.eventBus) {
|
|
385
|
+
this.unsubscribeCollaboratorsUpdated = this.props.eventBus.subscribe('collaborators-updated', this.updateCollaborators);
|
|
371
386
|
}
|
|
372
387
|
}
|
|
373
388
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
@@ -383,11 +398,13 @@ class RowExpandFormatter extends _react.default.Component {
|
|
|
383
398
|
className
|
|
384
399
|
} = this.props;
|
|
385
400
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
386
|
-
className: (0, _classnames.default)('dtable-ui dtable-row-expand-formatter',
|
|
401
|
+
className: (0, _classnames.default)('dtable-ui dtable-row-expand-formatter', {
|
|
402
|
+
[className]: className
|
|
403
|
+
})
|
|
387
404
|
}, this.renderFormatter());
|
|
388
405
|
}
|
|
389
406
|
}
|
|
390
|
-
|
|
407
|
+
exports.default = EditorFormatter;
|
|
408
|
+
EditorFormatter.defaultProps = {
|
|
391
409
|
className: ''
|
|
392
|
-
};
|
|
393
|
-
var _default = exports.default = RowExpandFormatter;
|
|
410
|
+
};
|
package/lib/{RowExpandFormatter/RowExpandFormulaFormatter → RowExpandFormulaFormatter}/index.js
RENAMED
|
@@ -8,14 +8,13 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _dtableUtils = require("dtable-utils");
|
|
11
|
-
var _baseFormatterConfig = _interopRequireDefault(require("
|
|
12
|
-
var _TextFormatter = _interopRequireDefault(require("
|
|
13
|
-
var _utils = require("
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
require("../../FormulaFormatter/index.css");
|
|
11
|
+
var _baseFormatterConfig = _interopRequireDefault(require("../formatterConfig/base-formatter-config"));
|
|
12
|
+
var _TextFormatter = _interopRequireDefault(require("../TextFormatter"));
|
|
13
|
+
var _utils = require("../FormulaFormatter/utils");
|
|
14
|
+
var _cellValueValidator = _interopRequireDefault(require("../FormulaFormatter/cell-value-validator"));
|
|
15
|
+
var _toaster = _interopRequireDefault(require("../toaster"));
|
|
16
|
+
var _lang = require("../lang");
|
|
17
|
+
require("../FormulaFormatter/index.css");
|
|
19
18
|
class RowExpandFormulaFormatter extends _react.default.Component {
|
|
20
19
|
constructor() {
|
|
21
20
|
super(...arguments);
|
|
@@ -33,11 +32,11 @@ class RowExpandFormulaFormatter extends _react.default.Component {
|
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
34
|
this.onOpenUrlLink = url => {
|
|
36
|
-
if (!(0,
|
|
35
|
+
if (!(0, _utils.isValidUrl)(url)) {
|
|
37
36
|
url = "http://".concat(url);
|
|
38
37
|
}
|
|
39
38
|
try {
|
|
40
|
-
(0,
|
|
39
|
+
(0, _utils.openUrlLink)(url);
|
|
41
40
|
} catch {
|
|
42
41
|
_toaster.default.danger((0, _lang.getLocale)('URL_is_invalid'));
|
|
43
42
|
}
|
|
@@ -180,7 +179,7 @@ class RowExpandFormulaFormatter extends _react.default.Component {
|
|
|
180
179
|
return /*#__PURE__*/_react.default.cloneElement(Formatter, {
|
|
181
180
|
...formatterProps
|
|
182
181
|
});
|
|
183
|
-
} else if ((0,
|
|
182
|
+
} else if ((0, _utils.isFunction)(Formatter)) {
|
|
184
183
|
return /*#__PURE__*/_react.default.createElement(Formatter, formatterProps);
|
|
185
184
|
} else {
|
|
186
185
|
return /*#__PURE__*/_react.default.createElement(_TextFormatter.default, formatterProps);
|
package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.css
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import url('
|
|
1
|
+
@import url('../css/cell-formatter.css');
|
|
2
2
|
|
|
3
3
|
.dtable-ui.row-expand-image-formatter {
|
|
4
4
|
display: flex;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
border-color: #c9c9c9;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.dtable-ui.row-expand-image-formatter .row-expand-item-image .dtable-
|
|
31
|
+
.dtable-ui.row-expand-image-formatter .row-expand-item-image .dtable-image-icons-choice {
|
|
32
32
|
height: 20px;
|
|
33
33
|
width: 100%;
|
|
34
34
|
top: 0;
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
align-items: center;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.dtable-ui.row-expand-image-formatter .row-expand-item-image:hover .dtable-
|
|
43
|
+
.dtable-ui.row-expand-image-formatter .row-expand-item-image:hover .dtable-image-icons-choice {
|
|
44
44
|
display: flex;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.dtable-ui.row-expand-image-formatter .row-expand-item-image .dtable-
|
|
47
|
+
.dtable-ui.row-expand-image-formatter .row-expand-item-image .dtable-image-icons-choice .image-icon {
|
|
48
48
|
height: 16px;
|
|
49
49
|
width: 16px;
|
|
50
50
|
border-radius: 50%;
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
align-items: center;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.dtable-ui.row-expand-image-formatter .row-expand-item-image .dtable-
|
|
59
|
+
.dtable-ui.row-expand-image-formatter .row-expand-item-image .dtable-image-icons-choice .image-icon:nth-child(2) {
|
|
60
60
|
margin-left: 5px;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.dtable-ui.row-expand-image-formatter .row-expand-item-image .dtable-
|
|
63
|
+
.dtable-ui.row-expand-image-formatter .row-expand-item-image .dtable-image-icons-choice .image-icon .dtable-font {
|
|
64
64
|
font-size: 12px;
|
|
65
65
|
transform: scale(.7);
|
|
66
66
|
}
|
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _rowExpandImageItemFormatter = _interopRequireDefault(require("./row-expand-image-item-formatter"));
|
|
12
|
-
var _ImagePreviewerLightbox = _interopRequireDefault(require("
|
|
12
|
+
var _ImagePreviewerLightbox = _interopRequireDefault(require("../ImagePreviewerLightbox"));
|
|
13
13
|
require("./index.css");
|
|
14
14
|
class RowExpandImageFormatter extends _react.default.Component {
|
|
15
15
|
constructor(props) {
|
|
@@ -9,8 +9,8 @@ exports.default = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactstrap = require("reactstrap");
|
|
11
11
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
12
|
-
var _lang = require("
|
|
13
|
-
var _deleteTip = _interopRequireDefault(require("
|
|
12
|
+
var _lang = require("../lang");
|
|
13
|
+
var _deleteTip = _interopRequireDefault(require("../common/delete-tip"));
|
|
14
14
|
class RowExpandImageItemFormatter extends _react.Component {
|
|
15
15
|
constructor(props) {
|
|
16
16
|
super(props);
|
|
@@ -74,7 +74,7 @@ class RowExpandImageItemFormatter extends _react.Component {
|
|
|
74
74
|
id: "item-image-".concat(index),
|
|
75
75
|
alt: name
|
|
76
76
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
-
className: "dtable-
|
|
77
|
+
className: "dtable-image-icons-choice"
|
|
78
78
|
}, downloadFile && /*#__PURE__*/_react.default.createElement("span", {
|
|
79
79
|
className: "image-icon",
|
|
80
80
|
onClick: this.onClickDownload
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _dtableUtils = require("dtable-utils");
|
|
11
|
-
var _CollaboratorItem = _interopRequireDefault(require("
|
|
11
|
+
var _CollaboratorItem = _interopRequireDefault(require("../CollaboratorItem"));
|
|
12
12
|
class CollaboratorItemFormatter extends _react.Component {
|
|
13
13
|
constructor(_props) {
|
|
14
14
|
super(_props);
|
|
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _constants = require("
|
|
11
|
-
var _MultipleSelectFormatter = _interopRequireDefault(require("
|
|
12
|
-
var _CTimeFormatter = _interopRequireDefault(require("
|
|
13
|
-
var _MTimeFormatter = _interopRequireDefault(require("
|
|
14
|
-
var _DateFormatter = _interopRequireDefault(require("
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
var _MultipleSelectFormatter = _interopRequireDefault(require("../MultipleSelectFormatter"));
|
|
12
|
+
var _CTimeFormatter = _interopRequireDefault(require("../CTimeFormatter"));
|
|
13
|
+
var _MTimeFormatter = _interopRequireDefault(require("../MTimeFormatter"));
|
|
14
|
+
var _DateFormatter = _interopRequireDefault(require("../DateFormatter"));
|
|
15
15
|
var _collaboratorItemFormatter = _interopRequireDefault(require("./collaborator-item-formatter"));
|
|
16
|
-
var _utils = require("
|
|
16
|
+
var _utils = require("./utils");
|
|
17
17
|
var _valueDisplayUtils = require("./value-display-utils");
|
|
18
18
|
require("./index.css");
|
|
19
19
|
class RowExpandLinkFormatter extends _react.Component {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTwoDimensionArrayValue = exports.getFormulaArrayValue = void 0;
|
|
7
|
+
exports.isArrayFormatColumn = isArrayFormatColumn;
|
|
8
|
+
exports.isValidCellValue = void 0;
|
|
9
|
+
var _constants = require("../constants");
|
|
10
|
+
const isValidCellValue = value => {
|
|
11
|
+
if (value === undefined) return false;
|
|
12
|
+
if (value === null) return false;
|
|
13
|
+
if (value === '') return false;
|
|
14
|
+
if (JSON.stringify(value) === '{}') return false;
|
|
15
|
+
if (JSON.stringify(value) === '[]') return false;
|
|
16
|
+
return true;
|
|
17
|
+
};
|
|
18
|
+
exports.isValidCellValue = isValidCellValue;
|
|
19
|
+
const getFormulaArrayValue = function (value) {
|
|
20
|
+
let isFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
21
|
+
if (!Array.isArray(value)) return [];
|
|
22
|
+
if (!isFlat) return getTwoDimensionArrayValue(value);
|
|
23
|
+
return value.map(item => {
|
|
24
|
+
if (Object.prototype.toString.call(item) !== '[object Object]') {
|
|
25
|
+
return item;
|
|
26
|
+
}
|
|
27
|
+
if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
|
|
28
|
+
const {
|
|
29
|
+
display_value
|
|
30
|
+
} = item;
|
|
31
|
+
if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
|
|
32
|
+
return display_value.map(i => {
|
|
33
|
+
if (Object.prototype.toString.call(i) === '[object Object]') {
|
|
34
|
+
if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
|
|
35
|
+
const {
|
|
36
|
+
display_value
|
|
37
|
+
} = i;
|
|
38
|
+
return display_value;
|
|
39
|
+
}
|
|
40
|
+
return i;
|
|
41
|
+
});
|
|
42
|
+
}).flat().filter(item => isValidCellValue(item));
|
|
43
|
+
};
|
|
44
|
+
exports.getFormulaArrayValue = getFormulaArrayValue;
|
|
45
|
+
const getTwoDimensionArrayValue = value => {
|
|
46
|
+
if (!Array.isArray(value)) return [];
|
|
47
|
+
return value.map(item => {
|
|
48
|
+
if (Object.prototype.toString.call(item) !== '[object Object]') {
|
|
49
|
+
return item;
|
|
50
|
+
}
|
|
51
|
+
if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
|
|
52
|
+
const {
|
|
53
|
+
display_value
|
|
54
|
+
} = item;
|
|
55
|
+
if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
|
|
56
|
+
return display_value.map(i => {
|
|
57
|
+
if (Object.prototype.toString.call(i) === '[object Object]') {
|
|
58
|
+
if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
|
|
59
|
+
const {
|
|
60
|
+
display_value
|
|
61
|
+
} = i;
|
|
62
|
+
return display_value;
|
|
63
|
+
}
|
|
64
|
+
return i;
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
exports.getTwoDimensionArrayValue = getTwoDimensionArrayValue;
|
|
69
|
+
function isArrayFormatColumn(columnType) {
|
|
70
|
+
return [_constants.CellType.IMAGE, _constants.CellType.FILE, _constants.CellType.MULTIPLE_SELECT, _constants.CellType.COLLABORATOR].includes(columnType);
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url('../css/cell-formatter.css');
|