@akinon/akitable 1.3.5 → 1.3.6
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/dist/cjs/akitable.css +4 -0
- package/dist/cjs/akitable.d.ts.map +1 -1
- package/dist/cjs/akitable.js +2 -2
- package/dist/cjs/components/datatable.d.ts.map +1 -1
- package/dist/cjs/components/datatable.js +2 -2
- package/dist/cjs/components/header.css +10 -0
- package/dist/cjs/components/header.d.ts.map +1 -1
- package/dist/cjs/components/header.js +17 -4
- package/dist/cjs/types.d.ts +92 -1
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/akitable.css +4 -0
- package/dist/esm/akitable.d.ts.map +1 -1
- package/dist/esm/akitable.js +2 -2
- package/dist/esm/components/datatable.d.ts.map +1 -1
- package/dist/esm/components/datatable.js +2 -2
- package/dist/esm/components/header.css +10 -0
- package/dist/esm/components/header.d.ts.map +1 -1
- package/dist/esm/components/header.js +17 -4
- package/dist/esm/types.d.ts +92 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/package.json +21 -21
package/dist/cjs/akitable.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"akitable.d.ts","sourceRoot":"","sources":["../../src/akitable.tsx"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAGV,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,
|
|
1
|
+
{"version":3,"file":"akitable.d.ts","sourceRoot":"","sources":["../../src/akitable.tsx"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAGV,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,sBA4E5C,CAAC"}
|
package/dist/cjs/akitable.js
CHANGED
|
@@ -24,7 +24,7 @@ const header_1 = require("./components/header");
|
|
|
24
24
|
* needs in enterprise applications.
|
|
25
25
|
*/
|
|
26
26
|
const Akitable = (props) => {
|
|
27
|
-
const { actions, columns, data, footer, header, isLoading, maxColumnContent, pagination, rowKey, emptyState, onPaginationChanged, onRowClick, onRowEdit, onChangeSorter } = props;
|
|
27
|
+
const { actions, columns, data, expandable, footer, header, isLoading, maxColumnContent, pagination, rowKey, emptyState, onPaginationChanged, onRowClick, onRowEdit, onChangeSorter } = props;
|
|
28
28
|
// If there is a pagination object, table data should be accessed from type AkitablePaginatedData.
|
|
29
29
|
// If not, table data should be accessed from type AkitableData.
|
|
30
30
|
const handleGetParsedData = () => {
|
|
@@ -45,7 +45,7 @@ const Akitable = (props) => {
|
|
|
45
45
|
react_1.default.createElement(akitable_context_1.AkitableProvider, { actions: actions, isLoading: isLoading, pagination: Object.assign(Object.assign({}, pagination), { total, hasPagination: !!pagination }), onPaginationChanged: onPaginationChanged },
|
|
46
46
|
react_1.default.createElement(antd_1.ConfigProvider, { theme: theme_overrides_1.themeOverrides },
|
|
47
47
|
react_1.default.createElement(header_1.AkitableHeader, Object.assign({}, header)),
|
|
48
|
-
react_1.default.createElement(datatable_1.AkitableDataTable, { columns: columns, data: parsedData, rowKey: rowKey, maxColumnContent: maxColumnContent, emptyState: emptyState, onRowClick: onRowClick, onRowEdit: onRowEdit, onChangeSorter: onChangeSorter }),
|
|
48
|
+
react_1.default.createElement(datatable_1.AkitableDataTable, { columns: columns, data: parsedData, expandable: expandable, rowKey: rowKey, maxColumnContent: maxColumnContent, emptyState: emptyState, onRowClick: onRowClick, onRowEdit: onRowEdit, onChangeSorter: onChangeSorter }),
|
|
49
49
|
react_1.default.createElement(footer_1.AkitableFooter, Object.assign({}, footer)))))));
|
|
50
50
|
};
|
|
51
51
|
exports.Akitable = Akitable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datatable.d.ts","sourceRoot":"","sources":["../../../src/components/datatable.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AAQzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAGL,sBAAsB,EAIvB,MAAM,UAAU,CAAC;AAIlB,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,
|
|
1
|
+
{"version":3,"file":"datatable.d.ts","sourceRoot":"","sources":["../../../src/components/datatable.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AAQzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAGL,sBAAsB,EAIvB,MAAM,UAAU,CAAC;AAIlB,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,sBA6M9D,CAAC"}
|
|
@@ -16,7 +16,7 @@ const EditableCell_1 = require("./EditableCell");
|
|
|
16
16
|
const { t } = i18n_1.i18n;
|
|
17
17
|
const AkitableDataTable = (props) => {
|
|
18
18
|
const { isLoading, selectedRowKeys, setSelectedRowKeys, actions } = (0, akitable_context_1.useAkitableContext)();
|
|
19
|
-
const { columns, data, rowKey, maxColumnContent = true, onRowClick, onRowEdit, emptyState, onChangeSorter } = props;
|
|
19
|
+
const { columns, data, expandable, rowKey, maxColumnContent = true, onRowClick, onRowEdit, emptyState, onChangeSorter } = props;
|
|
20
20
|
const [form] = akiform_1.Akiform.useForm();
|
|
21
21
|
const [localColumns, setLocalColumns] = react_1.default.useState(columns);
|
|
22
22
|
const [editingKey, setEditingKey] = react_1.default.useState(null);
|
|
@@ -121,6 +121,6 @@ const AkitableDataTable = (props) => {
|
|
|
121
121
|
'is-selectable': !!onRowClick && !checkIsEditingRow(getRowKeyData(record)),
|
|
122
122
|
'akitable-row-pending': record.rowStatus === types_1.AkitableRowStatus.PENDING,
|
|
123
123
|
'akitable-row-error': record.rowStatus === types_1.AkitableRowStatus.ERROR
|
|
124
|
-
}), rowSelection: hasActions ? rowSelection : undefined, onChange: (_, __, sorter) => handleOnChangeSorter(sorter) }))));
|
|
124
|
+
}), rowSelection: hasActions ? rowSelection : undefined, onChange: (_, __, sorter) => handleOnChangeSorter(sorter), expandable: expandable }))));
|
|
125
125
|
};
|
|
126
126
|
exports.AkitableDataTable = AkitableDataTable;
|
|
@@ -128,3 +128,13 @@
|
|
|
128
128
|
.akitable-header-downloads .akinon-btn-icon {
|
|
129
129
|
font-size: 0.762rem;
|
|
130
130
|
}
|
|
131
|
+
|
|
132
|
+
.akitable-header-trailing-extra {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
margin-left: 1.25rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.akitable-header-side--single-row .akitable-header-trailing-extra {
|
|
139
|
+
margin-left: calc(1.25rem - 0.75rem);
|
|
140
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/components/header.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAKtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD,eAAO,MAAM,cAAc,GAAI,QAAO,mBAAwB,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/components/header.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAKtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD,eAAO,MAAM,cAAc,GAAI,QAAO,mBAAwB,6BA8L7D,CAAC"}
|
|
@@ -13,12 +13,13 @@ const pagination_1 = require("./pagination");
|
|
|
13
13
|
const DEFAULT_DOWNLOAD_SLOT_WIDTH = 120;
|
|
14
14
|
const AkitableHeader = (props = {}) => {
|
|
15
15
|
const { isLoading, pagination, actions } = (0, akitable_context_1.useAkitableContext)();
|
|
16
|
-
const { title, extra, downloadActions, downloadActionsSlotWidth = DEFAULT_DOWNLOAD_SLOT_WIDTH, reserveDownloadActionsSpace = true } = props;
|
|
16
|
+
const { title, extra, downloadActions, downloadActionsSlotWidth = DEFAULT_DOWNLOAD_SLOT_WIDTH, reserveDownloadActionsSpace = true, trailingExtra } = props;
|
|
17
17
|
const hasActions = Boolean(actions && actions.length > 0);
|
|
18
18
|
const hasPagination = Boolean(pagination === null || pagination === void 0 ? void 0 : pagination.hasPagination);
|
|
19
19
|
const shouldRenderHeader = Boolean(title) ||
|
|
20
20
|
Boolean(extra) ||
|
|
21
21
|
Boolean(downloadActions) ||
|
|
22
|
+
Boolean(trailingExtra) ||
|
|
22
23
|
hasActions ||
|
|
23
24
|
hasPagination;
|
|
24
25
|
if (!shouldRenderHeader)
|
|
@@ -55,9 +56,15 @@ const AkitableHeader = (props = {}) => {
|
|
|
55
56
|
return (react_1.default.createElement("div", { "data-testid": "akitable-header-pagination" },
|
|
56
57
|
react_1.default.createElement(pagination_1.AkitablePagination, null)));
|
|
57
58
|
};
|
|
59
|
+
const renderTrailingExtra = () => {
|
|
60
|
+
if (!trailingExtra)
|
|
61
|
+
return null;
|
|
62
|
+
return (react_1.default.createElement("div", { "data-testid": "akitable-header-trailing-extra", className: "akitable-header-trailing-extra" }, trailingExtra));
|
|
63
|
+
};
|
|
58
64
|
const extraContent = renderExtraContent();
|
|
59
65
|
const downloadContent = renderDownloadActions();
|
|
60
66
|
const paginationContent = renderPagination();
|
|
67
|
+
const trailingExtraContent = renderTrailingExtra();
|
|
61
68
|
return (react_1.default.createElement("div", { "data-testid": "akitable-header", className: (0, clsx_1.default)('akitable-header', {
|
|
62
69
|
'akitable-header--with-actions': hasActions
|
|
63
70
|
}) },
|
|
@@ -68,16 +75,22 @@ const AkitableHeader = (props = {}) => {
|
|
|
68
75
|
react_1.default.createElement(ui_skeleton_1.Skeleton.Input, { active: true, size: "small", className: "akitable-header-title-description-skeleton" }))) : (renderTitleDescription()))),
|
|
69
76
|
hasActions && (react_1.default.createElement("div", { className: "akitable-header-actions" },
|
|
70
77
|
react_1.default.createElement(actions_1.AkitableActions, null)))),
|
|
71
|
-
(extraContent ||
|
|
78
|
+
(extraContent ||
|
|
79
|
+
downloadContent ||
|
|
80
|
+
paginationContent ||
|
|
81
|
+
trailingExtraContent) && (react_1.default.createElement("div", { className: (0, clsx_1.default)('akitable-header-side', {
|
|
72
82
|
'akitable-header-side--single-row': !hasActions,
|
|
73
83
|
'akitable-header-side--with-actions': hasActions
|
|
74
84
|
}) }, hasActions ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
75
85
|
(extraContent || downloadContent) && (react_1.default.createElement("div", { className: "akitable-header-side-top" },
|
|
76
86
|
extraContent,
|
|
77
87
|
downloadContent)),
|
|
78
|
-
paginationContent && (react_1.default.createElement("div", { className: "akitable-header-side-bottom" },
|
|
88
|
+
(paginationContent || trailingExtraContent) && (react_1.default.createElement("div", { className: "akitable-header-side-bottom" },
|
|
89
|
+
paginationContent,
|
|
90
|
+
trailingExtraContent)))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
79
91
|
extraContent,
|
|
80
92
|
downloadContent,
|
|
81
|
-
paginationContent
|
|
93
|
+
paginationContent,
|
|
94
|
+
trailingExtraContent))))));
|
|
82
95
|
};
|
|
83
96
|
exports.AkitableHeader = AkitableHeader;
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableColumnType } from 'antd';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
3
|
export type AnyObject = Record<PropertyKey, any>;
|
|
4
4
|
export type SortOrder = 'descend' | 'ascend' | null;
|
|
5
5
|
export interface SorterResult {
|
|
@@ -70,6 +70,10 @@ export interface AkitableProps {
|
|
|
70
70
|
* Custom empty state configuration for the table.
|
|
71
71
|
*/
|
|
72
72
|
emptyState?: AkitableEmptyStateProps;
|
|
73
|
+
/**
|
|
74
|
+
* Configuration for expandable rows.
|
|
75
|
+
*/
|
|
76
|
+
expandable?: AkitableExpandableConfig;
|
|
73
77
|
}
|
|
74
78
|
export interface AkitableHeaderProps {
|
|
75
79
|
/**
|
|
@@ -93,6 +97,10 @@ export interface AkitableHeaderProps {
|
|
|
93
97
|
* This only applies when there is no bulk action (Akitable actions) being displayed.
|
|
94
98
|
*/
|
|
95
99
|
reserveDownloadActionsSpace?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Additional content rendered at the far right of the header, after pagination.
|
|
102
|
+
*/
|
|
103
|
+
trailingExtra?: ReactNode;
|
|
96
104
|
}
|
|
97
105
|
export interface AkitableFooterProps {
|
|
98
106
|
/**
|
|
@@ -133,6 +141,10 @@ export interface AkitableDataTableProps {
|
|
|
133
141
|
* Custom empty state configuration for the table.
|
|
134
142
|
*/
|
|
135
143
|
emptyState?: AkitableEmptyStateProps;
|
|
144
|
+
/**
|
|
145
|
+
* Configuration for expandable rows.
|
|
146
|
+
*/
|
|
147
|
+
expandable?: AkitableExpandableConfig;
|
|
136
148
|
}
|
|
137
149
|
export interface AkitableEmptyStateProps {
|
|
138
150
|
/**
|
|
@@ -198,6 +210,85 @@ export interface AkitablePaginatedData {
|
|
|
198
210
|
*/
|
|
199
211
|
results: AkitableData[];
|
|
200
212
|
}
|
|
213
|
+
export interface AkitableExpandIconProps {
|
|
214
|
+
prefixCls: string;
|
|
215
|
+
expanded: boolean;
|
|
216
|
+
record: AkitableData;
|
|
217
|
+
expandable: boolean;
|
|
218
|
+
onExpand: (record: AkitableData, e: React.MouseEvent<HTMLElement>) => void;
|
|
219
|
+
}
|
|
220
|
+
export interface AkitableExpandableConfig {
|
|
221
|
+
/**
|
|
222
|
+
* The column contains children to display.
|
|
223
|
+
* @default 'children'
|
|
224
|
+
*/
|
|
225
|
+
childrenColumnName?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Set the title of the expand column.
|
|
228
|
+
*/
|
|
229
|
+
columnTitle?: React.ReactNode;
|
|
230
|
+
/**
|
|
231
|
+
* Set the width of the expand column.
|
|
232
|
+
*/
|
|
233
|
+
columnWidth?: string | number;
|
|
234
|
+
/**
|
|
235
|
+
* Expand all rows initially.
|
|
236
|
+
* @default false
|
|
237
|
+
*/
|
|
238
|
+
defaultExpandAllRows?: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Initial expanded row keys.
|
|
241
|
+
*/
|
|
242
|
+
defaultExpandedRowKeys?: string[] | number[];
|
|
243
|
+
/**
|
|
244
|
+
* Expanded row's className.
|
|
245
|
+
*/
|
|
246
|
+
expandedRowClassName?: string | ((record: AkitableData, index: number, indent: number) => string);
|
|
247
|
+
/**
|
|
248
|
+
* Current expanded row keys.
|
|
249
|
+
*/
|
|
250
|
+
expandedRowKeys?: string[] | number[];
|
|
251
|
+
/**
|
|
252
|
+
* Expanded container render for each row.
|
|
253
|
+
*/
|
|
254
|
+
expandedRowRender?: (record: AkitableData, index: number, indent: number, expanded: boolean) => React.ReactNode;
|
|
255
|
+
/**
|
|
256
|
+
* Customize row expand Icon. Ref example.
|
|
257
|
+
*/
|
|
258
|
+
expandIcon?: (props: AkitableExpandIconProps) => React.ReactNode;
|
|
259
|
+
/**
|
|
260
|
+
* Whether to expand row by clicking anywhere in the whole row.
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
expandRowByClick?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Whether the expansion icon is fixed. Optional true left right.
|
|
266
|
+
* @default false
|
|
267
|
+
*/
|
|
268
|
+
fixed?: boolean | 'left' | 'right';
|
|
269
|
+
/**
|
|
270
|
+
* Indent size in pixels of tree data.
|
|
271
|
+
* @default 15
|
|
272
|
+
*/
|
|
273
|
+
indentSize?: number;
|
|
274
|
+
/**
|
|
275
|
+
* Enable row can be expandable.
|
|
276
|
+
*/
|
|
277
|
+
rowExpandable?: (record: AkitableData) => boolean;
|
|
278
|
+
/**
|
|
279
|
+
* Show expand column.
|
|
280
|
+
* @default true
|
|
281
|
+
*/
|
|
282
|
+
showExpandColumn?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* Callback executed when the row expand icon is clicked.
|
|
285
|
+
*/
|
|
286
|
+
onExpand?: (expanded: boolean, record: AkitableData) => void;
|
|
287
|
+
/**
|
|
288
|
+
* Callback executed when the expanded rows change.
|
|
289
|
+
*/
|
|
290
|
+
onExpandedRowsChange?: (expandedRows: readonly React.Key[]) => void;
|
|
291
|
+
}
|
|
201
292
|
export interface AkitableAction {
|
|
202
293
|
/**
|
|
203
294
|
* Label for the action.
|
package/dist/cjs/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAEjD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,aAAa,GAAG,CACnB,MAAM,EAAE,YAAY,EACpB,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM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,"file":"akitable.d.ts","sourceRoot":"","sources":["../../src/akitable.tsx"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAGV,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,
|
|
1
|
+
{"version":3,"file":"akitable.d.ts","sourceRoot":"","sources":["../../src/akitable.tsx"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAGV,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,sBA4E5C,CAAC"}
|
package/dist/esm/akitable.js
CHANGED
|
@@ -21,7 +21,7 @@ import { AkitableHeader } from './components/header';
|
|
|
21
21
|
* needs in enterprise applications.
|
|
22
22
|
*/
|
|
23
23
|
export const Akitable = (props) => {
|
|
24
|
-
const { actions, columns, data, footer, header, isLoading, maxColumnContent, pagination, rowKey, emptyState, onPaginationChanged, onRowClick, onRowEdit, onChangeSorter } = props;
|
|
24
|
+
const { actions, columns, data, expandable, footer, header, isLoading, maxColumnContent, pagination, rowKey, emptyState, onPaginationChanged, onRowClick, onRowEdit, onChangeSorter } = props;
|
|
25
25
|
// If there is a pagination object, table data should be accessed from type AkitablePaginatedData.
|
|
26
26
|
// If not, table data should be accessed from type AkitableData.
|
|
27
27
|
const handleGetParsedData = () => {
|
|
@@ -42,6 +42,6 @@ export const Akitable = (props) => {
|
|
|
42
42
|
React.createElement(AkitableProvider, { actions: actions, isLoading: isLoading, pagination: Object.assign(Object.assign({}, pagination), { total, hasPagination: !!pagination }), onPaginationChanged: onPaginationChanged },
|
|
43
43
|
React.createElement(ConfigProvider, { theme: themeOverrides },
|
|
44
44
|
React.createElement(AkitableHeader, Object.assign({}, header)),
|
|
45
|
-
React.createElement(AkitableDataTable, { columns: columns, data: parsedData, rowKey: rowKey, maxColumnContent: maxColumnContent, emptyState: emptyState, onRowClick: onRowClick, onRowEdit: onRowEdit, onChangeSorter: onChangeSorter }),
|
|
45
|
+
React.createElement(AkitableDataTable, { columns: columns, data: parsedData, expandable: expandable, rowKey: rowKey, maxColumnContent: maxColumnContent, emptyState: emptyState, onRowClick: onRowClick, onRowEdit: onRowEdit, onChangeSorter: onChangeSorter }),
|
|
46
46
|
React.createElement(AkitableFooter, Object.assign({}, footer)))))));
|
|
47
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datatable.d.ts","sourceRoot":"","sources":["../../../src/components/datatable.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AAQzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAGL,sBAAsB,EAIvB,MAAM,UAAU,CAAC;AAIlB,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,
|
|
1
|
+
{"version":3,"file":"datatable.d.ts","sourceRoot":"","sources":["../../../src/components/datatable.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AAQzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAGL,sBAAsB,EAIvB,MAAM,UAAU,CAAC;AAIlB,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,sBA6M9D,CAAC"}
|
|
@@ -13,7 +13,7 @@ import EditableCell from './EditableCell';
|
|
|
13
13
|
const { t } = i18n;
|
|
14
14
|
export const AkitableDataTable = (props) => {
|
|
15
15
|
const { isLoading, selectedRowKeys, setSelectedRowKeys, actions } = useAkitableContext();
|
|
16
|
-
const { columns, data, rowKey, maxColumnContent = true, onRowClick, onRowEdit, emptyState, onChangeSorter } = props;
|
|
16
|
+
const { columns, data, expandable, rowKey, maxColumnContent = true, onRowClick, onRowEdit, emptyState, onChangeSorter } = props;
|
|
17
17
|
const [form] = Akiform.useForm();
|
|
18
18
|
const [localColumns, setLocalColumns] = React.useState(columns);
|
|
19
19
|
const [editingKey, setEditingKey] = React.useState(null);
|
|
@@ -118,5 +118,5 @@ export const AkitableDataTable = (props) => {
|
|
|
118
118
|
'is-selectable': !!onRowClick && !checkIsEditingRow(getRowKeyData(record)),
|
|
119
119
|
'akitable-row-pending': record.rowStatus === AkitableRowStatus.PENDING,
|
|
120
120
|
'akitable-row-error': record.rowStatus === AkitableRowStatus.ERROR
|
|
121
|
-
}), rowSelection: hasActions ? rowSelection : undefined, onChange: (_, __, sorter) => handleOnChangeSorter(sorter) }))));
|
|
121
|
+
}), rowSelection: hasActions ? rowSelection : undefined, onChange: (_, __, sorter) => handleOnChangeSorter(sorter), expandable: expandable }))));
|
|
122
122
|
};
|
|
@@ -128,3 +128,13 @@
|
|
|
128
128
|
.akitable-header-downloads .akinon-btn-icon {
|
|
129
129
|
font-size: 0.762rem;
|
|
130
130
|
}
|
|
131
|
+
|
|
132
|
+
.akitable-header-trailing-extra {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
margin-left: 1.25rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.akitable-header-side--single-row .akitable-header-trailing-extra {
|
|
139
|
+
margin-left: calc(1.25rem - 0.75rem);
|
|
140
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/components/header.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAKtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD,eAAO,MAAM,cAAc,GAAI,QAAO,mBAAwB,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/components/header.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAKtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAMpD,eAAO,MAAM,cAAc,GAAI,QAAO,mBAAwB,6BA8L7D,CAAC"}
|
|
@@ -10,12 +10,13 @@ import { AkitablePagination } from './pagination';
|
|
|
10
10
|
const DEFAULT_DOWNLOAD_SLOT_WIDTH = 120;
|
|
11
11
|
export const AkitableHeader = (props = {}) => {
|
|
12
12
|
const { isLoading, pagination, actions } = useAkitableContext();
|
|
13
|
-
const { title, extra, downloadActions, downloadActionsSlotWidth = DEFAULT_DOWNLOAD_SLOT_WIDTH, reserveDownloadActionsSpace = true } = props;
|
|
13
|
+
const { title, extra, downloadActions, downloadActionsSlotWidth = DEFAULT_DOWNLOAD_SLOT_WIDTH, reserveDownloadActionsSpace = true, trailingExtra } = props;
|
|
14
14
|
const hasActions = Boolean(actions && actions.length > 0);
|
|
15
15
|
const hasPagination = Boolean(pagination === null || pagination === void 0 ? void 0 : pagination.hasPagination);
|
|
16
16
|
const shouldRenderHeader = Boolean(title) ||
|
|
17
17
|
Boolean(extra) ||
|
|
18
18
|
Boolean(downloadActions) ||
|
|
19
|
+
Boolean(trailingExtra) ||
|
|
19
20
|
hasActions ||
|
|
20
21
|
hasPagination;
|
|
21
22
|
if (!shouldRenderHeader)
|
|
@@ -52,9 +53,15 @@ export const AkitableHeader = (props = {}) => {
|
|
|
52
53
|
return (React.createElement("div", { "data-testid": "akitable-header-pagination" },
|
|
53
54
|
React.createElement(AkitablePagination, null)));
|
|
54
55
|
};
|
|
56
|
+
const renderTrailingExtra = () => {
|
|
57
|
+
if (!trailingExtra)
|
|
58
|
+
return null;
|
|
59
|
+
return (React.createElement("div", { "data-testid": "akitable-header-trailing-extra", className: "akitable-header-trailing-extra" }, trailingExtra));
|
|
60
|
+
};
|
|
55
61
|
const extraContent = renderExtraContent();
|
|
56
62
|
const downloadContent = renderDownloadActions();
|
|
57
63
|
const paginationContent = renderPagination();
|
|
64
|
+
const trailingExtraContent = renderTrailingExtra();
|
|
58
65
|
return (React.createElement("div", { "data-testid": "akitable-header", className: clsx('akitable-header', {
|
|
59
66
|
'akitable-header--with-actions': hasActions
|
|
60
67
|
}) },
|
|
@@ -65,15 +72,21 @@ export const AkitableHeader = (props = {}) => {
|
|
|
65
72
|
React.createElement(Skeleton.Input, { active: true, size: "small", className: "akitable-header-title-description-skeleton" }))) : (renderTitleDescription()))),
|
|
66
73
|
hasActions && (React.createElement("div", { className: "akitable-header-actions" },
|
|
67
74
|
React.createElement(AkitableActions, null)))),
|
|
68
|
-
(extraContent ||
|
|
75
|
+
(extraContent ||
|
|
76
|
+
downloadContent ||
|
|
77
|
+
paginationContent ||
|
|
78
|
+
trailingExtraContent) && (React.createElement("div", { className: clsx('akitable-header-side', {
|
|
69
79
|
'akitable-header-side--single-row': !hasActions,
|
|
70
80
|
'akitable-header-side--with-actions': hasActions
|
|
71
81
|
}) }, hasActions ? (React.createElement(React.Fragment, null,
|
|
72
82
|
(extraContent || downloadContent) && (React.createElement("div", { className: "akitable-header-side-top" },
|
|
73
83
|
extraContent,
|
|
74
84
|
downloadContent)),
|
|
75
|
-
paginationContent && (React.createElement("div", { className: "akitable-header-side-bottom" },
|
|
85
|
+
(paginationContent || trailingExtraContent) && (React.createElement("div", { className: "akitable-header-side-bottom" },
|
|
86
|
+
paginationContent,
|
|
87
|
+
trailingExtraContent)))) : (React.createElement(React.Fragment, null,
|
|
76
88
|
extraContent,
|
|
77
89
|
downloadContent,
|
|
78
|
-
paginationContent
|
|
90
|
+
paginationContent,
|
|
91
|
+
trailingExtraContent))))));
|
|
79
92
|
};
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableColumnType } from 'antd';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
3
|
export type AnyObject = Record<PropertyKey, any>;
|
|
4
4
|
export type SortOrder = 'descend' | 'ascend' | null;
|
|
5
5
|
export interface SorterResult {
|
|
@@ -70,6 +70,10 @@ export interface AkitableProps {
|
|
|
70
70
|
* Custom empty state configuration for the table.
|
|
71
71
|
*/
|
|
72
72
|
emptyState?: AkitableEmptyStateProps;
|
|
73
|
+
/**
|
|
74
|
+
* Configuration for expandable rows.
|
|
75
|
+
*/
|
|
76
|
+
expandable?: AkitableExpandableConfig;
|
|
73
77
|
}
|
|
74
78
|
export interface AkitableHeaderProps {
|
|
75
79
|
/**
|
|
@@ -93,6 +97,10 @@ export interface AkitableHeaderProps {
|
|
|
93
97
|
* This only applies when there is no bulk action (Akitable actions) being displayed.
|
|
94
98
|
*/
|
|
95
99
|
reserveDownloadActionsSpace?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Additional content rendered at the far right of the header, after pagination.
|
|
102
|
+
*/
|
|
103
|
+
trailingExtra?: ReactNode;
|
|
96
104
|
}
|
|
97
105
|
export interface AkitableFooterProps {
|
|
98
106
|
/**
|
|
@@ -133,6 +141,10 @@ export interface AkitableDataTableProps {
|
|
|
133
141
|
* Custom empty state configuration for the table.
|
|
134
142
|
*/
|
|
135
143
|
emptyState?: AkitableEmptyStateProps;
|
|
144
|
+
/**
|
|
145
|
+
* Configuration for expandable rows.
|
|
146
|
+
*/
|
|
147
|
+
expandable?: AkitableExpandableConfig;
|
|
136
148
|
}
|
|
137
149
|
export interface AkitableEmptyStateProps {
|
|
138
150
|
/**
|
|
@@ -198,6 +210,85 @@ export interface AkitablePaginatedData {
|
|
|
198
210
|
*/
|
|
199
211
|
results: AkitableData[];
|
|
200
212
|
}
|
|
213
|
+
export interface AkitableExpandIconProps {
|
|
214
|
+
prefixCls: string;
|
|
215
|
+
expanded: boolean;
|
|
216
|
+
record: AkitableData;
|
|
217
|
+
expandable: boolean;
|
|
218
|
+
onExpand: (record: AkitableData, e: React.MouseEvent<HTMLElement>) => void;
|
|
219
|
+
}
|
|
220
|
+
export interface AkitableExpandableConfig {
|
|
221
|
+
/**
|
|
222
|
+
* The column contains children to display.
|
|
223
|
+
* @default 'children'
|
|
224
|
+
*/
|
|
225
|
+
childrenColumnName?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Set the title of the expand column.
|
|
228
|
+
*/
|
|
229
|
+
columnTitle?: React.ReactNode;
|
|
230
|
+
/**
|
|
231
|
+
* Set the width of the expand column.
|
|
232
|
+
*/
|
|
233
|
+
columnWidth?: string | number;
|
|
234
|
+
/**
|
|
235
|
+
* Expand all rows initially.
|
|
236
|
+
* @default false
|
|
237
|
+
*/
|
|
238
|
+
defaultExpandAllRows?: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Initial expanded row keys.
|
|
241
|
+
*/
|
|
242
|
+
defaultExpandedRowKeys?: string[] | number[];
|
|
243
|
+
/**
|
|
244
|
+
* Expanded row's className.
|
|
245
|
+
*/
|
|
246
|
+
expandedRowClassName?: string | ((record: AkitableData, index: number, indent: number) => string);
|
|
247
|
+
/**
|
|
248
|
+
* Current expanded row keys.
|
|
249
|
+
*/
|
|
250
|
+
expandedRowKeys?: string[] | number[];
|
|
251
|
+
/**
|
|
252
|
+
* Expanded container render for each row.
|
|
253
|
+
*/
|
|
254
|
+
expandedRowRender?: (record: AkitableData, index: number, indent: number, expanded: boolean) => React.ReactNode;
|
|
255
|
+
/**
|
|
256
|
+
* Customize row expand Icon. Ref example.
|
|
257
|
+
*/
|
|
258
|
+
expandIcon?: (props: AkitableExpandIconProps) => React.ReactNode;
|
|
259
|
+
/**
|
|
260
|
+
* Whether to expand row by clicking anywhere in the whole row.
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
expandRowByClick?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Whether the expansion icon is fixed. Optional true left right.
|
|
266
|
+
* @default false
|
|
267
|
+
*/
|
|
268
|
+
fixed?: boolean | 'left' | 'right';
|
|
269
|
+
/**
|
|
270
|
+
* Indent size in pixels of tree data.
|
|
271
|
+
* @default 15
|
|
272
|
+
*/
|
|
273
|
+
indentSize?: number;
|
|
274
|
+
/**
|
|
275
|
+
* Enable row can be expandable.
|
|
276
|
+
*/
|
|
277
|
+
rowExpandable?: (record: AkitableData) => boolean;
|
|
278
|
+
/**
|
|
279
|
+
* Show expand column.
|
|
280
|
+
* @default true
|
|
281
|
+
*/
|
|
282
|
+
showExpandColumn?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* Callback executed when the row expand icon is clicked.
|
|
285
|
+
*/
|
|
286
|
+
onExpand?: (expanded: boolean, record: AkitableData) => void;
|
|
287
|
+
/**
|
|
288
|
+
* Callback executed when the expanded rows change.
|
|
289
|
+
*/
|
|
290
|
+
onExpandedRowsChange?: (expandedRows: readonly React.Key[]) => void;
|
|
291
|
+
}
|
|
201
292
|
export interface AkitableAction {
|
|
202
293
|
/**
|
|
203
294
|
* Label for the action.
|
package/dist/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAEjD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;A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AE,CAAC,eAAe,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,IAAI,CAAC;CAClD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/akitable",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -12,32 +12,32 @@
|
|
|
12
12
|
"antd": "^5.27.0",
|
|
13
13
|
"clsx": "^2.1.1",
|
|
14
14
|
"react-error-boundary": "^6.0.0",
|
|
15
|
-
"@akinon/akilocale": "1.2.
|
|
16
|
-
"@akinon/akiform": "1.1.
|
|
17
|
-
"@akinon/ui-
|
|
18
|
-
"@akinon/
|
|
19
|
-
"@akinon/ui-
|
|
20
|
-
"@akinon/ui-
|
|
21
|
-
"@akinon/ui-
|
|
22
|
-
"@akinon/ui-
|
|
23
|
-
"@akinon/ui-
|
|
24
|
-
"@akinon/ui-
|
|
25
|
-
"@akinon/ui-
|
|
26
|
-
"@akinon/ui-
|
|
27
|
-
"@akinon/ui-
|
|
28
|
-
"@akinon/ui-
|
|
29
|
-
"@akinon/ui-
|
|
30
|
-
"@akinon/ui-
|
|
31
|
-
"@akinon/
|
|
15
|
+
"@akinon/akilocale": "1.2.5",
|
|
16
|
+
"@akinon/akiform": "1.1.6",
|
|
17
|
+
"@akinon/ui-card": "1.2.5",
|
|
18
|
+
"@akinon/ui-input": "1.2.5",
|
|
19
|
+
"@akinon/ui-pagination": "1.4.6",
|
|
20
|
+
"@akinon/ui-progress": "1.2.5",
|
|
21
|
+
"@akinon/ui-select": "1.4.6",
|
|
22
|
+
"@akinon/ui-skeleton": "1.1.5",
|
|
23
|
+
"@akinon/ui-space": "1.4.5",
|
|
24
|
+
"@akinon/ui-spin": "1.4.5",
|
|
25
|
+
"@akinon/ui-result": "1.4.5",
|
|
26
|
+
"@akinon/ui-table": "1.1.5",
|
|
27
|
+
"@akinon/ui-typography": "1.2.4",
|
|
28
|
+
"@akinon/ui-steps": "1.2.6",
|
|
29
|
+
"@akinon/ui-theme": "1.2.5",
|
|
30
|
+
"@akinon/ui-button": "1.4.6",
|
|
31
|
+
"@akinon/icons": "1.2.5"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"clean-package": "2.2.0",
|
|
35
35
|
"copyfiles": "^2.4.1",
|
|
36
36
|
"rimraf": "^5.0.5",
|
|
37
37
|
"typescript": "*",
|
|
38
|
-
"@akinon/typescript-config": "1.1.
|
|
39
|
-
"@akinon/
|
|
40
|
-
"@akinon/
|
|
38
|
+
"@akinon/typescript-config": "1.1.5",
|
|
39
|
+
"@akinon/utils": "1.2.6",
|
|
40
|
+
"@akinon/vitest-config": "1.1.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "^18 || ^19",
|