@svgrid/grid 2.2.32 → 2.2.34
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 +46 -47
- package/dist/GridMenus.svelte +0 -77
- package/dist/SvDateRangeInput.svelte +1 -1
- package/dist/SvGrid.css +10 -0
- 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-Cyk3qpJ7.js → GridMenus-T-bZNprc.js} +153 -152
- package/dist/cdn/{GridMenus-C6ixSGWW.js → GridMenus-oQYElQll.js} +5 -7
- package/dist/cdn/{SvDateTimePicker-ClqtVIj3.js → SvDateTimePicker-CHnUkWcH.js} +163 -163
- package/dist/cdn/{SvDateTimePicker-CdqaP61H.js → SvDateTimePicker-CRQH_U7E.js} +570 -553
- package/dist/cdn/{SvGridChart-BhnFdLd0.js → SvGridChart-BEJmNNx9.js} +1 -1
- package/dist/cdn/{SvGridChart-BcLCYvw9.js → SvGridChart-BwVos976.js} +27 -20
- package/dist/cdn/{SvGridChartPanel-Cmx9DHAS.js → SvGridChartPanel-BOknOkrP.js} +2 -2
- package/dist/cdn/{SvGridChartPanel-DvjwxLvK.js → SvGridChartPanel-D2PjII4O.js} +22 -14
- package/dist/cdn/{SvGridChartView-PwqI4s02.js → SvGridChartView-00LPUHL1.js} +3 -3
- package/dist/cdn/{SvGridChartView-B40DTJSX.js → SvGridChartView-BhUEJ5ki.js} +2 -2
- package/dist/cdn/{SvGridDropdown-Dh-2ej8j.js → SvGridDropdown-D13MtJ2j.js} +5 -4
- package/dist/cdn/{chart-T1usDN0o.js → chart-i4XcXyHJ.js} +12 -10
- package/dist/cdn/disclose-version-Dr7rEVv-.js +2866 -0
- package/dist/cdn/{export-format-JT5pWVT8.js → export-format-Cv1Dll6k.js} +66 -245
- package/dist/cdn/{src-BgHjWF0Q.js → src-72QTH8lh.js} +9006 -8811
- package/dist/cdn/{src-CgD-wiuS.js → src-Cm7C_WOZ.js} +9206 -8927
- package/dist/cdn/svgrid.js +9 -9
- package/dist/cdn/svgrid.svelte-external.js +8 -8
- package/dist/chart.d.ts +2 -0
- package/dist/chart.js +1 -4
- package/dist/columns.js +9 -2
- 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 +46 -47
- 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.css +10 -0
- 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 +7 -117
- 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/svgrid.footer-pagesize.svelte.test.ts +86 -0
- package/src/tree-row-model.test.ts +0 -1
- package/dist/cdn/disclose-version-DoD9AFD_.js +0 -2958
package/src/GridMenus.svelte
CHANGED
|
@@ -1,97 +1,21 @@
|
|
|
1
1
|
<script lang="ts" generics="TFeatures extends TableFeatures = TableFeatures, TData extends RowData = RowData">
|
|
2
2
|
import {
|
|
3
|
-
applyExcelFilter,
|
|
4
|
-
normalizeForFilter,
|
|
5
3
|
splitInTokens,
|
|
6
4
|
trailingInToken,
|
|
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
5
|
type CellEditorType,
|
|
33
|
-
type CellFormatter,
|
|
34
|
-
type CellFormatConfig,
|
|
35
6
|
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
11
|
import { onScrollOutside } from "./a11y/dismissable";
|
|
44
12
|
import type { Snippet } from "svelte";
|
|
45
|
-
import { getKeyboardIntent, getNextActiveCell } from "./keyboard";
|
|
46
|
-
import {
|
|
47
|
-
formatNumericWithConfig,
|
|
48
|
-
getDateFormatter,
|
|
49
|
-
resolveDatePattern,
|
|
50
|
-
} from "./cell-formatting";
|
|
51
|
-
import {
|
|
52
|
-
RenderSnippetConfig,
|
|
53
|
-
RenderComponentConfig,
|
|
54
|
-
} from "./render-component";
|
|
55
|
-
import { buildFillPattern } from "./fill-patterns";
|
|
56
|
-
import { buildSparkline, toSparklineValues } from "./sparkline";
|
|
57
|
-
import {
|
|
58
|
-
resolveCellFormat,
|
|
59
|
-
computeColumnStat,
|
|
60
|
-
formatsNeedingStats,
|
|
61
|
-
type ColumnStat,
|
|
62
|
-
type ResolvedCellFormat,
|
|
63
|
-
} from "./conditional-formatting";
|
|
64
|
-
import SvGridDropdown from "./SvGridDropdown.svelte";
|
|
65
13
|
import SvListBox from "./SvListBox.svelte";
|
|
66
14
|
import type {
|
|
67
|
-
Props,
|
|
68
|
-
SelectionPoint,
|
|
69
|
-
SelectionRange,
|
|
70
|
-
CellEditState,
|
|
71
15
|
FilterOperator,
|
|
72
|
-
FilterOption,
|
|
73
|
-
MenuPosition,
|
|
74
16
|
} from "./SvGrid.types";
|
|
75
17
|
import {
|
|
76
|
-
cfTextStyle,
|
|
77
|
-
fmtStat,
|
|
78
|
-
getCellKey,
|
|
79
|
-
resolveClassList,
|
|
80
|
-
toDateInputValue,
|
|
81
|
-
toDateTimeLocalInputValue,
|
|
82
|
-
getEditableInputValue,
|
|
83
18
|
getEditorInputType,
|
|
84
|
-
toValueArray,
|
|
85
|
-
getOptionLabel,
|
|
86
|
-
getOptionColor,
|
|
87
|
-
colorfulChipStyle,
|
|
88
|
-
getEditorClass,
|
|
89
|
-
asDate,
|
|
90
|
-
clampMenuX,
|
|
91
|
-
cssEscape,
|
|
92
|
-
rawToNumber,
|
|
93
|
-
formatFacetNumber,
|
|
94
|
-
formatFacetDate,
|
|
95
19
|
} from "./SvGrid.helpers";
|
|
96
20
|
|
|
97
21
|
import type { SvGridController } from "./SvGrid.controller.svelte";
|
|
@@ -103,7 +27,6 @@
|
|
|
103
27
|
const groupingControlsEnabled = $derived(ctrl.groupingControlsEnabled);
|
|
104
28
|
const filterMenuValues = $derived(ctrl.filterMenuValues);
|
|
105
29
|
const tooltip = $derived(ctrl.tooltip);
|
|
106
|
-
const showTooltipFor = $derived(ctrl.showTooltipFor);
|
|
107
30
|
const columnMenuFor = $derived(ctrl.columnMenuFor);
|
|
108
31
|
const columnMenuPos = $derived(ctrl.columnMenuPos);
|
|
109
32
|
const filterMenuFor = $derived(ctrl.filterMenuFor);
|
package/src/SvCalendar.test.ts
CHANGED
|
@@ -86,7 +86,7 @@ describe('SvCalendar selection', () => {
|
|
|
86
86
|
|
|
87
87
|
it('range mode: two clicks emit the inclusive span', () => {
|
|
88
88
|
let got: Date[] = []
|
|
89
|
-
const {
|
|
89
|
+
const { destroy } = mountCal({
|
|
90
90
|
value: null,
|
|
91
91
|
selectionMode: 'range',
|
|
92
92
|
displayMode: 'month',
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import { anchoredRect, portalToBody, popIn, type AnchoredRect } from './popover'
|
|
21
21
|
import { editorAria, nextEditorId, resolveMessages, type SvEditorProps } from './editor-contract'
|
|
22
22
|
import { formatDate } from './datetime/date-format'
|
|
23
|
-
import {
|
|
23
|
+
import { startOfDay, type DateLike } from './datetime/date-core'
|
|
24
24
|
import { rangeDays } from './datetime/date-selection'
|
|
25
25
|
import type { CalendarPreset } from './createCalendar.svelte'
|
|
26
26
|
|
|
@@ -13,10 +13,6 @@ import {
|
|
|
13
13
|
createSvGrid,
|
|
14
14
|
getGridCellDomId,
|
|
15
15
|
sortFns,
|
|
16
|
-
tableFeatures,
|
|
17
|
-
rowSortingFeature,
|
|
18
|
-
columnFilteringFeature,
|
|
19
|
-
columnGroupingFeature,
|
|
20
16
|
type CellEditorOption,
|
|
21
17
|
type Column,
|
|
22
18
|
type ColumnDef,
|
|
@@ -38,7 +34,6 @@ import {
|
|
|
38
34
|
formatNeedsStats,
|
|
39
35
|
type ColumnStat,
|
|
40
36
|
} from "./conditional-formatting";
|
|
41
|
-
import SvGridDropdown from "./SvGridDropdown.svelte";
|
|
42
37
|
import type {
|
|
43
38
|
Props,
|
|
44
39
|
SelectionRange,
|
package/src/SvGrid.css
CHANGED
|
@@ -1012,6 +1012,11 @@
|
|
|
1012
1012
|
width: 16px;
|
|
1013
1013
|
height: 16px;
|
|
1014
1014
|
margin: 0 auto;
|
|
1015
|
+
/* The UA stylesheet gives <button> "padding: 1px 6px" on top of
|
|
1016
|
+
"box-sizing: border-box", which leaves 2px of content width inside the
|
|
1017
|
+
16px box. The glyphs below then shrink to a sliver, and the tick renders
|
|
1018
|
+
as a bare slanted line. Guarded by tests/e2e/selection-checkbox.spec.ts. */
|
|
1019
|
+
padding: 0;
|
|
1015
1020
|
border: 1px solid var(--sg-input-border, #8794a8);
|
|
1016
1021
|
border-radius: 4px;
|
|
1017
1022
|
background: var(--sg-input-bg, #fff);
|
|
@@ -1089,6 +1094,7 @@ select.sv-grid-fr-editor {
|
|
|
1089
1094
|
|
|
1090
1095
|
.sv-grid-checkbox[aria-checked="true"]::after {
|
|
1091
1096
|
content: "";
|
|
1097
|
+
flex: none;
|
|
1092
1098
|
width: 5px;
|
|
1093
1099
|
height: 9px;
|
|
1094
1100
|
border-right: 2px solid currentColor;
|
|
@@ -1098,6 +1104,7 @@ select.sv-grid-fr-editor {
|
|
|
1098
1104
|
|
|
1099
1105
|
.sv-grid-checkbox[aria-checked="mixed"]::after {
|
|
1100
1106
|
content: "";
|
|
1107
|
+
flex: none;
|
|
1101
1108
|
width: 8px;
|
|
1102
1109
|
height: 2px;
|
|
1103
1110
|
border-radius: 1px;
|
|
@@ -2391,6 +2398,9 @@ select.sv-grid-fr-editor {
|
|
|
2391
2398
|
.sv-grid-find-step, .sv-grid-find-close {
|
|
2392
2399
|
display: inline-flex; align-items: center; justify-content: center;
|
|
2393
2400
|
width: 22px; height: 22px;
|
|
2401
|
+
/* Same fixed-box + UA <button> padding trap as .sv-grid-checkbox: without
|
|
2402
|
+
this reset the 6px side padding squeezes the icon inside the 22px box. */
|
|
2403
|
+
padding: 0;
|
|
2394
2404
|
background: transparent;
|
|
2395
2405
|
border: 0;
|
|
2396
2406
|
color: var(--sg-muted, #64748b);
|
package/src/SvGrid.svelte
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
} from "./index";
|
|
18
18
|
import "./sv-grid-scrollbar";
|
|
19
19
|
import "./SvGrid.css";
|
|
20
|
-
import type { Snippet } from "svelte";
|
|
21
20
|
import {
|
|
22
21
|
RenderSnippetConfig,
|
|
23
22
|
RenderComponentConfig,
|
|
@@ -36,16 +35,10 @@
|
|
|
36
35
|
import { timeStringToDate, dateToTimeString } from "./SvGrid.helpers";
|
|
37
36
|
import type {
|
|
38
37
|
Props,
|
|
39
|
-
SelectionPoint,
|
|
40
|
-
SelectionRange,
|
|
41
|
-
CellEditState,
|
|
42
38
|
FilterOperator,
|
|
43
|
-
FilterOption,
|
|
44
|
-
MenuPosition,
|
|
45
39
|
} from "./SvGrid.types";
|
|
46
40
|
import {
|
|
47
41
|
cfTextStyle,
|
|
48
|
-
fmtStat,
|
|
49
42
|
getEditableInputValue,
|
|
50
43
|
getEditorInputType,
|
|
51
44
|
toValueArray,
|
|
@@ -57,7 +50,6 @@
|
|
|
57
50
|
import {
|
|
58
51
|
splitInTokens,
|
|
59
52
|
trailingInToken,
|
|
60
|
-
joinInTokens,
|
|
61
53
|
} from "./filtering/excel-filters";
|
|
62
54
|
import { createSvGridController } from "./SvGrid.controller.svelte";
|
|
63
55
|
// GridMenus hosts tooltips + all column/filter/context menu overlays - none of
|
|
@@ -180,10 +172,8 @@
|
|
|
180
172
|
|
|
181
173
|
// ---- View facade: re-bind the controller's reactive members as locals so the
|
|
182
174
|
// markup stays identical. Assignable state + bindings + DOM refs use c.* directly.
|
|
183
|
-
const paginationEnabled = $derived(ctrl.paginationEnabled);
|
|
184
175
|
const filterRowValues = $derived(ctrl.filterRowValues);
|
|
185
176
|
const filterMenuValues = $derived(ctrl.filterMenuValues);
|
|
186
|
-
const tooltip = $derived(ctrl.tooltip);
|
|
187
177
|
const showTooltipFor = $derived(ctrl.showTooltipFor);
|
|
188
178
|
const hideTooltip = $derived(ctrl.hideTooltip);
|
|
189
179
|
const findHits = $derived(ctrl.findHits);
|
|
@@ -284,19 +274,13 @@
|
|
|
284
274
|
id === "__autoGroup" || id.startsWith("__group_");
|
|
285
275
|
const sortDirectionByColumn = $derived(ctrl.sortDirectionByColumn);
|
|
286
276
|
const groupingColumns = $derived(ctrl.groupingColumns);
|
|
287
|
-
const paginationState = $derived(ctrl.paginationState);
|
|
288
|
-
const allRowsBeforePagination = $derived(ctrl.allRowsBeforePagination);
|
|
289
277
|
const allRows = $derived(ctrl.allRows);
|
|
290
|
-
const statusBarEnabled = $derived(ctrl.statusBarEnabled);
|
|
291
|
-
const statusBarAggregates = $derived(ctrl.statusBarAggregates);
|
|
292
|
-
const statusBarStats = $derived(ctrl.statusBarStats);
|
|
293
278
|
const toolPanelEnabled = $derived(ctrl.toolPanelEnabled);
|
|
294
279
|
const toolPanelColumns = $derived(ctrl.toolPanelColumns);
|
|
295
280
|
const toolPanelHeaderLabel = $derived(ctrl.toolPanelHeaderLabel);
|
|
296
281
|
const toggleColumnVisibleInPanel = $derived(ctrl.toggleColumnVisibleInPanel);
|
|
297
282
|
const moveColumnInPanel = $derived(ctrl.moveColumnInPanel);
|
|
298
283
|
const toggleGroupInPanel = $derived(ctrl.toggleGroupInPanel);
|
|
299
|
-
const virtualizer = $derived(ctrl.virtualizer);
|
|
300
284
|
const rowVirtualizationEnabled = $derived(ctrl.rowVirtualizationEnabled);
|
|
301
285
|
// The fixed row height, matching what the virtualized path takes from the virtualizer.
|
|
302
286
|
// The non-virtualized (`virtualization={false}`) body must apply this too, else its rows
|
|
@@ -525,9 +509,6 @@
|
|
|
525
509
|
const onHeaderSortClick = $derived(ctrl.onHeaderSortClick);
|
|
526
510
|
const onGridKeyDown = $derived(ctrl.onGridKeyDown);
|
|
527
511
|
const onGridPaste = $derived(ctrl.onGridPaste);
|
|
528
|
-
const changePage = $derived(ctrl.changePage);
|
|
529
|
-
const goToPage = $derived(ctrl.goToPage);
|
|
530
|
-
const setPageSize = $derived(ctrl.setPageSize);
|
|
531
512
|
const updateFilterRow = $derived(ctrl.updateFilterRow);
|
|
532
513
|
const updateFilterMenuValue = $derived(ctrl.updateFilterMenuValue);
|
|
533
514
|
const updateFilterMenuValueTo = $derived(ctrl.updateFilterMenuValueTo);
|
|
@@ -1291,7 +1272,7 @@
|
|
|
1291
1272
|
aria-label="Edit checkbox value"
|
|
1292
1273
|
onclick={(event) => {
|
|
1293
1274
|
event.stopPropagation();
|
|
1294
|
-
const nextValue = !
|
|
1275
|
+
const nextValue = !ctrl.editingCell?.value;
|
|
1295
1276
|
ctrl.editingCell = ctrl.editingCell
|
|
1296
1277
|
? { ...ctrl.editingCell, value: nextValue }
|
|
1297
1278
|
: ctrl.editingCell;
|
|
@@ -1300,7 +1281,7 @@
|
|
|
1300
1281
|
onkeydown={(event) =>
|
|
1301
1282
|
toggleCheckboxWithKeyboard(event, () => {
|
|
1302
1283
|
event.stopPropagation();
|
|
1303
|
-
const nextValue = !
|
|
1284
|
+
const nextValue = !ctrl.editingCell?.value;
|
|
1304
1285
|
ctrl.editingCell = ctrl.editingCell
|
|
1305
1286
|
? { ...ctrl.editingCell, value: nextValue }
|
|
1306
1287
|
: ctrl.editingCell;
|
|
@@ -2690,10 +2671,6 @@
|
|
|
2690
2671
|
row,
|
|
2691
2672
|
rendered.column,
|
|
2692
2673
|
)}
|
|
2693
|
-
{@const cellTooltip = computeCellTooltip(
|
|
2694
|
-
row,
|
|
2695
|
-
rendered.column,
|
|
2696
|
-
)}
|
|
2697
2674
|
{@const cellValidity = computeCellValidity(
|
|
2698
2675
|
row,
|
|
2699
2676
|
rendered.column,
|
package/src/SvGrid.types.ts
CHANGED
|
@@ -13,7 +13,6 @@ import type { GroupDisplayType } from "./group-display";
|
|
|
13
13
|
import type { GridMessages } from "./grid-messages";
|
|
14
14
|
import type { GridPivotConfig } from "./pivot-view.svelte";
|
|
15
15
|
import type { MenuItem } from "./SvMenuList.svelte";
|
|
16
|
-
import type { RecurrenceRule } from "./recurrence";
|
|
17
16
|
|
|
18
17
|
/** The calendar views the scheduler can render. {@link SchedulerConfig}. The
|
|
19
18
|
* `timeline*` views are horizontal: time runs left→right and resources are
|
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<
|