@koobiq/components 20.1.0 → 20.3.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/accordion/_accordion-theme.scss +6 -2
- package/accordion/accordion-tokens.scss +3 -0
- package/accordion/{accordion-trigger.component.scss → accordion-trigger.scss} +10 -0
- package/accordion/accordion.scss +71 -0
- package/accordion/index.d.ts +264 -121
- package/actions-panel/index.d.ts +25 -13
- package/alert/_alert-theme.scss +14 -0
- package/alert/alert.component.scss +24 -13
- package/alert/index.d.ts +63 -29
- package/app-switcher/app-switcher-dropdown-app.scss +7 -5
- package/app-switcher/app-switcher-dropdown-site.scss +6 -4
- package/app-switcher/index.d.ts +41 -4
- package/app-switcher/kbq-app-switcher-list-item.scss +6 -8
- package/autocomplete/autocomplete.scss +2 -1
- package/autocomplete/index.d.ts +58 -37
- package/badge/index.d.ts +2 -3
- package/breadcrumbs/index.d.ts +1 -1
- package/button/index.d.ts +2 -2
- package/button-toggle/button-toggle-tokens.scss +2 -0
- package/button-toggle/button-toggle.scss +9 -0
- package/button-toggle/index.d.ts +5 -0
- package/checkbox/index.d.ts +33 -29
- package/clamped-text/index.d.ts +3 -2
- package/code-block/index.d.ts +24 -19
- package/content-panel/index.d.ts +1 -1
- package/core/index.d.ts +1217 -186
- package/core/option/_action-container-mixins.scss +28 -0
- package/core/option/_option-theme.scss +24 -0
- package/core/option/action.scss +7 -0
- package/core/styles/_core.scss +2 -0
- package/core/styles/_koobiq-theme.scss +2 -0
- package/core/styles/_tokens.scss +1 -0
- package/core/styles/common/_animation.scss +31 -24
- package/core/styles/common/_connected-overlay.scss +39 -0
- package/core/styles/common/_select.scss +19 -2
- package/core/styles/common/_tokens.scss +0 -9
- package/core/styles/theming/_index.scss +0 -1
- package/core/styles/theming/_theming.scss +34 -5
- package/datepicker/index.d.ts +46 -15
- package/dl/dl.scss +26 -0
- package/dl/index.d.ts +8 -1
- package/dropdown/_dropdown-theme.scss +28 -2
- package/dropdown/dropdown-item.scss +29 -0
- package/dropdown/dropdown-tokens.scss +2 -1
- package/dropdown/dropdown.scss +16 -1
- package/dropdown/index.d.ts +331 -17
- package/dynamic-translation/index.d.ts +1 -1
- package/fesm2022/koobiq-components-accordion.mjs +480 -317
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +57 -46
- package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-alert.mjs +98 -58
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs +233 -38
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +89 -52
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +18 -17
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +25 -25
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +17 -12
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +25 -25
- package/fesm2022/koobiq-components-checkbox.mjs +69 -92
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-clamped-text.mjs +18 -13
- package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +56 -69
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +29 -29
- package/fesm2022/koobiq-components-core.mjs +2485 -735
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +168 -126
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +7 -7
- package/fesm2022/koobiq-components-dl.mjs +23 -15
- package/fesm2022/koobiq-components-dl.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +814 -136
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-dynamic-translation.mjs +13 -13
- package/fesm2022/koobiq-components-ellipsis-center.mjs +7 -7
- package/fesm2022/koobiq-components-empty-state.mjs +19 -19
- package/fesm2022/koobiq-components-file-upload.mjs +74 -42
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +783 -199
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-flag.mjs +7 -7
- package/fesm2022/koobiq-components-form-field.mjs +350 -162
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +52 -25
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +175 -28
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +41 -24
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-link.mjs +8 -8
- package/fesm2022/koobiq-components-list.mjs +657 -143
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +16 -16
- package/fesm2022/koobiq-components-markdown.mjs +14 -11
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +59 -35
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +177 -67
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +40 -24
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +16 -17
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +31 -21
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-bar.mjs +13 -13
- package/fesm2022/koobiq-components-progress-spinner.mjs +13 -13
- package/fesm2022/koobiq-components-radio.mjs +10 -10
- package/fesm2022/koobiq-components-resizer.mjs +33 -14
- package/fesm2022/koobiq-components-resizer.mjs.map +1 -1
- package/fesm2022/koobiq-components-scrollbar.mjs +10 -10
- package/fesm2022/koobiq-components-search-expandable.mjs +49 -14
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +450 -146
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +14 -14
- package/fesm2022/koobiq-components-sidepanel.mjs +26 -26
- package/fesm2022/koobiq-components-skeleton.mjs +10 -10
- package/fesm2022/koobiq-components-split-button.mjs +10 -17
- package/fesm2022/koobiq-components-split-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-splitter.mjs +17 -17
- package/fesm2022/koobiq-components-table.mjs +15 -13
- package/fesm2022/koobiq-components-table.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +80 -68
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +283 -122
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +13 -8
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +29 -24
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +61 -30
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +77 -42
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +7 -7
- package/fesm2022/koobiq-components-toast.mjs +51 -26
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +72 -64
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +219 -28
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +13 -13
- package/fesm2022/koobiq-components-tree-select.mjs +222 -80
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +302 -81
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/fesm2022/koobiq-components-username.mjs +27 -27
- package/file-upload/index.d.ts +25 -6
- package/file-upload/multiple-file-upload.component.scss +14 -0
- package/filter-bar/_filter-bar-theme.scss +0 -10
- package/filter-bar/filter-bar-tokens.scss +3 -0
- package/filter-bar/filters.scss +3 -2
- package/filter-bar/index.d.ts +281 -9
- package/filter-bar/pipes/base-pipe.scss +0 -11
- package/filter-bar/pipes/pipe-input.scss +10 -0
- package/filter-bar/pipes/pipe-multi-tree-select.scss +0 -6
- package/filter-bar/pipes/pipe-multiselect.scss +0 -6
- package/filter-bar/pipes/pipe-tree-select.scss +0 -6
- package/form-field/_form-field-theme.scss +76 -20
- package/form-field/fieldset.scss +10 -0
- package/form-field/form-field-tokens.scss +15 -1
- package/form-field/form-field.scss +15 -19
- package/form-field/index.d.ts +147 -65
- package/icon/icon-button.scss +3 -1
- package/icon/index.d.ts +45 -7
- package/inline-edit/index.d.ts +57 -4
- package/inline-edit/inline-edit.scss +10 -0
- package/input/index.d.ts +17 -2
- package/list/_list-theme.scss +42 -10
- package/list/index.d.ts +326 -79
- package/list/list-tokens.scss +43 -8
- package/list/list.scss +186 -12
- package/markdown/index.d.ts +1 -1
- package/modal/index.d.ts +21 -4
- package/modal/modal-tokens.scss +1 -1
- package/navbar/_navbar-item_vertical.scss +7 -5
- package/navbar/index.d.ts +54 -5
- package/navbar/navbar-brand.scss +23 -7
- package/navbar/vertical-navbar.scss +6 -0
- package/notification-center/index.d.ts +2 -1
- package/notification-center/notification-item.scss +6 -0
- package/package.json +3 -6
- package/popover/index.d.ts +2 -2
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/resizer/index.d.ts +12 -0
- package/schematics/collection.json +10 -0
- package/schematics/migrations/alert-signals/README.md +64 -0
- package/schematics/migrations/alert-signals/data.js +70 -0
- package/schematics/migrations/alert-signals/index.js +350 -0
- package/schematics/migrations/alert-signals/schema.json +20 -0
- package/schematics/migrations/autocomplete-panel-width-auto/README.md +68 -0
- package/schematics/migrations/autocomplete-panel-width-auto/index.js +70 -0
- package/schematics/migrations/autocomplete-panel-width-auto/schema.json +15 -0
- package/schematics/migrations/deprecated-icons/README.md +29 -4
- package/schematics/migrations/deprecated-icons/data.js +7 -0
- package/schematics/migrations/deprecated-icons/index.js +62 -35
- package/schematics/migrations/filter-bar-signals/README.md +1 -1
- package/schematics/migrations/new-icons-pack/README.md +37 -2
- package/schematics/migrations/new-icons-pack/data.js +8 -0
- package/schematics/migrations/new-icons-pack/index.js +144 -53
- package/schematics/migrations.json +11 -1
- package/schematics/ng-add/index.js +3 -3
- package/schematics/utils/angular-parsing.js +41 -14
- package/schematics/utils/ast.js +31 -0
- package/schematics/utils/icon-migration.js +530 -0
- package/schematics/utils/typescript.js +44 -0
- package/scrollbar/index.d.ts +1 -1
- package/search-expandable/index.d.ts +3 -0
- package/select/index.d.ts +212 -40
- package/select/select-tokens.scss +0 -1
- package/select/select.scss +0 -2
- package/splitter/index.d.ts +1 -1
- package/table/_table-theme.scss +4 -0
- package/table/index.d.ts +2 -1
- package/table/table.scss +8 -0
- package/tabs/_tabs-common.scss +60 -31
- package/tabs/_tabs-theme.scss +12 -0
- package/tabs/index.d.ts +2 -2
- package/tabs/tab-header.scss +14 -0
- package/tabs/tab-nav-bar.scss +4 -0
- package/tabs/tabs-tokens.scss +1 -0
- package/tags/index.d.ts +128 -29
- package/textarea/index.d.ts +5 -0
- package/time-range/index.d.ts +1 -1
- package/timepicker/index.d.ts +4 -0
- package/timezone/index.d.ts +10 -8
- package/toast/index.d.ts +26 -3
- package/toggle/index.d.ts +34 -14
- package/tooltip/index.d.ts +119 -7
- package/tree/_tree-theme.scss +25 -5
- package/tree/index.d.ts +71 -3
- package/tree/tree-option.scss +2 -8
- package/tree-select/_tree-select-theme.scss +22 -0
- package/tree-select/index.d.ts +127 -36
- package/accordion/accordion.component.scss +0 -50
- package/core/styles/_tokens.kbq.import.scss +0 -4
- package/core/styles/theming/_components-theming.scss +0 -1927
- package/filter-bar/pipes/pipe-select.scss +0 -5
- package/overflow-items/overflow-items.scss +0 -20
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
@use '../core/styles/common/tokens' as *;
|
|
2
2
|
|
|
3
3
|
@mixin kbq-accordion-theme() {
|
|
4
|
+
// Only the trigger owns the item's focus ring. `:focus-within` would also fire for header
|
|
5
|
+
// actions and for controls inside the expanded content, ringing a section the user is merely
|
|
6
|
+
// typing in. Both shapes are matched because `<kbq-accordion-header>` is optional.
|
|
4
7
|
.kbq-accordion.cdk-keyboard-focused {
|
|
5
|
-
& .kbq-accordion-item:focus
|
|
8
|
+
& .kbq-accordion-item:has(> .kbq-accordion-trigger:focus),
|
|
9
|
+
& .kbq-accordion-item:has(> .kbq-accordion-header .kbq-accordion-trigger:focus) {
|
|
6
10
|
border-color: var(--kbq-accordion-item-states-focus-border-color);
|
|
7
11
|
}
|
|
8
12
|
}
|
|
@@ -36,7 +40,7 @@
|
|
|
36
40
|
color: var(--kbq-accordion-item-states-disabled-text-color);
|
|
37
41
|
|
|
38
42
|
& .kbq-accordion-trigger__icon {
|
|
39
|
-
color: var(--kbq-accordion-item-states-disabled-icon-color)
|
|
43
|
+
color: var(--kbq-accordion-item-states-disabled-icon-color);
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
.kbq-accordion {
|
|
2
|
+
--kbq-accordion-size-item-border-width: 2px;
|
|
2
3
|
--kbq-accordion-size-item-header-height: 36px;
|
|
3
4
|
--kbq-accordion-size-item-header-variant-fill-padding: var(--kbq-size-xs) var(--kbq-size-s);
|
|
4
5
|
--kbq-accordion-size-item-header-variant-hug-padding: var(--kbq-size-xs) var(--kbq-size-s) var(--kbq-size-xs)
|
|
5
6
|
var(--kbq-size-m);
|
|
6
7
|
--kbq-accordion-size-item-content-padding: 0px var(--kbq-size-m) var(--kbq-size-s) var(--kbq-size-m);
|
|
8
|
+
--kbq-accordion-size-item-header-actions-gap: var(--kbq-size-3xs);
|
|
9
|
+
--kbq-accordion-size-item-header-actions-padding-right: var(--kbq-size-s);
|
|
7
10
|
/* THEME TOKENS */
|
|
8
11
|
--kbq-accordion-item-default-background: transparent;
|
|
9
12
|
--kbq-accordion-item-default-text-color: var(--kbq-foreground-contrast);
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
padding: var(--kbq-size-xxs);
|
|
12
12
|
|
|
13
13
|
transition: transform 300ms ease-out;
|
|
14
|
+
|
|
15
|
+
@media (prefers-reduced-motion: reduce) {
|
|
16
|
+
transition: none;
|
|
17
|
+
}
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
& .kbq-accordion-trigger__badge,
|
|
@@ -19,6 +23,8 @@
|
|
|
19
23
|
margin-right: var(--kbq-size-s);
|
|
20
24
|
}
|
|
21
25
|
|
|
26
|
+
// @deprecated Actions nested inside the trigger are focusable elements inside a `role="button"`.
|
|
27
|
+
// Put them in a `.kbq-accordion-header__actions` sibling of the trigger instead.
|
|
22
28
|
& .kbq-accordion-trigger__action {
|
|
23
29
|
padding: var(--kbq-size-xxs) var(--kbq-size-xxs) var(--kbq-size-3xs);
|
|
24
30
|
margin-bottom: calc(-1 * #{var(--kbq-size-3xs)});
|
|
@@ -57,4 +63,8 @@
|
|
|
57
63
|
|
|
58
64
|
button.kbq-accordion-trigger {
|
|
59
65
|
flex: 1;
|
|
66
|
+
|
|
67
|
+
// A flex item floors at its min-content width by default, which would push the header actions
|
|
68
|
+
// past the item's right edge instead of letting a long label give way.
|
|
69
|
+
min-width: 0;
|
|
60
70
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use './accordion-theme' as *;
|
|
2
|
+
|
|
3
|
+
.kbq-accordion {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.kbq-accordion-item {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
display: block;
|
|
10
|
+
|
|
11
|
+
border-width: var(--kbq-accordion-size-item-border-width);
|
|
12
|
+
border-style: solid;
|
|
13
|
+
border-color: transparent;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.kbq-accordion-header {
|
|
17
|
+
display: flex;
|
|
18
|
+
|
|
19
|
+
height: var(--kbq-accordion-size-item-header-height);
|
|
20
|
+
// The height above is fixed, so a trigger label long enough to wrap would paint outside the
|
|
21
|
+
// header and over the item's border. Clipping keeps it inside; the trigger is a flex container,
|
|
22
|
+
// so `text-overflow` cannot ellipsize its text — wrap the label in an element of your own if you
|
|
23
|
+
// need that.
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
|
|
26
|
+
// Interactive controls live NEXT TO the trigger, never inside it: the trigger is `role="button"`
|
|
27
|
+
// and nesting focusable elements in it is an accessibility violation. The trigger's `flex: 1`
|
|
28
|
+
// keeps the rest of the header clickable, so the actions sit flush right; their padding matches
|
|
29
|
+
// the trigger's own right padding, which is `--kbq-size-s` in every variant.
|
|
30
|
+
& > .kbq-accordion-header__actions {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: var(--kbq-accordion-size-item-header-actions-gap);
|
|
34
|
+
|
|
35
|
+
// Icon buttons have a fixed size and nothing to reflow, so the trigger — not the actions —
|
|
36
|
+
// is what gives way when the header runs out of room.
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
|
|
39
|
+
padding-right: var(--kbq-accordion-size-item-header-actions-padding-right);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.kbq-accordion-content {
|
|
44
|
+
display: block;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
|
|
47
|
+
& > .kbq-accordion-content__body {
|
|
48
|
+
margin: unset;
|
|
49
|
+
padding: var(--kbq-accordion-size-item-content-padding);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&[data-state='open'] {
|
|
53
|
+
transition: height 300ms ease-out;
|
|
54
|
+
height: var(--kbq-accordion-content-height);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[data-state='closed'] {
|
|
58
|
+
transition: height 300ms ease-out;
|
|
59
|
+
height: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (prefers-reduced-motion: reduce) {
|
|
63
|
+
&[data-state='open'],
|
|
64
|
+
&[data-state='closed'] {
|
|
65
|
+
transition: none;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@include kbq-accordion-theme();
|
|
71
|
+
@include kbq-accordion-typography();
|
package/accordion/index.d.ts
CHANGED
|
@@ -1,83 +1,55 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
|
4
|
-
import * as i1 from '@koobiq/components/icon';
|
|
5
|
-
import { KbqIcon } from '@koobiq/components/icon';
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, AfterViewInit, OnDestroy, ChangeDetectorRef, AfterContentInit, ElementRef, Signal } from '@angular/core';
|
|
6
3
|
import { FocusMonitor, FocusKeyManager } from '@angular/cdk/a11y';
|
|
7
4
|
import { Directionality } from '@angular/cdk/bidi';
|
|
5
|
+
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
|
8
6
|
import { Subject } from 'rxjs';
|
|
7
|
+
import * as i1 from '@koobiq/components/icon';
|
|
8
|
+
import { KbqIcon } from '@koobiq/components/icon';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/** A snapshot of a single accordion item's persisted state. */
|
|
11
|
+
interface KbqAccordionItemSnapshot {
|
|
12
|
+
/** Whether the item is expanded. */
|
|
13
|
+
expanded: boolean;
|
|
14
|
+
/** The item's value. */
|
|
15
|
+
value: string;
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
/** The persisted state of an accordion, keyed by accordion item id. */
|
|
18
|
+
interface KbqAccordionState {
|
|
19
|
+
[itemId: string]: KbqAccordionItemSnapshot;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Strategy used by `KbqAccordion` to persist and restore the expanded state of its items
|
|
23
|
+
* while `useStateSaving` is enabled.
|
|
24
|
+
*
|
|
25
|
+
* Provide a custom implementation through the `KBQ_ACCORDION_STATE_STORE` token to change
|
|
26
|
+
* where the state is stored (e.g. `sessionStorage`, a backend, or an in-memory map).
|
|
27
|
+
*/
|
|
28
|
+
interface KbqAccordionStateStore {
|
|
29
|
+
/** Returns the previously saved state for the given key, or `null` when nothing is stored/available. */
|
|
30
|
+
getState(key: string): KbqAccordionState | null;
|
|
31
|
+
/** Persists the state for the given key. */
|
|
32
|
+
setState(key: string, state: KbqAccordionState): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Default `KbqAccordionStateStore` implementation backed by `localStorage`.
|
|
36
|
+
*
|
|
37
|
+
* All access is guarded so it is safe on the server (SSR) and in environments where storage
|
|
38
|
+
* throws on access (private mode, sandboxed iframes) or contains corrupt JSON.
|
|
39
|
+
*/
|
|
40
|
+
declare class KbqAccordionLocalStorageStateStore implements KbqAccordionStateStore {
|
|
18
41
|
private readonly isBrowser;
|
|
19
|
-
private readonly
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/** @docs-private */
|
|
25
|
-
protected readonly changeDetectorRef: ChangeDetectorRef;
|
|
26
|
-
/** @docs-private */
|
|
27
|
-
protected readonly selectionDispatcher: UniqueSelectionDispatcher;
|
|
28
|
-
/** @docs-private */
|
|
29
|
-
protected readonly dir: Directionality | null;
|
|
30
|
-
/** @docs-private */
|
|
31
|
-
protected keyManager: FocusKeyManager<KbqAccordionItem>;
|
|
32
|
-
/** @docs-private */
|
|
33
|
-
readonly openCloseAllActions: Subject<boolean>;
|
|
34
|
-
/** @docs-private */
|
|
35
|
-
readonly items: i0.Signal<readonly any[]>;
|
|
36
|
-
/** Specifies whether the accordion saves its states. Default is false */
|
|
37
|
-
useStateSaving: boolean;
|
|
38
|
-
readonly variant: i0.InputSignal<string>;
|
|
39
|
-
/** Whether the Accordion is disabled. */
|
|
40
|
-
readonly disabled: i0.InputSignalWithTransform<boolean, unknown>;
|
|
41
|
-
/** The orientation of the accordion. */
|
|
42
|
-
readonly orientation: i0.InputSignal<KbqAccordionOrientation>;
|
|
43
|
-
/**
|
|
44
|
-
* The value of the item to expand when initially rendered and type is "single". Use when you do not need to control the state of the items.
|
|
45
|
-
*/
|
|
46
|
-
get defaultValue(): string[] | string;
|
|
47
|
-
set defaultValue(value: string[] | string);
|
|
48
|
-
/** Determines whether one or multiple items can be opened at the same time. */
|
|
49
|
-
readonly type: i0.InputSignal<KbqAccordionType>;
|
|
50
|
-
readonly collapsible: i0.InputSignal<boolean>;
|
|
51
|
-
/** The controlled value of the item to expand */
|
|
52
|
-
get value(): string[] | string;
|
|
53
|
-
set value(value: string[] | string);
|
|
54
|
-
readonly onValueChange: i0.OutputEmitterRef<void>;
|
|
55
|
-
get id(): string;
|
|
56
|
-
get isMultiple(): boolean;
|
|
57
|
-
get hasSavedState(): boolean;
|
|
58
|
-
private _value?;
|
|
59
|
-
private _defaultValue;
|
|
60
|
-
private onValueChangeSubscription;
|
|
61
|
-
private _id;
|
|
62
|
-
private state;
|
|
63
|
-
constructor();
|
|
64
|
-
ngAfterContentInit(): void;
|
|
65
|
-
ngAfterViewInit(): void;
|
|
66
|
-
ngOnDestroy(): void;
|
|
67
|
-
/** @docs-private */
|
|
68
|
-
keydownHandler(event: KeyboardEvent): void;
|
|
69
|
-
/** Opens all enabled accordion items in an accordion where multi is enabled. */
|
|
70
|
-
openAll(): void;
|
|
71
|
-
/** Closes all enabled accordion items. */
|
|
72
|
-
closeAll(): void;
|
|
73
|
-
/** @docs-private */
|
|
74
|
-
setActiveItem(item: KbqAccordionItem): void;
|
|
75
|
-
/** @docs-private */
|
|
76
|
-
saveItemState(item: KbqAccordionItem, force?: boolean): void;
|
|
77
|
-
private getSavedState;
|
|
78
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordion, never>;
|
|
79
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KbqAccordion, "kbq-accordion, [kbq-accordion]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; }; }, { "onValueChange": "onValueChange"; }, ["items"], ["*"], true, never>;
|
|
42
|
+
private readonly window;
|
|
43
|
+
getState(key: string): KbqAccordionState | null;
|
|
44
|
+
setState(key: string, state: KbqAccordionState): void;
|
|
45
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionLocalStorageStateStore, never>;
|
|
46
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<KbqAccordionLocalStorageStateStore>;
|
|
80
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Injection token for the store used to persist accordion state while `useStateSaving` is enabled.
|
|
50
|
+
* Defaults to a `localStorage`-backed implementation (`KbqAccordionLocalStorageStateStore`).
|
|
51
|
+
*/
|
|
52
|
+
declare const KBQ_ACCORDION_STATE_STORE: InjectionToken<KbqAccordionStateStore>;
|
|
81
53
|
|
|
82
54
|
declare class KbqAccordionTriggerDirective {
|
|
83
55
|
/** @docs-private */
|
|
@@ -92,84 +64,106 @@ declare class KbqAccordionTriggerDirective {
|
|
|
92
64
|
get contentId(): string;
|
|
93
65
|
/** Fires when trigger clicked */
|
|
94
66
|
onClick(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Keeps the accordion's key manager in sync with native focus so that arrow-key navigation
|
|
69
|
+
* continues from the header the user has just tabbed/focused into.
|
|
70
|
+
* @docs-private
|
|
71
|
+
*/
|
|
72
|
+
onFocus(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Routes keyboard interaction to the accordion, but only while the trigger itself is focused.
|
|
75
|
+
*
|
|
76
|
+
* A `keydown` targets the focused element, so header actions placed next to the trigger and
|
|
77
|
+
* controls inside the expanded content keep their own keys — the accordion no longer toggles the
|
|
78
|
+
* section on Enter/Space nor moves focus to another header on the arrow keys. The `target` check
|
|
79
|
+
* additionally covers focusable content mistakenly nested inside the trigger.
|
|
80
|
+
*/
|
|
81
|
+
onKeydown(event: KeyboardEvent): void;
|
|
95
82
|
/** @docs-private */
|
|
96
83
|
focus(): void;
|
|
97
|
-
static ɵfac:
|
|
98
|
-
static ɵdir:
|
|
84
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionTriggerDirective, never>;
|
|
85
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionTriggerDirective, "[kbqAccordionTrigger]", never, {}, {}, never, never, true, never>;
|
|
99
86
|
}
|
|
100
87
|
|
|
101
|
-
declare class KbqAccordionTrigger implements AfterViewInit {
|
|
88
|
+
declare class KbqAccordionTrigger implements AfterViewInit, OnDestroy {
|
|
102
89
|
/** @docs-private */
|
|
103
90
|
protected readonly nativeElement: HTMLElement;
|
|
104
91
|
/** @docs-private */
|
|
105
92
|
protected readonly accordion: KbqAccordion;
|
|
106
93
|
/** @docs-private */
|
|
107
|
-
readonly icon:
|
|
94
|
+
readonly icon: _angular_core.Signal<KbqIcon>;
|
|
108
95
|
private savedTransition;
|
|
109
96
|
private readonly afterRenderRef?;
|
|
97
|
+
private animationTimerId?;
|
|
110
98
|
get isFill(): boolean;
|
|
111
99
|
get isHug(): boolean;
|
|
112
100
|
get isHugSpaceBetween(): boolean;
|
|
113
101
|
constructor();
|
|
114
102
|
ngAfterViewInit(): void;
|
|
103
|
+
ngOnDestroy(): void;
|
|
115
104
|
disableAnimation(): void;
|
|
116
105
|
enableAnimation(): void;
|
|
117
|
-
static ɵfac:
|
|
118
|
-
static ɵcmp:
|
|
106
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionTrigger, never>;
|
|
107
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<KbqAccordionTrigger, "kbq-accordion-trigger, [kbq-accordion-trigger]", never, {}, {}, never, ["*"], true, [{ directive: typeof KbqAccordionTriggerDirective; inputs: {}; outputs: {}; }]>;
|
|
119
108
|
}
|
|
120
109
|
|
|
121
110
|
type KbqAccordionItemState = 'open' | 'closed';
|
|
122
111
|
declare class KbqAccordionItem implements OnDestroy {
|
|
123
|
-
/**
|
|
124
|
-
|
|
112
|
+
/**
|
|
113
|
+
* The accordion this item belongs to — always the nearest one, because it is injected.
|
|
114
|
+
* The accordion reads it back to tell its own items apart from a nested accordion's.
|
|
115
|
+
*/
|
|
116
|
+
readonly accordion: KbqAccordion;
|
|
125
117
|
/** @docs-private */
|
|
126
118
|
protected readonly changeDetectorRef: ChangeDetectorRef;
|
|
127
119
|
/** @docs-private */
|
|
128
120
|
protected readonly expansionDispatcher: UniqueSelectionDispatcher;
|
|
129
121
|
/** @docs-private */
|
|
130
|
-
readonly trigger:
|
|
122
|
+
readonly trigger: _angular_core.Signal<KbqAccordionTriggerDirective | undefined>;
|
|
131
123
|
/** @docs-private */
|
|
132
|
-
readonly triggerComponent:
|
|
124
|
+
readonly triggerComponent: _angular_core.Signal<KbqAccordionTrigger | undefined>;
|
|
133
125
|
/** @docs-private */
|
|
134
|
-
readonly content:
|
|
126
|
+
readonly content: _angular_core.Signal<any>;
|
|
135
127
|
/** The unique AccordionItem id. */
|
|
136
128
|
get id(): string;
|
|
137
129
|
private _id;
|
|
130
|
+
/** The current open/closed state of the item. @docs-private */
|
|
138
131
|
get dataState(): KbqAccordionItemState;
|
|
132
|
+
/** The layout orientation inherited from the parent accordion. @docs-private */
|
|
139
133
|
get orientation(): KbqAccordionOrientation;
|
|
140
134
|
/** Whether the AccordionItem is expanded. */
|
|
141
135
|
get expanded(): boolean;
|
|
142
136
|
set expanded(expanded: boolean);
|
|
143
137
|
private _expanded;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
/**
|
|
139
|
+
* The item's own `value` input. Must stay `public`: a `protected` input cannot be bound from a
|
|
140
|
+
* consumer template (TS2445 under full AOT template type-checking).
|
|
141
|
+
* @docs-private
|
|
142
|
+
*/
|
|
143
|
+
readonly valueInput: _angular_core.InputSignal<string>;
|
|
144
|
+
/** The item's effective value — its own value, or the item id when none is provided. */
|
|
145
|
+
readonly value: _angular_core.Signal<string>;
|
|
147
146
|
/** Whether the AccordionItem is disabled. */
|
|
148
147
|
get disabled(): boolean;
|
|
149
148
|
set disabled(value: boolean);
|
|
150
149
|
private _disabled;
|
|
151
150
|
/** Event emitted every time the AccordionItem is closed. */
|
|
152
|
-
readonly closed:
|
|
151
|
+
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
153
152
|
/** Event emitted every time the AccordionItem is opened. */
|
|
154
|
-
readonly opened:
|
|
155
|
-
/**
|
|
156
|
-
* Event emitted when the AccordionItem is destroyed.
|
|
157
|
-
* @docs-private
|
|
158
|
-
*/
|
|
159
|
-
readonly destroyed: EventEmitter<void>;
|
|
153
|
+
readonly opened: _angular_core.OutputEmitterRef<void>;
|
|
160
154
|
/**
|
|
161
|
-
* Emits whenever the expanded state of the accordion changes.
|
|
155
|
+
* Emits whenever the expanded state of the accordion item changes.
|
|
162
156
|
* Primarily used to facilitate two-way binding.
|
|
163
157
|
* @docs-private
|
|
164
158
|
*/
|
|
165
|
-
readonly expandedChange:
|
|
159
|
+
readonly expandedChange: _angular_core.OutputEmitterRef<boolean>;
|
|
166
160
|
/** Unregister function for expansionDispatcher. */
|
|
167
161
|
private removeUniqueSelectionListener;
|
|
168
162
|
/** Subscription to openAll/closeAll events. */
|
|
169
163
|
private openCloseAllSubscription;
|
|
170
164
|
constructor();
|
|
171
|
-
/** Emits an event for the accordion item being destroyed. */
|
|
172
165
|
ngOnDestroy(): void;
|
|
166
|
+
/** Moves focus to the item's trigger. */
|
|
173
167
|
focus(): void;
|
|
174
168
|
/** Toggles the expanded state of the accordion item. */
|
|
175
169
|
toggle(): void;
|
|
@@ -177,19 +171,149 @@ declare class KbqAccordionItem implements OnDestroy {
|
|
|
177
171
|
close(): void;
|
|
178
172
|
/** Sets the expanded state of the accordion item to true. */
|
|
179
173
|
open(): void;
|
|
180
|
-
|
|
174
|
+
/** Returns a snapshot of the item's current persisted state. @docs-private */
|
|
175
|
+
getState(): KbqAccordionItemSnapshot;
|
|
176
|
+
/** Disables the open/close animation of the item's content and chevron. @docs-private */
|
|
181
177
|
disableAnimation(): void;
|
|
178
|
+
/** Restores the open/close animation of the item's content and chevron. @docs-private */
|
|
182
179
|
enableAnimation(): void;
|
|
183
180
|
private subscribeToOpenCloseAllActions;
|
|
184
|
-
static ɵfac:
|
|
185
|
-
static ɵdir:
|
|
181
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionItem, never>;
|
|
182
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionItem, "kbq-accordion-item, [kbq-accordion-item]", never, { "expanded": { "alias": "expanded"; "required": false; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "closed": "closed"; "opened": "opened"; "expandedChange": "expandedChange"; }, ["trigger", "triggerComponent", "content"], never, true, never>;
|
|
186
183
|
static ngAcceptInputType_expanded: unknown;
|
|
187
184
|
static ngAcceptInputType_disabled: unknown;
|
|
188
185
|
}
|
|
189
186
|
|
|
190
|
-
|
|
187
|
+
/** Available visual variants of the accordion. */
|
|
188
|
+
type KbqAccordionVariant = 'fill' | 'hug' | 'hugSpaceBetween';
|
|
189
|
+
/** Determines whether one or multiple items can be expanded at the same time. */
|
|
190
|
+
type KbqAccordionType = 'single' | 'multiple';
|
|
191
|
+
/** The layout orientation of the accordion. */
|
|
192
|
+
type KbqAccordionOrientation = 'horizontal' | 'vertical';
|
|
193
|
+
declare class KbqAccordion implements OnDestroy, AfterViewInit, AfterContentInit {
|
|
194
|
+
/** @docs-private */
|
|
195
|
+
protected readonly focusMonitor: FocusMonitor;
|
|
196
|
+
/** @docs-private */
|
|
197
|
+
protected readonly elementRef: ElementRef<any>;
|
|
198
|
+
/** @docs-private */
|
|
199
|
+
protected readonly changeDetectorRef: ChangeDetectorRef;
|
|
200
|
+
/** @docs-private */
|
|
201
|
+
protected readonly selectionDispatcher: UniqueSelectionDispatcher;
|
|
202
|
+
/** @docs-private */
|
|
203
|
+
protected readonly dir: Directionality | null;
|
|
204
|
+
private readonly injector;
|
|
205
|
+
private readonly stateStore;
|
|
206
|
+
/** @docs-private */
|
|
207
|
+
protected keyManager: FocusKeyManager<KbqAccordionItem>;
|
|
208
|
+
/** Emits every time `openAll()` or `closeAll()` is called. @docs-private */
|
|
209
|
+
readonly openCloseAllActions: Subject<boolean>;
|
|
210
|
+
/**
|
|
211
|
+
* Every item the content query matches, including those of a nested accordion.
|
|
212
|
+
* Use `items` instead — this one is the raw, unfiltered query.
|
|
213
|
+
* @docs-private
|
|
214
|
+
*/
|
|
215
|
+
protected readonly allItems: Signal<readonly KbqAccordionItem[]>;
|
|
216
|
+
/**
|
|
217
|
+
* The accordion items that belong to this accordion.
|
|
218
|
+
*
|
|
219
|
+
* A descendant content query resolves against the template the tag is authored in and does not
|
|
220
|
+
* stop at a nested component of the same type, so `allItems` of an outer accordion also matches
|
|
221
|
+
* the items of an accordion rendered inside an item's content. Each item's own `accordion` is
|
|
222
|
+
* injected and therefore always its nearest one, which makes ownership the reliable filter.
|
|
223
|
+
* Without it the key manager would move focus into the nested accordion's headers, `valueChange`
|
|
224
|
+
* would report a nested item's value and state saving would persist it under the outer key.
|
|
225
|
+
* @docs-private
|
|
226
|
+
*/
|
|
227
|
+
readonly items: Signal<readonly KbqAccordionItem[]>;
|
|
228
|
+
/** Whether the accordion persists the expanded state of its items across reloads. Defaults to `false`. */
|
|
229
|
+
readonly useStateSaving: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
230
|
+
/**
|
|
231
|
+
* A stable, consumer-provided key used to persist state when `useStateSaving` is enabled.
|
|
232
|
+
* Strongly recommended: without it the accordion falls back to an auto-generated,
|
|
233
|
+
* instantiation-order-dependent id that is unreliable under lazy/conditional/reordered rendering.
|
|
234
|
+
*/
|
|
235
|
+
readonly stateSavingKey: _angular_core.InputSignal<string>;
|
|
236
|
+
/** The visual variant of the accordion. Defaults to `fill`. */
|
|
237
|
+
readonly variant: _angular_core.InputSignal<KbqAccordionVariant>;
|
|
238
|
+
/** Whether the whole accordion is disabled. */
|
|
239
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
240
|
+
/** The layout orientation of the accordion. Defaults to `vertical`. */
|
|
241
|
+
readonly orientation: _angular_core.InputSignal<KbqAccordionOrientation>;
|
|
242
|
+
/**
|
|
243
|
+
* The `aria-level` applied to the item headings. Defaults to `2`.
|
|
244
|
+
* Set it to match the surrounding document outline (e.g. `3` when nested under an `<h2>` section).
|
|
245
|
+
*/
|
|
246
|
+
readonly level: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
247
|
+
/**
|
|
248
|
+
* The value of the item(s) to expand when initially rendered.
|
|
249
|
+
* Use when you do not need to control the state of the items.
|
|
250
|
+
*/
|
|
251
|
+
readonly defaultValue: _angular_core.InputSignal<string | string[]>;
|
|
252
|
+
/** Determines whether one or multiple items can be expanded at the same time. */
|
|
253
|
+
readonly type: _angular_core.InputSignal<KbqAccordionType>;
|
|
254
|
+
/** Whether an expanded item can be collapsed by the user. Defaults to `true`. */
|
|
255
|
+
readonly collapsible: _angular_core.InputSignal<boolean>;
|
|
256
|
+
/**
|
|
257
|
+
* The raw controlled `value` input. Must stay `public`: a `protected` input cannot be bound from
|
|
258
|
+
* a consumer template (TS2445 under full AOT template type-checking).
|
|
259
|
+
* @docs-private
|
|
260
|
+
*/
|
|
261
|
+
readonly valueInput: _angular_core.InputSignal<string | string[] | undefined>;
|
|
262
|
+
/**
|
|
263
|
+
* The controlled value of the item(s) to expand, reshaped by mode. Supports `[(value)]`.
|
|
264
|
+
* Falls back to `defaultValue` while `value` is unbound.
|
|
265
|
+
*
|
|
266
|
+
* Always an array in `multiple` mode and always a string in `single` mode — an empty string
|
|
267
|
+
* when nothing is expanded, matching what `valueChange` emits.
|
|
268
|
+
*/
|
|
269
|
+
readonly value: Signal<string | string[]>;
|
|
270
|
+
/** Emits the current value whenever the expanded state of the accordion changes. */
|
|
271
|
+
readonly valueChange: _angular_core.OutputEmitterRef<string | string[]>;
|
|
272
|
+
/** The unique id of this accordion. */
|
|
273
|
+
get id(): string;
|
|
274
|
+
/** Whether multiple items can be expanded at the same time. */
|
|
275
|
+
get isMultiple(): boolean;
|
|
276
|
+
/** Whether a persisted state exists for this accordion. */
|
|
277
|
+
get hasSavedState(): boolean;
|
|
278
|
+
/** `defaultValue` normalized to an array for internal coordination. */
|
|
279
|
+
private readonly defaultValueArray;
|
|
280
|
+
private _id;
|
|
281
|
+
private state;
|
|
282
|
+
constructor();
|
|
283
|
+
ngAfterContentInit(): void;
|
|
284
|
+
ngAfterViewInit(): void;
|
|
285
|
+
ngOnDestroy(): void;
|
|
286
|
+
/**
|
|
287
|
+
* Handles a key pressed on an item's trigger.
|
|
288
|
+
*
|
|
289
|
+
* Invoked by `KbqAccordionTriggerDirective`, not bound on the accordion host: a root listener
|
|
290
|
+
* also receives keys bubbling from the section content and from controls placed next to the
|
|
291
|
+
* trigger, and would swallow their Enter/Space and hijack their arrow keys. It would also
|
|
292
|
+
* activate the first item — stealing focus — the first time any key was pressed anywhere inside.
|
|
293
|
+
* @docs-private
|
|
294
|
+
*/
|
|
295
|
+
keydownHandler(event: KeyboardEvent): void;
|
|
296
|
+
/** Opens all enabled accordion items in an accordion where `type` is `multiple`. */
|
|
297
|
+
openAll(): void;
|
|
298
|
+
/** Closes all enabled accordion items. */
|
|
299
|
+
closeAll(): void;
|
|
300
|
+
/** @docs-private */
|
|
301
|
+
setActiveItem(item: KbqAccordionItem): void;
|
|
302
|
+
/**
|
|
303
|
+
* Persists the current state of the given item when `useStateSaving` is enabled.
|
|
304
|
+
* @docs-private
|
|
305
|
+
*/
|
|
306
|
+
saveItemState(item: KbqAccordionItem, force?: boolean): void;
|
|
307
|
+
/** The current expanded value(s) derived from the live item state. */
|
|
308
|
+
private getCurrentValue;
|
|
309
|
+
/** The key used to persist/restore state. */
|
|
310
|
+
private get stateStorageKey();
|
|
311
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordion, never>;
|
|
312
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<KbqAccordion, "kbq-accordion, [kbq-accordion]", never, { "useStateSaving": { "alias": "useStateSaving"; "required": false; "isSignal": true; }; "stateSavingKey": { "alias": "stateSavingKey"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, ["allItems"], ["*"], true, never>;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
declare class KbqAccordionContentDirective implements AfterViewInit {
|
|
191
316
|
private readonly renderer;
|
|
192
|
-
private readonly platform;
|
|
193
317
|
/** @docs-private */
|
|
194
318
|
protected readonly nativeElement: HTMLElement;
|
|
195
319
|
/** @docs-private */
|
|
@@ -199,40 +323,59 @@ declare class KbqAccordionContentDirective implements AfterContentInit, AfterVie
|
|
|
199
323
|
/** @docs-private */
|
|
200
324
|
get triggerId(): string;
|
|
201
325
|
/** @docs-private */
|
|
202
|
-
protected readonly hidden:
|
|
326
|
+
protected readonly hidden: _angular_core.WritableSignal<boolean>;
|
|
203
327
|
private savedTransition;
|
|
204
328
|
private readonly afterRenderRef?;
|
|
329
|
+
/** Whether the first browser render has happened, i.e. whether the content can be measured. */
|
|
330
|
+
private rendered;
|
|
205
331
|
constructor();
|
|
206
332
|
ngAfterViewInit(): void;
|
|
207
|
-
ngAfterContentInit(): void;
|
|
208
333
|
toggle(): void;
|
|
209
334
|
disableAnimation(): void;
|
|
210
335
|
enableAnimation(): void;
|
|
211
|
-
|
|
212
|
-
|
|
336
|
+
/**
|
|
337
|
+
* Publishes the natural height of the projected content as `--kbq-accordion-content-height`,
|
|
338
|
+
* which the open state animates towards.
|
|
339
|
+
*
|
|
340
|
+
* `scrollHeight` is used rather than `getBoundingClientRect()`: the host is `overflow: hidden`
|
|
341
|
+
* and collapsed to `height: 0` while closed, so its box reports `0`, whereas `scrollHeight`
|
|
342
|
+
* still reports the height of the content it clips.
|
|
343
|
+
*/
|
|
344
|
+
private updateHeight;
|
|
345
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionContentDirective, never>;
|
|
346
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionContentDirective, "[kbqAccordionContent]", ["kbqAccordionContent"], {}, {}, never, never, true, never>;
|
|
213
347
|
}
|
|
214
348
|
|
|
215
349
|
declare class KbqAccordionContent {
|
|
216
|
-
static ɵfac:
|
|
217
|
-
static ɵcmp:
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
declare class KbqAccordionHeaderDirective {
|
|
221
|
-
protected readonly item: KbqAccordionItem;
|
|
222
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordionHeaderDirective, never>;
|
|
223
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAccordionHeaderDirective, "[kbqAccordionHeader]", never, {}, {}, never, never, true, never>;
|
|
350
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionContent, never>;
|
|
351
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<KbqAccordionContent, "kbq-accordion-content, [kbq-accordion-content]", never, {}, {}, never, ["*"], true, [{ directive: typeof KbqAccordionContentDirective; inputs: {}; outputs: {}; }]>;
|
|
224
352
|
}
|
|
225
353
|
|
|
226
354
|
declare class KbqAccordionHeader {
|
|
227
|
-
|
|
228
|
-
|
|
355
|
+
/** @docs-private */
|
|
356
|
+
protected readonly item: KbqAccordionItem;
|
|
357
|
+
/** @docs-private */
|
|
358
|
+
protected readonly accordion: KbqAccordion;
|
|
359
|
+
/**
|
|
360
|
+
* Names the heading after the trigger alone.
|
|
361
|
+
*
|
|
362
|
+
* A `role="heading"` takes its name from its content, so the header actions sitting beside the
|
|
363
|
+
* trigger would otherwise append their own labels to it — a section titled "Profile" would be
|
|
364
|
+
* announced as "Profile Run More" when navigating by heading. Pointing at the trigger yields the
|
|
365
|
+
* announcement the WAI-ARIA APG gets by keeping the button the only element in the heading,
|
|
366
|
+
* which this component cannot do because the header is also the row that lays the actions out.
|
|
367
|
+
* @docs-private
|
|
368
|
+
*/
|
|
369
|
+
protected get labelledBy(): string | null;
|
|
370
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionHeader, never>;
|
|
371
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionHeader, "kbq-accordion-header, [kbq-accordion-header]", never, {}, {}, never, never, true, never>;
|
|
229
372
|
}
|
|
230
373
|
|
|
231
374
|
declare class KbqAccordionModule {
|
|
232
|
-
static ɵfac:
|
|
233
|
-
static ɵmod:
|
|
234
|
-
static ɵinj:
|
|
375
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionModule, never>;
|
|
376
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<KbqAccordionModule, never, [typeof i1.KbqIcon, typeof KbqAccordion, typeof KbqAccordionContent, typeof KbqAccordionHeader, typeof KbqAccordionItem, typeof KbqAccordionTrigger], [typeof KbqAccordion, typeof KbqAccordionContent, typeof KbqAccordionHeader, typeof KbqAccordionItem, typeof KbqAccordionTrigger]>;
|
|
377
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<KbqAccordionModule>;
|
|
235
378
|
}
|
|
236
379
|
|
|
237
|
-
export { KbqAccordion, KbqAccordionContent, KbqAccordionContentDirective, KbqAccordionHeader,
|
|
238
|
-
export type { KbqAccordionItemState, KbqAccordionOrientation, KbqAccordionType };
|
|
380
|
+
export { KBQ_ACCORDION_STATE_STORE, KbqAccordion, KbqAccordionContent, KbqAccordionContentDirective, KbqAccordionHeader, KbqAccordionItem, KbqAccordionLocalStorageStateStore, KbqAccordionModule, KbqAccordionTrigger, KbqAccordionTriggerDirective };
|
|
381
|
+
export type { KbqAccordionItemSnapshot, KbqAccordionItemState, KbqAccordionOrientation, KbqAccordionState, KbqAccordionStateStore, KbqAccordionType, KbqAccordionVariant };
|