@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
package/dist/locales/fr.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Titre 6
|
|
119
119
|
bulleted_list: Liste à puces
|
|
120
120
|
numbered_list: Liste numérotée
|
|
121
|
+
task_list: Liste de tâches
|
|
121
122
|
blockquote: Citation
|
|
122
123
|
code_block: Bloc de code
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Gras
|
|
125
126
|
italic: Italique
|
|
127
|
+
underline: Souligné
|
|
126
128
|
strikethrough: Barré
|
|
127
129
|
code: Code
|
|
128
130
|
link: Lien
|
package/dist/locales/he.yaml
CHANGED
|
@@ -123,11 +123,13 @@ text_editor:
|
|
|
123
123
|
heading_6: כותרת 6
|
|
124
124
|
bulleted_list: רשימת תבליטים
|
|
125
125
|
numbered_list: רשימה ממוספרת
|
|
126
|
+
task_list: רשימת משימות
|
|
126
127
|
blockquote: ציטוט
|
|
127
128
|
code_block: קטע קוד
|
|
128
129
|
# Inline style button aria-labels
|
|
129
130
|
bold: הדגשה
|
|
130
131
|
italic: הטיה
|
|
132
|
+
underline: קו תחתון
|
|
131
133
|
strikethrough: קו חוצה
|
|
132
134
|
code: קוד
|
|
133
135
|
link: קישור
|
package/dist/locales/hr.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Naslov 6
|
|
119
119
|
bulleted_list: Popis s grafičkim oznakama
|
|
120
120
|
numbered_list: Numerirani popis
|
|
121
|
+
task_list: Popis zadataka
|
|
121
122
|
blockquote: Citat
|
|
122
123
|
code_block: Blok koda
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Podebljano
|
|
125
126
|
italic: Kurziv
|
|
127
|
+
underline: Podcrtano
|
|
126
128
|
strikethrough: Precrtano
|
|
127
129
|
code: Kod
|
|
128
130
|
link: Poveznica
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Dialog action button labels
|
|
2
|
+
ok: OK
|
|
3
|
+
cancel: Mégse
|
|
4
|
+
close: Bezárás
|
|
5
|
+
|
|
6
|
+
# Button to clear content, e.g. search input or calendar date
|
|
7
|
+
clear: Törlés
|
|
8
|
+
|
|
9
|
+
# Text editor dialog buttons for link/image insertion
|
|
10
|
+
insert: Beszúrás
|
|
11
|
+
update: Frissítés
|
|
12
|
+
remove: Eltávolítás
|
|
13
|
+
|
|
14
|
+
# Combobox dropdown toggle button aria-labels
|
|
15
|
+
collapse: Összecsukás
|
|
16
|
+
expand: Kibontás
|
|
17
|
+
|
|
18
|
+
# Infobar/toast dismiss button label
|
|
19
|
+
dismiss: Elvetés
|
|
20
|
+
|
|
21
|
+
# Alert & infobar status, read out by screen readers before the message (visually hidden)
|
|
22
|
+
alert:
|
|
23
|
+
error: Hiba
|
|
24
|
+
warning: Figyelmeztetés
|
|
25
|
+
info: Információ
|
|
26
|
+
success: Siker
|
|
27
|
+
|
|
28
|
+
# Role descriptions, read out by screen readers in place of the generic “group” role
|
|
29
|
+
role_descriptions:
|
|
30
|
+
disclosure: kibontható panel
|
|
31
|
+
option_group: lehetőségcsoport
|
|
32
|
+
menu_item_group: menüelem-csoport
|
|
33
|
+
checkbox_group: jelölőnégyzet-csoport
|
|
34
|
+
table_head: táblázatfejléc
|
|
35
|
+
table_body: táblázattörzs
|
|
36
|
+
table_foot: táblázatlábléc
|
|
37
|
+
grid_head: rácsfejléc
|
|
38
|
+
grid_body: rácstörzs
|
|
39
|
+
grid_foot: rácslábléc
|
|
40
|
+
|
|
41
|
+
# Emoji suggestion listbox aria-label, shared by the text fields and the text editor
|
|
42
|
+
emoji_suggestions: Emojijavaslatok
|
|
43
|
+
|
|
44
|
+
# Calendar component
|
|
45
|
+
calendar:
|
|
46
|
+
# View switcher group aria-labels and navigation button aria-labels
|
|
47
|
+
year: Év
|
|
48
|
+
previous_decade: Előző évtized
|
|
49
|
+
next_decade: Következő évtized
|
|
50
|
+
month: Hónap
|
|
51
|
+
previous_month: Előző hónap
|
|
52
|
+
next_month: Következő hónap
|
|
53
|
+
# “Today” button label in footer
|
|
54
|
+
today: Ma
|
|
55
|
+
|
|
56
|
+
# Split button component
|
|
57
|
+
split_button:
|
|
58
|
+
# Wrapper aria-label, e.g. “Save Options” when primary button is “Save”
|
|
59
|
+
x_options: '{$name} – beállítások'
|
|
60
|
+
# Dropdown toggle aria-label
|
|
61
|
+
more_options: További lehetőségek
|
|
62
|
+
|
|
63
|
+
# Combobox component
|
|
64
|
+
combobox:
|
|
65
|
+
# Placeholder when no option is selected
|
|
66
|
+
select_an_option: Lehetőség kiválasztása…
|
|
67
|
+
# Filter input aria-label
|
|
68
|
+
filter_options: Lehetőségek szűrése
|
|
69
|
+
# Empty state message when filter has no matches
|
|
70
|
+
no_matching_options: Nincs egyező lehetőség
|
|
71
|
+
|
|
72
|
+
# Number input component
|
|
73
|
+
number_input:
|
|
74
|
+
# Spin button aria-labels for incrementing/decrementing the number value
|
|
75
|
+
increase: Növelés
|
|
76
|
+
decrease: Csökkentés
|
|
77
|
+
# Description of the allowed range when the number can’t be stepped, e.g. “From 1 to 10”
|
|
78
|
+
range: '{$min} és {$max} között'
|
|
79
|
+
# Description of the minimum value when the number can’t be stepped
|
|
80
|
+
min: Legalább {$min}
|
|
81
|
+
# Description of the maximum value when the number can’t be stepped
|
|
82
|
+
max: Legfeljebb {$max}
|
|
83
|
+
|
|
84
|
+
# Password input component
|
|
85
|
+
password_input:
|
|
86
|
+
# Visibility toggle button aria-labels
|
|
87
|
+
show_password: Jelszó megjelenítése
|
|
88
|
+
hide_password: Jelszó elrejtése
|
|
89
|
+
|
|
90
|
+
# Secret input component (API keys, tokens, etc.)
|
|
91
|
+
secret_input:
|
|
92
|
+
# Visibility toggle button aria-labels
|
|
93
|
+
show_secret: Titkos érték megjelenítése
|
|
94
|
+
hide_secret: Titkos érték elrejtése
|
|
95
|
+
|
|
96
|
+
# Select tags component (multi-select)
|
|
97
|
+
select_tags:
|
|
98
|
+
# Listbox aria-label
|
|
99
|
+
selected_options: Kiválasztott lehetőségek
|
|
100
|
+
# Remove button aria-label, e.g. “Remove Option 1”
|
|
101
|
+
remove_x: '{$name} eltávolítása'
|
|
102
|
+
|
|
103
|
+
# Text editor component
|
|
104
|
+
text_editor:
|
|
105
|
+
# Toolbar aria-labels
|
|
106
|
+
text_editor: Szövegszerkesztő
|
|
107
|
+
code_editor: Kódszerkesztő
|
|
108
|
+
# Block style menu button and menu aria-labels
|
|
109
|
+
text_style_options: Szövegstílus-beállítások
|
|
110
|
+
show_text_style_options: Szövegstílus-beállítások megjelenítése
|
|
111
|
+
# Block style menu items
|
|
112
|
+
paragraph: Bekezdés
|
|
113
|
+
heading_1: Címsor 1
|
|
114
|
+
heading_2: Címsor 2
|
|
115
|
+
heading_3: Címsor 3
|
|
116
|
+
heading_4: Címsor 4
|
|
117
|
+
heading_5: Címsor 5
|
|
118
|
+
heading_6: Címsor 6
|
|
119
|
+
bulleted_list: Felsorolás
|
|
120
|
+
numbered_list: Számozott lista
|
|
121
|
+
task_list: Feladatlista
|
|
122
|
+
blockquote: Idézet
|
|
123
|
+
code_block: Kódblokk
|
|
124
|
+
# Inline style button aria-labels
|
|
125
|
+
bold: Félkövér
|
|
126
|
+
italic: Dőlt
|
|
127
|
+
underline: Aláhúzott
|
|
128
|
+
strikethrough: Áthúzott
|
|
129
|
+
code: Kód
|
|
130
|
+
link: Hivatkozás
|
|
131
|
+
# Link dialog title
|
|
132
|
+
insert_link: Hivatkozás beszúrása
|
|
133
|
+
# Floating link editor button aria-labels
|
|
134
|
+
edit_link: Hivatkozás szerkesztése
|
|
135
|
+
remove_link: Hivatkozás eltávolítása
|
|
136
|
+
# Link dialog input field labels
|
|
137
|
+
text: Szöveg
|
|
138
|
+
url: URL
|
|
139
|
+
# Link dialog checkbox label and floating link editor button aria-label
|
|
140
|
+
open_in_new_tab: Megnyitás új lapon
|
|
141
|
+
# Table dialog title
|
|
142
|
+
insert_table: Táblázat beszúrása
|
|
143
|
+
# Table dialog input field labels
|
|
144
|
+
rows: Sorok
|
|
145
|
+
columns: Oszlopok
|
|
146
|
+
# Table menu button and menu aria-labels
|
|
147
|
+
table_options: Táblázatbeállítások
|
|
148
|
+
show_table_options: Táblázatbeállítások megjelenítése
|
|
149
|
+
# Table menu items
|
|
150
|
+
insert_row_above: Sor beszúrása fölé
|
|
151
|
+
insert_row_below: Sor beszúrása alá
|
|
152
|
+
insert_column_left: Oszlop beszúrása balra
|
|
153
|
+
insert_column_right: Oszlop beszúrása jobbra
|
|
154
|
+
delete_row: Sor törlése
|
|
155
|
+
delete_column: Oszlop törlése
|
|
156
|
+
delete_table: Táblázat törlése
|
|
157
|
+
# Horizontal rule button aria-label
|
|
158
|
+
insert_horizontal_rule: Vízszintes vonal beszúrása
|
|
159
|
+
# Alignment menu button and menu aria-labels
|
|
160
|
+
alignment_options: Igazítási beállítások
|
|
161
|
+
show_alignment_options: Igazítási beállítások megjelenítése
|
|
162
|
+
# Alignment menu items
|
|
163
|
+
align_left: Balra igazítás
|
|
164
|
+
align_center: Középre igazítás
|
|
165
|
+
align_right: Jobbra igazítás
|
|
166
|
+
align_justify: Sorkizárt igazítás
|
|
167
|
+
# Markdown mode toggle button aria-label
|
|
168
|
+
edit_in_markdown: Szerkesztés Markdownban
|
|
169
|
+
# HTML mode toggle button aria-label
|
|
170
|
+
edit_in_html: Szerkesztés HTML-ben
|
|
171
|
+
# Error message when rich text conversion fails
|
|
172
|
+
converter_error: Nem sikerült bekapcsolni a formázott szöveges módot. Helyette az egyszerű szöveges szerkesztő használható.
|
|
173
|
+
# Language selector aria-label
|
|
174
|
+
language: Nyelv
|
|
175
|
+
# Plain text mode option in language selector
|
|
176
|
+
plain_text: Egyszerű szöveg
|
package/dist/locales/it.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Titolo 6
|
|
119
119
|
bulleted_list: Elenco Puntato
|
|
120
120
|
numbered_list: Elenco Numerato
|
|
121
|
+
task_list: Elenco Attività
|
|
121
122
|
blockquote: Citazione
|
|
122
123
|
code_block: Blocco di Codice
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Grassetto
|
|
125
126
|
italic: Corsivo
|
|
127
|
+
underline: Sottolineato
|
|
126
128
|
strikethrough: Barrato
|
|
127
129
|
code: Codice
|
|
128
130
|
link: Link
|
package/dist/locales/ja.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: 見出し 6
|
|
119
119
|
bulleted_list: 番号なしリスト
|
|
120
120
|
numbered_list: 番号付きリスト
|
|
121
|
+
task_list: タスクリスト
|
|
121
122
|
blockquote: ブロック引用
|
|
122
123
|
code_block: コードブロック
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: 太字
|
|
125
126
|
italic: 斜体
|
|
127
|
+
underline: 下線
|
|
126
128
|
strikethrough: 取り消し線
|
|
127
129
|
code: コード
|
|
128
130
|
link: リンク
|
package/dist/locales/ko.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: 제목 6
|
|
119
119
|
bulleted_list: 글머리 기호 목록
|
|
120
120
|
numbered_list: 번호 매기기 목록
|
|
121
|
+
task_list: 할 일 목록
|
|
121
122
|
blockquote: 인용 블록
|
|
122
123
|
code_block: 코드 블록
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: 굵게
|
|
125
126
|
italic: 기울임꼴
|
|
127
|
+
underline: 밑줄
|
|
126
128
|
strikethrough: 취소선
|
|
127
129
|
code: 코드
|
|
128
130
|
link: 링크
|
package/dist/locales/nl.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Kop 6
|
|
119
119
|
bulleted_list: Opsommingslijst
|
|
120
120
|
numbered_list: Genummerde lijst
|
|
121
|
+
task_list: Takenlijst
|
|
121
122
|
blockquote: Citaatblok
|
|
122
123
|
code_block: Codeblok
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Vet
|
|
125
126
|
italic: Cursief
|
|
127
|
+
underline: Onderstrepen
|
|
126
128
|
strikethrough: Doorhalen
|
|
127
129
|
code: Code
|
|
128
130
|
link: Link
|
package/dist/locales/pl.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Nagłówek 6
|
|
119
119
|
bulleted_list: Lista punktowana
|
|
120
120
|
numbered_list: Lista numerowana
|
|
121
|
+
task_list: Lista zadań
|
|
121
122
|
blockquote: Cytat blokowy
|
|
122
123
|
code_block: Blok kodu
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Pogrubienie
|
|
125
126
|
italic: Kursywa
|
|
127
|
+
underline: Podkreślenie
|
|
126
128
|
strikethrough: Przekreślenie
|
|
127
129
|
code: Kod
|
|
128
130
|
link: Odnośnik
|
package/dist/locales/pt-BR.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Título 6
|
|
119
119
|
bulleted_list: Lista com marcadores
|
|
120
120
|
numbered_list: Lista numerada
|
|
121
|
+
task_list: Lista de tarefas
|
|
121
122
|
blockquote: Citação
|
|
122
123
|
code_block: Bloco de código
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Negrito
|
|
125
126
|
italic: Itálico
|
|
127
|
+
underline: Sublinhado
|
|
126
128
|
strikethrough: Tachado
|
|
127
129
|
code: Código
|
|
128
130
|
link: Link
|
package/dist/locales/pt-PT.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Título 6
|
|
119
119
|
bulleted_list: Lista com marcas
|
|
120
120
|
numbered_list: Lista numerada
|
|
121
|
+
task_list: Lista de tarefas
|
|
121
122
|
blockquote: Citação
|
|
122
123
|
code_block: Bloco de código
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Negrito
|
|
125
126
|
italic: Itálico
|
|
127
|
+
underline: Sublinhado
|
|
126
128
|
strikethrough: Rasurado
|
|
127
129
|
code: Código
|
|
128
130
|
link: Ligação
|
package/dist/locales/ru.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Заголовок 6
|
|
119
119
|
bulleted_list: Маркированный список
|
|
120
120
|
numbered_list: Нумерованный список
|
|
121
|
+
task_list: Список задач
|
|
121
122
|
blockquote: Цитата
|
|
122
123
|
code_block: Блок кода
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Полужирный
|
|
125
126
|
italic: Курсив
|
|
127
|
+
underline: Подчёркнутый
|
|
126
128
|
strikethrough: Зачёркнутый
|
|
127
129
|
code: Код
|
|
128
130
|
link: Ссылка
|
package/dist/locales/sk.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Nadpis 6
|
|
119
119
|
bulleted_list: Zoznam s odrážkami
|
|
120
120
|
numbered_list: Číslovaný zoznam
|
|
121
|
+
task_list: Zoznam úloh
|
|
121
122
|
blockquote: Citácia
|
|
122
123
|
code_block: Blok kódu
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Tučné
|
|
125
126
|
italic: Kurzíva
|
|
127
|
+
underline: Podčiarknuté
|
|
126
128
|
strikethrough: Prečiarknuté
|
|
127
129
|
code: Kód
|
|
128
130
|
link: Odkaz
|
package/dist/locales/sv.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Rubrik 6
|
|
119
119
|
bulleted_list: Punktlista
|
|
120
120
|
numbered_list: Numrerad lista
|
|
121
|
+
task_list: Uppgiftslista
|
|
121
122
|
blockquote: Blockcitat
|
|
122
123
|
code_block: Kodblock
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Fet
|
|
125
126
|
italic: Kursiv
|
|
127
|
+
underline: Understruken
|
|
126
128
|
strikethrough: Genomstruken
|
|
127
129
|
code: Kod
|
|
128
130
|
link: Länk
|
package/dist/locales/tr.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Başlık 6
|
|
119
119
|
bulleted_list: Madde İşaretli Liste
|
|
120
120
|
numbered_list: Numaralı Liste
|
|
121
|
+
task_list: Görev Listesi
|
|
121
122
|
blockquote: Alıntı
|
|
122
123
|
code_block: Kod Bloğu
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Kalın
|
|
125
126
|
italic: İtalik
|
|
127
|
+
underline: Altı Çizili
|
|
126
128
|
strikethrough: Üstü Çizili
|
|
127
129
|
code: Kod
|
|
128
130
|
link: Bağlantı
|
package/dist/locales/uk.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Заголовок 6
|
|
119
119
|
bulleted_list: Маркований список
|
|
120
120
|
numbered_list: Нумерований список
|
|
121
|
+
task_list: Список завдань
|
|
121
122
|
blockquote: Цитата
|
|
122
123
|
code_block: Блок коду
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: Жирний
|
|
125
126
|
italic: Курсив
|
|
127
|
+
underline: Підкреслений
|
|
126
128
|
strikethrough: Закреслений
|
|
127
129
|
code: Код
|
|
128
130
|
link: Посилання
|
package/dist/locales/vi.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: Tiêu đề 6
|
|
119
119
|
bulleted_list: Dấu đầu dòng
|
|
120
120
|
numbered_list: Đánh số
|
|
121
|
+
task_list: Danh sách công việc
|
|
121
122
|
blockquote: Trích dẫn
|
|
122
123
|
code_block: Khối mã
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: In đậm
|
|
125
126
|
italic: In nghiêng
|
|
127
|
+
underline: Gạch chân
|
|
126
128
|
strikethrough: Gạch ngang
|
|
127
129
|
code: Mã
|
|
128
130
|
link: Liên kết
|
package/dist/locales/zh-CN.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: 六级标题
|
|
119
119
|
bulleted_list: 无序列表
|
|
120
120
|
numbered_list: 有序列表
|
|
121
|
+
task_list: 任务列表
|
|
121
122
|
blockquote: 引用块
|
|
122
123
|
code_block: 代码块
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: 加粗
|
|
125
126
|
italic: 斜体
|
|
127
|
+
underline: 下划线
|
|
126
128
|
strikethrough: 删除线
|
|
127
129
|
code: 代码
|
|
128
130
|
link: 链接
|
package/dist/locales/zh-TW.yaml
CHANGED
|
@@ -118,11 +118,13 @@ text_editor:
|
|
|
118
118
|
heading_6: 標題 6
|
|
119
119
|
bulleted_list: 項目符號清單
|
|
120
120
|
numbered_list: 編號清單
|
|
121
|
+
task_list: 待辦清單
|
|
121
122
|
blockquote: 引言區塊
|
|
122
123
|
code_block: 程式碼區塊
|
|
123
124
|
# Inline style button aria-labels
|
|
124
125
|
bold: 粗體
|
|
125
126
|
italic: 斜體
|
|
127
|
+
underline: 底線
|
|
126
128
|
strikethrough: 刪除線
|
|
127
129
|
code: 程式碼
|
|
128
130
|
link: 連結
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import { Attachment } from 'svelte/attachments';
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Lifecycle shared by the composite widgets: the `Initializing` and `Initialized` events, the
|
|
6
|
+
* delayed activation that gives the child components time to mount, the event listeners that
|
|
7
|
+
* activate the widget before handling an event that comes first, and the clean-up.
|
|
8
|
+
*/
|
|
9
|
+
export class CompositeWidget {
|
|
10
|
+
/**
|
|
11
|
+
* Initialize a new `CompositeWidget` instance, and schedule its activation.
|
|
12
|
+
* @param {HTMLElement} parent Widget root element.
|
|
13
|
+
*/
|
|
14
|
+
constructor(parent: HTMLElement);
|
|
15
|
+
/**
|
|
16
|
+
* Whether {@link activate} has run. Until then, members are left as they are rendered.
|
|
17
|
+
* @type {boolean}
|
|
18
|
+
*/
|
|
19
|
+
activated: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether {@link destroy} has run, so a pending {@link activate} must not run.
|
|
22
|
+
* @type {boolean}
|
|
23
|
+
*/
|
|
24
|
+
destroyed: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Keystroke buffer for type-ahead.
|
|
27
|
+
* @type {TypeAhead}
|
|
28
|
+
*/
|
|
29
|
+
typeAheadBuffer: TypeAhead;
|
|
30
|
+
parent: HTMLElement;
|
|
31
|
+
/**
|
|
32
|
+
* Listen to an event on the widget root until {@link destroy} is called. The widget is activated
|
|
33
|
+
* before the event is handled, so an event that comes before the delayed activation isn’t lost.
|
|
34
|
+
* @template {keyof HTMLElementEventMap} K
|
|
35
|
+
* @param {K} type Event type.
|
|
36
|
+
* @param {(event: HTMLElementEventMap[K]) => void} handler Event handler.
|
|
37
|
+
*/
|
|
38
|
+
listen<K extends keyof HTMLElementEventMap>(type: K, handler: (event: HTMLElementEventMap[K]) => void): void;
|
|
39
|
+
/**
|
|
40
|
+
* Activate the members, unless they already are.
|
|
41
|
+
*/
|
|
42
|
+
activate(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Set up the members on activation. To be implemented by the subclass.
|
|
45
|
+
*/
|
|
46
|
+
setUp(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Called whenever the params passed to the attachment are updated. To be implemented by the
|
|
49
|
+
* subclass.
|
|
50
|
+
* @param {Record<string, any>} _params Updated params.
|
|
51
|
+
*/
|
|
52
|
+
onUpdate(_params: Record<string, any>): void;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the widget is disabled.
|
|
55
|
+
* @type {boolean}
|
|
56
|
+
*/
|
|
57
|
+
get isDisabled(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the widget is read-only.
|
|
60
|
+
* @type {boolean}
|
|
61
|
+
*/
|
|
62
|
+
get isReadOnly(): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Notify a change of the selection on the widget root.
|
|
65
|
+
* @param {HTMLElement} item Member that triggered the change.
|
|
66
|
+
*/
|
|
67
|
+
dispatchChange(item: HTMLElement): void;
|
|
68
|
+
/**
|
|
69
|
+
* Clean up event listeners.
|
|
70
|
+
*/
|
|
71
|
+
destroy(): void;
|
|
72
|
+
#private;
|
|
73
|
+
}
|
|
74
|
+
export function createWidgetAttachment<W extends CompositeWidget>(Widget: new (parent: HTMLElement, params?: any) => W): (paramsOrGetter?: object | (() => object)) => Attachment;
|
|
75
|
+
import { TypeAhead } from './type-ahead.js';
|
|
76
|
+
import type { Attachment } from 'svelte/attachments';
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class shared by the composite widgets, `Group` and `Tree`, along with the attachment factory
|
|
3
|
+
* that mounts them.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { untrack } from 'svelte';
|
|
7
|
+
import { getSelectedItemDetail } from './select.svelte.js';
|
|
8
|
+
import { TypeAhead } from './type-ahead.js';
|
|
9
|
+
import { activateBefore, activateLater } from './widget.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @import { Attachment } from 'svelte/attachments';
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Lifecycle shared by the composite widgets: the `Initializing` and `Initialized` events, the
|
|
17
|
+
* delayed activation that gives the child components time to mount, the event listeners that
|
|
18
|
+
* activate the widget before handling an event that comes first, and the clean-up.
|
|
19
|
+
*/
|
|
20
|
+
export class CompositeWidget {
|
|
21
|
+
/**
|
|
22
|
+
* Whether {@link activate} has run. Until then, members are left as they are rendered.
|
|
23
|
+
* @type {boolean}
|
|
24
|
+
*/
|
|
25
|
+
activated = false;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Whether {@link destroy} has run, so a pending {@link activate} must not run.
|
|
29
|
+
* @type {boolean}
|
|
30
|
+
*/
|
|
31
|
+
destroyed = false;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Keystroke buffer for type-ahead.
|
|
35
|
+
* @type {TypeAhead}
|
|
36
|
+
*/
|
|
37
|
+
typeAheadBuffer = new TypeAhead();
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Controller whose signal removes every listener added with {@link listen} once aborted.
|
|
41
|
+
* @type {AbortController}
|
|
42
|
+
*/
|
|
43
|
+
#controller = new AbortController();
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initialize a new `CompositeWidget` instance, and schedule its activation.
|
|
47
|
+
* @param {HTMLElement} parent Widget root element.
|
|
48
|
+
*/
|
|
49
|
+
constructor(parent) {
|
|
50
|
+
parent.dispatchEvent(new CustomEvent('Initializing'));
|
|
51
|
+
|
|
52
|
+
this.parent = parent;
|
|
53
|
+
|
|
54
|
+
// Wait a bit before the relevant components, including the `aria-controls` targets, are
|
|
55
|
+
// mounted. If the widget is unmounted in the meantime, nothing is set up.
|
|
56
|
+
activateLater(this, () => this.destroyed);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Listen to an event on the widget root until {@link destroy} is called. The widget is activated
|
|
61
|
+
* before the event is handled, so an event that comes before the delayed activation isn’t lost.
|
|
62
|
+
* @template {keyof HTMLElementEventMap} K
|
|
63
|
+
* @param {K} type Event type.
|
|
64
|
+
* @param {(event: HTMLElementEventMap[K]) => void} handler Event handler.
|
|
65
|
+
*/
|
|
66
|
+
listen(type, handler) {
|
|
67
|
+
this.parent.addEventListener(type, activateBefore(this, handler), {
|
|
68
|
+
signal: this.#controller.signal,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Activate the members, unless they already are.
|
|
74
|
+
*/
|
|
75
|
+
activate() {
|
|
76
|
+
if (this.activated) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
this.activated = true;
|
|
81
|
+
this.setUp();
|
|
82
|
+
this.parent.dispatchEvent(new CustomEvent('Initialized'));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Set up the members on activation. To be implemented by the subclass.
|
|
87
|
+
*/
|
|
88
|
+
setUp() {}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Called whenever the params passed to the attachment are updated. To be implemented by the
|
|
92
|
+
* subclass.
|
|
93
|
+
* @param {Record<string, any>} _params Updated params.
|
|
94
|
+
*/
|
|
95
|
+
// eslint-disable-next-line no-unused-vars
|
|
96
|
+
onUpdate(_params) {}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Whether the widget is disabled.
|
|
100
|
+
* @type {boolean}
|
|
101
|
+
*/
|
|
102
|
+
get isDisabled() {
|
|
103
|
+
return this.parent.matches('[aria-disabled="true"]');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Whether the widget is read-only.
|
|
108
|
+
* @type {boolean}
|
|
109
|
+
*/
|
|
110
|
+
get isReadOnly() {
|
|
111
|
+
return this.parent.matches('[aria-readonly="true"]');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Notify a change of the selection on the widget root.
|
|
116
|
+
* @param {HTMLElement} item Member that triggered the change.
|
|
117
|
+
*/
|
|
118
|
+
dispatchChange(item) {
|
|
119
|
+
this.parent.dispatchEvent(new CustomEvent('Change', { detail: getSelectedItemDetail(item) }));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Clean up event listeners.
|
|
124
|
+
*/
|
|
125
|
+
destroy() {
|
|
126
|
+
this.destroyed = true;
|
|
127
|
+
this.#controller.abort();
|
|
128
|
+
this.typeAheadBuffer.reset();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Create an attachment factory for the given composite widget class.
|
|
134
|
+
* @template {CompositeWidget} W
|
|
135
|
+
* @param {new (parent: HTMLElement, params?: any) => W} Widget Widget class.
|
|
136
|
+
* @returns {(paramsOrGetter?: object | (() => object)) => Attachment} Function that takes a params
|
|
137
|
+
* object, or a getter function for reactive params, and returns an attachment.
|
|
138
|
+
*/
|
|
139
|
+
export const createWidgetAttachment = (Widget) => (paramsOrGetter) => (parent) => {
|
|
140
|
+
const isGetter = typeof paramsOrGetter === 'function';
|
|
141
|
+
// Read the params without tracking them: attachments run in an effect, so a tracked read would
|
|
142
|
+
// destroy and recreate the whole widget whenever they change, e.g. on every search keystroke.
|
|
143
|
+
// Changes are handled by `onUpdate()` below instead.
|
|
144
|
+
const initialParams = isGetter ? untrack(() => paramsOrGetter()) : paramsOrGetter;
|
|
145
|
+
const widget = new Widget(/** @type {HTMLElement} */ (parent), initialParams);
|
|
146
|
+
|
|
147
|
+
/* v8 ignore next 4 */
|
|
148
|
+
if (isGetter) {
|
|
149
|
+
$effect(() => {
|
|
150
|
+
widget.onUpdate(paramsOrGetter());
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return () => {
|
|
155
|
+
widget.destroy();
|
|
156
|
+
};
|
|
157
|
+
};
|