@teamias/rex-design 0.0.1 → 0.0.3
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 +37 -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
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseListTable } from "../base-list-table";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
6
|
export default (function () {
|
|
4
|
-
return /*#__PURE__*/
|
|
7
|
+
return /*#__PURE__*/_jsx(BaseListTable, {
|
|
5
8
|
defaultExpandAllCollapse: true,
|
|
6
9
|
rowSelection: {
|
|
7
10
|
getCheckboxProps: function getCheckboxProps(record) {
|
|
@@ -17,20 +20,26 @@ export default (function () {
|
|
|
17
20
|
},
|
|
18
21
|
virtual: true,
|
|
19
22
|
headerRender: function headerRender(originNode) {
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
24
|
+
children: [originNode, /*#__PURE__*/_jsx("span", {
|
|
25
|
+
style: {
|
|
26
|
+
color: 'red'
|
|
27
|
+
},
|
|
28
|
+
children: "\u81EA\u5B9A\u4E49\u5185\u5BB9"
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
25
31
|
},
|
|
26
32
|
titleRender: function titleRender(item, index, originNode) {
|
|
27
|
-
return /*#__PURE__*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
34
|
+
children: [originNode.checkboxNode, originNode.dataNode, /*#__PURE__*/_jsx("span", {
|
|
35
|
+
style: {
|
|
36
|
+
flex: 1,
|
|
37
|
+
textAlign: 'right',
|
|
38
|
+
color: 'red'
|
|
39
|
+
},
|
|
40
|
+
children: "\u81EA\u5B9A\u4E49\u5185\u5BB9"
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
34
43
|
},
|
|
35
44
|
fieldsConfig: [{
|
|
36
45
|
"title": "编号/状态",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GetProps, Table } from
|
|
2
|
-
import { IDataCellItem, TGroupV2 } from
|
|
1
|
+
import { GetProps, Table } from 'antd';
|
|
2
|
+
import { IDataCellItem, TGroupV2 } from '../data-cell/types';
|
|
3
3
|
export declare const BaseTable: <T extends object = object>({ useDataCellRender, fields: outFields, fieldsConfig, fieldProps: outFieldProps, requestFields, requestFieldsUrl, requestFieldsParams, fieldPropsFn, indexColumn, extraColumns, onDataCellClick, onDataCellClickV2, scroll, rootClassName, customEmptyText, ...otherProps }: IBaseTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
/** 组件props */
|
|
5
5
|
export interface IBaseTableProps<T extends object = object> extends Omit<TRawTableProps<T>, 'size' | 'bordered' | 'tableLayout' | 'scroll'> {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var _excluded = ["useDataCellRender", "fields", "fieldsConfig", "fieldProps", "requestFields", "requestFieldsUrl", "requestFieldsParams", "fieldPropsFn", "indexColumn", "extraColumns", "onDataCellClick", "onDataCellClickV2", "scroll", "rootClassName", "customEmptyText"];
|
|
2
|
-
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); }
|
|
3
2
|
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); }
|
|
4
3
|
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; }
|
|
5
4
|
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; }
|
|
@@ -8,13 +7,16 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
8
7
|
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); }
|
|
9
8
|
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; }
|
|
10
9
|
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; }
|
|
11
|
-
import
|
|
10
|
+
import { useRequestFields, useRequestFieldsConfig, useRexProConfigProvider, useStateData } from "../..";
|
|
12
11
|
import { useDebounceEffect } from 'ahooks';
|
|
12
|
+
import { ConfigProvider, Empty, Skeleton, Table } from 'antd';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
import {
|
|
15
|
-
import { useStateData, useRequestFields, useRequestFieldsConfig, useRexProConfigProvider } from "../..";
|
|
16
|
-
import { BaseTableRow } from "./components/BaseTableRow";
|
|
14
|
+
import { useMemo } from 'react';
|
|
17
15
|
import { DataCell } from "../data-cell/data-cell";
|
|
16
|
+
import { BaseTableRow } from "./components/BaseTableRow";
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
20
|
export var BaseTable = function BaseTable(_ref) {
|
|
19
21
|
var _ref$useDataCellRende = _ref.useDataCellRender,
|
|
20
22
|
useDataCellRender = _ref$useDataCellRende === void 0 ? true : _ref$useDataCellRende,
|
|
@@ -102,8 +104,8 @@ export var BaseTable = function BaseTable(_ref) {
|
|
|
102
104
|
var mergeItem = _objectSpread(_objectSpread({}, item), itemProps);
|
|
103
105
|
|
|
104
106
|
// 隐藏时候不显示
|
|
105
|
-
if (mergeItem.hidden) return;
|
|
106
|
-
if (operationPermission && !operationPermission(mergeItem.permissionKey)) return;
|
|
107
|
+
if (mergeItem.hidden) return undefined;
|
|
108
|
+
if (operationPermission && !operationPermission(mergeItem.permissionKey)) return undefined;
|
|
107
109
|
|
|
108
110
|
// 渲染列 +1
|
|
109
111
|
inlineColumnCount += 1;
|
|
@@ -113,7 +115,7 @@ export var BaseTable = function BaseTable(_ref) {
|
|
|
113
115
|
if (item.render) return item.render(value, record, index);
|
|
114
116
|
if (!state.useDataCellRender) return _typeof(value) === 'object' && value !== null ? JSON.stringify(value) : value;
|
|
115
117
|
try {
|
|
116
|
-
return Array.isArray(value) ? /*#__PURE__*/
|
|
118
|
+
return Array.isArray(value) ? /*#__PURE__*/_jsx(DataCell, {
|
|
117
119
|
items: value,
|
|
118
120
|
onClick: function onClick(cellItem, subItem) {
|
|
119
121
|
cellClick({
|
|
@@ -170,7 +172,7 @@ export var BaseTable = function BaseTable(_ref) {
|
|
|
170
172
|
columnCount = _useMemo.columnCount;
|
|
171
173
|
var beforeInlineColumn = [indexColumn && _objectSpread(_objectSpread({
|
|
172
174
|
title: formatMessage({
|
|
173
|
-
id: '
|
|
175
|
+
id: 'rex.components.base-table.column-serial-number-title',
|
|
174
176
|
defaultMessage: '序号'
|
|
175
177
|
}),
|
|
176
178
|
dataIndex: 'key-web-index',
|
|
@@ -219,61 +221,64 @@ export var BaseTable = function BaseTable(_ref) {
|
|
|
219
221
|
wait: 0
|
|
220
222
|
});
|
|
221
223
|
if (loading) {
|
|
222
|
-
return /*#__PURE__*/
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
225
|
+
children: [/*#__PURE__*/_jsx(Skeleton, {
|
|
226
|
+
active: true
|
|
227
|
+
}), /*#__PURE__*/_jsx(Skeleton, {
|
|
228
|
+
active: true
|
|
229
|
+
})]
|
|
230
|
+
});
|
|
227
231
|
}
|
|
228
|
-
return /*#__PURE__*/
|
|
232
|
+
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
229
233
|
renderEmpty: function renderEmpty(componentName) {
|
|
230
234
|
if (componentName === 'Table') {
|
|
231
|
-
return /*#__PURE__*/
|
|
235
|
+
return /*#__PURE__*/_jsx(Empty, {
|
|
232
236
|
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
233
237
|
description: customEmptyText
|
|
234
238
|
});
|
|
235
239
|
}
|
|
236
|
-
}
|
|
237
|
-
}, /*#__PURE__*/React.createElement(Table, _extends({
|
|
238
|
-
columns: [].concat(beforeInlineColumn || [], inlineColumns || [], (extraColumns || []).map(function (ii) {
|
|
239
|
-
return _objectSpread(_objectSpread({}, ii), generateClassNameWithWidth(ii));
|
|
240
|
-
})),
|
|
241
|
-
rowKey: "key"
|
|
242
|
-
}, otherProps, {
|
|
243
|
-
rootClassName: classNames(state.tableKey, rootClassName),
|
|
244
|
-
onRow: function onRow() {
|
|
245
|
-
return {
|
|
246
|
-
'data-column-count': columnCount,
|
|
247
|
-
'data-cell-click-event': cellClick,
|
|
248
|
-
'data-table-width': state.tableWidth
|
|
249
|
-
};
|
|
250
|
-
},
|
|
251
|
-
components: {
|
|
252
|
-
body: {
|
|
253
|
-
row: BaseTableRow
|
|
254
|
-
}
|
|
255
240
|
},
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
241
|
+
children: /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
|
|
242
|
+
columns: [].concat(beforeInlineColumn || [], inlineColumns || [], (extraColumns || []).map(function (ii) {
|
|
243
|
+
return _objectSpread(_objectSpread({}, ii), generateClassNameWithWidth(ii));
|
|
244
|
+
})),
|
|
245
|
+
rowKey: "key"
|
|
246
|
+
}, otherProps), {}, {
|
|
247
|
+
rootClassName: classNames(state.tableKey, rootClassName),
|
|
248
|
+
onRow: function onRow() {
|
|
249
|
+
return {
|
|
250
|
+
'data-column-count': columnCount,
|
|
251
|
+
'data-cell-click-event': cellClick,
|
|
252
|
+
'data-table-width': state.tableWidth
|
|
253
|
+
};
|
|
254
|
+
},
|
|
255
|
+
components: {
|
|
256
|
+
body: {
|
|
257
|
+
row: BaseTableRow
|
|
268
258
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
259
|
+
},
|
|
260
|
+
rowSelection: otherProps.rowSelection ? _objectSpread({
|
|
261
|
+
columnWidth: 50,
|
|
262
|
+
fixed: 'left',
|
|
263
|
+
// className: `custom-width::${otherProps.rowSelection.columnWidth ?? 50}`,
|
|
264
|
+
getCheckboxProps: function getCheckboxProps(record) {
|
|
265
|
+
if (record.is_checkbox === 2) {
|
|
266
|
+
return {
|
|
267
|
+
style: {
|
|
268
|
+
display: 'none'
|
|
269
|
+
},
|
|
270
|
+
disabled: true
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
return {};
|
|
274
|
+
}
|
|
275
|
+
}, otherProps.rowSelection) : undefined,
|
|
276
|
+
size: "small",
|
|
277
|
+
bordered: true,
|
|
278
|
+
tableLayout: "fixed",
|
|
279
|
+
scroll: typeof scroll === 'function' ? scroll(state.scrollHeight) : scroll
|
|
280
|
+
}))
|
|
281
|
+
});
|
|
277
282
|
};
|
|
278
283
|
|
|
279
284
|
/** 组件props */
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
var _excluded = ["data-cell-click-event", "data-column-count", "data-table-width"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
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); }
|
|
2
8
|
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; }
|
|
3
9
|
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; }
|
|
4
10
|
/* eslint-disable react/destructuring-assignment */
|
|
@@ -6,6 +12,9 @@ import classNames from "classnames";
|
|
|
6
12
|
import React from "react";
|
|
7
13
|
import { TableParentRow, TableParentRowCell } from "../style";
|
|
8
14
|
import { DataCell } from "../../data-cell/data-cell";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
18
|
export var BaseTableRow = function BaseTableRow(outProps) {
|
|
10
19
|
var cellClick = outProps['data-cell-click-event'],
|
|
11
20
|
columnCount = outProps['data-column-count'],
|
|
@@ -51,79 +60,83 @@ export var BaseTableRow = function BaseTableRow(outProps) {
|
|
|
51
60
|
var offsetWidth = 16 + 20;
|
|
52
61
|
// console.log(props);
|
|
53
62
|
|
|
54
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/_jsxs(TableParentRow, {
|
|
55
64
|
className: classNames("base-table-parent-row", props.className),
|
|
56
|
-
key: rowKey,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
style: {
|
|
62
|
-
width: width
|
|
63
|
-
}
|
|
64
|
-
}, Object.keys(record).map(function (key) {
|
|
65
|
-
return Array.isArray(record[key]) ? /*#__PURE__*/React.createElement(DataCell, {
|
|
66
|
-
key: key,
|
|
67
|
-
items: record[key],
|
|
68
|
-
onClick: function onClick(cellItem, subItem) {
|
|
69
|
-
// cellClick({dataIndex: 'parent'}, record, 0, cellItem, subItem);
|
|
70
|
-
cellClick({
|
|
71
|
-
dataIndex: 'parent',
|
|
72
|
-
record: record,
|
|
73
|
-
index: index,
|
|
74
|
-
cellItem: cellItem,
|
|
75
|
-
subItem: subItem
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}) : /*#__PURE__*/React.createElement("span", {
|
|
65
|
+
"data-row-key": rowKey,
|
|
66
|
+
children: [function () {
|
|
67
|
+
var content = function content(width) {
|
|
68
|
+
return /*#__PURE__*/_jsx("div", {
|
|
79
69
|
style: {
|
|
80
|
-
|
|
70
|
+
width: width
|
|
81
71
|
},
|
|
82
|
-
|
|
72
|
+
children: Object.keys(record).map(function (key) {
|
|
73
|
+
return Array.isArray(record[key]) ? /*#__PURE__*/_jsx(DataCell, {
|
|
74
|
+
items: record[key],
|
|
75
|
+
onClick: function onClick(cellItem, subItem) {
|
|
76
|
+
// cellClick({dataIndex: 'parent'}, record, 0, cellItem, subItem);
|
|
77
|
+
cellClick({
|
|
78
|
+
dataIndex: 'parent',
|
|
79
|
+
record: record,
|
|
80
|
+
index: index,
|
|
81
|
+
cellItem: cellItem,
|
|
82
|
+
subItem: subItem
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}, key) : /*#__PURE__*/_jsx("span", {
|
|
86
|
+
style: {
|
|
87
|
+
display: 'none'
|
|
88
|
+
}
|
|
89
|
+
}, key);
|
|
90
|
+
})
|
|
83
91
|
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
// console.log(tableWidth, leftWidth, rightWidth, offsetWidth);
|
|
92
|
+
};
|
|
93
|
+
try {
|
|
94
|
+
// console.log(hanBeforeColumns, rightArr);
|
|
95
|
+
// console.log(tableWidth, leftWidth, rightWidth, offsetWidth);
|
|
89
96
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
97
|
+
var dom1 = hanBeforeColumns.length ? hanBeforeColumns.map(function (ii) {
|
|
98
|
+
return /*#__PURE__*/React.cloneElement(ii);
|
|
99
|
+
}) : null;
|
|
100
|
+
var dom2 = /*#__PURE__*/_jsx(TableParentRowCell, {
|
|
101
|
+
className: "base-table-parent-row-td"
|
|
102
|
+
// colSpan={Math.max(+columnCount - (isRight ? 1 : 0), 0)}
|
|
103
|
+
,
|
|
104
|
+
style: {
|
|
105
|
+
left: hanBeforeColumns.length ? leftWidth : 0
|
|
106
|
+
},
|
|
107
|
+
children: content(tableWidth - leftWidth - (isRight ? rightWidth : 0) - offsetWidth)
|
|
108
|
+
});
|
|
109
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
110
|
+
children: [dom1, dom2]
|
|
111
|
+
});
|
|
112
|
+
} catch (error) {
|
|
113
|
+
var _props$rowSelection$c, _props$rowSelection;
|
|
114
|
+
console.error('BaseTableRow-TableParentRow error:', error);
|
|
115
|
+
/** 是否存在选择列 */
|
|
116
|
+
var hasSelectedColumn = leftArr[0] && leftArr[0].key.includes('key-');
|
|
117
|
+
var _dom = hasSelectedColumn ? /*#__PURE__*/React.cloneElement(leftArr[0]) : null;
|
|
118
|
+
var _dom2 = /*#__PURE__*/_jsx(TableParentRowCell, {
|
|
119
|
+
className: "base-table-parent-row-td"
|
|
120
|
+
// colSpan={Math.max(+columnCount - (isRight ? 1 : 0), 0)}
|
|
121
|
+
,
|
|
122
|
+
style: {
|
|
123
|
+
left: hasSelectedColumn ? (_props$rowSelection$c = (_props$rowSelection = props.rowSelection) === null || _props$rowSelection === void 0 ? void 0 : _props$rowSelection.columnWidth) !== null && _props$rowSelection$c !== void 0 ? _props$rowSelection$c : 50 : 0
|
|
124
|
+
},
|
|
125
|
+
children: content(tableWidth - leftWidth - (isRight ? rightWidth : 0) - offsetWidth)
|
|
126
|
+
});
|
|
127
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
128
|
+
children: [_dom, _dom2]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}(), new Array(Math.max(+columnCount - 1, 0)).fill('').map(function (_, i) {
|
|
132
|
+
return /*#__PURE__*/_jsx("td", {
|
|
133
|
+
"aria-hidden": "true"
|
|
134
|
+
}, i);
|
|
135
|
+
}), isRight ? /*#__PURE__*/React.cloneElement(rightArr[rightArr.length - 1]) : null]
|
|
136
|
+
}, rowKey);
|
|
124
137
|
}
|
|
125
138
|
} catch (e) {
|
|
126
139
|
console.error('BaseTableRow error:', e);
|
|
127
140
|
}
|
|
128
|
-
return /*#__PURE__*/
|
|
141
|
+
return /*#__PURE__*/_jsx("tr", _objectSpread({}, props));
|
|
129
142
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseTable } from "../base-table";
|
|
3
3
|
import { tableData } from "./tableData";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
6
|
export default (function () {
|
|
5
|
-
return /*#__PURE__*/
|
|
7
|
+
return /*#__PURE__*/_jsx(BaseTable, {
|
|
6
8
|
fieldsConfig: [{
|
|
7
9
|
"title": "beforeExtraColumns",
|
|
8
10
|
"dataIndex": "beforeExtraColumns",
|
|
@@ -50,7 +52,9 @@ export default (function () {
|
|
|
50
52
|
width: 200,
|
|
51
53
|
fixed: 'right',
|
|
52
54
|
render: function render() {
|
|
53
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
56
|
+
children: "123"
|
|
57
|
+
});
|
|
54
58
|
}
|
|
55
59
|
}],
|
|
56
60
|
scroll: function scroll(height) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseTable } from "../base-table";
|
|
3
3
|
import { tableData } from "./tableData";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
export default (function () {
|
|
5
|
-
return /*#__PURE__*/
|
|
6
|
+
return /*#__PURE__*/_jsx(BaseTable, {
|
|
6
7
|
fieldsConfig: [{
|
|
7
8
|
"title": "编号/状态",
|
|
8
9
|
"dataIndex": "status_name",
|
|
@@ -40,7 +41,9 @@ export default (function () {
|
|
|
40
41
|
fixed: 'right',
|
|
41
42
|
width: 100,
|
|
42
43
|
render: function render() {
|
|
43
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/_jsx("div", {
|
|
45
|
+
children: "12312"
|
|
46
|
+
});
|
|
44
47
|
}
|
|
45
48
|
}],
|
|
46
49
|
scroll: function scroll(height) {
|
|
@@ -1,57 +1,55 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createIntl } from "react-intl";
|
|
3
|
-
import { crush } from "radash";
|
|
4
1
|
import { RexProConfigProvider } from "../../..";
|
|
5
2
|
import { BaseTable } from "../base-table";
|
|
6
|
-
import { designDataDisplayEnUS } from "../../../utils/locales";
|
|
7
3
|
import { tableData } from "./tableData";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
5
|
export default (function () {
|
|
9
|
-
return /*#__PURE__*/
|
|
6
|
+
return /*#__PURE__*/_jsx(RexProConfigProvider, {
|
|
10
7
|
value: {
|
|
11
|
-
intl: createIntl({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
}, /*#__PURE__*/React.createElement(BaseTable, {
|
|
18
|
-
fieldsConfig: [{
|
|
19
|
-
"title": "编号/状态",
|
|
20
|
-
"dataIndex": "status_name",
|
|
21
|
-
"key": "status_name"
|
|
22
|
-
}, {
|
|
23
|
-
"title": "SPU/组合SKU",
|
|
24
|
-
"dataIndex": "goods_spu_info",
|
|
25
|
-
"key": "goods_spu_info"
|
|
26
|
-
}, {
|
|
27
|
-
"title": "图片",
|
|
28
|
-
"dataIndex": "goods_image",
|
|
29
|
-
"key": "goods_image",
|
|
30
|
-
"align": 'center'
|
|
31
|
-
}, {
|
|
32
|
-
"title": "SKU/属性",
|
|
33
|
-
"dataIndex": "goods_sku_info",
|
|
34
|
-
"key": "goods_sku_info"
|
|
35
|
-
}, {
|
|
36
|
-
"title": "计划员",
|
|
37
|
-
"dataIndex": "planuser",
|
|
38
|
-
"key": "planuser"
|
|
39
|
-
}, {
|
|
40
|
-
"title": "供应商",
|
|
41
|
-
"dataIndex": "factory",
|
|
42
|
-
"key": "factory"
|
|
43
|
-
}, {
|
|
44
|
-
"title": "ASIN",
|
|
45
|
-
"dataIndex": "asin",
|
|
46
|
-
"key": "asin"
|
|
47
|
-
}],
|
|
48
|
-
scroll: function scroll(height) {
|
|
49
|
-
return {
|
|
50
|
-
y: height
|
|
51
|
-
};
|
|
8
|
+
// intl: createIntl({
|
|
9
|
+
// locale: 'en-US',
|
|
10
|
+
// messages: crush(designDataDisplayEnUS) as Record<string, string>,
|
|
11
|
+
// onError: () => {},
|
|
12
|
+
// }),
|
|
52
13
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
14
|
+
children: /*#__PURE__*/_jsx(BaseTable, {
|
|
15
|
+
fieldsConfig: [{
|
|
16
|
+
title: '编号/状态',
|
|
17
|
+
dataIndex: 'status_name',
|
|
18
|
+
key: 'status_name'
|
|
19
|
+
}, {
|
|
20
|
+
title: 'SPU/组合SKU',
|
|
21
|
+
dataIndex: 'goods_spu_info',
|
|
22
|
+
key: 'goods_spu_info'
|
|
23
|
+
}, {
|
|
24
|
+
title: '图片',
|
|
25
|
+
dataIndex: 'goods_image',
|
|
26
|
+
key: 'goods_image',
|
|
27
|
+
align: 'center'
|
|
28
|
+
}, {
|
|
29
|
+
title: 'SKU/属性',
|
|
30
|
+
dataIndex: 'goods_sku_info',
|
|
31
|
+
key: 'goods_sku_info'
|
|
32
|
+
}, {
|
|
33
|
+
title: '计划员',
|
|
34
|
+
dataIndex: 'planuser',
|
|
35
|
+
key: 'planuser'
|
|
36
|
+
}, {
|
|
37
|
+
title: '供应商',
|
|
38
|
+
dataIndex: 'factory',
|
|
39
|
+
key: 'factory'
|
|
40
|
+
}, {
|
|
41
|
+
title: 'ASIN',
|
|
42
|
+
dataIndex: 'asin',
|
|
43
|
+
key: 'asin'
|
|
44
|
+
}],
|
|
45
|
+
scroll: function scroll(height) {
|
|
46
|
+
return {
|
|
47
|
+
y: height
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
dataSource: tableData.items,
|
|
51
|
+
pagination: false,
|
|
52
|
+
indexColumn: {}
|
|
53
|
+
})
|
|
54
|
+
});
|
|
57
55
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseTable } from "../base-table";
|
|
3
3
|
import { tableData } from "./tableData";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
export default (function () {
|
|
5
|
-
return /*#__PURE__*/
|
|
6
|
+
return /*#__PURE__*/_jsx(BaseTable, {
|
|
6
7
|
fieldsConfig: [{
|
|
7
8
|
"title": "编号/状态",
|
|
8
9
|
"dataIndex": "status_name",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { cellItemMap } from "./modules/cellItemMap";
|
|
3
3
|
import { Wrapper } from "./style";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
export var DataCell = function DataCell(_ref) {
|
|
5
6
|
var items = _ref.items,
|
|
6
7
|
onClick = _ref.onClick;
|
|
@@ -8,10 +9,10 @@ export var DataCell = function DataCell(_ref) {
|
|
|
8
9
|
// return arr.map((node, index) => <div key={index} className={`data-cell-row-item ${ii.type}`}>{node}</div>);
|
|
9
10
|
return items.map(function (item, index) {
|
|
10
11
|
var _cellItemMap$item$typ;
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
key: index,
|
|
12
|
+
return /*#__PURE__*/_jsx(Wrapper, {
|
|
13
13
|
style: item.rootStyle,
|
|
14
|
-
className: "data-cell-row-item ".concat(item.type)
|
|
15
|
-
|
|
14
|
+
className: "data-cell-row-item ".concat(item.type),
|
|
15
|
+
children: (_cellItemMap$item$typ = cellItemMap[item.type]) === null || _cellItemMap$item$typ === void 0 ? void 0 : _cellItemMap$item$typ.call(cellItemMap, item, onClick)
|
|
16
|
+
}, index);
|
|
16
17
|
});
|
|
17
18
|
};
|