dtable-ui-component 0.3.2 → 0.3.4-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/assets/dtable-font/dtable-font.eot +0 -0
- package/assets/dtable-font/dtable-font.svg +319 -11
- 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 +630 -14
- package/lib/AutoNumberFormatter/index.js +2 -2
- package/lib/ButtonFormatter/index.js +4 -8
- package/lib/CTimeFormatter/index.js +2 -2
- package/lib/CheckboxFormatter/index.js +2 -2
- package/lib/CollaboratorFormatter/index.js +2 -2
- package/lib/CreatorFormatter/index.js +2 -2
- package/lib/DTableCustomizeCollaboratorSelect/index.css +1 -1
- package/lib/DTableSearchInput/index.js +2 -2
- package/lib/DateFormatter/index.js +2 -2
- package/lib/DigitalSignFormatter/index.js +2 -2
- package/lib/DurationFormatter/index.js +2 -2
- package/lib/EmailFormatter/index.js +2 -2
- package/lib/FileFormatter/index.js +4 -3
- package/lib/FileItemFormatter/index.js +1 -1
- package/lib/FormulaFormatter/index.js +24 -5
- package/lib/FormulaFormatter/utils.js +91 -0
- package/lib/GeolocationFormatter/index.js +2 -2
- package/lib/HtmlLongTextFormatter/index.js +2 -2
- package/lib/ImageFormatter/images-lazy-load.js +12 -16
- package/lib/ImageFormatter/index.js +2 -2
- package/lib/ImagePreviewerLightbox/index.js +3 -3
- package/lib/LastModifierFormatter/index.js +2 -2
- package/lib/LinkFormatter/index.js +4 -4
- package/lib/MTimeFormatter/index.js +2 -2
- package/lib/MultipleSelectFormatter/index.js +2 -2
- package/lib/NumberFormatter/index.js +2 -2
- package/lib/RateFormatter/index.js +2 -2
- package/lib/RowExpandFileFormatter/index.css +72 -0
- package/lib/RowExpandFileFormatter/index.js +59 -0
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +125 -0
- package/lib/RowExpandFormatter/index.css +73 -0
- package/lib/RowExpandFormatter/index.js +441 -0
- package/lib/RowExpandImageFormatter/index.css +79 -0
- package/lib/RowExpandImageFormatter/index.js +127 -0
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +128 -0
- package/lib/RowExpandImageFormatter/utils.js +7 -0
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +164 -0
- package/lib/RowExpandLinkFormatter/column-data-constants.js +20 -0
- package/lib/RowExpandLinkFormatter/date-utils.js +127 -0
- package/lib/RowExpandLinkFormatter/formula-constants.js +9 -0
- package/lib/RowExpandLinkFormatter/index.css +25 -0
- package/lib/RowExpandLinkFormatter/index.js +170 -0
- package/lib/RowExpandLinkFormatter/number-precision.js +116 -0
- package/lib/RowExpandLinkFormatter/utils.js +58 -0
- package/lib/RowExpandLinkFormatter/value-display-utils.js +401 -0
- package/lib/SimpleLongTextFormatter/index.js +2 -2
- package/lib/SingleSelectFormatter/index.js +2 -2
- package/lib/TextFormatter/index.js +2 -2
- package/lib/UrlFormatter/index.js +2 -2
- package/lib/common/delete-tip.css +16 -0
- package/lib/common/delete-tip.js +84 -0
- package/lib/common/modal-portal.js +44 -0
- package/lib/constants/cell-types.js +5 -1
- package/lib/data/dtable-value.js +2731 -0
- package/lib/index.js +7 -1
- package/lib/lang/index.js +1 -1
- package/lib/locals/en.js +17 -13
- package/lib/locals/zh-CN.js +16 -12
- package/package.json +5 -4
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import dayjs from 'dayjs';
|
|
8
8
|
import './index.css';
|
|
9
9
|
|
|
@@ -36,7 +36,7 @@ var CTimeFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
36
36
|
var _this$props = this.props,
|
|
37
37
|
date = _this$props.value,
|
|
38
38
|
containerClassName = _this$props.containerClassName;
|
|
39
|
-
var classname =
|
|
39
|
+
var classname = classnames('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
|
|
40
40
|
|
|
41
41
|
if (date !== '') {
|
|
42
42
|
date = this.formatDate(date);
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import './index.css';
|
|
8
8
|
|
|
9
9
|
var CheckboxFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -24,7 +24,7 @@ var CheckboxFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
24
24
|
value = _this$props.value,
|
|
25
25
|
containerClassName = _this$props.containerClassName;
|
|
26
26
|
value = value === true ? true : false;
|
|
27
|
-
var classname =
|
|
27
|
+
var classname = classnames('dtable-ui cell-formatter-container checkbox-formatter d-flex align-items-center justify-content-center', containerClassName);
|
|
28
28
|
|
|
29
29
|
if (value) {
|
|
30
30
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import CollaboratorItem from '../CollaboratorItem';
|
|
8
8
|
import DefaultAvatar from '../assets/images/avatar/default_avatar.png';
|
|
9
9
|
import './index.css';
|
|
@@ -70,7 +70,7 @@ var CollaboratorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
70
70
|
var _this$props2 = this.props,
|
|
71
71
|
containerClassName = _this$props2.containerClassName,
|
|
72
72
|
value = _this$props2.value;
|
|
73
|
-
var classname =
|
|
73
|
+
var classname = classnames('dtable-ui cell-formatter-container collaborator-formatter', containerClassName);
|
|
74
74
|
|
|
75
75
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
76
76
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import CollaboratorItem from '../CollaboratorItem';
|
|
8
8
|
import DefaultAvatar from '../assets/images/avatar/default_avatar.png';
|
|
9
9
|
import './index.css';
|
|
@@ -66,7 +66,7 @@ var CreatorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
66
66
|
var _this$props2 = this.props,
|
|
67
67
|
containerClassName = _this$props2.containerClassName,
|
|
68
68
|
value = _this$props2.value;
|
|
69
|
-
var classname =
|
|
69
|
+
var classname = classnames('dtable-ui cell-formatter-container creator-formatter', containerClassName);
|
|
70
70
|
|
|
71
71
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
72
72
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -103,8 +103,8 @@ var DtableSearchInput = /*#__PURE__*/function (_Component) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
_createClass(DtableSearchInput, [{
|
|
106
|
-
key: "
|
|
107
|
-
value: function
|
|
106
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
107
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
108
108
|
if (nextProps.value !== this.props.value) {
|
|
109
109
|
this.setState({
|
|
110
110
|
searchValue: nextProps.value
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import { getDateDisplayString } from '../utils/value-format-utils';
|
|
8
8
|
import './index.css';
|
|
9
9
|
|
|
@@ -37,7 +37,7 @@ var DateFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
37
37
|
date = _this$props.value,
|
|
38
38
|
format = _this$props.format,
|
|
39
39
|
containerClassName = _this$props.containerClassName;
|
|
40
|
-
var classname =
|
|
40
|
+
var classname = classnames('dtable-ui cell-formatter-container date-formatter', containerClassName);
|
|
41
41
|
|
|
42
42
|
if (date !== '') {
|
|
43
43
|
date = this.formatDate(date, format);
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import ImagesLazyLoad from '../ImageFormatter/images-lazy-load';
|
|
8
8
|
import ImagePreviewerLightbox from '../ImagePreviewerLightbox';
|
|
9
9
|
import { getDigitalSignImageUrl } from './utils';
|
|
@@ -79,7 +79,7 @@ var DigitalSignFormatter = /*#__PURE__*/function (_Component) {
|
|
|
79
79
|
readOnly = _this$props2.readOnly,
|
|
80
80
|
config = _this$props2.config,
|
|
81
81
|
isSample = _this$props2.isSample;
|
|
82
|
-
var className =
|
|
82
|
+
var className = classnames('dtable-ui cell-formatter-container digital-sign-formatter', containerClassName);
|
|
83
83
|
var signImages = this.getSignImages();
|
|
84
84
|
if (signImages.length === 0) return null;
|
|
85
85
|
var _this$state = this.state,
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import { getDurationDisplayString } from '../utils/value-format-utils';
|
|
8
8
|
import './index.css';
|
|
9
9
|
|
|
@@ -25,7 +25,7 @@ var DurationFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
25
25
|
value = _this$props.value,
|
|
26
26
|
containerClassName = _this$props.containerClassName,
|
|
27
27
|
format = _this$props.format;
|
|
28
|
-
var classname =
|
|
28
|
+
var classname = classnames('dtable-ui cell-formatter-container duration-formatter', containerClassName);
|
|
29
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
30
30
|
className: classname
|
|
31
31
|
}, getDurationDisplayString(value, {
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import './index.css';
|
|
8
8
|
|
|
9
9
|
var EmailFormatter = /*#__PURE__*/function (_React$Component) {
|
|
@@ -23,7 +23,7 @@ var EmailFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
23
23
|
var _this$props = this.props,
|
|
24
24
|
containerClassName = _this$props.containerClassName,
|
|
25
25
|
value = _this$props.value;
|
|
26
|
-
var classname =
|
|
26
|
+
var classname = classnames('dtable-ui cell-formatter-container email-formatter', containerClassName);
|
|
27
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
28
28
|
className: classname
|
|
29
29
|
}, value);
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import FileItemFormatter from '../FileItemFormatter';
|
|
8
8
|
import './index.css';
|
|
9
9
|
|
|
@@ -25,12 +25,13 @@ var FileFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
25
25
|
isSample = _this$props.isSample,
|
|
26
26
|
value = _this$props.value,
|
|
27
27
|
containerClassName = _this$props.containerClassName;
|
|
28
|
-
var className = cn('dtable-ui cell-formatter-container file-formatter', containerClassName);
|
|
29
28
|
|
|
30
29
|
if (!Array.isArray(value) || value.length === 0) {
|
|
31
30
|
return null;
|
|
32
31
|
}
|
|
33
32
|
|
|
33
|
+
var className = classnames('dtable-ui cell-formatter-container file-formatter', containerClassName);
|
|
34
|
+
|
|
34
35
|
if (isSample) {
|
|
35
36
|
var item = value[0];
|
|
36
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -61,4 +62,4 @@ FileFormatter.defaultProps = {
|
|
|
61
62
|
value: [],
|
|
62
63
|
containerClassName: ''
|
|
63
64
|
};
|
|
64
|
-
export default
|
|
65
|
+
export { FileFormatter as default };
|
|
@@ -7,7 +7,7 @@ import React from 'react';
|
|
|
7
7
|
import { FORMULA_RESULT_TYPE, CellType } from '../constants';
|
|
8
8
|
import BaseFormatterConfig from '../formatterConfig/base-formatter-config';
|
|
9
9
|
import TextFormatter from '../TextFormatter';
|
|
10
|
-
import { isArrayFormalColumn, isSimpleCellFormatter, isFunction } from './utils';
|
|
10
|
+
import { isArrayFormalColumn, isSimpleCellFormatter, isFunction, getFormulaArrayValue, convertValueToDtableLongTextValue } from './utils';
|
|
11
11
|
import cellValueValidator from './cell-value-validator';
|
|
12
12
|
import { getFormulaDisplayString } from '../utils/value-format-utils';
|
|
13
13
|
import './index.css';
|
|
@@ -130,12 +130,31 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
130
130
|
key: "render",
|
|
131
131
|
value: function render() {
|
|
132
132
|
var _this$props2 = this.props,
|
|
133
|
-
value = _this$props2.value,
|
|
134
133
|
containerClassName = _this$props2.containerClassName,
|
|
135
134
|
column = _this$props2.column,
|
|
136
135
|
collaborators = _this$props2.collaborators;
|
|
137
|
-
var
|
|
138
|
-
var
|
|
136
|
+
var data = column.data;
|
|
137
|
+
var array_type = data.array_type,
|
|
138
|
+
resultType = data.result_type;
|
|
139
|
+
var value = this.props.value;
|
|
140
|
+
|
|
141
|
+
if (Array.isArray(value)) {
|
|
142
|
+
value = getFormulaArrayValue(value);
|
|
143
|
+
|
|
144
|
+
if (array_type === CellType.DATE || resultType === FORMULA_RESULT_TYPE.DATE) {
|
|
145
|
+
value = value.map(function (item) {
|
|
146
|
+
return item.replace('T', ' ').replace('Z', '');
|
|
147
|
+
});
|
|
148
|
+
} else if (array_type === CellType.LONG_TEXT) {
|
|
149
|
+
value = value.map(function (item) {
|
|
150
|
+
return convertValueToDtableLongTextValue(item);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
if (resultType === FORMULA_RESULT_TYPE.DATE) {
|
|
155
|
+
value = value.replace('T', ' ').replace('Z', '');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
139
158
|
|
|
140
159
|
if (resultType === FORMULA_RESULT_TYPE.ARRAY) {
|
|
141
160
|
return this.renderOtherColumnFormatter();
|
|
@@ -146,7 +165,7 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
146
165
|
}
|
|
147
166
|
|
|
148
167
|
var gridCellClassName = this.getGridCellClassName(resultType);
|
|
149
|
-
var formattedValue = getFormulaDisplayString(value,
|
|
168
|
+
var formattedValue = getFormulaDisplayString(value, data, {
|
|
150
169
|
collaborators: collaborators
|
|
151
170
|
});
|
|
152
171
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ARRAY_FORMAL_COLUMNS, SIMPLE_CELL_COLUMNS, SIMPLE_CELL_FORMULA_RESULTS } from '../constants';
|
|
2
|
+
import getPreviewContent from '../SimpleLongTextFormatter/normalize-long-text-value';
|
|
2
3
|
export function isSimpleCellFormatter(type) {
|
|
3
4
|
return SIMPLE_CELL_COLUMNS.includes(type) || SIMPLE_CELL_FORMULA_RESULTS.includes(type);
|
|
4
5
|
}
|
|
@@ -8,4 +9,94 @@ export function isArrayFormalColumn(columnType) {
|
|
|
8
9
|
export var isFunction = function isFunction(functionToCheck) {
|
|
9
10
|
var getType = {};
|
|
10
11
|
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
12
|
+
};
|
|
13
|
+
export var isValidCellValue = function isValidCellValue(value) {
|
|
14
|
+
if (value === undefined) return false;
|
|
15
|
+
if (value === null) return false;
|
|
16
|
+
if (value === '') return false;
|
|
17
|
+
if (JSON.stringify(value) === '{}') return false;
|
|
18
|
+
if (JSON.stringify(value) === '[]') return false;
|
|
19
|
+
return true;
|
|
20
|
+
};
|
|
21
|
+
export var getFormulaArrayValue = function getFormulaArrayValue(value) {
|
|
22
|
+
var isFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
23
|
+
|
|
24
|
+
if (!Array.isArray(value)) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!isFlat) {
|
|
29
|
+
return getTwoDimensionArrayValue(value);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return value.map(function (item) {
|
|
33
|
+
if (Object.prototype.toString.call(item) !== '[object Object]' || !Object.prototype.hasOwnProperty.call(item, 'display_value')) {
|
|
34
|
+
return item;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var display_value = item.display_value;
|
|
38
|
+
|
|
39
|
+
if (!Array.isArray(display_value) || display_value.length === 0) {
|
|
40
|
+
return display_value;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return display_value.map(function (i) {
|
|
44
|
+
if (Object.prototype.toString.call(i) === '[object Object]') {
|
|
45
|
+
if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) {
|
|
46
|
+
return i;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var _display_value = i.display_value;
|
|
50
|
+
return _display_value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return i;
|
|
54
|
+
});
|
|
55
|
+
}).flat().filter(function (item) {
|
|
56
|
+
return isValidCellValue(item);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
export var getTwoDimensionArrayValue = function getTwoDimensionArrayValue(value) {
|
|
60
|
+
if (!Array.isArray(value)) return [];
|
|
61
|
+
return value.map(function (item) {
|
|
62
|
+
if (Object.prototype.toString.call(item) !== '[object Object]') {
|
|
63
|
+
return item;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) {
|
|
67
|
+
return item;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var display_value = item.display_value;
|
|
71
|
+
|
|
72
|
+
if (!Array.isArray(display_value) || display_value.length === 0) {
|
|
73
|
+
return display_value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return display_value.map(function (i) {
|
|
77
|
+
if (Object.prototype.toString.call(i) === '[object Object]') {
|
|
78
|
+
if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) {
|
|
79
|
+
return i;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var _display_value2 = i.display_value;
|
|
83
|
+
return _display_value2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return i;
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
export var convertValueToDtableLongTextValue = function convertValueToDtableLongTextValue(value) {
|
|
91
|
+
var valueType = Object.prototype.toString.call(value);
|
|
92
|
+
|
|
93
|
+
if (value && valueType === '[object String]') {
|
|
94
|
+
return getPreviewContent(value);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (valueType === '[object Object]') {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return '';
|
|
11
102
|
};
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import { getGeolocationDisplayString } from '../utils/value-format-utils';
|
|
8
8
|
import './index.css';
|
|
9
9
|
|
|
@@ -25,7 +25,7 @@ var GeolocationFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
25
25
|
value = _this$props.value,
|
|
26
26
|
data = _this$props.data,
|
|
27
27
|
containerClassName = _this$props.containerClassName;
|
|
28
|
-
var className =
|
|
28
|
+
var className = classnames('dtable-ui cell-formatter-container geolocation-formatter', containerClassName);
|
|
29
29
|
|
|
30
30
|
if (typeof value !== 'object') {
|
|
31
31
|
return null;
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import { processor } from './markdown2html';
|
|
8
8
|
import './index.css';
|
|
9
9
|
|
|
@@ -82,7 +82,7 @@ var HtmlLongTextFormatter = /*#__PURE__*/function (_Component) {
|
|
|
82
82
|
value: function render() {
|
|
83
83
|
var innerHtml = this.state.innerHtml;
|
|
84
84
|
var containerClassName = this.props.containerClassName;
|
|
85
|
-
var className =
|
|
85
|
+
var className = classnames('dtable-ui cell-formatter-container long-text-formatter', containerClassName);
|
|
86
86
|
if (!innerHtml) return null;
|
|
87
87
|
return /*#__PURE__*/React.createElement("div", {
|
|
88
88
|
className: "".concat(className, " article"),
|
|
@@ -22,7 +22,7 @@ var ImagesLazyLoad = /*#__PURE__*/function (_React$Component) {
|
|
|
22
22
|
_this.lazyLoadImages(_this.props);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
_this.
|
|
25
|
+
_this.UNSAFE_componentWillReceiveProps = function (nextProps) {
|
|
26
26
|
if (nextProps.images.toString() !== _this.props.images.toString()) {
|
|
27
27
|
_this.lazyLoadImages(nextProps);
|
|
28
28
|
}
|
|
@@ -134,22 +134,18 @@ var ImagesLazyLoad = /*#__PURE__*/function (_React$Component) {
|
|
|
134
134
|
}, /*#__PURE__*/React.createElement(Loading, null));
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
return
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
alt: ""
|
|
148
|
-
});
|
|
137
|
+
return loadedImages.map(function (image, index) {
|
|
138
|
+
return /*#__PURE__*/React.createElement("img", {
|
|
139
|
+
key: index,
|
|
140
|
+
className: "image-item",
|
|
141
|
+
src: image.src,
|
|
142
|
+
onMouseDown: _this2.onMouseDown,
|
|
143
|
+
onClick: function onClick(event) {
|
|
144
|
+
return _this2.onImageClick(event, index);
|
|
145
|
+
},
|
|
146
|
+
alt: ""
|
|
149
147
|
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return '';
|
|
148
|
+
});
|
|
153
149
|
}
|
|
154
150
|
}]);
|
|
155
151
|
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React, { Fragment } from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import ImagesLazyLoad from './images-lazy-load';
|
|
8
8
|
import { getImageThumbnailUrl } from './utils';
|
|
9
9
|
import ImagePreviewerLightbox from '../ImagePreviewerLightbox';
|
|
@@ -101,7 +101,7 @@ var ImageFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
101
101
|
server = _this$props.server,
|
|
102
102
|
containerClassName = _this$props.containerClassName,
|
|
103
103
|
readOnly = _this$props.readOnly;
|
|
104
|
-
var className =
|
|
104
|
+
var className = classnames('dtable-ui cell-formatter-container image-formatter', containerClassName);
|
|
105
105
|
var _this$state = this.state,
|
|
106
106
|
isPreviewImage = _this$state.isPreviewImage,
|
|
107
107
|
previewImageIndex = _this$state.previewImageIndex;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import MediaQuery from 'react-responsive';
|
|
3
|
-
import
|
|
3
|
+
import classnames from 'classnames';
|
|
4
4
|
import ModalPortal from '../ModalPortal';
|
|
5
5
|
import Lightbox from '@seafile/react-image-lightbox';
|
|
6
6
|
import { checkSVGImage, isInternalImg } from './utils';
|
|
@@ -71,7 +71,7 @@ function ImagePreviewerLightbox(props) {
|
|
|
71
71
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MediaQuery, {
|
|
72
72
|
query: "(min-width: 767.8px)"
|
|
73
73
|
}, /*#__PURE__*/React.createElement(Lightbox, {
|
|
74
|
-
wrapperClassName:
|
|
74
|
+
wrapperClassName: classnames('PC-image-previewer', className),
|
|
75
75
|
imageTitle: imageTitleEl,
|
|
76
76
|
toolbarButtons: toolbarButtons,
|
|
77
77
|
mainSrc: imageItems[imageIndex],
|
|
@@ -93,7 +93,7 @@ function ImagePreviewerLightbox(props) {
|
|
|
93
93
|
query: "(max-width: 767.8px)"
|
|
94
94
|
}, /*#__PURE__*/React.createElement(Lightbox, {
|
|
95
95
|
isDesktop: false,
|
|
96
|
-
wrapperClassName:
|
|
96
|
+
wrapperClassName: classnames('mobile-image-previewer dtable-ui-component', className),
|
|
97
97
|
mainSrc: imageItems[imageIndex],
|
|
98
98
|
nextSrc: imageItems[(imageIndex + 1) % imageItemsLength],
|
|
99
99
|
prevSrc: imageItems[(imageIndex + imageItemsLength - 1) % imageItemsLength],
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import CollaboratorItem from '../CollaboratorItem';
|
|
8
8
|
import DefaultAvatar from '../assets/images/avatar/default_avatar.png';
|
|
9
9
|
import './index.css';
|
|
@@ -66,7 +66,7 @@ var LastModifierFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
66
66
|
var _this$props2 = this.props,
|
|
67
67
|
containerClassName = _this$props2.containerClassName,
|
|
68
68
|
value = _this$props2.value;
|
|
69
|
-
var classname =
|
|
69
|
+
var classname = classnames('dtable-ui cell-formatter-container last-modified-formatter', containerClassName);
|
|
70
70
|
|
|
71
71
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
72
72
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -4,7 +4,7 @@ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitial
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import
|
|
7
|
+
import classnames from 'classnames';
|
|
8
8
|
import * as CellTypes from '../constants/cell-types';
|
|
9
9
|
import { getNumberDisplayString, getDateDisplayString } from '../utils/value-format-utils';
|
|
10
10
|
|
|
@@ -113,8 +113,8 @@ var LinkFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
_createClass(LinkFormatter, [{
|
|
116
|
-
key: "
|
|
117
|
-
value: function
|
|
116
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
117
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
118
118
|
var nextRow = nextProps.row;
|
|
119
119
|
|
|
120
120
|
if (nextRow._id !== this.props.row._id) {
|
|
@@ -127,7 +127,7 @@ var LinkFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
127
127
|
key: "render",
|
|
128
128
|
value: function render() {
|
|
129
129
|
var containerClassName = this.props.containerClassName;
|
|
130
|
-
var classname =
|
|
130
|
+
var classname = classnames('dtable-ui cell-formatter-container link-formatter', containerClassName);
|
|
131
131
|
var displayValues = this.getDisplayValues();
|
|
132
132
|
return /*#__PURE__*/React.createElement("div", {
|
|
133
133
|
className: classname
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import dayjs from 'dayjs';
|
|
8
8
|
import './index.css';
|
|
9
9
|
|
|
@@ -36,7 +36,7 @@ var MTimeFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
36
36
|
var _this$props = this.props,
|
|
37
37
|
date = _this$props.value,
|
|
38
38
|
containerClassName = _this$props.containerClassName;
|
|
39
|
-
var classname =
|
|
39
|
+
var classname = classnames('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
|
|
40
40
|
|
|
41
41
|
if (date !== '') {
|
|
42
42
|
date = this.formatDate(date);
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import SelectItem from '../SelectItem';
|
|
8
8
|
import './index.css';
|
|
9
9
|
|
|
@@ -49,7 +49,7 @@ var MultipleSelectFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
49
49
|
var _this$props2 = this.props,
|
|
50
50
|
value = _this$props2.value,
|
|
51
51
|
containerClassName = _this$props2.containerClassName;
|
|
52
|
-
var classname =
|
|
52
|
+
var classname = classnames('dtable-ui cell-formatter-container multiple-select-formatter', containerClassName);
|
|
53
53
|
|
|
54
54
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
55
55
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import { getNumberDisplayString } from '../utils/value-format-utils';
|
|
8
8
|
import './index.css';
|
|
9
9
|
|
|
@@ -25,7 +25,7 @@ var NumberFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
25
25
|
number = _this$props.value,
|
|
26
26
|
data = _this$props.data,
|
|
27
27
|
containerClassName = _this$props.containerClassName;
|
|
28
|
-
var classname =
|
|
28
|
+
var classname = classnames('dtable-ui cell-formatter-container number-formatter', containerClassName);
|
|
29
29
|
|
|
30
30
|
if (number || number === 0) {
|
|
31
31
|
number = getNumberDisplayString(number, data);
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
6
|
+
import classnames from 'classnames';
|
|
7
7
|
import './index.css';
|
|
8
8
|
|
|
9
9
|
var RateFormatter = /*#__PURE__*/function (_React$Component) {
|
|
@@ -60,7 +60,7 @@ var RateFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
60
60
|
var _this$props2 = this.props,
|
|
61
61
|
number = _this$props2.value,
|
|
62
62
|
containerClassName = _this$props2.containerClassName;
|
|
63
|
-
var className =
|
|
63
|
+
var className = classnames('dtable-ui cell-formatter-container rate-formatter', containerClassName);
|
|
64
64
|
if (!number) return null;
|
|
65
65
|
var rateList = this.getRateList();
|
|
66
66
|
return /*#__PURE__*/React.createElement("div", {
|