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
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactstrap = require("reactstrap");
|
|
10
10
|
require("./index.css");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
class NotificationPopover extends _react.default.Component {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
@@ -46,43 +47,53 @@ class NotificationPopover extends _react.default.Component {
|
|
|
46
47
|
bodyText,
|
|
47
48
|
footerText
|
|
48
49
|
} = this.props;
|
|
49
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Popover, {
|
|
50
51
|
className: "notification-wrapper",
|
|
51
52
|
target: "notification-popover",
|
|
52
53
|
isOpen: true,
|
|
53
54
|
fade: false,
|
|
54
55
|
hideArrow: true,
|
|
55
|
-
placement: "bottom"
|
|
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
|
-
|
|
56
|
+
placement: "bottom",
|
|
57
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
58
|
+
className: "notification-container",
|
|
59
|
+
ref: ref => this.notificationContainerRef = ref,
|
|
60
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
61
|
+
className: "notification-header",
|
|
62
|
+
children: [headerText, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
63
|
+
className: "dtable-font dtable-icon-x notification-close-icon",
|
|
64
|
+
onClick: this.props.onNotificationListToggle
|
|
65
|
+
})]
|
|
66
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
67
|
+
className: "notification-body",
|
|
68
|
+
children: [this.props.enableWeixin && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
69
|
+
className: "show-weixin-qrcode",
|
|
70
|
+
onClick: this.onWeixinQRCodeDialogToggle,
|
|
71
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
72
|
+
className: "dtable-font dtable-icon-wechat weixin-icon"
|
|
73
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
74
|
+
className: "ml-2",
|
|
75
|
+
children: "\u5173\u6CE8\u516C\u4F17\u53F7\u83B7\u53D6\u5B9E\u65F6\u901A\u77E5"
|
|
76
|
+
})]
|
|
77
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
78
|
+
className: "mark-notifications",
|
|
79
|
+
onClick: this.props.onMarkAllNotifications,
|
|
80
|
+
children: bodyText
|
|
81
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
82
|
+
className: "notification-list-container",
|
|
83
|
+
onScroll: this.onHandleScroll,
|
|
84
|
+
ref: ref => this.notificationListRef = ref,
|
|
85
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
86
|
+
ref: ref => this.notificationsWrapperRef = ref,
|
|
87
|
+
children: this.props.children
|
|
88
|
+
})
|
|
89
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
90
|
+
className: "notification-footer",
|
|
91
|
+
onClick: this.onNotificationDialogToggle,
|
|
92
|
+
children: footerText
|
|
93
|
+
})]
|
|
94
|
+
})]
|
|
95
|
+
})
|
|
96
|
+
});
|
|
86
97
|
}
|
|
87
98
|
}
|
|
88
99
|
exports.default = NotificationPopover;
|
|
@@ -10,6 +10,7 @@ var _isHotkey = _interopRequireDefault(require("is-hotkey"));
|
|
|
10
10
|
var _dtableUtils = require("dtable-utils");
|
|
11
11
|
var _constants = require("../constants");
|
|
12
12
|
var _utils = require("../utils/utils");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
class NumberEditor extends _react.default.Component {
|
|
14
15
|
constructor(props) {
|
|
15
16
|
super(props);
|
|
@@ -105,26 +106,29 @@ class NumberEditor extends _react.default.Component {
|
|
|
105
106
|
}
|
|
106
107
|
render() {
|
|
107
108
|
let style = this.getStyle();
|
|
108
|
-
return /*#__PURE__*/
|
|
109
|
-
className: "cell-editor number-editor"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
109
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
110
|
+
className: "cell-editor number-editor",
|
|
111
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
112
|
+
className: "number-editor-container",
|
|
113
|
+
children: [!this.state.isEditorShow && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
114
|
+
className: "form-control",
|
|
115
|
+
style: style,
|
|
116
|
+
onClick: this.onEditorHandle,
|
|
117
|
+
children: this.state.textValue
|
|
118
|
+
}), this.state.isEditorShow && /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
119
|
+
ref: this.setInputRef,
|
|
120
|
+
type: "text",
|
|
121
|
+
className: "form-control",
|
|
122
|
+
style: style,
|
|
123
|
+
value: this.state.inputValue,
|
|
124
|
+
onChange: this.onChange,
|
|
125
|
+
onBlur: this.onBlur,
|
|
126
|
+
onCut: this.onCut,
|
|
127
|
+
onPaste: this.onPaste,
|
|
128
|
+
onKeyDown: this.onKeyDown
|
|
129
|
+
})]
|
|
130
|
+
})
|
|
131
|
+
});
|
|
128
132
|
}
|
|
129
133
|
}
|
|
130
134
|
NumberEditor.defaultProps = {
|
|
@@ -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 NumberFormatter extends _react.default.Component {
|
|
13
14
|
render() {
|
|
14
15
|
let {
|
|
@@ -20,9 +21,10 @@ class NumberFormatter extends _react.default.Component {
|
|
|
20
21
|
if (number || number === 0) {
|
|
21
22
|
number = (0, _dtableUtils.getNumberDisplayString)(number, data);
|
|
22
23
|
}
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
className: classname
|
|
25
|
-
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
25
|
+
className: classname,
|
|
26
|
+
children: number
|
|
27
|
+
});
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
NumberFormatter.defaultProps = {
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
require("./index.css");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
class RateFormatter extends _react.default.Component {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
@@ -24,13 +25,12 @@ class RateFormatter extends _react.default.Component {
|
|
|
24
25
|
const validValue = Math.min(rate_max_number, value);
|
|
25
26
|
let rateList = [];
|
|
26
27
|
for (let i = 0; i < validValue; i++) {
|
|
27
|
-
rateList.push( /*#__PURE__*/
|
|
28
|
-
key: "dtable-ui-component-rate-".concat(i),
|
|
28
|
+
rateList.push( /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
29
29
|
className: "dtable-font ".concat(rate_style_type),
|
|
30
30
|
style: {
|
|
31
31
|
color: rate_style_color || '#e5e5e5'
|
|
32
32
|
}
|
|
33
|
-
}));
|
|
33
|
+
}, "dtable-ui-component-rate-".concat(i)));
|
|
34
34
|
}
|
|
35
35
|
return rateList;
|
|
36
36
|
};
|
|
@@ -43,9 +43,10 @@ class RateFormatter extends _react.default.Component {
|
|
|
43
43
|
const className = (0, _classnames.default)('dtable-ui cell-formatter-container rate-formatter', containerClassName);
|
|
44
44
|
if (!number) return null;
|
|
45
45
|
const rateList = this.getRateList();
|
|
46
|
-
return /*#__PURE__*/
|
|
47
|
-
className: className
|
|
48
|
-
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
47
|
+
className: className,
|
|
48
|
+
children: rateList
|
|
49
|
+
});
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
RateFormatter.defaultProps = {
|
|
@@ -10,6 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _reactstrap = require("reactstrap");
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
require("./index.css");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
const RoleStatusEditor = _ref => {
|
|
14
15
|
let {
|
|
15
16
|
isShowDropdownIcon,
|
|
@@ -27,37 +28,41 @@ const RoleStatusEditor = _ref => {
|
|
|
27
28
|
if (value === currentOption.value) return;
|
|
28
29
|
onChangeOption(value);
|
|
29
30
|
};
|
|
30
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Dropdown, {
|
|
31
32
|
isOpen: isOpen,
|
|
32
33
|
className: "role-status-editor",
|
|
33
|
-
toggle: () => setIsOpen(!isOpen)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
toggle: () => setIsOpen(!isOpen),
|
|
35
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.DropdownToggle, {
|
|
36
|
+
className: "dropdown-toggle-button d-flex align-items-center",
|
|
37
|
+
tag: "div",
|
|
38
|
+
children: [currentOption.label, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
39
|
+
className: "dropdown-icon-container ml-1",
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
41
|
+
className: (0, _classnames.default)('dtable-font dtable-icon-drop-down', {
|
|
42
|
+
'hide': !isShowDropdownIcon
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
})]
|
|
46
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownMenu, {
|
|
47
|
+
positionFixed: true,
|
|
48
|
+
modifiers: {
|
|
49
|
+
preventOverflow: {
|
|
50
|
+
boundariesElement: document.body
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
children: menuOptions.map(option => {
|
|
54
|
+
const {
|
|
55
|
+
value,
|
|
56
|
+
label
|
|
57
|
+
} = option;
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.DropdownItem, {
|
|
59
|
+
onClick: () => handleClickMenuOption(option),
|
|
60
|
+
children: [label, value === currentOption.value && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
61
|
+
className: "dtable-font dtable-icon-check-mark ml-2"
|
|
62
|
+
})]
|
|
63
|
+
}, "item-".concat(value));
|
|
64
|
+
})
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
62
67
|
};
|
|
63
68
|
var _default = exports.default = RoleStatusEditor;
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _editorUtils = require("../utils/editor-utils");
|
|
11
11
|
require("./index.css");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
class RowExpandEmailFormatter extends _react.default.Component {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
@@ -26,14 +27,16 @@ class RowExpandEmailFormatter extends _react.default.Component {
|
|
|
26
27
|
value
|
|
27
28
|
} = this.props;
|
|
28
29
|
let classname = (0, _classnames.default)('dtable-ui cell-formatter-container email-formatter', containerClassName);
|
|
29
|
-
return /*#__PURE__*/
|
|
30
|
-
className: classname
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
31
|
+
className: classname,
|
|
32
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
33
|
+
className: "email-formatter-value text-truncate",
|
|
34
|
+
children: value
|
|
35
|
+
}), (0, _editorUtils.getTrimmedString)(value) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
36
|
+
className: "dtable-font dtable-icon-email row-expand-jump-link",
|
|
37
|
+
onClick: this.onOpenEmailLink
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
var _default = exports.default = RowExpandEmailFormatter;
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _rowExpandFileItemFormatter = _interopRequireDefault(require("./row-expand-file-item-formatter"));
|
|
11
11
|
require("./index.css");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
class RowExpandFileFormatter extends _react.default.PureComponent {
|
|
13
14
|
render() {
|
|
14
15
|
let {
|
|
@@ -22,19 +23,19 @@ class RowExpandFileFormatter extends _react.default.PureComponent {
|
|
|
22
23
|
if (!Array.isArray(value) || value.length === 0) {
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
25
|
-
return /*#__PURE__*/
|
|
26
|
-
className: (0, _classnames.default)('dtable-ui cell-formatter-container row-expand-file-formatter', containerClassName)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
})
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
27
|
+
className: (0, _classnames.default)('dtable-ui cell-formatter-container row-expand-file-formatter', containerClassName),
|
|
28
|
+
children: value.map((item, index) => {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_rowExpandFileItemFormatter.default, {
|
|
30
|
+
file: item,
|
|
31
|
+
index: index,
|
|
32
|
+
column: column,
|
|
33
|
+
downloadFile: downloadFile,
|
|
34
|
+
deleteFile: deleteFile,
|
|
35
|
+
readOnly: readOnly
|
|
36
|
+
}, index);
|
|
37
|
+
})
|
|
38
|
+
});
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
exports.default = RowExpandFileFormatter;
|
|
@@ -11,6 +11,7 @@ var _reactstrap = require("reactstrap");
|
|
|
11
11
|
var _lang = require("../lang");
|
|
12
12
|
var _utils = require("../FileItemFormatter/utils");
|
|
13
13
|
var _deleteTip = _interopRequireDefault(require("../common/delete-tip"));
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
class RowExpandFileItemFormatter extends _react.Component {
|
|
15
16
|
constructor(props) {
|
|
16
17
|
super(props);
|
|
@@ -59,42 +60,48 @@ class RowExpandFileItemFormatter extends _react.Component {
|
|
|
59
60
|
} = this.props;
|
|
60
61
|
const id = 'file-list-preview-item' + column.key + index;
|
|
61
62
|
const url = this.getFileIconData(file);
|
|
62
|
-
return /*#__PURE__*/
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
64
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
65
|
+
className: "row-expand-item-file",
|
|
66
|
+
id: id,
|
|
67
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
68
|
+
src: url,
|
|
69
|
+
id: "item-file-".concat(index),
|
|
70
|
+
alt: file.name
|
|
71
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
72
|
+
className: "dtable-file-icons-choice",
|
|
73
|
+
children: [downloadFile && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
74
|
+
className: "file-icon",
|
|
75
|
+
onClick: e => this.props.downloadFile(file, e),
|
|
76
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
77
|
+
className: "dtable-font dtable-icon-download"
|
|
78
|
+
})
|
|
79
|
+
}), !readOnly && deleteFile && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
80
|
+
className: "file-icon",
|
|
81
|
+
onClick: this.onClickDelete,
|
|
82
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
83
|
+
className: "dtable-font dtable-icon-fork-number"
|
|
84
|
+
})
|
|
85
|
+
})]
|
|
86
|
+
})]
|
|
87
|
+
}, "file-".concat(index)), this.state.isDeleteTipOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_deleteTip.default, {
|
|
88
|
+
position: this.position,
|
|
89
|
+
toggle: this.closeDeleteTip,
|
|
90
|
+
onDelete: this.onDelete,
|
|
91
|
+
deleteTip: (0, _lang.getLocale)('Are_you_sure_you_want_to_delete_this_file')
|
|
92
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Tooltip, {
|
|
93
|
+
placement: "bottom",
|
|
94
|
+
isOpen: this.state.isTooltipOpen,
|
|
95
|
+
toggle: this.toggleTooltip,
|
|
96
|
+
target: id,
|
|
97
|
+
delay: {
|
|
98
|
+
show: 0,
|
|
99
|
+
hide: 0
|
|
100
|
+
},
|
|
101
|
+
fade: false,
|
|
102
|
+
children: file.name
|
|
103
|
+
})]
|
|
104
|
+
});
|
|
98
105
|
}
|
|
99
106
|
}
|
|
100
107
|
exports.default = RowExpandFileItemFormatter;
|