@graphenedata/cli 0.0.15 → 0.0.16
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 +138 -0
- package/dist/cli/bigQuery-I3F46SC6.js +75 -0
- package/dist/cli/bigQuery-I3F46SC6.js.map +7 -0
- package/dist/cli/chunk-OVWODUTJ.js +12849 -0
- package/dist/cli/chunk-OVWODUTJ.js.map +7 -0
- package/dist/cli/chunk-QAXEOZ43.js +53 -0
- package/dist/cli/chunk-QAXEOZ43.js.map +7 -0
- package/dist/cli/cli.js +234 -11197
- package/dist/cli/clickhouse-ZN5AN2UL.js +64 -0
- package/dist/cli/clickhouse-ZN5AN2UL.js.map +7 -0
- package/dist/cli/duckdb-IYBIO5KJ.js +87 -0
- package/dist/cli/duckdb-IYBIO5KJ.js.map +7 -0
- package/dist/cli/serve2-TNN5EROW.js +447 -0
- package/dist/cli/serve2-TNN5EROW.js.map +7 -0
- package/dist/cli/snowflake-MOQB5GA4.js +128 -0
- package/dist/cli/snowflake-MOQB5GA4.js.map +7 -0
- package/dist/index.d.ts +63 -0
- package/dist/lang/index.d.ts +63 -0
- package/dist/skills/graphene/SKILL.md +150 -96
- package/dist/skills/graphene/references/big-value.md +6 -41
- package/dist/skills/graphene/references/date-range.md +64 -0
- package/dist/skills/graphene/references/dropdown.md +3 -4
- package/dist/skills/graphene/references/echarts.md +162 -0
- package/dist/skills/graphene/references/gsql.md +55 -25
- package/dist/skills/graphene/references/model-gsql.md +72 -0
- package/dist/skills/graphene/references/table.md +13 -14
- package/dist/skills/graphene/references/text-input.md +2 -1
- package/dist/ui/app.css +239 -340
- package/dist/ui/component-utilities/dataShaping.ts +484 -0
- package/dist/ui/component-utilities/dataSummary.ts +57 -0
- package/dist/ui/component-utilities/enrich.ts +763 -0
- package/dist/ui/component-utilities/format.ts +177 -0
- package/dist/ui/component-utilities/inputUtils.ts +44 -8
- package/dist/ui/component-utilities/theme.ts +200 -0
- package/dist/ui/component-utilities/themeStores.ts +21 -8
- package/dist/ui/component-utilities/types.ts +70 -0
- package/dist/ui/components/AreaChart.svelte +57 -105
- package/dist/ui/components/BarChart.svelte +71 -129
- package/dist/ui/components/BigValue.svelte +24 -40
- package/dist/ui/components/Column.svelte +10 -18
- package/dist/ui/components/DateRange.svelte +54 -21
- package/dist/ui/components/Dropdown.svelte +47 -26
- package/dist/ui/components/DropdownOption.svelte +1 -2
- package/dist/ui/components/ECharts.svelte +181 -67
- package/dist/ui/components/InlineDelta.svelte +50 -31
- package/dist/ui/components/LineChart.svelte +54 -125
- package/dist/ui/components/PieChart.svelte +27 -37
- package/dist/ui/components/QueryLoad.svelte +77 -45
- package/dist/ui/components/Row.svelte +2 -1
- package/dist/ui/components/ScatterPlot.svelte +52 -0
- package/dist/ui/components/Skeleton.svelte +32 -0
- package/dist/ui/components/Table.svelte +3 -2
- package/dist/ui/components/TableGroupRow.svelte +28 -36
- package/dist/ui/components/TableHarness.svelte +32 -0
- package/dist/ui/components/TableHeader.svelte +34 -59
- package/dist/ui/components/TableRow.svelte +14 -38
- package/dist/ui/components/TableSubtotalRow.svelte +18 -21
- package/dist/ui/components/TableTotalRow.svelte +27 -37
- package/dist/ui/components/TextInput.svelte +13 -12
- package/dist/ui/components/Value.svelte +25 -0
- package/dist/ui/components/_Table.svelte +72 -70
- package/dist/ui/internal/ChartGallery.svelte +527 -0
- package/dist/ui/internal/ErrorDisplay.svelte +22 -97
- package/dist/ui/internal/LocalApp.svelte +80 -17
- package/dist/ui/internal/PageNavGroup.svelte +269 -0
- package/dist/ui/internal/Sidebar.svelte +178 -0
- package/dist/ui/internal/SidebarToggle.svelte +47 -0
- package/dist/ui/internal/StyleGallery.svelte +244 -0
- package/dist/ui/internal/clientCache.ts +2 -2
- package/dist/ui/internal/pageInputs.svelte.js +292 -0
- package/dist/ui/internal/queryEngine.ts +102 -117
- package/dist/ui/internal/runSocket.ts +32 -12
- package/dist/ui/internal/sidebar.svelte.js +18 -0
- package/dist/ui/internal/telemetry.ts +51 -16
- package/dist/ui/internal/types.d.ts +7 -0
- package/dist/ui/web.js +28 -11
- package/package.json +36 -38
- package/dist/skills/graphene/references/area-chart.md +0 -95
- package/dist/skills/graphene/references/bar-chart.md +0 -112
- package/dist/skills/graphene/references/line-chart.md +0 -108
- package/dist/skills/graphene/references/pie-chart.md +0 -29
- package/dist/skills/graphene/references/value-formats.md +0 -104
- package/dist/ui/component-utilities/autoFormatting.js +0 -280
- package/dist/ui/component-utilities/builtInFormats.js +0 -481
- package/dist/ui/component-utilities/chartContext.js +0 -12
- package/dist/ui/component-utilities/chartWindowDebug.js +0 -21
- package/dist/ui/component-utilities/checkInputs.js +0 -84
- package/dist/ui/component-utilities/convert.js +0 -15
- package/dist/ui/component-utilities/dateParsing.js +0 -56
- package/dist/ui/component-utilities/dropdownContext.ts +0 -1
- package/dist/ui/component-utilities/echarts.js +0 -252
- package/dist/ui/component-utilities/echartsThemes.js +0 -443
- package/dist/ui/component-utilities/formatTitle.js +0 -24
- package/dist/ui/component-utilities/formatting.js +0 -241
- package/dist/ui/component-utilities/getColumnExtents.js +0 -79
- package/dist/ui/component-utilities/getColumnSummary.js +0 -62
- package/dist/ui/component-utilities/getCompletedData.js +0 -122
- package/dist/ui/component-utilities/getDistinctCount.js +0 -7
- package/dist/ui/component-utilities/getDistinctValues.js +0 -15
- package/dist/ui/component-utilities/getSeriesConfig.js +0 -231
- package/dist/ui/component-utilities/getSortedData.js +0 -9
- package/dist/ui/component-utilities/getStackPercentages.js +0 -45
- package/dist/ui/component-utilities/getStackedData.js +0 -19
- package/dist/ui/component-utilities/getYAxisIndex.js +0 -15
- package/dist/ui/component-utilities/globalContexts.js +0 -1
- package/dist/ui/component-utilities/helpers/getCompletedData.helpers.js +0 -119
- package/dist/ui/component-utilities/replaceNulls.js +0 -16
- package/dist/ui/component-utilities/tableUtils.ts +0 -107
- package/dist/ui/component-utilities/tidyWithTypes.js +0 -9
- package/dist/ui/components/Area.svelte +0 -214
- package/dist/ui/components/Bar.svelte +0 -347
- package/dist/ui/components/Chart.svelte +0 -995
- package/dist/ui/components/Line.svelte +0 -227
- package/dist/ui/internal/NavSidebar.svelte +0 -396
- package/dist/ui/internal/theme.ts +0 -60
- package/dist/ui/public/inter-latin-ext.woff2 +0 -0
- package/dist/ui/public/inter-latin.woff2 +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import {onMount} from 'svelte'
|
|
2
3
|
import {toBoolean} from '../component-utilities/inputUtils'
|
|
4
|
+
import {captureInitial, getPageInputs} from '../internal/pageInputs.svelte.js'
|
|
3
5
|
|
|
4
6
|
interface Props {
|
|
5
7
|
name: string
|
|
@@ -17,16 +19,16 @@
|
|
|
17
19
|
placeholder = 'Type to search', defaultValue = undefined, hideDuringPrint = true, unsafe = false,
|
|
18
20
|
}: Props = $props()
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
+
let pageInputs = getPageInputs()
|
|
23
|
+
let field = captureInitial(() => pageInputs.text(name))
|
|
22
24
|
|
|
23
25
|
let hidePrint = $derived(toBoolean(hideDuringPrint))
|
|
24
26
|
let allowUnsafe = $derived(toBoolean(unsafe))
|
|
25
27
|
let displayLabel = $derived(title || label)
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
onMount(() => {
|
|
30
|
+
if (!field.hasExternalValue) field.set(defaultValue ?? '')
|
|
31
|
+
return () => field.destroy()
|
|
30
32
|
})
|
|
31
33
|
|
|
32
34
|
function sanitize(input: string): string {
|
|
@@ -36,14 +38,12 @@
|
|
|
36
38
|
|
|
37
39
|
function pushValue(input: string) {
|
|
38
40
|
let trimmed = input ?? ''
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
window.$GRAPHENE.updateParam(name, paramValue)
|
|
41
|
+
sanitize(trimmed)
|
|
42
|
+
field.set(trimmed)
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
function onInput(event: Event) {
|
|
45
|
-
|
|
46
|
-
pushValue(value)
|
|
46
|
+
pushValue((event.currentTarget as HTMLInputElement).value)
|
|
47
47
|
}
|
|
48
48
|
</script>
|
|
49
49
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
id={`text-input-${name}`}
|
|
59
59
|
class="text-input"
|
|
60
60
|
type="text"
|
|
61
|
-
value={value}
|
|
61
|
+
value={field.value}
|
|
62
62
|
placeholder={placeholder}
|
|
63
63
|
oninput={onInput}
|
|
64
64
|
/>
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
.input-label {
|
|
80
|
+
font-family: var(--font-ui);
|
|
80
81
|
font-size: 12px;
|
|
81
82
|
font-weight: 600;
|
|
82
83
|
color: var(--input-label-color, #374151);
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
border-radius: 6px;
|
|
92
93
|
border: 1px solid rgba(107, 114, 128, 0.4);
|
|
93
94
|
font-size: 14px;
|
|
94
|
-
font-family: var(--
|
|
95
|
+
font-family: var(--font-ui);
|
|
95
96
|
font-synthesis: none;
|
|
96
97
|
}
|
|
97
98
|
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import QueryLoad from './QueryLoad.svelte'
|
|
3
|
+
import {formatFromField} from '../component-utilities/format.ts'
|
|
4
|
+
import type {QueryResult} from '../component-utilities/types.ts'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
data: string | QueryResult
|
|
8
|
+
column: string
|
|
9
|
+
row?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let {data, column, row = 0}: Props = $props()
|
|
13
|
+
|
|
14
|
+
function formatValue(input: any, loaded: QueryResult) {
|
|
15
|
+
if (input === null || input === undefined) return '—'
|
|
16
|
+
let field = loaded?.fields?.find((entry: any) => entry?.name === column)
|
|
17
|
+
return formatFromField(field as any, input)
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
{#snippet valueContent(loaded: QueryResult)}
|
|
22
|
+
<span>{formatValue(loaded?.rows?.[row]?.[column], loaded)}</span>
|
|
23
|
+
{/snippet}
|
|
24
|
+
|
|
25
|
+
<QueryLoad {data} fields={{column}} inline children={valueContent} />
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import {setContext, untrack, type Snippet} from 'svelte'
|
|
3
3
|
import {writable} from 'svelte/store'
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {convertColumnToDate} from '../component-utilities/dateParsing.js'
|
|
7
|
-
import checkInputs from '../component-utilities/checkInputs.js'
|
|
4
|
+
import {formatTitle} from '../component-utilities/format.ts'
|
|
5
|
+
import {summarizeColumn} from '../component-utilities/dataSummary.ts'
|
|
8
6
|
import ErrorDisplay from '../internal/ErrorDisplay.svelte'
|
|
9
7
|
import TableHeader from './TableHeader.svelte'
|
|
10
8
|
import TableRow from './TableRow.svelte'
|
|
@@ -12,13 +10,13 @@
|
|
|
12
10
|
import TableSubtotalRow from './TableSubtotalRow.svelte'
|
|
13
11
|
import TableTotalRow from './TableTotalRow.svelte'
|
|
14
12
|
import Column from './Column.svelte'
|
|
15
|
-
import {getFinalColumnOrder} from '../component-utilities/tableUtils'
|
|
16
13
|
import {getThemeStores} from '../component-utilities/themeStores'
|
|
17
|
-
import {toBoolean} from '../component-utilities/
|
|
18
|
-
import {
|
|
14
|
+
import {toBoolean} from '../component-utilities/inputUtils'
|
|
15
|
+
import {componentLogger} from '../internal/telemetry.js'
|
|
16
|
+
import type {QueryResult} from '../component-utilities/types.ts'
|
|
19
17
|
|
|
20
18
|
interface Props {
|
|
21
|
-
data?:
|
|
19
|
+
data?: QueryResult, rows?: number | string, title?: string, rowNumbers?: boolean | string
|
|
22
20
|
sort?: string, sortable?: boolean | string, groupBy?: string, groupsOpen?: boolean | string
|
|
23
21
|
groupType?: 'accordion' | 'section', accordionRowColor?: string, groupNamePosition?: 'top' | 'middle' | 'bottom'
|
|
24
22
|
subtotals?: boolean | string, subtotalRowColor?: string, subtotalFontColor?: string
|
|
@@ -32,7 +30,7 @@
|
|
|
32
30
|
const {resolveColor} = getThemeStores()
|
|
33
31
|
|
|
34
32
|
let {
|
|
35
|
-
data = [], rows = 10, title = undefined,
|
|
33
|
+
data = {rows: [], fields: []}, rows = 10, title = undefined, rowNumbers = false, sort = undefined,
|
|
36
34
|
sortable = true, groupBy = undefined, groupsOpen = true, groupType = 'accordion',
|
|
37
35
|
accordionRowColor = undefined, groupNamePosition = 'middle', subtotals = false,
|
|
38
36
|
subtotalRowColor = undefined, subtotalFontColor = undefined, rowShading = false, rowLines = true,
|
|
@@ -64,15 +62,14 @@
|
|
|
64
62
|
|
|
65
63
|
// Initialize store without data - it will be populated by the effect below
|
|
66
64
|
const tablePropsStore = writable<{data: any[]; columns: any[]; priorityColumns:(string | undefined)[]}>({data: [], columns: [], priorityColumns: []})
|
|
67
|
-
setContext(
|
|
65
|
+
setContext('tableProps', tablePropsStore)
|
|
68
66
|
|
|
69
67
|
// Update store when data or groupBy changes
|
|
70
68
|
$effect(() => {
|
|
71
|
-
|
|
72
|
-
let currentData = data
|
|
69
|
+
let currentRows = data?.rows ?? []
|
|
73
70
|
let currentGroupBy = groupBy
|
|
74
71
|
untrack(() => {
|
|
75
|
-
tablePropsStore.update((state) => ({...state, data:
|
|
72
|
+
tablePropsStore.update((state) => ({...state, data: currentRows, priorityColumns: [currentGroupBy]}))
|
|
76
73
|
})
|
|
77
74
|
})
|
|
78
75
|
|
|
@@ -85,6 +82,7 @@
|
|
|
85
82
|
let headerFontColorStore = $derived(resolveColor(headerFontColor))
|
|
86
83
|
let backgroundColorStore = $derived(resolveColor(backgroundColor))
|
|
87
84
|
|
|
85
|
+
let logger = untrack(() => componentLogger('DataTable'))
|
|
88
86
|
let priorityColumns = $derived<(string | undefined)[]>([groupBy])
|
|
89
87
|
|
|
90
88
|
$effect(() => {
|
|
@@ -97,11 +95,6 @@
|
|
|
97
95
|
// Use $derived to reactively read from the store
|
|
98
96
|
let tablePropsColumns = $derived($tablePropsStore.columns ?? [])
|
|
99
97
|
|
|
100
|
-
let finalColumnOrder = $derived(getFinalColumnOrder(tablePropsColumns.map((column: any) => column.id), priorityColumns))
|
|
101
|
-
let orderedColumns = $derived([...tablePropsColumns].sort(
|
|
102
|
-
(a, b) => finalColumnOrder.indexOf(a.id) - finalColumnOrder.indexOf(b.id),
|
|
103
|
-
))
|
|
104
|
-
|
|
105
98
|
let sortObj: {col: string | null; ascending: boolean | null} = $state({col: null, ascending: null})
|
|
106
99
|
|
|
107
100
|
// Parse initial sort on mount
|
|
@@ -129,69 +122,83 @@
|
|
|
129
122
|
// Process data - combine all data processing into one $derived.by block to avoid loops
|
|
130
123
|
let processedState = $derived.by(() => {
|
|
131
124
|
let resultError: string | undefined = undefined
|
|
132
|
-
let
|
|
125
|
+
let resultColumns: any[] = []
|
|
133
126
|
let resultProcessedData: any[] = []
|
|
134
127
|
let resultDataTestId: string | undefined = undefined
|
|
135
128
|
let resultNormalizedData: any[] = []
|
|
136
129
|
|
|
137
130
|
try {
|
|
138
|
-
|
|
139
|
-
let
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
131
|
+
let inputRows = Array.isArray(data?.rows) ? data.rows : []
|
|
132
|
+
let inputFields = Array.isArray(data?.fields) ? data.fields : []
|
|
133
|
+
resultDataTestId = coerceId((data as any)?.id)
|
|
134
|
+
|
|
135
|
+
if (!Array.isArray(inputFields) || inputFields.length === 0) throw new Error('Table data is missing field metadata.')
|
|
136
|
+
if (Array.isArray(inputRows) && inputRows.length > 0) {
|
|
137
|
+
for (let colName of Object.keys(inputRows[0])) {
|
|
138
|
+
let field = inputFields.find(item => item?.name?.toLowerCase() === colName?.toLowerCase())
|
|
139
|
+
let type = String(field?.type || '').toLowerCase()
|
|
140
|
+
let resolvedField = field ?? {name: colName, type}
|
|
141
|
+
let stats = type === 'number' ? summarizeColumn(inputRows, resolvedField, ['min', 'max']) : {}
|
|
142
|
+
|
|
143
|
+
resultColumns.push({
|
|
144
|
+
id: colName,
|
|
145
|
+
defaultTitle: formatTitle(colName),
|
|
146
|
+
type,
|
|
147
|
+
field: resolvedField,
|
|
148
|
+
stats,
|
|
149
|
+
})
|
|
150
|
+
}
|
|
148
151
|
}
|
|
149
152
|
|
|
150
|
-
|
|
151
|
-
resultColumnSummary = getColumnSummary(inputData, 'array')
|
|
153
|
+
if (link && !showLinkColBool) resultColumns = resultColumns.filter((column) => column.id !== link)
|
|
152
154
|
|
|
153
155
|
if (initialSort.sortBy) {
|
|
154
|
-
let columnNames =
|
|
156
|
+
let columnNames = resultColumns.map((col) => col.id)
|
|
155
157
|
if (!columnNames.includes(initialSort.sortBy)) {
|
|
156
158
|
throw new Error(`${initialSort.sortBy} is not a column in the dataset. sort should contain one column name and optionally a direction (asc or desc).`)
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
161
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
.map((col) => col.id)
|
|
163
|
-
|
|
164
|
-
let tempData = inputData
|
|
165
|
-
for (let columnId of dateCols) {
|
|
166
|
-
tempData = convertColumnToDate(tempData, columnId)
|
|
167
|
-
}
|
|
168
|
-
resultProcessedData = tempData
|
|
169
|
-
resultNormalizedData = tempData
|
|
170
|
-
|
|
171
|
-
if (link && !showLinkColBool) {
|
|
172
|
-
let linkIndex = resultColumnSummary.findIndex((col) => col.id === link)
|
|
173
|
-
if (linkIndex !== -1) {
|
|
174
|
-
resultColumnSummary = [...resultColumnSummary.slice(0, linkIndex), ...resultColumnSummary.slice(linkIndex + 1)]
|
|
175
|
-
}
|
|
176
|
-
}
|
|
162
|
+
resultProcessedData = inputRows
|
|
163
|
+
resultNormalizedData = inputRows
|
|
177
164
|
} catch(thrown) {
|
|
178
165
|
let message = thrown instanceof Error ? thrown.message : 'Unable to prepare dataset'
|
|
179
|
-
logError(thrown, {queryId: 'DataTable'})
|
|
180
166
|
resultError = message
|
|
181
|
-
if (strictBuild) throw thrown
|
|
182
167
|
}
|
|
168
|
+
logger.error(resultError)
|
|
183
169
|
|
|
184
170
|
return {
|
|
185
171
|
error: resultError,
|
|
186
|
-
|
|
172
|
+
columns: resultColumns,
|
|
187
173
|
processedData: resultProcessedData,
|
|
188
174
|
dataTestId: resultDataTestId,
|
|
189
175
|
normalizedData: resultNormalizedData,
|
|
190
176
|
}
|
|
191
177
|
})
|
|
192
178
|
|
|
179
|
+
let columnLookup = $derived.by(() => {
|
|
180
|
+
let lookup: Record<string, any> = {}
|
|
181
|
+
for (let column of processedState.columns) lookup[column.id] = column
|
|
182
|
+
return lookup
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
let resolvedColumns = $derived(tablePropsColumns.map((column: any) => {
|
|
186
|
+
let meta = columnLookup[column.id] || {}
|
|
187
|
+
return {
|
|
188
|
+
...column,
|
|
189
|
+
defaultTitle: meta.defaultTitle ?? formatTitle(column.id),
|
|
190
|
+
type: meta.type,
|
|
191
|
+
field: meta.field,
|
|
192
|
+
stats: meta.stats,
|
|
193
|
+
}
|
|
194
|
+
}))
|
|
195
|
+
|
|
196
|
+
let finalColumnOrder = $derived(getFinalColumnOrder(resolvedColumns.map((column: any) => column.id), priorityColumns))
|
|
197
|
+
let orderedColumns = $derived([...resolvedColumns].sort(
|
|
198
|
+
(a, b) => finalColumnOrder.indexOf(a.id) - finalColumnOrder.indexOf(b.id),
|
|
199
|
+
))
|
|
200
|
+
|
|
193
201
|
// Extract processed state
|
|
194
|
-
let columnSummary = $derived(processedState.columnSummary)
|
|
195
202
|
let normalizedData = $derived(processedState.normalizedData)
|
|
196
203
|
let dataTestId = $derived(processedState.dataTestId)
|
|
197
204
|
|
|
@@ -213,6 +220,12 @@
|
|
|
213
220
|
return String(value).toLowerCase()
|
|
214
221
|
}
|
|
215
222
|
|
|
223
|
+
const getFinalColumnOrder = (columns: string[], priorityColumns: Array<string | undefined>): string[] => {
|
|
224
|
+
let priorities = priorityColumns.filter(Boolean) as string[]
|
|
225
|
+
let restColumns = columns.filter(key => !priorities.includes(key))
|
|
226
|
+
return [...priorities, ...restColumns]
|
|
227
|
+
}
|
|
228
|
+
|
|
216
229
|
const compareValues = (a: unknown, b: unknown, ascending: boolean) => {
|
|
217
230
|
let modifier = ascending ? 1 : -1
|
|
218
231
|
if (a === b) return 0
|
|
@@ -352,7 +365,7 @@
|
|
|
352
365
|
{#if children}
|
|
353
366
|
{@render children()}
|
|
354
367
|
{:else}
|
|
355
|
-
{#each
|
|
368
|
+
{#each processedState.columns as column (column.id)}
|
|
356
369
|
<Column id={column.id} />
|
|
357
370
|
{/each}
|
|
358
371
|
{/if}
|
|
@@ -361,10 +374,9 @@
|
|
|
361
374
|
class={`table-container ${paginated ? 'table-container--has-pagination' : ''}`}
|
|
362
375
|
data-testid={isFullPageBool ? undefined : `DataTable-${dataTestId ?? 'no-id'}`}
|
|
363
376
|
>
|
|
364
|
-
{#if title
|
|
377
|
+
{#if title}
|
|
365
378
|
<div class="table-title">
|
|
366
|
-
|
|
367
|
-
{#if subtitle}<div class="table-title__subhead">{subtitle}</div>{/if}
|
|
379
|
+
<div class="table-title__headline">{title}</div>
|
|
368
380
|
</div>
|
|
369
381
|
{/if}
|
|
370
382
|
|
|
@@ -375,7 +387,6 @@
|
|
|
375
387
|
headerColor={$headerColorStore}
|
|
376
388
|
headerFontColor={$headerFontColorStore}
|
|
377
389
|
{orderedColumns}
|
|
378
|
-
{columnSummary}
|
|
379
390
|
sortable={sortableBool}
|
|
380
391
|
{sortClick}
|
|
381
392
|
formatColumnTitles={formatColumnTitlesBool}
|
|
@@ -392,7 +403,6 @@
|
|
|
392
403
|
{groupName}
|
|
393
404
|
currentGroupData={sortedGroupedData[groupName]}
|
|
394
405
|
toggled={groupToggleStates[groupName]}
|
|
395
|
-
{columnSummary}
|
|
396
406
|
rowNumbers={effectiveRowNumbers}
|
|
397
407
|
rowColor={$accordionRowColorStore}
|
|
398
408
|
subtotals={subtotalsBool}
|
|
@@ -409,12 +419,12 @@
|
|
|
409
419
|
rowNumbers={effectiveRowNumbers}
|
|
410
420
|
rowLines={rowLinesBool}
|
|
411
421
|
compact={compactBool}
|
|
412
|
-
{columnSummary}
|
|
413
422
|
grouped={true}
|
|
414
423
|
{groupType}
|
|
415
424
|
groupColumn={groupBy}
|
|
416
425
|
groupNamePosition={groupNamePosition}
|
|
417
426
|
orderedColumns={orderedColumns}
|
|
427
|
+
columnLookup={columnLookup}
|
|
418
428
|
index={groupOffsets[groupName] ?? 0}
|
|
419
429
|
rowSpan={sortedGroupedData[groupName].length}
|
|
420
430
|
/>
|
|
@@ -422,7 +432,6 @@
|
|
|
422
432
|
<TableSubtotalRow
|
|
423
433
|
{groupName}
|
|
424
434
|
currentGroupData={sortedGroupedData[groupName]}
|
|
425
|
-
{columnSummary}
|
|
426
435
|
rowColor={$subtotalRowColorStore}
|
|
427
436
|
fontColor={$subtotalFontColorStore}
|
|
428
437
|
groupBy={groupBy}
|
|
@@ -442,12 +451,12 @@
|
|
|
442
451
|
rowNumbers={effectiveRowNumbers}
|
|
443
452
|
rowLines={rowLinesBool}
|
|
444
453
|
compact={compactBool}
|
|
445
|
-
{columnSummary}
|
|
446
454
|
grouped={false}
|
|
447
455
|
{groupType}
|
|
448
456
|
groupColumn={groupBy}
|
|
449
457
|
groupNamePosition={groupNamePosition}
|
|
450
458
|
orderedColumns={orderedColumns}
|
|
459
|
+
columnLookup={columnLookup}
|
|
451
460
|
index={rowsNum * (currentPage - 1)}
|
|
452
461
|
/>
|
|
453
462
|
{/if}
|
|
@@ -456,7 +465,6 @@
|
|
|
456
465
|
<TableTotalRow
|
|
457
466
|
data={tableData}
|
|
458
467
|
rowNumbers={effectiveRowNumbers}
|
|
459
|
-
{columnSummary}
|
|
460
468
|
rowColor={$totalRowColorStore}
|
|
461
469
|
fontColor={$totalFontColorStore}
|
|
462
470
|
groupType={groupType}
|
|
@@ -492,7 +500,7 @@
|
|
|
492
500
|
margin: 8px 0;
|
|
493
501
|
position: relative;
|
|
494
502
|
color: var(--color-base-content, #1f2937);
|
|
495
|
-
font-family: var(--
|
|
503
|
+
font-family: var(--font-ui, system-ui);
|
|
496
504
|
line-height: 1.45;
|
|
497
505
|
}
|
|
498
506
|
|
|
@@ -510,12 +518,6 @@
|
|
|
510
518
|
line-height: 1.3;
|
|
511
519
|
}
|
|
512
520
|
|
|
513
|
-
.table-title__subhead {
|
|
514
|
-
color: var(--color-base-content-muted, #6b7280);
|
|
515
|
-
font-size: 13px;
|
|
516
|
-
margin-top: 2px;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
521
|
.scrollbox {
|
|
520
522
|
width: 100%;
|
|
521
523
|
overflow-x: auto;
|