@sveltia/ui 0.90.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/constants.d.ts +40 -6
- package/dist/components/text-editor/constants.js +81 -7
- package/dist/components/text-editor/conversion/editor-components.js +4 -4
- package/dist/components/text-editor/conversion/html/components.d.ts +16 -0
- package/dist/components/text-editor/conversion/html/components.js +87 -0
- package/dist/components/text-editor/conversion/html/export.d.ts +10 -0
- package/dist/components/text-editor/conversion/html/export.js +360 -0
- package/dist/components/text-editor/conversion/html/import-rules.d.ts +12 -0
- package/dist/components/text-editor/conversion/html/import-rules.js +234 -0
- package/dist/components/text-editor/conversion/html/index.d.ts +10 -0
- package/dist/components/text-editor/conversion/html/index.js +33 -0
- package/dist/components/text-editor/conversion/html/paragraph.d.ts +1 -0
- package/dist/components/text-editor/conversion/html/paragraph.js +123 -0
- package/dist/components/text-editor/conversion/html/task-list.d.ts +13 -0
- package/dist/components/text-editor/conversion/html/task-list.js +82 -0
- package/dist/components/text-editor/conversion/html/unsupported.d.ts +2 -0
- package/dist/components/text-editor/conversion/html/unsupported.js +122 -0
- package/dist/components/text-editor/conversion/html/utils.d.ts +6 -0
- package/dist/components/text-editor/conversion/html/utils.js +34 -0
- package/dist/components/text-editor/conversion/import.js +33 -27
- 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/transformers/task-list.d.ts +24 -0
- package/dist/components/text-editor/conversion/transformers/task-list.js +53 -0
- package/dist/components/text-editor/conversion/update.d.ts +19 -2
- package/dist/components/text-editor/conversion/update.js +64 -40
- package/dist/components/text-editor/core.d.ts +12 -51
- package/dist/components/text-editor/core.js +47 -77
- package/dist/components/text-editor/editing/commands.js +9 -18
- package/dist/components/text-editor/editing/guards.d.ts +7 -0
- package/dist/components/text-editor/editing/guards.js +123 -0
- package/dist/components/text-editor/editing/raw-markdown.d.ts +7 -2
- package/dist/components/text-editor/editing/raw-markdown.js +68 -8
- package/dist/components/text-editor/editing/selection.js +6 -2
- package/dist/components/text-editor/lexical-root.svelte +89 -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 +57 -146
- package/dist/components/text-editor/text-editor.svelte.d.ts +9 -105
- 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 +27 -19
- 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 +34 -11
- 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 +35 -41
- 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/ar.yaml +2 -0
- package/dist/locales/bg.yaml +2 -0
- package/dist/locales/ca.yaml +2 -0
- package/dist/locales/cs.yaml +2 -0
- package/dist/locales/da.yaml +2 -0
- package/dist/locales/de.yaml +2 -0
- package/dist/locales/el.yaml +2 -0
- package/dist/locales/en-CA.yaml +2 -0
- package/dist/locales/en-GB.yaml +2 -0
- package/dist/locales/en-US.yaml +2 -0
- package/dist/locales/en-ZA.yaml +2 -0
- package/dist/locales/es-CO.yaml +2 -0
- package/dist/locales/es-ES.yaml +2 -0
- package/dist/locales/fa.yaml +2 -0
- package/dist/locales/fi.yaml +2 -0
- package/dist/locales/fr.yaml +2 -0
- package/dist/locales/he.yaml +2 -0
- package/dist/locales/hr.yaml +2 -0
- package/dist/locales/hu.yaml +176 -0
- package/dist/locales/it.yaml +2 -0
- package/dist/locales/ja.yaml +2 -0
- package/dist/locales/ko.yaml +2 -0
- package/dist/locales/nl.yaml +2 -0
- package/dist/locales/pl.yaml +2 -0
- package/dist/locales/pt-BR.yaml +2 -0
- package/dist/locales/pt-PT.yaml +2 -0
- package/dist/locales/ru.yaml +2 -0
- package/dist/locales/sk.yaml +2 -0
- package/dist/locales/sv.yaml +2 -0
- package/dist/locales/tr.yaml +2 -0
- package/dist/locales/uk.yaml +2 -0
- package/dist/locales/vi.yaml +2 -0
- package/dist/locales/zh-CN.yaml +2 -0
- package/dist/locales/zh-TW.yaml +2 -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 +108 -6
- package/dist/typedefs.js +63 -6
- package/package.json +5 -5
- package/dist/components/text-editor/conversion/html.d.ts +0 -30
- package/dist/components/text-editor/conversion/html.js +0 -857
- 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,7 +1,7 @@
|
|
|
1
1
|
export default PromptDialog;
|
|
2
2
|
type PromptDialog = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<ModalProps &
|
|
4
|
+
$set?(props: Partial<ModalProps & ModalLabelProps & DialogOwnProps & KeyboardEventHandlers & MouseEventHandlers & PointerEventHandlers & FocusEventHandlers & DragEventHandlers & InputEventHandlers & Props & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* A modal prompt dialog. It shows the OK and Cancel buttons as well as a textbox, just like
|
|
@@ -10,7 +10,7 @@ type PromptDialog = {
|
|
|
10
10
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/
|
|
11
11
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt
|
|
12
12
|
*/
|
|
13
|
-
declare const PromptDialog: import("svelte").Component<ModalProps &
|
|
13
|
+
declare const PromptDialog: import("svelte").Component<ModalProps & import("../../typedefs.js").ModalLabelProps & import("../../typedefs.js").DialogOwnProps & import("../../typedefs.js").KeyboardEventHandlers & import("../../typedefs.js").MouseEventHandlers & import("../../typedefs.js").PointerEventHandlers & import("../../typedefs.js").FocusEventHandlers & import("../../typedefs.js").DragEventHandlers & InputEventHandlers & {
|
|
14
14
|
/**
|
|
15
15
|
* Value entered on the textbox.
|
|
16
16
|
*/
|
|
@@ -49,6 +49,5 @@ type Props = {
|
|
|
49
49
|
input?: Snippet<[]> | undefined;
|
|
50
50
|
};
|
|
51
51
|
import type { ModalProps } from '../../typedefs.js';
|
|
52
|
-
import type { DialogProps } from '../../typedefs.js';
|
|
53
52
|
import type { InputEventHandlers } from '../../typedefs.js';
|
|
54
53
|
import type { Snippet } from 'svelte';
|
|
@@ -11,25 +11,20 @@
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @import { Snippet } from 'svelte';
|
|
14
|
+
* @import { ContainerProps, WidgetStateProps } from '../../typedefs.js';
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* @typedef {object} Props
|
|
18
|
-
* @property {string} [class] The `class` attribute on the wrapper element.
|
|
19
|
-
* @property {boolean} [hidden] Whether to hide the widget. An alias of the `aria-hidden`
|
|
20
|
-
* attribute.
|
|
21
|
-
* @property {boolean} [disabled] Whether to disable the widget. An alias of the `aria-disabled`
|
|
22
|
-
* attribute.
|
|
23
19
|
* @property {boolean} [expanded] Whether to show the content. An alias of the `aria-expanded`
|
|
24
20
|
* attribute.
|
|
25
21
|
* @property {string} [label] Text label displayed next to the expander.
|
|
26
|
-
* @property {Snippet} [children] Primary slot content.
|
|
27
22
|
* @property {Snippet} [chevronIcon] Chevron slot content.
|
|
28
23
|
* @property {(event: CustomEvent) => void} [onChange] Custom `Change` event handler.
|
|
29
24
|
*/
|
|
30
25
|
|
|
31
26
|
/**
|
|
32
|
-
* @type {Props & Record<string, any>}
|
|
27
|
+
* @type {ContainerProps & WidgetStateProps & Props & Record<string, any>}
|
|
33
28
|
*/
|
|
34
29
|
let {
|
|
35
30
|
/* eslint-disable prefer-const */
|
|
@@ -80,30 +75,33 @@
|
|
|
80
75
|
{/snippet}
|
|
81
76
|
{label}
|
|
82
77
|
</Button>
|
|
83
|
-
|
|
78
|
+
<!--
|
|
79
|
+
The collapsed content stays rendered with zero height instead of `display: none`, so make it
|
|
80
|
+
`inert` as well to keep it away from the Tab key and assistive technology.
|
|
81
|
+
-->
|
|
82
|
+
<div class="content" id="{id}-content" hidden={!expanded} inert={!expanded}>
|
|
84
83
|
{@render children?.()}
|
|
85
84
|
</div>
|
|
86
85
|
</div>
|
|
87
86
|
</div>
|
|
88
87
|
|
|
89
|
-
<style>.
|
|
88
|
+
<style>.inner {
|
|
89
|
+
display: contents;
|
|
90
|
+
}
|
|
91
|
+
.inner > :global(.header) {
|
|
90
92
|
display: flex;
|
|
91
93
|
width: 100%;
|
|
92
94
|
}
|
|
93
|
-
.
|
|
95
|
+
.inner > :global(.header) :global(.icon) {
|
|
94
96
|
transition: all 200ms;
|
|
95
97
|
}
|
|
96
|
-
.
|
|
98
|
+
.inner > :global(.header[aria-expanded='false'] .icon:dir(ltr)) {
|
|
97
99
|
transform: rotate(-90deg);
|
|
98
100
|
}
|
|
99
|
-
.
|
|
101
|
+
.inner > :global(.header[aria-expanded='false'] .icon:dir(rtl)) {
|
|
100
102
|
transform: rotate(90deg);
|
|
101
103
|
}
|
|
102
104
|
|
|
103
|
-
.inner {
|
|
104
|
-
display: contents;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
105
|
.content[hidden] {
|
|
108
106
|
display: block;
|
|
109
107
|
overflow: hidden;
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
export default Disclosure;
|
|
2
2
|
type Disclosure = {
|
|
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
|
/**
|
|
7
7
|
* A disclosure (expander) widget. The equivalent of the HTML `<details>` element.
|
|
8
8
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
|
|
9
9
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
|
|
10
10
|
*/
|
|
11
|
-
declare const Disclosure: import("svelte").Component<{
|
|
12
|
-
/**
|
|
13
|
-
* The `class` attribute on the wrapper element.
|
|
14
|
-
*/
|
|
15
|
-
class?: string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to hide the widget. An alias of the `aria-hidden`
|
|
18
|
-
* attribute.
|
|
19
|
-
*/
|
|
20
|
-
hidden?: boolean | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Whether to disable the widget. An alias of the `aria-disabled`
|
|
23
|
-
* attribute.
|
|
24
|
-
*/
|
|
25
|
-
disabled?: boolean | undefined;
|
|
11
|
+
declare const Disclosure: import("svelte").Component<ContainerProps & WidgetStateProps & {
|
|
26
12
|
/**
|
|
27
13
|
* Whether to show the content. An alias of the `aria-expanded`
|
|
28
14
|
* attribute.
|
|
@@ -32,10 +18,6 @@ declare const Disclosure: import("svelte").Component<{
|
|
|
32
18
|
* Text label displayed next to the expander.
|
|
33
19
|
*/
|
|
34
20
|
label?: string | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Primary slot content.
|
|
37
|
-
*/
|
|
38
|
-
children?: Snippet<[]> | undefined;
|
|
39
21
|
/**
|
|
40
22
|
* Chevron slot content.
|
|
41
23
|
*/
|
|
@@ -46,20 +28,6 @@ declare const Disclosure: import("svelte").Component<{
|
|
|
46
28
|
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
47
29
|
} & Record<string, any>, {}, "expanded">;
|
|
48
30
|
type Props = {
|
|
49
|
-
/**
|
|
50
|
-
* The `class` attribute on the wrapper element.
|
|
51
|
-
*/
|
|
52
|
-
class?: string | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Whether to hide the widget. An alias of the `aria-hidden`
|
|
55
|
-
* attribute.
|
|
56
|
-
*/
|
|
57
|
-
hidden?: boolean | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Whether to disable the widget. An alias of the `aria-disabled`
|
|
60
|
-
* attribute.
|
|
61
|
-
*/
|
|
62
|
-
disabled?: boolean | undefined;
|
|
63
31
|
/**
|
|
64
32
|
* Whether to show the content. An alias of the `aria-expanded`
|
|
65
33
|
* attribute.
|
|
@@ -69,10 +37,6 @@ type Props = {
|
|
|
69
37
|
* Text label displayed next to the expander.
|
|
70
38
|
*/
|
|
71
39
|
label?: string | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Primary slot content.
|
|
74
|
-
*/
|
|
75
|
-
children?: Snippet<[]> | undefined;
|
|
76
40
|
/**
|
|
77
41
|
* Chevron slot content.
|
|
78
42
|
*/
|
|
@@ -82,4 +46,6 @@ type Props = {
|
|
|
82
46
|
*/
|
|
83
47
|
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
84
48
|
};
|
|
49
|
+
import type { ContainerProps } from '../../typedefs.js';
|
|
50
|
+
import type { WidgetStateProps } from '../../typedefs.js';
|
|
85
51
|
import type { Snippet } from 'svelte';
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
import { untrack } from 'svelte';
|
|
9
|
+
import { getModalLabelAttrs } from '../../services/label.js';
|
|
9
10
|
import Spacer from '../divider/spacer.svelte';
|
|
10
11
|
import ModalCloseButton from '../dialog/modal-close-button.svelte';
|
|
11
12
|
import Modal from '../util/modal.svelte';
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* @import { Snippet } from 'svelte';
|
|
22
|
-
* @import { ModalProps } from '../../typedefs.js';
|
|
23
|
+
* @import { ModalLabelProps, ModalProps } from '../../typedefs.js';
|
|
23
24
|
* @import { SwipeState } from './drawer.js';
|
|
24
25
|
*/
|
|
25
26
|
|
|
@@ -27,11 +28,6 @@
|
|
|
27
28
|
* @typedef {object} Props
|
|
28
29
|
* @property {string} [class] The `class` attribute on the content element.
|
|
29
30
|
* @property {boolean} [open] Whether to open the drawer.
|
|
30
|
-
* @property {string} [title] Title text displayed on the header. With a custom `header` snippet,
|
|
31
|
-
* it’s used as the drawer’s `aria-label` instead.
|
|
32
|
-
* @property {string} [ariaLabelledby] ID of the element that labels the drawer, typically a
|
|
33
|
-
* heading inside a custom `header` snippet. Takes precedence over `title` for the accessible
|
|
34
|
-
* name.
|
|
35
31
|
* @property {'top' | 'right' | 'bottom' | 'left'} [position] Position of the drawer.
|
|
36
32
|
* @property {'small' | 'medium' | 'large' | 'x-large' | 'full'} [size] Width or height of the
|
|
37
33
|
* drawer.
|
|
@@ -50,7 +46,7 @@
|
|
|
50
46
|
*/
|
|
51
47
|
|
|
52
48
|
/**
|
|
53
|
-
* @type {ModalProps & Props & Record<string, any>}
|
|
49
|
+
* @type {ModalProps & ModalLabelProps & Props & Record<string, any>}
|
|
54
50
|
*/
|
|
55
51
|
let {
|
|
56
52
|
/* eslint-disable prefer-const */
|
|
@@ -96,7 +92,7 @@
|
|
|
96
92
|
|
|
97
93
|
/**
|
|
98
94
|
* A reference to the modal component.
|
|
99
|
-
* @type {
|
|
95
|
+
* @type {Modal | undefined}
|
|
100
96
|
*/
|
|
101
97
|
let modal = $state();
|
|
102
98
|
|
|
@@ -208,24 +204,25 @@
|
|
|
208
204
|
});
|
|
209
205
|
|
|
210
206
|
/**
|
|
211
|
-
*
|
|
212
|
-
* renders the title in an element the dialog can point at; with a custom header the title is
|
|
213
|
-
* only text, so it becomes `aria-label` unless the consumer names the labelling element.
|
|
207
|
+
* Labelling attributes for the `<dialog>`, giving it an accessible name.
|
|
214
208
|
*/
|
|
215
|
-
const
|
|
216
|
-
|
|
209
|
+
const labelAttrs = $derived(
|
|
210
|
+
getModalLabelAttrs({ id, title, ariaLabelledby, hasCustomHeader: !!header }),
|
|
211
|
+
);
|
|
217
212
|
</script>
|
|
218
213
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
214
|
+
{#snippet closeButton()}
|
|
215
|
+
<ModalCloseButton
|
|
216
|
+
class="close"
|
|
217
|
+
controls={id}
|
|
218
|
+
{closeIcon}
|
|
219
|
+
onClose={() => {
|
|
220
|
+
modal?.close('close');
|
|
221
|
+
}}
|
|
222
|
+
/>
|
|
223
|
+
{/snippet}
|
|
224
|
+
|
|
225
|
+
<Modal bind:this={modal} {...restProps} bind:open {id} class="drawer" {...labelAttrs} showBackdrop>
|
|
229
226
|
<div
|
|
230
227
|
bind:this={content}
|
|
231
228
|
role="none"
|
|
@@ -249,14 +246,7 @@
|
|
|
249
246
|
{/if}
|
|
250
247
|
<div role="none" class="extra-control">
|
|
251
248
|
{#if showClose === 'outside'}
|
|
252
|
-
|
|
253
|
-
class="close"
|
|
254
|
-
controls={id}
|
|
255
|
-
{closeIcon}
|
|
256
|
-
onClose={() => {
|
|
257
|
-
modal?.close('close');
|
|
258
|
-
}}
|
|
259
|
-
/>
|
|
249
|
+
{@render closeButton()}
|
|
260
250
|
{/if}
|
|
261
251
|
</div>
|
|
262
252
|
{#if title || showClose === 'inside' || header || headerExtra}
|
|
@@ -270,14 +260,7 @@
|
|
|
270
260
|
<Spacer flex={true} />
|
|
271
261
|
{@render headerExtra?.()}
|
|
272
262
|
{#if showClose === 'inside'}
|
|
273
|
-
|
|
274
|
-
class="close"
|
|
275
|
-
controls={id}
|
|
276
|
-
{closeIcon}
|
|
277
|
-
onClose={() => {
|
|
278
|
-
modal?.close('close');
|
|
279
|
-
}}
|
|
280
|
-
/>
|
|
263
|
+
{@render closeButton()}
|
|
281
264
|
{/if}
|
|
282
265
|
</div>
|
|
283
266
|
{/if}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export default Drawer;
|
|
2
2
|
type Drawer = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<ModalProps & Props & Record<string, any>>): void;
|
|
4
|
+
$set?(props: Partial<ModalProps & ModalLabelProps & Props & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* A generic drawer 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 Drawer: import("svelte").Component<ModalProps & {
|
|
11
|
+
declare const Drawer: import("svelte").Component<ModalProps & ModalLabelProps & {
|
|
12
12
|
/**
|
|
13
13
|
* The `class` attribute on the content element.
|
|
14
14
|
*/
|
|
@@ -17,17 +17,6 @@ declare const Drawer: import("svelte").Component<ModalProps & {
|
|
|
17
17
|
* Whether to open the drawer.
|
|
18
18
|
*/
|
|
19
19
|
open?: boolean | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Title text displayed on the header. With a custom `header` snippet,
|
|
22
|
-
* it’s used as the drawer’s `aria-label` instead.
|
|
23
|
-
*/
|
|
24
|
-
title?: string | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* ID of the element that labels the drawer, typically a
|
|
27
|
-
* heading inside a custom `header` snippet. Takes precedence over `title` for the accessible
|
|
28
|
-
* name.
|
|
29
|
-
*/
|
|
30
|
-
ariaLabelledby?: string | undefined;
|
|
31
20
|
/**
|
|
32
21
|
* Position of the drawer.
|
|
33
22
|
*/
|
|
@@ -83,17 +72,6 @@ type Props = {
|
|
|
83
72
|
* Whether to open the drawer.
|
|
84
73
|
*/
|
|
85
74
|
open?: boolean | undefined;
|
|
86
|
-
/**
|
|
87
|
-
* Title text displayed on the header. With a custom `header` snippet,
|
|
88
|
-
* it’s used as the drawer’s `aria-label` instead.
|
|
89
|
-
*/
|
|
90
|
-
title?: string | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* ID of the element that labels the drawer, typically a
|
|
93
|
-
* heading inside a custom `header` snippet. Takes precedence over `title` for the accessible
|
|
94
|
-
* name.
|
|
95
|
-
*/
|
|
96
|
-
ariaLabelledby?: string | undefined;
|
|
97
75
|
/**
|
|
98
76
|
* Position of the drawer.
|
|
99
77
|
*/
|
|
@@ -141,4 +119,5 @@ type Props = {
|
|
|
141
119
|
extraContent?: Snippet<[]> | undefined;
|
|
142
120
|
};
|
|
143
121
|
import type { ModalProps } from '../../typedefs.js';
|
|
122
|
+
import type { ModalLabelProps } from '../../typedefs.js';
|
|
144
123
|
import type { Snippet } from 'svelte';
|
|
@@ -14,24 +14,23 @@
|
|
|
14
14
|
/**
|
|
15
15
|
* @import { Snippet } from 'svelte';
|
|
16
16
|
* @import { Attachment } from 'svelte/attachments';
|
|
17
|
+
* @import { ContainerProps } from '../../typedefs.js';
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* @typedef {object} Props
|
|
21
|
-
* @property {string} [class] The `class` attribute on the wrapper element.
|
|
22
22
|
* @property {string} [label] Display label for the row group.
|
|
23
23
|
* @property {boolean} [collapsible] Whether the rows can be hidden with an expander in the
|
|
24
24
|
* caption. Requires `label`.
|
|
25
25
|
* @property {boolean} [expanded] Whether the rows are shown. Only applies when `collapsible`. An
|
|
26
26
|
* alias of the `aria-expanded` attribute on the expander button.
|
|
27
|
-
* @property {Snippet} [children] Primary slot content.
|
|
28
27
|
* @property {Snippet} [chevronIcon] Chevron slot content for the expander.
|
|
29
28
|
* @property {(event: CustomEvent) => void} [onChange] Custom `Change` event handler, called with
|
|
30
29
|
* the new `expanded` state in `detail` when the expander is toggled.
|
|
31
30
|
*/
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
|
-
* @type {Props & Record<string, any>}
|
|
33
|
+
* @type {ContainerProps & Props & Record<string, any>}
|
|
35
34
|
*/
|
|
36
35
|
let {
|
|
37
36
|
/* eslint-disable prefer-const */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default GridBody;
|
|
2
2
|
type GridBody = {
|
|
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
6
|
/**
|
|
7
7
|
* The interactive version of `<TableBody>`. A labelled row group can be made collapsible, in which
|
|
@@ -10,11 +10,7 @@ type GridBody = {
|
|
|
10
10
|
* @see https://w3c.github.io/aria/#rowgroup
|
|
11
11
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
|
|
12
12
|
*/
|
|
13
|
-
declare const GridBody: import("svelte").Component<{
|
|
14
|
-
/**
|
|
15
|
-
* The `class` attribute on the wrapper element.
|
|
16
|
-
*/
|
|
17
|
-
class?: string | undefined;
|
|
13
|
+
declare const GridBody: import("svelte").Component<ContainerProps & {
|
|
18
14
|
/**
|
|
19
15
|
* Display label for the row group.
|
|
20
16
|
*/
|
|
@@ -29,10 +25,6 @@ declare const GridBody: import("svelte").Component<{
|
|
|
29
25
|
* alias of the `aria-expanded` attribute on the expander button.
|
|
30
26
|
*/
|
|
31
27
|
expanded?: boolean | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Primary slot content.
|
|
34
|
-
*/
|
|
35
|
-
children?: Snippet<[]> | undefined;
|
|
36
28
|
/**
|
|
37
29
|
* Chevron slot content for the expander.
|
|
38
30
|
*/
|
|
@@ -44,10 +36,6 @@ declare const GridBody: import("svelte").Component<{
|
|
|
44
36
|
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
45
37
|
} & Record<string, any>, {}, "expanded">;
|
|
46
38
|
type Props = {
|
|
47
|
-
/**
|
|
48
|
-
* The `class` attribute on the wrapper element.
|
|
49
|
-
*/
|
|
50
|
-
class?: string | undefined;
|
|
51
39
|
/**
|
|
52
40
|
* Display label for the row group.
|
|
53
41
|
*/
|
|
@@ -62,10 +50,6 @@ type Props = {
|
|
|
62
50
|
* alias of the `aria-expanded` attribute on the expander button.
|
|
63
51
|
*/
|
|
64
52
|
expanded?: boolean | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Primary slot content.
|
|
67
|
-
*/
|
|
68
|
-
children?: Snippet<[]> | undefined;
|
|
69
53
|
/**
|
|
70
54
|
* Chevron slot content for the expander.
|
|
71
55
|
*/
|
|
@@ -76,4 +60,5 @@ type Props = {
|
|
|
76
60
|
*/
|
|
77
61
|
onChange?: ((event: CustomEvent) => void) | undefined;
|
|
78
62
|
};
|
|
63
|
+
import type { ContainerProps } from '../../typedefs.js';
|
|
79
64
|
import type { Snippet } from 'svelte';
|
|
@@ -8,17 +8,11 @@
|
|
|
8
8
|
import TablePart from '../table/table-part.svelte';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @import {
|
|
11
|
+
* @import { ContainerProps } from '../../typedefs.js';
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @
|
|
16
|
-
* @property {string} [class] The `class` attribute on the wrapper element.
|
|
17
|
-
* @property {Snippet} [children] Primary slot content.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @type {Props & Record<string, any>}
|
|
15
|
+
* @type {ContainerProps & Record<string, any>}
|
|
22
16
|
*/
|
|
23
17
|
let {
|
|
24
18
|
/* eslint-disable prefer-const */
|
|
@@ -1,31 +1,12 @@
|
|
|
1
1
|
export default GridCell;
|
|
2
2
|
type GridCell = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<
|
|
4
|
+
$set?(props: Partial<ContainerProps & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* The interactive version of `<TableCell>`.
|
|
8
8
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td
|
|
9
9
|
* @see https://w3c.github.io/aria/#gridcell
|
|
10
10
|
*/
|
|
11
|
-
declare const GridCell: import("svelte").Component<{
|
|
12
|
-
|
|
13
|
-
* The `class` attribute on the wrapper element.
|
|
14
|
-
*/
|
|
15
|
-
class?: string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Primary slot content.
|
|
18
|
-
*/
|
|
19
|
-
children?: Snippet<[]> | undefined;
|
|
20
|
-
} & Record<string, any>, {}, "">;
|
|
21
|
-
type Props = {
|
|
22
|
-
/**
|
|
23
|
-
* The `class` attribute on the wrapper element.
|
|
24
|
-
*/
|
|
25
|
-
class?: string | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Primary slot content.
|
|
28
|
-
*/
|
|
29
|
-
children?: Snippet<[]> | undefined;
|
|
30
|
-
};
|
|
31
|
-
import type { Snippet } from 'svelte';
|
|
11
|
+
declare const GridCell: import("svelte").Component<ContainerProps & Record<string, any>, {}, "">;
|
|
12
|
+
import type { ContainerProps } from '../../typedefs.js';
|
|
@@ -12,19 +12,17 @@
|
|
|
12
12
|
import TablePart from '../table/table-part.svelte';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @import { Snippet } from 'svelte';
|
|
16
15
|
* @import { Attachment } from 'svelte/attachments';
|
|
16
|
+
* @import { ContainerProps } from '../../typedefs.js';
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @typedef {object} Props
|
|
21
|
-
* @property {string} [class] The `class` attribute on the wrapper element.
|
|
22
21
|
* @property {'ascending' | 'descending' | 'none'} [sortOrder] The order the column is sorted in,
|
|
23
22
|
* or `none` if it can be sorted but currently isn’t. An alias of the `aria-sort` attribute, which
|
|
24
23
|
* is only set on the sorted column, as the sortable table pattern recommends. When set, the
|
|
25
24
|
* content is rendered in a button that requests a new order with `onSort`; the button covers the
|
|
26
25
|
* whole cell, padding included. Leave it out for a header that can’t be sorted.
|
|
27
|
-
* @property {Snippet} [children] Primary slot content.
|
|
28
26
|
* @property {(event: CustomEvent<{ sortOrder: 'ascending' | 'descending' }>) => void} [onSort]
|
|
29
27
|
* Custom `Sort` event handler, called when the sort button is clicked. `detail.sortOrder` is the
|
|
30
28
|
* suggested next order: `descending` if the column is currently sorted in ascending order,
|
|
@@ -32,7 +30,7 @@
|
|
|
32
30
|
*/
|
|
33
31
|
|
|
34
32
|
/**
|
|
35
|
-
* @type {Props & Record<string, any>}
|
|
33
|
+
* @type {ContainerProps & Props & Record<string, any>}
|
|
36
34
|
*/
|
|
37
35
|
let {
|
|
38
36
|
/* eslint-disable prefer-const */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default GridColHeader;
|
|
2
2
|
type GridColHeader = {
|
|
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
6
|
/**
|
|
7
7
|
* The interactive version of `<TableColHeader>`. With `sortOrder` set, the header becomes sortable:
|
|
@@ -10,11 +10,7 @@ type GridColHeader = {
|
|
|
10
10
|
* @see https://w3c.github.io/aria/#columnheader
|
|
11
11
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/sortable-table/
|
|
12
12
|
*/
|
|
13
|
-
declare const GridColHeader: import("svelte").Component<{
|
|
14
|
-
/**
|
|
15
|
-
* The `class` attribute on the wrapper element.
|
|
16
|
-
*/
|
|
17
|
-
class?: string | undefined;
|
|
13
|
+
declare const GridColHeader: import("svelte").Component<ContainerProps & {
|
|
18
14
|
/**
|
|
19
15
|
* The order the column is sorted in,
|
|
20
16
|
* or `none` if it can be sorted but currently isn’t. An alias of the `aria-sort` attribute, which
|
|
@@ -23,10 +19,6 @@ declare const GridColHeader: import("svelte").Component<{
|
|
|
23
19
|
* whole cell, padding included. Leave it out for a header that can’t be sorted.
|
|
24
20
|
*/
|
|
25
21
|
sortOrder?: "none" | "ascending" | "descending" | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Primary slot content.
|
|
28
|
-
*/
|
|
29
|
-
children?: Snippet<[]> | undefined;
|
|
30
22
|
/**
|
|
31
23
|
* Custom `Sort` event handler, called when the sort button is clicked. `detail.sortOrder` is the
|
|
32
24
|
* suggested next order: `descending` if the column is currently sorted in ascending order,
|
|
@@ -37,10 +29,6 @@ declare const GridColHeader: import("svelte").Component<{
|
|
|
37
29
|
}>) => void) | undefined;
|
|
38
30
|
} & Record<string, any>, {}, "">;
|
|
39
31
|
type Props = {
|
|
40
|
-
/**
|
|
41
|
-
* The `class` attribute on the wrapper element.
|
|
42
|
-
*/
|
|
43
|
-
class?: string | undefined;
|
|
44
32
|
/**
|
|
45
33
|
* The order the column is sorted in,
|
|
46
34
|
* or `none` if it can be sorted but currently isn’t. An alias of the `aria-sort` attribute, which
|
|
@@ -49,10 +37,6 @@ type Props = {
|
|
|
49
37
|
* whole cell, padding included. Leave it out for a header that can’t be sorted.
|
|
50
38
|
*/
|
|
51
39
|
sortOrder?: "none" | "ascending" | "descending" | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Primary slot content.
|
|
54
|
-
*/
|
|
55
|
-
children?: Snippet<[]> | undefined;
|
|
56
40
|
/**
|
|
57
41
|
* Custom `Sort` event handler, called when the sort button is clicked. `detail.sortOrder` is the
|
|
58
42
|
* suggested next order: `descending` if the column is currently sorted in ascending order,
|
|
@@ -62,4 +46,4 @@ type Props = {
|
|
|
62
46
|
sortOrder: "ascending" | "descending";
|
|
63
47
|
}>) => void) | undefined;
|
|
64
48
|
};
|
|
65
|
-
import type {
|
|
49
|
+
import type { ContainerProps } from '../../typedefs.js';
|
|
@@ -8,19 +8,14 @@
|
|
|
8
8
|
import { _ } from '@sveltia/i18n';
|
|
9
9
|
import { setContext } from 'svelte';
|
|
10
10
|
import TablePart from '../table/table-part.svelte';
|
|
11
|
+
import { UNSELECTABLE_ROWS_KEY } from './grid.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
|
-
* @import {
|
|
14
|
+
* @import { ContainerProps } from '../../typedefs.js';
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* @
|
|
18
|
-
* @property {string} [class] The `class` attribute on the wrapper element.
|
|
19
|
-
* @property {Snippet} [children] Primary slot content.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @type {Props & Record<string, any>}
|
|
18
|
+
* @type {ContainerProps & Record<string, any>}
|
|
24
19
|
*/
|
|
25
20
|
let {
|
|
26
21
|
/* eslint-disable prefer-const */
|
|
@@ -30,7 +25,7 @@
|
|
|
30
25
|
|
|
31
26
|
// Tell the `<GridRow>`s inside that they are footer rows, such as a totals row, which can be
|
|
32
27
|
// focused but not selected, like header rows
|
|
33
|
-
setContext(
|
|
28
|
+
setContext(UNSELECTABLE_ROWS_KEY, true);
|
|
34
29
|
</script>
|
|
35
30
|
|
|
36
31
|
<TablePart
|
|
@@ -1,31 +1,12 @@
|
|
|
1
1
|
export default GridFoot;
|
|
2
2
|
type GridFoot = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial<
|
|
4
|
+
$set?(props: Partial<ContainerProps & Record<string, any>>): void;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* The interactive version of `<TableFoot>`.
|
|
8
8
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot
|
|
9
9
|
* @see https://w3c.github.io/aria/#rowgroup
|
|
10
10
|
*/
|
|
11
|
-
declare const GridFoot: import("svelte").Component<{
|
|
12
|
-
|
|
13
|
-
* The `class` attribute on the wrapper element.
|
|
14
|
-
*/
|
|
15
|
-
class?: string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Primary slot content.
|
|
18
|
-
*/
|
|
19
|
-
children?: Snippet<[]> | undefined;
|
|
20
|
-
} & Record<string, any>, {}, "">;
|
|
21
|
-
type Props = {
|
|
22
|
-
/**
|
|
23
|
-
* The `class` attribute on the wrapper element.
|
|
24
|
-
*/
|
|
25
|
-
class?: string | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Primary slot content.
|
|
28
|
-
*/
|
|
29
|
-
children?: Snippet<[]> | undefined;
|
|
30
|
-
};
|
|
31
|
-
import type { Snippet } from 'svelte';
|
|
11
|
+
declare const GridFoot: import("svelte").Component<ContainerProps & Record<string, any>, {}, "">;
|
|
12
|
+
import type { ContainerProps } from '../../typedefs.js';
|