@teamias/rex-design 0.0.1

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.
Files changed (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -0
  3. package/dist/components/action-buttons/action-buttons.d.ts +2 -0
  4. package/dist/components/action-buttons/action-buttons.js +182 -0
  5. package/dist/components/action-buttons/demo/index.d.ts +2 -0
  6. package/dist/components/action-buttons/demo/index.js +69 -0
  7. package/dist/components/action-buttons/index.d.ts +3 -0
  8. package/dist/components/action-buttons/index.js +3 -0
  9. package/dist/components/action-buttons/modules/handlerFilter.d.ts +2 -0
  10. package/dist/components/action-buttons/modules/handlerFilter.js +62 -0
  11. package/dist/components/action-buttons/types.d.ts +96 -0
  12. package/dist/components/action-buttons/types.js +3 -0
  13. package/dist/components/base-form/base-form.d.ts +3 -0
  14. package/dist/components/base-form/base-form.js +260 -0
  15. package/dist/components/base-form/demo/index.d.ts +4 -0
  16. package/dist/components/base-form/demo/index.js +515 -0
  17. package/dist/components/base-form/index.d.ts +4 -0
  18. package/dist/components/base-form/index.js +4 -0
  19. package/dist/components/base-form/locales/en-US.json +21 -0
  20. package/dist/components/base-form/locales/zh-CN.json +21 -0
  21. package/dist/components/base-form/locales.index.d.ts +42 -0
  22. package/dist/components/base-form/locales.index.js +4 -0
  23. package/dist/components/base-form/modules/dependencyUtils.d.ts +13 -0
  24. package/dist/components/base-form/modules/dependencyUtils.js +43 -0
  25. package/dist/components/base-form/modules/handlerData.d.ts +8 -0
  26. package/dist/components/base-form/modules/handlerData.js +59 -0
  27. package/dist/components/base-form/modules/renderComponentNode.d.ts +11 -0
  28. package/dist/components/base-form/modules/renderComponentNode.js +607 -0
  29. package/dist/components/base-form/modules/valuesToFields.d.ts +10 -0
  30. package/dist/components/base-form/modules/valuesToFields.js +18 -0
  31. package/dist/components/base-form/style/index.d.ts +3 -0
  32. package/dist/components/base-form/style/index.js +8 -0
  33. package/dist/components/base-form/types.d.ts +181 -0
  34. package/dist/components/base-form/types.js +10 -0
  35. package/dist/components/base-list-table/base-list-table.d.ts +33 -0
  36. package/dist/components/base-list-table/base-list-table.js +292 -0
  37. package/dist/components/base-list-table/demo/BasicBaseListTable.d.ts +2 -0
  38. package/dist/components/base-list-table/demo/BasicBaseListTable.js +1469 -0
  39. package/dist/components/base-list-table/demo/NoData.d.ts +2 -0
  40. package/dist/components/base-list-table/demo/NoData.js +55 -0
  41. package/dist/components/base-list-table/demo/TableMaxRowCount.d.ts +2 -0
  42. package/dist/components/base-list-table/demo/TableMaxRowCount.js +1696 -0
  43. package/dist/components/base-list-table/demo/VirtualDemo.d.ts +2 -0
  44. package/dist/components/base-list-table/demo/VirtualDemo.js +548 -0
  45. package/dist/components/base-list-table/index.d.ts +1 -0
  46. package/dist/components/base-list-table/index.js +1 -0
  47. package/dist/components/base-list-table/style/index.d.ts +5 -0
  48. package/dist/components/base-list-table/style/index.js +17 -0
  49. package/dist/components/base-table/base-table.d.ts +51 -0
  50. package/dist/components/base-table/base-table.js +291 -0
  51. package/dist/components/base-table/components/BaseTableRow.d.ts +1 -0
  52. package/dist/components/base-table/components/BaseTableRow.js +129 -0
  53. package/dist/components/base-table/demo/BaseTableAll.d.ts +2 -0
  54. package/dist/components/base-table/demo/BaseTableAll.js +66 -0
  55. package/dist/components/base-table/demo/BaseTableBasic.d.ts +2 -0
  56. package/dist/components/base-table/demo/BaseTableBasic.js +58 -0
  57. package/dist/components/base-table/demo/BaseTableIndex.d.ts +2 -0
  58. package/dist/components/base-table/demo/BaseTableIndex.js +57 -0
  59. package/dist/components/base-table/demo/BaseTableRowSelect.d.ts +2 -0
  60. package/dist/components/base-table/demo/BaseTableRowSelect.js +45 -0
  61. package/dist/components/base-table/demo/tableData.d.ts +332 -0
  62. package/dist/components/base-table/demo/tableData.js +293 -0
  63. package/dist/components/base-table/index.d.ts +1 -0
  64. package/dist/components/base-table/index.js +1 -0
  65. package/dist/components/base-table/style/index.d.ts +3 -0
  66. package/dist/components/base-table/style/index.js +9 -0
  67. package/dist/components/data-cell/data-cell.d.ts +3 -0
  68. package/dist/components/data-cell/data-cell.js +17 -0
  69. package/dist/components/data-cell/demo/index.d.ts +2 -0
  70. package/dist/components/data-cell/demo/index.js +332 -0
  71. package/dist/components/data-cell/index.d.ts +2 -0
  72. package/dist/components/data-cell/index.js +2 -0
  73. package/dist/components/data-cell/modules/cellItemMap.d.ts +3 -0
  74. package/dist/components/data-cell/modules/cellItemMap.js +374 -0
  75. package/dist/components/data-cell/style/index.d.ts +7 -0
  76. package/dist/components/data-cell/style/index.js +23 -0
  77. package/dist/components/data-cell/types.d.ts +192 -0
  78. package/dist/components/data-cell/types.js +1 -0
  79. package/dist/components/icons/assets/icon-park--arrow-up.svg +7 -0
  80. package/dist/components/icons/assets/index.d.ts +4 -0
  81. package/dist/components/icons/assets/index.js +9 -0
  82. package/dist/components/icons/assets/svg-spinners--blocks-shuffle-3.svg +21 -0
  83. package/dist/components/icons/demo/index.d.ts +2 -0
  84. package/dist/components/icons/demo/index.js +43 -0
  85. package/dist/components/icons/icons.d.ts +39 -0
  86. package/dist/components/icons/icons.js +251 -0
  87. package/dist/components/icons/index.d.ts +1 -0
  88. package/dist/components/icons/index.js +1 -0
  89. package/dist/components/icons/style/index.d.ts +2 -0
  90. package/dist/components/icons/style/index.js +5 -0
  91. package/dist/components/media-viewer/demo/index.d.ts +2 -0
  92. package/dist/components/media-viewer/demo/index.js +23 -0
  93. package/dist/components/media-viewer/index.d.ts +1 -0
  94. package/dist/components/media-viewer/index.js +1 -0
  95. package/dist/components/media-viewer/media-viewer.d.ts +48 -0
  96. package/dist/components/media-viewer/media-viewer.js +119 -0
  97. package/dist/components/media-viewer/style/index.d.ts +6 -0
  98. package/dist/components/media-viewer/style/index.js +31 -0
  99. package/dist/hooks/request-fields-container/demo/index.d.ts +2 -0
  100. package/dist/hooks/request-fields-container/demo/index.js +36 -0
  101. package/dist/hooks/request-fields-container/index.d.ts +4 -0
  102. package/dist/hooks/request-fields-container/index.js +3 -0
  103. package/dist/hooks/request-fields-container/request-fields-container-context-provider.d.ts +22 -0
  104. package/dist/hooks/request-fields-container/request-fields-container-context-provider.js +134 -0
  105. package/dist/hooks/request-fields-container/request-fields-container-context.d.ts +39 -0
  106. package/dist/hooks/request-fields-container/request-fields-container-context.js +5 -0
  107. package/dist/hooks/request-fields-container/request-fields-container-hoc.d.ts +4 -0
  108. package/dist/hooks/request-fields-container/request-fields-container-hoc.js +31 -0
  109. package/dist/hooks/request-fields-container/use-request-fields-container.d.ts +22 -0
  110. package/dist/hooks/request-fields-container/use-request-fields-container.js +131 -0
  111. package/dist/hooks/rex-pro-config-provider/demo/index.d.ts +2 -0
  112. package/dist/hooks/rex-pro-config-provider/demo/index.js +61 -0
  113. package/dist/hooks/rex-pro-config-provider/index.d.ts +2 -0
  114. package/dist/hooks/rex-pro-config-provider/index.js +2 -0
  115. package/dist/hooks/rex-pro-config-provider/rex-pro-config-context.d.ts +27 -0
  116. package/dist/hooks/rex-pro-config-provider/rex-pro-config-context.js +33 -0
  117. package/dist/hooks/rex-pro-config-provider/rex-pro-config-provider.d.ts +6 -0
  118. package/dist/hooks/rex-pro-config-provider/rex-pro-config-provider.js +24 -0
  119. package/dist/hooks/rex-pro-config-provider/use-rex-pro-config-provider.d.ts +2 -0
  120. package/dist/hooks/rex-pro-config-provider/use-rex-pro-config-provider.js +11 -0
  121. package/dist/hooks/use-state-data/demo/index.d.ts +2 -0
  122. package/dist/hooks/use-state-data/demo/index.js +135 -0
  123. package/dist/hooks/use-state-data/index.d.ts +1 -0
  124. package/dist/hooks/use-state-data/index.js +1 -0
  125. package/dist/hooks/use-state-data/use-state-data.d.ts +11 -0
  126. package/dist/hooks/use-state-data/use-state-data.js +64 -0
  127. package/dist/index.d.ts +10 -0
  128. package/dist/index.js +10 -0
  129. package/dist/types/svg.d.ts +4 -0
  130. package/dist/utils/locales/en-US.json +13 -0
  131. package/dist/utils/locales/index.d.ts +26 -0
  132. package/dist/utils/locales/index.js +4 -0
  133. package/dist/utils/locales/zh-CN.json +13 -0
  134. package/package.json +90 -0
@@ -0,0 +1,374 @@
1
+ var _excluded = ["ellipsis", "tooltip", "copyable", "action", "urlTarget", "url", "style", "type"],
2
+ _excluded2 = ["mediaViewerType"],
3
+ _excluded3 = ["value"],
4
+ _excluded4 = ["iconsType"];
5
+ 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
+ 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
+ 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
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ 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
+ 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
+ import { Icons, MediaViewer } from "../../..";
17
+ import { DataCell } from "../data-cell";
18
+ import { DataCellRowText, DataCellRowTextLabel, DataCellRowTextValue } from "../style";
19
+ var isEmpty = function isEmpty(val) {
20
+ if (val === '' || val === null || val === undefined) return true;
21
+ if (typeof val === 'undefined') return true;
22
+ return false;
23
+ };
24
+
25
+ /** 动作块渲染 */
26
+ var actionRender = function actionRender(item, action, node, click) {
27
+ var _item$urlTarget;
28
+ var tooltipBox = function tooltipBox(content) {
29
+ if (item.tooltip) {
30
+ return /*#__PURE__*/React.createElement(Tooltip, {
31
+ styles: {
32
+ body: {
33
+ whiteSpace: 'pre-wrap',
34
+ wordBreak: 'break-word'
35
+ }
36
+ },
37
+ title: item.tooltip,
38
+ arrow: false
39
+ }, content);
40
+ }
41
+ return content;
42
+ };
43
+ if (action === 'default') {
44
+ return tooltipBox( /*#__PURE__*/React.createElement("span", {
45
+ style: item.style
46
+ }, node));
47
+ }
48
+
49
+ // 自定义
50
+ if (action === 'custom') {
51
+ return tooltipBox( /*#__PURE__*/React.createElement("a", {
52
+ href: "void",
53
+ style: item.style,
54
+ onClick: function onClick(e) {
55
+ e.preventDefault();
56
+ click === null || click === void 0 || click();
57
+ }
58
+ }, node));
59
+ }
60
+
61
+ // TODO: 窗口-未实现
62
+ // if (action === 'modal') {
63
+ // return <a href="javascript:void;" onClick={() => click?.()}>{node}</a>
64
+ // }
65
+
66
+ // 默认url
67
+ return tooltipBox( /*#__PURE__*/React.createElement("a", {
68
+ style: item.style,
69
+ href: item.value,
70
+ target: (_item$urlTarget = item.urlTarget) !== null && _item$urlTarget !== void 0 ? _item$urlTarget : '_blank',
71
+ rel: "noreferrer"
72
+ }, node));
73
+ };
74
+ export var cellItemMap = {
75
+ /** 文本块 */
76
+ text: function text(item, click) {
77
+ var props = item.props;
78
+ if (!props) return undefined;
79
+ return !isEmpty(props.label) || !isEmpty(props.value) ? /*#__PURE__*/React.createElement(DataCellRowText, {
80
+ className: "data-cell-row-text",
81
+ style: props === null || props === void 0 ? void 0 : props.style
82
+ }, !isEmpty(props.label) ? /*#__PURE__*/React.createElement(DataCellRowTextLabel, {
83
+ className: "data-cell-row-text-label",
84
+ title: "".concat(props.label),
85
+ style: props === null || props === void 0 ? void 0 : props.labelStyle
86
+ }, "".concat(props.label)) : '', !isEmpty(props.label) && !isEmpty(props.value) ? /*#__PURE__*/React.createElement("span", {
87
+ style: {
88
+ paddingRight: 3
89
+ }
90
+ }, ":") : '', function () {
91
+ if (isEmpty(props.value)) return '';
92
+ if (_typeof(props.value) === 'object') {
93
+ return /*#__PURE__*/React.createElement(DataCellRowTextValue, {
94
+ className: "data-cell-row-text-value",
95
+ style: props === null || props === void 0 ? void 0 : props.valueStyle
96
+ }, cellItemMap[props.value.type](props.value, click));
97
+ }
98
+ return /*#__PURE__*/React.createElement(DataCellRowTextValue, {
99
+ ellipsis: props === null || props === void 0 ? void 0 : props.ellipsis,
100
+ className: "data-cell-row-text-value",
101
+ title: "".concat(props.tooltip || props.value),
102
+ style: props === null || props === void 0 ? void 0 : props.valueStyle
103
+ }, "".concat(props.value));
104
+ }(), _typeof(props.value) !== 'object' && props.copyable ? /*#__PURE__*/React.createElement(Typography.Paragraph, {
105
+ copyable: {
106
+ text: typeof props.copyable === 'string' ? props.copyable : "".concat(props.value)
107
+ }
108
+ }) : '') : undefined;
109
+ },
110
+ /** 图片块 */
111
+ img: function img(item) {
112
+ var props = item.props;
113
+ return /*#__PURE__*/React.createElement(MediaViewer, _extends({
114
+ src: props === null || props === void 0 ? void 0 : props.value,
115
+ alt: props === null || props === void 0 ? void 0 : props.label
116
+ }, props));
117
+ },
118
+ /** 链接块 */
119
+ link: function link(item, click) {
120
+ var props = item.props;
121
+ if (!props) return undefined;
122
+
123
+ // return actionRender(props, props.action, props.label, () => click?.(item));
124
+ return /*#__PURE__*/React.createElement(DataCellRowText, {
125
+ className: "data-cell-row-text link"
126
+ }, /*#__PURE__*/React.createElement(DataCellRowTextValue, {
127
+ ellipsis: props === null || props === void 0 ? void 0 : props.ellipsis,
128
+ className: "data-cell-row-text-value link",
129
+ style: {
130
+ flex: 'initial',
131
+ width: 'auto'
132
+ }
133
+ }, actionRender(props, props.action, props.label, function () {
134
+ return click === null || click === void 0 ? void 0 : click(item);
135
+ })), props.copyable ? /*#__PURE__*/React.createElement(Typography.Paragraph, {
136
+ copyable: {
137
+ text: typeof props.copyable === 'string' ? props.copyable : "".concat(props.label)
138
+ }
139
+ }) : '');
140
+ },
141
+ /** 链接组 */
142
+ 'link-group': function linkGroup(item, click) {
143
+ var props = item.props;
144
+ if (!props) return undefined;
145
+ return /*#__PURE__*/React.createElement("div", {
146
+ style: {
147
+ display: 'inline-flex'
148
+ }
149
+ }, props === null || props === void 0 ? void 0 : props.items.map(function (child, index) {
150
+ var _props$separator;
151
+ return /*#__PURE__*/React.createElement("div", {
152
+ style: {
153
+ display: 'inline-flex'
154
+ },
155
+ key: index
156
+ }, cellItemMap.link({
157
+ props: child,
158
+ type: 'link'
159
+ }, click), (props === null || props === void 0 ? void 0 : props.items.length) - 1 === index ? '' : /*#__PURE__*/React.createElement("span", {
160
+ style: {
161
+ paddingInline: 2
162
+ }
163
+ }, (_props$separator = props.separator) !== null && _props$separator !== void 0 ? _props$separator : '/'));
164
+ }));
165
+ },
166
+ /** tag块 */
167
+ tag: function tag(item, click) {
168
+ var props = item.props;
169
+ if (!props) return undefined;
170
+ var color = function () {
171
+ if (props.color !== null && _typeof(props.color) === 'object') {
172
+ var _props$color, _props$color$toHexStr;
173
+ return (_props$color = props.color) === null || _props$color === void 0 || (_props$color$toHexStr = _props$color.toHexString) === null || _props$color$toHexStr === void 0 ? void 0 : _props$color$toHexStr.call(_props$color);
174
+ }
175
+ if (typeof props.color === 'string') {
176
+ return props.color;
177
+ }
178
+ return "#2db7f5";
179
+ }();
180
+ return !isEmpty(props.label) || !isEmpty(props.value) ? /*#__PURE__*/React.createElement(Tag, _extends({}, props, {
181
+ color: color,
182
+ onClick: function onClick() {
183
+ return click === null || click === void 0 ? void 0 : click(item);
184
+ }
185
+ }), !isEmpty(props.label) ? /*#__PURE__*/React.createElement("span", {
186
+ title: "".concat(props.label)
187
+ }, "".concat(props.label)) : '', !isEmpty(props.label) && !isEmpty(props.value) ? /*#__PURE__*/React.createElement("span", {
188
+ style: {
189
+ paddingRight: 3
190
+ }
191
+ }, ":") : '', !isEmpty(props.value) ? /*#__PURE__*/React.createElement("span", {
192
+ title: "".concat(props.value)
193
+ }, "".concat(props.value)) : '') : undefined;
194
+ },
195
+ icon: function icon(item, click) {
196
+ var _props$action;
197
+ var props = item.props;
198
+ if (!props) return undefined;
199
+ return actionRender(props, (_props$action = props.action) !== null && _props$action !== void 0 ? _props$action : 'default', /*#__PURE__*/React.createElement(Icons, {
200
+ type: props.label,
201
+ name: props.value
202
+ }), function () {
203
+ return click === null || click === void 0 ? void 0 : click(item);
204
+ });
205
+ },
206
+ /** 块组 */
207
+ group: function group(item, click) {
208
+ var props = item.props;
209
+ if (!props) return undefined;
210
+ return /*#__PURE__*/React.createElement("div", {
211
+ style: props.style
212
+ }, /*#__PURE__*/React.createElement(DataCell, {
213
+ items: props.items,
214
+ onClick: click
215
+ }));
216
+ },
217
+ 'group-v2': function groupV2(item, click) {
218
+ var _props$items;
219
+ var props = item.props;
220
+ if (!props) return undefined;
221
+ // itemsSeparator itemsStyle itemsDirection itemsGap
222
+ // ellipsis tooltip copyable action urlTarget url style
223
+ var renderItem = function renderItem(subItem, index) {
224
+ var count = 0;
225
+ if (subItem.type === 'group-v2') {
226
+ return /*#__PURE__*/React.createElement(DataCell, {
227
+ key: "renderItem-".concat(index, "-").concat(count++),
228
+ items: [subItem],
229
+ onClick: click
230
+ });
231
+ }
232
+ var ellipsis = subItem.ellipsis,
233
+ tooltip = subItem.tooltip,
234
+ copyable = subItem.copyable,
235
+ action = subItem.action,
236
+ urlTarget = subItem.urlTarget,
237
+ url = subItem.url,
238
+ style = subItem.style,
239
+ type = subItem.type,
240
+ other = _objectWithoutProperties(subItem, _excluded);
241
+ var renderBox = function renderBox(content) {
242
+ var afterContent = /*#__PURE__*/React.createElement(DataCellRowTextValue, {
243
+ className: "data-cell-group-v2-value-item"
244
+ // title={typeof content === 'string' ? content : ''}
245
+ ,
246
+ ellipsis: ellipsis,
247
+ key: "renderItem-".concat(index, "-").concat(count++)
248
+ }, content);
249
+ if (tooltip) {
250
+ afterContent = /*#__PURE__*/React.createElement(Tooltip, {
251
+ styles: {
252
+ body: {
253
+ whiteSpace: 'pre-wrap',
254
+ wordBreak: 'break-word'
255
+ }
256
+ },
257
+ title: typeof tooltip === 'boolean' ? "".concat(content) : tooltip,
258
+ arrow: false,
259
+ key: "renderItem-".concat(index, "-").concat(count++)
260
+ }, afterContent);
261
+ }
262
+ if (copyable) {
263
+ afterContent = /*#__PURE__*/React.createElement(React.Fragment, null, afterContent, /*#__PURE__*/React.createElement(Typography.Paragraph, {
264
+ copyable: {
265
+ text: typeof copyable === 'string' ? copyable : "".concat(typeof content === 'string' ? content : '')
266
+ },
267
+ key: "renderItem-".concat(index, "-").concat(count++)
268
+ }));
269
+ }
270
+ if (action === 'url') {
271
+ return /*#__PURE__*/React.createElement("a", {
272
+ href: url,
273
+ target: urlTarget !== null && urlTarget !== void 0 ? urlTarget : '_blank',
274
+ style: _objectSpread({
275
+ display: 'inline-flex'
276
+ }, style),
277
+ key: "renderItem-".concat(index, "-").concat(count++)
278
+ }, afterContent);
279
+ }
280
+ if (action === 'custom') {
281
+ return /*#__PURE__*/React.createElement("a", {
282
+ href: "void",
283
+ style: _objectSpread({
284
+ display: 'inline-flex'
285
+ }, style),
286
+ key: "renderItem-".concat(index, "-").concat(count++),
287
+ onClick: function onClick(e) {
288
+ e.preventDefault();
289
+ click === null || click === void 0 || click(item, subItem);
290
+ }
291
+ }, afterContent);
292
+ }
293
+ return /*#__PURE__*/React.createElement("div", {
294
+ style: _objectSpread({
295
+ display: 'inline-flex'
296
+ }, style),
297
+ key: "renderItem-".concat(index, "-").concat(count++)
298
+ }, afterContent);
299
+ };
300
+ switch (type) {
301
+ case 'text':
302
+ return renderBox(subItem.value);
303
+ case 'img':
304
+ {
305
+ var _ref = other,
306
+ mediaViewerType = _ref.mediaViewerType,
307
+ otherProps = _objectWithoutProperties(_ref, _excluded2);
308
+ return renderBox( /*#__PURE__*/React.createElement(MediaViewer, _extends({
309
+ type: mediaViewerType
310
+ }, otherProps)));
311
+ }
312
+ case 'tag':
313
+ {
314
+ var _ref2 = other,
315
+ value = _ref2.value,
316
+ _otherProps = _objectWithoutProperties(_ref2, _excluded3);
317
+ var color = function () {
318
+ if (subItem.color !== null && _typeof(subItem.color) === 'object') {
319
+ var _subItem$color, _subItem$color$toHexS;
320
+ return (_subItem$color = subItem.color) === null || _subItem$color === void 0 || (_subItem$color$toHexS = _subItem$color.toHexString) === null || _subItem$color$toHexS === void 0 ? void 0 : _subItem$color$toHexS.call(_subItem$color);
321
+ }
322
+ if (typeof subItem.color === 'string') {
323
+ return subItem.color;
324
+ }
325
+ return "#2db7f5";
326
+ }();
327
+ return renderBox(isEmpty(value) ? '' : /*#__PURE__*/React.createElement(Tag, _extends({}, _otherProps, {
328
+ color: color
329
+ }), value));
330
+ }
331
+ case 'icon':
332
+ {
333
+ var _ref3 = other,
334
+ iconsType = _ref3.iconsType,
335
+ _otherProps2 = _objectWithoutProperties(_ref3, _excluded4);
336
+ return renderBox( /*#__PURE__*/React.createElement(Icons, _extends({
337
+ type: iconsType
338
+ }, _otherProps2)));
339
+ }
340
+ default:
341
+ break;
342
+ }
343
+ };
344
+ return /*#__PURE__*/React.createElement(DataCellRowText, {
345
+ className: "data-cell-group-v2-box",
346
+ style: props === null || props === void 0 ? void 0 : props.style
347
+ }, !isEmpty(props.label) ? /*#__PURE__*/React.createElement(DataCellRowTextLabel, {
348
+ className: "data-cell-group-v2-label",
349
+ title: "".concat(props.label),
350
+ style: props === null || props === void 0 ? void 0 : props.labelStyle
351
+ }, "".concat(props.label)) : '', !isEmpty(props.label) ? /*#__PURE__*/React.createElement("span", {
352
+ style: {
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: {
368
+ paddingInline: 2
369
+ }
370
+ }, props.itemsSeparator) : undefined);
371
+ return arr;
372
+ }))));
373
+ }
374
+ };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const DataCellRowText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
+ export declare const DataCellRowTextLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
5
+ export declare const DataCellRowTextValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
6
+ ellipsis?: number | undefined;
7
+ }>> & string;
@@ -0,0 +1,23 @@
1
+ import styled from 'styled-components';
2
+ export var Wrapper = styled.div.withConfig({
3
+ displayName: "Wrapper",
4
+ componentId: "rex-design-aaf4__sc-9eukro-0"
5
+ })(["&.data-cell-row-item{font-size:12px;}"]);
6
+ export var DataCellRowText = styled.div.withConfig({
7
+ displayName: "DataCellRowText",
8
+ componentId: "rex-design-aaf4__sc-9eukro-1"
9
+ })(["&.data-cell-row-text{display:inline-flex;gap:1px;width:100%;align-items:flex-start;>.ant-typography{margin:0;margin-left:2px;opacity:0;z-index:-1;transition:.2s;position:relative;}&:hover > .ant-typography{opacity:1;z-index:initial;}}&.data-cell-group-v2-box{display:flex;width:100%;gap:1px;align-items:flex-start;div:has(.data-cell-group-v2-value-item),a:has(.data-cell-group-v2-value-item){.data-cell-group-v2-value-item + .ant-typography{margin:0;margin-left:2px;opacity:0;z-index:-1;transition:.2s;position:relative;}&:hover > .ant-typography{opacity:1;z-index:initial;}}}"]);
10
+ export var DataCellRowTextLabel = styled.span.withConfig({
11
+ displayName: "DataCellRowTextLabel",
12
+ componentId: "rex-design-aaf4__sc-9eukro-2"
13
+ })(["&.data-cell-row-text-label{white-space:nowrap;}&.data-cell-group-v2-label{white-space:nowrap;}&.data-cell-row-text-label.link{display:inline-flex;}"]);
14
+ export var DataCellRowTextValue = styled.span.withConfig({
15
+ displayName: "DataCellRowTextValue",
16
+ componentId: "rex-design-aaf4__sc-9eukro-3"
17
+ })(["&.data-cell-row-text-value{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:", ";-webkit-box-orient:vertical;word-break:break-word;}&.data-cell-group-v2-value{display:flex;gap:2px;flex-direction:row;}&.data-cell-group-v2-value-item{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:", ";-webkit-box-orient:vertical;word-break:break-word;}&.data-cell-row-text-value.link{}"], function (props) {
18
+ var _props$ellipsis;
19
+ return (_props$ellipsis = props.ellipsis) !== null && _props$ellipsis !== void 0 ? _props$ellipsis : 2;
20
+ }, function (props) {
21
+ var _props$ellipsis2;
22
+ return (_props$ellipsis2 = props.ellipsis) !== null && _props$ellipsis2 !== void 0 ? _props$ellipsis2 : 2;
23
+ });
@@ -0,0 +1,192 @@
1
+ import { GetProps, Tag } from "antd";
2
+ import { HTMLAttributeAnchorTarget } from "react";
3
+ import { Icons, MediaViewer } from "../..";
4
+ /** 组件props */
5
+ export interface IDataCellProps {
6
+ /** 每一行展示内容 */
7
+ items: Array<TGroupV2 | IDataCellItem<TDataCellType>>;
8
+ /** 点击回调 */
9
+ onClick?: (item: IDataCellItem, subItem?: Exclude<TGroupV2['props'], undefined>['items'][number]) => void;
10
+ }
11
+ export interface IDataCellItem<T extends TDataCellType = TDataCellType> {
12
+ /** 组件类型 */
13
+ type: T;
14
+ /** 组件props */
15
+ props?: ICellPropsMap[T];
16
+ /** 顶层样式 */
17
+ rootStyle?: React.CSSProperties;
18
+ /** 扩展信息 */
19
+ extra?: {
20
+ rowSpan?: number;
21
+ colSpan?: number;
22
+ };
23
+ }
24
+ export interface ICellPropsMap {
25
+ text: {
26
+ /** 小标题 */
27
+ label?: string | number | boolean;
28
+ /** 展示值 */
29
+ value?: string | number | boolean | Omit<IDataCellItem<TDataCellType>, 'extra'>;
30
+ /** 样式 */
31
+ style?: React.CSSProperties;
32
+ /**
33
+ * 缺省
34
+ * @default 2
35
+ */
36
+ ellipsis?: number;
37
+ /** 提示信息 */
38
+ tooltip?: string;
39
+ /** 可复制 */
40
+ copyable?: boolean | string;
41
+ labelStyle?: React.CSSProperties;
42
+ valueStyle?: React.CSSProperties;
43
+ };
44
+ img: {
45
+ /** alt文案 */
46
+ label?: string;
47
+ /** url地址 */
48
+ value?: string;
49
+ } & Omit<GetProps<typeof MediaViewer>, 'src' | 'alt'>;
50
+ link: {
51
+ /** 展示文案 */
52
+ label?: string;
53
+ /** 跳转地址 */
54
+ value?: string;
55
+ /**
56
+ * 缺省
57
+ * @default 2
58
+ */
59
+ ellipsis?: number;
60
+ /** 提示信息 */
61
+ tooltip?: string;
62
+ /** 可复制 */
63
+ copyable?: boolean | string;
64
+ } & TCellActionExtend;
65
+ tag: {
66
+ /** 小标题 */
67
+ label?: string;
68
+ /** 展示值 */
69
+ value?: string;
70
+ } & Omit<GetProps<typeof Tag>, 'children'>;
71
+ 'link-group': {
72
+ items: Array<ICellPropsMap['link']>;
73
+ /**
74
+ * 分离器
75
+ * @default /
76
+ */
77
+ separator?: string;
78
+ };
79
+ 'icon': {
80
+ /** 类型 */
81
+ label?: GetProps<typeof Icons>['type'];
82
+ /** 图标 */
83
+ value?: string;
84
+ } & Omit<GetProps<typeof Icons>, 'type' | 'name'> & TCellActionExtend;
85
+ 'group': {
86
+ items: Array<Omit<IDataCellItem<TDataCellType>, 'extra'>>;
87
+ /** 样式 */
88
+ style?: React.CSSProperties;
89
+ };
90
+ 'group-v2': TGroupV2['props'];
91
+ }
92
+ export type TGroupV2 = {
93
+ /** 组件类型 */
94
+ type: 'group-v2';
95
+ /** 组件props */
96
+ props?: {
97
+ style?: React.CSSProperties;
98
+ label?: string;
99
+ labelStyle?: React.CSSProperties;
100
+ /**
101
+ * 分离器
102
+ */
103
+ itemsSeparator?: string;
104
+ /** 样式 */
105
+ itemsStyle?: React.CSSProperties;
106
+ /**
107
+ * 排列方向
108
+ * @default row
109
+ */
110
+ itemsDirection?: 'column' | 'row';
111
+ /**
112
+ * 间距
113
+ * @default 2
114
+ */
115
+ itemsGap?: number | string;
116
+ items: Array<{
117
+ type?: 'text';
118
+ value?: React.ReactNode;
119
+ } & ICommonGroupV2 | {
120
+ type?: 'img';
121
+ mediaViewerType?: GetProps<typeof MediaViewer>['type'];
122
+ } & ICommonGroupV2 & Omit<GetProps<typeof MediaViewer>, 'type'> | {
123
+ type?: 'tag';
124
+ value?: React.ReactNode;
125
+ } & ICommonGroupV2 & Omit<GetProps<typeof Tag>, 'children'> | {
126
+ type?: 'icon';
127
+ iconsType?: GetProps<typeof Icons>['type'];
128
+ } & ICommonGroupV2 & Omit<GetProps<typeof Icons>, 'type'> | TGroupV2>;
129
+ };
130
+ /** 顶层样式 */
131
+ rootStyle?: React.CSSProperties;
132
+ /** 扩展信息 */
133
+ extra?: {
134
+ rowSpan?: number;
135
+ colSpan?: number;
136
+ };
137
+ };
138
+ export interface ICommonGroupV2 {
139
+ /**
140
+ * 缺省
141
+ * @default 2
142
+ */
143
+ ellipsis?: number;
144
+ /** 提示信息 */
145
+ tooltip?: string | boolean;
146
+ /** 可复制 */
147
+ copyable?: boolean | string;
148
+ /**
149
+ * 触发类型
150
+ * - url 跳转路由
151
+ * - custom 透传出去
152
+ * - default 什么都不做
153
+ * @default default
154
+ */
155
+ action?: 'url' | 'custom' | 'default';
156
+ /**
157
+ * url 跳转类型
158
+ * - a 标签的 target 属性
159
+ * @default _blank
160
+ */
161
+ urlTarget?: HTMLAttributeAnchorTarget;
162
+ /** 跳转路径 */
163
+ url?: string;
164
+ /** 样式 */
165
+ style?: React.CSSProperties;
166
+ }
167
+ /** 操作功能 */
168
+ export type TCellActionExtend = {
169
+ label?: string;
170
+ value?: string;
171
+ /**
172
+ * 触发类型
173
+ * - url 跳转路由
174
+ * - modal-form 弹出表单窗口(未实现)
175
+ * - modal-search 弹出搜索窗口(未实现)
176
+ * - custom 透传出去
177
+ * - default 什么都不做
178
+ */
179
+ action: 'url' | 'modal-form' | 'modal-search' | 'custom' | 'default';
180
+ /**
181
+ * url 跳转类型
182
+ * - a 标签的 target 属性
183
+ * @default _blank
184
+ */
185
+ urlTarget?: HTMLAttributeAnchorTarget;
186
+ /** 样式 */
187
+ style?: React.CSSProperties;
188
+ /** 提示信息 */
189
+ tooltip?: string;
190
+ };
191
+ /** 支持配置的展示类型 */
192
+ export type TDataCellType = 'text' | 'link' | 'tag' | 'link-group' | 'img' | 'icon' | 'group' | 'group-v2';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
2
+ <rect width="48" height="48" fill="none" />
3
+ <g fill="none" stroke="#020000" stroke-linecap="round" stroke-linejoin="round" stroke-width="4">
4
+ <path d="M24 6V42" />
5
+ <path d="M12 18L24 6L36 18" />
6
+ </g>
7
+ </svg>
@@ -0,0 +1,4 @@
1
+ /** 本地图标枚举 */
2
+ export declare const localIconMap: Record<string, () => Promise<{
3
+ default: string;
4
+ }>>;
@@ -0,0 +1,9 @@
1
+ /** 本地图标枚举 */
2
+ export var localIconMap = {
3
+ 'icon-park--arrow-up': function iconParkArrowUp() {
4
+ return import("./icon-park--arrow-up.svg");
5
+ },
6
+ 'svg-spinners--blocks-shuffle-3': function svgSpinnersBlocksShuffle3() {
7
+ return import("./svg-spinners--blocks-shuffle-3.svg");
8
+ }
9
+ };
@@ -0,0 +1,21 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
2
+ <rect width="24" height="24" fill="none" />
3
+ <rect width="10" height="10" x="1" y="1" fill="currentColor" rx="1">
4
+ <animate id="svgSpinnersBlocksShuffle30" fill="freeze" attributeName="x" begin="0;svgSpinnersBlocksShuffle3b.end" dur="0.2s" values="1;13" />
5
+ <animate id="svgSpinnersBlocksShuffle31" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle38.end" dur="0.2s" values="1;13" />
6
+ <animate id="svgSpinnersBlocksShuffle32" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle39.end" dur="0.2s" values="13;1" />
7
+ <animate id="svgSpinnersBlocksShuffle33" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle3a.end" dur="0.2s" values="13;1" />
8
+ </rect>
9
+ <rect width="10" height="10" x="1" y="13" fill="currentColor" rx="1">
10
+ <animate id="svgSpinnersBlocksShuffle34" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle30.end" dur="0.2s" values="13;1" />
11
+ <animate id="svgSpinnersBlocksShuffle35" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle31.end" dur="0.2s" values="1;13" />
12
+ <animate id="svgSpinnersBlocksShuffle36" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle32.end" dur="0.2s" values="1;13" />
13
+ <animate id="svgSpinnersBlocksShuffle37" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle33.end" dur="0.2s" values="13;1" />
14
+ </rect>
15
+ <rect width="10" height="10" x="13" y="13" fill="currentColor" rx="1">
16
+ <animate id="svgSpinnersBlocksShuffle38" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle34.end" dur="0.2s" values="13;1" />
17
+ <animate id="svgSpinnersBlocksShuffle39" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle35.end" dur="0.2s" values="13;1" />
18
+ <animate id="svgSpinnersBlocksShuffle3a" fill="freeze" attributeName="x" begin="svgSpinnersBlocksShuffle36.end" dur="0.2s" values="1;13" />
19
+ <animate id="svgSpinnersBlocksShuffle3b" fill="freeze" attributeName="y" begin="svgSpinnersBlocksShuffle37.end" dur="0.2s" values="1;13" />
20
+ </rect>
21
+ </svg>
@@ -0,0 +1,2 @@
1
+ declare const _default: () => import("react/jsx-runtime").JSX.Element;
2
+ export default _default;