dtable-ui-component 4.4.2 → 4.4.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/AutoNumberFormatter/index.js +14 -7
- package/lib/ButtonFormatter/index.js +16 -9
- package/lib/CTimeFormatter/index.js +16 -9
- package/lib/CheckboxEditor/index.js +15 -8
- package/lib/CheckboxFormatter/index.js +15 -8
- package/lib/CollaboratorEditor/index.js +29 -21
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +32 -25
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +25 -18
- package/lib/CollaboratorFormatter/index.js +19 -12
- package/lib/CollaboratorItem/index.js +17 -10
- package/lib/CreatorFormatter/index.js +19 -12
- package/lib/DTableCommonAddTool/index.js +13 -6
- package/lib/DTableCustomizeCollaboratorSelect/index.js +26 -18
- package/lib/DTableCustomizeSelect/index.js +23 -15
- package/lib/DTableFiltersPopover/constants/index.js +38 -33
- package/lib/DTableFiltersPopover/index.js +38 -31
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +53 -46
- package/lib/DTableFiltersPopover/utils/index.js +128 -99
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +34 -26
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +33 -25
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +34 -26
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +34 -26
- package/lib/DTableFiltersPopover/widgets/filter-item.js +128 -120
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +21 -0
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +26 -18
- package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -8
- package/lib/DTablePopover/index.js +15 -8
- package/lib/DTablePopover/utils.js +9 -2
- package/lib/DTableRadio/index.js +17 -10
- package/lib/DTableSearchInput/index.js +21 -13
- package/lib/DTableSearchInput/utils.js +9 -2
- package/lib/DTableSelect/dtable-select-label.js +13 -6
- package/lib/DTableSelect/index.js +18 -10
- package/lib/DTableSelect/utils.js +20 -10
- package/lib/DTableSwitch/index.js +14 -7
- package/lib/DateEditor/index.js +30 -22
- package/lib/DateEditor/mb-date-editor-popover/index.js +55 -47
- package/lib/DateEditor/pc-date-editor-popover.js +27 -20
- package/lib/DateFormatter/index.js +16 -9
- package/lib/Department-editor/constants.js +7 -1
- package/lib/Department-editor/department-multiple-select/index.js +32 -24
- package/lib/Department-editor/department-single-select.js +41 -33
- package/lib/Department-editor/index.js +22 -14
- package/lib/Department-editor/selected-departments/index.js +32 -25
- package/lib/Department-editor/utils.js +11 -3
- package/lib/DepartmentSingleSelectFormatter/index.js +16 -9
- package/lib/DigitalSignFormatter/index.js +23 -15
- package/lib/DigitalSignFormatter/utils.js +11 -3
- package/lib/DurationFormatter/index.js +16 -9
- package/lib/EditEditorButton/index.js +12 -5
- package/lib/EmailFormatter/index.js +14 -7
- package/lib/FieldDisplaySetting/field-item.js +21 -14
- package/lib/FieldDisplaySetting/index.js +27 -19
- package/lib/FileEditor/index.js +15 -8
- 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/FileFormatter/index.js +19 -11
- package/lib/FileItemFormatter/index.js +14 -6
- package/lib/FileItemFormatter/utils.js +9 -2
- package/lib/FileUploader/index.js +11 -4
- package/lib/FormulaFormatter/cell-value-validator.js +24 -18
- package/lib/FormulaFormatter/index.js +39 -32
- package/lib/FormulaFormatter/utils.js +29 -13
- package/lib/GeolocationFormatter/index.js +16 -9
- package/lib/HtmlLongTextFormatter/index.js +17 -9
- package/lib/ImageFormatter/images-lazy-load.js +16 -9
- package/lib/ImageFormatter/index.js +24 -16
- package/lib/ImageFormatter/utils.js +9 -2
- package/lib/ImagePreviewerLightbox/index.js +19 -12
- package/lib/ImagePreviewerLightbox/utils.js +11 -3
- package/lib/LastModifierFormatter/index.js +19 -12
- package/lib/LinkEditor/index.js +33 -25
- package/lib/LinkEditor/link-editor-option.js +15 -8
- package/lib/LinkEditor/mb-link-editor-popover/index.js +30 -23
- package/lib/LinkEditor/pc-link-editor-popover/index.js +24 -17
- package/lib/LinkFormatter/index.js +20 -13
- package/lib/Loading/index.js +11 -4
- package/lib/LongTextFormatter/index.js +13 -6
- package/lib/MBEditorHeader/index.js +14 -7
- package/lib/MTimeFormatter/index.js +16 -9
- package/lib/ModalPortal/index.js +12 -5
- package/lib/MultipleSelectEditor/index.js +25 -17
- package/lib/MultipleSelectFormatter/index.js +17 -10
- package/lib/NotificationPopover/index.js +24 -16
- package/lib/NumberEditor/index.js +25 -18
- package/lib/NumberFormatter/index.js +16 -9
- package/lib/RateFormatter/index.js +15 -8
- package/lib/RoleStatusEditor/index.js +22 -14
- package/lib/RowExpandEmailFormatter/index.js +17 -10
- package/lib/RowExpandFileFormatter/index.js +16 -8
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +27 -18
- package/lib/RowExpandFormatter/index.js +86 -78
- package/lib/RowExpandFormulaFormatter/index.js +42 -34
- package/lib/RowExpandImageFormatter/index.js +19 -10
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +27 -18
- package/lib/RowExpandImageFormatter/utils.js +9 -2
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +16 -7
- package/lib/RowExpandLinkFormatter/index.js +46 -37
- package/lib/RowExpandLinkFormatter/utils.js +17 -6
- package/lib/RowExpandLinkFormatter/value-display-utils.js +12 -5
- package/lib/RowExpandRateFormatter/index.js +15 -8
- package/lib/RowExpandUrlFormatter/index.js +21 -14
- package/lib/SelectItem/index.js +12 -4
- package/lib/SelectOptionGroup/KeyCodes.js +7 -1
- package/lib/SelectOptionGroup/index.js +28 -20
- package/lib/SelectOptionGroup/option.js +11 -4
- package/lib/SimpleLongTextFormatter/index.js +27 -20
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +7 -1
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +15 -8
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +14 -7
- package/lib/SingleSelectEditor/index.js +26 -18
- package/lib/SingleSelectFormatter/index.js +16 -9
- package/lib/TextEditor/index.js +14 -7
- package/lib/TextFormatter/index.js +14 -7
- package/lib/UrlFormatter/index.js +14 -7
- package/lib/cellFormatterFactory/index.js +11 -4
- package/lib/common/ClickOutside.js +12 -4
- package/lib/common/delete-tip.js +20 -12
- package/lib/common/modal-portal.js +13 -5
- package/lib/constants/index.js +28 -9
- package/lib/data/dtable-value.js +11 -6
- package/lib/formatterConfig/base-formatter-config.js +53 -46
- package/lib/formatterConfig/index.js +16 -9
- package/lib/hooks/common-hooks.js +11 -4
- package/lib/index.js +432 -75
- package/lib/lang/index.js +24 -13
- package/lib/locals/de.js +7 -1
- package/lib/locals/en.js +7 -1
- package/lib/locals/fr.js +7 -1
- package/lib/locals/zh-CN.js +7 -1
- package/lib/select-editor/index.js +27 -4
- package/lib/select-editor/mb-select-editor-popover/index.js +41 -33
- package/lib/select-editor/pc-select-editor-popover/index.js +26 -19
- package/lib/select-editor/select-editor-option.js +15 -8
- package/lib/toaster/alert.js +18 -11
- package/lib/toaster/index.js +10 -3
- package/lib/toaster/toast.js +16 -8
- package/lib/toaster/toastManager.js +13 -5
- package/lib/toaster/toaster.js +15 -7
- package/lib/utils/dayjs.js +11 -4
- package/lib/utils/editor-utils.js +15 -5
- package/lib/utils/event-bus.js +7 -1
- package/lib/utils/utils.js +17 -6
- package/package.json +63 -77
- package/lib/HtmlLongTextFormatter/markdown2html.js +0 -47
- package/lib/HtmlLongTextFormatter/unified/index.js +0 -400
- package/lib/HtmlLongTextFormatter/vfile/core.js +0 -155
- package/lib/HtmlLongTextFormatter/vfile/index.js +0 -40
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _dtableUtils = require("dtable-utils");
|
|
10
|
+
var _baseFormatterConfig = _interopRequireDefault(require("../formatterConfig/base-formatter-config"));
|
|
11
|
+
var _TextFormatter = _interopRequireDefault(require("../TextFormatter"));
|
|
12
|
+
var _utils = require("../FormulaFormatter/utils");
|
|
13
|
+
var _cellValueValidator = _interopRequireDefault(require("../FormulaFormatter/cell-value-validator"));
|
|
14
|
+
require("../FormulaFormatter/index.css");
|
|
15
|
+
class RowExpandFormulaFormatter extends _react.default.Component {
|
|
9
16
|
constructor() {
|
|
10
17
|
super(...arguments);
|
|
11
18
|
this.renderBorder = dom => {
|
|
@@ -18,12 +25,12 @@ export default class RowExpandFormulaFormatter extends React.Component {
|
|
|
18
25
|
let style = {
|
|
19
26
|
minHeight: '38px'
|
|
20
27
|
};
|
|
21
|
-
if (result_type === FORMULA_RESULT_TYPE.DATE || result_type === FORMULA_RESULT_TYPE.NUMBER) {
|
|
28
|
+
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.DATE || result_type === _dtableUtils.FORMULA_RESULT_TYPE.NUMBER) {
|
|
22
29
|
style = {
|
|
23
30
|
width: '320px'
|
|
24
31
|
};
|
|
25
32
|
}
|
|
26
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
34
|
className: "d-flex align-items-center form-control disabled h-auto",
|
|
28
35
|
style: style
|
|
29
36
|
}, dom);
|
|
@@ -38,32 +45,32 @@ export default class RowExpandFormulaFormatter extends React.Component {
|
|
|
38
45
|
array_type,
|
|
39
46
|
array_data
|
|
40
47
|
} = column.data;
|
|
41
|
-
if (!array_type || array_type === CellType.LINK) {
|
|
48
|
+
if (!array_type || array_type === _dtableUtils.CellType.LINK) {
|
|
42
49
|
return null;
|
|
43
50
|
}
|
|
44
|
-
const Formatter =
|
|
51
|
+
const Formatter = _baseFormatterConfig.default[array_type];
|
|
45
52
|
let formatterProps = this.getFormatterProps(array_type, array_data, collaborators);
|
|
46
|
-
if (isArrayFormatColumn(array_type)) {
|
|
53
|
+
if ((0, _utils.isArrayFormatColumn)(array_type)) {
|
|
47
54
|
formatterProps.value = value;
|
|
48
55
|
return this.renderBorder(this.createColumnFormatter(Formatter, formatterProps));
|
|
49
56
|
}
|
|
50
57
|
let cellValue = value;
|
|
51
58
|
if (!Array.isArray(value)) {
|
|
52
|
-
cellValue =
|
|
59
|
+
cellValue = (0, _cellValueValidator.default)(value, array_type) ? [value] : [];
|
|
53
60
|
}
|
|
54
|
-
return this.renderBorder( /*#__PURE__*/
|
|
61
|
+
return this.renderBorder( /*#__PURE__*/_react.default.createElement("div", {
|
|
55
62
|
className: "dtable-ui formula-formatter multiple"
|
|
56
63
|
}, cellValue.map((v, index) => {
|
|
57
64
|
formatterProps.value = v;
|
|
58
|
-
return /*#__PURE__*/
|
|
59
|
-
className: "formula-formatter-content-item ".concat(isSimpleCellFormatter(array_type) ? 'simple-cell-formatter' : ''),
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
+
className: "formula-formatter-content-item ".concat((0, _utils.isSimpleCellFormatter)(array_type) ? 'simple-cell-formatter' : ''),
|
|
60
67
|
key: "formula-formatter-content-item-".concat(index)
|
|
61
68
|
}, this.createColumnFormatter(Formatter, formatterProps));
|
|
62
69
|
})));
|
|
63
70
|
};
|
|
64
71
|
this.getFormatterProps = (array_type, array_data, collaborators) => {
|
|
65
72
|
switch (array_type) {
|
|
66
|
-
case CellType.DURATION:
|
|
73
|
+
case _dtableUtils.CellType.DURATION:
|
|
67
74
|
{
|
|
68
75
|
const {
|
|
69
76
|
duration_format
|
|
@@ -72,9 +79,9 @@ export default class RowExpandFormulaFormatter extends React.Component {
|
|
|
72
79
|
format: duration_format
|
|
73
80
|
};
|
|
74
81
|
}
|
|
75
|
-
case CellType.NUMBER:
|
|
76
|
-
case CellType.RATE:
|
|
77
|
-
case CellType.GEOLOCATION:
|
|
82
|
+
case _dtableUtils.CellType.NUMBER:
|
|
83
|
+
case _dtableUtils.CellType.RATE:
|
|
84
|
+
case _dtableUtils.CellType.GEOLOCATION:
|
|
78
85
|
{
|
|
79
86
|
return {
|
|
80
87
|
data: array_data
|
|
@@ -91,14 +98,14 @@ export default class RowExpandFormulaFormatter extends React.Component {
|
|
|
91
98
|
};
|
|
92
99
|
}
|
|
93
100
|
createColumnFormatter(Formatter, formatterProps) {
|
|
94
|
-
if (
|
|
95
|
-
return
|
|
101
|
+
if ( /*#__PURE__*/_react.default.isValidElement(Formatter)) {
|
|
102
|
+
return /*#__PURE__*/_react.default.cloneElement(Formatter, {
|
|
96
103
|
...formatterProps
|
|
97
104
|
});
|
|
98
|
-
} else if (isFunction(Formatter)) {
|
|
99
|
-
return /*#__PURE__*/
|
|
105
|
+
} else if ((0, _utils.isFunction)(Formatter)) {
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(Formatter, formatterProps);
|
|
100
107
|
} else {
|
|
101
|
-
return /*#__PURE__*/
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement(_TextFormatter.default, formatterProps);
|
|
102
109
|
}
|
|
103
110
|
}
|
|
104
111
|
render() {
|
|
@@ -117,28 +124,29 @@ export default class RowExpandFormulaFormatter extends React.Component {
|
|
|
117
124
|
} = data;
|
|
118
125
|
if (!value) return null;
|
|
119
126
|
if (Array.isArray(value)) {
|
|
120
|
-
value = getFormulaArrayValue(value);
|
|
121
|
-
if (array_type === CellType.LONG_TEXT) {
|
|
122
|
-
value = value.map(item => convertValueToDtableLongTextValue(item));
|
|
127
|
+
value = (0, _utils.getFormulaArrayValue)(value);
|
|
128
|
+
if (array_type === _dtableUtils.CellType.LONG_TEXT) {
|
|
129
|
+
value = value.map(item => (0, _utils.convertValueToDtableLongTextValue)(item));
|
|
123
130
|
}
|
|
124
131
|
}
|
|
125
|
-
if (result_type === FORMULA_RESULT_TYPE.ARRAY) {
|
|
132
|
+
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) {
|
|
126
133
|
return this.renderOtherColumnFormatter();
|
|
127
134
|
}
|
|
128
135
|
if (typeof value === 'object') {
|
|
129
136
|
return null;
|
|
130
137
|
}
|
|
131
|
-
const formattedValue = getFormulaDisplayString(value, data, {
|
|
138
|
+
const formattedValue = (0, _dtableUtils.getFormulaDisplayString)(value, data, {
|
|
132
139
|
collaborators
|
|
133
140
|
});
|
|
134
141
|
let className = "dtable-ui cell-formatter-container formula-formatter ".concat(containerClassName);
|
|
135
|
-
if (result_type === FORMULA_RESULT_TYPE.NUMBER) {
|
|
142
|
+
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.NUMBER) {
|
|
136
143
|
className = className + ' text-right';
|
|
137
144
|
}
|
|
138
|
-
return this.renderBorder( /*#__PURE__*/
|
|
145
|
+
return this.renderBorder( /*#__PURE__*/_react.default.createElement("div", {
|
|
139
146
|
className: className,
|
|
140
147
|
title: formattedValue,
|
|
141
148
|
"aria-label": formattedValue
|
|
142
149
|
}, formattedValue));
|
|
143
150
|
}
|
|
144
|
-
}
|
|
151
|
+
}
|
|
152
|
+
exports.default = RowExpandFormulaFormatter;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _rowExpandImageItemFormatter = _interopRequireDefault(require("./row-expand-image-item-formatter"));
|
|
12
|
+
var _ImagePreviewerLightbox = _interopRequireDefault(require("../ImagePreviewerLightbox"));
|
|
13
|
+
require("./index.css");
|
|
14
|
+
class RowExpandImageFormatter extends _react.default.Component {
|
|
7
15
|
constructor(props) {
|
|
8
16
|
super(props);
|
|
9
17
|
this.onImageClick = index => {
|
|
@@ -54,10 +62,10 @@ export default class RowExpandImageFormatter extends React.Component {
|
|
|
54
62
|
if (!Array.isArray(value) || value.length === 0) {
|
|
55
63
|
return null;
|
|
56
64
|
}
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
className:
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
+
className: (0, _classnames.default)('dtable-ui cell-formatter-container row-expand-image-formatter', containerClassName)
|
|
59
67
|
}, value.map((item, index) => {
|
|
60
|
-
return /*#__PURE__*/
|
|
68
|
+
return /*#__PURE__*/_react.default.createElement(_rowExpandImageItemFormatter.default, {
|
|
61
69
|
url: item,
|
|
62
70
|
key: index,
|
|
63
71
|
index: index,
|
|
@@ -67,7 +75,7 @@ export default class RowExpandImageFormatter extends React.Component {
|
|
|
67
75
|
readOnly: readOnly,
|
|
68
76
|
onImageClick: this.onImageClick
|
|
69
77
|
});
|
|
70
|
-
})), isPreviewImage && /*#__PURE__*/
|
|
78
|
+
})), isPreviewImage && /*#__PURE__*/_react.default.createElement(_ImagePreviewerLightbox.default, {
|
|
71
79
|
imageItems: value,
|
|
72
80
|
imageIndex: previewImageIndex,
|
|
73
81
|
closeImagePopup: this.closeImagePopup,
|
|
@@ -83,6 +91,7 @@ export default class RowExpandImageFormatter extends React.Component {
|
|
|
83
91
|
}));
|
|
84
92
|
}
|
|
85
93
|
}
|
|
94
|
+
exports.default = RowExpandImageFormatter;
|
|
86
95
|
RowExpandImageFormatter.defaultProps = {
|
|
87
96
|
readOnly: true,
|
|
88
97
|
value: [],
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactstrap = require("reactstrap");
|
|
11
|
+
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
12
|
+
var _lang = require("../lang");
|
|
13
|
+
var _deleteTip = _interopRequireDefault(require("../common/delete-tip"));
|
|
14
|
+
class RowExpandImageItemFormatter extends _react.Component {
|
|
7
15
|
constructor(props) {
|
|
8
16
|
super(props);
|
|
9
17
|
this.toggleTooltip = () => {
|
|
@@ -56,35 +64,35 @@ export default class RowExpandImageItemFormatter extends Component {
|
|
|
56
64
|
} = this.props;
|
|
57
65
|
const id = 'image-list-preview-item' + column.key + index;
|
|
58
66
|
const name = decodeURI(url.slice(url.lastIndexOf('/') + 1));
|
|
59
|
-
return /*#__PURE__*/
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
60
68
|
key: "image-".concat(index),
|
|
61
69
|
className: "row-expand-item-image",
|
|
62
70
|
id: id,
|
|
63
71
|
onClick: this.onClickImage
|
|
64
|
-
}, /*#__PURE__*/
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
65
73
|
src: url,
|
|
66
74
|
id: "item-image-".concat(index),
|
|
67
75
|
alt: name
|
|
68
|
-
}), /*#__PURE__*/
|
|
76
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
69
77
|
className: "dtable-image-icons-choice"
|
|
70
|
-
}, downloadFile && /*#__PURE__*/
|
|
78
|
+
}, downloadFile && /*#__PURE__*/_react.default.createElement("span", {
|
|
71
79
|
className: "image-icon",
|
|
72
80
|
onClick: this.onClickDownload
|
|
73
|
-
}, /*#__PURE__*/
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
74
82
|
className: "dtable-font dtable-icon-download"
|
|
75
|
-
})), !readOnly && deleteFile && /*#__PURE__*/
|
|
83
|
+
})), !readOnly && deleteFile && /*#__PURE__*/_react.default.createElement("span", {
|
|
76
84
|
className: "image-icon",
|
|
77
85
|
onClick: this.onClickDelete
|
|
78
|
-
}, /*#__PURE__*/
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
79
87
|
className: "dtable-font dtable-icon-fork-number"
|
|
80
|
-
})))), this.state.isDeleteTipOpen && /*#__PURE__*/
|
|
88
|
+
})))), this.state.isDeleteTipOpen && /*#__PURE__*/_react.default.createElement(_deleteTip.default, {
|
|
81
89
|
position: this.position,
|
|
82
90
|
toggle: this.closeDeleteTip,
|
|
83
91
|
onDelete: this.onDelete,
|
|
84
|
-
deleteTip: getLocale('Are_you_sure_you_want_to_delete_this_image')
|
|
85
|
-
}), /*#__PURE__*/
|
|
92
|
+
deleteTip: (0, _lang.getLocale)('Are_you_sure_you_want_to_delete_this_image')
|
|
93
|
+
}), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
|
|
86
94
|
query: '(min-width: 768px)'
|
|
87
|
-
}, /*#__PURE__*/
|
|
95
|
+
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Tooltip, {
|
|
88
96
|
placement: "bottom",
|
|
89
97
|
isOpen: this.state.isTooltipOpen,
|
|
90
98
|
toggle: this.toggleTooltip,
|
|
@@ -96,4 +104,5 @@ export default class RowExpandImageItemFormatter extends Component {
|
|
|
96
104
|
fade: false
|
|
97
105
|
}, name)));
|
|
98
106
|
}
|
|
99
|
-
}
|
|
107
|
+
}
|
|
108
|
+
exports.default = RowExpandImageItemFormatter;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getImageThumbnailUrl = void 0;
|
|
7
|
+
const getImageThumbnailUrl = (url, server) => {
|
|
2
8
|
if (server && url.indexOf(server) > -1) {
|
|
3
9
|
return url.replace('/workspace', '/thumbnail/workspace') + '?size=256';
|
|
4
10
|
}
|
|
5
11
|
return url;
|
|
6
|
-
};
|
|
12
|
+
};
|
|
13
|
+
exports.getImageThumbnailUrl = getImageThumbnailUrl;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _dtableUtils = require("dtable-utils");
|
|
11
|
+
var _CollaboratorItem = _interopRequireDefault(require("../CollaboratorItem"));
|
|
12
|
+
class CollaboratorItemFormatter extends _react.Component {
|
|
5
13
|
constructor(_props) {
|
|
6
14
|
super(_props);
|
|
7
15
|
this.calculateCollaboratorData = props => {
|
|
@@ -54,7 +62,7 @@ export default class CollaboratorItemFormatter extends Component {
|
|
|
54
62
|
});
|
|
55
63
|
return;
|
|
56
64
|
}
|
|
57
|
-
if (!isValidEmail(cellValue)) {
|
|
65
|
+
if (!(0, _dtableUtils.isValidEmail)(cellValue)) {
|
|
58
66
|
collaborator = {
|
|
59
67
|
name: cellValue,
|
|
60
68
|
avatar_url: defaultAvatarUrl
|
|
@@ -107,9 +115,10 @@ export default class CollaboratorItemFormatter extends Component {
|
|
|
107
115
|
if (!isDataLoaded || !cellValue || !collaborator) {
|
|
108
116
|
return this.props.renderEmpty();
|
|
109
117
|
}
|
|
110
|
-
return /*#__PURE__*/
|
|
118
|
+
return /*#__PURE__*/_react.default.createElement(_CollaboratorItem.default, {
|
|
111
119
|
collaborator: collaborator,
|
|
112
120
|
enableDeleteCollaborator: false
|
|
113
121
|
});
|
|
114
122
|
}
|
|
115
|
-
}
|
|
123
|
+
}
|
|
124
|
+
exports.default = CollaboratorItemFormatter;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
var _index = require("../index");
|
|
12
|
+
var _collaboratorItemFormatter = _interopRequireDefault(require("./collaborator-item-formatter"));
|
|
13
|
+
var _utils = require("./utils");
|
|
14
|
+
var _valueDisplayUtils = require("./value-display-utils");
|
|
15
|
+
require("./index.css");
|
|
16
|
+
class RowExpandLinkFormatter extends _react.Component {
|
|
9
17
|
render() {
|
|
10
18
|
const props = this.props;
|
|
11
19
|
const {
|
|
@@ -30,38 +38,38 @@ export default class RowExpandLinkFormatter extends Component {
|
|
|
30
38
|
type: displayColumnType,
|
|
31
39
|
data: displayColumnData
|
|
32
40
|
} = displayColumn;
|
|
33
|
-
const cellValue = getFormulaArrayValue(value, !isArrayFormatColumn(displayColumnType));
|
|
41
|
+
const cellValue = (0, _utils.getFormulaArrayValue)(value, !(0, _utils.isArrayFormatColumn)(displayColumnType));
|
|
34
42
|
if (!Array.isArray(cellValue) || cellValue.length === 0) {
|
|
35
43
|
return props.renderEmpty();
|
|
36
44
|
}
|
|
37
45
|
switch (displayColumnType) {
|
|
38
|
-
case CellType.TEXT:
|
|
39
|
-
case CellType.AUTO_NUMBER:
|
|
40
|
-
case CellType.EMAIL:
|
|
41
|
-
case CellType.URL:
|
|
42
|
-
case CellType.DURATION:
|
|
43
|
-
case CellType.NUMBER:
|
|
46
|
+
case _constants.CellType.TEXT:
|
|
47
|
+
case _constants.CellType.AUTO_NUMBER:
|
|
48
|
+
case _constants.CellType.EMAIL:
|
|
49
|
+
case _constants.CellType.URL:
|
|
50
|
+
case _constants.CellType.DURATION:
|
|
51
|
+
case _constants.CellType.NUMBER:
|
|
44
52
|
{
|
|
45
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
54
|
className: containerClassName
|
|
47
55
|
}, cellValue.map((value, index) => {
|
|
48
56
|
if (!value) return null;
|
|
49
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
50
58
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
51
59
|
className: "row-expand-link-item"
|
|
52
60
|
}, value);
|
|
53
61
|
}));
|
|
54
62
|
}
|
|
55
|
-
case CellType.DATE:
|
|
63
|
+
case _constants.CellType.DATE:
|
|
56
64
|
{
|
|
57
|
-
return /*#__PURE__*/
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
58
66
|
className: containerClassName
|
|
59
67
|
}, cellValue.map((value, index) => {
|
|
60
68
|
if (!value || typeof value !== 'string') return null;
|
|
61
69
|
const {
|
|
62
70
|
format
|
|
63
71
|
} = displayColumnData || {};
|
|
64
|
-
return /*#__PURE__*/
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement(_index.DateFormatter, {
|
|
65
73
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
66
74
|
value: value,
|
|
67
75
|
format: format,
|
|
@@ -69,40 +77,40 @@ export default class RowExpandLinkFormatter extends Component {
|
|
|
69
77
|
});
|
|
70
78
|
}));
|
|
71
79
|
}
|
|
72
|
-
case CellType.CTIME:
|
|
80
|
+
case _constants.CellType.CTIME:
|
|
73
81
|
{
|
|
74
|
-
return /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
75
83
|
className: containerClassName
|
|
76
84
|
}, cellValue.map((value, index) => {
|
|
77
85
|
if (!value) return null;
|
|
78
|
-
return /*#__PURE__*/
|
|
86
|
+
return /*#__PURE__*/_react.default.createElement(_index.CTimeFormatter, {
|
|
79
87
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
80
88
|
value: value,
|
|
81
89
|
containerClassName: "row-expand-link-item"
|
|
82
90
|
});
|
|
83
91
|
}));
|
|
84
92
|
}
|
|
85
|
-
case CellType.MTIME:
|
|
93
|
+
case _constants.CellType.MTIME:
|
|
86
94
|
{
|
|
87
|
-
return /*#__PURE__*/
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
88
96
|
className: containerClassName
|
|
89
97
|
}, cellValue.map((value, index) => {
|
|
90
98
|
if (!value) return null;
|
|
91
|
-
return /*#__PURE__*/
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement(_index.MTimeFormatter, {
|
|
92
100
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
93
101
|
value: value,
|
|
94
102
|
containerClassName: "row-expand-link-item"
|
|
95
103
|
});
|
|
96
104
|
}));
|
|
97
105
|
}
|
|
98
|
-
case CellType.CREATOR:
|
|
99
|
-
case CellType.LAST_MODIFIER:
|
|
106
|
+
case _constants.CellType.CREATOR:
|
|
107
|
+
case _constants.CellType.LAST_MODIFIER:
|
|
100
108
|
{
|
|
101
|
-
return /*#__PURE__*/
|
|
109
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
102
110
|
className: "dtable-ui cell-formatter-container collaborator-formatter sql-query-collaborator-formatter"
|
|
103
111
|
}, cellValue.map((value, index) => {
|
|
104
112
|
if (!value) return null;
|
|
105
|
-
return /*#__PURE__*/
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement(_collaboratorItemFormatter.default, {
|
|
106
114
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
107
115
|
cellValue: value,
|
|
108
116
|
collaborators: collaborators,
|
|
@@ -111,24 +119,24 @@ export default class RowExpandLinkFormatter extends Component {
|
|
|
111
119
|
});
|
|
112
120
|
}));
|
|
113
121
|
}
|
|
114
|
-
case CellType.SINGLE_SELECT:
|
|
122
|
+
case _constants.CellType.SINGLE_SELECT:
|
|
115
123
|
{
|
|
116
124
|
const options = displayColumnData && Array.isArray(displayColumnData.options) ? displayColumnData.options : [];
|
|
117
|
-
return /*#__PURE__*/
|
|
125
|
+
return /*#__PURE__*/_react.default.createElement(_index.MultipleSelectFormatter, {
|
|
118
126
|
value: cellValue,
|
|
119
127
|
options: options || []
|
|
120
128
|
});
|
|
121
129
|
}
|
|
122
|
-
case CellType.FORMULA:
|
|
130
|
+
case _constants.CellType.FORMULA:
|
|
123
131
|
{
|
|
124
|
-
return /*#__PURE__*/
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
125
133
|
className: containerClassName
|
|
126
134
|
}, cellValue.map((value, index) => {
|
|
127
135
|
if (!value) return null;
|
|
128
|
-
return /*#__PURE__*/
|
|
136
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
129
137
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
130
138
|
className: "row-expand-link-item"
|
|
131
|
-
}, getCellDisplayValue({
|
|
139
|
+
}, (0, _valueDisplayUtils.getCellDisplayValue)({
|
|
132
140
|
[displayColumn.key]: value
|
|
133
141
|
}, displayColumn, collaborators));
|
|
134
142
|
}));
|
|
@@ -139,4 +147,5 @@ export default class RowExpandLinkFormatter extends Component {
|
|
|
139
147
|
}
|
|
140
148
|
}
|
|
141
149
|
}
|
|
142
|
-
}
|
|
150
|
+
}
|
|
151
|
+
exports.default = RowExpandLinkFormatter;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 => {
|
|
3
11
|
if (value === undefined) return false;
|
|
4
12
|
if (value === null) return false;
|
|
5
13
|
if (value === '') return false;
|
|
@@ -7,7 +15,8 @@ export const isValidCellValue = value => {
|
|
|
7
15
|
if (JSON.stringify(value) === '[]') return false;
|
|
8
16
|
return true;
|
|
9
17
|
};
|
|
10
|
-
|
|
18
|
+
exports.isValidCellValue = isValidCellValue;
|
|
19
|
+
const getFormulaArrayValue = function (value) {
|
|
11
20
|
let isFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
12
21
|
if (!Array.isArray(value)) return [];
|
|
13
22
|
if (!isFlat) return getTwoDimensionArrayValue(value);
|
|
@@ -32,7 +41,8 @@ export const getFormulaArrayValue = function (value) {
|
|
|
32
41
|
});
|
|
33
42
|
}).flat().filter(item => isValidCellValue(item));
|
|
34
43
|
};
|
|
35
|
-
|
|
44
|
+
exports.getFormulaArrayValue = getFormulaArrayValue;
|
|
45
|
+
const getTwoDimensionArrayValue = value => {
|
|
36
46
|
if (!Array.isArray(value)) return [];
|
|
37
47
|
return value.map(item => {
|
|
38
48
|
if (Object.prototype.toString.call(item) !== '[object Object]') {
|
|
@@ -55,6 +65,7 @@ export const getTwoDimensionArrayValue = value => {
|
|
|
55
65
|
});
|
|
56
66
|
});
|
|
57
67
|
};
|
|
58
|
-
|
|
59
|
-
|
|
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);
|
|
60
71
|
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCellDisplayValue = void 0;
|
|
7
|
+
var _dtableUtils = require("dtable-utils");
|
|
8
|
+
const DOWNLOAD_NAME_COLUMN_TYPES = [_dtableUtils.CellType.TEXT, _dtableUtils.CellType.NUMBER, _dtableUtils.CellType.DATE, _dtableUtils.CellType.COLLABORATOR, _dtableUtils.CellType.CREATOR, _dtableUtils.CellType.AUTO_NUMBER];
|
|
9
|
+
const getCellDisplayValue = (record, column, collaborators) => {
|
|
4
10
|
if (!column || !DOWNLOAD_NAME_COLUMN_TYPES.includes(column.type)) return '';
|
|
5
11
|
const {
|
|
6
12
|
key,
|
|
7
13
|
type,
|
|
8
14
|
data
|
|
9
15
|
} = column;
|
|
10
|
-
return getCellValueDisplayString(record, type, key, {
|
|
16
|
+
return (0, _dtableUtils.getCellValueDisplayString)(record, type, key, {
|
|
11
17
|
data,
|
|
12
18
|
collaborators,
|
|
13
19
|
geolocationHyphen: ' '
|
|
14
20
|
});
|
|
15
|
-
};
|
|
21
|
+
};
|
|
22
|
+
exports.getCellDisplayValue = getCellDisplayValue;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
require("./index.css");
|
|
11
|
+
class RateExpendRateFormatter extends _react.default.Component {
|
|
5
12
|
constructor() {
|
|
6
13
|
super(...arguments);
|
|
7
14
|
this.getRateList = () => {
|
|
@@ -19,7 +26,7 @@ class RateExpendRateFormatter extends React.Component {
|
|
|
19
26
|
let style = {
|
|
20
27
|
color: value >= i + 1 ? rate_style_color : '#e5e5e5'
|
|
21
28
|
};
|
|
22
|
-
rateList.push( /*#__PURE__*/
|
|
29
|
+
rateList.push( /*#__PURE__*/_react.default.createElement("i", {
|
|
23
30
|
key: "dtable-ui-component-rate-".concat(i),
|
|
24
31
|
className: "dtable-font ".concat(rate_style_type),
|
|
25
32
|
style: style
|
|
@@ -32,9 +39,9 @@ class RateExpendRateFormatter extends React.Component {
|
|
|
32
39
|
const {
|
|
33
40
|
containerClassName
|
|
34
41
|
} = this.props;
|
|
35
|
-
const className =
|
|
42
|
+
const className = (0, _classnames.default)('dtable-ui cell-formatter-container rate-formatter', containerClassName);
|
|
36
43
|
const rateList = this.getRateList();
|
|
37
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
45
|
className: className
|
|
39
46
|
}, rateList);
|
|
40
47
|
}
|
|
@@ -43,4 +50,4 @@ RateExpendRateFormatter.defaultProps = {
|
|
|
43
50
|
value: '',
|
|
44
51
|
containerClassName: ''
|
|
45
52
|
};
|
|
46
|
-
|
|
53
|
+
var _default = exports.default = RateExpendRateFormatter;
|