@svgrid/grid 2.2.32 → 2.2.33
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/DockNodeView.svelte +1 -1
- package/dist/GridFooter.svelte +0 -40
- package/dist/GridMenus.svelte +0 -77
- package/dist/SvDateRangeInput.svelte +1 -1
- package/dist/SvGrid.svelte +2 -25
- package/dist/SvGridChart.svelte +2 -10
- package/dist/SvGridSelect.svelte +0 -2
- package/dist/SvKbd.svelte +1 -1
- package/dist/SvList.svelte +1 -1
- package/dist/SvMenubar.svelte +1 -1
- package/dist/SvMultiSelect.svelte +0 -1
- package/dist/SvOtpInput.svelte +1 -1
- package/dist/SvRichText.svelte +4 -0
- package/dist/SvTour.svelte +4 -0
- package/dist/SvTreeSelect.svelte +0 -2
- package/dist/cdn/{GridMenus-C6ixSGWW.js → GridMenus-B7XhhqdN.js} +2 -4
- package/dist/cdn/{GridMenus-Cyk3qpJ7.js → GridMenus-BxmIvCJh.js} +4 -6
- package/dist/cdn/{SvDateTimePicker-CdqaP61H.js → SvDateTimePicker-o94wfSUa.js} +1 -1
- package/dist/cdn/{SvGridChart-BcLCYvw9.js → SvGridChart-Cr_90pPD.js} +1 -1
- package/dist/cdn/{SvGridChartPanel-DvjwxLvK.js → SvGridChartPanel-ICbxiUvK.js} +4 -4
- package/dist/cdn/{SvGridChartView-PwqI4s02.js → SvGridChartView-Bx42PMvf.js} +2 -2
- package/dist/cdn/{SvGridDropdown-Dh-2ej8j.js → SvGridDropdown-CUOdm7YA.js} +1 -1
- package/dist/cdn/{disclose-version-DoD9AFD_.js → disclose-version-DljhZohK.js} +45 -45
- package/dist/cdn/{src-CgD-wiuS.js → src-erjBRYfX.js} +14 -31
- package/dist/cdn/{src-BgHjWF0Q.js → src-ktbQVOk-.js} +7 -24
- package/dist/cdn/svgrid.js +5 -5
- package/dist/cdn/svgrid.svelte-external.js +1 -1
- package/dist/chart.d.ts +2 -0
- package/dist/chart.js +1 -4
- package/dist/createMenu.svelte.js +0 -1
- package/dist/createPopoverSelect.svelte.d.ts +2 -2
- package/dist/editing.js +1 -1
- package/dist/export-format.js +3 -0
- package/dist/selection.js +0 -1
- package/package.json +3 -2
- package/src/DockNodeView.svelte +1 -1
- package/src/GridFooter.svelte +0 -40
- package/src/GridMenus.svelte +0 -77
- package/src/SvCalendar.test.ts +1 -1
- package/src/SvDateRangeInput.svelte +1 -1
- package/src/SvGrid.controller.svelte.ts +0 -5
- package/src/SvGrid.svelte +2 -25
- package/src/SvGrid.types.ts +0 -1
- package/src/SvGridChart.svelte +2 -10
- package/src/SvGridSelect.svelte +0 -2
- package/src/SvKbd.svelte +1 -1
- package/src/SvList.svelte +1 -1
- package/src/SvMenubar.svelte +1 -1
- package/src/SvMultiSelect.svelte +0 -1
- package/src/SvOtpInput.svelte +1 -1
- package/src/SvRichText.svelte +4 -0
- package/src/SvTour.svelte +4 -0
- package/src/SvTreeSelect.svelte +0 -2
- package/src/ai.test.ts +1 -1
- package/src/build-api.ts +0 -105
- package/src/cell-formatting.test.ts +1 -1
- package/src/cell-render.ts +0 -94
- package/src/chart.ts +1 -2
- package/src/clipboard.ts +0 -102
- package/src/columns.ts +0 -115
- package/src/createMenu.svelte.ts +0 -1
- package/src/editing.ts +2 -105
- package/src/editor-registry.grid.test.ts +0 -2
- package/src/export-format.ts +3 -0
- package/src/features.ts +0 -90
- package/src/keyboard-handlers.coverage.test.ts +1 -1
- package/src/keyboard-handlers.ts +0 -120
- package/src/menus.test.ts +0 -1
- package/src/menus.ts +0 -112
- package/src/new-features.test.ts +3 -1
- package/src/row-drag.test.ts +1 -1
- package/src/row-resize.test.ts +1 -2
- package/src/scroll-sync.test.ts +4 -7
- package/src/scroll-sync.ts +0 -122
- package/src/selection.ts +0 -109
- package/src/server-group-model.test.ts +2 -2
- package/src/summaries.ts +0 -112
- package/src/svgrid.behavior.test.ts +0 -1
- package/src/svgrid.column-reorder.test.ts +0 -8
- package/src/tree-row-model.test.ts +0 -1
package/src/SvGridChart.svelte
CHANGED
|
@@ -213,15 +213,7 @@
|
|
|
213
213
|
return { t0: zoom.i0 / n, t1: (zoom.i1 + 1) / n }
|
|
214
214
|
})
|
|
215
215
|
|
|
216
|
-
|
|
217
|
-
function brushXToIndex(localX: number): number {
|
|
218
|
-
if (!brushGeo) return 0
|
|
219
|
-
const w = brushGeo.plot.w
|
|
220
|
-
const x = Math.max(0, Math.min(w, localX - brushGeo.plot.x))
|
|
221
|
-
const n = spec.categories.length
|
|
222
|
-
return Math.max(0, Math.min(n - 1, Math.floor((x / w) * n)))
|
|
223
|
-
}
|
|
224
|
-
type BrushDrag = { mode: 'move' | 'left' | 'right'; startX: number; startT0: number; startT1: number }
|
|
216
|
+
type BrushDrag ={ mode: 'move' | 'left' | 'right'; startX: number; startT0: number; startT1: number }
|
|
225
217
|
let brushDrag = $state<BrushDrag | null>(null)
|
|
226
218
|
function brushSvgX(e: PointerEvent, svg: SVGSVGElement): number {
|
|
227
219
|
const r = svg.getBoundingClientRect()
|
|
@@ -919,7 +911,7 @@
|
|
|
919
911
|
{#if isRadar && geo.radarCenter}
|
|
920
912
|
{@const c = geo.radarCenter}
|
|
921
913
|
<!-- Concentric grid rings -->
|
|
922
|
-
{#each geo.radarRings as
|
|
914
|
+
{#each geo.radarRings as _v, ri (ri)}
|
|
923
915
|
{@const ringR = c.r * ((ri + 1) / geo.radarRings.length)}
|
|
924
916
|
<circle class="sv-grid-chart-radar-ring" cx={c.cx} cy={c.cy} r={ringR} />
|
|
925
917
|
{/each}
|
package/src/SvGridSelect.svelte
CHANGED
package/src/SvKbd.svelte
CHANGED
package/src/SvList.svelte
CHANGED
package/src/SvMenubar.svelte
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
const resolvedDir = $derived(dir === 'ltr' || dir === 'rtl' ? dir : undefined)
|
|
42
42
|
const rtl = $derived(resolvedDir === 'rtl')
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
const triggerEls = $state<(HTMLButtonElement | null)[]>([])
|
|
45
45
|
let panelEl = $state<HTMLDivElement | null>(null)
|
|
46
46
|
let openIndex = $state(-1)
|
|
47
47
|
let activeIndex = $state(0)
|
package/src/SvMultiSelect.svelte
CHANGED
package/src/SvOtpInput.svelte
CHANGED
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
const autoId = nextEditorId('sv-otp')
|
|
53
53
|
const uid = $derived(id ?? autoId)
|
|
54
54
|
const cells = $derived(otpCells(sanitizeOtp(value, length, numeric), length))
|
|
55
|
-
|
|
55
|
+
const inputs = $state<HTMLInputElement[]>([])
|
|
56
56
|
|
|
57
57
|
function commit(next: string) {
|
|
58
58
|
const clean = sanitizeOtp(next, length, numeric)
|
package/src/SvRichText.svelte
CHANGED
|
@@ -90,6 +90,10 @@
|
|
|
90
90
|
// (writing innerHTML while focused would collapse the caret).
|
|
91
91
|
$effect(() => {
|
|
92
92
|
const v = value ?? ''
|
|
93
|
+
// A contenteditable owns its own DOM: letting Svelte re-render the body
|
|
94
|
+
// would wipe the caret mid-typing, so the value is pushed in by hand and
|
|
95
|
+
// only while the editor is unfocused.
|
|
96
|
+
// eslint-disable-next-line svelte/no-dom-manipulating
|
|
93
97
|
if (editorEl && !focused && editorEl.innerHTML !== v) editorEl.innerHTML = v
|
|
94
98
|
if (editorEl) empty = editorEl.textContent!.trim().length === 0
|
|
95
99
|
})
|
package/src/SvTour.svelte
CHANGED
|
@@ -156,6 +156,10 @@
|
|
|
156
156
|
>
|
|
157
157
|
{#if step.image}
|
|
158
158
|
<div class="sv-tour__media">
|
|
159
|
+
<!-- A step's `image` is either a URL (rendered as an img above) or
|
|
160
|
+
inline SVG markup the app author wrote for its own tour - never
|
|
161
|
+
user input, so rendering it as markup is the intent. -->
|
|
162
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
159
163
|
{#if /^(https?:|data:|\/)/.test(step.image)}<img class="sv-tour__img" src={step.image} alt="" />{:else}{@html step.image}{/if}
|
|
160
164
|
</div>
|
|
161
165
|
{/if}
|
package/src/SvTreeSelect.svelte
CHANGED
package/src/ai.test.ts
CHANGED
package/src/build-api.ts
CHANGED
|
@@ -2,52 +2,12 @@
|
|
|
2
2
|
// reading/writing controller state via the `ctx` handle; the reactive core
|
|
3
3
|
// ($state/$derived/$effect) stays in the controller.
|
|
4
4
|
import {
|
|
5
|
-
applyExcelFilter,
|
|
6
|
-
normalizeForFilter,
|
|
7
|
-
createColumnVirtualizer,
|
|
8
|
-
createCoreRowModel,
|
|
9
|
-
createExpandedRowModel,
|
|
10
|
-
createFilteredRowModel,
|
|
11
|
-
createGroupedRowModel,
|
|
12
|
-
createPaginatedRowModel,
|
|
13
|
-
createSvelteVirtualizer,
|
|
14
|
-
createSortedRowModel,
|
|
15
|
-
createSvGrid,
|
|
16
|
-
filterFns,
|
|
17
|
-
getGridCellA11yProps,
|
|
18
|
-
getGridCellDomId,
|
|
19
|
-
getGridHeaderA11yProps,
|
|
20
|
-
getGridRootA11yProps,
|
|
21
|
-
getGridRowA11yProps,
|
|
22
|
-
parseEditorValue,
|
|
23
|
-
normalizeEditorOptions,
|
|
24
|
-
sortFns,
|
|
25
|
-
tableFeatures,
|
|
26
|
-
rowSortingFeature,
|
|
27
|
-
columnFilteringFeature,
|
|
28
|
-
columnGroupingFeature,
|
|
29
|
-
type CellContext,
|
|
30
|
-
type EditorContext,
|
|
31
|
-
type CellEditorOption,
|
|
32
|
-
type CellEditorType,
|
|
33
|
-
type CellFormatter,
|
|
34
|
-
type CellFormatConfig,
|
|
35
|
-
type Column,
|
|
36
|
-
type ColumnDef,
|
|
37
|
-
type Row,
|
|
38
5
|
type RowData,
|
|
39
6
|
type SvGridApi,
|
|
40
7
|
type TableFeatures,
|
|
41
8
|
} from "./index";
|
|
42
9
|
import "./sv-grid-scrollbar";
|
|
43
10
|
import { untrack } from "svelte";
|
|
44
|
-
import type { Snippet } from "svelte";
|
|
45
|
-
import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
|
|
46
|
-
import {
|
|
47
|
-
formatNumericWithConfig,
|
|
48
|
-
getDateFormatter,
|
|
49
|
-
resolveDatePattern,
|
|
50
|
-
} from "./cell-formatting";
|
|
51
11
|
// The export serializers load lazily (their own chunk) so export-format.ts stays
|
|
52
12
|
// out of the base bundle - it is fetched only when an export/copy method is
|
|
53
13
|
// actually invoked (an explicit, already-async user action).
|
|
@@ -57,77 +17,12 @@ import type {
|
|
|
57
17
|
GridExportOptions,
|
|
58
18
|
GridClipboardOptions,
|
|
59
19
|
} from "./export-format";
|
|
60
|
-
import {
|
|
61
|
-
RenderSnippetConfig,
|
|
62
|
-
RenderComponentConfig,
|
|
63
|
-
} from "./render-component";
|
|
64
|
-
import { buildFillPattern } from "./fill-patterns";
|
|
65
|
-
import { buildSparkline, toSparklineValues } from "./sparkline";
|
|
66
|
-
import {
|
|
67
|
-
resolveCellFormat,
|
|
68
|
-
computeColumnStat,
|
|
69
|
-
formatsNeedingStats,
|
|
70
|
-
type ColumnStat,
|
|
71
|
-
type ResolvedCellFormat,
|
|
72
|
-
} from "./conditional-formatting";
|
|
73
|
-
import SvGridDropdown from "./SvGridDropdown.svelte";
|
|
74
20
|
import type {
|
|
75
|
-
Props,
|
|
76
|
-
SelectionPoint,
|
|
77
|
-
SelectionRange,
|
|
78
|
-
CellEditState,
|
|
79
21
|
FilterOperator,
|
|
80
|
-
FilterOption,
|
|
81
|
-
MenuPosition,
|
|
82
22
|
} from "./SvGrid.types";
|
|
83
23
|
import {
|
|
84
|
-
cfTextStyle,
|
|
85
|
-
fmtStat,
|
|
86
|
-
getCellKey,
|
|
87
|
-
resolveClassList,
|
|
88
|
-
toDateInputValue,
|
|
89
|
-
toDateTimeLocalInputValue,
|
|
90
|
-
getEditableInputValue,
|
|
91
|
-
getEditorInputType,
|
|
92
|
-
toValueArray,
|
|
93
|
-
getOptionLabel,
|
|
94
|
-
getOptionColor,
|
|
95
|
-
colorfulChipStyle,
|
|
96
|
-
getEditorClass,
|
|
97
|
-
asDate,
|
|
98
|
-
clampMenuX,
|
|
99
|
-
cssEscape,
|
|
100
|
-
rawToNumber,
|
|
101
|
-
formatFacetNumber,
|
|
102
|
-
formatFacetDate,
|
|
103
|
-
} from "./SvGrid.helpers";
|
|
104
|
-
import { createClipboard } from "./clipboard";
|
|
105
|
-
import {
|
|
106
|
-
filterOperatorOptions,
|
|
107
|
-
fallbackOperatorOption,
|
|
108
|
-
TEXT_OPERATORS,
|
|
109
|
-
NUMBER_OPERATORS,
|
|
110
|
-
DATE_OPERATORS,
|
|
111
|
-
CHECKBOX_OPERATORS,
|
|
112
|
-
operatorOption,
|
|
113
|
-
operatorsForColumn,
|
|
114
|
-
defaultOperatorFor,
|
|
115
|
-
operatorLabelFor,
|
|
116
|
-
} from "./filter-operators";
|
|
117
|
-
import {
|
|
118
|
-
type FacetBucket,
|
|
119
|
-
isBucketableColumn,
|
|
120
|
-
buildBuckets,
|
|
121
|
-
isInBucket,
|
|
122
|
-
} from "./facet-buckets";
|
|
123
|
-
import {
|
|
124
|
-
getColumnBaseValue,
|
|
125
24
|
isGroupRow,
|
|
126
|
-
toolPanelHeaderLabel,
|
|
127
|
-
formatSummaryNumeric,
|
|
128
25
|
getColumnAlign,
|
|
129
|
-
getPinnedCellValue,
|
|
130
|
-
getColumnAccessorValue,
|
|
131
26
|
columnDefMatchesId,
|
|
132
27
|
} from "./cell-values";
|
|
133
28
|
|
|
@@ -158,7 +158,7 @@ describe('getDateFormatter', () => {
|
|
|
158
158
|
|
|
159
159
|
describe('formatNumericWithConfig - number', () => {
|
|
160
160
|
it('formats a basic integer with default locale', () => {
|
|
161
|
-
expect(formatNumericWithConfig(1234, { type: 'number' })).toMatch(/1[
|
|
161
|
+
expect(formatNumericWithConfig(1234, { type: 'number' })).toMatch(/1[.,]?234/)
|
|
162
162
|
})
|
|
163
163
|
|
|
164
164
|
it('respects locale grouping and decimal separators', () => {
|
package/src/cell-render.ts
CHANGED
|
@@ -2,127 +2,33 @@
|
|
|
2
2
|
// reading/writing controller state via the `ctx` handle; the reactive core
|
|
3
3
|
// ($state/$derived/$effect) stays in the controller.
|
|
4
4
|
import {
|
|
5
|
-
applyExcelFilter,
|
|
6
|
-
normalizeForFilter,
|
|
7
|
-
createColumnVirtualizer,
|
|
8
|
-
createCoreRowModel,
|
|
9
|
-
createExpandedRowModel,
|
|
10
|
-
createFilteredRowModel,
|
|
11
|
-
createGroupedRowModel,
|
|
12
|
-
createPaginatedRowModel,
|
|
13
|
-
createSvelteVirtualizer,
|
|
14
|
-
createSortedRowModel,
|
|
15
|
-
createSvGrid,
|
|
16
|
-
filterFns,
|
|
17
|
-
getGridCellA11yProps,
|
|
18
|
-
getGridCellDomId,
|
|
19
|
-
getGridHeaderA11yProps,
|
|
20
|
-
getGridRootA11yProps,
|
|
21
|
-
getGridRowA11yProps,
|
|
22
|
-
parseEditorValue,
|
|
23
5
|
normalizeEditorOptions,
|
|
24
|
-
sortFns,
|
|
25
|
-
tableFeatures,
|
|
26
|
-
rowSortingFeature,
|
|
27
|
-
columnFilteringFeature,
|
|
28
|
-
columnGroupingFeature,
|
|
29
|
-
type CellContext,
|
|
30
|
-
type EditorContext,
|
|
31
6
|
type CellEditorOption,
|
|
32
|
-
type CellEditorType,
|
|
33
7
|
type CellFormatter,
|
|
34
8
|
type CellFormatConfig,
|
|
35
9
|
type Column,
|
|
36
|
-
type ColumnDef,
|
|
37
10
|
type Row,
|
|
38
11
|
type RowData,
|
|
39
|
-
type SvGridApi,
|
|
40
12
|
type TableFeatures,
|
|
41
13
|
} from "./index";
|
|
42
14
|
import "./sv-grid-scrollbar";
|
|
43
|
-
import type { Snippet } from "svelte";
|
|
44
|
-
import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
|
|
45
15
|
import {
|
|
46
16
|
formatNumericWithConfig,
|
|
47
17
|
getDateFormatter,
|
|
48
18
|
resolveDatePattern,
|
|
49
19
|
} from "./cell-formatting";
|
|
50
|
-
import {
|
|
51
|
-
RenderSnippetConfig,
|
|
52
|
-
RenderComponentConfig,
|
|
53
|
-
} from "./render-component";
|
|
54
|
-
import { buildFillPattern } from "./fill-patterns";
|
|
55
|
-
import { buildSparkline, toSparklineValues } from "./sparkline";
|
|
56
20
|
import {
|
|
57
21
|
resolveCellFormat,
|
|
58
|
-
computeColumnStat,
|
|
59
|
-
formatsNeedingStats,
|
|
60
|
-
type ColumnStat,
|
|
61
22
|
type ResolvedCellFormat,
|
|
62
23
|
} from "./conditional-formatting";
|
|
63
|
-
import SvGridDropdown from "./SvGridDropdown.svelte";
|
|
64
|
-
import type {
|
|
65
|
-
Props,
|
|
66
|
-
SelectionPoint,
|
|
67
|
-
SelectionRange,
|
|
68
|
-
CellEditState,
|
|
69
|
-
FilterOperator,
|
|
70
|
-
FilterOption,
|
|
71
|
-
MenuPosition,
|
|
72
|
-
} from "./SvGrid.types";
|
|
73
24
|
import {
|
|
74
|
-
cfTextStyle,
|
|
75
|
-
fmtStat,
|
|
76
25
|
getCellKey,
|
|
77
26
|
resolveClassList,
|
|
78
|
-
toDateInputValue,
|
|
79
|
-
toDateTimeLocalInputValue,
|
|
80
|
-
getEditableInputValue,
|
|
81
|
-
getEditorInputType,
|
|
82
|
-
toValueArray,
|
|
83
27
|
getOptionLabel,
|
|
84
|
-
getOptionColor,
|
|
85
|
-
colorfulChipStyle,
|
|
86
|
-
getEditorClass,
|
|
87
28
|
asDate,
|
|
88
|
-
clampMenuX,
|
|
89
|
-
cssEscape,
|
|
90
|
-
rawToNumber,
|
|
91
|
-
formatFacetNumber,
|
|
92
|
-
formatFacetDate,
|
|
93
29
|
} from "./SvGrid.helpers";
|
|
94
|
-
import { createEditing } from "./editing";
|
|
95
|
-
import { createSelection } from "./selection";
|
|
96
|
-
import { createColumns } from "./columns";
|
|
97
|
-
import { createGridApi } from "./build-api";
|
|
98
|
-
import { createClipboard } from "./clipboard";
|
|
99
|
-
import {
|
|
100
|
-
filterOperatorOptions,
|
|
101
|
-
fallbackOperatorOption,
|
|
102
|
-
TEXT_OPERATORS,
|
|
103
|
-
NUMBER_OPERATORS,
|
|
104
|
-
DATE_OPERATORS,
|
|
105
|
-
CHECKBOX_OPERATORS,
|
|
106
|
-
operatorOption,
|
|
107
|
-
operatorsForColumn,
|
|
108
|
-
defaultOperatorFor,
|
|
109
|
-
operatorLabelFor,
|
|
110
|
-
} from "./filter-operators";
|
|
111
|
-
import {
|
|
112
|
-
type FacetBucket,
|
|
113
|
-
isBucketableColumn,
|
|
114
|
-
buildBuckets,
|
|
115
|
-
isInBucket,
|
|
116
|
-
} from "./facet-buckets";
|
|
117
30
|
import {
|
|
118
|
-
getColumnBaseValue,
|
|
119
|
-
isGroupRow,
|
|
120
|
-
toolPanelHeaderLabel,
|
|
121
|
-
formatSummaryNumeric,
|
|
122
|
-
getColumnAlign,
|
|
123
31
|
getPinnedCellValue,
|
|
124
|
-
getColumnAccessorValue,
|
|
125
|
-
columnDefMatchesId,
|
|
126
32
|
} from "./cell-values";
|
|
127
33
|
|
|
128
34
|
export function createCellRender<
|
package/src/chart.ts
CHANGED
|
@@ -38,7 +38,6 @@ export type SeriesOverlay = 'linear' | `sma:${number}` | `ema:${number}`
|
|
|
38
38
|
export type SeriesPattern = 'solid' | 'stripe' | 'crosshatch' | 'dots' | 'diagonal'
|
|
39
39
|
/** Cycle used when `ChartSpec.patternFallback` is true and a series has no
|
|
40
40
|
* explicit `pattern` set. Skips `'solid'` so every series gets a texture. */
|
|
41
|
-
const PATTERN_CYCLE: SeriesPattern[] = ['stripe', 'crosshatch', 'dots', 'diagonal']
|
|
42
41
|
|
|
43
42
|
export type ChartSeries = {
|
|
44
43
|
label: string
|
|
@@ -2254,7 +2253,7 @@ export function rowsToChartSpec<T extends Record<string, unknown>>(
|
|
|
2254
2253
|
entries.reduce((sum, e) => sum + (Number.isFinite(e.values[i]!) ? e.values[i]! : 0), 0),
|
|
2255
2254
|
)
|
|
2256
2255
|
const sort = opts.sort ?? (opts.topN ? 'value-desc' : 'none')
|
|
2257
|
-
|
|
2256
|
+
const order = categories.map((_, i) => i)
|
|
2258
2257
|
if (sort === 'value-desc') order.sort((a, b) => totals[b]! - totals[a]!)
|
|
2259
2258
|
else if (sort === 'value-asc') order.sort((a, b) => totals[a]! - totals[b]!)
|
|
2260
2259
|
else if (sort === 'category') order.sort((a, b) => categories[a]!.localeCompare(categories[b]!))
|
package/src/clipboard.ts
CHANGED
|
@@ -2,122 +2,20 @@
|
|
|
2
2
|
// that read/write controller state via the `ctx` handle; the reactive core
|
|
3
3
|
// ($state/$derived/$effect) stays in the controller.
|
|
4
4
|
import {
|
|
5
|
-
applyExcelFilter,
|
|
6
|
-
normalizeForFilter,
|
|
7
|
-
createColumnVirtualizer,
|
|
8
|
-
createCoreRowModel,
|
|
9
|
-
createExpandedRowModel,
|
|
10
|
-
createFilteredRowModel,
|
|
11
|
-
createGroupedRowModel,
|
|
12
|
-
createPaginatedRowModel,
|
|
13
|
-
createSvelteVirtualizer,
|
|
14
|
-
createSortedRowModel,
|
|
15
|
-
createSvGrid,
|
|
16
|
-
filterFns,
|
|
17
|
-
getGridCellA11yProps,
|
|
18
|
-
getGridCellDomId,
|
|
19
|
-
getGridHeaderA11yProps,
|
|
20
|
-
getGridRootA11yProps,
|
|
21
|
-
getGridRowA11yProps,
|
|
22
5
|
parseEditorValue,
|
|
23
|
-
normalizeEditorOptions,
|
|
24
|
-
sortFns,
|
|
25
|
-
tableFeatures,
|
|
26
|
-
rowSortingFeature,
|
|
27
|
-
columnFilteringFeature,
|
|
28
|
-
columnGroupingFeature,
|
|
29
|
-
type CellContext,
|
|
30
|
-
type EditorContext,
|
|
31
|
-
type CellEditorOption,
|
|
32
6
|
type CellEditorType,
|
|
33
|
-
type CellFormatter,
|
|
34
|
-
type CellFormatConfig,
|
|
35
|
-
type Column,
|
|
36
|
-
type ColumnDef,
|
|
37
|
-
type Row,
|
|
38
7
|
type RowData,
|
|
39
|
-
type SvGridApi,
|
|
40
8
|
type TableFeatures,
|
|
41
9
|
} from "./index";
|
|
42
10
|
import "./sv-grid-scrollbar";
|
|
43
|
-
import type { Snippet } from "svelte";
|
|
44
|
-
import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
|
|
45
|
-
import {
|
|
46
|
-
formatNumericWithConfig,
|
|
47
|
-
getDateFormatter,
|
|
48
|
-
resolveDatePattern,
|
|
49
|
-
} from "./cell-formatting";
|
|
50
|
-
import {
|
|
51
|
-
RenderSnippetConfig,
|
|
52
|
-
RenderComponentConfig,
|
|
53
|
-
} from "./render-component";
|
|
54
11
|
import { buildFillPattern } from "./fill-patterns";
|
|
55
|
-
import { buildSparkline, toSparklineValues } from "./sparkline";
|
|
56
|
-
import {
|
|
57
|
-
resolveCellFormat,
|
|
58
|
-
computeColumnStat,
|
|
59
|
-
formatsNeedingStats,
|
|
60
|
-
type ColumnStat,
|
|
61
|
-
type ResolvedCellFormat,
|
|
62
|
-
} from "./conditional-formatting";
|
|
63
|
-
import SvGridDropdown from "./SvGridDropdown.svelte";
|
|
64
|
-
import type {
|
|
65
|
-
Props,
|
|
66
|
-
SelectionPoint,
|
|
67
|
-
SelectionRange,
|
|
68
|
-
CellEditState,
|
|
69
|
-
FilterOperator,
|
|
70
|
-
FilterOption,
|
|
71
|
-
MenuPosition,
|
|
72
|
-
} from "./SvGrid.types";
|
|
73
12
|
import {
|
|
74
|
-
cfTextStyle,
|
|
75
|
-
fmtStat,
|
|
76
13
|
getCellKey,
|
|
77
|
-
resolveClassList,
|
|
78
|
-
toDateInputValue,
|
|
79
|
-
toDateTimeLocalInputValue,
|
|
80
|
-
getEditableInputValue,
|
|
81
|
-
getEditorInputType,
|
|
82
|
-
toValueArray,
|
|
83
|
-
getOptionLabel,
|
|
84
|
-
getOptionColor,
|
|
85
|
-
colorfulChipStyle,
|
|
86
|
-
getEditorClass,
|
|
87
|
-
asDate,
|
|
88
|
-
clampMenuX,
|
|
89
|
-
cssEscape,
|
|
90
|
-
rawToNumber,
|
|
91
|
-
formatFacetNumber,
|
|
92
|
-
formatFacetDate,
|
|
93
14
|
} from "./SvGrid.helpers";
|
|
94
|
-
import {
|
|
95
|
-
filterOperatorOptions,
|
|
96
|
-
fallbackOperatorOption,
|
|
97
|
-
TEXT_OPERATORS,
|
|
98
|
-
NUMBER_OPERATORS,
|
|
99
|
-
DATE_OPERATORS,
|
|
100
|
-
CHECKBOX_OPERATORS,
|
|
101
|
-
operatorOption,
|
|
102
|
-
operatorsForColumn,
|
|
103
|
-
defaultOperatorFor,
|
|
104
|
-
operatorLabelFor,
|
|
105
|
-
} from "./filter-operators";
|
|
106
|
-
import {
|
|
107
|
-
type FacetBucket,
|
|
108
|
-
isBucketableColumn,
|
|
109
|
-
buildBuckets,
|
|
110
|
-
isInBucket,
|
|
111
|
-
} from "./facet-buckets";
|
|
112
15
|
import {
|
|
113
16
|
getColumnBaseValue,
|
|
114
17
|
isGroupRow,
|
|
115
18
|
toolPanelHeaderLabel,
|
|
116
|
-
formatSummaryNumeric,
|
|
117
|
-
getColumnAlign,
|
|
118
|
-
getPinnedCellValue,
|
|
119
|
-
getColumnAccessorValue,
|
|
120
|
-
columnDefMatchesId,
|
|
121
19
|
} from "./cell-values";
|
|
122
20
|
|
|
123
21
|
export function createClipboard<
|
package/src/columns.ts
CHANGED
|
@@ -2,125 +2,10 @@
|
|
|
2
2
|
// reading/writing controller state via the `ctx` handle; the reactive core
|
|
3
3
|
// ($state/$derived/$effect) stays in the controller.
|
|
4
4
|
import {
|
|
5
|
-
applyExcelFilter,
|
|
6
|
-
normalizeForFilter,
|
|
7
|
-
createColumnVirtualizer,
|
|
8
|
-
createCoreRowModel,
|
|
9
|
-
createExpandedRowModel,
|
|
10
|
-
createFilteredRowModel,
|
|
11
|
-
createGroupedRowModel,
|
|
12
|
-
createPaginatedRowModel,
|
|
13
|
-
createSvelteVirtualizer,
|
|
14
|
-
createSortedRowModel,
|
|
15
|
-
createSvGrid,
|
|
16
|
-
filterFns,
|
|
17
|
-
getGridCellA11yProps,
|
|
18
|
-
getGridCellDomId,
|
|
19
|
-
getGridHeaderA11yProps,
|
|
20
|
-
getGridRootA11yProps,
|
|
21
|
-
getGridRowA11yProps,
|
|
22
|
-
parseEditorValue,
|
|
23
|
-
normalizeEditorOptions,
|
|
24
|
-
sortFns,
|
|
25
|
-
tableFeatures,
|
|
26
|
-
rowSortingFeature,
|
|
27
|
-
columnFilteringFeature,
|
|
28
|
-
columnGroupingFeature,
|
|
29
|
-
type CellContext,
|
|
30
|
-
type EditorContext,
|
|
31
|
-
type CellEditorOption,
|
|
32
|
-
type CellEditorType,
|
|
33
|
-
type CellFormatter,
|
|
34
|
-
type CellFormatConfig,
|
|
35
|
-
type Column,
|
|
36
|
-
type ColumnDef,
|
|
37
|
-
type Row,
|
|
38
5
|
type RowData,
|
|
39
|
-
type SvGridApi,
|
|
40
6
|
type TableFeatures,
|
|
41
7
|
} from "./index";
|
|
42
8
|
import "./sv-grid-scrollbar";
|
|
43
|
-
import type { Snippet } from "svelte";
|
|
44
|
-
import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
|
|
45
|
-
import {
|
|
46
|
-
formatNumericWithConfig,
|
|
47
|
-
getDateFormatter,
|
|
48
|
-
resolveDatePattern,
|
|
49
|
-
} from "./cell-formatting";
|
|
50
|
-
import {
|
|
51
|
-
RenderSnippetConfig,
|
|
52
|
-
RenderComponentConfig,
|
|
53
|
-
} from "./render-component";
|
|
54
|
-
import { buildFillPattern } from "./fill-patterns";
|
|
55
|
-
import { buildSparkline, toSparklineValues } from "./sparkline";
|
|
56
|
-
import {
|
|
57
|
-
resolveCellFormat,
|
|
58
|
-
computeColumnStat,
|
|
59
|
-
formatsNeedingStats,
|
|
60
|
-
type ColumnStat,
|
|
61
|
-
type ResolvedCellFormat,
|
|
62
|
-
} from "./conditional-formatting";
|
|
63
|
-
import SvGridDropdown from "./SvGridDropdown.svelte";
|
|
64
|
-
import type {
|
|
65
|
-
Props,
|
|
66
|
-
SelectionPoint,
|
|
67
|
-
SelectionRange,
|
|
68
|
-
CellEditState,
|
|
69
|
-
FilterOperator,
|
|
70
|
-
FilterOption,
|
|
71
|
-
MenuPosition,
|
|
72
|
-
} from "./SvGrid.types";
|
|
73
|
-
import {
|
|
74
|
-
cfTextStyle,
|
|
75
|
-
fmtStat,
|
|
76
|
-
getCellKey,
|
|
77
|
-
resolveClassList,
|
|
78
|
-
toDateInputValue,
|
|
79
|
-
toDateTimeLocalInputValue,
|
|
80
|
-
getEditableInputValue,
|
|
81
|
-
getEditorInputType,
|
|
82
|
-
toValueArray,
|
|
83
|
-
getOptionLabel,
|
|
84
|
-
getOptionColor,
|
|
85
|
-
colorfulChipStyle,
|
|
86
|
-
getEditorClass,
|
|
87
|
-
asDate,
|
|
88
|
-
clampMenuX,
|
|
89
|
-
cssEscape,
|
|
90
|
-
rawToNumber,
|
|
91
|
-
formatFacetNumber,
|
|
92
|
-
formatFacetDate,
|
|
93
|
-
} from "./SvGrid.helpers";
|
|
94
|
-
import { createGridApi } from "./build-api";
|
|
95
|
-
import { createClipboard } from "./clipboard";
|
|
96
|
-
import {
|
|
97
|
-
filterOperatorOptions,
|
|
98
|
-
fallbackOperatorOption,
|
|
99
|
-
TEXT_OPERATORS,
|
|
100
|
-
NUMBER_OPERATORS,
|
|
101
|
-
DATE_OPERATORS,
|
|
102
|
-
CHECKBOX_OPERATORS,
|
|
103
|
-
operatorOption,
|
|
104
|
-
operatorsForColumn,
|
|
105
|
-
defaultOperatorFor,
|
|
106
|
-
operatorLabelFor,
|
|
107
|
-
} from "./filter-operators";
|
|
108
|
-
import {
|
|
109
|
-
type FacetBucket,
|
|
110
|
-
isBucketableColumn,
|
|
111
|
-
buildBuckets,
|
|
112
|
-
isInBucket,
|
|
113
|
-
} from "./facet-buckets";
|
|
114
|
-
import {
|
|
115
|
-
getColumnBaseValue,
|
|
116
|
-
isGroupRow,
|
|
117
|
-
toolPanelHeaderLabel,
|
|
118
|
-
formatSummaryNumeric,
|
|
119
|
-
getColumnAlign,
|
|
120
|
-
getPinnedCellValue,
|
|
121
|
-
getColumnAccessorValue,
|
|
122
|
-
columnDefMatchesId,
|
|
123
|
-
} from "./cell-values";
|
|
124
9
|
|
|
125
10
|
export function createColumns<
|
|
126
11
|
TFeatures extends TableFeatures = TableFeatures,
|