dtable-ui-component 4.4.3-2 → 4.4.3-alpha1
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/AutoNumberFormatter/index.js +7 -14
- package/lib/ButtonFormatter/index.js +9 -16
- package/lib/CTimeFormatter/index.js +9 -16
- package/lib/CheckboxEditor/index.js +8 -15
- package/lib/CheckboxFormatter/index.js +8 -15
- package/lib/CollaboratorEditor/index.js +21 -29
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +25 -32
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +18 -25
- package/lib/CollaboratorFormatter/index.js +12 -19
- package/lib/CollaboratorItem/index.js +10 -17
- package/lib/CreatorFormatter/index.js +12 -19
- package/lib/DTableCommonAddTool/index.js +6 -13
- package/lib/DTableCustomizeCollaboratorSelect/index.js +18 -26
- package/lib/DTableCustomizeSelect/index.js +15 -23
- package/lib/DTableFiltersPopover/constants/index.js +33 -38
- package/lib/DTableFiltersPopover/index.js +31 -38
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +46 -53
- package/lib/DTableFiltersPopover/utils/index.js +99 -128
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +26 -34
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +25 -33
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +26 -34
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +26 -34
- package/lib/DTableFiltersPopover/widgets/filter-item.js +120 -128
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +18 -26
- package/lib/DTableFiltersPopover/widgets/rate-item.js +8 -15
- package/lib/DTablePopover/index.js +8 -15
- package/lib/DTablePopover/utils.js +2 -9
- package/lib/DTableRadio/index.js +10 -17
- package/lib/DTableSearchInput/index.js +13 -21
- package/lib/DTableSearchInput/utils.js +2 -9
- package/lib/DTableSelect/dtable-select-label.js +6 -13
- package/lib/DTableSelect/index.js +10 -18
- package/lib/DTableSelect/utils.js +10 -20
- package/lib/DTableSwitch/index.js +7 -14
- package/lib/DateEditor/index.js +22 -30
- package/lib/DateEditor/mb-date-editor-popover/index.js +47 -55
- package/lib/DateEditor/pc-date-editor-popover.js +20 -27
- package/lib/DateFormatter/index.js +9 -16
- package/lib/Department-editor/constants.js +1 -7
- package/lib/Department-editor/department-multiple-select/index.js +24 -32
- package/lib/Department-editor/department-single-select.js +33 -41
- package/lib/Department-editor/index.js +14 -22
- package/lib/Department-editor/selected-departments/index.js +25 -32
- package/lib/Department-editor/utils.js +3 -11
- package/lib/DepartmentSingleSelectFormatter/index.js +9 -16
- package/lib/DigitalSignFormatter/index.js +15 -23
- package/lib/DigitalSignFormatter/utils.js +3 -11
- package/lib/DurationFormatter/index.js +9 -16
- package/lib/EditEditorButton/index.js +5 -12
- package/lib/EmailFormatter/index.js +7 -14
- package/lib/FieldDisplaySetting/field-item.js +14 -21
- package/lib/FieldDisplaySetting/index.js +19 -27
- package/lib/FileEditor/index.js +8 -15
- 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/FileFormatter/index.js +11 -19
- package/lib/FileItemFormatter/index.js +6 -14
- package/lib/FileItemFormatter/utils.js +2 -9
- package/lib/FileUploader/index.js +4 -11
- package/lib/FormulaFormatter/cell-value-validator.js +18 -24
- package/lib/FormulaFormatter/index.js +32 -39
- package/lib/FormulaFormatter/utils.js +13 -29
- package/lib/GeolocationFormatter/index.js +9 -16
- package/lib/HtmlLongTextFormatter/index.js +9 -17
- package/lib/HtmlLongTextFormatter/markdown2html.js +47 -0
- package/lib/HtmlLongTextFormatter/unified/index.js +400 -0
- package/lib/HtmlLongTextFormatter/vfile/core.js +155 -0
- package/lib/HtmlLongTextFormatter/vfile/index.js +40 -0
- package/lib/ImageFormatter/images-lazy-load.js +9 -16
- package/lib/ImageFormatter/index.js +16 -24
- package/lib/ImageFormatter/utils.js +2 -9
- package/lib/ImagePreviewerLightbox/index.js +12 -19
- package/lib/ImagePreviewerLightbox/utils.js +3 -11
- package/lib/LastModifierFormatter/index.js +12 -19
- package/lib/LinkEditor/index.js +25 -33
- package/lib/LinkEditor/link-editor-option.js +8 -15
- package/lib/LinkEditor/mb-link-editor-popover/index.js +23 -30
- package/lib/LinkEditor/pc-link-editor-popover/index.js +17 -24
- package/lib/LinkFormatter/index.js +13 -20
- package/lib/Loading/index.js +4 -11
- package/lib/LongTextFormatter/index.js +6 -13
- package/lib/MBEditorHeader/index.js +7 -14
- package/lib/MTimeFormatter/index.js +9 -16
- package/lib/ModalPortal/index.js +5 -12
- package/lib/MultipleSelectEditor/index.js +17 -25
- package/lib/MultipleSelectFormatter/index.js +10 -17
- package/lib/NotificationPopover/index.js +16 -24
- package/lib/NumberEditor/index.js +18 -25
- package/lib/NumberFormatter/index.js +9 -16
- package/lib/RateFormatter/index.js +8 -15
- package/lib/RoleStatusEditor/index.js +14 -22
- package/lib/RowExpandEmailFormatter/index.js +10 -17
- package/lib/RowExpandFileFormatter/index.js +8 -16
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +18 -27
- package/lib/RowExpandFormatter/index.js +78 -86
- package/lib/RowExpandFormulaFormatter/index.js +34 -42
- package/lib/RowExpandImageFormatter/index.js +10 -19
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +18 -27
- package/lib/RowExpandImageFormatter/utils.js +2 -9
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +7 -16
- package/lib/RowExpandLinkFormatter/index.js +37 -46
- package/lib/RowExpandLinkFormatter/utils.js +6 -17
- package/lib/RowExpandLinkFormatter/value-display-utils.js +5 -12
- package/lib/RowExpandRateFormatter/index.js +8 -15
- package/lib/RowExpandUrlFormatter/index.js +14 -21
- package/lib/SelectItem/index.js +4 -12
- package/lib/SelectOptionGroup/KeyCodes.js +1 -7
- package/lib/SelectOptionGroup/index.js +33 -32
- package/lib/SelectOptionGroup/option.js +4 -19
- package/lib/SimpleLongTextFormatter/index.js +20 -27
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +1 -7
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +8 -15
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +7 -14
- package/lib/SingleSelectEditor/index.js +18 -26
- package/lib/SingleSelectFormatter/index.js +9 -16
- package/lib/TextEditor/index.js +7 -14
- package/lib/TextFormatter/index.js +7 -14
- package/lib/UrlFormatter/index.js +7 -14
- package/lib/cellFormatterFactory/index.js +4 -11
- package/lib/common/ClickOutside.js +4 -12
- package/lib/common/delete-tip.js +12 -20
- package/lib/common/modal-portal.js +5 -13
- package/lib/constants/index.js +9 -28
- package/lib/data/dtable-value.js +6 -11
- package/lib/formatterConfig/base-formatter-config.js +46 -53
- package/lib/formatterConfig/index.js +9 -16
- package/lib/hooks/common-hooks.js +4 -11
- package/lib/index.js +75 -432
- package/lib/lang/index.js +13 -24
- package/lib/locals/de.js +1 -7
- package/lib/locals/en.js +1 -7
- package/lib/locals/fr.js +1 -7
- package/lib/locals/zh-CN.js +1 -7
- package/lib/select-editor/index.js +4 -27
- package/lib/select-editor/mb-select-editor-popover/index.js +33 -41
- package/lib/select-editor/pc-select-editor-popover/index.js +19 -26
- package/lib/select-editor/select-editor-option.js +8 -15
- package/lib/toaster/alert.js +11 -18
- package/lib/toaster/index.js +3 -10
- package/lib/toaster/toast.js +8 -16
- package/lib/toaster/toastManager.js +5 -13
- package/lib/toaster/toaster.js +7 -15
- package/lib/utils/dayjs.js +4 -11
- package/lib/utils/editor-utils.js +5 -15
- package/lib/utils/event-bus.js +1 -7
- package/lib/utils/utils.js +6 -17
- package/package.json +77 -63
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _editorUtils = require("../utils/editor-utils");
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class RowExpandEmailFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { getTrimmedString } from '../utils/editor-utils';
|
|
4
|
+
import './index.css';
|
|
5
|
+
class RowExpandEmailFormatter extends React.Component {
|
|
13
6
|
constructor() {
|
|
14
7
|
super(...arguments);
|
|
15
8
|
this.onOpenEmailLink = () => {
|
|
@@ -25,15 +18,15 @@ class RowExpandEmailFormatter extends _react.default.Component {
|
|
|
25
18
|
containerClassName,
|
|
26
19
|
value
|
|
27
20
|
} = this.props;
|
|
28
|
-
let classname = (
|
|
29
|
-
return /*#__PURE__*/
|
|
21
|
+
let classname = classnames('dtable-ui cell-formatter-container email-formatter', containerClassName);
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
23
|
className: classname
|
|
31
|
-
}, /*#__PURE__*/
|
|
24
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
32
25
|
className: "email-formatter-value text-truncate"
|
|
33
|
-
}, value),
|
|
26
|
+
}, value), getTrimmedString(value) && /*#__PURE__*/React.createElement("span", {
|
|
34
27
|
className: "dtable-font dtable-icon-email row-expand-jump-link",
|
|
35
28
|
onClick: this.onOpenEmailLink
|
|
36
29
|
}));
|
|
37
30
|
}
|
|
38
31
|
}
|
|
39
|
-
|
|
32
|
+
export default RowExpandEmailFormatter;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _rowExpandFileItemFormatter = _interopRequireDefault(require("./row-expand-file-item-formatter"));
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class RowExpandFileFormatter extends _react.default.PureComponent {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classname from 'classnames';
|
|
3
|
+
import RowExpandFileItemFormatter from './row-expand-file-item-formatter';
|
|
4
|
+
import './index.css';
|
|
5
|
+
export default class RowExpandFileFormatter extends React.PureComponent {
|
|
13
6
|
render() {
|
|
14
7
|
let {
|
|
15
8
|
value,
|
|
@@ -22,10 +15,10 @@ class RowExpandFileFormatter extends _react.default.PureComponent {
|
|
|
22
15
|
if (!Array.isArray(value) || value.length === 0) {
|
|
23
16
|
return null;
|
|
24
17
|
}
|
|
25
|
-
return /*#__PURE__*/
|
|
26
|
-
className: (
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: classname('dtable-ui cell-formatter-container row-expand-file-formatter', containerClassName)
|
|
27
20
|
}, value.map((item, index) => {
|
|
28
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/React.createElement(RowExpandFileItemFormatter, {
|
|
29
22
|
file: item,
|
|
30
23
|
key: index,
|
|
31
24
|
index: index,
|
|
@@ -37,7 +30,6 @@ class RowExpandFileFormatter extends _react.default.PureComponent {
|
|
|
37
30
|
}));
|
|
38
31
|
}
|
|
39
32
|
}
|
|
40
|
-
exports.default = RowExpandFileFormatter;
|
|
41
33
|
RowExpandFileFormatter.defaultProps = {
|
|
42
34
|
value: [],
|
|
43
35
|
containerClassName: ''
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _lang = require("../lang");
|
|
12
|
-
var _utils = require("../FileItemFormatter/utils");
|
|
13
|
-
var _deleteTip = _interopRequireDefault(require("../common/delete-tip"));
|
|
14
|
-
class RowExpandFileItemFormatter extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { Tooltip } from 'reactstrap';
|
|
3
|
+
import { getLocale } from '../lang';
|
|
4
|
+
import { getFileIconUrl } from '../FileItemFormatter/utils';
|
|
5
|
+
import DeleteTip from '../common/delete-tip';
|
|
6
|
+
export default class RowExpandFileItemFormatter extends Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.toggleTooltip = () => {
|
|
@@ -40,7 +32,7 @@ class RowExpandFileItemFormatter extends _react.Component {
|
|
|
40
32
|
this.props.deleteFile(this.props.index);
|
|
41
33
|
};
|
|
42
34
|
this.getFileIconData = item => {
|
|
43
|
-
let fileIconUrl =
|
|
35
|
+
let fileIconUrl = getFileIconUrl(item.name, item.type);
|
|
44
36
|
return require('../FileItemFormatter/' + fileIconUrl);
|
|
45
37
|
};
|
|
46
38
|
this.state = {
|
|
@@ -59,32 +51,32 @@ class RowExpandFileItemFormatter extends _react.Component {
|
|
|
59
51
|
} = this.props;
|
|
60
52
|
const id = 'file-list-preview-item' + column.key + index;
|
|
61
53
|
const url = this.getFileIconData(file);
|
|
62
|
-
return /*#__PURE__*/
|
|
54
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
63
55
|
key: "file-".concat(index),
|
|
64
56
|
className: "row-expand-item-file",
|
|
65
57
|
id: id
|
|
66
|
-
}, /*#__PURE__*/
|
|
58
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
67
59
|
src: url,
|
|
68
60
|
id: "item-file-".concat(index),
|
|
69
61
|
alt: file.name
|
|
70
|
-
}), /*#__PURE__*/
|
|
62
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
71
63
|
className: "dtable-file-icons-choice"
|
|
72
|
-
}, downloadFile && /*#__PURE__*/
|
|
64
|
+
}, downloadFile && /*#__PURE__*/React.createElement("span", {
|
|
73
65
|
className: "file-icon",
|
|
74
66
|
onClick: e => this.props.downloadFile(file, e)
|
|
75
|
-
}, /*#__PURE__*/
|
|
67
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
76
68
|
className: "dtable-font dtable-icon-download"
|
|
77
|
-
})), !readOnly && deleteFile && /*#__PURE__*/
|
|
69
|
+
})), !readOnly && deleteFile && /*#__PURE__*/React.createElement("span", {
|
|
78
70
|
className: "file-icon",
|
|
79
71
|
onClick: this.onClickDelete
|
|
80
|
-
}, /*#__PURE__*/
|
|
72
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
81
73
|
className: "dtable-font dtable-icon-fork-number"
|
|
82
|
-
})))), this.state.isDeleteTipOpen && /*#__PURE__*/
|
|
74
|
+
})))), this.state.isDeleteTipOpen && /*#__PURE__*/React.createElement(DeleteTip, {
|
|
83
75
|
position: this.position,
|
|
84
76
|
toggle: this.closeDeleteTip,
|
|
85
77
|
onDelete: this.onDelete,
|
|
86
|
-
deleteTip:
|
|
87
|
-
}), /*#__PURE__*/
|
|
78
|
+
deleteTip: getLocale('Are_you_sure_you_want_to_delete_this_file')
|
|
79
|
+
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
88
80
|
placement: "bottom",
|
|
89
81
|
isOpen: this.state.isTooltipOpen,
|
|
90
82
|
toggle: this.toggleTooltip,
|
|
@@ -96,5 +88,4 @@ class RowExpandFileItemFormatter extends _react.Component {
|
|
|
96
88
|
fade: false
|
|
97
89
|
}, file.name));
|
|
98
90
|
}
|
|
99
|
-
}
|
|
100
|
-
exports.default = RowExpandFileItemFormatter;
|
|
91
|
+
}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _index = require("../index");
|
|
11
|
-
var _constants = require("../constants");
|
|
12
|
-
require("./index.css");
|
|
13
|
-
class EditorFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { TextFormatter, NumberFormatter, CheckboxFormatter, DateFormatter, SingleSelectFormatter, MultipleSelectFormatter, CollaboratorFormatter, LongTextFormatter, GeolocationFormatter, CTimeFormatter, CreatorFormatter, LastModifierFormatter, MTimeFormatter, AutoNumberFormatter, DurationFormatter, ButtonFormatter, RowExpandUrlFormatter, RowExpandEmailFormatter, RowExpandRateFormatter, RowExpandImageFormatter, RowExpandFileFormatter, RowExpandLinkFormatter, RowExpandFormulaFormatter, DigitalSignFormatter, DepartmentSingleSelectFormatter } from '../index';
|
|
4
|
+
import { CellType } from '../constants';
|
|
5
|
+
import './index.css';
|
|
6
|
+
export default class EditorFormatter extends React.Component {
|
|
14
7
|
constructor(_props) {
|
|
15
8
|
super(_props);
|
|
16
9
|
this.updateCollaborators = () => {
|
|
@@ -23,10 +16,10 @@ class EditorFormatter extends _react.default.Component {
|
|
|
23
16
|
row,
|
|
24
17
|
column
|
|
25
18
|
} = props;
|
|
26
|
-
if (column.type ===
|
|
19
|
+
if (column.type === CellType.CREATOR || column.type === CellType.LAST_MODIFIER) {
|
|
27
20
|
const email = row[column.name];
|
|
28
21
|
this.loadCollaborator(email);
|
|
29
|
-
} else if (column.type ===
|
|
22
|
+
} else if (column.type === CellType.COLLABORATOR) {
|
|
30
23
|
const emails = row[column.name];
|
|
31
24
|
if (Array.isArray(emails)) {
|
|
32
25
|
emails.forEach(email => {
|
|
@@ -54,7 +47,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
54
47
|
}
|
|
55
48
|
};
|
|
56
49
|
this.renderEmpty = () => {
|
|
57
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
58
51
|
className: "d-flex align-items-center form-control disabled h-auto"
|
|
59
52
|
});
|
|
60
53
|
};
|
|
@@ -73,131 +66,131 @@ class EditorFormatter extends _react.default.Component {
|
|
|
73
66
|
const containerClassName = "dtable-".concat(columnType, "-formatter ").concat(className || '');
|
|
74
67
|
let cellValue = row[column.key] || row[column.name];
|
|
75
68
|
switch (columnType) {
|
|
76
|
-
case
|
|
69
|
+
case CellType.TEXT:
|
|
77
70
|
{
|
|
78
|
-
return /*#__PURE__*/
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
79
72
|
className: "form-control d-flex align-items-center w-100"
|
|
80
|
-
}, /*#__PURE__*/
|
|
73
|
+
}, /*#__PURE__*/React.createElement(TextFormatter, {
|
|
81
74
|
value: cellValue,
|
|
82
75
|
containerClassName: containerClassName
|
|
83
76
|
}));
|
|
84
77
|
}
|
|
85
|
-
case
|
|
78
|
+
case CellType.COLLABORATOR:
|
|
86
79
|
{
|
|
87
|
-
return /*#__PURE__*/
|
|
80
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
88
81
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
89
|
-
}, /*#__PURE__*/
|
|
82
|
+
}, /*#__PURE__*/React.createElement(CollaboratorFormatter, {
|
|
90
83
|
value: cellValue,
|
|
91
84
|
collaborators: collaborators,
|
|
92
85
|
containerClassName: containerClassName
|
|
93
86
|
}));
|
|
94
87
|
}
|
|
95
|
-
case
|
|
88
|
+
case CellType.LONG_TEXT:
|
|
96
89
|
{
|
|
97
90
|
if (!cellValue) return null;
|
|
98
|
-
return /*#__PURE__*/
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
99
92
|
className: "longtext-formatter-container"
|
|
100
|
-
}, /*#__PURE__*/
|
|
93
|
+
}, /*#__PURE__*/React.createElement(LongTextFormatter, {
|
|
101
94
|
value: cellValue,
|
|
102
95
|
containerClassName: containerClassName,
|
|
103
96
|
isSample: false
|
|
104
97
|
}));
|
|
105
98
|
}
|
|
106
|
-
case
|
|
99
|
+
case CellType.GEOLOCATION:
|
|
107
100
|
{
|
|
108
101
|
if (typeof cellValue !== 'object') return null;
|
|
109
|
-
return /*#__PURE__*/
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
103
|
className: "geolocation-formatter-container"
|
|
111
|
-
}, /*#__PURE__*/
|
|
104
|
+
}, /*#__PURE__*/React.createElement(GeolocationFormatter, {
|
|
112
105
|
value: cellValue,
|
|
113
106
|
data: column.data,
|
|
114
107
|
containerClassName: containerClassName
|
|
115
108
|
}));
|
|
116
109
|
}
|
|
117
|
-
case
|
|
110
|
+
case CellType.NUMBER:
|
|
118
111
|
{
|
|
119
|
-
return /*#__PURE__*/
|
|
112
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
120
113
|
className: "form-control d-flex align-items-center",
|
|
121
114
|
style: {
|
|
122
115
|
width: 320
|
|
123
116
|
}
|
|
124
|
-
}, /*#__PURE__*/
|
|
117
|
+
}, /*#__PURE__*/React.createElement(NumberFormatter, {
|
|
125
118
|
value: cellValue,
|
|
126
119
|
data: column.data,
|
|
127
120
|
containerClassName: containerClassName
|
|
128
121
|
}));
|
|
129
122
|
}
|
|
130
|
-
case
|
|
123
|
+
case CellType.DATE:
|
|
131
124
|
{
|
|
132
|
-
return /*#__PURE__*/
|
|
125
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
133
126
|
className: "form-control d-flex align-items-center",
|
|
134
127
|
style: {
|
|
135
128
|
width: 320
|
|
136
129
|
}
|
|
137
|
-
}, /*#__PURE__*/
|
|
130
|
+
}, /*#__PURE__*/React.createElement(DateFormatter, {
|
|
138
131
|
value: cellValue,
|
|
139
132
|
format: column.data.format,
|
|
140
133
|
containerClassName: containerClassName
|
|
141
134
|
}));
|
|
142
135
|
}
|
|
143
|
-
case
|
|
136
|
+
case CellType.CTIME:
|
|
144
137
|
{
|
|
145
|
-
return /*#__PURE__*/
|
|
138
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
146
139
|
className: "form-control d-flex align-items-center ctime-formatter-container",
|
|
147
140
|
style: {
|
|
148
141
|
width: 320
|
|
149
142
|
}
|
|
150
|
-
}, /*#__PURE__*/
|
|
143
|
+
}, /*#__PURE__*/React.createElement(CTimeFormatter, {
|
|
151
144
|
value: row._ctime,
|
|
152
145
|
containerClassName: containerClassName
|
|
153
146
|
}));
|
|
154
147
|
}
|
|
155
|
-
case
|
|
148
|
+
case CellType.MTIME:
|
|
156
149
|
{
|
|
157
|
-
return /*#__PURE__*/
|
|
150
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
158
151
|
className: "form-control d-flex align-items-center mtime-formatter-container",
|
|
159
152
|
style: {
|
|
160
153
|
width: 320
|
|
161
154
|
}
|
|
162
|
-
}, /*#__PURE__*/
|
|
155
|
+
}, /*#__PURE__*/React.createElement(MTimeFormatter, {
|
|
163
156
|
value: row._mtime,
|
|
164
157
|
containerClassName: containerClassName
|
|
165
158
|
}));
|
|
166
159
|
}
|
|
167
|
-
case
|
|
160
|
+
case CellType.MULTIPLE_SELECT:
|
|
168
161
|
{
|
|
169
162
|
const options = column.data ? column.data.options : [];
|
|
170
|
-
return /*#__PURE__*/
|
|
163
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
171
164
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
172
|
-
}, /*#__PURE__*/
|
|
165
|
+
}, /*#__PURE__*/React.createElement(MultipleSelectFormatter, {
|
|
173
166
|
value: cellValue,
|
|
174
167
|
options: options,
|
|
175
168
|
containerClassName: containerClassName
|
|
176
169
|
}));
|
|
177
170
|
}
|
|
178
|
-
case
|
|
171
|
+
case CellType.SINGLE_SELECT:
|
|
179
172
|
{
|
|
180
173
|
const options = column.data ? column.data.options : [];
|
|
181
|
-
return /*#__PURE__*/
|
|
174
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
182
175
|
className: "form-control d-flex align-items-center w-100"
|
|
183
|
-
}, /*#__PURE__*/
|
|
176
|
+
}, /*#__PURE__*/React.createElement(SingleSelectFormatter, {
|
|
184
177
|
value: cellValue,
|
|
185
178
|
options: options,
|
|
186
179
|
containerClassName: containerClassName
|
|
187
180
|
}));
|
|
188
181
|
}
|
|
189
|
-
case
|
|
182
|
+
case CellType.FILE:
|
|
190
183
|
{
|
|
191
|
-
return /*#__PURE__*/
|
|
184
|
+
return /*#__PURE__*/React.createElement(RowExpandFileFormatter, {
|
|
192
185
|
value: cellValue,
|
|
193
186
|
column: column,
|
|
194
187
|
downloadFile: this.props.downloadFile,
|
|
195
188
|
deleteFile: this.props.deleteFile
|
|
196
189
|
});
|
|
197
190
|
}
|
|
198
|
-
case
|
|
191
|
+
case CellType.IMAGE:
|
|
199
192
|
{
|
|
200
|
-
return /*#__PURE__*/
|
|
193
|
+
return /*#__PURE__*/React.createElement(RowExpandImageFormatter, {
|
|
201
194
|
value: cellValue,
|
|
202
195
|
column: column,
|
|
203
196
|
downloadImage: this.props.downloadImage,
|
|
@@ -205,41 +198,41 @@ class EditorFormatter extends _react.default.Component {
|
|
|
205
198
|
onRotateImage: this.props.onRotateImage
|
|
206
199
|
});
|
|
207
200
|
}
|
|
208
|
-
case
|
|
201
|
+
case CellType.CHECKBOX:
|
|
209
202
|
{
|
|
210
|
-
return /*#__PURE__*/
|
|
203
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
211
204
|
className: "checkbox-formatter-container"
|
|
212
|
-
}, /*#__PURE__*/
|
|
205
|
+
}, /*#__PURE__*/React.createElement(CheckboxFormatter, {
|
|
213
206
|
value: cellValue
|
|
214
207
|
}));
|
|
215
208
|
}
|
|
216
|
-
case
|
|
209
|
+
case CellType.CREATOR:
|
|
217
210
|
{
|
|
218
|
-
return /*#__PURE__*/
|
|
211
|
+
return /*#__PURE__*/React.createElement(CreatorFormatter, {
|
|
219
212
|
collaborators: collaborators,
|
|
220
213
|
value: cellValue,
|
|
221
214
|
containerClassName: containerClassName
|
|
222
215
|
});
|
|
223
216
|
}
|
|
224
|
-
case
|
|
217
|
+
case CellType.LAST_MODIFIER:
|
|
225
218
|
{
|
|
226
|
-
return /*#__PURE__*/
|
|
219
|
+
return /*#__PURE__*/React.createElement(LastModifierFormatter, {
|
|
227
220
|
collaborators: collaborators,
|
|
228
221
|
value: cellValue,
|
|
229
222
|
containerClassName: containerClassName
|
|
230
223
|
});
|
|
231
224
|
}
|
|
232
|
-
case
|
|
233
|
-
case
|
|
225
|
+
case CellType.FORMULA:
|
|
226
|
+
case CellType.LINK_FORMULA:
|
|
234
227
|
{
|
|
235
|
-
return /*#__PURE__*/
|
|
228
|
+
return /*#__PURE__*/React.createElement(RowExpandFormulaFormatter, {
|
|
236
229
|
value: cellValue,
|
|
237
230
|
column: column,
|
|
238
231
|
collaborators: collaborators,
|
|
239
232
|
containerClassName: containerClassName
|
|
240
233
|
});
|
|
241
234
|
}
|
|
242
|
-
case
|
|
235
|
+
case CellType.LINK:
|
|
243
236
|
{
|
|
244
237
|
// handle link column do not have column.data.display_column
|
|
245
238
|
const {
|
|
@@ -257,13 +250,13 @@ class EditorFormatter extends _react.default.Component {
|
|
|
257
250
|
...data,
|
|
258
251
|
display_column: {
|
|
259
252
|
key: display_column_key || '0000',
|
|
260
|
-
type: array_type ||
|
|
253
|
+
type: array_type || CellType.TEXT,
|
|
261
254
|
data: array_data || null
|
|
262
255
|
}
|
|
263
256
|
}
|
|
264
257
|
};
|
|
265
258
|
}
|
|
266
|
-
return /*#__PURE__*/
|
|
259
|
+
return /*#__PURE__*/React.createElement(RowExpandLinkFormatter, {
|
|
267
260
|
value: cellValue,
|
|
268
261
|
column: column,
|
|
269
262
|
collaborators: collaborators,
|
|
@@ -271,76 +264,76 @@ class EditorFormatter extends _react.default.Component {
|
|
|
271
264
|
renderEmpty: this.renderEmpty
|
|
272
265
|
});
|
|
273
266
|
}
|
|
274
|
-
case
|
|
267
|
+
case CellType.AUTO_NUMBER:
|
|
275
268
|
{
|
|
276
|
-
return /*#__PURE__*/
|
|
269
|
+
return /*#__PURE__*/React.createElement(AutoNumberFormatter, {
|
|
277
270
|
value: cellValue,
|
|
278
271
|
containerClassName: containerClassName
|
|
279
272
|
});
|
|
280
273
|
}
|
|
281
|
-
case
|
|
274
|
+
case CellType.URL:
|
|
282
275
|
{
|
|
283
|
-
return /*#__PURE__*/
|
|
276
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
284
277
|
className: "form-control d-flex align-items-center w-100"
|
|
285
|
-
}, /*#__PURE__*/
|
|
278
|
+
}, /*#__PURE__*/React.createElement(RowExpandUrlFormatter, {
|
|
286
279
|
value: cellValue,
|
|
287
280
|
containerClassName: containerClassName
|
|
288
281
|
}));
|
|
289
282
|
}
|
|
290
|
-
case
|
|
283
|
+
case CellType.EMAIL:
|
|
291
284
|
{
|
|
292
|
-
return /*#__PURE__*/
|
|
285
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
293
286
|
className: "form-control d-flex align-items-center w-100"
|
|
294
|
-
}, /*#__PURE__*/
|
|
287
|
+
}, /*#__PURE__*/React.createElement(RowExpandEmailFormatter, {
|
|
295
288
|
value: cellValue,
|
|
296
289
|
containerClassName: containerClassName
|
|
297
290
|
}));
|
|
298
291
|
}
|
|
299
|
-
case
|
|
292
|
+
case CellType.DURATION:
|
|
300
293
|
{
|
|
301
|
-
return /*#__PURE__*/
|
|
294
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
302
295
|
className: "form-control d-flex align-items-center",
|
|
303
296
|
style: {
|
|
304
297
|
width: 320
|
|
305
298
|
}
|
|
306
|
-
}, /*#__PURE__*/
|
|
299
|
+
}, /*#__PURE__*/React.createElement(DurationFormatter, {
|
|
307
300
|
value: cellValue,
|
|
308
301
|
format: column.data.duration_format,
|
|
309
302
|
containerClassName: containerClassName
|
|
310
303
|
}));
|
|
311
304
|
}
|
|
312
|
-
case
|
|
305
|
+
case CellType.RATE:
|
|
313
306
|
{
|
|
314
|
-
return /*#__PURE__*/
|
|
307
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
315
308
|
className: "form-control d-flex align-items-center",
|
|
316
309
|
style: {
|
|
317
310
|
width: 320
|
|
318
311
|
}
|
|
319
|
-
}, /*#__PURE__*/
|
|
312
|
+
}, /*#__PURE__*/React.createElement(RowExpandRateFormatter, {
|
|
320
313
|
value: cellValue,
|
|
321
314
|
data: column.data,
|
|
322
315
|
containerClassName: containerClassName
|
|
323
316
|
}));
|
|
324
317
|
}
|
|
325
|
-
case
|
|
318
|
+
case CellType.BUTTON:
|
|
326
319
|
{
|
|
327
|
-
return /*#__PURE__*/
|
|
320
|
+
return /*#__PURE__*/React.createElement(ButtonFormatter, {
|
|
328
321
|
data: column.data,
|
|
329
322
|
containerClassName: containerClassName,
|
|
330
323
|
onClickButton: this.props.onClickButton
|
|
331
324
|
});
|
|
332
325
|
}
|
|
333
|
-
case
|
|
326
|
+
case CellType.DIGITAL_SIGN:
|
|
334
327
|
{
|
|
335
|
-
return /*#__PURE__*/
|
|
328
|
+
return /*#__PURE__*/React.createElement(DigitalSignFormatter, {
|
|
336
329
|
value: cellValue,
|
|
337
330
|
containerClassName: containerClassName,
|
|
338
331
|
config: this.props.config
|
|
339
332
|
});
|
|
340
333
|
}
|
|
341
|
-
case
|
|
334
|
+
case CellType.DEPARTMENT_SINGLE_SELECT:
|
|
342
335
|
{
|
|
343
|
-
return /*#__PURE__*/
|
|
336
|
+
return /*#__PURE__*/React.createElement(DepartmentSingleSelectFormatter, {
|
|
344
337
|
value: cellValue,
|
|
345
338
|
departments: this.props.departments
|
|
346
339
|
});
|
|
@@ -371,14 +364,13 @@ class EditorFormatter extends _react.default.Component {
|
|
|
371
364
|
const {
|
|
372
365
|
className
|
|
373
366
|
} = this.props;
|
|
374
|
-
return /*#__PURE__*/
|
|
375
|
-
className: (
|
|
367
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
368
|
+
className: classnames('dtable-ui dtable-row-expand-formatter', {
|
|
376
369
|
[className]: className
|
|
377
370
|
})
|
|
378
371
|
}, this.renderFormatter());
|
|
379
372
|
}
|
|
380
373
|
}
|
|
381
|
-
exports.default = EditorFormatter;
|
|
382
374
|
EditorFormatter.defaultProps = {
|
|
383
375
|
className: ''
|
|
384
376
|
};
|