@sveltia/ui 0.91.0 → 0.92.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/dist/components/bottom-navigation/bottom-navigation.svelte +3 -9
- package/dist/components/bottom-navigation/bottom-navigation.svelte.d.ts +4 -39
- package/dist/components/button/button-group.svelte +2 -4
- package/dist/components/button/button-group.svelte.d.ts +3 -19
- package/dist/components/button/select-button-group.svelte +2 -13
- package/dist/components/button/select-button-group.svelte.d.ts +5 -67
- package/dist/components/calendar/calendar.d.ts +9 -0
- package/dist/components/calendar/calendar.js +43 -0
- package/dist/components/calendar/calendar.svelte +26 -27
- package/dist/components/checkbox/checkbox-group.svelte +2 -8
- package/dist/components/checkbox/checkbox-group.svelte.d.ts +4 -39
- package/dist/components/dialog/alert-dialog.svelte.d.ts +2 -3
- package/dist/components/dialog/confirmation-dialog.svelte.d.ts +2 -3
- package/dist/components/dialog/dialog.svelte +6 -7
- package/dist/components/dialog/dialog.svelte.d.ts +2 -3
- package/dist/components/dialog/prompt-dialog.svelte +2 -2
- package/dist/components/dialog/prompt-dialog.svelte.d.ts +2 -3
- package/dist/components/disclosure/disclosure.svelte +14 -16
- package/dist/components/disclosure/disclosure.svelte.d.ts +4 -38
- package/dist/components/drawer/drawer.svelte +22 -39
- package/dist/components/drawer/drawer.svelte.d.ts +3 -24
- package/dist/components/grid/grid-body.svelte +2 -3
- package/dist/components/grid/grid-body.svelte.d.ts +3 -18
- package/dist/components/grid/grid-cell.svelte +2 -8
- package/dist/components/grid/grid-cell.svelte.d.ts +3 -22
- package/dist/components/grid/grid-col-header.svelte +2 -4
- package/dist/components/grid/grid-col-header.svelte.d.ts +3 -19
- package/dist/components/grid/grid-foot.svelte +4 -9
- package/dist/components/grid/grid-foot.svelte.d.ts +3 -22
- package/dist/components/grid/grid-head.svelte +4 -9
- package/dist/components/grid/grid-head.svelte.d.ts +3 -22
- package/dist/components/grid/grid-row-header.svelte +2 -8
- package/dist/components/grid/grid-row-header.svelte.d.ts +3 -22
- package/dist/components/grid/grid-row.svelte +4 -5
- package/dist/components/grid/grid-row.svelte.d.ts +3 -19
- package/dist/components/grid/grid.d.ts +10 -0
- package/dist/components/grid/grid.js +11 -0
- package/dist/components/grid/grid.svelte +6 -7
- package/dist/components/grid/grid.svelte.d.ts +5 -21
- package/dist/components/listbox/listbox.svelte +34 -15
- package/dist/components/listbox/listbox.svelte.d.ts +5 -69
- package/dist/components/listbox/option-group.svelte +2 -8
- package/dist/components/listbox/option-group.svelte.d.ts +4 -39
- package/dist/components/listbox/option.svelte +2 -1
- package/dist/components/menu/menu-item-group.svelte +2 -6
- package/dist/components/menu/menu-item-group.svelte.d.ts +3 -22
- package/dist/components/menu/menu-item.svelte +5 -1
- package/dist/components/menu/menu.svelte +2 -8
- package/dist/components/menu/menu.svelte.d.ts +4 -39
- package/dist/components/radio/radio-group.svelte +2 -17
- package/dist/components/radio/radio-group.svelte.d.ts +5 -67
- package/dist/components/radio/radio.svelte +19 -22
- package/dist/components/radio/radio.svelte.d.ts +10 -40
- package/dist/components/resizable-pane/resizable-handle.svelte +42 -49
- package/dist/components/resizable-pane/resizable-pane-group.svelte +44 -58
- package/dist/components/resizable-pane/resizable-pane-group.svelte.d.ts +3 -19
- package/dist/components/resizable-pane/resizable-pane.svelte +2 -5
- package/dist/components/resizable-pane/resizable-pane.svelte.d.ts +3 -19
- package/dist/components/resizable-pane/sizing.d.ts +24 -0
- package/dist/components/resizable-pane/sizing.js +83 -0
- package/dist/components/select/combobox.svelte +35 -39
- package/dist/components/select/select-tags.svelte +3 -13
- package/dist/components/select/select-tags.svelte.d.ts +5 -67
- package/dist/components/slider/slider.d.ts +5 -4
- package/dist/components/slider/slider.js +28 -23
- package/dist/components/slider/slider.svelte +64 -62
- package/dist/components/slider/slider.svelte.d.ts +4 -37
- package/dist/components/switch/switch.svelte +2 -13
- package/dist/components/switch/switch.svelte.d.ts +5 -67
- package/dist/components/table/table-body.svelte +2 -4
- package/dist/components/table/table-body.svelte.d.ts +3 -19
- package/dist/components/table/table-cell.svelte +2 -8
- package/dist/components/table/table-cell.svelte.d.ts +3 -22
- package/dist/components/table/table-col-header.svelte +2 -8
- package/dist/components/table/table-col-header.svelte.d.ts +3 -22
- package/dist/components/table/table-foot.svelte +2 -8
- package/dist/components/table/table-foot.svelte.d.ts +3 -22
- package/dist/components/table/table-head.svelte +2 -8
- package/dist/components/table/table-head.svelte.d.ts +3 -22
- package/dist/components/table/table-part.svelte +2 -4
- package/dist/components/table/table-part.svelte.d.ts +3 -19
- package/dist/components/table/table-row-header.svelte +2 -8
- package/dist/components/table/table-row-header.svelte.d.ts +3 -22
- package/dist/components/table/table-row.svelte +2 -8
- package/dist/components/table/table-row.svelte.d.ts +3 -22
- package/dist/components/table/table.svelte +2 -4
- package/dist/components/table/table.svelte.d.ts +3 -19
- package/dist/components/tabs/tab-box.svelte +2 -4
- package/dist/components/tabs/tab-box.svelte.d.ts +3 -19
- package/dist/components/tabs/tab-list.svelte +2 -7
- package/dist/components/tabs/tab-list.svelte.d.ts +4 -37
- package/dist/components/tabs/tab-panel.svelte +2 -8
- package/dist/components/tabs/tab-panel.svelte.d.ts +3 -22
- package/dist/components/tabs/tab-panels.svelte +2 -8
- package/dist/components/tabs/tab-panels.svelte.d.ts +3 -22
- package/dist/components/text-editor/code-editor.js +14 -7
- package/dist/components/text-editor/code-editor.svelte +14 -22
- package/dist/components/text-editor/code-editor.svelte.d.ts +5 -103
- package/dist/components/text-editor/config.d.ts +73 -0
- package/dist/components/text-editor/config.js +110 -0
- package/dist/components/text-editor/conversion/editor-components.js +4 -4
- package/dist/components/text-editor/conversion/html/export.js +1 -1
- package/dist/components/text-editor/conversion/import.js +32 -26
- package/dist/components/text-editor/conversion/markdown/block-conversion.d.ts +4 -0
- package/dist/components/text-editor/conversion/markdown/block-conversion.js +154 -0
- package/dist/components/text-editor/conversion/markdown/block-structure.d.ts +16 -0
- package/dist/components/text-editor/conversion/markdown/block-structure.js +254 -0
- package/dist/components/text-editor/conversion/markdown/code-blocks.d.ts +57 -0
- package/dist/components/text-editor/conversion/markdown/code-blocks.js +279 -0
- package/dist/components/text-editor/conversion/markdown/code-spans.d.ts +19 -0
- package/dist/components/text-editor/conversion/markdown/code-spans.js +71 -0
- package/dist/components/text-editor/conversion/markdown/formatting.d.ts +22 -0
- package/dist/components/text-editor/conversion/markdown/formatting.js +451 -0
- package/dist/components/text-editor/conversion/markdown/index.d.ts +10 -0
- package/dist/components/text-editor/conversion/markdown/index.js +55 -0
- package/dist/components/text-editor/conversion/markdown/placeholders.d.ts +2 -0
- package/dist/components/text-editor/conversion/markdown/placeholders.js +229 -0
- package/dist/components/text-editor/conversion/markdown/syntax.d.ts +99 -0
- package/dist/components/text-editor/conversion/markdown/syntax.js +206 -0
- package/dist/components/text-editor/conversion/placeholder-chars.d.ts +43 -0
- package/dist/components/text-editor/conversion/placeholder-chars.js +51 -0
- package/dist/components/text-editor/conversion/transformers/block-escape.d.ts +1 -0
- package/dist/components/text-editor/conversion/transformers/block-escape.js +53 -26
- package/dist/components/text-editor/conversion/transformers/code.d.ts +3 -14
- package/dist/components/text-editor/conversion/transformers/code.js +78 -16
- package/dist/components/text-editor/conversion/transformers/formatted-code.js +3 -18
- package/dist/components/text-editor/conversion/transformers/inline-code.js +3 -1
- package/dist/components/text-editor/conversion/transformers/link.js +3 -1
- package/dist/components/text-editor/conversion/transformers/raw-syntax.d.ts +0 -19
- package/dist/components/text-editor/conversion/transformers/raw-syntax.js +22 -93
- package/dist/components/text-editor/conversion/transformers/table.js +57 -16
- package/dist/components/text-editor/conversion/update.d.ts +19 -2
- package/dist/components/text-editor/conversion/update.js +63 -39
- package/dist/components/text-editor/core.d.ts +12 -51
- package/dist/components/text-editor/core.js +44 -66
- package/dist/components/text-editor/editing/raw-markdown.d.ts +3 -0
- package/dist/components/text-editor/editing/raw-markdown.js +46 -2
- package/dist/components/text-editor/lexical-root.svelte +49 -47
- package/dist/components/text-editor/lexical-root.svelte.d.ts +4 -67
- package/dist/components/text-editor/shiki/{facade.d.ts → engine.d.ts} +8 -8
- package/dist/components/text-editor/shiki/{facade.js → engine.js} +53 -156
- package/dist/components/text-editor/shiki/highlighter.js +5 -5
- package/dist/components/text-editor/shiki/lexical.d.ts +6 -0
- package/dist/components/text-editor/shiki/lexical.js +165 -0
- package/dist/components/text-editor/shiki/preload.js +1 -1
- package/dist/components/text-editor/shiki/source-highlight.svelte.d.ts +15 -0
- package/dist/components/text-editor/shiki/source-highlight.svelte.js +120 -0
- package/dist/components/text-editor/shiki/version.d.ts +1 -1
- package/dist/components/text-editor/shiki/version.js +1 -1
- package/dist/components/text-editor/store.svelte.js +65 -16
- package/dist/components/text-editor/text-editor.svelte +53 -145
- package/dist/components/text-editor/text-editor.svelte.d.ts +5 -103
- package/dist/components/text-editor/toolbar/actions.d.ts +25 -0
- package/dist/components/text-editor/toolbar/actions.js +107 -0
- package/dist/components/text-editor/toolbar/align-menu-button.svelte +16 -14
- package/dist/components/text-editor/toolbar/format-text-button.svelte +26 -24
- package/dist/components/text-editor/toolbar/insert-horizontal-rule-button.svelte +23 -23
- package/dist/components/text-editor/toolbar/insert-item-button.svelte +1 -1
- package/dist/components/text-editor/toolbar/insert-link-button.svelte +47 -51
- package/dist/components/text-editor/toolbar/insert-menu-button.svelte +1 -1
- package/dist/components/text-editor/toolbar/insert-table-button.svelte +35 -52
- package/dist/components/text-editor/toolbar/table-action-menu.svelte +19 -17
- package/dist/components/text-editor/toolbar/text-editor-toolbar.svelte +16 -4
- package/dist/components/text-editor/toolbar/text-editor-toolbar.svelte.d.ts +0 -8
- package/dist/components/text-editor/toolbar/toggle-block-menu-item.svelte +34 -33
- package/dist/components/text-editor/widgets/emoji-autocomplete.svelte +7 -6
- package/dist/components/text-editor/widgets/floating-link-editor.svelte +19 -32
- package/dist/components/text-editor/widgets/table-cell-menu-button.svelte +28 -32
- package/dist/components/text-field/date-time-input.svelte +7 -8
- package/dist/components/text-field/date-time-input.svelte.d.ts +3 -32
- package/dist/components/text-field/number-input.d.ts +0 -2
- package/dist/components/text-field/number-input.js +25 -25
- package/dist/components/text-field/number-input.svelte +18 -9
- package/dist/components/text-field/number-input.svelte.d.ts +1 -1
- package/dist/components/text-field/text-area.d.ts +2 -0
- package/dist/components/text-field/text-area.js +31 -0
- package/dist/components/text-field/text-area.svelte +12 -25
- package/dist/components/text-field/text-area.svelte.d.ts +5 -67
- package/dist/components/toast/toast.svelte +31 -8
- package/dist/components/toast/toast.svelte.d.ts +6 -6
- package/dist/components/toolbar/toolbar.svelte +2 -7
- package/dist/components/toolbar/toolbar.svelte.d.ts +4 -37
- package/dist/components/tree/tree-item.svelte +2 -6
- package/dist/components/tree/tree-item.svelte.d.ts +3 -22
- package/dist/components/tree/tree.svelte +3 -10
- package/dist/components/tree/tree.svelte.d.ts +4 -39
- package/dist/components/util/group.svelte +2 -7
- package/dist/components/util/group.svelte.d.ts +4 -37
- package/dist/components/util/modal.d.ts +9 -0
- package/dist/components/util/modal.js +30 -0
- package/dist/components/util/modal.svelte +16 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/hu.yaml +176 -0
- package/dist/services/composite-widget.svelte.d.ts +76 -0
- package/dist/services/composite-widget.svelte.js +157 -0
- package/dist/services/focus.d.ts +2 -0
- package/dist/services/focus.js +68 -0
- package/dist/services/group.svelte.d.ts +17 -69
- package/dist/services/group.svelte.js +128 -391
- package/dist/services/label.d.ts +9 -0
- package/dist/services/label.js +22 -0
- package/dist/services/menu.d.ts +8 -0
- package/dist/services/menu.js +237 -0
- package/dist/services/navigation.d.ts +9 -0
- package/dist/services/navigation.js +13 -0
- package/dist/services/number.d.ts +2 -0
- package/dist/services/number.js +27 -0
- package/dist/services/pointer-drag.d.ts +14 -0
- package/dist/services/pointer-drag.js +89 -0
- package/dist/services/popup.svelte.js +123 -103
- package/dist/services/text.d.ts +3 -0
- package/dist/services/text.js +17 -0
- package/dist/services/tree.svelte.d.ts +29 -43
- package/dist/services/tree.svelte.js +58 -105
- package/dist/services/type-ahead.d.ts +10 -1
- package/dist/services/type-ahead.js +56 -34
- package/dist/typedefs.d.ts +103 -4
- package/dist/typedefs.js +60 -4
- package/package.json +1 -1
- package/dist/components/text-editor/conversion/markdown.d.ts +0 -56
- package/dist/components/text-editor/conversion/markdown.js +0 -949
- package/dist/components/text-editor/toolbar/code-editor-toolbar.svelte +0 -28
- package/dist/components/text-editor/toolbar/code-editor-toolbar.svelte.d.ts +0 -37
- package/dist/components/text-editor/toolbar/insert-component.d.ts +0 -3
- package/dist/components/text-editor/toolbar/insert-component.js +0 -37
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
/**
|
|
3
|
-
* @import {
|
|
3
|
+
* @import { ContainerProps, WidgetStateProps } from '../../typedefs.js';
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @typedef {object} Props
|
|
8
|
-
* @property {string} [class] The `class` attribute on the wrapper element.
|
|
9
|
-
* @property {boolean} [hidden] Whether to hide the widget. An alias of the `aria-hidden`
|
|
10
|
-
* attribute.
|
|
11
|
-
* @property {boolean} [disabled] Whether to disable the widget. An alias of the `aria-disabled`
|
|
12
|
-
* attribute.
|
|
13
8
|
* @property {string} [title] Text label displayed above the group items.
|
|
14
|
-
* @property {Snippet} [children] Primary slot content.
|
|
15
9
|
*/
|
|
16
10
|
|
|
17
11
|
/**
|
|
18
|
-
* @type {Props & Record<string, any>}
|
|
12
|
+
* @type {ContainerProps & WidgetStateProps & Props & Record<string, any>}
|
|
19
13
|
*/
|
|
20
14
|
let {
|
|
21
15
|
/* eslint-disable prefer-const */
|
|
@@ -32,7 +26,7 @@
|
|
|
32
26
|
|
|
33
27
|
<style>.bottom-navigation {
|
|
34
28
|
height: var(--sui-bottom-navigation-height, var(--sui-primary-toolbar-size));
|
|
35
|
-
border-top-width: var(--sui-bottom-navigation-border-
|
|
29
|
+
border-top-width: var(--sui-bottom-navigation-border-width, 1px);
|
|
36
30
|
border-top-style: var(--sui-bottom-navigation-border-style, solid);
|
|
37
31
|
border-top-color: var(--sui-bottom-navigation-border-color, var(--sui-secondary-border-color));
|
|
38
32
|
}
|
|
@@ -1,54 +1,19 @@
|
|
|
1
1
|
export default BottomNavigation;
|
|
2
2
|
type BottomNavigation = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
4
|
+
$set?(props: Partial<ContainerProps & WidgetStateProps & Props & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
|
-
declare const BottomNavigation: import("svelte").Component<{
|
|
7
|
-
/**
|
|
8
|
-
* The `class` attribute on the wrapper element.
|
|
9
|
-
*/
|
|
10
|
-
class?: string | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Whether to hide the widget. An alias of the `aria-hidden`
|
|
13
|
-
* attribute.
|
|
14
|
-
*/
|
|
15
|
-
hidden?: boolean | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to disable the widget. An alias of the `aria-disabled`
|
|
18
|
-
* attribute.
|
|
19
|
-
*/
|
|
20
|
-
disabled?: boolean | undefined;
|
|
6
|
+
declare const BottomNavigation: import("svelte").Component<ContainerProps & WidgetStateProps & {
|
|
21
7
|
/**
|
|
22
8
|
* Text label displayed above the group items.
|
|
23
9
|
*/
|
|
24
10
|
title?: string | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Primary slot content.
|
|
27
|
-
*/
|
|
28
|
-
children?: Snippet<[]> | undefined;
|
|
29
11
|
} & Record<string, any>, {}, "">;
|
|
30
12
|
type Props = {
|
|
31
|
-
/**
|
|
32
|
-
* The `class` attribute on the wrapper element.
|
|
33
|
-
*/
|
|
34
|
-
class?: string | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Whether to hide the widget. An alias of the `aria-hidden`
|
|
37
|
-
* attribute.
|
|
38
|
-
*/
|
|
39
|
-
hidden?: boolean | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Whether to disable the widget. An alias of the `aria-disabled`
|
|
42
|
-
* attribute.
|
|
43
|
-
*/
|
|
44
|
-
disabled?: boolean | undefined;
|
|
45
13
|
/**
|
|
46
14
|
* Text label displayed above the group items.
|
|
47
15
|
*/
|
|
48
16
|
title?: string | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Primary slot content.
|
|
51
|
-
*/
|
|
52
|
-
children?: Snippet<[]> | undefined;
|
|
53
17
|
};
|
|
54
|
-
import type {
|
|
18
|
+
import type { ContainerProps } from '../../typedefs.js';
|
|
19
|
+
import type { WidgetStateProps } from '../../typedefs.js';
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
/**
|
|
3
|
-
* @import {
|
|
3
|
+
* @import { ContainerProps } from '../../typedefs.js';
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @typedef {object} Props
|
|
8
|
-
* @property {string} [class] The `class` attribute on the wrapper element.
|
|
9
8
|
* @property {string} [ariaLabel] The `aria-label` attribute on the wrapper element.
|
|
10
|
-
* @property {Snippet} [children] Primary slot content.
|
|
11
9
|
*/
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
|
-
* @type {Props & Record<string, any>}
|
|
12
|
+
* @type {ContainerProps & Props & Record<string, any>}
|
|
15
13
|
*/
|
|
16
14
|
let {
|
|
17
15
|
/* eslint-disable prefer-const */
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
export default ButtonGroup;
|
|
2
2
|
type ButtonGroup = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
4
|
+
$set?(props: Partial<ContainerProps & Props & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
|
-
declare const ButtonGroup: import("svelte").Component<{
|
|
7
|
-
/**
|
|
8
|
-
* The `class` attribute on the wrapper element.
|
|
9
|
-
*/
|
|
10
|
-
class?: string | undefined;
|
|
6
|
+
declare const ButtonGroup: import("svelte").Component<ContainerProps & {
|
|
11
7
|
/**
|
|
12
8
|
* The `aria-label` attribute on the wrapper element.
|
|
13
9
|
*/
|
|
14
10
|
ariaLabel?: string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Primary slot content.
|
|
17
|
-
*/
|
|
18
|
-
children?: Snippet<[]> | undefined;
|
|
19
11
|
} & Record<string, any>, {}, "">;
|
|
20
12
|
type Props = {
|
|
21
|
-
/**
|
|
22
|
-
* The `class` attribute on the wrapper element.
|
|
23
|
-
*/
|
|
24
|
-
class?: string | undefined;
|
|
25
13
|
/**
|
|
26
14
|
* The `aria-label` attribute on the wrapper element.
|
|
27
15
|
*/
|
|
28
16
|
ariaLabel?: string | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Primary slot content.
|
|
31
|
-
*/
|
|
32
|
-
children?: Snippet<[]> | undefined;
|
|
33
17
|
};
|
|
34
|
-
import type {
|
|
18
|
+
import type { ContainerProps } from '../../typedefs.js';
|
|
@@ -8,28 +8,17 @@
|
|
|
8
8
|
import { activateGroup } from '../../services/group.svelte.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @import {
|
|
11
|
+
* @import { ContainerProps, FormFieldStateProps, WidgetStateProps } from '../../typedefs.js';
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @typedef {object} Props
|
|
16
|
-
* @property {string} [class] The `class` attribute on the wrapper element.
|
|
17
|
-
* @property {boolean} [hidden] Whether to hide the widget.
|
|
18
|
-
* @property {boolean} [disabled] Whether to disable the widget. An alias of the `aria-disabled`
|
|
19
|
-
* attribute.
|
|
20
|
-
* @property {boolean} [readonly] Whether to make the widget read-only. An alias of the
|
|
21
|
-
* `aria-readonly` attribute.
|
|
22
|
-
* @property {boolean} [required] Whether to mark the widget required. An alias of the
|
|
23
|
-
* `aria-required` attribute.
|
|
24
|
-
* @property {boolean} [invalid] Whether to mark the widget invalid. An alias of the
|
|
25
|
-
* `aria-invalid` attribute.
|
|
26
16
|
* @property {string} [ariaLabel] The `aria-label` attribute on the wrapper element.
|
|
27
|
-
* @property {Snippet} [children] Primary slot content.
|
|
28
17
|
* @property {(event: CustomEvent) => void} [onChange] Custom `Change` event handler.
|
|
29
18
|
*/
|
|
30
19
|
|
|
31
20
|
/**
|
|
32
|
-
* @type {Props & Record<string, any>}
|
|
21
|
+
* @type {ContainerProps & WidgetStateProps & FormFieldStateProps & Props & Record<string, any>}
|
|
33
22
|
*/
|
|
34
23
|
let {
|
|
35
24
|
/* eslint-disable prefer-const */
|
|
@@ -1,95 +1,33 @@
|
|
|
1
1
|
export default SelectButtonGroup;
|
|
2
2
|
type SelectButtonGroup = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
4
|
+
$set?(props: Partial<ContainerProps & WidgetStateProps & FormFieldStateProps & Props & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* A variant of `<RadioGroup>`, looking like normal buttons.
|
|
8
8
|
* @see https://w3c.github.io/aria/#radiogroup
|
|
9
9
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
10
10
|
*/
|
|
11
|
-
declare const SelectButtonGroup: import("svelte").Component<{
|
|
12
|
-
/**
|
|
13
|
-
* The `class` attribute on the wrapper element.
|
|
14
|
-
*/
|
|
15
|
-
class?: string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to hide the widget.
|
|
18
|
-
*/
|
|
19
|
-
hidden?: boolean | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Whether to disable the widget. An alias of the `aria-disabled`
|
|
22
|
-
* attribute.
|
|
23
|
-
*/
|
|
24
|
-
disabled?: boolean | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* Whether to make the widget read-only. An alias of the
|
|
27
|
-
* `aria-readonly` attribute.
|
|
28
|
-
*/
|
|
29
|
-
readonly?: boolean | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Whether to mark the widget required. An alias of the
|
|
32
|
-
* `aria-required` attribute.
|
|
33
|
-
*/
|
|
34
|
-
required?: boolean | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Whether to mark the widget invalid. An alias of the
|
|
37
|
-
* `aria-invalid` attribute.
|
|
38
|
-
*/
|
|
39
|
-
invalid?: boolean | undefined;
|
|
11
|
+
declare const SelectButtonGroup: import("svelte").Component<ContainerProps & WidgetStateProps & FormFieldStateProps & {
|
|
40
12
|
/**
|
|
41
13
|
* The `aria-label` attribute on the wrapper element.
|
|
42
14
|
*/
|
|
43
15
|
ariaLabel?: string | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Primary slot content.
|
|
46
|
-
*/
|
|
47
|
-
children?: Snippet<[]> | undefined;
|
|
48
16
|
/**
|
|
49
17
|
* Custom `Change` event handler.
|
|
50
18
|
*/
|
|
51
19
|
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
52
20
|
} & Record<string, any>, {}, "">;
|
|
53
21
|
type Props = {
|
|
54
|
-
/**
|
|
55
|
-
* The `class` attribute on the wrapper element.
|
|
56
|
-
*/
|
|
57
|
-
class?: string | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Whether to hide the widget.
|
|
60
|
-
*/
|
|
61
|
-
hidden?: boolean | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Whether to disable the widget. An alias of the `aria-disabled`
|
|
64
|
-
* attribute.
|
|
65
|
-
*/
|
|
66
|
-
disabled?: boolean | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Whether to make the widget read-only. An alias of the
|
|
69
|
-
* `aria-readonly` attribute.
|
|
70
|
-
*/
|
|
71
|
-
readonly?: boolean | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Whether to mark the widget required. An alias of the
|
|
74
|
-
* `aria-required` attribute.
|
|
75
|
-
*/
|
|
76
|
-
required?: boolean | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* Whether to mark the widget invalid. An alias of the
|
|
79
|
-
* `aria-invalid` attribute.
|
|
80
|
-
*/
|
|
81
|
-
invalid?: boolean | undefined;
|
|
82
22
|
/**
|
|
83
23
|
* The `aria-label` attribute on the wrapper element.
|
|
84
24
|
*/
|
|
85
25
|
ariaLabel?: string | undefined;
|
|
86
|
-
/**
|
|
87
|
-
* Primary slot content.
|
|
88
|
-
*/
|
|
89
|
-
children?: Snippet<[]> | undefined;
|
|
90
26
|
/**
|
|
91
27
|
* Custom `Change` event handler.
|
|
92
28
|
*/
|
|
93
29
|
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
94
30
|
};
|
|
95
|
-
import type {
|
|
31
|
+
import type { ContainerProps } from '../../typedefs.js';
|
|
32
|
+
import type { WidgetStateProps } from '../../typedefs.js';
|
|
33
|
+
import type { FormFieldStateProps } from '../../typedefs.js';
|
|
@@ -17,3 +17,12 @@ export function getArrowKeyDayOffset(key: string, rtl?: boolean): number | undef
|
|
|
17
17
|
export function getCalendarDays(firstDay: Date): Date[];
|
|
18
18
|
export function toDateString(date: Date): string;
|
|
19
19
|
export function getToday(now?: Date): Date;
|
|
20
|
+
export function parseDateValue(value: string | undefined, today: Date): Date;
|
|
21
|
+
export function getCursorDate({ focusedValue, value, days, firstDay, today, offset }: {
|
|
22
|
+
focusedValue: string | undefined;
|
|
23
|
+
value: string | undefined;
|
|
24
|
+
days: Date[];
|
|
25
|
+
firstDay: Date;
|
|
26
|
+
today: Date;
|
|
27
|
+
offset: number;
|
|
28
|
+
}): string;
|
|
@@ -129,3 +129,46 @@ export const toDateString = (date) => date.toJSON().split('T')[0];
|
|
|
129
129
|
*/
|
|
130
130
|
export const getToday = (now = new Date()) =>
|
|
131
131
|
new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()));
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get the date given as the `value` of the calendar. A value that doesn’t make a valid date, like
|
|
135
|
+
* `2024-13-01`, or that rolls over into another day, like `2024-02-30` turning into March 1, is
|
|
136
|
+
* treated like no value rather than crashing or showing an unexpected month.
|
|
137
|
+
* @param {string | undefined} value Date in the `YYYY-MM-DD` format.
|
|
138
|
+
* @param {Date} today Today’s date, as returned by {@link getToday}.
|
|
139
|
+
* @returns {Date} Parsed date, or `today` if the value is empty or invalid.
|
|
140
|
+
*/
|
|
141
|
+
export const parseDateValue = (value, today) => {
|
|
142
|
+
const parsed = value ? new Date(value) : undefined;
|
|
143
|
+
|
|
144
|
+
return parsed && !Number.isNaN(parsed.getTime()) && toDateString(parsed) === value
|
|
145
|
+
? parsed
|
|
146
|
+
: today;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Get the day the keyboard cursor moves to on an arrow key. Without a cursor, it starts from the
|
|
151
|
+
* selected day only if it’s on the grid. After browsing to another month, it isn’t, and moving from
|
|
152
|
+
* it would bring that month back. The cursor then lands on today if it’s in the month displayed, or
|
|
153
|
+
* on the first of the month otherwise.
|
|
154
|
+
* @param {object} options Options.
|
|
155
|
+
* @param {string | undefined} options.focusedValue Value of the day the cursor is on, if any.
|
|
156
|
+
* @param {string | undefined} options.value Selected day, in the `YYYY-MM-DD` format.
|
|
157
|
+
* @param {Date[]} options.days Days on the grid, as returned by {@link getCalendarDays}.
|
|
158
|
+
* @param {Date} options.firstDay First day of the month being displayed.
|
|
159
|
+
* @param {Date} options.today Today’s date, as returned by {@link getToday}.
|
|
160
|
+
* @param {number} options.offset Number of days the key moves the cursor by.
|
|
161
|
+
* @returns {string} Day to move to, in the `YYYY-MM-DD` format.
|
|
162
|
+
*/
|
|
163
|
+
export const getCursorDate = ({ focusedValue, value, days, firstDay, today, offset }) => {
|
|
164
|
+
const cursor =
|
|
165
|
+
focusedValue || (value && days.some((day) => toDateString(day) === value) ? value : undefined);
|
|
166
|
+
|
|
167
|
+
if (cursor) {
|
|
168
|
+
return toDateString(addDays(new Date(cursor), offset));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return getFirstDayOfMonth(today).getTime() === firstDay.getTime()
|
|
172
|
+
? toDateString(today)
|
|
173
|
+
: toDateString(firstDay);
|
|
174
|
+
};
|
|
@@ -5,20 +5,22 @@
|
|
|
5
5
|
<script>
|
|
6
6
|
import { _, isRTL } from '@sveltia/i18n';
|
|
7
7
|
import { tick } from 'svelte';
|
|
8
|
-
import { activateGroup } from '../../services/group.svelte.js';
|
|
8
|
+
import { activateGroup, setFocusedMember } from '../../services/group.svelte.js';
|
|
9
|
+
import { hasModifier } from '../../services/navigation.js';
|
|
9
10
|
import Button from '../button/button.svelte';
|
|
10
11
|
import Divider from '../divider/divider.svelte';
|
|
11
12
|
import Spacer from '../divider/spacer.svelte';
|
|
12
13
|
import Icon from '../icon/icon.svelte';
|
|
13
14
|
import {
|
|
14
|
-
addDays,
|
|
15
15
|
addMonths,
|
|
16
16
|
formatDate,
|
|
17
17
|
getArrowKeyDayOffset,
|
|
18
18
|
getCalendarDays,
|
|
19
|
+
getCursorDate,
|
|
19
20
|
getFirstDayOfMonth,
|
|
20
21
|
getToday,
|
|
21
22
|
MONTH_NAMES,
|
|
23
|
+
parseDateValue,
|
|
22
24
|
toDateString,
|
|
23
25
|
} from './calendar.js';
|
|
24
26
|
|
|
@@ -36,7 +38,11 @@
|
|
|
36
38
|
const today = getToday();
|
|
37
39
|
const todayString = toDateString(today);
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Date given as the {@link value}, or today if it’s empty or invalid.
|
|
43
|
+
* @type {Date}
|
|
44
|
+
*/
|
|
45
|
+
const date = $derived(parseDateValue(value, today));
|
|
40
46
|
/**
|
|
41
47
|
* First day of the month being displayed. Follows the {@link value}, and is reassigned by the
|
|
42
48
|
* month navigation below.
|
|
@@ -63,10 +69,9 @@
|
|
|
63
69
|
* @param {KeyboardEvent} event `keydown` event.
|
|
64
70
|
*/
|
|
65
71
|
const onGridKeyDown = (event) => {
|
|
66
|
-
const
|
|
67
|
-
const offset = getArrowKeyDayOffset(key, isRTL());
|
|
72
|
+
const offset = getArrowKeyDayOffset(event.key, isRTL());
|
|
68
73
|
|
|
69
|
-
if (offset === undefined ||
|
|
74
|
+
if (offset === undefined || hasModifier(event)) {
|
|
70
75
|
return;
|
|
71
76
|
}
|
|
72
77
|
|
|
@@ -78,21 +83,14 @@
|
|
|
78
83
|
grid?.querySelector('[role="option"].focused')
|
|
79
84
|
);
|
|
80
85
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
value = toDateString(addDays(new Date(cursor), offset));
|
|
90
|
-
} else {
|
|
91
|
-
value =
|
|
92
|
-
getFirstDayOfMonth(today).getTime() === firstDay.getTime()
|
|
93
|
-
? todayString
|
|
94
|
-
: toDateString(firstDay);
|
|
95
|
-
}
|
|
86
|
+
value = getCursorDate({
|
|
87
|
+
focusedValue: focused?.value,
|
|
88
|
+
value,
|
|
89
|
+
days: dayList.map(({ day }) => day),
|
|
90
|
+
firstDay,
|
|
91
|
+
today,
|
|
92
|
+
offset,
|
|
93
|
+
});
|
|
96
94
|
};
|
|
97
95
|
|
|
98
96
|
// Keep the keyboard cursor on the selected day. The group service tracks the cursor with the
|
|
@@ -111,17 +109,15 @@
|
|
|
111
109
|
const listbox = grid;
|
|
112
110
|
|
|
113
111
|
tick().then(() => {
|
|
114
|
-
const option =
|
|
112
|
+
const option = /** @type {HTMLElement | null} */ (
|
|
113
|
+
listbox.querySelector('[role="option"][aria-selected="true"]')
|
|
114
|
+
);
|
|
115
115
|
|
|
116
116
|
if (!option || option.classList.contains('focused')) {
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
listbox
|
|
121
|
-
element.classList.remove('focused');
|
|
122
|
-
});
|
|
123
|
-
option.classList.add('focused');
|
|
124
|
-
listbox.setAttribute('aria-activedescendant', option.id);
|
|
120
|
+
setFocusedMember(listbox, option);
|
|
125
121
|
});
|
|
126
122
|
});
|
|
127
123
|
</script>
|
|
@@ -257,6 +253,9 @@
|
|
|
257
253
|
<Button
|
|
258
254
|
onclick={() => {
|
|
259
255
|
value = todayString;
|
|
256
|
+
// Also go back to today’s month in case today is already selected, which leaves `value`
|
|
257
|
+
// unchanged and `firstDay` on the month browsed to
|
|
258
|
+
firstDay = getFirstDayOfMonth(today);
|
|
260
259
|
}}
|
|
261
260
|
>
|
|
262
261
|
{_('_sui.calendar.today')}
|
|
@@ -6,23 +6,17 @@
|
|
|
6
6
|
import { _ } from '@sveltia/i18n';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @import {
|
|
9
|
+
* @import { ContainerProps, WidgetStateProps } from '../../typedefs.js';
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @typedef {object} Props
|
|
14
|
-
* @property {string} [class] The `class` attribute on the wrapper element.
|
|
15
|
-
* @property {boolean} [hidden] Whether to hide the widget. An alias of the `aria-hidden`
|
|
16
|
-
* attribute.
|
|
17
|
-
* @property {boolean} [disabled] Whether to disable the widget. An alias of the `aria-disabled`
|
|
18
|
-
* attribute.
|
|
19
14
|
* @property {'horizontal'|'vertical'} [orientation] Orientation of the widget.
|
|
20
15
|
* @property {string} [ariaLabel] The `aria-label` attribute on the wrapper element.
|
|
21
|
-
* @property {Snippet} [children] Primary slot content.
|
|
22
16
|
*/
|
|
23
17
|
|
|
24
18
|
/**
|
|
25
|
-
* @type {Props & Record<string, any>}
|
|
19
|
+
* @type {ContainerProps & WidgetStateProps & Props & Record<string, any>}
|
|
26
20
|
*/
|
|
27
21
|
let {
|
|
28
22
|
/* eslint-disable prefer-const */
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
export default CheckboxGroup;
|
|
2
2
|
type CheckboxGroup = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<Props & Record<string, any>>): void;
|
|
4
|
+
$set?(props: Partial<ContainerProps & WidgetStateProps & Props & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/** The layout container of `<Checkbox>`es. */
|
|
7
|
-
declare const CheckboxGroup: import("svelte").Component<{
|
|
8
|
-
/**
|
|
9
|
-
* The `class` attribute on the wrapper element.
|
|
10
|
-
*/
|
|
11
|
-
class?: string | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Whether to hide the widget. An alias of the `aria-hidden`
|
|
14
|
-
* attribute.
|
|
15
|
-
*/
|
|
16
|
-
hidden?: boolean | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* Whether to disable the widget. An alias of the `aria-disabled`
|
|
19
|
-
* attribute.
|
|
20
|
-
*/
|
|
21
|
-
disabled?: boolean | undefined;
|
|
7
|
+
declare const CheckboxGroup: import("svelte").Component<ContainerProps & WidgetStateProps & {
|
|
22
8
|
/**
|
|
23
9
|
* Orientation of the widget.
|
|
24
10
|
*/
|
|
@@ -27,26 +13,8 @@ declare const CheckboxGroup: import("svelte").Component<{
|
|
|
27
13
|
* The `aria-label` attribute on the wrapper element.
|
|
28
14
|
*/
|
|
29
15
|
ariaLabel?: string | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Primary slot content.
|
|
32
|
-
*/
|
|
33
|
-
children?: Snippet<[]> | undefined;
|
|
34
16
|
} & Record<string, any>, {}, "">;
|
|
35
17
|
type Props = {
|
|
36
|
-
/**
|
|
37
|
-
* The `class` attribute on the wrapper element.
|
|
38
|
-
*/
|
|
39
|
-
class?: string | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Whether to hide the widget. An alias of the `aria-hidden`
|
|
42
|
-
* attribute.
|
|
43
|
-
*/
|
|
44
|
-
hidden?: boolean | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Whether to disable the widget. An alias of the `aria-disabled`
|
|
47
|
-
* attribute.
|
|
48
|
-
*/
|
|
49
|
-
disabled?: boolean | undefined;
|
|
50
18
|
/**
|
|
51
19
|
* Orientation of the widget.
|
|
52
20
|
*/
|
|
@@ -55,9 +23,6 @@ type Props = {
|
|
|
55
23
|
* The `aria-label` attribute on the wrapper element.
|
|
56
24
|
*/
|
|
57
25
|
ariaLabel?: string | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Primary slot content.
|
|
60
|
-
*/
|
|
61
|
-
children?: Snippet<[]> | undefined;
|
|
62
26
|
};
|
|
63
|
-
import type {
|
|
27
|
+
import type { ContainerProps } from '../../typedefs.js';
|
|
28
|
+
import type { WidgetStateProps } from '../../typedefs.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default AlertDialog;
|
|
2
2
|
type AlertDialog = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<ModalProps &
|
|
4
|
+
$set?(props: Partial<ModalProps & ModalLabelProps & DialogOwnProps & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* A modal alert dialog. It only shows the OK button, just like `window.alert()`.
|
|
@@ -9,6 +9,5 @@ type AlertDialog = {
|
|
|
9
9
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/
|
|
10
10
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/alert
|
|
11
11
|
*/
|
|
12
|
-
declare const AlertDialog: import("svelte").Component<ModalProps &
|
|
12
|
+
declare const AlertDialog: import("svelte").Component<ModalProps & import("../../typedefs.js").ModalLabelProps & import("../../typedefs.js").DialogOwnProps & Record<string, any>, {}, "open">;
|
|
13
13
|
import type { ModalProps } from '../../typedefs.js';
|
|
14
|
-
import type { DialogProps } from '../../typedefs.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default ConfirmationDialog;
|
|
2
2
|
type ConfirmationDialog = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<ModalProps &
|
|
4
|
+
$set?(props: Partial<ModalProps & ModalLabelProps & DialogOwnProps & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* A modal confirmation dialog. It shows the OK and Cancel buttons, just like `window.confirm()`.
|
|
@@ -9,6 +9,5 @@ type ConfirmationDialog = {
|
|
|
9
9
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/
|
|
10
10
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm
|
|
11
11
|
*/
|
|
12
|
-
declare const ConfirmationDialog: import("svelte").Component<ModalProps &
|
|
12
|
+
declare const ConfirmationDialog: import("svelte").Component<ModalProps & import("../../typedefs.js").ModalLabelProps & import("../../typedefs.js").DialogOwnProps & Record<string, any>, {}, "open">;
|
|
13
13
|
import type { ModalProps } from '../../typedefs.js';
|
|
14
|
-
import type { DialogProps } from '../../typedefs.js';
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
<script>
|
|
20
20
|
import { _ } from '@sveltia/i18n';
|
|
21
21
|
import { sleep } from '@sveltia/utils/misc';
|
|
22
|
+
import { getModalLabelAttrs } from '../../services/label.js';
|
|
22
23
|
import Button from '../button/button.svelte';
|
|
23
24
|
import Spacer from '../divider/spacer.svelte';
|
|
24
25
|
import Modal from '../util/modal.svelte';
|
|
@@ -71,12 +72,11 @@
|
|
|
71
72
|
const id = $props.id();
|
|
72
73
|
|
|
73
74
|
/**
|
|
74
|
-
*
|
|
75
|
-
* dialog can point at; with a custom header the title is only text, so it becomes `aria-label`
|
|
76
|
-
* unless the consumer names the labelling element.
|
|
75
|
+
* Labelling attributes for the `<dialog>`, giving it an accessible name.
|
|
77
76
|
*/
|
|
78
|
-
const
|
|
79
|
-
|
|
77
|
+
const labelAttrs = $derived(
|
|
78
|
+
getModalLabelAttrs({ id, title, ariaLabelledby, hasCustomHeader: !!header }),
|
|
79
|
+
);
|
|
80
80
|
/**
|
|
81
81
|
* A reference to the modal component.
|
|
82
82
|
* @type {Modal | undefined}
|
|
@@ -252,8 +252,7 @@
|
|
|
252
252
|
{role}
|
|
253
253
|
{id}
|
|
254
254
|
class="dialog"
|
|
255
|
-
|
|
256
|
-
aria-labelledby={labelledby}
|
|
255
|
+
{...labelAttrs}
|
|
257
256
|
aria-describedby="{id}-body"
|
|
258
257
|
bind:open
|
|
259
258
|
{modal}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
export default Dialog;
|
|
2
2
|
type Dialog = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<ModalProps &
|
|
4
|
+
$set?(props: Partial<ModalProps & ModalLabelProps & DialogOwnProps & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* A feedback dialog widget based on the HTML `<dialog>` element.
|
|
8
8
|
* @see https://w3c.github.io/aria/#dialog
|
|
9
9
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
10
10
|
*/
|
|
11
|
-
declare const Dialog: import("svelte").Component<ModalProps &
|
|
11
|
+
declare const Dialog: import("svelte").Component<ModalProps & import("../../typedefs.js").ModalLabelProps & import("../../typedefs.js").DialogOwnProps & Record<string, any>, {}, "open" | "value">;
|
|
12
12
|
import type { ModalProps } from '../../typedefs.js';
|
|
13
|
-
import type { DialogProps } from '../../typedefs.js';
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* @type {ModalProps & DialogProps & CommonEventHandlers & InputEventHandlers &
|
|
34
|
-
* Record<string, any>}
|
|
33
|
+
* @type {ModalProps & DialogProps & CommonEventHandlers & InputEventHandlers &
|
|
34
|
+
* Props & Record<string, any>}
|
|
35
35
|
*/
|
|
36
36
|
let {
|
|
37
37
|
/* eslint-disable prefer-const */
|