@aivenio/aquarium 1.53.0 → 1.54.0
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/_variables.scss +1 -1
- package/dist/src/atoms/DataList/DataList.d.ts +2 -0
- package/dist/src/atoms/DataList/DataList.js +8 -9
- package/dist/src/molecules/DataList/DataList.d.ts +12 -7
- package/dist/src/molecules/DataList/DataList.js +28 -96
- package/dist/src/molecules/DataList/DataListComponents.d.ts +27 -0
- package/dist/src/molecules/DataList/DataListComponents.js +73 -0
- package/dist/src/molecules/DataList/DataListGroup.d.ts +9 -0
- package/dist/src/molecules/DataList/DataListGroup.js +74 -0
- package/dist/src/molecules/DataTable/DataTable.d.ts +1 -1
- package/dist/src/molecules/Template/Template.d.ts +1 -1
- package/dist/src/molecules/Template/Template.js +13 -2
- package/dist/src/utils/table/types.d.ts +10 -6
- package/dist/src/utils/table/types.js +7 -2
- package/dist/styles.css +5 -10
- package/dist/system.cjs +1332 -1158
- package/dist/system.mjs +1298 -1125
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
@@ -36,8 +36,8 @@ export declare type ColumnBase<R> = {
|
|
36
36
|
*/
|
37
37
|
headerTooltip?: Pick<TooltipProps, 'content' | 'placement'>;
|
38
38
|
};
|
39
|
-
declare type Tooltip<R> = (row: R, index: number, rows: R[]) => Pick<TooltipProps, 'content' | 'placement'>;
|
40
|
-
declare type Formatter<R, K extends keyof R, V = R[K]> = (value: V, row: R, index: number, rows: R[]) => string;
|
39
|
+
declare type Tooltip<R> = (row: R, index: number, rows: R[] | undefined) => Pick<TooltipProps, 'content' | 'placement'>;
|
40
|
+
declare type Formatter<R, K extends keyof R, V = R[K]> = (value: V, row: R, index: number, rows: R[] | undefined) => string;
|
41
41
|
declare type CustomSortable<R> = {
|
42
42
|
/**
|
43
43
|
* Optional compare function for sorting.
|
@@ -81,7 +81,7 @@ export declare type ActionColumn<R> = CustomSortable<R> & {
|
|
81
81
|
/**
|
82
82
|
* Callback function that resolves to Button props.
|
83
83
|
*/
|
84
|
-
action: (row: R, index: number, rows: R[]) => ActionType;
|
84
|
+
action: (row: R, index: number, rows: R[] | undefined) => ActionType;
|
85
85
|
};
|
86
86
|
export declare type CustomColumn<R> = CustomSortable<R> & {
|
87
87
|
/**
|
@@ -92,7 +92,7 @@ export declare type CustomColumn<R> = CustomSortable<R> & {
|
|
92
92
|
* Unsafe render method. Consider consulting the designer instead of using this.
|
93
93
|
* Using render callback will also disallow sorting on that column.
|
94
94
|
*/
|
95
|
-
UNSAFE_render: (row: R, index: number, rows: R[]) => React.ReactNode;
|
95
|
+
UNSAFE_render: (row: R, index: number, rows: R[] | undefined) => React.ReactNode;
|
96
96
|
};
|
97
97
|
export declare type TableItem = RequireAtLeastOne<{
|
98
98
|
title: React.ReactNode;
|
@@ -109,7 +109,7 @@ declare type ItemColumn<R> = Column & CustomSortable<R> & {
|
|
109
109
|
/**
|
110
110
|
* Callback function that resolves to TableItem props
|
111
111
|
*/
|
112
|
-
item: (row: R, index: number, rows: R[]) => TableItem | undefined;
|
112
|
+
item: (row: R, index: number, rows: R[] | undefined) => TableItem | undefined;
|
113
113
|
};
|
114
114
|
export declare type TableStatus = {
|
115
115
|
status: ChipStatus;
|
@@ -123,7 +123,7 @@ declare type StatusColumn<R> = Column & CustomSortable<R> & {
|
|
123
123
|
/**
|
124
124
|
* Callback function that resolves to StatusChip props
|
125
125
|
*/
|
126
|
-
status: (row: R, index: number, rows: R[]) => TableStatus | undefined;
|
126
|
+
status: (row: R, index: number, rows: R[] | undefined) => TableStatus | undefined;
|
127
127
|
};
|
128
128
|
declare type ListColumn = Column & {
|
129
129
|
/**
|
@@ -147,10 +147,14 @@ export declare type DataTableRow = Record<string, any> & {
|
|
147
147
|
*/
|
148
148
|
id: number | string;
|
149
149
|
};
|
150
|
+
export declare type DataListGroupedRows<R extends DataTableRow> = {
|
151
|
+
[K in string]: DataListGroupedRows<R> | R[];
|
152
|
+
};
|
150
153
|
export declare type Sort<C> = {
|
151
154
|
column: C;
|
152
155
|
direction: SortDirection;
|
153
156
|
};
|
157
|
+
export declare const areRowsGrouped: <R extends DataTableRow>(rows: DataListGroupedRows<R> | R[]) => rows is DataListGroupedRows<R>;
|
154
158
|
export declare const toSortDirection: (direction: SortDirection | undefined) => 'asc' | 'desc' | false;
|
155
159
|
export declare type StickyColumn = 'left' | 'right';
|
156
160
|
declare type CellProps = {
|
@@ -1,5 +1,10 @@
|
|
1
|
+
import isArray from 'lodash/isArray';
|
2
|
+
export const areRowsGrouped = (rows) => {
|
3
|
+
return !isArray(rows);
|
4
|
+
};
|
1
5
|
export const toSortDirection = (direction) => direction === 'ascending' ? 'asc' : direction === 'descending' ? 'desc' : false;
|
2
6
|
export const cellProps = (column) => {
|
7
|
+
var _a;
|
3
8
|
let align;
|
4
9
|
switch (column.type) {
|
5
10
|
case 'action':
|
@@ -16,7 +21,7 @@ export const cellProps = (column) => {
|
|
16
21
|
}
|
17
22
|
}
|
18
23
|
return {
|
19
|
-
key: column.key
|
24
|
+
key: (_a = column.key) !== null && _a !== void 0 ? _a : column.headerName,
|
20
25
|
align,
|
21
26
|
stickyColumn: column.sticky,
|
22
27
|
};
|
@@ -25,4 +30,4 @@ export const columnIsFieldColumn = (column) => Boolean(column && column.field);
|
|
25
30
|
export function isOnSortChangedDirection(value) {
|
26
31
|
return value === undefined || ['ascending', 'descending'].includes(value);
|
27
32
|
}
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdXRpbHMvdGFibGUvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxPQUFPLE1BQU0sZ0JBQWdCLENBQUM7QUF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NuSCxPQUFPLENBQUMsTUFBTSxJQUFLLE1BQXlCLENBQUMsS0FBSyxDQUFDLENBQUM7QUEyQnRELE1BQU0sVUFBVSx3QkFBd0IsQ0FBQyxLQUF5QjtJQUNoRSxPQUFPLEtBQUssS0FBSyxTQUFTLElBQUksQ0FBQyxXQUFXLEVBQUUsWUFBWSxDQUFDLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQzVFLENBQUMifQ==
|
package/dist/styles.css
CHANGED
@@ -1653,9 +1653,6 @@ input[type='number'].no-arrows {
|
|
1653
1653
|
.border-2{
|
1654
1654
|
border-width: 2px;
|
1655
1655
|
}
|
1656
|
-
.border-t{
|
1657
|
-
border-top-width: 1px;
|
1658
|
-
}
|
1659
1656
|
.border-b{
|
1660
1657
|
border-bottom-width: 1px;
|
1661
1658
|
}
|
@@ -3056,16 +3053,14 @@ input[type='number'].no-arrows {
|
|
3056
3053
|
stroke: #e3e9ff;
|
3057
3054
|
stroke: var(--aquarium-colors-primary-10, #e3e9ff);
|
3058
3055
|
}
|
3059
|
-
.\[
|
3056
|
+
.\[\&\>\*\]\:bg-primary-5>*{
|
3057
|
+
background-color: #f3f6ff;
|
3058
|
+
background-color: var(--aquarium-colors-primary-5, #f3f6ff);
|
3059
|
+
}
|
3060
|
+
.\[\&\>\*\]\:hover\:bg-grey-0:hover>*{
|
3060
3061
|
background-color: #f7f7fa;
|
3061
3062
|
background-color: var(--aquarium-colors-grey-0, #f7f7fa);
|
3062
3063
|
}
|
3063
|
-
.\[\&\>\.group\>\*\:first-child\]\:border-b-0>.group>*:first-child{
|
3064
|
-
border-bottom-width: 0px;
|
3065
|
-
}
|
3066
|
-
.\[\&\:last-child\>\*\:first-child\]\:border-t:last-child>*:first-child{
|
3067
|
-
border-top-width: 1px;
|
3068
|
-
}
|
3069
3064
|
.\[\&\>button\]\:p-0>button{
|
3070
3065
|
padding: 0;
|
3071
3066
|
}
|