@teamias/rex-design 0.0.1 → 0.0.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/LICENSE +21 -21
- package/README.md +3 -3
- package/dist/components/action-buttons/action-buttons.d.ts +1 -1
- package/dist/components/action-buttons/action-buttons.js +86 -76
- package/dist/components/action-buttons/demo/index.js +61 -58
- package/dist/components/base-form/base-form.js +218 -215
- package/dist/components/base-form/demo/index.js +147 -135
- package/dist/components/base-form/modules/renderComponentNode.d.ts +2 -2
- package/dist/components/base-form/modules/renderComponentNode.js +135 -130
- package/dist/components/base-form/types.d.ts +1 -1
- package/dist/components/base-form/types.js +0 -9
- package/dist/components/base-list-table/base-list-table.d.ts +2 -2
- package/dist/components/base-list-table/base-list-table.js +156 -135
- package/dist/components/base-list-table/demo/BasicBaseListTable.js +22 -13
- package/dist/components/base-list-table/demo/NoData.js +2 -1
- package/dist/components/base-list-table/demo/TableMaxRowCount.js +1669 -1663
- package/dist/components/base-list-table/demo/VirtualDemo.js +22 -13
- package/dist/components/base-table/base-table.d.ts +2 -2
- package/dist/components/base-table/base-table.js +60 -55
- package/dist/components/base-table/components/BaseTableRow.js +79 -66
- package/dist/components/base-table/demo/BaseTableAll.js +6 -2
- package/dist/components/base-table/demo/BaseTableBasic.js +5 -2
- package/dist/components/base-table/demo/BaseTableIndex.js +48 -50
- package/dist/components/base-table/demo/BaseTableRowSelect.js +2 -1
- package/dist/components/data-cell/data-cell.js +5 -4
- package/dist/components/data-cell/demo/index.js +327 -309
- package/dist/components/data-cell/modules/cellItemMap.d.ts +2 -2
- package/dist/components/data-cell/modules/cellItemMap.js +184 -157
- package/dist/components/data-cell/types.d.ts +9 -9
- package/dist/components/icons/demo/index.js +44 -40
- package/dist/components/icons/icons.d.ts +1 -1
- package/dist/components/icons/icons.js +36 -26
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +7 -0
- package/dist/components/media-viewer/demo/index.js +24 -20
- package/dist/components/media-viewer/media-viewer.d.ts +1 -1
- package/dist/components/media-viewer/media-viewer.js +13 -12
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +2 -0
- package/dist/{hooks → context}/request-fields-container/demo/index.js +10 -5
- package/dist/{hooks → context}/request-fields-container/index.js +2 -2
- package/dist/{hooks → context}/request-fields-container/request-fields-container-context-provider.js +17 -12
- package/dist/context/request-fields-container/request-fields-container-hoc.d.ts +4 -0
- package/dist/{hooks → context}/request-fields-container/request-fields-container-hoc.js +0 -1
- package/dist/{hooks → context}/request-fields-container/use-request-fields-container.js +2 -2
- package/dist/{hooks → context}/rex-pro-config-provider/demo/index.js +9 -5
- package/dist/{hooks → context}/rex-pro-config-provider/index.js +2 -2
- package/dist/{hooks → context}/rex-pro-config-provider/rex-pro-config-context.js +0 -1
- package/dist/context/rex-pro-config-provider/rex-pro-config-provider.d.ts +5 -0
- package/dist/{hooks → context}/rex-pro-config-provider/rex-pro-config-provider.js +8 -6
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-state-data/use-state-data.js +4 -4
- package/dist/index.d.ts +3 -10
- package/dist/index.js +3 -10
- package/dist/{components/base-form/locales → locales}/en-US.json +30 -21
- package/dist/{components/base-form/locales → locales}/zh-CN.json +30 -21
- package/dist/types/svg.d.ts +3 -3
- package/package.json +38 -33
- package/dist/components/base-form/locales.index.d.ts +0 -42
- package/dist/components/base-form/locales.index.js +0 -4
- package/dist/hooks/request-fields-container/request-fields-container-hoc.d.ts +0 -4
- package/dist/hooks/rex-pro-config-provider/rex-pro-config-provider.d.ts +0 -6
- package/dist/utils/locales/en-US.json +0 -13
- package/dist/utils/locales/index.d.ts +0 -26
- package/dist/utils/locales/index.js +0 -4
- package/dist/utils/locales/zh-CN.json +0 -13
- package/dist/{hooks → context}/request-fields-container/demo/index.d.ts +0 -0
- package/dist/{hooks → context}/request-fields-container/index.d.ts +2 -2
- package/dist/{hooks → context}/request-fields-container/request-fields-container-context-provider.d.ts +0 -0
- package/dist/{hooks → context}/request-fields-container/request-fields-container-context.d.ts +0 -0
- package/dist/{hooks → context}/request-fields-container/request-fields-container-context.js +0 -0
- package/dist/{hooks → context}/request-fields-container/use-request-fields-container.d.ts +0 -0
- package/dist/{hooks → context}/rex-pro-config-provider/demo/index.d.ts +0 -0
- package/dist/{hooks → context}/rex-pro-config-provider/index.d.ts +1 -1
- /package/dist/{hooks → context}/rex-pro-config-provider/rex-pro-config-context.d.ts +0 -0
- /package/dist/{hooks → context}/rex-pro-config-provider/use-rex-pro-config-provider.d.ts +0 -0
- /package/dist/{hooks → context}/rex-pro-config-provider/use-rex-pro-config-provider.js +0 -0
|
@@ -2,20 +2,22 @@ var _excluded = ["ellipsis", "tooltip", "copyable", "action", "urlTarget", "url"
|
|
|
2
2
|
_excluded2 = ["mediaViewerType"],
|
|
3
3
|
_excluded3 = ["value"],
|
|
4
4
|
_excluded4 = ["iconsType"];
|
|
5
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
12
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
|
-
import { Tag, Tooltip, Typography } from "antd";
|
|
15
|
-
import React from "react";
|
|
16
13
|
import { Icons, MediaViewer } from "../../..";
|
|
14
|
+
import { Tag, Tooltip, Typography } from 'antd';
|
|
15
|
+
import React from 'react';
|
|
17
16
|
import { DataCell } from "../data-cell";
|
|
18
17
|
import { DataCellRowText, DataCellRowTextLabel, DataCellRowTextValue } from "../style";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
21
|
var isEmpty = function isEmpty(val) {
|
|
20
22
|
if (val === '' || val === null || val === undefined) return true;
|
|
21
23
|
if (typeof val === 'undefined') return true;
|
|
@@ -27,7 +29,7 @@ var actionRender = function actionRender(item, action, node, click) {
|
|
|
27
29
|
var _item$urlTarget;
|
|
28
30
|
var tooltipBox = function tooltipBox(content) {
|
|
29
31
|
if (item.tooltip) {
|
|
30
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
31
33
|
styles: {
|
|
32
34
|
body: {
|
|
33
35
|
whiteSpace: 'pre-wrap',
|
|
@@ -35,27 +37,30 @@ var actionRender = function actionRender(item, action, node, click) {
|
|
|
35
37
|
}
|
|
36
38
|
},
|
|
37
39
|
title: item.tooltip,
|
|
38
|
-
arrow: false
|
|
39
|
-
|
|
40
|
+
arrow: false,
|
|
41
|
+
children: content
|
|
42
|
+
});
|
|
40
43
|
}
|
|
41
44
|
return content;
|
|
42
45
|
};
|
|
43
46
|
if (action === 'default') {
|
|
44
|
-
return tooltipBox( /*#__PURE__*/
|
|
45
|
-
style: item.style
|
|
46
|
-
|
|
47
|
+
return tooltipBox( /*#__PURE__*/_jsx("span", {
|
|
48
|
+
style: item.style,
|
|
49
|
+
children: node
|
|
50
|
+
}));
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
// 自定义
|
|
50
54
|
if (action === 'custom') {
|
|
51
|
-
return tooltipBox( /*#__PURE__*/
|
|
55
|
+
return tooltipBox( /*#__PURE__*/_jsx("a", {
|
|
52
56
|
href: "void",
|
|
53
57
|
style: item.style,
|
|
54
58
|
onClick: function onClick(e) {
|
|
55
59
|
e.preventDefault();
|
|
56
60
|
click === null || click === void 0 || click();
|
|
57
|
-
}
|
|
58
|
-
|
|
61
|
+
},
|
|
62
|
+
children: node
|
|
63
|
+
}));
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
// TODO: 窗口-未实现
|
|
@@ -64,53 +69,59 @@ var actionRender = function actionRender(item, action, node, click) {
|
|
|
64
69
|
// }
|
|
65
70
|
|
|
66
71
|
// 默认url
|
|
67
|
-
return tooltipBox( /*#__PURE__*/
|
|
72
|
+
return tooltipBox( /*#__PURE__*/_jsx("a", {
|
|
68
73
|
style: item.style,
|
|
69
74
|
href: item.value,
|
|
70
75
|
target: (_item$urlTarget = item.urlTarget) !== null && _item$urlTarget !== void 0 ? _item$urlTarget : '_blank',
|
|
71
|
-
rel: "noreferrer"
|
|
72
|
-
|
|
76
|
+
rel: "noreferrer",
|
|
77
|
+
children: node
|
|
78
|
+
}));
|
|
73
79
|
};
|
|
74
80
|
export var cellItemMap = {
|
|
75
81
|
/** 文本块 */
|
|
76
82
|
text: function text(item, click) {
|
|
77
83
|
var props = item.props;
|
|
78
84
|
if (!props) return undefined;
|
|
79
|
-
return !isEmpty(props.label) || !isEmpty(props.value) ? /*#__PURE__*/
|
|
85
|
+
return !isEmpty(props.label) || !isEmpty(props.value) ? /*#__PURE__*/_jsxs(DataCellRowText, {
|
|
80
86
|
className: "data-cell-row-text",
|
|
81
|
-
style: props === null || props === void 0 ? void 0 : props.style
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
style: props === null || props === void 0 ? void 0 : props.style,
|
|
88
|
+
children: [!isEmpty(props.label) ? /*#__PURE__*/_jsx(DataCellRowTextLabel, {
|
|
89
|
+
className: "data-cell-row-text-label",
|
|
90
|
+
title: "".concat(props.label),
|
|
91
|
+
style: props === null || props === void 0 ? void 0 : props.labelStyle,
|
|
92
|
+
children: "".concat(props.label)
|
|
93
|
+
}) : '', !isEmpty(props.label) && !isEmpty(props.value) ? /*#__PURE__*/_jsx("span", {
|
|
94
|
+
style: {
|
|
95
|
+
paddingRight: 3
|
|
96
|
+
},
|
|
97
|
+
children: ":"
|
|
98
|
+
}) : '', function () {
|
|
99
|
+
if (isEmpty(props.value)) return '';
|
|
100
|
+
if (_typeof(props.value) === 'object') {
|
|
101
|
+
return /*#__PURE__*/_jsx(DataCellRowTextValue, {
|
|
102
|
+
className: "data-cell-row-text-value",
|
|
103
|
+
style: props === null || props === void 0 ? void 0 : props.valueStyle,
|
|
104
|
+
children: cellItemMap[props.value.type](props.value, click)
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return /*#__PURE__*/_jsx(DataCellRowTextValue, {
|
|
108
|
+
ellipsis: props === null || props === void 0 ? void 0 : props.ellipsis,
|
|
94
109
|
className: "data-cell-row-text-value",
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
copyable: {
|
|
106
|
-
text: typeof props.copyable === 'string' ? props.copyable : "".concat(props.value)
|
|
107
|
-
}
|
|
108
|
-
}) : '') : undefined;
|
|
110
|
+
title: "".concat(props.tooltip || props.value),
|
|
111
|
+
style: props === null || props === void 0 ? void 0 : props.valueStyle,
|
|
112
|
+
children: "".concat(props.value)
|
|
113
|
+
});
|
|
114
|
+
}(), _typeof(props.value) !== 'object' && props.copyable ? /*#__PURE__*/_jsx(Typography.Paragraph, {
|
|
115
|
+
copyable: {
|
|
116
|
+
text: typeof props.copyable === 'string' ? props.copyable : "".concat(props.value)
|
|
117
|
+
}
|
|
118
|
+
}) : '']
|
|
119
|
+
}) : undefined;
|
|
109
120
|
},
|
|
110
121
|
/** 图片块 */
|
|
111
122
|
img: function img(item) {
|
|
112
123
|
var props = item.props;
|
|
113
|
-
return /*#__PURE__*/
|
|
124
|
+
return /*#__PURE__*/_jsx(MediaViewer, _objectSpread({
|
|
114
125
|
src: props === null || props === void 0 ? void 0 : props.value,
|
|
115
126
|
alt: props === null || props === void 0 ? void 0 : props.label
|
|
116
127
|
}, props));
|
|
@@ -121,47 +132,51 @@ export var cellItemMap = {
|
|
|
121
132
|
if (!props) return undefined;
|
|
122
133
|
|
|
123
134
|
// return actionRender(props, props.action, props.label, () => click?.(item));
|
|
124
|
-
return /*#__PURE__*/
|
|
125
|
-
className: "data-cell-row-text link"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
copyable
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
return /*#__PURE__*/_jsxs(DataCellRowText, {
|
|
136
|
+
className: "data-cell-row-text link",
|
|
137
|
+
children: [/*#__PURE__*/_jsx(DataCellRowTextValue, {
|
|
138
|
+
ellipsis: props === null || props === void 0 ? void 0 : props.ellipsis,
|
|
139
|
+
className: "data-cell-row-text-value link",
|
|
140
|
+
style: {
|
|
141
|
+
flex: 'initial',
|
|
142
|
+
width: 'auto'
|
|
143
|
+
},
|
|
144
|
+
children: actionRender(props, props.action, props.label, function () {
|
|
145
|
+
return click === null || click === void 0 ? void 0 : click(item);
|
|
146
|
+
})
|
|
147
|
+
}), props.copyable ? /*#__PURE__*/_jsx(Typography.Paragraph, {
|
|
148
|
+
copyable: {
|
|
149
|
+
text: typeof props.copyable === 'string' ? props.copyable : "".concat(props.label)
|
|
150
|
+
}
|
|
151
|
+
}) : '']
|
|
152
|
+
});
|
|
140
153
|
},
|
|
141
154
|
/** 链接组 */
|
|
142
155
|
'link-group': function linkGroup(item, click) {
|
|
143
156
|
var props = item.props;
|
|
144
157
|
if (!props) return undefined;
|
|
145
|
-
return /*#__PURE__*/
|
|
158
|
+
return /*#__PURE__*/_jsx("div", {
|
|
146
159
|
style: {
|
|
147
160
|
display: 'inline-flex'
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
},
|
|
162
|
+
children: props === null || props === void 0 ? void 0 : props.items.map(function (child, index) {
|
|
163
|
+
var _props$separator;
|
|
164
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
165
|
+
style: {
|
|
166
|
+
display: 'inline-flex'
|
|
167
|
+
},
|
|
168
|
+
children: [cellItemMap.link({
|
|
169
|
+
props: child,
|
|
170
|
+
type: 'link'
|
|
171
|
+
}, click), (props === null || props === void 0 ? void 0 : props.items.length) - 1 === index ? '' : /*#__PURE__*/_jsx("span", {
|
|
172
|
+
style: {
|
|
173
|
+
paddingInline: 2
|
|
174
|
+
},
|
|
175
|
+
children: (_props$separator = props.separator) !== null && _props$separator !== void 0 ? _props$separator : '/'
|
|
176
|
+
})]
|
|
177
|
+
}, index);
|
|
178
|
+
})
|
|
179
|
+
});
|
|
165
180
|
},
|
|
166
181
|
/** tag块 */
|
|
167
182
|
tag: function tag(item, click) {
|
|
@@ -175,28 +190,32 @@ export var cellItemMap = {
|
|
|
175
190
|
if (typeof props.color === 'string') {
|
|
176
191
|
return props.color;
|
|
177
192
|
}
|
|
178
|
-
return
|
|
193
|
+
return '#2db7f5';
|
|
179
194
|
}();
|
|
180
|
-
return !isEmpty(props.label) || !isEmpty(props.value) ? /*#__PURE__*/
|
|
195
|
+
return !isEmpty(props.label) || !isEmpty(props.value) ? /*#__PURE__*/_jsxs(Tag, _objectSpread(_objectSpread({}, props), {}, {
|
|
181
196
|
color: color,
|
|
182
197
|
onClick: function onClick() {
|
|
183
198
|
return click === null || click === void 0 ? void 0 : click(item);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
199
|
+
},
|
|
200
|
+
children: [!isEmpty(props.label) ? /*#__PURE__*/_jsx("span", {
|
|
201
|
+
title: "".concat(props.label),
|
|
202
|
+
children: "".concat(props.label)
|
|
203
|
+
}) : '', !isEmpty(props.label) && !isEmpty(props.value) ? /*#__PURE__*/_jsx("span", {
|
|
204
|
+
style: {
|
|
205
|
+
paddingRight: 3
|
|
206
|
+
},
|
|
207
|
+
children: ":"
|
|
208
|
+
}) : '', !isEmpty(props.value) ? /*#__PURE__*/_jsx("span", {
|
|
209
|
+
title: "".concat(props.value),
|
|
210
|
+
children: "".concat(props.value)
|
|
211
|
+
}) : '']
|
|
212
|
+
})) : undefined;
|
|
194
213
|
},
|
|
195
214
|
icon: function icon(item, click) {
|
|
196
215
|
var _props$action;
|
|
197
216
|
var props = item.props;
|
|
198
217
|
if (!props) return undefined;
|
|
199
|
-
return actionRender(props, (_props$action = props.action) !== null && _props$action !== void 0 ? _props$action : 'default', /*#__PURE__*/
|
|
218
|
+
return actionRender(props, (_props$action = props.action) !== null && _props$action !== void 0 ? _props$action : 'default', /*#__PURE__*/_jsx(Icons, {
|
|
200
219
|
type: props.label,
|
|
201
220
|
name: props.value
|
|
202
221
|
}), function () {
|
|
@@ -207,12 +226,13 @@ export var cellItemMap = {
|
|
|
207
226
|
group: function group(item, click) {
|
|
208
227
|
var props = item.props;
|
|
209
228
|
if (!props) return undefined;
|
|
210
|
-
return /*#__PURE__*/
|
|
211
|
-
style: props.style
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
229
|
+
return /*#__PURE__*/_jsx("div", {
|
|
230
|
+
style: props.style,
|
|
231
|
+
children: /*#__PURE__*/_jsx(DataCell, {
|
|
232
|
+
items: props.items,
|
|
233
|
+
onClick: click
|
|
234
|
+
})
|
|
235
|
+
});
|
|
216
236
|
},
|
|
217
237
|
'group-v2': function groupV2(item, click) {
|
|
218
238
|
var _props$items;
|
|
@@ -223,11 +243,10 @@ export var cellItemMap = {
|
|
|
223
243
|
var renderItem = function renderItem(subItem, index) {
|
|
224
244
|
var count = 0;
|
|
225
245
|
if (subItem.type === 'group-v2') {
|
|
226
|
-
return /*#__PURE__*/
|
|
227
|
-
key: "renderItem-".concat(index, "-").concat(count++),
|
|
246
|
+
return /*#__PURE__*/_jsx(DataCell, {
|
|
228
247
|
items: [subItem],
|
|
229
248
|
onClick: click
|
|
230
|
-
});
|
|
249
|
+
}, "renderItem-".concat(index, "-").concat(count++));
|
|
231
250
|
}
|
|
232
251
|
var ellipsis = subItem.ellipsis,
|
|
233
252
|
tooltip = subItem.tooltip,
|
|
@@ -239,15 +258,15 @@ export var cellItemMap = {
|
|
|
239
258
|
type = subItem.type,
|
|
240
259
|
other = _objectWithoutProperties(subItem, _excluded);
|
|
241
260
|
var renderBox = function renderBox(content) {
|
|
242
|
-
var afterContent = /*#__PURE__*/
|
|
261
|
+
var afterContent = /*#__PURE__*/_jsx(DataCellRowTextValue, {
|
|
243
262
|
className: "data-cell-group-v2-value-item"
|
|
244
263
|
// title={typeof content === 'string' ? content : ''}
|
|
245
264
|
,
|
|
246
265
|
ellipsis: ellipsis,
|
|
247
|
-
|
|
248
|
-
},
|
|
266
|
+
children: content
|
|
267
|
+
}, "renderItem-".concat(index, "-").concat(count++));
|
|
249
268
|
if (tooltip) {
|
|
250
|
-
afterContent = /*#__PURE__*/
|
|
269
|
+
afterContent = /*#__PURE__*/_jsx(Tooltip, {
|
|
251
270
|
styles: {
|
|
252
271
|
body: {
|
|
253
272
|
whiteSpace: 'pre-wrap',
|
|
@@ -256,46 +275,47 @@ export var cellItemMap = {
|
|
|
256
275
|
},
|
|
257
276
|
title: typeof tooltip === 'boolean' ? "".concat(content) : tooltip,
|
|
258
277
|
arrow: false,
|
|
259
|
-
|
|
260
|
-
},
|
|
278
|
+
children: afterContent
|
|
279
|
+
}, "renderItem-".concat(index, "-").concat(count++));
|
|
261
280
|
}
|
|
262
281
|
if (copyable) {
|
|
263
|
-
afterContent = /*#__PURE__*/
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
282
|
+
afterContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
283
|
+
children: [afterContent, /*#__PURE__*/_jsx(Typography.Paragraph, {
|
|
284
|
+
copyable: {
|
|
285
|
+
text: typeof copyable === 'string' ? copyable : "".concat(typeof content === 'string' ? content : '')
|
|
286
|
+
}
|
|
287
|
+
}, "renderItem-".concat(index, "-").concat(count++))]
|
|
288
|
+
});
|
|
269
289
|
}
|
|
270
290
|
if (action === 'url') {
|
|
271
|
-
return /*#__PURE__*/
|
|
291
|
+
return /*#__PURE__*/_jsx("a", {
|
|
272
292
|
href: url,
|
|
273
293
|
target: urlTarget !== null && urlTarget !== void 0 ? urlTarget : '_blank',
|
|
274
294
|
style: _objectSpread({
|
|
275
295
|
display: 'inline-flex'
|
|
276
296
|
}, style),
|
|
277
|
-
|
|
278
|
-
},
|
|
297
|
+
children: afterContent
|
|
298
|
+
}, "renderItem-".concat(index, "-").concat(count++));
|
|
279
299
|
}
|
|
280
300
|
if (action === 'custom') {
|
|
281
|
-
return /*#__PURE__*/
|
|
301
|
+
return /*#__PURE__*/_jsx("a", {
|
|
282
302
|
href: "void",
|
|
283
303
|
style: _objectSpread({
|
|
284
304
|
display: 'inline-flex'
|
|
285
305
|
}, style),
|
|
286
|
-
key: "renderItem-".concat(index, "-").concat(count++),
|
|
287
306
|
onClick: function onClick(e) {
|
|
288
307
|
e.preventDefault();
|
|
289
308
|
click === null || click === void 0 || click(item, subItem);
|
|
290
|
-
}
|
|
291
|
-
|
|
309
|
+
},
|
|
310
|
+
children: afterContent
|
|
311
|
+
}, "renderItem-".concat(index, "-").concat(count++));
|
|
292
312
|
}
|
|
293
|
-
return /*#__PURE__*/
|
|
313
|
+
return /*#__PURE__*/_jsx("div", {
|
|
294
314
|
style: _objectSpread({
|
|
295
315
|
display: 'inline-flex'
|
|
296
316
|
}, style),
|
|
297
|
-
|
|
298
|
-
},
|
|
317
|
+
children: afterContent
|
|
318
|
+
}, "renderItem-".concat(index, "-").concat(count++));
|
|
299
319
|
};
|
|
300
320
|
switch (type) {
|
|
301
321
|
case 'text':
|
|
@@ -305,7 +325,7 @@ export var cellItemMap = {
|
|
|
305
325
|
var _ref = other,
|
|
306
326
|
mediaViewerType = _ref.mediaViewerType,
|
|
307
327
|
otherProps = _objectWithoutProperties(_ref, _excluded2);
|
|
308
|
-
return renderBox( /*#__PURE__*/
|
|
328
|
+
return renderBox( /*#__PURE__*/_jsx(MediaViewer, _objectSpread({
|
|
309
329
|
type: mediaViewerType
|
|
310
330
|
}, otherProps)));
|
|
311
331
|
}
|
|
@@ -322,18 +342,19 @@ export var cellItemMap = {
|
|
|
322
342
|
if (typeof subItem.color === 'string') {
|
|
323
343
|
return subItem.color;
|
|
324
344
|
}
|
|
325
|
-
return
|
|
345
|
+
return '#2db7f5';
|
|
326
346
|
}();
|
|
327
|
-
return renderBox(isEmpty(value) ? '' : /*#__PURE__*/
|
|
328
|
-
color: color
|
|
329
|
-
|
|
347
|
+
return renderBox(isEmpty(value) ? '' : /*#__PURE__*/_jsx(Tag, _objectSpread(_objectSpread({}, _otherProps), {}, {
|
|
348
|
+
color: color,
|
|
349
|
+
children: value
|
|
350
|
+
})));
|
|
330
351
|
}
|
|
331
352
|
case 'icon':
|
|
332
353
|
{
|
|
333
354
|
var _ref3 = other,
|
|
334
355
|
iconsType = _ref3.iconsType,
|
|
335
356
|
_otherProps2 = _objectWithoutProperties(_ref3, _excluded4);
|
|
336
|
-
return renderBox( /*#__PURE__*/
|
|
357
|
+
return renderBox( /*#__PURE__*/_jsx(Icons, _objectSpread({
|
|
337
358
|
type: iconsType
|
|
338
359
|
}, _otherProps2)));
|
|
339
360
|
}
|
|
@@ -341,34 +362,40 @@ export var cellItemMap = {
|
|
|
341
362
|
break;
|
|
342
363
|
}
|
|
343
364
|
};
|
|
344
|
-
return /*#__PURE__*/
|
|
365
|
+
return /*#__PURE__*/_jsxs(DataCellRowText, {
|
|
345
366
|
className: "data-cell-group-v2-box",
|
|
346
|
-
style: props === null || props === void 0 ? void 0 : props.style
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
paddingRight: 3
|
|
354
|
-
}
|
|
355
|
-
}, ":") : '', /*#__PURE__*/React.createElement(DataCellRowTextValue, {
|
|
356
|
-
className: "data-cell-group-v2-value",
|
|
357
|
-
style: _objectSpread({
|
|
358
|
-
gap: props.itemsGap,
|
|
359
|
-
flexDirection: props.itemsDirection
|
|
360
|
-
}, props.itemsStyle)
|
|
361
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, (_props$items = props.items) === null || _props$items === void 0 ? void 0 : _props$items.map(function (child, index) {
|
|
362
|
-
var _props$items2;
|
|
363
|
-
var arr = [];
|
|
364
|
-
arr.push(renderItem(child, index));
|
|
365
|
-
arr.push(((_props$items2 = props.items) === null || _props$items2 === void 0 ? void 0 : _props$items2.length) - 1 === index ? undefined : !isEmpty(props.itemsSeparator) && props.itemsDirection === 'row' ? /*#__PURE__*/React.createElement("span", {
|
|
366
|
-
key: "span-".concat(index),
|
|
367
|
+
style: props === null || props === void 0 ? void 0 : props.style,
|
|
368
|
+
children: [!isEmpty(props.label) ? /*#__PURE__*/_jsx(DataCellRowTextLabel, {
|
|
369
|
+
className: "data-cell-group-v2-label",
|
|
370
|
+
title: "".concat(props.label),
|
|
371
|
+
style: props === null || props === void 0 ? void 0 : props.labelStyle,
|
|
372
|
+
children: "".concat(props.label)
|
|
373
|
+
}) : '', !isEmpty(props.label) ? /*#__PURE__*/_jsx("span", {
|
|
367
374
|
style: {
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
375
|
+
paddingRight: 3
|
|
376
|
+
},
|
|
377
|
+
children: ":"
|
|
378
|
+
}) : '', /*#__PURE__*/_jsx(DataCellRowTextValue, {
|
|
379
|
+
className: "data-cell-group-v2-value",
|
|
380
|
+
style: _objectSpread({
|
|
381
|
+
gap: props.itemsGap,
|
|
382
|
+
flexDirection: props.itemsDirection
|
|
383
|
+
}, props.itemsStyle),
|
|
384
|
+
children: /*#__PURE__*/_jsx(_Fragment, {
|
|
385
|
+
children: (_props$items = props.items) === null || _props$items === void 0 ? void 0 : _props$items.map(function (child, index) {
|
|
386
|
+
var _props$items2;
|
|
387
|
+
var arr = [];
|
|
388
|
+
arr.push(renderItem(child, index));
|
|
389
|
+
arr.push(((_props$items2 = props.items) === null || _props$items2 === void 0 ? void 0 : _props$items2.length) - 1 === index ? undefined : !isEmpty(props.itemsSeparator) && props.itemsDirection === 'row' ? /*#__PURE__*/_jsx("span", {
|
|
390
|
+
style: {
|
|
391
|
+
paddingInline: 2
|
|
392
|
+
},
|
|
393
|
+
children: props.itemsSeparator
|
|
394
|
+
}, "span-".concat(index)) : undefined);
|
|
395
|
+
return arr;
|
|
396
|
+
})
|
|
397
|
+
})
|
|
398
|
+
})]
|
|
399
|
+
});
|
|
373
400
|
}
|
|
374
401
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GetProps, Tag } from "antd";
|
|
2
|
-
import { HTMLAttributeAnchorTarget } from "react";
|
|
3
1
|
import { Icons, MediaViewer } from "../..";
|
|
2
|
+
import { GetProps, Tag } from 'antd';
|
|
3
|
+
import { HTMLAttributeAnchorTarget } from 'react';
|
|
4
4
|
/** 组件props */
|
|
5
5
|
export interface IDataCellProps {
|
|
6
6
|
/** 每一行展示内容 */
|
|
@@ -76,13 +76,13 @@ export interface ICellPropsMap {
|
|
|
76
76
|
*/
|
|
77
77
|
separator?: string;
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
icon: {
|
|
80
80
|
/** 类型 */
|
|
81
81
|
label?: GetProps<typeof Icons>['type'];
|
|
82
82
|
/** 图标 */
|
|
83
83
|
value?: string;
|
|
84
84
|
} & Omit<GetProps<typeof Icons>, 'type' | 'name'> & TCellActionExtend;
|
|
85
|
-
|
|
85
|
+
group: {
|
|
86
86
|
items: Array<Omit<IDataCellItem<TDataCellType>, 'extra'>>;
|
|
87
87
|
/** 样式 */
|
|
88
88
|
style?: React.CSSProperties;
|
|
@@ -113,19 +113,19 @@ export type TGroupV2 = {
|
|
|
113
113
|
* @default 2
|
|
114
114
|
*/
|
|
115
115
|
itemsGap?: number | string;
|
|
116
|
-
items: Array<{
|
|
116
|
+
items: Array<({
|
|
117
117
|
type?: 'text';
|
|
118
118
|
value?: React.ReactNode;
|
|
119
|
-
} & ICommonGroupV2 | {
|
|
119
|
+
} & ICommonGroupV2) | ({
|
|
120
120
|
type?: 'img';
|
|
121
121
|
mediaViewerType?: GetProps<typeof MediaViewer>['type'];
|
|
122
|
-
} & ICommonGroupV2 & Omit<GetProps<typeof MediaViewer>, 'type'> | {
|
|
122
|
+
} & ICommonGroupV2 & Omit<GetProps<typeof MediaViewer>, 'type'>) | ({
|
|
123
123
|
type?: 'tag';
|
|
124
124
|
value?: React.ReactNode;
|
|
125
|
-
} & ICommonGroupV2 & Omit<GetProps<typeof Tag>, 'children'> | {
|
|
125
|
+
} & ICommonGroupV2 & Omit<GetProps<typeof Tag>, 'children'>) | ({
|
|
126
126
|
type?: 'icon';
|
|
127
127
|
iconsType?: GetProps<typeof Icons>['type'];
|
|
128
|
-
} & ICommonGroupV2 & Omit<GetProps<typeof Icons>, 'type'> | TGroupV2>;
|
|
128
|
+
} & ICommonGroupV2 & Omit<GetProps<typeof Icons>, 'type'>) | TGroupV2>;
|
|
129
129
|
};
|
|
130
130
|
/** 顶层样式 */
|
|
131
131
|
rootStyle?: React.CSSProperties;
|