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,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CellType, FORMULA_RESULT_TYPE, getFormulaDisplayString } from 'dtable-utils';
|
|
3
|
+
import BaseFormatterConfig from '../formatterConfig/base-formatter-config';
|
|
4
|
+
import TextFormatter from '../TextFormatter';
|
|
5
|
+
import { isArrayFormatColumn, isSimpleCellFormatter, isFunction, getFormulaArrayValue, convertValueToDtableLongTextValue } from '../FormulaFormatter/utils';
|
|
6
|
+
import cellValueValidator from '../FormulaFormatter/cell-value-validator';
|
|
7
|
+
import '../FormulaFormatter/index.css';
|
|
8
|
+
export default class RowExpandFormulaFormatter extends React.Component {
|
|
16
9
|
constructor() {
|
|
17
10
|
super(...arguments);
|
|
18
11
|
this.renderBorder = dom => {
|
|
@@ -25,12 +18,12 @@ class RowExpandFormulaFormatter extends _react.default.Component {
|
|
|
25
18
|
let style = {
|
|
26
19
|
minHeight: '38px'
|
|
27
20
|
};
|
|
28
|
-
if (result_type ===
|
|
21
|
+
if (result_type === FORMULA_RESULT_TYPE.DATE || result_type === FORMULA_RESULT_TYPE.NUMBER) {
|
|
29
22
|
style = {
|
|
30
23
|
width: '320px'
|
|
31
24
|
};
|
|
32
25
|
}
|
|
33
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
34
27
|
className: "d-flex align-items-center form-control disabled h-auto",
|
|
35
28
|
style: style
|
|
36
29
|
}, dom);
|
|
@@ -45,32 +38,32 @@ class RowExpandFormulaFormatter extends _react.default.Component {
|
|
|
45
38
|
array_type,
|
|
46
39
|
array_data
|
|
47
40
|
} = column.data;
|
|
48
|
-
if (!array_type || array_type ===
|
|
41
|
+
if (!array_type || array_type === CellType.LINK) {
|
|
49
42
|
return null;
|
|
50
43
|
}
|
|
51
|
-
const Formatter =
|
|
44
|
+
const Formatter = BaseFormatterConfig[array_type];
|
|
52
45
|
let formatterProps = this.getFormatterProps(array_type, array_data, collaborators);
|
|
53
|
-
if (
|
|
46
|
+
if (isArrayFormatColumn(array_type)) {
|
|
54
47
|
formatterProps.value = value;
|
|
55
48
|
return this.renderBorder(this.createColumnFormatter(Formatter, formatterProps));
|
|
56
49
|
}
|
|
57
50
|
let cellValue = value;
|
|
58
51
|
if (!Array.isArray(value)) {
|
|
59
|
-
cellValue = (
|
|
52
|
+
cellValue = cellValueValidator(value, array_type) ? [value] : [];
|
|
60
53
|
}
|
|
61
|
-
return this.renderBorder( /*#__PURE__*/
|
|
54
|
+
return this.renderBorder( /*#__PURE__*/React.createElement("div", {
|
|
62
55
|
className: "dtable-ui formula-formatter multiple"
|
|
63
56
|
}, cellValue.map((v, index) => {
|
|
64
57
|
formatterProps.value = v;
|
|
65
|
-
return /*#__PURE__*/
|
|
66
|
-
className: "formula-formatter-content-item ".concat(
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: "formula-formatter-content-item ".concat(isSimpleCellFormatter(array_type) ? 'simple-cell-formatter' : ''),
|
|
67
60
|
key: "formula-formatter-content-item-".concat(index)
|
|
68
61
|
}, this.createColumnFormatter(Formatter, formatterProps));
|
|
69
62
|
})));
|
|
70
63
|
};
|
|
71
64
|
this.getFormatterProps = (array_type, array_data, collaborators) => {
|
|
72
65
|
switch (array_type) {
|
|
73
|
-
case
|
|
66
|
+
case CellType.DURATION:
|
|
74
67
|
{
|
|
75
68
|
const {
|
|
76
69
|
duration_format
|
|
@@ -79,9 +72,9 @@ class RowExpandFormulaFormatter extends _react.default.Component {
|
|
|
79
72
|
format: duration_format
|
|
80
73
|
};
|
|
81
74
|
}
|
|
82
|
-
case
|
|
83
|
-
case
|
|
84
|
-
case
|
|
75
|
+
case CellType.NUMBER:
|
|
76
|
+
case CellType.RATE:
|
|
77
|
+
case CellType.GEOLOCATION:
|
|
85
78
|
{
|
|
86
79
|
return {
|
|
87
80
|
data: array_data
|
|
@@ -98,14 +91,14 @@ class RowExpandFormulaFormatter extends _react.default.Component {
|
|
|
98
91
|
};
|
|
99
92
|
}
|
|
100
93
|
createColumnFormatter(Formatter, formatterProps) {
|
|
101
|
-
if (
|
|
102
|
-
return
|
|
94
|
+
if (React.isValidElement(Formatter)) {
|
|
95
|
+
return React.cloneElement(Formatter, {
|
|
103
96
|
...formatterProps
|
|
104
97
|
});
|
|
105
|
-
} else if (
|
|
106
|
-
return /*#__PURE__*/
|
|
98
|
+
} else if (isFunction(Formatter)) {
|
|
99
|
+
return /*#__PURE__*/React.createElement(Formatter, formatterProps);
|
|
107
100
|
} else {
|
|
108
|
-
return /*#__PURE__*/
|
|
101
|
+
return /*#__PURE__*/React.createElement(TextFormatter, formatterProps);
|
|
109
102
|
}
|
|
110
103
|
}
|
|
111
104
|
render() {
|
|
@@ -124,29 +117,28 @@ class RowExpandFormulaFormatter extends _react.default.Component {
|
|
|
124
117
|
} = data;
|
|
125
118
|
if (!value) return null;
|
|
126
119
|
if (Array.isArray(value)) {
|
|
127
|
-
value =
|
|
128
|
-
if (array_type ===
|
|
129
|
-
value = value.map(item =>
|
|
120
|
+
value = getFormulaArrayValue(value);
|
|
121
|
+
if (array_type === CellType.LONG_TEXT) {
|
|
122
|
+
value = value.map(item => convertValueToDtableLongTextValue(item));
|
|
130
123
|
}
|
|
131
124
|
}
|
|
132
|
-
if (result_type ===
|
|
125
|
+
if (result_type === FORMULA_RESULT_TYPE.ARRAY) {
|
|
133
126
|
return this.renderOtherColumnFormatter();
|
|
134
127
|
}
|
|
135
128
|
if (typeof value === 'object') {
|
|
136
129
|
return null;
|
|
137
130
|
}
|
|
138
|
-
const formattedValue =
|
|
131
|
+
const formattedValue = getFormulaDisplayString(value, data, {
|
|
139
132
|
collaborators
|
|
140
133
|
});
|
|
141
134
|
let className = "dtable-ui cell-formatter-container formula-formatter ".concat(containerClassName);
|
|
142
|
-
if (result_type ===
|
|
135
|
+
if (result_type === FORMULA_RESULT_TYPE.NUMBER) {
|
|
143
136
|
className = className + ' text-right';
|
|
144
137
|
}
|
|
145
|
-
return this.renderBorder( /*#__PURE__*/
|
|
138
|
+
return this.renderBorder( /*#__PURE__*/React.createElement("div", {
|
|
146
139
|
className: className,
|
|
147
140
|
title: formattedValue,
|
|
148
141
|
"aria-label": formattedValue
|
|
149
142
|
}, formattedValue));
|
|
150
143
|
}
|
|
151
|
-
}
|
|
152
|
-
exports.default = RowExpandFormulaFormatter;
|
|
144
|
+
}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 {
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import RowExpandImageImageFormatter from './row-expand-image-item-formatter';
|
|
4
|
+
import ImagePreviewerLightbox from '../ImagePreviewerLightbox';
|
|
5
|
+
import './index.css';
|
|
6
|
+
export default class RowExpandImageFormatter extends React.Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.onImageClick = index => {
|
|
@@ -62,10 +54,10 @@ class RowExpandImageFormatter extends _react.default.Component {
|
|
|
62
54
|
if (!Array.isArray(value) || value.length === 0) {
|
|
63
55
|
return null;
|
|
64
56
|
}
|
|
65
|
-
return /*#__PURE__*/
|
|
66
|
-
className: (
|
|
57
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: classnames('dtable-ui cell-formatter-container row-expand-image-formatter', containerClassName)
|
|
67
59
|
}, value.map((item, index) => {
|
|
68
|
-
return /*#__PURE__*/
|
|
60
|
+
return /*#__PURE__*/React.createElement(RowExpandImageImageFormatter, {
|
|
69
61
|
url: item,
|
|
70
62
|
key: index,
|
|
71
63
|
index: index,
|
|
@@ -75,7 +67,7 @@ class RowExpandImageFormatter extends _react.default.Component {
|
|
|
75
67
|
readOnly: readOnly,
|
|
76
68
|
onImageClick: this.onImageClick
|
|
77
69
|
});
|
|
78
|
-
})), isPreviewImage && /*#__PURE__*/
|
|
70
|
+
})), isPreviewImage && /*#__PURE__*/React.createElement(ImagePreviewerLightbox, {
|
|
79
71
|
imageItems: value,
|
|
80
72
|
imageIndex: previewImageIndex,
|
|
81
73
|
closeImagePopup: this.closeImagePopup,
|
|
@@ -91,7 +83,6 @@ class RowExpandImageFormatter extends _react.default.Component {
|
|
|
91
83
|
}));
|
|
92
84
|
}
|
|
93
85
|
}
|
|
94
|
-
exports.default = RowExpandImageFormatter;
|
|
95
86
|
RowExpandImageFormatter.defaultProps = {
|
|
96
87
|
readOnly: true,
|
|
97
88
|
value: [],
|
|
@@ -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 _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
12
|
-
var _lang = require("../lang");
|
|
13
|
-
var _deleteTip = _interopRequireDefault(require("../common/delete-tip"));
|
|
14
|
-
class RowExpandImageItemFormatter extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { Tooltip } from 'reactstrap';
|
|
3
|
+
import MediaQuery from 'react-responsive';
|
|
4
|
+
import { getLocale } from '../lang';
|
|
5
|
+
import DeleteTip from '../common/delete-tip';
|
|
6
|
+
export default class RowExpandImageItemFormatter extends Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.toggleTooltip = () => {
|
|
@@ -64,35 +56,35 @@ class RowExpandImageItemFormatter extends _react.Component {
|
|
|
64
56
|
} = this.props;
|
|
65
57
|
const id = 'image-list-preview-item' + column.key + index;
|
|
66
58
|
const name = decodeURI(url.slice(url.lastIndexOf('/') + 1));
|
|
67
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
68
60
|
key: "image-".concat(index),
|
|
69
61
|
className: "row-expand-item-image",
|
|
70
62
|
id: id,
|
|
71
63
|
onClick: this.onClickImage
|
|
72
|
-
}, /*#__PURE__*/
|
|
64
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
73
65
|
src: url,
|
|
74
66
|
id: "item-image-".concat(index),
|
|
75
67
|
alt: name
|
|
76
|
-
}), /*#__PURE__*/
|
|
68
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
77
69
|
className: "dtable-image-icons-choice"
|
|
78
|
-
}, downloadFile && /*#__PURE__*/
|
|
70
|
+
}, downloadFile && /*#__PURE__*/React.createElement("span", {
|
|
79
71
|
className: "image-icon",
|
|
80
72
|
onClick: this.onClickDownload
|
|
81
|
-
}, /*#__PURE__*/
|
|
73
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
82
74
|
className: "dtable-font dtable-icon-download"
|
|
83
|
-
})), !readOnly && deleteFile && /*#__PURE__*/
|
|
75
|
+
})), !readOnly && deleteFile && /*#__PURE__*/React.createElement("span", {
|
|
84
76
|
className: "image-icon",
|
|
85
77
|
onClick: this.onClickDelete
|
|
86
|
-
}, /*#__PURE__*/
|
|
78
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
87
79
|
className: "dtable-font dtable-icon-fork-number"
|
|
88
|
-
})))), this.state.isDeleteTipOpen && /*#__PURE__*/
|
|
80
|
+
})))), this.state.isDeleteTipOpen && /*#__PURE__*/React.createElement(DeleteTip, {
|
|
89
81
|
position: this.position,
|
|
90
82
|
toggle: this.closeDeleteTip,
|
|
91
83
|
onDelete: this.onDelete,
|
|
92
|
-
deleteTip:
|
|
93
|
-
}), /*#__PURE__*/
|
|
84
|
+
deleteTip: getLocale('Are_you_sure_you_want_to_delete_this_image')
|
|
85
|
+
}), /*#__PURE__*/React.createElement(MediaQuery, {
|
|
94
86
|
query: '(min-width: 768px)'
|
|
95
|
-
}, /*#__PURE__*/
|
|
87
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
96
88
|
placement: "bottom",
|
|
97
89
|
isOpen: this.state.isTooltipOpen,
|
|
98
90
|
toggle: this.toggleTooltip,
|
|
@@ -104,5 +96,4 @@ class RowExpandImageItemFormatter extends _react.Component {
|
|
|
104
96
|
fade: false
|
|
105
97
|
}, name)));
|
|
106
98
|
}
|
|
107
|
-
}
|
|
108
|
-
exports.default = RowExpandImageItemFormatter;
|
|
99
|
+
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getImageThumbnailUrl = void 0;
|
|
7
|
-
const getImageThumbnailUrl = (url, server) => {
|
|
1
|
+
export const getImageThumbnailUrl = (url, server) => {
|
|
8
2
|
if (server && url.indexOf(server) > -1) {
|
|
9
3
|
return url.replace('/workspace', '/thumbnail/workspace') + '?size=256';
|
|
10
4
|
}
|
|
11
5
|
return url;
|
|
12
|
-
};
|
|
13
|
-
exports.getImageThumbnailUrl = getImageThumbnailUrl;
|
|
6
|
+
};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { isValidEmail } from 'dtable-utils';
|
|
3
|
+
import CollaboratorItem from '../CollaboratorItem';
|
|
4
|
+
export default class CollaboratorItemFormatter extends Component {
|
|
13
5
|
constructor(_props) {
|
|
14
6
|
super(_props);
|
|
15
7
|
this.calculateCollaboratorData = props => {
|
|
@@ -62,7 +54,7 @@ class CollaboratorItemFormatter extends _react.Component {
|
|
|
62
54
|
});
|
|
63
55
|
return;
|
|
64
56
|
}
|
|
65
|
-
if (!
|
|
57
|
+
if (!isValidEmail(cellValue)) {
|
|
66
58
|
collaborator = {
|
|
67
59
|
name: cellValue,
|
|
68
60
|
avatar_url: defaultAvatarUrl
|
|
@@ -115,10 +107,9 @@ class CollaboratorItemFormatter extends _react.Component {
|
|
|
115
107
|
if (!isDataLoaded || !cellValue || !collaborator) {
|
|
116
108
|
return this.props.renderEmpty();
|
|
117
109
|
}
|
|
118
|
-
return /*#__PURE__*/
|
|
110
|
+
return /*#__PURE__*/React.createElement(CollaboratorItem, {
|
|
119
111
|
collaborator: collaborator,
|
|
120
112
|
enableDeleteCollaborator: false
|
|
121
113
|
});
|
|
122
114
|
}
|
|
123
|
-
}
|
|
124
|
-
exports.default = CollaboratorItemFormatter;
|
|
115
|
+
}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { CellType } from '../constants';
|
|
3
|
+
import { MultipleSelectFormatter, DateFormatter, CTimeFormatter, MTimeFormatter } from '../index';
|
|
4
|
+
import CollaboratorItemFormatter from './collaborator-item-formatter';
|
|
5
|
+
import { getFormulaArrayValue, isArrayFormatColumn } from './utils';
|
|
6
|
+
import { getCellDisplayValue } from './value-display-utils';
|
|
7
|
+
import './index.css';
|
|
8
|
+
export default class RowExpandLinkFormatter extends Component {
|
|
17
9
|
render() {
|
|
18
10
|
const props = this.props;
|
|
19
11
|
const {
|
|
@@ -38,38 +30,38 @@ class RowExpandLinkFormatter extends _react.Component {
|
|
|
38
30
|
type: displayColumnType,
|
|
39
31
|
data: displayColumnData
|
|
40
32
|
} = displayColumn;
|
|
41
|
-
const cellValue =
|
|
33
|
+
const cellValue = getFormulaArrayValue(value, !isArrayFormatColumn(displayColumnType));
|
|
42
34
|
if (!Array.isArray(cellValue) || cellValue.length === 0) {
|
|
43
35
|
return props.renderEmpty();
|
|
44
36
|
}
|
|
45
37
|
switch (displayColumnType) {
|
|
46
|
-
case
|
|
47
|
-
case
|
|
48
|
-
case
|
|
49
|
-
case
|
|
50
|
-
case
|
|
51
|
-
case
|
|
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:
|
|
52
44
|
{
|
|
53
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
46
|
className: containerClassName
|
|
55
47
|
}, cellValue.map((value, index) => {
|
|
56
48
|
if (!value) return null;
|
|
57
|
-
return /*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
58
50
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
59
51
|
className: "row-expand-link-item"
|
|
60
52
|
}, value);
|
|
61
53
|
}));
|
|
62
54
|
}
|
|
63
|
-
case
|
|
55
|
+
case CellType.DATE:
|
|
64
56
|
{
|
|
65
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
58
|
className: containerClassName
|
|
67
59
|
}, cellValue.map((value, index) => {
|
|
68
60
|
if (!value || typeof value !== 'string') return null;
|
|
69
61
|
const {
|
|
70
62
|
format
|
|
71
63
|
} = displayColumnData || {};
|
|
72
|
-
return /*#__PURE__*/
|
|
64
|
+
return /*#__PURE__*/React.createElement(DateFormatter, {
|
|
73
65
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
74
66
|
value: value,
|
|
75
67
|
format: format,
|
|
@@ -77,40 +69,40 @@ class RowExpandLinkFormatter extends _react.Component {
|
|
|
77
69
|
});
|
|
78
70
|
}));
|
|
79
71
|
}
|
|
80
|
-
case
|
|
72
|
+
case CellType.CTIME:
|
|
81
73
|
{
|
|
82
|
-
return /*#__PURE__*/
|
|
74
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
83
75
|
className: containerClassName
|
|
84
76
|
}, cellValue.map((value, index) => {
|
|
85
77
|
if (!value) return null;
|
|
86
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/React.createElement(CTimeFormatter, {
|
|
87
79
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
88
80
|
value: value,
|
|
89
81
|
containerClassName: "row-expand-link-item"
|
|
90
82
|
});
|
|
91
83
|
}));
|
|
92
84
|
}
|
|
93
|
-
case
|
|
85
|
+
case CellType.MTIME:
|
|
94
86
|
{
|
|
95
|
-
return /*#__PURE__*/
|
|
87
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
96
88
|
className: containerClassName
|
|
97
89
|
}, cellValue.map((value, index) => {
|
|
98
90
|
if (!value) return null;
|
|
99
|
-
return /*#__PURE__*/
|
|
91
|
+
return /*#__PURE__*/React.createElement(MTimeFormatter, {
|
|
100
92
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
101
93
|
value: value,
|
|
102
94
|
containerClassName: "row-expand-link-item"
|
|
103
95
|
});
|
|
104
96
|
}));
|
|
105
97
|
}
|
|
106
|
-
case
|
|
107
|
-
case
|
|
98
|
+
case CellType.CREATOR:
|
|
99
|
+
case CellType.LAST_MODIFIER:
|
|
108
100
|
{
|
|
109
|
-
return /*#__PURE__*/
|
|
101
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
102
|
className: "dtable-ui cell-formatter-container collaborator-formatter sql-query-collaborator-formatter"
|
|
111
103
|
}, cellValue.map((value, index) => {
|
|
112
104
|
if (!value) return null;
|
|
113
|
-
return /*#__PURE__*/
|
|
105
|
+
return /*#__PURE__*/React.createElement(CollaboratorItemFormatter, {
|
|
114
106
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
115
107
|
cellValue: value,
|
|
116
108
|
collaborators: collaborators,
|
|
@@ -119,24 +111,24 @@ class RowExpandLinkFormatter extends _react.Component {
|
|
|
119
111
|
});
|
|
120
112
|
}));
|
|
121
113
|
}
|
|
122
|
-
case
|
|
114
|
+
case CellType.SINGLE_SELECT:
|
|
123
115
|
{
|
|
124
116
|
const options = displayColumnData && Array.isArray(displayColumnData.options) ? displayColumnData.options : [];
|
|
125
|
-
return /*#__PURE__*/
|
|
117
|
+
return /*#__PURE__*/React.createElement(MultipleSelectFormatter, {
|
|
126
118
|
value: cellValue,
|
|
127
119
|
options: options || []
|
|
128
120
|
});
|
|
129
121
|
}
|
|
130
|
-
case
|
|
122
|
+
case CellType.FORMULA:
|
|
131
123
|
{
|
|
132
|
-
return /*#__PURE__*/
|
|
124
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
133
125
|
className: containerClassName
|
|
134
126
|
}, cellValue.map((value, index) => {
|
|
135
127
|
if (!value) return null;
|
|
136
|
-
return /*#__PURE__*/
|
|
128
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
137
129
|
key: "link-".concat(displayColumnType, "-").concat(index),
|
|
138
130
|
className: "row-expand-link-item"
|
|
139
|
-
},
|
|
131
|
+
}, getCellDisplayValue({
|
|
140
132
|
[displayColumn.key]: value
|
|
141
133
|
}, displayColumn, collaborators));
|
|
142
134
|
}));
|
|
@@ -147,5 +139,4 @@ class RowExpandLinkFormatter extends _react.Component {
|
|
|
147
139
|
}
|
|
148
140
|
}
|
|
149
141
|
}
|
|
150
|
-
}
|
|
151
|
-
exports.default = RowExpandLinkFormatter;
|
|
142
|
+
}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
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 => {
|
|
1
|
+
import { CellType } from '../constants';
|
|
2
|
+
export const isValidCellValue = value => {
|
|
11
3
|
if (value === undefined) return false;
|
|
12
4
|
if (value === null) return false;
|
|
13
5
|
if (value === '') return false;
|
|
@@ -15,8 +7,7 @@ const isValidCellValue = value => {
|
|
|
15
7
|
if (JSON.stringify(value) === '[]') return false;
|
|
16
8
|
return true;
|
|
17
9
|
};
|
|
18
|
-
|
|
19
|
-
const getFormulaArrayValue = function (value) {
|
|
10
|
+
export const getFormulaArrayValue = function (value) {
|
|
20
11
|
let isFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
21
12
|
if (!Array.isArray(value)) return [];
|
|
22
13
|
if (!isFlat) return getTwoDimensionArrayValue(value);
|
|
@@ -41,8 +32,7 @@ const getFormulaArrayValue = function (value) {
|
|
|
41
32
|
});
|
|
42
33
|
}).flat().filter(item => isValidCellValue(item));
|
|
43
34
|
};
|
|
44
|
-
|
|
45
|
-
const getTwoDimensionArrayValue = value => {
|
|
35
|
+
export const getTwoDimensionArrayValue = value => {
|
|
46
36
|
if (!Array.isArray(value)) return [];
|
|
47
37
|
return value.map(item => {
|
|
48
38
|
if (Object.prototype.toString.call(item) !== '[object Object]') {
|
|
@@ -65,7 +55,6 @@ const getTwoDimensionArrayValue = value => {
|
|
|
65
55
|
});
|
|
66
56
|
});
|
|
67
57
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return [_constants.CellType.IMAGE, _constants.CellType.FILE, _constants.CellType.MULTIPLE_SELECT, _constants.CellType.COLLABORATOR].includes(columnType);
|
|
58
|
+
export function isArrayFormatColumn(columnType) {
|
|
59
|
+
return [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR].includes(columnType);
|
|
71
60
|
}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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) => {
|
|
1
|
+
import { CellType, getCellValueDisplayString } from 'dtable-utils';
|
|
2
|
+
const DOWNLOAD_NAME_COLUMN_TYPES = [CellType.TEXT, CellType.NUMBER, CellType.DATE, CellType.COLLABORATOR, CellType.CREATOR, CellType.AUTO_NUMBER];
|
|
3
|
+
export const getCellDisplayValue = (record, column, collaborators) => {
|
|
10
4
|
if (!column || !DOWNLOAD_NAME_COLUMN_TYPES.includes(column.type)) return '';
|
|
11
5
|
const {
|
|
12
6
|
key,
|
|
13
7
|
type,
|
|
14
8
|
data
|
|
15
9
|
} = column;
|
|
16
|
-
return
|
|
10
|
+
return getCellValueDisplayString(record, type, key, {
|
|
17
11
|
data,
|
|
18
12
|
collaborators,
|
|
19
13
|
geolocationHyphen: ' '
|
|
20
14
|
});
|
|
21
|
-
};
|
|
22
|
-
exports.getCellDisplayValue = getCellDisplayValue;
|
|
15
|
+
};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class RateExpendRateFormatter extends React.Component {
|
|
12
5
|
constructor() {
|
|
13
6
|
super(...arguments);
|
|
14
7
|
this.getRateList = () => {
|
|
@@ -26,7 +19,7 @@ class RateExpendRateFormatter extends _react.default.Component {
|
|
|
26
19
|
let style = {
|
|
27
20
|
color: value >= i + 1 ? rate_style_color : '#e5e5e5'
|
|
28
21
|
};
|
|
29
|
-
rateList.push( /*#__PURE__*/
|
|
22
|
+
rateList.push( /*#__PURE__*/React.createElement("i", {
|
|
30
23
|
key: "dtable-ui-component-rate-".concat(i),
|
|
31
24
|
className: "dtable-font ".concat(rate_style_type),
|
|
32
25
|
style: style
|
|
@@ -39,9 +32,9 @@ class RateExpendRateFormatter extends _react.default.Component {
|
|
|
39
32
|
const {
|
|
40
33
|
containerClassName
|
|
41
34
|
} = this.props;
|
|
42
|
-
const className = (
|
|
35
|
+
const className = classnames('dtable-ui cell-formatter-container rate-formatter', containerClassName);
|
|
43
36
|
const rateList = this.getRateList();
|
|
44
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
38
|
className: className
|
|
46
39
|
}, rateList);
|
|
47
40
|
}
|
|
@@ -50,4 +43,4 @@ RateExpendRateFormatter.defaultProps = {
|
|
|
50
43
|
value: '',
|
|
51
44
|
containerClassName: ''
|
|
52
45
|
};
|
|
53
|
-
|
|
46
|
+
export default RateExpendRateFormatter;
|