@svgrid/grid 2.2.31 → 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/README.md +1 -1
- package/dist/DockNodeView.svelte +1 -1
- package/dist/GridFooter.svelte +0 -40
- package/dist/GridMenus.svelte +0 -77
- package/dist/SvAvatar.svelte +1 -1
- package/dist/SvCheckBox.svelte +2 -1
- package/dist/SvCircularProgress.svelte +1 -1
- package/dist/SvDateRangeInput.svelte +1 -1
- package/dist/SvGrid.controller.svelte.d.ts +20 -0
- package/dist/SvGrid.controller.svelte.js +358 -18
- package/dist/SvGrid.css +103 -3
- package/dist/SvGrid.svelte +164 -35
- package/dist/SvGrid.types.d.ts +81 -0
- package/dist/SvGridChart.svelte +2 -10
- package/dist/SvGridDropdown.svelte +38 -6
- package/dist/SvGridDropdown.svelte.d.ts +4 -0
- package/dist/SvGridSelect.svelte +12 -5
- package/dist/SvGridSelect.svelte.d.ts +6 -0
- package/dist/SvGroupCell.svelte +9 -2
- package/dist/SvKbd.svelte +1 -1
- package/dist/SvList.svelte +1 -1
- package/dist/SvMenubar.svelte +1 -1
- package/dist/SvMultiSelect.svelte +12 -4
- package/dist/SvMultiSelect.svelte.d.ts +6 -0
- package/dist/SvOtpInput.svelte +1 -1
- package/dist/SvPasswordInput.svelte +1 -1
- package/dist/SvProgress.svelte +1 -1
- package/dist/SvRating.svelte +1 -1
- package/dist/SvResult.svelte +1 -1
- package/dist/SvRichText.svelte +35 -16
- package/dist/SvRichText.svelte.d.ts +9 -0
- package/dist/SvSwitchButton.svelte +2 -1
- package/dist/SvToaster.svelte +1 -1
- package/dist/SvTour.svelte +4 -0
- package/dist/SvTree.svelte +9 -2
- package/dist/SvTree.svelte.d.ts +5 -0
- package/dist/SvTreeSelect.svelte +6 -4
- package/dist/build-api.js +16 -0
- package/dist/cdn/{GridMenus-Ds3OpzZT.js → GridMenus-B7XhhqdN.js} +34 -36
- package/dist/cdn/{GridMenus-Da_p7SKS.js → GridMenus-BxmIvCJh.js} +35 -37
- package/dist/cdn/{SvDateTimePicker-DB0aIEk8.js → SvDateTimePicker-ClqtVIj3.js} +2 -1
- package/dist/cdn/{SvDateTimePicker-B8GopjhC.js → SvDateTimePicker-o94wfSUa.js} +3 -2
- 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-hpnHvOGt.js → SvGridDropdown-CUOdm7YA.js} +93 -88
- package/dist/cdn/{SvGridDropdown-DjALc_4f.js → SvGridDropdown-D0VdjeR8.js} +129 -123
- package/dist/cdn/{disclose-version-DoD9AFD_.js → disclose-version-DljhZohK.js} +45 -45
- package/dist/cdn/{src-DYDCiC0D.js → src-erjBRYfX.js} +5952 -5615
- package/dist/cdn/{src-BLJfdyL0.js → src-ktbQVOk-.js} +4190 -3851
- package/dist/cdn/svgrid.js +9 -9
- package/dist/cdn/svgrid.svelte-external.js +8 -8
- package/dist/cell-render.d.ts +1 -0
- package/dist/cell-render.js +115 -1
- package/dist/cell-values.js +5 -0
- package/dist/chart.d.ts +2 -0
- package/dist/chart.js +1 -4
- package/dist/core.d.ts +80 -9
- package/dist/core.js +89 -0
- package/dist/createMenu.svelte.js +0 -1
- package/dist/createPopoverSelect.svelte.d.ts +2 -2
- package/dist/editing.js +1 -1
- package/dist/editor-contract.d.ts +12 -5
- package/dist/editor-registry.d.ts +18 -7
- package/dist/editor-registry.js +10 -1
- package/dist/export-format.js +3 -0
- package/dist/group-display.d.ts +39 -0
- package/dist/group-display.js +52 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/keyboard-handlers.js +16 -0
- package/dist/recurrence.js +3 -2
- package/dist/selection.js +0 -1
- package/dist/svgrid-wrapper.types.d.ts +8 -2
- package/dist/themes/index.d.ts +10 -0
- package/dist/themes/index.js +26 -0
- 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/SvAccordion.test.ts +5 -5
- package/src/SvAvatar.svelte +1 -1
- package/src/SvButtonGroup.test.ts +6 -6
- package/src/SvCalendar.test.ts +1 -1
- package/src/SvCheckBox.svelte +2 -1
- package/src/SvCircularProgress.svelte +1 -1
- package/src/SvDateRangeInput.svelte +1 -1
- package/src/SvFileUpload.test.ts +1 -1
- package/src/SvGrid.controller.svelte.ts +367 -22
- package/src/SvGrid.css +103 -3
- package/src/SvGrid.svelte +164 -35
- package/src/SvGrid.types.ts +81 -1
- package/src/SvGridChart.svelte +2 -10
- package/src/SvGridDropdown.svelte +38 -6
- package/src/SvGridSelect.svelte +12 -5
- package/src/SvGroupCell.svelte +9 -2
- package/src/SvKbd.svelte +1 -1
- package/src/SvList.svelte +1 -1
- package/src/SvMenubar.svelte +1 -1
- package/src/SvMultiSelect.svelte +12 -4
- package/src/SvOtpInput.svelte +1 -1
- package/src/SvPasswordInput.svelte +1 -1
- package/src/SvProgress.svelte +1 -1
- package/src/SvRating.svelte +1 -1
- package/src/SvResult.svelte +1 -1
- package/src/SvRichText.svelte +35 -16
- package/src/SvSwitchButton.svelte +2 -1
- package/src/SvToaster.svelte +1 -1
- package/src/SvTour.svelte +4 -0
- package/src/SvTree.svelte +9 -2
- package/src/SvTreeSelect.svelte +6 -4
- package/src/ai.test.ts +1 -1
- package/src/build-api.ts +15 -105
- package/src/builtin-editors.test.ts +3 -1
- package/src/cell-formatting.test.ts +1 -1
- package/src/cell-render.test.ts +27 -3
- package/src/cell-render.ts +122 -95
- package/src/cell-values.ts +4 -0
- package/src/chart-export.test.ts +2 -2
- package/src/chart.ts +1 -2
- package/src/clipboard.test.ts +0 -2
- package/src/clipboard.ts +0 -102
- package/src/columns.ts +0 -115
- package/src/core.ts +157 -8
- package/src/createMenu.svelte.ts +0 -1
- package/src/editing.test.ts +1 -1
- package/src/editing.ts +2 -105
- package/src/editor-contract.ts +12 -5
- package/src/editor-registry.grid.test.ts +48 -2
- package/src/editor-registry.test.ts +3 -1
- package/src/editor-registry.ts +23 -7
- package/src/export-format.ts +3 -0
- package/src/facet-buckets.test.ts +33 -33
- package/src/features.ts +0 -90
- package/src/group-display.test.ts +91 -1
- package/src/group-display.ts +83 -0
- package/src/index.ts +9 -0
- package/src/keyboard-handlers.coverage.test.ts +1 -1
- package/src/keyboard-handlers.ts +17 -120
- package/src/list-power.test.ts +2 -2
- package/src/menus.test.ts +4 -5
- package/src/menus.ts +0 -112
- package/src/named-views.coverage.test.ts +3 -3
- package/src/new-features.test.ts +3 -1
- package/src/recurrence.ts +3 -2
- package/src/row-drag.test.ts +1 -1
- package/src/row-resize.test.ts +41 -42
- package/src/scheduler-model.ts +1 -1
- package/src/scroll-sync.test.ts +4 -7
- package/src/scroll-sync.ts +0 -122
- package/src/selection.ts +0 -109
- package/src/server-data-source.coverage.test.ts +1 -1
- package/src/server-group-model.test.ts +8 -8
- package/src/spreadsheet.test.ts +0 -1
- package/src/summaries.ts +0 -112
- package/src/svgrid-wrapper.types.ts +11 -9
- package/src/svgrid.async-editor-options.test.ts +271 -0
- package/src/svgrid.auto-row-height.test.ts +204 -0
- package/src/svgrid.behavior.test.ts +0 -1
- package/src/svgrid.charting.test.ts +4 -4
- package/src/svgrid.column-reorder.test.ts +0 -8
- package/src/svgrid.comments-autocomplete.test.ts +8 -2
- package/src/svgrid.context-menu.test.ts +25 -9
- package/src/svgrid.filter-depth.test.ts +163 -0
- package/src/svgrid.filter-menu-listbox.svelte.test.ts +16 -2
- package/src/svgrid.filter-menu-scroll.test.ts +10 -2
- package/src/svgrid.grand-total.test.ts +188 -0
- package/src/svgrid.group-display-mode.test.ts +171 -0
- package/src/svgrid.group-footers.test.ts +121 -0
- package/src/svgrid.group-pagination.test.ts +153 -0
- package/src/svgrid.tree-data.test.ts +186 -0
- package/src/svgriddropdown.async-panel.svelte.test.ts +195 -0
- package/src/themes/index.ts +42 -0
- package/src/tree-edit.test.ts +4 -4
- package/src/tree-row-model.test.ts +168 -0
- package/src/ui-localization.test.ts +113 -0
- package/themes/ag-alpine.css +22 -0
- package/themes/antd.css +22 -0
- package/themes/atlassian.css +22 -0
- package/themes/bootstrap.css +22 -0
- package/themes/carbon.css +22 -0
- package/themes/catppuccin.css +22 -0
- package/themes/dracula.css +22 -0
- package/themes/ember.css +22 -0
- package/themes/excel.css +22 -0
- package/themes/fluent.css +22 -0
- package/themes/github.css +22 -0
- package/themes/linear.css +22 -0
- package/themes/material.css +22 -0
- package/themes/nord.css +22 -0
- package/themes/notion.css +22 -0
- package/themes/salesforce.css +22 -0
- package/themes/sap.css +22 -0
- package/themes/shadcn.css +22 -0
- package/themes/tailwind.css +22 -0
- package/themes/vercel.css +22 -0
package/dist/themes/index.js
CHANGED
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
* browser. `@svgrid/enterprise`'s Studio layer builds its `ProjectTheme`-aware
|
|
9
9
|
* wrapper on top of this module instead of keeping its own copy.
|
|
10
10
|
*/
|
|
11
|
+
/** Status-color defaults per mode - dark mode lifts them so they stay legible
|
|
12
|
+
* on a dark ground. Values match the components' own inline fallbacks. */
|
|
13
|
+
const STATUS_DEFAULTS = {
|
|
14
|
+
light: { danger: '#dc2626', success: '#16a34a', warning: '#d97706', info: '#0891b2' },
|
|
15
|
+
dark: { danger: '#f87171', success: '#4ade80', warning: '#fbbf24', info: '#22d3ee' },
|
|
16
|
+
};
|
|
11
17
|
/** The built-in theme presets, in gallery order (SvGrid's own theme first). */
|
|
12
18
|
export const themePresets = [
|
|
13
19
|
// Ember is SvGrid's signature look - the palette svgrid.com itself runs on, so
|
|
@@ -108,6 +114,7 @@ export function resolveThemeTokens(preset, mode, accentOverride) {
|
|
|
108
114
|
const resolved = preset ?? defaultThemePreset;
|
|
109
115
|
const p = resolved[mode];
|
|
110
116
|
const accent = accentOverride || p.accent;
|
|
117
|
+
const status = STATUS_DEFAULTS[mode];
|
|
111
118
|
return {
|
|
112
119
|
'--sg-bg': p.bg,
|
|
113
120
|
'--sg-fg': p.fg,
|
|
@@ -146,6 +153,25 @@ export function resolveThemeTokens(preset, mode, accentOverride) {
|
|
|
146
153
|
'--sg-on-accent': onAccent(accent),
|
|
147
154
|
'--sg-radius': `${resolved.radius}px`,
|
|
148
155
|
'--sg-font': resolved.font,
|
|
156
|
+
// Semantic status colors. Same reasoning as the scrollbar tokens below:
|
|
157
|
+
// the UI kit consumes these (destructive buttons, alerts, validation,
|
|
158
|
+
// badges, the rating star), so a preset that doesn't define them leaves
|
|
159
|
+
// every status color at a hard-coded red/green/amber that ignores the
|
|
160
|
+
// theme and, on dark presets, sits at the wrong lightness.
|
|
161
|
+
'--sg-danger': p.danger ?? status.danger,
|
|
162
|
+
'--sg-success': p.success ?? status.success,
|
|
163
|
+
'--sg-warning': p.warning ?? status.warning,
|
|
164
|
+
'--sg-info': p.info ?? status.info,
|
|
165
|
+
// A COLOR, not a shadow - consumed as `outline: 2px solid var(...)`.
|
|
166
|
+
'--sg-focus-ring': p.focusRing ?? accent,
|
|
167
|
+
// Derived surfaces + shape the kit reads. Deriving from the palette keeps
|
|
168
|
+
// them following the preset and the light/dark mode.
|
|
169
|
+
'--sg-muted-bg': p.rowHover,
|
|
170
|
+
'--sg-skeleton-bg': p.rowHover,
|
|
171
|
+
'--sg-radius-lg': `${resolved.radius * 2}px`,
|
|
172
|
+
'--sg-rating-on': p.warning ?? status.warning,
|
|
173
|
+
'--sg-rating-empty': p.border,
|
|
174
|
+
'--sg-invalid-fg': p.danger ?? status.danger,
|
|
149
175
|
// The grid's custom scrollbar is a shadow-DOM web component that reads its
|
|
150
176
|
// OWN --sg-scrollbar-* tokens (with fixed light-mode fallbacks). Without
|
|
151
177
|
// these it ignores the theme entirely - a light scrollbar left on a dark
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svgrid/grid",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.33",
|
|
4
4
|
"description": "Svelte 5-native data grid and data table. Headless-first engine with virtual scrolling for 100k+ rows, Excel-style filtering, inline editing, grouping, tree data, pivot, and server-side data. Drop-in <SvGrid> component. TypeScript, SSR-ready.",
|
|
5
5
|
"author": "jQWidgets <boikom@jqwidgets.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -104,7 +104,8 @@
|
|
|
104
104
|
"test:types": "svelte-check --tsconfig ./tsconfig.json",
|
|
105
105
|
"test:lib": "vitest run --coverage",
|
|
106
106
|
"test:build": "publint --strict",
|
|
107
|
-
"build": "svelte-package --input ./src --output ./dist && node ../../tools/strip-dist-tests.mjs ./dist && node ./scripts/build-cdn.mjs && node ./scripts/build-themes.mjs"
|
|
107
|
+
"build": "svelte-package --input ./src --output ./dist && node ../../tools/strip-dist-tests.mjs ./dist && node ./scripts/build-cdn.mjs && node ./scripts/build-themes.mjs",
|
|
108
|
+
"lint": "eslint ./src"
|
|
108
109
|
},
|
|
109
110
|
"devDependencies": {
|
|
110
111
|
"@sveltejs/package": "^2.5.7",
|
package/src/DockNodeView.svelte
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
const onMove = (ev: PointerEvent) => {
|
|
44
44
|
const delta = ((vertical ? ev.clientY : ev.clientX) - startPos) / total
|
|
45
|
-
|
|
45
|
+
const fa = Math.min(Math.max(startSizes[a]! + delta, minA), pairTotal - minB)
|
|
46
46
|
const next = startSizes.slice()
|
|
47
47
|
next[a] = fa
|
|
48
48
|
next[b] = pairTotal - fa
|
package/src/GridFooter.svelte
CHANGED
|
@@ -1,50 +1,13 @@
|
|
|
1
1
|
<script lang="ts" generics="TFeatures extends TableFeatures = TableFeatures, TData extends RowData = RowData">
|
|
2
2
|
import {
|
|
3
|
-
getGridCellA11yProps,
|
|
4
|
-
getGridCellDomId,
|
|
5
|
-
getGridHeaderA11yProps,
|
|
6
|
-
getGridRootA11yProps,
|
|
7
|
-
getGridRowA11yProps,
|
|
8
|
-
type EditorContext,
|
|
9
|
-
type CellEditorOption,
|
|
10
|
-
type Column,
|
|
11
|
-
type Row,
|
|
12
3
|
type RowData,
|
|
13
4
|
type TableFeatures,
|
|
14
5
|
} from "./index";
|
|
15
6
|
import "./sv-grid-scrollbar";
|
|
16
|
-
import type { Snippet } from "svelte";
|
|
17
|
-
import {
|
|
18
|
-
RenderSnippetConfig,
|
|
19
|
-
RenderComponentConfig,
|
|
20
|
-
} from "./render-component";
|
|
21
|
-
import {
|
|
22
|
-
buildSparkline,
|
|
23
|
-
toSparklineValues,
|
|
24
|
-
} from "./sparkline";
|
|
25
7
|
import SvGridDropdown from "./SvGridDropdown.svelte";
|
|
26
|
-
import type {
|
|
27
|
-
Props,
|
|
28
|
-
SelectionPoint,
|
|
29
|
-
SelectionRange,
|
|
30
|
-
CellEditState,
|
|
31
|
-
FilterOperator,
|
|
32
|
-
FilterOption,
|
|
33
|
-
MenuPosition,
|
|
34
|
-
} from "./SvGrid.types";
|
|
35
8
|
import {
|
|
36
|
-
cfTextStyle,
|
|
37
9
|
fmtStat,
|
|
38
|
-
getEditableInputValue,
|
|
39
|
-
getEditorInputType,
|
|
40
|
-
toValueArray,
|
|
41
|
-
getOptionLabel,
|
|
42
|
-
getOptionColor,
|
|
43
|
-
colorfulChipStyle,
|
|
44
|
-
getEditorClass,
|
|
45
10
|
} from "./SvGrid.helpers";
|
|
46
|
-
import {
|
|
47
|
-
} from "./SvGrid.controller.svelte";
|
|
48
11
|
import type { SvGridController } from "./SvGrid.controller.svelte";
|
|
49
12
|
|
|
50
13
|
let {
|
|
@@ -68,9 +31,6 @@
|
|
|
68
31
|
// View facade: re-bind the controller's reactive members so the markup
|
|
69
32
|
// (moved verbatim from SvGrid.svelte) stays identical.
|
|
70
33
|
const paginationEnabled = $derived(ctrl.paginationEnabled);
|
|
71
|
-
const grid = $derived(ctrl.grid);
|
|
72
|
-
const paginationState = $derived(ctrl.paginationState);
|
|
73
|
-
const allRowsBeforePagination = $derived(ctrl.allRowsBeforePagination);
|
|
74
34
|
const statusBarEnabled = $derived(ctrl.statusBarEnabled);
|
|
75
35
|
const statusBarAggregates = $derived(ctrl.statusBarAggregates);
|
|
76
36
|
const statusBarStats = $derived(ctrl.statusBarStats);
|
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/SvAccordion.test.ts
CHANGED
|
@@ -32,11 +32,11 @@ describe('SvAccordion', () => {
|
|
|
32
32
|
try {
|
|
33
33
|
const headers = [...target.querySelectorAll<HTMLButtonElement>('.sv-acc__header')]
|
|
34
34
|
expect(headers).toHaveLength(3)
|
|
35
|
-
expect(headers[0]
|
|
36
|
-
expect(headers[1]
|
|
35
|
+
expect(headers[0]!.getAttribute('aria-expanded')).toBe('true')
|
|
36
|
+
expect(headers[1]!.getAttribute('aria-expanded')).toBe('false')
|
|
37
37
|
const region = target.querySelector<HTMLElement>('.sv-acc__panel')!
|
|
38
38
|
expect(region.getAttribute('role')).toBe('region')
|
|
39
|
-
expect(region.getAttribute('aria-labelledby')).toBe(headers[0]
|
|
39
|
+
expect(region.getAttribute('aria-labelledby')).toBe(headers[0]!.id)
|
|
40
40
|
// Only one panel region is rendered (the open one).
|
|
41
41
|
expect(target.querySelectorAll('.sv-acc__panel')).toHaveLength(1)
|
|
42
42
|
} finally { destroy() }
|
|
@@ -47,7 +47,7 @@ describe('SvAccordion', () => {
|
|
|
47
47
|
const { target, destroy } = mountAcc({ items, expanded: ['a'], expandMode: 'single', onChange: (ids: string[]) => (got = ids) })
|
|
48
48
|
try {
|
|
49
49
|
const headers = target.querySelectorAll<HTMLButtonElement>('.sv-acc__header')
|
|
50
|
-
headers[1]
|
|
50
|
+
headers[1]!.click()
|
|
51
51
|
flushSync()
|
|
52
52
|
expect(got).toEqual(['b'])
|
|
53
53
|
} finally { destroy() }
|
|
@@ -58,7 +58,7 @@ describe('SvAccordion', () => {
|
|
|
58
58
|
const { target, destroy } = mountAcc({ items, expanded: ['a'], expandMode: 'multiple', onChange: (ids: string[]) => (got = ids) })
|
|
59
59
|
try {
|
|
60
60
|
const headers = target.querySelectorAll<HTMLButtonElement>('.sv-acc__header')
|
|
61
|
-
headers[2]
|
|
61
|
+
headers[2]!.click()
|
|
62
62
|
flushSync()
|
|
63
63
|
expect(got).toEqual(['a', 'c'])
|
|
64
64
|
} finally { destroy() }
|
package/src/SvAvatar.svelte
CHANGED
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
.sv-avatar__status.is-online { background: var(--sg-success, #16a34a); }
|
|
72
72
|
.sv-avatar__status.is-offline { background: var(--sg-muted, #94a3b8); }
|
|
73
73
|
.sv-avatar__status.is-busy { background: var(--sg-danger, #dc2626); }
|
|
74
|
-
.sv-avatar__status.is-away { background: var(--sg-warning, #
|
|
74
|
+
.sv-avatar__status.is-away { background: var(--sg-warning, #d97706); }
|
|
75
75
|
</style>
|
|
@@ -28,10 +28,10 @@ describe('SvButtonGroup', () => {
|
|
|
28
28
|
expect(group.getAttribute('role')).toBe('radiogroup')
|
|
29
29
|
const btns = [...target.querySelectorAll<HTMLButtonElement>('.sv-bg__btn')]
|
|
30
30
|
expect(btns.map((b) => b.getAttribute('role'))).toEqual(['radio', 'radio', 'radio'])
|
|
31
|
-
expect(btns[1]
|
|
31
|
+
expect(btns[1]!.getAttribute('aria-checked')).toBe('true')
|
|
32
32
|
// Roving tabindex: only the checked/active button is tabbable.
|
|
33
|
-
expect(btns[1]
|
|
34
|
-
expect(btns[0]
|
|
33
|
+
expect(btns[1]!.tabIndex).toBe(0)
|
|
34
|
+
expect(btns[0]!.tabIndex).toBe(-1)
|
|
35
35
|
} finally { destroy() }
|
|
36
36
|
})
|
|
37
37
|
|
|
@@ -40,7 +40,7 @@ describe('SvButtonGroup', () => {
|
|
|
40
40
|
const { target, destroy } = mountBg({ items, value: 'day', mode: 'single', onChange: (v: unknown) => (got = v) })
|
|
41
41
|
try {
|
|
42
42
|
const btns = target.querySelectorAll<HTMLButtonElement>('.sv-bg__btn')
|
|
43
|
-
btns[2]
|
|
43
|
+
btns[2]!.click()
|
|
44
44
|
flushSync()
|
|
45
45
|
expect(got).toBe('month')
|
|
46
46
|
} finally { destroy() }
|
|
@@ -53,8 +53,8 @@ describe('SvButtonGroup', () => {
|
|
|
53
53
|
const group = target.querySelector<HTMLElement>('.sv-bg')!
|
|
54
54
|
expect(group.getAttribute('role')).toBe('group')
|
|
55
55
|
const btns = target.querySelectorAll<HTMLButtonElement>('.sv-bg__btn')
|
|
56
|
-
expect(btns[0]
|
|
57
|
-
btns[1]
|
|
56
|
+
expect(btns[0]!.getAttribute('aria-pressed')).toBe('true')
|
|
57
|
+
btns[1]!.click()
|
|
58
58
|
flushSync()
|
|
59
59
|
expect(got).toEqual(['day', 'week'])
|
|
60
60
|
} finally { destroy() }
|
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',
|
package/src/SvCheckBox.svelte
CHANGED
|
@@ -56,8 +56,9 @@
|
|
|
56
56
|
|
|
57
57
|
<SvField id={uid} {hint} {error} {required} {dir}>
|
|
58
58
|
<label class="sv-check sv-check--{size}" class:is-disabled={disabled} class:is-readonly={readonly} class:is-invalid={invalid}>
|
|
59
|
+
<!-- role="checkbox" arrives via boxProps(), which the a11y pass cannot see through -->
|
|
60
|
+
<!-- svelte-ignore a11y_role_supports_aria_props_implicit -->
|
|
59
61
|
<button
|
|
60
|
-
role="checkbox"
|
|
61
62
|
class="sv-check__box"
|
|
62
63
|
class:is-checked={checked && !indeterminate}
|
|
63
64
|
class:is-indeterminate={indeterminate}
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
position: relative; display: inline-flex; flex: none;
|
|
90
90
|
}
|
|
91
91
|
.sv-circ--success { --_c: var(--sg-success, #16a34a); }
|
|
92
|
-
.sv-circ--warning { --_c: var(--sg-warning, #
|
|
92
|
+
.sv-circ--warning { --_c: var(--sg-warning, #d97706); }
|
|
93
93
|
.sv-circ--danger { --_c: var(--sg-danger, #dc2626); }
|
|
94
94
|
.sv-circ__svg { display: block; transform: rotate(-90deg); }
|
|
95
95
|
.sv-circ__track { stroke: var(--sg-border, #e2e8f0); }
|
|
@@ -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
|
|
package/src/SvFileUpload.test.ts
CHANGED
|
@@ -53,7 +53,7 @@ describe('SvFileUpload', () => {
|
|
|
53
53
|
target.querySelector<HTMLButtonElement>('.sv-file__remove')!.click()
|
|
54
54
|
flushSync()
|
|
55
55
|
expect(got).toHaveLength(1)
|
|
56
|
-
expect(got![0]
|
|
56
|
+
expect(got![0]!.name).toBe('b.png')
|
|
57
57
|
} finally { destroy() }
|
|
58
58
|
})
|
|
59
59
|
})
|