@happyvertical/smrt-ui 0.42.3 → 0.42.5
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/README.md +275 -0
- package/dist/components/data/DataTable.svelte +1444 -172
- package/dist/components/data/DataTable.svelte.d.ts +1 -1
- package/dist/components/data/DataTable.svelte.d.ts.map +1 -1
- package/dist/components/data/DataTableController.d.ts +235 -0
- package/dist/components/data/DataTableController.d.ts.map +1 -0
- package/dist/components/data/DataTableController.js +792 -0
- package/dist/components/data/DataTableIdentity.d.ts +21 -0
- package/dist/components/data/DataTableIdentity.d.ts.map +1 -0
- package/dist/components/data/DataTableIdentity.js +28 -0
- package/dist/components/data/DataTableLayout.d.ts +37 -0
- package/dist/components/data/DataTableLayout.d.ts.map +1 -0
- package/dist/components/data/DataTableLayout.js +135 -0
- package/dist/components/data/DataTablePerformance.d.ts +31 -0
- package/dist/components/data/DataTablePerformance.d.ts.map +1 -0
- package/dist/components/data/DataTablePerformance.js +46 -0
- package/dist/components/data/DataTableVirtualization.d.ts +71 -0
- package/dist/components/data/DataTableVirtualization.d.ts.map +1 -0
- package/dist/components/data/DataTableVirtualization.js +100 -0
- package/dist/components/data/__benchmarks__/DataTable.bench.d.ts +2 -0
- package/dist/components/data/__benchmarks__/DataTable.bench.d.ts.map +1 -0
- package/dist/components/data/__benchmarks__/DataTable.bench.js +53 -0
- package/dist/components/data/__fixtures__/DataTableConformanceFixture.d.ts +27 -0
- package/dist/components/data/__fixtures__/DataTableConformanceFixture.d.ts.map +1 -0
- package/dist/components/data/__fixtures__/DataTableConformanceFixture.js +141 -0
- package/dist/components/data/__fixtures__/DataTablePerformanceFixture.d.ts +10 -0
- package/dist/components/data/__fixtures__/DataTablePerformanceFixture.d.ts.map +1 -0
- package/dist/components/data/__fixtures__/DataTablePerformanceFixture.js +23 -0
- package/dist/components/data/__tests__/DataTable.test.js +644 -21
- package/dist/components/data/__tests__/DataTableConformance.test.js +212 -0
- package/dist/components/data/__tests__/DataTableController.test.js +336 -0
- package/dist/components/data/__tests__/DataTableIdentity.test.js +29 -0
- package/dist/components/data/__tests__/DataTableLayout.test.js +195 -0
- package/dist/components/data/__tests__/DataTablePerformance.test.js +21 -0
- package/dist/components/data/__tests__/DataTableVirtualization.test.js +80 -0
- package/dist/components/data/__tests__/DataTableVirtualizationComponent.test.js +255 -0
- package/dist/components/data/__tests__/data-surface.test.js +675 -0
- package/dist/components/data/data-surface.d.ts +246 -0
- package/dist/components/data/data-surface.d.ts.map +1 -0
- package/dist/components/data/data-surface.js +1102 -0
- package/dist/components/data/index.d.ts +5 -0
- package/dist/components/data/index.d.ts.map +1 -1
- package/dist/components/data/index.js +5 -0
- package/dist/components/data/types.d.ts +110 -2
- package/dist/components/data/types.d.ts.map +1 -1
- package/dist/i18n/strings.d.ts +26 -0
- package/dist/i18n/strings.d.ts.map +1 -1
- package/dist/i18n/strings.js +28 -2
- package/dist/svelte/playground/DataTablePreview.svelte +400 -10
- package/dist/svelte/playground/DataTablePreview.svelte.d.ts.map +1 -1
- package/dist/svelte/playground.js +2 -2
- package/package.json +3 -2
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export const dataTableConformanceRows = [
|
|
2
|
+
{
|
|
3
|
+
id: 'revenue',
|
|
4
|
+
account: 'Subscription revenue',
|
|
5
|
+
team: 'Growth',
|
|
6
|
+
actual: 182_400,
|
|
7
|
+
forecast: 176_000,
|
|
8
|
+
variance: 6_400,
|
|
9
|
+
status: 'On track',
|
|
10
|
+
action: 'Review',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'services',
|
|
14
|
+
account: 'Professional services',
|
|
15
|
+
team: 'Delivery',
|
|
16
|
+
actual: 48_300,
|
|
17
|
+
forecast: 52_000,
|
|
18
|
+
variance: -3_700,
|
|
19
|
+
status: 'Watch',
|
|
20
|
+
action: 'Review',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
export const dataTableConformanceColumns = [
|
|
24
|
+
{
|
|
25
|
+
id: 'account',
|
|
26
|
+
label: 'Account',
|
|
27
|
+
headerPath: [{ id: 'dimensions', label: 'Dimensions' }],
|
|
28
|
+
minWidth: '13rem',
|
|
29
|
+
resizable: true,
|
|
30
|
+
sortable: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'team',
|
|
34
|
+
label: 'Team',
|
|
35
|
+
headerPath: [{ id: 'dimensions', label: 'Dimensions' }],
|
|
36
|
+
minWidth: '9rem',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'actual',
|
|
40
|
+
label: 'Actual',
|
|
41
|
+
headerPath: [{ id: 'performance', label: 'Performance' }],
|
|
42
|
+
align: 'right',
|
|
43
|
+
resizable: true,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'forecast',
|
|
47
|
+
label: 'Forecast',
|
|
48
|
+
headerPath: [{ id: 'performance', label: 'Performance' }],
|
|
49
|
+
align: 'right',
|
|
50
|
+
resizable: true,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'variance',
|
|
54
|
+
label: 'Variance',
|
|
55
|
+
headerPath: [{ id: 'performance', label: 'Performance' }],
|
|
56
|
+
align: 'right',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'status',
|
|
60
|
+
label: 'Status',
|
|
61
|
+
role: 'status',
|
|
62
|
+
responsive: { keepVisible: true, priority: 10 },
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'action',
|
|
66
|
+
label: 'Action',
|
|
67
|
+
role: 'action',
|
|
68
|
+
responsive: { keepVisible: true, priority: 10 },
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
export const dataTableConformanceStructuralRows = [
|
|
72
|
+
{
|
|
73
|
+
id: 'forecast-subtotal',
|
|
74
|
+
kind: 'subtotal',
|
|
75
|
+
label: 'Current forecast',
|
|
76
|
+
values: { actual: 230_700, forecast: 228_000, variance: 2_700 },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'forecast-total',
|
|
80
|
+
kind: 'footer',
|
|
81
|
+
label: 'All accounts',
|
|
82
|
+
values: { actual: 230_700, forecast: 228_000, variance: 2_700 },
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
export const dataTableConformanceScenarios = [
|
|
86
|
+
{
|
|
87
|
+
id: 'semantic-interaction',
|
|
88
|
+
title: 'Semantic interaction',
|
|
89
|
+
contracts: ['caption', 'rowKey', 'selection', 'keyboard row actions'],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'manual-query',
|
|
93
|
+
title: 'Manual query ownership',
|
|
94
|
+
contracts: [
|
|
95
|
+
'modes',
|
|
96
|
+
'totalRows',
|
|
97
|
+
'query revision',
|
|
98
|
+
'allMatching selection',
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 'async-lifecycle',
|
|
103
|
+
title: 'Async lifecycle',
|
|
104
|
+
contracts: ['loading', 'refreshing', 'stale', 'partial results', 'retry'],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'responsive-overflow',
|
|
108
|
+
title: 'Responsive overflow',
|
|
109
|
+
contracts: [
|
|
110
|
+
'responsive metadata',
|
|
111
|
+
'named overflow region',
|
|
112
|
+
'keyboard scroll',
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'report-layout',
|
|
117
|
+
title: 'Report layout',
|
|
118
|
+
contracts: ['grouped headers', 'structural rows', 'widths', 'pinning'],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'scale-virtualization',
|
|
122
|
+
title: 'Scale and virtualization',
|
|
123
|
+
contracts: [
|
|
124
|
+
'rowKey',
|
|
125
|
+
'virtual body',
|
|
126
|
+
'stable focus',
|
|
127
|
+
'footer reachability',
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
export function createDataTableConformanceRows(rowCount) {
|
|
132
|
+
return Array.from({ length: rowCount }, (_, index) => {
|
|
133
|
+
const source = dataTableConformanceRows[index % dataTableConformanceRows.length];
|
|
134
|
+
const rowNumber = index + 1;
|
|
135
|
+
return {
|
|
136
|
+
...source,
|
|
137
|
+
id: `conformance-${rowNumber}`,
|
|
138
|
+
account: `${source.account} ${rowNumber}`,
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DataTableColumn } from '../types.js';
|
|
2
|
+
export interface DataTablePerformanceRow {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
group: string;
|
|
6
|
+
values: Record<string, number>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createDataTablePerformanceRows(rowCount: number, valueColumnCount: number): DataTablePerformanceRow[];
|
|
9
|
+
export declare function createDataTablePerformanceColumns(valueColumnCount: number): DataTableColumn<DataTablePerformanceRow>[];
|
|
10
|
+
//# sourceMappingURL=DataTablePerformanceFixture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTablePerformanceFixture.d.ts","sourceRoot":"","sources":["../../../../src/components/data/__fixtures__/DataTablePerformanceFixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACvB,uBAAuB,EAAE,CAY3B;AAED,wBAAgB,iCAAiC,CAC/C,gBAAgB,EAAE,MAAM,GACvB,eAAe,CAAC,uBAAuB,CAAC,EAAE,CAW5C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function createDataTablePerformanceRows(rowCount, valueColumnCount) {
|
|
2
|
+
return Array.from({ length: rowCount }, (_, index) => ({
|
|
3
|
+
id: `row-${index}`,
|
|
4
|
+
name: `Record ${index.toString().padStart(5, '0')}`,
|
|
5
|
+
group: `group-${index % 10}`,
|
|
6
|
+
values: Object.fromEntries(Array.from({ length: valueColumnCount }, (_, valueIndex) => [
|
|
7
|
+
`value${valueIndex}`,
|
|
8
|
+
(index * (valueIndex + 3)) % 997,
|
|
9
|
+
])),
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
export function createDataTablePerformanceColumns(valueColumnCount) {
|
|
13
|
+
return [
|
|
14
|
+
{ id: 'name', label: 'Name', accessor: 'name', sortable: true },
|
|
15
|
+
{ id: 'group', label: 'Group', accessor: 'group', sortable: true },
|
|
16
|
+
...Array.from({ length: valueColumnCount }, (_, index) => ({
|
|
17
|
+
id: `value${index}`,
|
|
18
|
+
label: `Value ${index + 1}`,
|
|
19
|
+
accessor: `values.value${index}`,
|
|
20
|
+
sortable: true,
|
|
21
|
+
})),
|
|
22
|
+
];
|
|
23
|
+
}
|