dtable-ui-component 5.0.9-beta.1 → 5.0.9-beta.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 +5 -3
- package/lib/ButtonFormatter/index.js +9 -5
- package/lib/CTimeFormatter/index.js +5 -3
- package/lib/CheckboxEditor/index.js +15 -12
- package/lib/CheckboxFormatter/index.js +7 -5
- package/lib/CollaboratorEditor/index.js +46 -37
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +60 -47
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +37 -31
- package/lib/CollaboratorFormatter/index.js +8 -7
- package/lib/CollaboratorItem/index.js +21 -16
- package/lib/CollapsibleSettingLayout/index.js +17 -12
- package/lib/CreatorFormatter/index.js +8 -7
- package/lib/DTableCommonAddTool/index.js +10 -7
- package/lib/DTableCustomizeCollaboratorSelect/index.js +38 -32
- package/lib/DTableCustomizeSelect/index.js +51 -44
- package/lib/DTableFiltersPopover/index.js +46 -41
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +67 -51
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +64 -49
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +38 -32
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +42 -34
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +35 -31
- package/lib/DTableFiltersPopover/widgets/filter-item.js +92 -76
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +19 -17
- package/lib/DTableFiltersPopover/widgets/rate-item.js +12 -9
- package/lib/DTablePopover/index.js +9 -6
- package/lib/DTableRadio/index.js +20 -17
- package/lib/DTableSearchInput/index.js +22 -18
- package/lib/DTableSelect/dtable-select-label.js +12 -7
- package/lib/DTableSelect/index.js +2 -1
- package/lib/DTableSelect/utils.js +26 -13
- package/lib/DTableSwitch/index.js +20 -16
- package/lib/DateEditor/index.js +46 -36
- package/lib/DateEditor/mb-date-editor-popover/index.js +80 -63
- package/lib/DateEditor/pc-date-editor-popover.js +25 -22
- package/lib/DateFormatter/index.js +5 -3
- package/lib/Department-editor/department-multiple-select/index.js +49 -42
- package/lib/Department-editor/department-single-select.js +70 -54
- package/lib/Department-editor/index.js +18 -14
- package/lib/Department-editor/selected-departments/index.js +54 -44
- package/lib/DepartmentSelectFilter/index.js +8 -1
- package/lib/DepartmentSingleSelectFormatter/index.js +13 -9
- package/lib/DigitalSignFormatter/index.js +21 -17
- package/lib/DurationFormatter/index.js +7 -5
- package/lib/EditEditorButton/index.js +5 -3
- package/lib/EmailFormatter/index.js +5 -3
- package/lib/FieldDisplaySetting/field-item.js +25 -19
- package/lib/FieldDisplaySetting/index.js +47 -38
- package/lib/FileEditor/index.js +10 -7
- package/lib/FileFormatter/index.js +18 -15
- package/lib/FileItemFormatter/index.js +2 -1
- package/lib/FileUploader/index.js +2 -1
- package/lib/FormulaFormatter/index.js +21 -14
- package/lib/GeolocationFormatter/index.js +8 -6
- package/lib/HtmlLongTextFormatter/index.js +2 -1
- package/lib/ImageFormatter/images-lazy-load.js +7 -6
- package/lib/ImageFormatter/index.js +35 -29
- package/lib/ImagePreviewerLightbox/index.js +12 -8
- package/lib/LastModifierFormatter/index.js +8 -7
- package/lib/LinkEditor/index.js +38 -32
- package/lib/LinkEditor/link-editor-option.js +25 -20
- package/lib/LinkEditor/mb-link-editor-popover/index.js +53 -41
- package/lib/LinkEditor/pc-link-editor-popover/index.js +41 -33
- package/lib/LinkFormatter/index.js +13 -10
- package/lib/Loading/index.js +2 -1
- package/lib/LongTextFormatter/index.js +3 -2
- package/lib/MBEditorHeader/index.js +19 -14
- package/lib/MTimeFormatter/index.js +5 -3
- package/lib/MultipleSelectEditor/index.js +43 -37
- package/lib/MultipleSelectFormatter/index.js +8 -7
- package/lib/NotificationPopover/index.js +43 -32
- package/lib/NumberEditor/index.js +24 -20
- package/lib/NumberFormatter/index.js +5 -3
- package/lib/RateFormatter/index.js +7 -6
- package/lib/RoleStatusEditor/index.js +35 -30
- package/lib/RowExpandEmailFormatter/index.js +11 -8
- package/lib/RowExpandFileFormatter/index.js +14 -13
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +43 -36
- package/lib/RowExpandFormatter/index.js +129 -112
- package/lib/RowExpandFormulaFormatter/index.js +37 -29
- package/lib/RowExpandImageFormatter/index.js +29 -26
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +47 -39
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +2 -1
- package/lib/RowExpandLinkFormatter/index.js +70 -67
- package/lib/RowExpandRateFormatter/index.js +7 -6
- package/lib/RowExpandUrlFormatter/index.js +11 -8
- package/lib/SelectItem/index.js +5 -3
- package/lib/SelectOptionGroup/index.js +38 -31
- package/lib/SelectOptionGroup/option.js +5 -3
- package/lib/SimpleLongTextFormatter/index.js +39 -30
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +11 -8
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -2
- package/lib/SingleSelectEditor/index.js +42 -34
- package/lib/SingleSelectFormatter/index.js +6 -4
- package/lib/TextEditor/index.js +2 -1
- package/lib/TextFormatter/index.js +5 -3
- package/lib/UrlFormatter/index.js +5 -3
- package/lib/common/delete-tip.js +27 -19
- package/lib/formatterConfig/base-formatter-config.js +23 -22
- package/lib/formatterConfig/index.js +3 -2
- package/lib/select-editor/mb-select-editor-popover/index.js +84 -64
- package/lib/select-editor/pc-select-editor-popover/index.js +50 -39
- package/lib/select-editor/select-editor-option.js +24 -19
- package/lib/toaster/alert.js +25 -16
- package/lib/toaster/toast.js +28 -24
- package/lib/toaster/toastManager.js +16 -13
- package/lib/toaster/toaster.js +2 -1
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ var _reactstrap = require("reactstrap");
|
|
|
11
11
|
var _reactTransitionGroup = require("react-transition-group");
|
|
12
12
|
var _fieldItem = _interopRequireDefault(require("./field-item"));
|
|
13
13
|
require("./index.css");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
const FIELD_ITEM_HEIGHT = 30;
|
|
15
16
|
const BANNER_HEIGHT = 24;
|
|
16
17
|
const DURATION = 300;
|
|
@@ -50,43 +51,51 @@ function FieldDisplaySetting(_ref) {
|
|
|
50
51
|
height: 0
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
|
-
return /*#__PURE__*/
|
|
54
|
-
className: "field-setting"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
55
|
+
className: "field-setting",
|
|
56
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
57
|
+
className: "field-setting-header d-flex align-items-center justify-content-between",
|
|
58
|
+
onClick: expandAllFields,
|
|
59
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Label, {
|
|
60
|
+
className: "mb-0",
|
|
61
|
+
children: textProperties.titleValue
|
|
62
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
63
|
+
className: "dtable-font dtable-icon-right expand-button ".concat(isCollapsed ? '' : 'revolving')
|
|
64
|
+
})]
|
|
65
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.Transition, {
|
|
66
|
+
nodeRef: nodeRef,
|
|
67
|
+
in: !isCollapsed,
|
|
68
|
+
timeout: DURATION,
|
|
69
|
+
children: state => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
70
|
+
className: "field-setting-wrapper",
|
|
71
|
+
ref: nodeRef,
|
|
72
|
+
style: {
|
|
73
|
+
...defaultStyle,
|
|
74
|
+
...transitionStyles[state]
|
|
75
|
+
},
|
|
76
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
77
|
+
className: "field-setting-banner ".concat(isCollapsed ? 'd-none' : 'd-flex', " align-items-center justify-content-between h-5 mt-2 mb-2"),
|
|
78
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Label, {
|
|
79
|
+
className: "mb-0",
|
|
80
|
+
children: textProperties.bannerValue
|
|
81
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
82
|
+
className: "show-all-button",
|
|
83
|
+
onClick: onToggleFieldsVisibility,
|
|
84
|
+
children: fieldAllShown ? textProperties.hideValue : textProperties.showValue
|
|
85
|
+
})]
|
|
86
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
87
|
+
className: "field-setting-body",
|
|
88
|
+
children: fields.map((field, index) => {
|
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_fieldItem.default, {
|
|
90
|
+
field: field,
|
|
91
|
+
isCollapsed: isCollapsed,
|
|
92
|
+
onClickField: onClickField,
|
|
93
|
+
onMoveField: onMoveField
|
|
94
|
+
}, "".concat(field.key, "-").concat(index));
|
|
95
|
+
})
|
|
96
|
+
})]
|
|
97
|
+
})
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
91
100
|
}
|
|
92
101
|
var _default = exports.default = FieldDisplaySetting;
|
package/lib/FileEditor/index.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactstrap = require("reactstrap");
|
|
10
10
|
var _lang = require("../lang");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
class FileEditor extends _react.default.Component {
|
|
12
13
|
constructor(props) {
|
|
13
14
|
super(props);
|
|
@@ -17,14 +18,16 @@ class FileEditor extends _react.default.Component {
|
|
|
17
18
|
let {
|
|
18
19
|
closeEditor
|
|
19
20
|
} = this.props;
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Modal, {
|
|
21
22
|
isOpen: true,
|
|
22
|
-
toggle: closeEditor
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
toggle: closeEditor,
|
|
24
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.ModalHeader, {
|
|
25
|
+
toggle: closeEditor,
|
|
26
|
+
children: (0, _lang.getLocale)('Add_Files')
|
|
27
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.ModalBody, {
|
|
28
|
+
className: "file-editor-container"
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
FileEditor.defaultProps = {
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _FileItemFormatter = _interopRequireDefault(require("../FileItemFormatter"));
|
|
11
11
|
require("./index.css");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
class FileFormatter extends _react.default.PureComponent {
|
|
13
14
|
render() {
|
|
14
15
|
let {
|
|
@@ -22,22 +23,24 @@ class FileFormatter extends _react.default.PureComponent {
|
|
|
22
23
|
let className = (0, _classnames.default)('dtable-ui cell-formatter-container file-formatter', containerClassName);
|
|
23
24
|
if (isSample) {
|
|
24
25
|
let item = value[0];
|
|
25
|
-
return /*#__PURE__*/
|
|
26
|
-
className: className
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
-
className: className
|
|
35
|
-
}, value.map((item, index) => {
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement(_FileItemFormatter.default, {
|
|
37
|
-
file: item,
|
|
38
|
-
key: index
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
27
|
+
className: className,
|
|
28
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FileItemFormatter.default, {
|
|
29
|
+
file: item
|
|
30
|
+
}), value.length !== 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
31
|
+
className: "file-item-count",
|
|
32
|
+
children: "+".concat(value.length)
|
|
33
|
+
})]
|
|
39
34
|
});
|
|
40
|
-
}
|
|
35
|
+
}
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
37
|
+
className: className,
|
|
38
|
+
children: value.map((item, index) => {
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileItemFormatter.default, {
|
|
40
|
+
file: item
|
|
41
|
+
}, index);
|
|
42
|
+
})
|
|
43
|
+
});
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
exports.default = FileFormatter;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _utils = require("./utils");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
class FileItemFormatter extends _react.Component {
|
|
11
12
|
constructor() {
|
|
12
13
|
super(...arguments);
|
|
@@ -20,7 +21,7 @@ class FileItemFormatter extends _react.Component {
|
|
|
20
21
|
const {
|
|
21
22
|
file
|
|
22
23
|
} = this.props;
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
24
25
|
className: "file-item-icon",
|
|
25
26
|
src: this.getFileIconData(file),
|
|
26
27
|
alt: file.name
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
class FileUploader extends _react.default.Component {
|
|
10
11
|
constructor(props) {
|
|
11
12
|
super(props);
|
|
@@ -22,7 +23,7 @@ class FileUploader extends _react.default.Component {
|
|
|
22
23
|
this.uploadFiles = [];
|
|
23
24
|
}
|
|
24
25
|
render() {
|
|
25
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
26
27
|
type: "file",
|
|
27
28
|
onChange: this.onFilesChanged
|
|
28
29
|
});
|
|
@@ -12,6 +12,7 @@ var _TextFormatter = _interopRequireDefault(require("../TextFormatter"));
|
|
|
12
12
|
var _utils = require("./utils");
|
|
13
13
|
var _cellValueValidator = _interopRequireDefault(require("./cell-value-validator"));
|
|
14
14
|
require("./index.css");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
class FormulaFormatter extends _react.default.Component {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(...arguments);
|
|
@@ -55,15 +56,16 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
55
56
|
cellValue = (0, _cellValueValidator.default)(value, array_type) ? [value] : [];
|
|
56
57
|
}
|
|
57
58
|
const contentItemClassName = "formula-formatter-content-item ".concat(_isSimpleCellFormatterColumn ? 'simple-cell-formatter' : '');
|
|
58
|
-
return /*#__PURE__*/
|
|
59
|
-
className: "dtable-ui formula-formatter multiple"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
60
|
+
className: "dtable-ui formula-formatter multiple",
|
|
61
|
+
children: cellValue.map((v, index) => {
|
|
62
|
+
formatterProps.value = v;
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
64
|
+
className: contentItemClassName,
|
|
65
|
+
children: this.createColumnFormatter(Formatter, formatterProps)
|
|
66
|
+
}, "formula-formatter-content-item-".concat(index));
|
|
67
|
+
})
|
|
68
|
+
});
|
|
67
69
|
};
|
|
68
70
|
this.getFormatterProps = (array_type, array_data, collaborators) => {
|
|
69
71
|
switch (array_type) {
|
|
@@ -100,9 +102,13 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
100
102
|
...formatterProps
|
|
101
103
|
});
|
|
102
104
|
} else if ((0, _utils.isFunction)(Formatter)) {
|
|
103
|
-
return /*#__PURE__*/
|
|
105
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Formatter, {
|
|
106
|
+
...formatterProps
|
|
107
|
+
});
|
|
104
108
|
}
|
|
105
|
-
return /*#__PURE__*/
|
|
109
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextFormatter.default, {
|
|
110
|
+
...formatterProps
|
|
111
|
+
});
|
|
106
112
|
}
|
|
107
113
|
render() {
|
|
108
114
|
const {
|
|
@@ -134,11 +140,12 @@ class FormulaFormatter extends _react.default.Component {
|
|
|
134
140
|
const formattedValue = (0, _dtableUtils.getFormulaDisplayString)(value, data, {
|
|
135
141
|
collaborators
|
|
136
142
|
});
|
|
137
|
-
return /*#__PURE__*/
|
|
143
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
138
144
|
className: "dtable-ui cell-formatter-container formula-formatter ".concat(containerClassName, " ").concat(gridCellClassName),
|
|
139
145
|
title: formattedValue,
|
|
140
|
-
"aria-label": formattedValue
|
|
141
|
-
|
|
146
|
+
"aria-label": formattedValue,
|
|
147
|
+
children: formattedValue
|
|
148
|
+
});
|
|
142
149
|
}
|
|
143
150
|
}
|
|
144
151
|
var _default = exports.default = FormulaFormatter;
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _dtableUtils = require("dtable-utils");
|
|
11
11
|
require("./index.css");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
class GeolocationFormatter extends _react.default.Component {
|
|
13
14
|
render() {
|
|
14
15
|
let {
|
|
@@ -21,12 +22,13 @@ class GeolocationFormatter extends _react.default.Component {
|
|
|
21
22
|
if (typeof value !== 'object') {
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
24
|
-
return /*#__PURE__*/
|
|
25
|
-
className: className
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
26
|
+
className: className,
|
|
27
|
+
children: (0, _dtableUtils.getGeolocationDisplayString)(value, data, {
|
|
28
|
+
isBaiduMap,
|
|
29
|
+
hyphen: ' '
|
|
30
|
+
})
|
|
31
|
+
});
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
GeolocationFormatter.defaultProps = {
|
|
@@ -10,6 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _seafileEditor = require("@seafile/seafile-editor");
|
|
12
12
|
require("./index.css");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
class HtmlLongTextFormatter extends _react.Component {
|
|
14
15
|
constructor(_props) {
|
|
15
16
|
super(_props);
|
|
@@ -66,7 +67,7 @@ class HtmlLongTextFormatter extends _react.Component {
|
|
|
66
67
|
} = this.props;
|
|
67
68
|
const className = (0, _classnames.default)('dtable-ui cell-formatter-container long-text-formatter', containerClassName);
|
|
68
69
|
if (!innerHtml) return null;
|
|
69
|
-
return /*#__PURE__*/
|
|
70
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
70
71
|
className: "".concat(className, " article"),
|
|
71
72
|
dangerouslySetInnerHTML: {
|
|
72
73
|
__html: innerHtml
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _Loading = _interopRequireDefault(require("../Loading"));
|
|
10
10
|
var _utils = require("./utils");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
class ImagesLazyLoad extends _react.default.Component {
|
|
12
13
|
constructor(_props) {
|
|
13
14
|
super(_props);
|
|
@@ -104,20 +105,20 @@ class ImagesLazyLoad extends _react.default.Component {
|
|
|
104
105
|
let style = {
|
|
105
106
|
marginLeft: '4px'
|
|
106
107
|
};
|
|
107
|
-
return /*#__PURE__*/
|
|
108
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
108
109
|
style: style,
|
|
109
|
-
className: "d-flex align-items-center"
|
|
110
|
-
|
|
110
|
+
className: "d-flex align-items-center",
|
|
111
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.default, {})
|
|
112
|
+
});
|
|
111
113
|
}
|
|
112
114
|
return loadedImages.map((image, index) => {
|
|
113
|
-
return /*#__PURE__*/
|
|
114
|
-
key: index,
|
|
115
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
115
116
|
className: "image-item",
|
|
116
117
|
src: image.src,
|
|
117
118
|
onMouseDown: this.onMouseDown,
|
|
118
119
|
onClick: event => this.onImageClick(event, index),
|
|
119
120
|
alt: ""
|
|
120
|
-
});
|
|
121
|
+
}, index);
|
|
121
122
|
});
|
|
122
123
|
}
|
|
123
124
|
}
|
|
@@ -12,6 +12,7 @@ var _imagesLazyLoad = _interopRequireDefault(require("./images-lazy-load"));
|
|
|
12
12
|
var _utils = require("./utils");
|
|
13
13
|
var _ImagePreviewerLightbox = _interopRequireDefault(require("../ImagePreviewerLightbox"));
|
|
14
14
|
require("./index.css");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
class ImageFormatter extends _react.default.Component {
|
|
16
17
|
constructor(props) {
|
|
17
18
|
super(props);
|
|
@@ -80,36 +81,41 @@ class ImageFormatter extends _react.default.Component {
|
|
|
80
81
|
if (isSample) {
|
|
81
82
|
let item = value[0];
|
|
82
83
|
let url = (0, _utils.getImageThumbnailUrl)(item, server);
|
|
83
|
-
return /*#__PURE__*/
|
|
84
|
-
className: className
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
85
|
+
className: className,
|
|
86
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
87
|
+
className: "image-item",
|
|
88
|
+
src: url,
|
|
89
|
+
alt: ""
|
|
90
|
+
}), value.length !== 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
91
|
+
className: "image-item-count",
|
|
92
|
+
children: "+".concat(value.length)
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
92
95
|
}
|
|
93
|
-
return /*#__PURE__*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
97
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
98
|
+
className: className,
|
|
99
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_imagesLazyLoad.default, {
|
|
100
|
+
images: value,
|
|
101
|
+
server: server,
|
|
102
|
+
onImageClick: this.onImageClick
|
|
103
|
+
})
|
|
104
|
+
}), isPreviewImage && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagePreviewerLightbox.default, {
|
|
105
|
+
imageItems: value,
|
|
106
|
+
imageIndex: previewImageIndex,
|
|
107
|
+
closeImagePopup: this.closeImagePopup,
|
|
108
|
+
moveToPrevImage: this.movePrev,
|
|
109
|
+
moveToNextImage: this.moveNext,
|
|
110
|
+
deleteImage: this.canDelete ? this.deleteImage : null,
|
|
111
|
+
downloadImage: this.downloadImage,
|
|
112
|
+
onRotateImage: this.canRotate ? this.onRotateImage : null,
|
|
113
|
+
readOnly: readOnly,
|
|
114
|
+
server: server,
|
|
115
|
+
moveToPrevRowImage: this.props.moveToPrevRowImage,
|
|
116
|
+
moveToNextRowImage: this.props.moveToNextRowImage
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
113
119
|
}
|
|
114
120
|
}
|
|
115
121
|
ImageFormatter.defaultProps = {
|
|
@@ -10,6 +10,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _reactImageLightbox = _interopRequireDefault(require("@seafile/react-image-lightbox"));
|
|
11
11
|
var _utils = require("./utils");
|
|
12
12
|
require("@seafile/react-image-lightbox/style.css");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function ImagePreviewerLightbox(props) {
|
|
14
15
|
const {
|
|
15
16
|
imageItems,
|
|
@@ -28,14 +29,17 @@ function ImagePreviewerLightbox(props) {
|
|
|
28
29
|
const imageTitle = URL ? decodeURI(URL.slice(URL.lastIndexOf('/') + 1)) : '';
|
|
29
30
|
// svg image is vectorgraph and can't rotate, external image can't rotate
|
|
30
31
|
const canRotateImage = onRotateImage && !readOnly && !(0, _utils.checkSVGImage)(URL) && (0, _utils.isInternalImg)(URL, server);
|
|
31
|
-
const imageTitleEl = /*#__PURE__*/
|
|
32
|
-
className: "d-flex"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
const imageTitleEl = /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
33
|
+
className: "d-flex",
|
|
34
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
35
|
+
className: "text-truncate",
|
|
36
|
+
children: imageTitle
|
|
37
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
38
|
+
className: "flex-shrink-0",
|
|
39
|
+
children: ["(", imageIndex + 1, "/", imageItemsLength, ")"]
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactImageLightbox.default, {
|
|
39
43
|
wrapperClassName: (0, _classnames.default)('dtable-ui-component', className),
|
|
40
44
|
imageTitle: imageTitleEl,
|
|
41
45
|
mainSrc: imageItems[imageIndex],
|
|
@@ -10,6 +10,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _CollaboratorItem = _interopRequireDefault(require("../CollaboratorItem"));
|
|
11
11
|
var _default_avatar = _interopRequireDefault(require("../assets/images/avatar/default_avatar.png"));
|
|
12
12
|
require("./index.css");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
// there will be there conditions
|
|
14
15
|
// 1 value is not exist, typeof value is array, but it's length is 0
|
|
15
16
|
// 2 value is exist, but can't find in collaborators
|
|
@@ -35,10 +36,9 @@ class LastModifierFormatter extends _react.default.PureComponent {
|
|
|
35
36
|
avatar_url: _default_avatar.default
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
return /*#__PURE__*/
|
|
39
|
-
key: index,
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CollaboratorItem.default, {
|
|
40
40
|
collaborator: collaborator
|
|
41
|
-
});
|
|
41
|
+
}, index);
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
}
|
|
@@ -49,14 +49,15 @@ class LastModifierFormatter extends _react.default.PureComponent {
|
|
|
49
49
|
} = this.props;
|
|
50
50
|
const classname = (0, _classnames.default)('dtable-ui cell-formatter-container last-modified-formatter', containerClassName);
|
|
51
51
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
52
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
53
53
|
className: classname
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
const collaborators = this.getCollaborators();
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
className: classname
|
|
59
|
-
|
|
57
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
58
|
+
className: classname,
|
|
59
|
+
children: collaborators
|
|
60
|
+
});
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
LastModifierFormatter.defaultProps = {
|
package/lib/LinkEditor/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var _linkEditorOption = _interopRequireDefault(require("./link-editor-option"));
|
|
|
16
16
|
var _pcLinkEditorPopover = _interopRequireDefault(require("./pc-link-editor-popover"));
|
|
17
17
|
var _mbLinkEditorPopover = _interopRequireDefault(require("./mb-link-editor-popover"));
|
|
18
18
|
require("./index.css");
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
20
|
class LinkEditor extends _react.default.Component {
|
|
20
21
|
constructor(props) {
|
|
21
22
|
super(props);
|
|
@@ -221,39 +222,44 @@ class LinkEditor extends _react.default.Component {
|
|
|
221
222
|
let options = this.getAvailableLinkedOptions();
|
|
222
223
|
let selectedOptions = this.formatLinkedValuesToOptions();
|
|
223
224
|
let isShowRemoveIcon = !isReadOnly;
|
|
224
|
-
return /*#__PURE__*/
|
|
225
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
225
226
|
ref: this.setEditorContainerRef,
|
|
226
|
-
className: "dtable-ui-link-editor"
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
227
|
+
className: "dtable-ui-link-editor",
|
|
228
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
229
|
+
ref: this.setEditorRef,
|
|
230
|
+
className: "dtable-ui-link-editor-container",
|
|
231
|
+
onClick: this.onAddOptionToggle,
|
|
232
|
+
children: [selectedOptions.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_EditEditorButton.default, {
|
|
233
|
+
text: (0, _lang.getLocale)('Add_an_option')
|
|
234
|
+
}), selectedOptions.length !== 0 && selectedOptions.map(option => {
|
|
235
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_linkEditorOption.default, {
|
|
236
|
+
option: option,
|
|
237
|
+
isShowRemoveIcon: isShowRemoveIcon,
|
|
238
|
+
onDeleteLinkOption: this.onDeleteOption
|
|
239
|
+
}, option.id);
|
|
240
|
+
})]
|
|
241
|
+
}), isPopoverShow && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
242
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
243
|
+
query: "(min-width: 768px)",
|
|
244
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcLinkEditorPopover.default, {
|
|
245
|
+
popoverPosition: popoverPosition,
|
|
246
|
+
options: options,
|
|
247
|
+
selectedOptions: selectedOptions,
|
|
248
|
+
onOptionItemToggle: this.onOptionItemToggle
|
|
249
|
+
})
|
|
250
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
251
|
+
query: "(max-width: 767.8px)",
|
|
252
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbLinkEditorPopover.default, {
|
|
253
|
+
isReadOnly: this.props.isReadOnly,
|
|
254
|
+
value: this.state.newValue,
|
|
255
|
+
column: this.props.column,
|
|
256
|
+
options: options,
|
|
257
|
+
onOptionItemToggle: this.onOptionItemToggle,
|
|
258
|
+
onClosePopover: this.onClosePopover
|
|
259
|
+
})
|
|
260
|
+
})]
|
|
261
|
+
})]
|
|
262
|
+
});
|
|
257
263
|
}
|
|
258
264
|
}
|
|
259
265
|
LinkEditor.defaultProps = {
|