dtable-ui-component 5.3.0 → 5.3.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/dtable-font/dtable-font.eot +0 -0
- package/assets/dtable-font/dtable-font.svg +116 -0
- package/assets/dtable-font/dtable-font.ttf +0 -0
- package/assets/dtable-font/dtable-font.woff +0 -0
- package/assets/dtable-font/dtable-font.woff2 +0 -0
- package/assets/dtable-font.css +238 -6
- package/lib/CheckboxEditor/index.css +3 -20
- package/lib/CheckboxEditor/index.js +98 -35
- package/lib/CheckboxFormatter/index.js +6 -9
- package/lib/CollaboratorEditor/index.css +12 -35
- package/lib/CollaboratorEditor/index.js +18 -212
- package/lib/CollaboratorEditor/{mb-collaborator-editor-popover → mb-collaborator-editor}/index.js +26 -29
- package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +257 -0
- package/lib/CollaboratorItem/index.css +1 -1
- package/lib/CollaboratorItem/index.js +6 -2
- package/lib/DTableCustomizeCollaboratorSelect/index.css +1 -1
- package/lib/DTableCustomizeCollaboratorSelect/index.js +1 -1
- package/lib/DTableCustomizeSelect/index.css +2 -2
- package/lib/DTableCustomizeSelect/index.js +1 -1
- package/lib/DTableFiltersPopover/utils/index.js +1 -7
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +1 -1
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +2 -2
- package/lib/DTableSelect/index.js +3 -1
- package/lib/DTableSelect/utils.js +1 -1
- package/lib/DateEditor/index.js +14 -51
- package/lib/DateEditor/pc-date-editor-popover.js +145 -12
- package/lib/DeleteTip/index.js +50 -0
- package/lib/Department-editor/department-single-select.js +1 -1
- package/lib/Department-editor/index.js +3 -4
- package/lib/DepartmentSingleSelectFormatter/index.js +2 -1
- package/lib/DigitalSignEditor/constants.js +7 -0
- package/lib/DigitalSignEditor/index.css +69 -0
- package/lib/DigitalSignEditor/index.js +182 -0
- package/lib/DigitalSignEditor/service.js +38 -0
- package/lib/DigitalSignEditor/signature-board/index.css +35 -0
- package/lib/DigitalSignEditor/signature-board/index.js +135 -0
- package/lib/DigitalSignEditor/signature-board/signature-tool.js +396 -0
- package/lib/DigitalSignEditor/utils.js +29 -0
- package/lib/DurationEditor/index.js +111 -0
- package/lib/EmailEditor/index.js +59 -0
- package/lib/FileEditor/addition-previewer/index.css +1 -0
- package/lib/FileEditor/addition-previewer/index.js +52 -0
- package/lib/FileEditor/addition-previewer/local-file-addition/index.css +1 -0
- package/lib/FileEditor/addition-previewer/local-file-addition/index.js +252 -0
- package/lib/FileEditor/constants.js +7 -0
- package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +74 -0
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +5 -0
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +77 -0
- package/lib/FileEditor/files-previewer/file-previewer/index.css +88 -0
- package/lib/FileEditor/files-previewer/file-previewer/index.js +167 -0
- package/lib/FileEditor/files-previewer/index.css +56 -0
- package/lib/FileEditor/files-previewer/index.js +277 -0
- package/lib/FileEditor/index.css +6 -0
- package/lib/FileEditor/index.js +244 -11
- package/lib/FileEditor/utils.js +22 -0
- package/lib/FileItemFormatter/index.js +19 -20
- package/lib/FileUploader/index.css +9 -0
- package/lib/FileUploader/index.js +268 -14
- package/lib/FormulaFormatter/index.js +2 -1
- package/lib/FormulaFormatter/utils.js +0 -31
- package/lib/GeolocationEditor/country-editor.js +319 -0
- package/lib/GeolocationEditor/index.css +641 -0
- package/lib/GeolocationEditor/index.js +241 -0
- package/lib/GeolocationEditor/location-editor.js +368 -0
- package/lib/GeolocationEditor/map-editor/index.js +456 -0
- package/lib/GeolocationEditor/map-editor/large-editor/index.css +137 -0
- package/lib/GeolocationEditor/map-editor/large-editor/index.js +461 -0
- package/lib/GeolocationEditor/map-editor-utils.js +153 -0
- package/lib/GeolocationEditor/map-selection-editor/index.js +455 -0
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +1 -0
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +447 -0
- package/lib/GeolocationEditor/parse-geolocation.js +282 -0
- package/lib/GeolocationEditor/province-city-editor.js +292 -0
- package/lib/GeolocationEditor/province-editor.js +226 -0
- package/lib/GeolocationEditor/selector-header-item.js +28 -0
- package/lib/GeolocationEditor/selector-list.js +33 -0
- package/lib/GeolocationEditor/with-ref.js +27 -0
- package/lib/ImageEditor/addition-previewer/image-link/index.css +45 -0
- package/lib/ImageEditor/addition-previewer/image-link/index.js +73 -0
- package/lib/ImageEditor/addition-previewer/index.css +106 -0
- package/lib/ImageEditor/addition-previewer/index.js +63 -0
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +125 -0
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +254 -0
- package/lib/ImageEditor/constants.js +7 -0
- package/lib/ImageEditor/images-previewer/image-preview/index.css +59 -0
- package/lib/ImageEditor/images-previewer/image-preview/index.js +155 -0
- package/lib/ImageEditor/images-previewer/index.css +18 -0
- package/lib/ImageEditor/images-previewer/index.js +140 -0
- package/lib/ImageEditor/index.css +24 -0
- package/lib/ImageEditor/index.js +194 -0
- package/lib/ImageThumbnail/index.css +20 -0
- package/lib/ImageThumbnail/index.js +136 -0
- package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
- package/lib/MultipleSelectEditor/index.js +16 -177
- package/lib/NumberEditor/index.js +64 -77
- package/lib/RoleStatusEditor/index.css +3 -3
- package/lib/RoleStatusEditor/index.js +1 -1
- package/lib/RowExpandDialog/body/index.css +21 -0
- package/lib/RowExpandDialog/body/index.js +279 -0
- package/lib/RowExpandDialog/column-content/index.css +43 -0
- package/lib/RowExpandDialog/column-content/index.js +50 -0
- package/lib/RowExpandDialog/constants.js +114 -0
- package/lib/RowExpandDialog/header/index.css +31 -0
- package/lib/RowExpandDialog/header/index.js +33 -0
- package/lib/RowExpandDialog/index.css +24 -0
- package/lib/RowExpandDialog/index.js +268 -0
- package/lib/RowExpandDialog/utils.js +83 -0
- package/lib/RowExpandEditor/RowExpandAddBtn/index.css +22 -0
- package/lib/RowExpandEditor/RowExpandAddBtn/index.js +24 -0
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +18 -0
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +43 -0
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +5 -0
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +232 -0
- package/lib/RowExpandEditor/RowExpandDateEditor/index.js +130 -0
- package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +129 -0
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +13 -0
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +208 -0
- package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +105 -0
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +2 -0
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +125 -0
- package/lib/RowExpandEditor/RowExpandFileEditor/index.css +1 -0
- package/lib/RowExpandEditor/RowExpandFileEditor/index.js +146 -0
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +17 -0
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +165 -0
- package/lib/RowExpandEditor/RowExpandImageEditor/index.css +6 -0
- package/lib/RowExpandEditor/RowExpandImageEditor/index.js +170 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +6 -0
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +124 -0
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +44 -0
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +224 -0
- package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +105 -0
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +13 -0
- package/lib/RowExpandEditor/RowExpandRateEditor/index.js +152 -0
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +58 -0
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +192 -0
- package/lib/RowExpandEditor/RowExpandTextEditor/index.css +4 -0
- package/lib/RowExpandEditor/RowExpandTextEditor/index.js +127 -0
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +31 -0
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +130 -0
- package/lib/RowExpandEditor/constants.js +44 -0
- package/lib/RowExpandEditor/index.css +0 -0
- package/lib/RowExpandEditor/index.js +32 -0
- package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +27 -0
- package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.css +1 -1
- package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.js +1 -1
- package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.css +6 -6
- package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.js +3 -1
- package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/row-expand-file-item-formatter.js +10 -11
- package/lib/{RowExpandFormulaFormatter → RowExpandFormatter/RowExpandFormulaFormatter}/index.js +11 -10
- package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.css +6 -6
- package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.js +1 -1
- package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/row-expand-image-item-formatter.js +3 -3
- package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
- package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.js +5 -5
- package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/utils.js +1 -1
- package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.css +1 -1
- package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +1 -0
- package/lib/{RowExpandUrlFormatter → RowExpandFormatter/RowExpandUrlFormatter}/index.js +4 -3
- package/lib/RowExpandFormatter/constants.js +60 -0
- package/lib/RowExpandFormatter/index.css +26 -0
- package/lib/RowExpandFormatter/index.js +84 -100
- package/lib/SingleSelectEditor/index.js +16 -156
- package/lib/TextEditor/index.js +113 -42
- package/lib/UploadProgress/index.js +38 -0
- package/lib/UrlEditor/index.js +62 -0
- package/lib/common/editor-base.js +53 -0
- package/lib/constants/file.js +96 -0
- package/lib/constants/index.js +34 -2
- package/lib/constants/key-codes.js +109 -0
- package/lib/css/cell-editor.css +18 -2
- package/lib/hooks/index.js +16 -0
- package/lib/index.js +74 -46
- package/lib/lang/index.js +16 -14
- package/lib/locales/de.json +163 -0
- package/lib/locales/en.json +163 -0
- package/lib/locales/es.json +163 -0
- package/lib/locales/fr.json +163 -0
- package/lib/locales/pt.json +163 -0
- package/lib/locales/ru.json +163 -0
- package/lib/locales/zh-CN.json +163 -0
- package/lib/select-editor/index.js +6 -6
- package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.js +3 -3
- package/lib/select-editor/pc-select-editor/index.css +85 -0
- package/lib/select-editor/pc-select-editor/index.js +290 -0
- package/lib/utils/cell-comparer.js +35 -0
- package/lib/utils/cell.js +55 -0
- package/lib/utils/column-utils.js +25 -0
- package/lib/utils/editor-utils.js +1 -6
- package/lib/utils/get-event-transfer.js +75 -0
- package/lib/utils/object-utils.js +61 -0
- package/lib/utils/url.js +119 -8
- package/lib/utils/utils.js +89 -2
- package/package.json +3 -2
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +0 -97
- package/lib/FileEditor/pc-files-addition/index.js +0 -1
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +0 -1
- package/lib/FileEditor/pc-files-preview/index.js +0 -1
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +0 -1
- package/lib/FileItemFormatter/assets/file/192/excel.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/file.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/music.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/pdf.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/pic.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/ppt.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/txt.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/video.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/word.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/excel.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/file.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/music.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/pdf.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/pic.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/ppt.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/txt.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/video.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/word.png +0 -0
- package/lib/FileItemFormatter/assets/folder/folder-192.png +0 -0
- package/lib/FileItemFormatter/assets/folder/folder-24.png +0 -0
- package/lib/FileItemFormatter/utils.js +0 -99
- package/lib/MultipleSelectEditor/index.css +0 -9
- package/lib/RowExpandUrlFormatter/index.css +0 -1
- package/lib/SingleSelectEditor/index.css +0 -14
- package/lib/locals/de.js +0 -103
- package/lib/locals/en.js +0 -104
- package/lib/locals/es.js +0 -103
- package/lib/locals/fr.js +0 -103
- package/lib/locals/pt.js +0 -103
- package/lib/locals/ru.js +0 -103
- package/lib/locals/zh-CN.js +0 -104
- package/lib/select-editor/pc-select-editor-popover/index.css +0 -71
- package/lib/select-editor/pc-select-editor-popover/index.js +0 -122
- /package/lib/CollaboratorEditor/{mb-collaborator-editor-popover → mb-collaborator-editor}/index.css +0 -0
- /package/lib/CollaboratorEditor/{pc-collaborator-editor-popover → pc-collaborator-editor}/index.css +0 -0
- /package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.css +0 -0
- /package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/value-display-utils.js +0 -0
- /package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.js +0 -0
- /package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.css +0 -0
|
@@ -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 _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"));
|
|
35
10
|
var _constants = require("../constants");
|
|
11
|
+
var _constants2 = 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 (![_constants.CellType.CREATOR, _constants.CellType.LAST_MODIFIER, _constants.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
32
|
if (column.type === _constants.CellType.CREATOR || column.type === _constants.CellType.LAST_MODIFIER) {
|
|
51
33
|
const email = row[column.name];
|
|
52
|
-
|
|
34
|
+
queryCollaborators && queryCollaborators(email);
|
|
53
35
|
} else if (column.type === _constants.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,14 +64,15 @@ 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];
|
|
99
70
|
switch (columnType) {
|
|
100
71
|
case _constants.CellType.TEXT:
|
|
101
72
|
{
|
|
102
73
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
103
74
|
className: "form-control d-flex align-items-center w-100"
|
|
104
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
105
76
|
value: cellValue,
|
|
106
77
|
containerClassName: containerClassName
|
|
107
78
|
}));
|
|
@@ -110,7 +81,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
110
81
|
{
|
|
111
82
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
112
83
|
className: "form-control d-flex align-items-center w-100 h-auto"
|
|
113
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
114
85
|
value: cellValue,
|
|
115
86
|
collaborators: collaborators,
|
|
116
87
|
containerClassName: containerClassName
|
|
@@ -118,10 +89,12 @@ class EditorFormatter extends _react.default.Component {
|
|
|
118
89
|
}
|
|
119
90
|
case _constants.CellType.LONG_TEXT:
|
|
120
91
|
{
|
|
121
|
-
if (!cellValue) return
|
|
92
|
+
if (!cellValue) return /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
+
className: "form-control d-flex align-items-center w-100"
|
|
94
|
+
});
|
|
122
95
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
123
96
|
className: "longtext-formatter-container"
|
|
124
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
125
98
|
value: cellValue,
|
|
126
99
|
containerClassName: containerClassName,
|
|
127
100
|
isSample: false
|
|
@@ -129,10 +102,12 @@ class EditorFormatter extends _react.default.Component {
|
|
|
129
102
|
}
|
|
130
103
|
case _constants.CellType.GEOLOCATION:
|
|
131
104
|
{
|
|
132
|
-
if (typeof cellValue !== 'object') return
|
|
105
|
+
if (typeof cellValue !== 'object') return /*#__PURE__*/_react.default.createElement("div", {
|
|
106
|
+
className: "geolocation-formatter-container"
|
|
107
|
+
});
|
|
133
108
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
134
109
|
className: "geolocation-formatter-container"
|
|
135
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
136
111
|
value: cellValue,
|
|
137
112
|
data: column.data,
|
|
138
113
|
containerClassName: containerClassName
|
|
@@ -145,7 +120,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
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
|
|
@@ -158,7 +133,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
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
|
|
@@ -171,8 +146,8 @@ class EditorFormatter extends _react.default.Component {
|
|
|
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
|
}
|
|
@@ -183,17 +158,18 @@ class EditorFormatter extends _react.default.Component {
|
|
|
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
166
|
case _constants.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
|
|
@@ -201,10 +177,11 @@ class EditorFormatter extends _react.default.Component {
|
|
|
201
177
|
}
|
|
202
178
|
case _constants.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
|
|
@@ -212,44 +189,39 @@ class EditorFormatter extends _react.default.Component {
|
|
|
212
189
|
}
|
|
213
190
|
case _constants.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
200
|
case _constants.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
211
|
case _constants.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
221
|
case _constants.CellType.CREATOR:
|
|
243
|
-
{
|
|
244
|
-
return /*#__PURE__*/_react.default.createElement(_CreatorFormatter.default, {
|
|
245
|
-
collaborators: collaborators,
|
|
246
|
-
value: cellValue,
|
|
247
|
-
containerClassName: containerClassName
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
222
|
case _constants.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
|
|
@@ -258,7 +230,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
258
230
|
case _constants.CellType.FORMULA:
|
|
259
231
|
case _constants.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,
|
|
@@ -289,17 +261,17 @@ class EditorFormatter extends _react.default.Component {
|
|
|
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
272
|
case _constants.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
|
});
|
|
@@ -308,7 +280,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
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
|
}));
|
|
@@ -317,7 +289,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
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
|
}));
|
|
@@ -329,7 +301,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
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
|
|
@@ -342,7 +314,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
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
|
|
@@ -350,7 +322,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
350
322
|
}
|
|
351
323
|
case _constants.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
|
|
@@ -358,7 +330,7 @@ class EditorFormatter extends _react.default.Component {
|
|
|
358
330
|
}
|
|
359
331
|
case _constants.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
|
|
@@ -366,23 +338,37 @@ class EditorFormatter extends _react.default.Component {
|
|
|
366
338
|
}
|
|
367
339
|
case _constants.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
|
+
if (Formatter) {
|
|
349
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, {
|
|
350
|
+
value: cellValue,
|
|
351
|
+
containerClassName: containerClassName,
|
|
352
|
+
config: this.props.config
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
return null;
|
|
356
|
+
}
|
|
376
357
|
}
|
|
377
358
|
};
|
|
378
359
|
this.state = {
|
|
379
|
-
collaborators: this.
|
|
360
|
+
collaborators: this.getCollaborators()
|
|
361
|
+
};
|
|
362
|
+
this.component = {
|
|
363
|
+
..._constants2.DEFAULT_FORMATTER,
|
|
364
|
+
...this.props.component
|
|
380
365
|
};
|
|
381
366
|
}
|
|
382
367
|
componentDidMount() {
|
|
383
368
|
this.calculateCollaboratorData(this.props);
|
|
384
|
-
|
|
385
|
-
|
|
369
|
+
const eventBus = this.props.eventBus;
|
|
370
|
+
if (eventBus) {
|
|
371
|
+
this.unsubscribeCollaboratorsUpdated = eventBus.subscribe('collaborators-updated', this.updateCollaborators);
|
|
386
372
|
}
|
|
387
373
|
}
|
|
388
374
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
@@ -398,13 +384,11 @@ class EditorFormatter extends _react.default.Component {
|
|
|
398
384
|
className
|
|
399
385
|
} = this.props;
|
|
400
386
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
401
|
-
className: (0, _classnames.default)('dtable-ui dtable-row-expand-formatter',
|
|
402
|
-
[className]: className
|
|
403
|
-
})
|
|
387
|
+
className: (0, _classnames.default)('dtable-ui dtable-row-expand-formatter', className)
|
|
404
388
|
}, this.renderFormatter());
|
|
405
389
|
}
|
|
406
390
|
}
|
|
407
|
-
|
|
408
|
-
EditorFormatter.defaultProps = {
|
|
391
|
+
RowExpandFormatter.defaultProps = {
|
|
409
392
|
className: ''
|
|
410
|
-
};
|
|
393
|
+
};
|
|
394
|
+
var _default = exports.default = RowExpandFormatter;
|
|
@@ -1,167 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
11
|
-
var _lang = require("../lang");
|
|
12
|
-
var _EditEditorButton = _interopRequireDefault(require("../EditEditorButton"));
|
|
13
10
|
var _selectEditor = require("../select-editor");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
this.onAddOptionToggle = event => {
|
|
31
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
32
|
-
event.stopPropagation();
|
|
33
|
-
if (this.props.isReadOnly) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
let isPopoverShow = !this.state.isPopoverShow;
|
|
37
|
-
if (isPopoverShow) {
|
|
38
|
-
let popoverPosition = this.caculatePopoverPosition();
|
|
39
|
-
this.setState({
|
|
40
|
-
isPopoverShow,
|
|
41
|
-
popoverPosition
|
|
42
|
-
});
|
|
43
|
-
} else {
|
|
44
|
-
this.setState({
|
|
45
|
-
isPopoverShow
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
this.onCommit = newValue => {
|
|
50
|
-
let updated = {};
|
|
51
|
-
let {
|
|
52
|
-
column
|
|
53
|
-
} = this.props;
|
|
54
|
-
updated[column.name] = newValue;
|
|
55
|
-
this.props.onCommit(updated);
|
|
56
|
-
};
|
|
57
|
-
this.onOptionItemToggle = option => {
|
|
58
|
-
let newValue = this.state.newValue === option.name ? '' : option.name;
|
|
59
|
-
this.setState({
|
|
60
|
-
newValue
|
|
61
|
-
}, () => {
|
|
62
|
-
this.onCommit(newValue);
|
|
63
|
-
this.onClosePopover();
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
this.caculatePopoverPosition = () => {
|
|
67
|
-
const POPOVER_MAX_HEIGHT = 200;
|
|
68
|
-
let innerHeight = window.innerHeight;
|
|
69
|
-
let {
|
|
70
|
-
top,
|
|
71
|
-
height
|
|
72
|
-
} = this.editor.getClientRects()[0];
|
|
73
|
-
let isBelow = innerHeight - (top + height) > POPOVER_MAX_HEIGHT;
|
|
74
|
-
let position = {
|
|
75
|
-
top: height + 1,
|
|
76
|
-
left: 0
|
|
77
|
-
};
|
|
78
|
-
if (!isBelow) {
|
|
79
|
-
let bottom = height + 1;
|
|
80
|
-
position = {
|
|
81
|
-
bottom: bottom,
|
|
82
|
-
left: 0
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return position;
|
|
86
|
-
};
|
|
87
|
-
this.onAddNewOption = optionName => {
|
|
88
|
-
this.props.onAddNewOption(optionName);
|
|
89
|
-
this.onClosePopover();
|
|
90
|
-
};
|
|
91
|
-
this.onClosePopover = () => {
|
|
92
|
-
this.setState({
|
|
93
|
-
isPopoverShow: false
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
this.setEditorContainerRef = editorContainer => {
|
|
97
|
-
this.editorContainer = editorContainer;
|
|
98
|
-
};
|
|
99
|
-
this.setEditorRef = editor => {
|
|
100
|
-
this.editor = editor;
|
|
101
|
-
};
|
|
102
|
-
this.state = {
|
|
103
|
-
newValue: props.value,
|
|
104
|
-
isPopoverShow: false,
|
|
105
|
-
popoverPosition: {}
|
|
106
|
-
};
|
|
107
|
-
let {
|
|
108
|
-
column: _column
|
|
109
|
-
} = this.props;
|
|
110
|
-
this.options = _column.data && (_column.data.options || []);
|
|
111
|
-
}
|
|
112
|
-
componentDidMount() {
|
|
113
|
-
document.addEventListener('mousedown', this.onMouseDown);
|
|
114
|
-
}
|
|
115
|
-
componentWillUnmount() {
|
|
116
|
-
document.removeEventListener('mousedown', this.onMouseDown);
|
|
117
|
-
}
|
|
118
|
-
render() {
|
|
119
|
-
let {
|
|
120
|
-
isPopoverShow,
|
|
121
|
-
popoverPosition
|
|
122
|
-
} = this.state;
|
|
123
|
-
let option = this.formatOption();
|
|
124
|
-
let options = this.options;
|
|
125
|
-
let selectedOptions = option ? [option] : [];
|
|
126
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
127
|
-
ref: this.setEditorContainerRef,
|
|
128
|
-
className: "dtable-ui-single-select-editor"
|
|
129
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
-
ref: this.setEditorRef,
|
|
131
|
-
className: option ? '' : 'd-inline-block',
|
|
132
|
-
onClick: this.onAddOptionToggle
|
|
133
|
-
}, option ? /*#__PURE__*/_react.default.createElement("div", {
|
|
134
|
-
className: "dtable-ui-single-select-option-container"
|
|
135
|
-
}, /*#__PURE__*/_react.default.createElement(_selectEditor.SelectEditorOption, {
|
|
136
|
-
option: option
|
|
137
|
-
})) : /*#__PURE__*/_react.default.createElement(_EditEditorButton.default, {
|
|
138
|
-
text: (0, _lang.getLocale)('Add_an_option')
|
|
139
|
-
})), isPopoverShow && /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
140
|
-
query: "(min-width: 768px)"
|
|
141
|
-
}, /*#__PURE__*/_react.default.createElement(_selectEditor.PCSelectEditorPopover, {
|
|
142
|
-
popoverPosition: popoverPosition,
|
|
143
|
-
options: options,
|
|
144
|
-
selectedOptions: selectedOptions,
|
|
145
|
-
onOptionItemToggle: this.onOptionItemToggle,
|
|
146
|
-
isSupportNewOption: this.props.isSupportNewOption,
|
|
147
|
-
onAddNewOption: this.onAddNewOption
|
|
148
|
-
})), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
149
|
-
query: "(max-width: 767.8px)"
|
|
150
|
-
}, /*#__PURE__*/_react.default.createElement(_selectEditor.MBSelectEditorPopover, {
|
|
151
|
-
isReadOnly: this.props.isReadOnly,
|
|
152
|
-
value: [this.state.newValue],
|
|
153
|
-
column: this.props.column,
|
|
154
|
-
options: options,
|
|
155
|
-
onOptionItemToggle: this.onOptionItemToggle,
|
|
156
|
-
isShowRemoveIcon: true,
|
|
157
|
-
isSupportNewOption: this.props.isSupportNewOption,
|
|
158
|
-
onAddNewOption: this.onAddNewOption,
|
|
159
|
-
onClosePopover: this.onClosePopover
|
|
160
|
-
}))));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
SingleSelectEditor.defaultProps = {
|
|
164
|
-
isReadOnly: false,
|
|
165
|
-
value: ''
|
|
11
|
+
const SingleSelectEditor = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
value: oldValue,
|
|
14
|
+
...props
|
|
15
|
+
} = _ref;
|
|
16
|
+
const value = oldValue ? [oldValue] : [];
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
18
|
+
query: "(min-width: 768px)"
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement(_selectEditor.PCSelectEditor, Object.assign({}, props, {
|
|
20
|
+
value: value
|
|
21
|
+
}))), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
22
|
+
query: "(max-width: 767.8px)"
|
|
23
|
+
}, /*#__PURE__*/_react.default.createElement(_selectEditor.MBSelectEditor, Object.assign({}, props, {
|
|
24
|
+
value: value
|
|
25
|
+
}))));
|
|
166
26
|
};
|
|
167
27
|
var _default = exports.default = SingleSelectEditor;
|