dssoca 0.20.0 → 0.22.0
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 +3 -3
- package/dist/components/Accordion.svelte +23 -52
- package/dist/components/BottomNav.svelte +18 -28
- package/dist/components/BoxPlot.svelte +7 -6
- package/dist/components/BumpChart.svelte +9 -12
- package/dist/components/Chart.svelte +9 -12
- package/dist/components/Checkbox.svelte +210 -0
- package/dist/components/Checkbox.svelte.d.ts +38 -0
- package/dist/components/FileDrop.svelte +52 -83
- package/dist/components/FileDrop.svelte.d.ts +6 -2
- package/dist/components/Heatmap.svelte +8 -8
- package/dist/components/Image.svelte +44 -44
- package/dist/components/Input.svelte +8 -3
- package/dist/components/LogStream.svelte +15 -25
- package/dist/components/Menu.svelte +69 -94
- package/dist/components/Menu.svelte.d.ts +6 -0
- package/dist/components/Modal.svelte +61 -14
- package/dist/components/Modal.svelte.d.ts +7 -2
- package/dist/components/NumberField.svelte +18 -19
- package/dist/components/Pagination.svelte +47 -37
- package/dist/components/Pagination.svelte.d.ts +6 -2
- package/dist/components/Popover.svelte +404 -0
- package/dist/components/Popover.svelte.d.ts +55 -0
- package/dist/components/RadioGroup.svelte +227 -0
- package/dist/components/RadioGroup.svelte.d.ts +42 -0
- package/dist/components/ScatterPlot.svelte +11 -13
- package/dist/components/SearchPalette.svelte +124 -120
- package/dist/components/SearchPalette.svelte.d.ts +6 -4
- package/dist/components/SegmentedControl.svelte +41 -62
- package/dist/components/SegmentedControl.svelte.d.ts +7 -2
- package/dist/components/ShortcutsHelp.svelte +48 -47
- package/dist/components/Sidebar.svelte +48 -60
- package/dist/components/Switch.svelte +20 -10
- package/dist/components/Switch.svelte.d.ts +6 -2
- package/dist/components/Table.svelte +15 -37
- package/dist/components/Tabs.svelte +223 -0
- package/dist/components/Tabs.svelte.d.ts +51 -0
- package/dist/components/TierList.svelte +41 -38
- package/dist/components/TierList.svelte.d.ts +7 -3
- package/dist/components/Toaster.svelte +29 -29
- package/dist/components/Tooltip.svelte +37 -21
- package/dist/components/Topbar.svelte +13 -38
- package/dist/core/accordion.d.ts +32 -0
- package/dist/core/accordion.js +53 -0
- package/dist/core/behaviors/focusable.d.ts +5 -0
- package/dist/core/behaviors/focusable.js +14 -0
- package/dist/core/behaviors/roving.d.ts +13 -0
- package/dist/core/behaviors/roving.js +29 -0
- package/dist/core/bottom-nav.d.ts +36 -0
- package/dist/core/bottom-nav.js +33 -0
- package/dist/core/chart-nav.d.ts +53 -0
- package/dist/{chart-nav.js → core/chart-nav.js} +27 -0
- package/dist/core/checkbox.d.ts +36 -0
- package/dist/core/checkbox.js +29 -0
- package/dist/core/file-drop.d.ts +75 -0
- package/dist/core/file-drop.js +101 -0
- package/dist/core/image.d.ts +59 -0
- package/dist/core/image.js +64 -0
- package/dist/core/input.d.ts +21 -0
- package/dist/core/input.js +17 -0
- package/dist/core/log-stream.d.ts +51 -0
- package/dist/core/log-stream.js +50 -0
- package/dist/core/menu.d.ts +70 -0
- package/dist/core/menu.js +84 -0
- package/dist/core/modal.d.ts +59 -0
- package/dist/core/modal.js +44 -0
- package/dist/core/number-field.d.ts +47 -0
- package/dist/core/number-field.js +64 -0
- package/dist/core/pagination.d.ts +59 -0
- package/dist/core/pagination.js +65 -0
- package/dist/core/popover.d.ts +111 -0
- package/dist/core/popover.js +86 -0
- package/dist/core/radio.d.ts +36 -0
- package/dist/core/radio.js +48 -0
- package/dist/core/search-palette.d.ts +124 -0
- package/dist/core/search-palette.js +149 -0
- package/dist/core/segmented.d.ts +46 -0
- package/dist/core/segmented.js +66 -0
- package/dist/core/shortcuts-help.d.ts +56 -0
- package/dist/core/shortcuts-help.js +50 -0
- package/dist/core/sidebar.d.ts +63 -0
- package/dist/core/sidebar.js +84 -0
- package/dist/core/switch.d.ts +19 -0
- package/dist/core/switch.js +11 -0
- package/dist/core/table.d.ts +40 -0
- package/dist/core/table.js +57 -0
- package/dist/core/tabs.d.ts +84 -0
- package/dist/core/tabs.js +90 -0
- package/dist/{tierlist-core.d.ts → core/tierlist.d.ts} +62 -0
- package/dist/{tierlist-core.js → core/tierlist.js} +34 -0
- package/dist/core/toast.d.ts +112 -0
- package/dist/{toast-core.js → core/toast.js} +48 -2
- package/dist/core/tooltip.d.ts +47 -0
- package/dist/core/tooltip.js +51 -0
- package/dist/core/topbar.d.ts +41 -0
- package/dist/core/topbar.js +52 -0
- package/dist/dssoca.config.d.ts +1 -1
- package/dist/dssoca.config.js +4 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +9 -1
- package/dist/theme.css +47 -0
- package/dist/toast.svelte.d.ts +2 -2
- package/dist/toast.svelte.js +1 -1
- package/dist/tokens.css +47 -0
- package/dist/vanilla/accordion.js +28 -29
- package/dist/vanilla/checkbox.d.ts +8 -0
- package/dist/vanilla/checkbox.js +43 -0
- package/dist/vanilla/delegate.d.ts +2 -0
- package/dist/vanilla/delegate.js +9 -0
- package/dist/vanilla/fields.js +37 -32
- package/dist/vanilla/index.d.ts +4 -0
- package/dist/vanilla/index.js +16 -3
- package/dist/vanilla/menu.js +92 -86
- package/dist/vanilla/modal.d.ts +3 -1
- package/dist/vanilla/modal.js +65 -15
- package/dist/vanilla/popover.d.ts +10 -0
- package/dist/vanilla/popover.js +199 -0
- package/dist/vanilla/radio.d.ts +3 -0
- package/dist/vanilla/radio.js +54 -0
- package/dist/vanilla/segmented.js +49 -51
- package/dist/vanilla/switch.d.ts +2 -1
- package/dist/vanilla/switch.js +13 -8
- package/dist/vanilla/tabs.d.ts +2 -0
- package/dist/vanilla/tabs.js +87 -0
- package/dist/vanilla/tierlist.d.ts +1 -1
- package/dist/vanilla/tierlist.js +32 -25
- package/dist/vanilla/toast.d.ts +2 -2
- package/dist/vanilla/toast.js +16 -14
- package/dist/vanilla/tooltip.js +35 -23
- package/dist/vanilla.css +364 -42
- package/package.json +1 -1
- package/dist/chart-nav.d.ts +0 -13
- package/dist/toast-core.d.ts +0 -61
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NumberField core (DS-0197) — parsing, clamping, stepping and the stepper state, shared by
|
|
3
|
+
* NumberField.svelte and `vanilla/fields.ts`. No DOM, no Svelte.
|
|
4
|
+
*/
|
|
5
|
+
/** A bound or a value that may be absent (`null`/`undefined` = none). */
|
|
6
|
+
type Maybe = number | null | undefined;
|
|
7
|
+
export interface NumberFieldState {
|
|
8
|
+
/** Current value; `null` when the input is empty or not a number. */
|
|
9
|
+
value: number | null;
|
|
10
|
+
min?: Maybe;
|
|
11
|
+
max?: Maybe;
|
|
12
|
+
/** Stepper increment; defaults to 1. */
|
|
13
|
+
step?: Maybe;
|
|
14
|
+
/** The field is disabled or readonly: nothing may change it. */
|
|
15
|
+
locked: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The value behind what the input holds. `raw` is its text and `asNumber` what the browser
|
|
19
|
+
* parsed it to (`valueAsNumber`, or `Number(raw)`); empty or unparseable text is `null`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function numberFieldParse(raw: string, asNumber: number): number | null;
|
|
22
|
+
/** A numeric option read from markup (`min`/`max`/`step` attribute): `null` when absent. */
|
|
23
|
+
export declare function numberFieldOption(raw: string | null | undefined): number | null;
|
|
24
|
+
/** `n` held inside `[min, max]`; a missing bound does not constrain. */
|
|
25
|
+
export declare function numberFieldClamp(n: number, min?: Maybe, max?: Maybe): number;
|
|
26
|
+
/** Is the value sitting on (or beyond) a bound? An empty field is at neither. */
|
|
27
|
+
export declare function numberFieldBounds(state: Pick<NumberFieldState, 'value' | 'min' | 'max'>): {
|
|
28
|
+
atMin: boolean;
|
|
29
|
+
atMax: boolean;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A stepper was pressed (`dir` 1 = increase, -1 = decrease): the next value, or `null` when the
|
|
33
|
+
* press is a no-op (field locked, or already at that bound). An empty field starts from the
|
|
34
|
+
* near bound (`min` going up, `max` going down), else from 0.
|
|
35
|
+
*/
|
|
36
|
+
export declare function numberFieldStep(state: NumberFieldState, dir: 1 | -1): number | null;
|
|
37
|
+
/** What the polite live region says after a stepper changed the value. */
|
|
38
|
+
export declare function numberFieldAnnouncement(value: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* State of one stepper button. Natively `disabled` only when the whole field is locked; at a
|
|
41
|
+
* bound it stays focusable and becomes an `aria-disabled` no-op, so focus never drops to <body>.
|
|
42
|
+
*/
|
|
43
|
+
export declare function numberFieldStepperAttrs(state: NumberFieldState, dir: 1 | -1): {
|
|
44
|
+
readonly disabled: boolean;
|
|
45
|
+
readonly 'aria-disabled': "true" | undefined;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NumberField core (DS-0197) — parsing, clamping, stepping and the stepper state, shared by
|
|
3
|
+
* NumberField.svelte and `vanilla/fields.ts`. No DOM, no Svelte.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The value behind what the input holds. `raw` is its text and `asNumber` what the browser
|
|
7
|
+
* parsed it to (`valueAsNumber`, or `Number(raw)`); empty or unparseable text is `null`.
|
|
8
|
+
*/
|
|
9
|
+
export function numberFieldParse(raw, asNumber) {
|
|
10
|
+
return raw === '' || Number.isNaN(asNumber) ? null : asNumber;
|
|
11
|
+
}
|
|
12
|
+
/** A numeric option read from markup (`min`/`max`/`step` attribute): `null` when absent. */
|
|
13
|
+
export function numberFieldOption(raw) {
|
|
14
|
+
if (raw == null || raw === '')
|
|
15
|
+
return null;
|
|
16
|
+
const n = Number(raw);
|
|
17
|
+
return Number.isNaN(n) ? null : n;
|
|
18
|
+
}
|
|
19
|
+
/** `n` held inside `[min, max]`; a missing bound does not constrain. */
|
|
20
|
+
export function numberFieldClamp(n, min, max) {
|
|
21
|
+
if (min != null && n < min)
|
|
22
|
+
return min;
|
|
23
|
+
if (max != null && n > max)
|
|
24
|
+
return max;
|
|
25
|
+
return n;
|
|
26
|
+
}
|
|
27
|
+
/** Is the value sitting on (or beyond) a bound? An empty field is at neither. */
|
|
28
|
+
export function numberFieldBounds(state) {
|
|
29
|
+
const { value, min, max } = state;
|
|
30
|
+
return {
|
|
31
|
+
atMin: value != null && min != null && value <= min,
|
|
32
|
+
atMax: value != null && max != null && value >= max,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A stepper was pressed (`dir` 1 = increase, -1 = decrease): the next value, or `null` when the
|
|
37
|
+
* press is a no-op (field locked, or already at that bound). An empty field starts from the
|
|
38
|
+
* near bound (`min` going up, `max` going down), else from 0.
|
|
39
|
+
*/
|
|
40
|
+
export function numberFieldStep(state, dir) {
|
|
41
|
+
if (state.locked)
|
|
42
|
+
return null;
|
|
43
|
+
const { atMin, atMax } = numberFieldBounds(state);
|
|
44
|
+
if (dir < 0 ? atMin : atMax)
|
|
45
|
+
return null;
|
|
46
|
+
const base = state.value ?? (dir > 0 ? (state.min ?? 0) : (state.max ?? 0));
|
|
47
|
+
return numberFieldClamp(base + dir * (state.step ?? 1), state.min, state.max);
|
|
48
|
+
}
|
|
49
|
+
/** What the polite live region says after a stepper changed the value. */
|
|
50
|
+
export function numberFieldAnnouncement(value) {
|
|
51
|
+
return String(value);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* State of one stepper button. Natively `disabled` only when the whole field is locked; at a
|
|
55
|
+
* bound it stays focusable and becomes an `aria-disabled` no-op, so focus never drops to <body>.
|
|
56
|
+
*/
|
|
57
|
+
export function numberFieldStepperAttrs(state, dir) {
|
|
58
|
+
const { atMin, atMax } = numberFieldBounds(state);
|
|
59
|
+
const atBound = dir < 0 ? atMin : atMax;
|
|
60
|
+
return {
|
|
61
|
+
disabled: state.locked,
|
|
62
|
+
'aria-disabled': !state.locked && atBound ? 'true' : undefined,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination core (DS-0197) — the page-window maths, the bounds, and what a press on a page
|
|
3
|
+
* button or a stepper does. Pure functions over a small state object; Pagination.svelte holds
|
|
4
|
+
* the state and applies the result. No DOM, no Svelte.
|
|
5
|
+
*/
|
|
6
|
+
/** What changed the page; passed to `onchange`. */
|
|
7
|
+
export type PaginationReason = 'page' | 'prev' | 'next';
|
|
8
|
+
export interface PaginationChangeDetails {
|
|
9
|
+
reason: PaginationReason;
|
|
10
|
+
}
|
|
11
|
+
export interface PaginationCountInput {
|
|
12
|
+
/** Explicit page count; wins over `total` / `pageSize`. */
|
|
13
|
+
pageCount?: number;
|
|
14
|
+
/** Total item count. */
|
|
15
|
+
total?: number;
|
|
16
|
+
/** Items per page. */
|
|
17
|
+
pageSize: number;
|
|
18
|
+
}
|
|
19
|
+
/** Number of pages. Derived counts are at least 1, so the control never renders empty. */
|
|
20
|
+
export declare function paginationPageCount(input: PaginationCountInput): number;
|
|
21
|
+
/** `page` clamped into `[1, pages]`. */
|
|
22
|
+
export declare function paginationClamp(page: number, pages: number): number;
|
|
23
|
+
/** One rendered cell: a page number, or the ellipsis before / after the sibling window. */
|
|
24
|
+
export type PaginationSlot = number | 'gap-start' | 'gap-end';
|
|
25
|
+
/**
|
|
26
|
+
* The windowed list of slots: first page, last page, `siblingCount` pages on each side of
|
|
27
|
+
* `current`, and an ellipsis wherever a run of pages is hidden. A single hidden page is cheaper
|
|
28
|
+
* to show than an ellipsis, so a run only collapses when it hides more than one page.
|
|
29
|
+
*/
|
|
30
|
+
export declare function paginationSlots(current: number, pages: number, siblingCount: number): PaginationSlot[];
|
|
31
|
+
export declare function paginationIsGap(slot: PaginationSlot): slot is 'gap-start' | 'gap-end';
|
|
32
|
+
export interface PaginationState {
|
|
33
|
+
/** The clamped current page (see {@link paginationClamp}). */
|
|
34
|
+
current: number;
|
|
35
|
+
pages: number;
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface PaginationChange {
|
|
39
|
+
/** The new page. */
|
|
40
|
+
page: number;
|
|
41
|
+
reason: PaginationReason;
|
|
42
|
+
/**
|
|
43
|
+
* Where focus must go once the page has changed. A stepper that lands on its bound becomes
|
|
44
|
+
* natively disabled while it is focused, which would drop focus to `<body>`; it hands focus
|
|
45
|
+
* to the new current-page button instead. `null` = leave focus where it is.
|
|
46
|
+
*/
|
|
47
|
+
focus: 'current' | null;
|
|
48
|
+
}
|
|
49
|
+
/** A page-number button was pressed. `null` = nothing changes (disabled, or already there). */
|
|
50
|
+
export declare function paginationPagePress(state: PaginationState, target: number): PaginationChange | null;
|
|
51
|
+
/** The Prev / Next stepper was pressed. `null` = nothing changes (disabled, or at the bound). */
|
|
52
|
+
export declare function paginationStep(state: PaginationState, direction: 'prev' | 'next'): PaginationChange | null;
|
|
53
|
+
/** Whether the Prev / Next stepper is disabled: the whole control is, or it sits at its bound. */
|
|
54
|
+
export declare function paginationStepperDisabled(state: PaginationState, direction: 'prev' | 'next'): boolean;
|
|
55
|
+
/** State attributes of one page-number button. */
|
|
56
|
+
export declare function paginationPageAttrs(slot: number, current: number): {
|
|
57
|
+
readonly 'aria-current': "page" | undefined;
|
|
58
|
+
readonly 'aria-label': `Page ${number}`;
|
|
59
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination core (DS-0197) — the page-window maths, the bounds, and what a press on a page
|
|
3
|
+
* button or a stepper does. Pure functions over a small state object; Pagination.svelte holds
|
|
4
|
+
* the state and applies the result. No DOM, no Svelte.
|
|
5
|
+
*/
|
|
6
|
+
/** Number of pages. Derived counts are at least 1, so the control never renders empty. */
|
|
7
|
+
export function paginationPageCount(input) {
|
|
8
|
+
return input.pageCount ?? Math.max(1, Math.ceil((input.total ?? 0) / input.pageSize));
|
|
9
|
+
}
|
|
10
|
+
/** `page` clamped into `[1, pages]`. */
|
|
11
|
+
export function paginationClamp(page, pages) {
|
|
12
|
+
return Math.min(Math.max(1, page), pages);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The windowed list of slots: first page, last page, `siblingCount` pages on each side of
|
|
16
|
+
* `current`, and an ellipsis wherever a run of pages is hidden. A single hidden page is cheaper
|
|
17
|
+
* to show than an ellipsis, so a run only collapses when it hides more than one page.
|
|
18
|
+
*/
|
|
19
|
+
export function paginationSlots(current, pages, siblingCount) {
|
|
20
|
+
const start = Math.max(2, current - siblingCount);
|
|
21
|
+
const end = Math.min(pages - 1, current + siblingCount);
|
|
22
|
+
const out = [1];
|
|
23
|
+
if (start > 3)
|
|
24
|
+
out.push('gap-start');
|
|
25
|
+
else if (start === 3)
|
|
26
|
+
out.push(2);
|
|
27
|
+
for (let p = start; p <= end; p++)
|
|
28
|
+
out.push(p);
|
|
29
|
+
if (end < pages - 2)
|
|
30
|
+
out.push('gap-end');
|
|
31
|
+
else if (end === pages - 2)
|
|
32
|
+
out.push(pages - 1);
|
|
33
|
+
if (pages > 1)
|
|
34
|
+
out.push(pages);
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
export function paginationIsGap(slot) {
|
|
38
|
+
return slot === 'gap-start' || slot === 'gap-end';
|
|
39
|
+
}
|
|
40
|
+
function change(state, target, reason) {
|
|
41
|
+
const page = paginationClamp(target, state.pages);
|
|
42
|
+
if (state.disabled || page === state.current)
|
|
43
|
+
return null;
|
|
44
|
+
const atBound = (reason === 'prev' && page <= 1) || (reason === 'next' && page >= state.pages);
|
|
45
|
+
return { page, reason, focus: atBound ? 'current' : null };
|
|
46
|
+
}
|
|
47
|
+
/** A page-number button was pressed. `null` = nothing changes (disabled, or already there). */
|
|
48
|
+
export function paginationPagePress(state, target) {
|
|
49
|
+
return change(state, target, 'page');
|
|
50
|
+
}
|
|
51
|
+
/** The Prev / Next stepper was pressed. `null` = nothing changes (disabled, or at the bound). */
|
|
52
|
+
export function paginationStep(state, direction) {
|
|
53
|
+
return change(state, state.current + (direction === 'prev' ? -1 : 1), direction);
|
|
54
|
+
}
|
|
55
|
+
/** Whether the Prev / Next stepper is disabled: the whole control is, or it sits at its bound. */
|
|
56
|
+
export function paginationStepperDisabled(state, direction) {
|
|
57
|
+
return (state.disabled || (direction === 'prev' ? state.current <= 1 : state.current >= state.pages));
|
|
58
|
+
}
|
|
59
|
+
/** State attributes of one page-number button. */
|
|
60
|
+
export function paginationPageAttrs(slot, current) {
|
|
61
|
+
return {
|
|
62
|
+
'aria-current': slot === current ? 'page' : undefined,
|
|
63
|
+
'aria-label': `Page ${slot}`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover core (DS-0197) — the one place the popover's behaviour is decided: a non-modal panel
|
|
3
|
+
* anchored to a trigger. Pure functions over a small state object: an event comes in, a
|
|
4
|
+
* {@link PopoverAction} comes out, and the caller applies it (Popover.svelte to its `$state`,
|
|
5
|
+
* `vanilla/popover.ts` to the DOM). No DOM, no Svelte. Sibling of `menu.ts`.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Why the popover opened or closed; passed to `onOpenChange` / `ss:openchange`. `hover`,
|
|
9
|
+
* `focus` and `leave` only occur with `openOn: 'hover'` (DS-0206).
|
|
10
|
+
*/
|
|
11
|
+
export type PopoverReason = 'trigger' | 'escape' | 'outside' | 'tab' | 'hover' | 'focus' | 'leave';
|
|
12
|
+
/**
|
|
13
|
+
* What opens the panel. `press` (default): the trigger toggles it and opening moves focus in.
|
|
14
|
+
* `hover`: a hover card — pointer hover or keyboard focus on the trigger *peeks* it open
|
|
15
|
+
* without moving focus, the pointer may travel onto the panel, and leaving both closes it
|
|
16
|
+
* after a grace period; a press on the trigger *activates* it instead (DS-0206).
|
|
17
|
+
*/
|
|
18
|
+
export type PopoverOpenOn = 'press' | 'hover';
|
|
19
|
+
/** Hover-mode timing (ms): a short intent delay before opening, a grace period before closing. */
|
|
20
|
+
export declare const POPOVER_HOVER_OPEN_DELAY = 100;
|
|
21
|
+
export declare const POPOVER_HOVER_CLOSE_DELAY = 150;
|
|
22
|
+
export interface PopoverOpenChangeDetails {
|
|
23
|
+
reason: PopoverReason;
|
|
24
|
+
}
|
|
25
|
+
export interface PopoverState {
|
|
26
|
+
open: boolean;
|
|
27
|
+
}
|
|
28
|
+
export type PopoverAction =
|
|
29
|
+
/** Show the panel and move focus into it (first focusable element, else the panel). */
|
|
30
|
+
{
|
|
31
|
+
type: 'open';
|
|
32
|
+
reason: PopoverReason;
|
|
33
|
+
}
|
|
34
|
+
/** Show the panel and leave focus where it is (hover mode: hover, focus, a touch tap). */
|
|
35
|
+
| {
|
|
36
|
+
type: 'peek';
|
|
37
|
+
reason: PopoverReason;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'close';
|
|
40
|
+
returnFocus: boolean;
|
|
41
|
+
reason: PopoverReason;
|
|
42
|
+
}
|
|
43
|
+
/** Hover mode: the trigger was pressed — run the trigger's own action (`onactivate`). */
|
|
44
|
+
| {
|
|
45
|
+
type: 'activate';
|
|
46
|
+
};
|
|
47
|
+
/** A key the popover handles: its action, and whether the browser default must be cancelled. */
|
|
48
|
+
export interface PopoverKeyResult {
|
|
49
|
+
action: PopoverAction | null;
|
|
50
|
+
preventDefault: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Where focus went when it left an element of the popover: to another element `inside` it
|
|
54
|
+
* (trigger or panel), to an element `outside` it, or `nowhere` (the window lost focus, or a
|
|
55
|
+
* pointer landed on something that takes none).
|
|
56
|
+
*/
|
|
57
|
+
export type PopoverFocusTarget = 'inside' | 'outside' | 'nowhere';
|
|
58
|
+
/** Open from code (`openPopover`). */
|
|
59
|
+
export declare function popoverOpen(state: PopoverState): PopoverAction | null;
|
|
60
|
+
/** Close from code (`closePopover`). */
|
|
61
|
+
export declare function popoverClose(state: PopoverState, returnFocus?: boolean): PopoverAction | null;
|
|
62
|
+
/** How a hover-mode press arrived, for {@link popoverTriggerPress}. */
|
|
63
|
+
export interface PopoverPressOptions {
|
|
64
|
+
openOn?: PopoverOpenOn;
|
|
65
|
+
/** `PointerEvent.pointerType` of the press, or `''` for a keyboard click. */
|
|
66
|
+
pointerType?: string;
|
|
67
|
+
/** The trigger has its own action (`onactivate` / an `ss:activate` listener). */
|
|
68
|
+
hasAction?: boolean;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The trigger was pressed. Press mode: toggle. Hover mode: a touch or pen tap on a closed card
|
|
72
|
+
* peeks it open (there is no hover to do it); otherwise the press activates the trigger's own
|
|
73
|
+
* action when it has one, and toggles the card (without moving focus) when it does not.
|
|
74
|
+
*/
|
|
75
|
+
export declare function popoverTriggerPress(state: PopoverState, options?: PopoverPressOptions): PopoverAction | null;
|
|
76
|
+
/** Hover mode: the pointer rested on the trigger or the panel (after the open delay). */
|
|
77
|
+
export declare function popoverHoverEnter(state: PopoverState): PopoverAction | null;
|
|
78
|
+
/** Hover mode: the pointer left the trigger and the panel (after the close grace period). */
|
|
79
|
+
export declare function popoverHoverLeave(state: PopoverState): PopoverAction | null;
|
|
80
|
+
/**
|
|
81
|
+
* Focus arrived on the trigger. Hover mode peeks the card open so keyboard users get what a
|
|
82
|
+
* hover shows; Tab then moves on into the panel. Press mode ignores it.
|
|
83
|
+
*/
|
|
84
|
+
export declare function popoverFocusIn(state: PopoverState, openOn?: PopoverOpenOn): PopoverAction | null;
|
|
85
|
+
/**
|
|
86
|
+
* A key anywhere in the popover (trigger or panel). Escape closes an open popover and hands
|
|
87
|
+
* focus back to the trigger. `null` = not a popover key (or nothing to close): let it through,
|
|
88
|
+
* so an enclosing surface still sees it.
|
|
89
|
+
*/
|
|
90
|
+
export declare function popoverKey(state: PopoverState, key: string): PopoverKeyResult | null;
|
|
91
|
+
/** A pointer went down outside the popover: dismiss without pulling focus back. */
|
|
92
|
+
export declare function popoverOutsidePress(state: PopoverState): PopoverAction | null;
|
|
93
|
+
/**
|
|
94
|
+
* Focus left an element of the popover. Tabbing out (focus lands on an element outside) closes
|
|
95
|
+
* it and lets focus go on; moving between the trigger and the panel, or losing focus to nothing,
|
|
96
|
+
* does not — the popover is persistent.
|
|
97
|
+
*/
|
|
98
|
+
export declare function popoverFocusOut(state: PopoverState, to: PopoverFocusTarget): PopoverAction | null;
|
|
99
|
+
export declare function popoverTriggerAttrs(isOpen: boolean): {
|
|
100
|
+
readonly 'aria-haspopup': "dialog";
|
|
101
|
+
readonly 'aria-expanded': "true" | "false";
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* The panel: a non-modal dialog (no `aria-modal`), focusable from code so focus has somewhere
|
|
105
|
+
* to land when the content holds nothing focusable. Closed-state hiding (`inert`) is written by
|
|
106
|
+
* the caller.
|
|
107
|
+
*/
|
|
108
|
+
export declare function popoverPanelAttrs(): {
|
|
109
|
+
readonly role: "dialog";
|
|
110
|
+
readonly tabindex: -1;
|
|
111
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover core (DS-0197) — the one place the popover's behaviour is decided: a non-modal panel
|
|
3
|
+
* anchored to a trigger. Pure functions over a small state object: an event comes in, a
|
|
4
|
+
* {@link PopoverAction} comes out, and the caller applies it (Popover.svelte to its `$state`,
|
|
5
|
+
* `vanilla/popover.ts` to the DOM). No DOM, no Svelte. Sibling of `menu.ts`.
|
|
6
|
+
*/
|
|
7
|
+
/** Hover-mode timing (ms): a short intent delay before opening, a grace period before closing. */
|
|
8
|
+
export const POPOVER_HOVER_OPEN_DELAY = 100;
|
|
9
|
+
export const POPOVER_HOVER_CLOSE_DELAY = 150;
|
|
10
|
+
const open = (state, reason) => state.open ? null : { type: 'open', reason };
|
|
11
|
+
const close = (state, returnFocus, reason) => (state.open ? { type: 'close', returnFocus, reason } : null);
|
|
12
|
+
/** Open from code (`openPopover`). */
|
|
13
|
+
export function popoverOpen(state) {
|
|
14
|
+
return open(state, 'trigger');
|
|
15
|
+
}
|
|
16
|
+
/** Close from code (`closePopover`). */
|
|
17
|
+
export function popoverClose(state, returnFocus = true) {
|
|
18
|
+
return close(state, returnFocus, 'trigger');
|
|
19
|
+
}
|
|
20
|
+
const peek = (state, reason) => state.open ? null : { type: 'peek', reason };
|
|
21
|
+
/**
|
|
22
|
+
* The trigger was pressed. Press mode: toggle. Hover mode: a touch or pen tap on a closed card
|
|
23
|
+
* peeks it open (there is no hover to do it); otherwise the press activates the trigger's own
|
|
24
|
+
* action when it has one, and toggles the card (without moving focus) when it does not.
|
|
25
|
+
*/
|
|
26
|
+
export function popoverTriggerPress(state, options = {}) {
|
|
27
|
+
if (options.openOn !== 'hover') {
|
|
28
|
+
return state.open ? close(state, true, 'trigger') : open(state, 'trigger');
|
|
29
|
+
}
|
|
30
|
+
const touch = options.pointerType === 'touch' || options.pointerType === 'pen';
|
|
31
|
+
if (touch && !state.open)
|
|
32
|
+
return peek(state, 'trigger');
|
|
33
|
+
if (options.hasAction)
|
|
34
|
+
return { type: 'activate' };
|
|
35
|
+
return state.open ? close(state, false, 'trigger') : peek(state, 'trigger');
|
|
36
|
+
}
|
|
37
|
+
/** Hover mode: the pointer rested on the trigger or the panel (after the open delay). */
|
|
38
|
+
export function popoverHoverEnter(state) {
|
|
39
|
+
return peek(state, 'hover');
|
|
40
|
+
}
|
|
41
|
+
/** Hover mode: the pointer left the trigger and the panel (after the close grace period). */
|
|
42
|
+
export function popoverHoverLeave(state) {
|
|
43
|
+
return close(state, false, 'leave');
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Focus arrived on the trigger. Hover mode peeks the card open so keyboard users get what a
|
|
47
|
+
* hover shows; Tab then moves on into the panel. Press mode ignores it.
|
|
48
|
+
*/
|
|
49
|
+
export function popoverFocusIn(state, openOn = 'press') {
|
|
50
|
+
return openOn === 'hover' ? peek(state, 'focus') : null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A key anywhere in the popover (trigger or panel). Escape closes an open popover and hands
|
|
54
|
+
* focus back to the trigger. `null` = not a popover key (or nothing to close): let it through,
|
|
55
|
+
* so an enclosing surface still sees it.
|
|
56
|
+
*/
|
|
57
|
+
export function popoverKey(state, key) {
|
|
58
|
+
if (key !== 'Escape' || !state.open)
|
|
59
|
+
return null;
|
|
60
|
+
return { action: close(state, true, 'escape'), preventDefault: true };
|
|
61
|
+
}
|
|
62
|
+
/** A pointer went down outside the popover: dismiss without pulling focus back. */
|
|
63
|
+
export function popoverOutsidePress(state) {
|
|
64
|
+
return close(state, false, 'outside');
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Focus left an element of the popover. Tabbing out (focus lands on an element outside) closes
|
|
68
|
+
* it and lets focus go on; moving between the trigger and the panel, or losing focus to nothing,
|
|
69
|
+
* does not — the popover is persistent.
|
|
70
|
+
*/
|
|
71
|
+
export function popoverFocusOut(state, to) {
|
|
72
|
+
return to === 'outside' ? close(state, false, 'tab') : null;
|
|
73
|
+
}
|
|
74
|
+
// --- attributes ---------------------------------------------------------------
|
|
75
|
+
// Strings, not booleans, so the Svelte spread and the vanilla `setAttribute` write the same DOM.
|
|
76
|
+
export function popoverTriggerAttrs(isOpen) {
|
|
77
|
+
return { 'aria-haspopup': 'dialog', 'aria-expanded': isOpen ? 'true' : 'false' };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The panel: a non-modal dialog (no `aria-modal`), focusable from code so focus has somewhere
|
|
81
|
+
* to land when the content holds nothing focusable. Closed-state hiding (`inert`) is written by
|
|
82
|
+
* the caller.
|
|
83
|
+
*/
|
|
84
|
+
export function popoverPanelAttrs() {
|
|
85
|
+
return { role: 'dialog', tabindex: -1 };
|
|
86
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface RadioState {
|
|
2
|
+
/** Index of the selected option, `-1` when none. */
|
|
3
|
+
selected: number;
|
|
4
|
+
/** Indexes of the enabled options, in DOM order (empty when the whole group is disabled). */
|
|
5
|
+
enabled: readonly number[];
|
|
6
|
+
}
|
|
7
|
+
/** Select option `index`. `changed` is false when it already was the selection (no event). */
|
|
8
|
+
export interface RadioAction {
|
|
9
|
+
type: 'select';
|
|
10
|
+
index: number;
|
|
11
|
+
changed: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The enabled option indexes: `optionDisabled[i]` is each option's own flag, and a disabled
|
|
15
|
+
* group enables nothing.
|
|
16
|
+
*/
|
|
17
|
+
export declare function radioEnabled(optionDisabled: readonly boolean[], groupDisabled: boolean): number[];
|
|
18
|
+
/** An option was picked (pressed, or reached with an arrow key). `null` when it is disabled. */
|
|
19
|
+
export declare function radioPress(state: RadioState, index: number): RadioAction | null;
|
|
20
|
+
/**
|
|
21
|
+
* The index that owns the group's single tab stop: the selected option when it is enabled,
|
|
22
|
+
* otherwise the first enabled one (so a group with no selection, or with a disabled selection,
|
|
23
|
+
* is still reachable); `-1` when nothing is enabled.
|
|
24
|
+
*/
|
|
25
|
+
export declare function radioTabStop(state: RadioState): number;
|
|
26
|
+
export declare function radioGroupAttrs(disabled: boolean): {
|
|
27
|
+
readonly role: "radiogroup";
|
|
28
|
+
readonly 'aria-disabled': "true" | undefined;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Attributes for one native radio. No `role` and no `aria-checked`: the input already exposes
|
|
32
|
+
* both from its `checked` property.
|
|
33
|
+
*/
|
|
34
|
+
export declare function radioInputAttrs(index: number, tabStop: number): {
|
|
35
|
+
readonly tabindex: 0 | -1;
|
|
36
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RadioGroup core (DS-0197) — the decisions that belong to the group, shared by
|
|
3
|
+
* RadioGroup.svelte and `vanilla/radio.ts`. Pure functions: no DOM, no Svelte.
|
|
4
|
+
*
|
|
5
|
+
* The options are native `<input type="radio">` elements sharing a `name`, so the browser owns
|
|
6
|
+
* arrow-key movement (wrapping, skipping disabled, mirrored under RTL), Space and form
|
|
7
|
+
* submission, and reports every one of them as a `change` event on the newly checked input.
|
|
8
|
+
* What stays ours is decided here: which options are enabled, what a press on an option
|
|
9
|
+
* selects, which option is the tab stop (most of all when nothing is selected), and the state
|
|
10
|
+
* attributes. A press and an arrow key cannot be told apart reliably from a `change` event, so
|
|
11
|
+
* there is no `reason`: the callback and the `ss:change` event carry the new value only.
|
|
12
|
+
*/
|
|
13
|
+
import { rovingTabindex } from './behaviors/roving.js';
|
|
14
|
+
/**
|
|
15
|
+
* The enabled option indexes: `optionDisabled[i]` is each option's own flag, and a disabled
|
|
16
|
+
* group enables nothing.
|
|
17
|
+
*/
|
|
18
|
+
export function radioEnabled(optionDisabled, groupDisabled) {
|
|
19
|
+
if (groupDisabled)
|
|
20
|
+
return [];
|
|
21
|
+
return optionDisabled.map((off, index) => (off ? -1 : index)).filter((index) => index >= 0);
|
|
22
|
+
}
|
|
23
|
+
/** An option was picked (pressed, or reached with an arrow key). `null` when it is disabled. */
|
|
24
|
+
export function radioPress(state, index) {
|
|
25
|
+
return state.enabled.includes(index)
|
|
26
|
+
? { type: 'select', index, changed: index !== state.selected }
|
|
27
|
+
: null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The index that owns the group's single tab stop: the selected option when it is enabled,
|
|
31
|
+
* otherwise the first enabled one (so a group with no selection, or with a disabled selection,
|
|
32
|
+
* is still reachable); `-1` when nothing is enabled.
|
|
33
|
+
*/
|
|
34
|
+
export function radioTabStop(state) {
|
|
35
|
+
return state.enabled.includes(state.selected) ? state.selected : (state.enabled[0] ?? -1);
|
|
36
|
+
}
|
|
37
|
+
// --- attributes ---------------------------------------------------------------
|
|
38
|
+
// Strings, not booleans, so the Svelte spread and the vanilla `setAttribute` write the same DOM.
|
|
39
|
+
export function radioGroupAttrs(disabled) {
|
|
40
|
+
return { role: 'radiogroup', 'aria-disabled': disabled ? 'true' : undefined };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Attributes for one native radio. No `role` and no `aria-checked`: the input already exposes
|
|
44
|
+
* both from its `checked` property.
|
|
45
|
+
*/
|
|
46
|
+
export function radioInputAttrs(index, tabStop) {
|
|
47
|
+
return { tabindex: rovingTabindex(index, tabStop) };
|
|
48
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/** Why the palette opened or closed; passed to `onopen` / `onclose`. */
|
|
2
|
+
export type SearchPaletteReason =
|
|
3
|
+
/** The toggle shortcut (`mod+k`). */
|
|
4
|
+
'shortcut'
|
|
5
|
+
/** Escape (the native dialog's `cancel`). */
|
|
6
|
+
| 'escape'
|
|
7
|
+
/** A press on the backdrop. */
|
|
8
|
+
| 'backdrop'
|
|
9
|
+
/** The × close button. */
|
|
10
|
+
| 'close-button'
|
|
11
|
+
/** An item was chosen. */
|
|
12
|
+
| 'select'
|
|
13
|
+
/** The consumer changed `open` (or called the dialog's `close()`) itself. */
|
|
14
|
+
| 'prop';
|
|
15
|
+
export interface SearchPaletteOpenDetails {
|
|
16
|
+
reason: SearchPaletteReason;
|
|
17
|
+
}
|
|
18
|
+
/** The fields of an item the core reads. */
|
|
19
|
+
export interface SearchItemLike {
|
|
20
|
+
label: string;
|
|
21
|
+
group?: string;
|
|
22
|
+
keywords?: string[];
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
href?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Case- and diacritic-insensitive fold ("São" matches "sao"). */
|
|
27
|
+
export declare function searchFold(text: string): string;
|
|
28
|
+
/** Items whose label or keywords contain the query; a blank query keeps them all. */
|
|
29
|
+
export declare function searchFilter<T extends SearchItemLike>(items: readonly T[], query: string): T[];
|
|
30
|
+
export interface SearchGroup<T> {
|
|
31
|
+
/** Group heading; `null` for the ungrouped bucket. */
|
|
32
|
+
label: string | null;
|
|
33
|
+
/** The bucket's items with their flat index (keyboard order equals DOM order). */
|
|
34
|
+
entries: {
|
|
35
|
+
item: T;
|
|
36
|
+
index: number;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
/** Buckets in first-appearance order, the ungrouped one (label `null`) always first. */
|
|
40
|
+
export declare function searchGroups<T extends SearchItemLike>(items: readonly T[]): SearchGroup<T>[];
|
|
41
|
+
/** The grouped items in display order — what the flat `index` of an entry points into. */
|
|
42
|
+
export declare function searchFlat<T>(groups: readonly SearchGroup<T>[]): T[];
|
|
43
|
+
/** Live-region text: silent until the user types, then the count (or the no-results text). */
|
|
44
|
+
export declare function searchStatus(query: string, count: number, resultsText: (count: number) => string, emptyText: string): string;
|
|
45
|
+
export interface SearchPaletteState {
|
|
46
|
+
open: boolean;
|
|
47
|
+
/** Flat index of the active option. */
|
|
48
|
+
active: number;
|
|
49
|
+
/** The options in display order (see {@link searchFlat}). */
|
|
50
|
+
items: readonly Pick<SearchItemLike, 'disabled' | 'href'>[];
|
|
51
|
+
}
|
|
52
|
+
/** The option a fresh list starts on: the first selectable one (0 when there is none). */
|
|
53
|
+
export declare function searchFirstActive(state: SearchPaletteState): number;
|
|
54
|
+
/** `active` when it still points at a selectable option, else the first selectable one. */
|
|
55
|
+
export declare function searchValidActive(state: SearchPaletteState): number;
|
|
56
|
+
/** The pointer moved over an option: it becomes active unless disabled (`null`). */
|
|
57
|
+
export declare function searchHover(state: SearchPaletteState, index: number): number | null;
|
|
58
|
+
export type SearchPaletteAction = {
|
|
59
|
+
type: 'open';
|
|
60
|
+
reason: SearchPaletteReason;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'close';
|
|
63
|
+
reason: SearchPaletteReason;
|
|
64
|
+
}
|
|
65
|
+
/** Make `index` the active option and scroll it into view. */
|
|
66
|
+
| {
|
|
67
|
+
type: 'move';
|
|
68
|
+
index: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Activate option `index`. `via: 'anchor'` = it is a link: click the rendered `<a>` so the
|
|
72
|
+
* router's/native navigation applies (its click handler then runs the item press).
|
|
73
|
+
*/
|
|
74
|
+
| {
|
|
75
|
+
type: 'activate';
|
|
76
|
+
index: number;
|
|
77
|
+
via: 'anchor' | 'item';
|
|
78
|
+
};
|
|
79
|
+
/** A key the palette handles: its action, and whether the browser default must be cancelled. */
|
|
80
|
+
export interface SearchPaletteKeyResult {
|
|
81
|
+
action: SearchPaletteAction | null;
|
|
82
|
+
preventDefault: boolean;
|
|
83
|
+
}
|
|
84
|
+
/** The toggle shortcut fired. */
|
|
85
|
+
export declare function searchShortcut(isOpen: boolean): SearchPaletteAction;
|
|
86
|
+
/**
|
|
87
|
+
* The backdrop was clicked; `onBackdrop` = the press both started and ended on the dialog
|
|
88
|
+
* itself, not the panel. Called on `click`, not `pointerdown`, for the same reason as
|
|
89
|
+
* `modalBackdropPress`: closing on the pointerdown lets the gesture's mousedown drop the
|
|
90
|
+
* returned focus on `<body>` (DS-0205).
|
|
91
|
+
*/
|
|
92
|
+
export declare function searchBackdropPress(state: SearchPaletteState, onBackdrop: boolean): SearchPaletteAction | null;
|
|
93
|
+
/** The × close button was pressed. */
|
|
94
|
+
export declare function searchClosePress(state: SearchPaletteState): SearchPaletteAction | null;
|
|
95
|
+
/** An activated option: it is selected, and `close` dismisses the palette unless the
|
|
96
|
+
* consumer's `onselect` returned `false`. */
|
|
97
|
+
export interface SearchItemResult {
|
|
98
|
+
close: SearchPaletteAction | null;
|
|
99
|
+
}
|
|
100
|
+
/** An option was activated (click or Enter). `null` when it is disabled or missing. */
|
|
101
|
+
export declare function searchItemPress(state: SearchPaletteState, index: number): SearchItemResult | null;
|
|
102
|
+
/**
|
|
103
|
+
* A key on the input. `null` = not a palette key, let it through (typing, caret keys — Home/End
|
|
104
|
+
* stay native per the APG combobox; PageUp/PageDown jump to the first/last option instead).
|
|
105
|
+
* `composing` = an IME composition is in progress: every key belongs to it.
|
|
106
|
+
*/
|
|
107
|
+
export declare function searchInputKey(state: SearchPaletteState, key: string, composing?: boolean): SearchPaletteKeyResult | null;
|
|
108
|
+
/** Combobox state on the input; `activeId` is the DOM id of the active option. */
|
|
109
|
+
export declare function searchInputAttrs(count: number, activeId: string): {
|
|
110
|
+
readonly role: "combobox";
|
|
111
|
+
readonly 'aria-autocomplete': "list";
|
|
112
|
+
readonly 'aria-expanded': "true" | "false";
|
|
113
|
+
readonly 'aria-activedescendant': string | undefined;
|
|
114
|
+
};
|
|
115
|
+
export declare function searchOptionAttrs(option: {
|
|
116
|
+
index: number;
|
|
117
|
+
active: number;
|
|
118
|
+
disabled?: boolean;
|
|
119
|
+
}): {
|
|
120
|
+
readonly role: "option";
|
|
121
|
+
readonly 'aria-selected': "true" | "false";
|
|
122
|
+
readonly 'aria-disabled': "true" | undefined;
|
|
123
|
+
readonly tabindex: -1;
|
|
124
|
+
};
|