@kirbydesign/extensions-angular 5.0.1 → 6.0.0-dev-d045bb2
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/assets/spot-illustrations/graph.coins.dot.bars.medium.svg +5 -0
- package/assets/spot-illustrations/house.plant.door.bars.medium.svg +5 -0
- package/assets/spot-illustrations/letters.arrow.triangle.circle.large.svg +5 -0
- package/assets/spot-illustrations/moneybag.money-notes.dot.bars.medium.svg +5 -0
- package/assets/spot-illustrations/template.plus.dot.circle.xlarge.svg +5 -0
- package/fesm2022/kirbydesign-extensions-angular-combobox.mjs +897 -852
- package/fesm2022/kirbydesign-extensions-angular-combobox.mjs.map +1 -1
- package/fesm2022/kirbydesign-extensions-angular-image-banner.mjs +206 -128
- package/fesm2022/kirbydesign-extensions-angular-image-banner.mjs.map +1 -1
- package/fesm2022/kirbydesign-extensions-angular-localization.mjs +541 -411
- package/fesm2022/kirbydesign-extensions-angular-localization.mjs.map +1 -1
- package/fesm2022/kirbydesign-extensions-angular-sidebar-menu.mjs +1462 -603
- package/fesm2022/kirbydesign-extensions-angular-sidebar-menu.mjs.map +1 -1
- package/fesm2022/kirbydesign-extensions-angular-skeleton-loader.mjs +79 -40
- package/fesm2022/kirbydesign-extensions-angular-skeleton-loader.mjs.map +1 -1
- package/fesm2022/kirbydesign-extensions-angular-spot-illustration.mjs +164 -140
- package/fesm2022/kirbydesign-extensions-angular-spot-illustration.mjs.map +1 -1
- package/fesm2022/kirbydesign-extensions-angular.mjs +1 -8
- package/fesm2022/kirbydesign-extensions-angular.mjs.map +1 -1
- package/package.json +13 -13
- package/types/kirbydesign-extensions-angular-combobox.d.ts +273 -216
- package/types/kirbydesign-extensions-angular-image-banner.d.ts +102 -66
- package/types/kirbydesign-extensions-angular-localization.d.ts +185 -204
- package/types/kirbydesign-extensions-angular-sidebar-menu.d.ts +137 -120
- package/types/kirbydesign-extensions-angular-skeleton-loader.d.ts +23 -17
- package/types/kirbydesign-extensions-angular-spot-illustration.d.ts +224 -187
- package/types/kirbydesign-extensions-angular.d.ts +2 -2
- package/combobox/package.json +0 -4
- package/image-banner/package.json +0 -4
- package/localization/package.json +0 -4
- package/sidebar-menu/package.json +0 -4
- package/skeleton-loader/package.json +0 -4
- package/spot-illustration/package.json +0 -4
|
@@ -1,646 +1,1505 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { CdkScrollable } from
|
|
4
|
-
import { Subject, debounceTime } from
|
|
5
|
-
import { distinctUntilChanged } from
|
|
6
|
-
import { DividerComponent } from
|
|
7
|
-
import {
|
|
8
|
-
import { RouterLink } from
|
|
9
|
-
import { ToggleButtonComponent } from
|
|
10
|
-
import { ButtonComponent } from
|
|
11
|
-
import * as i1 from
|
|
12
|
-
import {
|
|
13
|
-
import { BadgeComponent } from
|
|
14
|
-
import {
|
|
15
|
-
import { SkeletonLoaderComponent } from
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
i0.ɵɵ
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, ElementRef, EventEmitter, Injectable, Input, NgModule, Output, afterNextRender, computed, effect, forwardRef, inject, input, output, signal } from "@angular/core";
|
|
3
|
+
import { CdkScrollable } from "@angular/cdk/overlay";
|
|
4
|
+
import { Subject, debounceTime } from "rxjs";
|
|
5
|
+
import { distinctUntilChanged } from "rxjs/operators";
|
|
6
|
+
import { DividerComponent } from "@kirbydesign/designsystem/divider";
|
|
7
|
+
import { CdkDrag, CdkDropList, moveItemInArray } from "@angular/cdk/drag-drop";
|
|
8
|
+
import { RouterLink } from "@angular/router";
|
|
9
|
+
import { ToggleButtonComponent } from "@kirbydesign/designsystem/toggle-button";
|
|
10
|
+
import { ButtonComponent } from "@kirbydesign/designsystem/button";
|
|
11
|
+
import * as i1 from "@kirbydesign/designsystem/icon";
|
|
12
|
+
import { IconComponent, IconModule } from "@kirbydesign/designsystem/icon";
|
|
13
|
+
import { BadgeComponent } from "@kirbydesign/designsystem/badge";
|
|
14
|
+
import { AUTO_STYLE, animate, style, transition, trigger } from "@angular/animations";
|
|
15
|
+
import { SkeletonLoaderComponent } from "@kirbydesign/extensions-angular/skeleton-loader";
|
|
16
|
+
var HeightObserverDirective = class HeightObserverDirective {
|
|
17
|
+
#element;
|
|
18
|
+
#heightChanges;
|
|
19
|
+
#observer;
|
|
20
|
+
constructor() {
|
|
21
|
+
this.heightChange = output();
|
|
22
|
+
this.#element = inject(ElementRef).nativeElement;
|
|
23
|
+
this.#heightChanges = new Subject();
|
|
24
|
+
this.#observer = new ResizeObserver((entries) => {
|
|
25
|
+
this.#heightChanges.next(entries[0].contentRect.height);
|
|
26
|
+
});
|
|
27
|
+
this.#observer.observe(this.#element, { box: "content-box" });
|
|
28
|
+
this.#heightChanges.pipe(debounceTime(50), distinctUntilChanged()).subscribe(this.heightChange.emit.bind(this.heightChange));
|
|
29
|
+
}
|
|
30
|
+
ngOnDestroy() {
|
|
31
|
+
this.#observer.unobserve(this.#element);
|
|
32
|
+
this.#observer.disconnect();
|
|
33
|
+
}
|
|
34
|
+
static {
|
|
35
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
36
|
+
minVersion: "12.0.0",
|
|
37
|
+
version: "22.2.2",
|
|
38
|
+
ngImport: i0,
|
|
39
|
+
type: HeightObserverDirective,
|
|
40
|
+
deps: [],
|
|
41
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
static {
|
|
45
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
46
|
+
minVersion: "14.0.0",
|
|
47
|
+
version: "22.2.2",
|
|
48
|
+
type: HeightObserverDirective,
|
|
49
|
+
isStandalone: true,
|
|
50
|
+
selector: "[kirbyXHeightObserver]",
|
|
51
|
+
outputs: { heightChange: "heightChange" },
|
|
52
|
+
ngImport: i0
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
57
|
+
minVersion: "12.0.0",
|
|
58
|
+
version: "22.2.2",
|
|
59
|
+
ngImport: i0,
|
|
60
|
+
type: HeightObserverDirective,
|
|
61
|
+
decorators: [{
|
|
62
|
+
type: Directive,
|
|
63
|
+
args: [{ selector: "[kirbyXHeightObserver]" }]
|
|
64
|
+
}],
|
|
65
|
+
ctorParameters: () => [],
|
|
66
|
+
propDecorators: { heightChange: [{
|
|
67
|
+
type: i0.Output,
|
|
68
|
+
args: ["heightChange"]
|
|
69
|
+
}] }
|
|
70
|
+
});
|
|
71
|
+
var SidebarService = class SidebarService {
|
|
72
|
+
#menuHeight = signal(0, ...ngDevMode ? [{ debugName: "#menuHeight" }] : /* istanbul ignore next */ []);
|
|
73
|
+
#containerHeight = signal(0, ...ngDevMode ? [{ debugName: "#containerHeight" }] : /* istanbul ignore next */ []);
|
|
74
|
+
#scrollDistance = signal(0, ...ngDevMode ? [{ debugName: "#scrollDistance" }] : /* istanbul ignore next */ []);
|
|
75
|
+
#scrollableDistance = computed(() => Math.max(0, this.#menuHeight() - this.#containerHeight()), ...ngDevMode ? [{ debugName: "#scrollableDistance" }] : /* istanbul ignore next */ []);
|
|
76
|
+
#hasScrollbar = computed(() => this.#scrollableDistance() > 0, ...ngDevMode ? [{ debugName: "#hasScrollbar" }] : /* istanbul ignore next */ []);
|
|
77
|
+
#notAtBottom = computed(() => this.#scrollDistance() < this.#scrollableDistance(), ...ngDevMode ? [{ debugName: "#notAtBottom" }] : /* istanbul ignore next */ []);
|
|
78
|
+
#showHeaderBottomBorder = computed(() => this.#scrollDistance() > 0, ...ngDevMode ? [{ debugName: "#showHeaderBottomBorder" }] : /* istanbul ignore next */ []);
|
|
79
|
+
#showFooterTopBorder = computed(() => this.#hasScrollbar() && this.#notAtBottom(), ...ngDevMode ? [{ debugName: "#showFooterTopBorder" }] : /* istanbul ignore next */ []);
|
|
80
|
+
get showHeaderBottomBorder() {
|
|
81
|
+
return this.#showHeaderBottomBorder;
|
|
82
|
+
}
|
|
83
|
+
get showFooterTopBorder() {
|
|
84
|
+
return this.#showFooterTopBorder;
|
|
85
|
+
}
|
|
86
|
+
set menuHeight(height) {
|
|
87
|
+
this.#menuHeight.set(height);
|
|
88
|
+
}
|
|
89
|
+
set containerHeight(height) {
|
|
90
|
+
this.#containerHeight.set(height);
|
|
91
|
+
}
|
|
92
|
+
set scrollDistance(distance) {
|
|
93
|
+
this.#scrollDistance.set(distance);
|
|
94
|
+
}
|
|
95
|
+
static {
|
|
96
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
97
|
+
minVersion: "12.0.0",
|
|
98
|
+
version: "22.2.2",
|
|
99
|
+
ngImport: i0,
|
|
100
|
+
type: SidebarService,
|
|
101
|
+
deps: [],
|
|
102
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
static {
|
|
106
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
107
|
+
minVersion: "12.0.0",
|
|
108
|
+
version: "22.2.2",
|
|
109
|
+
ngImport: i0,
|
|
110
|
+
type: SidebarService,
|
|
111
|
+
providedIn: "root"
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
116
|
+
minVersion: "12.0.0",
|
|
117
|
+
version: "22.2.2",
|
|
118
|
+
ngImport: i0,
|
|
119
|
+
type: SidebarService,
|
|
120
|
+
decorators: [{
|
|
121
|
+
type: Injectable,
|
|
122
|
+
args: [{ providedIn: "root" }]
|
|
123
|
+
}]
|
|
124
|
+
});
|
|
125
|
+
var SidebarContainerComponent = class SidebarContainerComponent {
|
|
126
|
+
constructor() {
|
|
127
|
+
this.#sidebarService = inject(SidebarService);
|
|
128
|
+
this.vm = {
|
|
129
|
+
showHeaderBottomBorder: this.#sidebarService.showHeaderBottomBorder,
|
|
130
|
+
showFooterTopBorder: this.#sidebarService.showFooterTopBorder,
|
|
131
|
+
setContainerHeight: this.#setContainerHeight.bind(this),
|
|
132
|
+
setScroll: this.#setScrollDistance.bind(this)
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
#sidebarService;
|
|
136
|
+
#setContainerHeight(height) {
|
|
137
|
+
this.#sidebarService.containerHeight = height;
|
|
138
|
+
}
|
|
139
|
+
#setScrollDistance(event) {
|
|
140
|
+
const target = event.target;
|
|
141
|
+
if (target) this.#sidebarService.scrollDistance = target.scrollTop;
|
|
142
|
+
}
|
|
143
|
+
static {
|
|
144
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
145
|
+
minVersion: "12.0.0",
|
|
146
|
+
version: "22.2.2",
|
|
147
|
+
ngImport: i0,
|
|
148
|
+
type: SidebarContainerComponent,
|
|
149
|
+
deps: [],
|
|
150
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
static {
|
|
154
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
155
|
+
minVersion: "14.0.0",
|
|
156
|
+
version: "22.2.2",
|
|
157
|
+
type: SidebarContainerComponent,
|
|
158
|
+
isStandalone: true,
|
|
159
|
+
selector: "aside[kirby-x-sidebar-container]",
|
|
160
|
+
ngImport: i0,
|
|
161
|
+
template: "<div class=\"sidebar-header\" [class.bottom-border]=\"vm.showHeaderBottomBorder()\">\n <ng-content select=\"[slot='header']\"></ng-content>\n</div>\n<div\n kirbyXHeightObserver\n class=\"sidebar-content\"\n cdkScrollable\n (scroll)=\"vm.setScroll($event)\"\n (heightChange)=\"vm.setContainerHeight($event)\"\n>\n <ng-content select=\"[slot='content']\"></ng-content>\n</div>\n<div class=\"sidebar-footer\" [class.top-border]=\"vm.showFooterTopBorder()\">\n <ng-content select=\"[slot='footer']\"></ng-content>\n</div>\n",
|
|
162
|
+
styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}ion-item-option.primary{background-color:var(--kirby-primary);color:var(--kirby-primary-contrast)}ion-item-option.secondary{background-color:var(--kirby-secondary);color:var(--kirby-secondary-contrast)}ion-item-option.tertiary{background-color:var(--kirby-tertiary);color:var(--kirby-tertiary-contrast)}ion-item-option.success{background-color:var(--kirby-success);color:var(--kirby-success-contrast)}ion-item-option.warning{background-color:var(--kirby-warning);color:var(--kirby-warning-contrast)}ion-item-option.danger{background-color:var(--kirby-danger);color:var(--kirby-danger-contrast)}ion-item-option.white-overlay{background-color:var(--kirby-white-overlay);color:var(--kirby-white-overlay-contrast)}ion-item-option.light{background-color:var(--kirby-light);color:var(--kirby-light-contrast)}ion-item-option.medium{background-color:var(--kirby-medium);color:var(--kirby-medium-contrast)}ion-item-option.dark{background-color:var(--kirby-dark);color:var(--kirby-dark-contrast)}ion-item-option.dark-overlay{background-color:var(--kirby-dark-overlay);color:var(--kirby-dark-overlay-contrast)}:host{--kirby-inputs-background-color: var(--kirby-white-overlay);--kirby-inputs-background-color-hover: var(--kirby-white-overlay-30);--kirby-inputs-background-color-active: var(--kirby-white-overlay-40);--kirby-inputs-color: var(--kirby-white);--kirby-inputs-indicator-background-color: var(--kirby-white);--kirby-inputs-indicator-color: var(--kirby-black);--kirby-inputs-placeholder-color: var(--kirby-white-overlay-50);--kirby-inputs-color-hover: var(--kirby-white-overlay-50);--kirby-inputs-elevation: none;height:100%;height:100dvh;background-color:var(--sidebar-background-color, var(--kirby-tertiary));color:var(--sidebar-color, var(--kirby-tertiary-contrast));display:flex;flex-direction:column}:host *{scrollbar-width:thin;scrollbar-color:var(--kirby-semi-dark) var(--kirby-tertiary)}:host *::-webkit-scrollbar{width:16px}:host *::-webkit-scrollbar-track{background:transparent}:host *::-webkit-scrollbar-thumb{background-color:#8e8e8e80;border-radius:20px;border:4px solid transparent;background-clip:content-box}.sidebar-content{flex-grow:1;min-height:0;display:flex;flex-direction:column;overflow-y:auto}@supports (scrollbar-gutter: stable){.sidebar-content{overflow:hidden auto;scrollbar-gutter:auto}}.sidebar-header,.sidebar-footer{z-index:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;position:relative}.sidebar-header.bottom-border{box-shadow:0 4px 10px 2px #1c1c1c4d;transition:opacity .3s}.sidebar-footer.top-border{box-shadow:0 -4px 10px 2px #1c1c1c4d;transition:opacity .3s}\n"],
|
|
163
|
+
dependencies: [{
|
|
164
|
+
kind: "directive",
|
|
165
|
+
type: HeightObserverDirective,
|
|
166
|
+
selector: "[kirbyXHeightObserver]",
|
|
167
|
+
outputs: ["heightChange"]
|
|
168
|
+
}, {
|
|
169
|
+
kind: "directive",
|
|
170
|
+
type: CdkScrollable,
|
|
171
|
+
selector: "[cdk-scrollable], [cdkScrollable]"
|
|
172
|
+
}],
|
|
173
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
178
|
+
minVersion: "12.0.0",
|
|
179
|
+
version: "22.2.2",
|
|
180
|
+
ngImport: i0,
|
|
181
|
+
type: SidebarContainerComponent,
|
|
182
|
+
decorators: [{
|
|
183
|
+
type: Component,
|
|
184
|
+
args: [{
|
|
185
|
+
selector: "aside[kirby-x-sidebar-container]",
|
|
186
|
+
imports: [HeightObserverDirective, CdkScrollable],
|
|
187
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
188
|
+
template: "<div class=\"sidebar-header\" [class.bottom-border]=\"vm.showHeaderBottomBorder()\">\n <ng-content select=\"[slot='header']\"></ng-content>\n</div>\n<div\n kirbyXHeightObserver\n class=\"sidebar-content\"\n cdkScrollable\n (scroll)=\"vm.setScroll($event)\"\n (heightChange)=\"vm.setContainerHeight($event)\"\n>\n <ng-content select=\"[slot='content']\"></ng-content>\n</div>\n<div class=\"sidebar-footer\" [class.top-border]=\"vm.showFooterTopBorder()\">\n <ng-content select=\"[slot='footer']\"></ng-content>\n</div>\n",
|
|
189
|
+
styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}ion-item-option.primary{background-color:var(--kirby-primary);color:var(--kirby-primary-contrast)}ion-item-option.secondary{background-color:var(--kirby-secondary);color:var(--kirby-secondary-contrast)}ion-item-option.tertiary{background-color:var(--kirby-tertiary);color:var(--kirby-tertiary-contrast)}ion-item-option.success{background-color:var(--kirby-success);color:var(--kirby-success-contrast)}ion-item-option.warning{background-color:var(--kirby-warning);color:var(--kirby-warning-contrast)}ion-item-option.danger{background-color:var(--kirby-danger);color:var(--kirby-danger-contrast)}ion-item-option.white-overlay{background-color:var(--kirby-white-overlay);color:var(--kirby-white-overlay-contrast)}ion-item-option.light{background-color:var(--kirby-light);color:var(--kirby-light-contrast)}ion-item-option.medium{background-color:var(--kirby-medium);color:var(--kirby-medium-contrast)}ion-item-option.dark{background-color:var(--kirby-dark);color:var(--kirby-dark-contrast)}ion-item-option.dark-overlay{background-color:var(--kirby-dark-overlay);color:var(--kirby-dark-overlay-contrast)}:host{--kirby-inputs-background-color: var(--kirby-white-overlay);--kirby-inputs-background-color-hover: var(--kirby-white-overlay-30);--kirby-inputs-background-color-active: var(--kirby-white-overlay-40);--kirby-inputs-color: var(--kirby-white);--kirby-inputs-indicator-background-color: var(--kirby-white);--kirby-inputs-indicator-color: var(--kirby-black);--kirby-inputs-placeholder-color: var(--kirby-white-overlay-50);--kirby-inputs-color-hover: var(--kirby-white-overlay-50);--kirby-inputs-elevation: none;height:100%;height:100dvh;background-color:var(--sidebar-background-color, var(--kirby-tertiary));color:var(--sidebar-color, var(--kirby-tertiary-contrast));display:flex;flex-direction:column}:host *{scrollbar-width:thin;scrollbar-color:var(--kirby-semi-dark) var(--kirby-tertiary)}:host *::-webkit-scrollbar{width:16px}:host *::-webkit-scrollbar-track{background:transparent}:host *::-webkit-scrollbar-thumb{background-color:#8e8e8e80;border-radius:20px;border:4px solid transparent;background-clip:content-box}.sidebar-content{flex-grow:1;min-height:0;display:flex;flex-direction:column;overflow-y:auto}@supports (scrollbar-gutter: stable){.sidebar-content{overflow:hidden auto;scrollbar-gutter:auto}}.sidebar-header,.sidebar-footer{z-index:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;position:relative}.sidebar-header.bottom-border{box-shadow:0 4px 10px 2px #1c1c1c4d;transition:opacity .3s}.sidebar-footer.top-border{box-shadow:0 -4px 10px 2px #1c1c1c4d;transition:opacity .3s}\n"]
|
|
190
|
+
}]
|
|
191
|
+
}]
|
|
192
|
+
});
|
|
193
|
+
var SidebarComponent = class SidebarComponent {
|
|
194
|
+
static {
|
|
195
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
196
|
+
minVersion: "12.0.0",
|
|
197
|
+
version: "22.2.2",
|
|
198
|
+
ngImport: i0,
|
|
199
|
+
type: SidebarComponent,
|
|
200
|
+
deps: [],
|
|
201
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
static {
|
|
205
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
206
|
+
minVersion: "14.0.0",
|
|
207
|
+
version: "22.2.2",
|
|
208
|
+
type: SidebarComponent,
|
|
209
|
+
isStandalone: true,
|
|
210
|
+
selector: "kirby-x-sidebar",
|
|
211
|
+
ngImport: i0,
|
|
212
|
+
template: `
|
|
110
213
|
<aside kirby-x-sidebar-container>
|
|
111
214
|
<ng-content select="kirby-x-sidebar-header" slot="header"></ng-content>
|
|
112
215
|
<ng-content slot="content"></ng-content>
|
|
113
216
|
<ng-content select="kirby-x-sidebar-footer" slot="footer"></ng-content>
|
|
114
217
|
</aside>
|
|
115
|
-
`,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
218
|
+
`,
|
|
219
|
+
isInline: true,
|
|
220
|
+
dependencies: [{
|
|
221
|
+
kind: "component",
|
|
222
|
+
type: SidebarContainerComponent,
|
|
223
|
+
selector: "aside[kirby-x-sidebar-container]"
|
|
224
|
+
}],
|
|
225
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
230
|
+
minVersion: "12.0.0",
|
|
231
|
+
version: "22.2.2",
|
|
232
|
+
ngImport: i0,
|
|
233
|
+
type: SidebarComponent,
|
|
234
|
+
decorators: [{
|
|
235
|
+
type: Component,
|
|
236
|
+
args: [{
|
|
237
|
+
selector: "kirby-x-sidebar",
|
|
238
|
+
template: `
|
|
122
239
|
<aside kirby-x-sidebar-container>
|
|
123
240
|
<ng-content select="kirby-x-sidebar-header" slot="header"></ng-content>
|
|
124
241
|
<ng-content slot="content"></ng-content>
|
|
125
242
|
<ng-content select="kirby-x-sidebar-footer" slot="footer"></ng-content>
|
|
126
243
|
</aside>
|
|
127
244
|
`,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
245
|
+
imports: [SidebarContainerComponent],
|
|
246
|
+
changeDetection: ChangeDetectionStrategy.Eager
|
|
247
|
+
}]
|
|
248
|
+
}]
|
|
249
|
+
});
|
|
250
|
+
var SidebarFooterComponent = class SidebarFooterComponent {
|
|
251
|
+
static {
|
|
252
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
253
|
+
minVersion: "12.0.0",
|
|
254
|
+
version: "22.2.2",
|
|
255
|
+
ngImport: i0,
|
|
256
|
+
type: SidebarFooterComponent,
|
|
257
|
+
deps: [],
|
|
258
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
static {
|
|
262
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
263
|
+
minVersion: "14.0.0",
|
|
264
|
+
version: "22.2.2",
|
|
265
|
+
type: SidebarFooterComponent,
|
|
266
|
+
isStandalone: true,
|
|
267
|
+
selector: "kirby-x-sidebar-footer",
|
|
268
|
+
ngImport: i0,
|
|
269
|
+
template: "<footer><ng-content></ng-content></footer>",
|
|
270
|
+
isInline: true,
|
|
271
|
+
styles: [":host,footer{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}:host{min-height:80px}\n"],
|
|
272
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
277
|
+
minVersion: "12.0.0",
|
|
278
|
+
version: "22.2.2",
|
|
279
|
+
ngImport: i0,
|
|
280
|
+
type: SidebarFooterComponent,
|
|
281
|
+
decorators: [{
|
|
282
|
+
type: Component,
|
|
283
|
+
args: [{
|
|
284
|
+
selector: "kirby-x-sidebar-footer",
|
|
285
|
+
template: "<footer><ng-content></ng-content></footer>",
|
|
286
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
287
|
+
styles: [":host,footer{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}:host{min-height:80px}\n"]
|
|
288
|
+
}]
|
|
289
|
+
}]
|
|
290
|
+
});
|
|
291
|
+
var SidebarHeaderComponent = class SidebarHeaderComponent {
|
|
292
|
+
static {
|
|
293
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
294
|
+
minVersion: "12.0.0",
|
|
295
|
+
version: "22.2.2",
|
|
296
|
+
ngImport: i0,
|
|
297
|
+
type: SidebarHeaderComponent,
|
|
298
|
+
deps: [],
|
|
299
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
static {
|
|
303
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
304
|
+
minVersion: "14.0.0",
|
|
305
|
+
version: "22.2.2",
|
|
306
|
+
type: SidebarHeaderComponent,
|
|
307
|
+
isStandalone: true,
|
|
308
|
+
selector: "kirby-x-sidebar-header",
|
|
309
|
+
ngImport: i0,
|
|
310
|
+
template: `
|
|
144
311
|
<header>
|
|
145
312
|
<span class="sidebar-logo"><ng-content select="[slot='logo']"></ng-content></span>
|
|
146
313
|
<div class="action-bar">
|
|
147
314
|
<ng-content select="[slot='action']"></ng-content>
|
|
148
315
|
</div>
|
|
149
316
|
</header>
|
|
150
|
-
`,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
317
|
+
`,
|
|
318
|
+
isInline: true,
|
|
319
|
+
styles: [":host,header{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}:host::ng-deep [slot=logo]{display:inline-flex}:host::ng-deep [slot=logo] img,:host::ng-deep img[slot=logo]{object-fit:contain;max-width:100%;max-height:100%}.sidebar-logo{display:flex;align-items:center;height:50px;margin:var(--kirby-spacing-l) var(--kirby-spacing-m)}.action-bar{display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;width:100%}.action-bar:has([slot=action]){padding:0 var(--kirby-spacing-xs) var(--kirby-spacing-xs)}\n"],
|
|
320
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
325
|
+
minVersion: "12.0.0",
|
|
326
|
+
version: "22.2.2",
|
|
327
|
+
ngImport: i0,
|
|
328
|
+
type: SidebarHeaderComponent,
|
|
329
|
+
decorators: [{
|
|
330
|
+
type: Component,
|
|
331
|
+
args: [{
|
|
332
|
+
selector: "kirby-x-sidebar-header",
|
|
333
|
+
template: `
|
|
155
334
|
<header>
|
|
156
335
|
<span class="sidebar-logo"><ng-content select="[slot='logo']"></ng-content></span>
|
|
157
336
|
<div class="action-bar">
|
|
158
337
|
<ng-content select="[slot='action']"></ng-content>
|
|
159
338
|
</div>
|
|
160
339
|
</header>
|
|
161
|
-
`,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
inline: position,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
class MenuItemComponent {
|
|
181
|
-
constructor() {
|
|
182
|
-
this.id = input.required(...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
183
|
-
this.size = input.required(...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
184
|
-
this.icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
185
|
-
this.iconSize = computed(() => (this.size() === 'lg' ? 'sm' : 'xs'), ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
186
|
-
}
|
|
187
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
188
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: MenuItemComponent, isStandalone: true, selector: "a[kirby-x-menu-item],button[kirby-x-menu-item]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "\"item\" + id()", "class": "size()" } }, ngImport: i0, template: "<div class=\"menu-item-start {{ size() }}\">\n @if (icon(); as icon) {\n <kirby-icon [size]=\"iconSize()\" [name]=\"icon\"></kirby-icon>\n }\n</div>\n\n<div class=\"menu-item-content\">\n <ng-content></ng-content>\n</div>\n\n<div class=\"menu-item-end\">\n <ng-content select=\"[slot='end']\"></ng-content>\n</div>\n", styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;flex-direction:row;flex-grow:1;align-items:center;align-self:stretch;box-sizing:border-box;min-height:32px;border-radius:8px;padding:4px 12px;gap:8px;border:none;background:inherit;font:inherit;color:inherit;text-decoration:none;cursor:pointer}:host.lg{min-height:40px}:host:hover{background:var(--menuitem-hover-background-color, var(--kirby-inputs-background-color-hover))}:host:active{background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:var(--kirby-focus-ring-md-inset);outline:none}:host-context(.cdk-drag-preview){transform:scale(1.05);transition:transform .2s ease;border-radius:var(--kirby-border-radius-s)}:host-context(.cdk-drag-preview):before{content:\"\";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}:host-context(.cdk-drag-preview).selected:before{display:none}:host-context(.cdk-drag-preview):not(.selected){background:var(--sidebar-background-color, var(--kirby-tertiary))}.menu-item-start{display:flex;align-items:center;justify-content:center;flex-shrink:0}.menu-item-start.lg,.menu-item-start.md{width:24px;height:24px}.menu-item-start.sm,.menu-item-start.xs{width:16px;height:16px}.menu-item-start.sm{padding-left:32px}.menu-item-start.xs{padding-left:56px}.menu-item-content{display:flex;flex-grow:1;align-items:center;text-align:left;word-break:break-word;-webkit-hyphens:auto;hyphens:auto;hyphenate-limit-chars:10 4 4;font-size:clamp(13px,1rem,32px);line-height:1.3334}.menu-item-end{display:inline-flex;min-width:24px;align-items:center;justify-content:center;gap:8px}.menu-item-end:empty{display:none}\n"], dependencies: [{ kind: "ngmodule", type: IconModule }, { kind: "component", type: i1.IconComponent, selector: "kirby-icon", inputs: ["size", "name"] }] }); }
|
|
189
|
-
}
|
|
190
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MenuItemComponent, decorators: [{
|
|
191
|
-
type: Component,
|
|
192
|
-
args: [{ selector: 'a[kirby-x-menu-item],button[kirby-x-menu-item]', host: {
|
|
193
|
-
'[attr.id]': '"item" + id()',
|
|
194
|
-
'[class]': 'size()',
|
|
195
|
-
}, imports: [IconModule], template: "<div class=\"menu-item-start {{ size() }}\">\n @if (icon(); as icon) {\n <kirby-icon [size]=\"iconSize()\" [name]=\"icon\"></kirby-icon>\n }\n</div>\n\n<div class=\"menu-item-content\">\n <ng-content></ng-content>\n</div>\n\n<div class=\"menu-item-end\">\n <ng-content select=\"[slot='end']\"></ng-content>\n</div>\n", styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;flex-direction:row;flex-grow:1;align-items:center;align-self:stretch;box-sizing:border-box;min-height:32px;border-radius:8px;padding:4px 12px;gap:8px;border:none;background:inherit;font:inherit;color:inherit;text-decoration:none;cursor:pointer}:host.lg{min-height:40px}:host:hover{background:var(--menuitem-hover-background-color, var(--kirby-inputs-background-color-hover))}:host:active{background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:var(--kirby-focus-ring-md-inset);outline:none}:host-context(.cdk-drag-preview){transform:scale(1.05);transition:transform .2s ease;border-radius:var(--kirby-border-radius-s)}:host-context(.cdk-drag-preview):before{content:\"\";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}:host-context(.cdk-drag-preview).selected:before{display:none}:host-context(.cdk-drag-preview):not(.selected){background:var(--sidebar-background-color, var(--kirby-tertiary))}.menu-item-start{display:flex;align-items:center;justify-content:center;flex-shrink:0}.menu-item-start.lg,.menu-item-start.md{width:24px;height:24px}.menu-item-start.sm,.menu-item-start.xs{width:16px;height:16px}.menu-item-start.sm{padding-left:32px}.menu-item-start.xs{padding-left:56px}.menu-item-content{display:flex;flex-grow:1;align-items:center;text-align:left;word-break:break-word;-webkit-hyphens:auto;hyphens:auto;hyphenate-limit-chars:10 4 4;font-size:clamp(13px,1rem,32px);line-height:1.3334}.menu-item-end{display:inline-flex;min-width:24px;align-items:center;justify-content:center;gap:8px}.menu-item-end:empty{display:none}\n"] }]
|
|
196
|
-
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }] } });
|
|
197
|
-
|
|
198
|
-
class MenuStateService {
|
|
199
|
-
#menuItems = signal([], ...(ngDevMode ? [{ debugName: "#menuItems" }] : /* istanbul ignore next */ []));
|
|
200
|
-
#selectedItem = signal(undefined, ...(ngDevMode ? [{ debugName: "#selectedItem" }] : /* istanbul ignore next */ []));
|
|
201
|
-
#expandedItems = signal(new Set(), ...(ngDevMode ? [{ debugName: "#expandedItems" }] : /* istanbul ignore next */ []));
|
|
202
|
-
#checkedItems = signal(new Set(), ...(ngDevMode ? [{ debugName: "#checkedItems" }] : /* istanbul ignore next */ []));
|
|
203
|
-
#autoCollapse = signal(false, ...(ngDevMode ? [{ debugName: "#autoCollapse" }] : /* istanbul ignore next */ []));
|
|
204
|
-
#animationsDisabled = signal(false, ...(ngDevMode ? [{ debugName: "#animationsDisabled" }] : /* istanbul ignore next */ []));
|
|
205
|
-
#expandEvents = new Subject();
|
|
206
|
-
#checkEvents = new Subject();
|
|
207
|
-
#reorderEvents = new Subject();
|
|
208
|
-
#selectEvents = new Subject();
|
|
209
|
-
get menuItems() {
|
|
210
|
-
return this.#menuItems.asReadonly();
|
|
211
|
-
}
|
|
212
|
-
set menuItems(items) {
|
|
213
|
-
this.#menuItems.set(items);
|
|
214
|
-
}
|
|
215
|
-
get selectedItem() {
|
|
216
|
-
return this.#selectedItem.asReadonly();
|
|
217
|
-
}
|
|
218
|
-
set selectedItem(id) {
|
|
219
|
-
this.#selectedItem.set(id);
|
|
220
|
-
}
|
|
221
|
-
get expandedItems() {
|
|
222
|
-
return this.#expandedItems.asReadonly();
|
|
223
|
-
}
|
|
224
|
-
set expandedItems(ids) {
|
|
225
|
-
this.#expandedItems.set(ids);
|
|
226
|
-
}
|
|
227
|
-
get checkedItems() {
|
|
228
|
-
return this.#checkedItems.asReadonly();
|
|
229
|
-
}
|
|
230
|
-
set checkedItems(ids) {
|
|
231
|
-
this.#checkedItems.set(ids);
|
|
232
|
-
}
|
|
233
|
-
set autoCollapse(enabled) {
|
|
234
|
-
this.#autoCollapse.set(enabled);
|
|
235
|
-
}
|
|
236
|
-
get animationsDisabled() {
|
|
237
|
-
return this.#animationsDisabled.asReadonly();
|
|
238
|
-
}
|
|
239
|
-
set animationsDisabled(disabled) {
|
|
240
|
-
this.#animationsDisabled.set(disabled);
|
|
241
|
-
}
|
|
242
|
-
get expandEvents() {
|
|
243
|
-
return this.#expandEvents.asObservable();
|
|
244
|
-
}
|
|
245
|
-
get checkEvents() {
|
|
246
|
-
return this.#checkEvents.asObservable();
|
|
247
|
-
}
|
|
248
|
-
get reorderEvents() {
|
|
249
|
-
return this.#reorderEvents.asObservable();
|
|
250
|
-
}
|
|
251
|
-
get selectEvents() {
|
|
252
|
-
return this.#selectEvents.asObservable();
|
|
253
|
-
}
|
|
254
|
-
expandItem(id) {
|
|
255
|
-
this.#expandEvents.next({ id, isExpanded: true });
|
|
256
|
-
if (this.#autoCollapse()) {
|
|
257
|
-
this.#expandedItems.set(this.#findAncestors(id));
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
this.#expandedItems.update((items) => {
|
|
261
|
-
items.add(id);
|
|
262
|
-
return new Set(items);
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
collapseItem(id) {
|
|
266
|
-
this.#expandEvents.next({ id, isExpanded: false });
|
|
267
|
-
this.#expandedItems.update((items) => {
|
|
268
|
-
items.delete(id);
|
|
269
|
-
return new Set(items);
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
checkItem(id) {
|
|
273
|
-
this.#checkEvents.next({ id, isChecked: true });
|
|
274
|
-
this.#checkedItems.update((items) => {
|
|
275
|
-
items.add(id);
|
|
276
|
-
return new Set(items);
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
uncheckItem(id) {
|
|
280
|
-
this.#checkEvents.next({ id, isChecked: false });
|
|
281
|
-
this.#checkedItems.update((items) => {
|
|
282
|
-
items.delete(id);
|
|
283
|
-
return new Set(items);
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
selectItem(id) {
|
|
287
|
-
this.#selectEvents.next(id);
|
|
288
|
-
this.#selectedItem.set(id);
|
|
289
|
-
}
|
|
290
|
-
#findAncestors(id) {
|
|
291
|
-
return recursivelyFindAncestors(this.#menuItems(), id) ?? new Set();
|
|
292
|
-
}
|
|
293
|
-
reorderItems(submenu, itemId, previousIndex, currentIndex) {
|
|
294
|
-
moveItemInArray(submenu.children, previousIndex, currentIndex);
|
|
295
|
-
this.#reorderEvents.next({
|
|
296
|
-
parentId: submenu.id,
|
|
297
|
-
itemId,
|
|
298
|
-
previousIndex,
|
|
299
|
-
currentIndex,
|
|
300
|
-
reorderedItemIds: submenu.children.map((item) => item.id),
|
|
301
|
-
});
|
|
302
|
-
this.#menuItems.update((items) => [...items]);
|
|
303
|
-
}
|
|
304
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MenuStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
305
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MenuStateService, providedIn: 'root' }); }
|
|
340
|
+
`,
|
|
341
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
342
|
+
styles: [":host,header{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}:host::ng-deep [slot=logo]{display:inline-flex}:host::ng-deep [slot=logo] img,:host::ng-deep img[slot=logo]{object-fit:contain;max-width:100%;max-height:100%}.sidebar-logo{display:flex;align-items:center;height:50px;margin:var(--kirby-spacing-l) var(--kirby-spacing-m)}.action-bar{display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;width:100%}.action-bar:has([slot=action]){padding:0 var(--kirby-spacing-xs) var(--kirby-spacing-xs)}\n"]
|
|
343
|
+
}]
|
|
344
|
+
}]
|
|
345
|
+
});
|
|
346
|
+
function scrollIntoViewIfNecessary(scrollContainer, child, position = "center") {
|
|
347
|
+
const containerRect = scrollContainer.getBoundingClientRect();
|
|
348
|
+
const elementRect = child.getBoundingClientRect();
|
|
349
|
+
if (containerRect.top > elementRect.top || containerRect.bottom < elementRect.bottom) child.scrollIntoView({
|
|
350
|
+
behavior: "instant",
|
|
351
|
+
block: position,
|
|
352
|
+
inline: position
|
|
353
|
+
});
|
|
306
354
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
355
|
+
var MenuItemComponent = class MenuItemComponent {
|
|
356
|
+
constructor() {
|
|
357
|
+
this.id = input.required(...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
358
|
+
this.size = input.required(...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
359
|
+
this.icon = input(...ngDevMode ? [void 0, { debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
360
|
+
this.iconSize = computed(() => this.size() === "lg" ? "sm" : "xs", ...ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []);
|
|
361
|
+
}
|
|
362
|
+
static {
|
|
363
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
364
|
+
minVersion: "12.0.0",
|
|
365
|
+
version: "22.2.2",
|
|
366
|
+
ngImport: i0,
|
|
367
|
+
type: MenuItemComponent,
|
|
368
|
+
deps: [],
|
|
369
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
static {
|
|
373
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
374
|
+
minVersion: "17.0.0",
|
|
375
|
+
version: "22.2.2",
|
|
376
|
+
type: MenuItemComponent,
|
|
377
|
+
isStandalone: true,
|
|
378
|
+
selector: "a[kirby-x-menu-item],button[kirby-x-menu-item]",
|
|
379
|
+
inputs: {
|
|
380
|
+
id: {
|
|
381
|
+
classPropertyName: "id",
|
|
382
|
+
publicName: "id",
|
|
383
|
+
isSignal: true,
|
|
384
|
+
isRequired: true,
|
|
385
|
+
transformFunction: null
|
|
386
|
+
},
|
|
387
|
+
size: {
|
|
388
|
+
classPropertyName: "size",
|
|
389
|
+
publicName: "size",
|
|
390
|
+
isSignal: true,
|
|
391
|
+
isRequired: true,
|
|
392
|
+
transformFunction: null
|
|
393
|
+
},
|
|
394
|
+
icon: {
|
|
395
|
+
classPropertyName: "icon",
|
|
396
|
+
publicName: "icon",
|
|
397
|
+
isSignal: true,
|
|
398
|
+
isRequired: false,
|
|
399
|
+
transformFunction: null
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
host: { properties: {
|
|
403
|
+
"attr.id": "\"item\" + id()",
|
|
404
|
+
"class": "size()"
|
|
405
|
+
} },
|
|
406
|
+
ngImport: i0,
|
|
407
|
+
template: "<div class=\"menu-item-start {{ size() }}\">\n @if (icon(); as icon) {\n <kirby-icon [size]=\"iconSize()\" [name]=\"icon\"></kirby-icon>\n }\n</div>\n\n<div class=\"menu-item-content\">\n <ng-content></ng-content>\n</div>\n\n<div class=\"menu-item-end\">\n <ng-content select=\"[slot='end']\"></ng-content>\n</div>\n",
|
|
408
|
+
styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;flex-direction:row;flex-grow:1;align-items:center;align-self:stretch;box-sizing:border-box;min-height:var(--kirby-spacing-l);border-radius:var(--kirby-border-radius-s);padding:var(--kirby-spacing-xxxs) var(--kirby-spacing-xs);gap:var(--kirby-spacing-xxs);border:none;background:inherit;font:inherit;color:inherit;text-decoration:none;cursor:pointer}:host.lg{min-height:var(--kirby-spacing-xl)}:host:hover{background:var(--menuitem-hover-background-color, var(--kirby-inputs-background-color-hover))}:host:active{background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:var(--kirby-focus-ring-md-inset);outline:none}:host-context(.cdk-drag-preview){transform:scale(1.05);transition:transform .2s ease;border-radius:var(--kirby-border-radius-s)}:host-context(.cdk-drag-preview):before{content:\"\";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}:host-context(.cdk-drag-preview).selected:before{display:none}:host-context(.cdk-drag-preview):not(.selected){background:var(--sidebar-background-color, var(--kirby-tertiary))}.menu-item-start{display:flex;align-items:center;justify-content:center;flex-shrink:0}.menu-item-start.lg,.menu-item-start.md{width:var(--kirby-icon-font-size-sm);height:var(--kirby-icon-font-size-sm)}.menu-item-start.sm,.menu-item-start.xs{width:var(--kirby-icon-font-size-xs);height:var(--kirby-icon-font-size-xs)}.menu-item-start.sm{padding-left:var(--kirby-spacing-l)}.menu-item-start.xs{padding-left:var(--kirby-spacing-xxxl)}.menu-item-content{display:flex;flex-grow:1;align-items:center;text-align:left;word-break:break-word;-webkit-hyphens:auto;hyphens:auto;hyphenate-limit-chars:10 4 4;font-size:var(--kirby-font-size-n);line-height:var(--kirby-line-height-m)}.menu-item-end{display:inline-flex;min-width:var(--kirby-icon-font-size-sm);align-items:center;justify-content:center;gap:var(--kirby-spacing-xxs)}.menu-item-end:empty{display:none}\n"],
|
|
409
|
+
dependencies: [{
|
|
410
|
+
kind: "ngmodule",
|
|
411
|
+
type: IconModule
|
|
412
|
+
}, {
|
|
413
|
+
kind: "component",
|
|
414
|
+
type: i1.IconComponent,
|
|
415
|
+
selector: "kirby-icon",
|
|
416
|
+
inputs: ["size", "name"]
|
|
417
|
+
}],
|
|
418
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
423
|
+
minVersion: "12.0.0",
|
|
424
|
+
version: "22.2.2",
|
|
425
|
+
ngImport: i0,
|
|
426
|
+
type: MenuItemComponent,
|
|
427
|
+
decorators: [{
|
|
428
|
+
type: Component,
|
|
429
|
+
args: [{
|
|
430
|
+
selector: "a[kirby-x-menu-item],button[kirby-x-menu-item]",
|
|
431
|
+
host: {
|
|
432
|
+
"[attr.id]": "\"item\" + id()",
|
|
433
|
+
"[class]": "size()"
|
|
434
|
+
},
|
|
435
|
+
imports: [IconModule],
|
|
436
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
437
|
+
template: "<div class=\"menu-item-start {{ size() }}\">\n @if (icon(); as icon) {\n <kirby-icon [size]=\"iconSize()\" [name]=\"icon\"></kirby-icon>\n }\n</div>\n\n<div class=\"menu-item-content\">\n <ng-content></ng-content>\n</div>\n\n<div class=\"menu-item-end\">\n <ng-content select=\"[slot='end']\"></ng-content>\n</div>\n",
|
|
438
|
+
styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;flex-direction:row;flex-grow:1;align-items:center;align-self:stretch;box-sizing:border-box;min-height:var(--kirby-spacing-l);border-radius:var(--kirby-border-radius-s);padding:var(--kirby-spacing-xxxs) var(--kirby-spacing-xs);gap:var(--kirby-spacing-xxs);border:none;background:inherit;font:inherit;color:inherit;text-decoration:none;cursor:pointer}:host.lg{min-height:var(--kirby-spacing-xl)}:host:hover{background:var(--menuitem-hover-background-color, var(--kirby-inputs-background-color-hover))}:host:active{background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:var(--kirby-focus-ring-md-inset);outline:none}:host-context(.cdk-drag-preview){transform:scale(1.05);transition:transform .2s ease;border-radius:var(--kirby-border-radius-s)}:host-context(.cdk-drag-preview):before{content:\"\";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}:host-context(.cdk-drag-preview).selected:before{display:none}:host-context(.cdk-drag-preview):not(.selected){background:var(--sidebar-background-color, var(--kirby-tertiary))}.menu-item-start{display:flex;align-items:center;justify-content:center;flex-shrink:0}.menu-item-start.lg,.menu-item-start.md{width:var(--kirby-icon-font-size-sm);height:var(--kirby-icon-font-size-sm)}.menu-item-start.sm,.menu-item-start.xs{width:var(--kirby-icon-font-size-xs);height:var(--kirby-icon-font-size-xs)}.menu-item-start.sm{padding-left:var(--kirby-spacing-l)}.menu-item-start.xs{padding-left:var(--kirby-spacing-xxxl)}.menu-item-content{display:flex;flex-grow:1;align-items:center;text-align:left;word-break:break-word;-webkit-hyphens:auto;hyphens:auto;hyphenate-limit-chars:10 4 4;font-size:var(--kirby-font-size-n);line-height:var(--kirby-line-height-m)}.menu-item-end{display:inline-flex;min-width:var(--kirby-icon-font-size-sm);align-items:center;justify-content:center;gap:var(--kirby-spacing-xxs)}.menu-item-end:empty{display:none}\n"]
|
|
439
|
+
}]
|
|
440
|
+
}],
|
|
441
|
+
propDecorators: {
|
|
442
|
+
id: [{
|
|
443
|
+
type: i0.Input,
|
|
444
|
+
args: [{
|
|
445
|
+
isSignal: true,
|
|
446
|
+
alias: "id",
|
|
447
|
+
required: true
|
|
448
|
+
}]
|
|
449
|
+
}],
|
|
450
|
+
size: [{
|
|
451
|
+
type: i0.Input,
|
|
452
|
+
args: [{
|
|
453
|
+
isSignal: true,
|
|
454
|
+
alias: "size",
|
|
455
|
+
required: true
|
|
456
|
+
}]
|
|
457
|
+
}],
|
|
458
|
+
icon: [{
|
|
459
|
+
type: i0.Input,
|
|
460
|
+
args: [{
|
|
461
|
+
isSignal: true,
|
|
462
|
+
alias: "icon",
|
|
463
|
+
required: false
|
|
464
|
+
}]
|
|
465
|
+
}]
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
var MenuStateService = class MenuStateService {
|
|
469
|
+
#menuItems = signal([], ...ngDevMode ? [{ debugName: "#menuItems" }] : /* istanbul ignore next */ []);
|
|
470
|
+
#selectedItem = signal(void 0, ...ngDevMode ? [{ debugName: "#selectedItem" }] : /* istanbul ignore next */ []);
|
|
471
|
+
#expandedItems = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "#expandedItems" }] : /* istanbul ignore next */ []);
|
|
472
|
+
#checkedItems = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "#checkedItems" }] : /* istanbul ignore next */ []);
|
|
473
|
+
#autoCollapse = signal(false, ...ngDevMode ? [{ debugName: "#autoCollapse" }] : /* istanbul ignore next */ []);
|
|
474
|
+
#animationsDisabled = signal(false, ...ngDevMode ? [{ debugName: "#animationsDisabled" }] : /* istanbul ignore next */ []);
|
|
475
|
+
#expandEvents = new Subject();
|
|
476
|
+
#checkEvents = new Subject();
|
|
477
|
+
#reorderEvents = new Subject();
|
|
478
|
+
#selectEvents = new Subject();
|
|
479
|
+
get menuItems() {
|
|
480
|
+
return this.#menuItems.asReadonly();
|
|
481
|
+
}
|
|
482
|
+
set menuItems(items) {
|
|
483
|
+
this.#menuItems.set(items);
|
|
484
|
+
}
|
|
485
|
+
get selectedItem() {
|
|
486
|
+
return this.#selectedItem.asReadonly();
|
|
487
|
+
}
|
|
488
|
+
set selectedItem(id) {
|
|
489
|
+
this.#selectedItem.set(id);
|
|
490
|
+
}
|
|
491
|
+
get expandedItems() {
|
|
492
|
+
return this.#expandedItems.asReadonly();
|
|
493
|
+
}
|
|
494
|
+
set expandedItems(ids) {
|
|
495
|
+
this.#expandedItems.set(ids);
|
|
496
|
+
}
|
|
497
|
+
get checkedItems() {
|
|
498
|
+
return this.#checkedItems.asReadonly();
|
|
499
|
+
}
|
|
500
|
+
set checkedItems(ids) {
|
|
501
|
+
this.#checkedItems.set(ids);
|
|
502
|
+
}
|
|
503
|
+
set autoCollapse(enabled) {
|
|
504
|
+
this.#autoCollapse.set(enabled);
|
|
505
|
+
}
|
|
506
|
+
get animationsDisabled() {
|
|
507
|
+
return this.#animationsDisabled.asReadonly();
|
|
508
|
+
}
|
|
509
|
+
set animationsDisabled(disabled) {
|
|
510
|
+
this.#animationsDisabled.set(disabled);
|
|
511
|
+
}
|
|
512
|
+
get expandEvents() {
|
|
513
|
+
return this.#expandEvents.asObservable();
|
|
514
|
+
}
|
|
515
|
+
get checkEvents() {
|
|
516
|
+
return this.#checkEvents.asObservable();
|
|
517
|
+
}
|
|
518
|
+
get reorderEvents() {
|
|
519
|
+
return this.#reorderEvents.asObservable();
|
|
520
|
+
}
|
|
521
|
+
get selectEvents() {
|
|
522
|
+
return this.#selectEvents.asObservable();
|
|
523
|
+
}
|
|
524
|
+
expandItem(id) {
|
|
525
|
+
this.#expandEvents.next({
|
|
526
|
+
id,
|
|
527
|
+
isExpanded: true
|
|
528
|
+
});
|
|
529
|
+
if (this.#autoCollapse()) {
|
|
530
|
+
this.#expandedItems.set(this.#findAncestors(id));
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
this.#expandedItems.update((items) => {
|
|
534
|
+
items.add(id);
|
|
535
|
+
return new Set(items);
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
collapseItem(id) {
|
|
539
|
+
this.#expandEvents.next({
|
|
540
|
+
id,
|
|
541
|
+
isExpanded: false
|
|
542
|
+
});
|
|
543
|
+
this.#expandedItems.update((items) => {
|
|
544
|
+
items.delete(id);
|
|
545
|
+
return new Set(items);
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
checkItem(id) {
|
|
549
|
+
this.#checkEvents.next({
|
|
550
|
+
id,
|
|
551
|
+
isChecked: true
|
|
552
|
+
});
|
|
553
|
+
this.#checkedItems.update((items) => {
|
|
554
|
+
items.add(id);
|
|
555
|
+
return new Set(items);
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
uncheckItem(id) {
|
|
559
|
+
this.#checkEvents.next({
|
|
560
|
+
id,
|
|
561
|
+
isChecked: false
|
|
562
|
+
});
|
|
563
|
+
this.#checkedItems.update((items) => {
|
|
564
|
+
items.delete(id);
|
|
565
|
+
return new Set(items);
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
selectItem(id) {
|
|
569
|
+
this.#selectEvents.next(id);
|
|
570
|
+
this.#selectedItem.set(id);
|
|
571
|
+
}
|
|
572
|
+
#findAncestors(id) {
|
|
573
|
+
return recursivelyFindAncestors(this.#menuItems(), id) ?? /* @__PURE__ */ new Set();
|
|
574
|
+
}
|
|
575
|
+
reorderItems(submenu, itemId, previousIndex, currentIndex) {
|
|
576
|
+
moveItemInArray(submenu.children, previousIndex, currentIndex);
|
|
577
|
+
this.#reorderEvents.next({
|
|
578
|
+
parentId: submenu.id,
|
|
579
|
+
itemId,
|
|
580
|
+
previousIndex,
|
|
581
|
+
currentIndex,
|
|
582
|
+
reorderedItemIds: submenu.children.map((item) => item.id)
|
|
583
|
+
});
|
|
584
|
+
this.#menuItems.update((items) => [...items]);
|
|
585
|
+
}
|
|
586
|
+
static {
|
|
587
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
588
|
+
minVersion: "12.0.0",
|
|
589
|
+
version: "22.2.2",
|
|
590
|
+
ngImport: i0,
|
|
591
|
+
type: MenuStateService,
|
|
592
|
+
deps: [],
|
|
593
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
static {
|
|
597
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
598
|
+
minVersion: "12.0.0",
|
|
599
|
+
version: "22.2.2",
|
|
600
|
+
ngImport: i0,
|
|
601
|
+
type: MenuStateService,
|
|
602
|
+
providedIn: "root"
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
607
|
+
minVersion: "12.0.0",
|
|
608
|
+
version: "22.2.2",
|
|
609
|
+
ngImport: i0,
|
|
610
|
+
type: MenuStateService,
|
|
611
|
+
decorators: [{
|
|
612
|
+
type: Injectable,
|
|
613
|
+
args: [{ providedIn: "root" }]
|
|
614
|
+
}]
|
|
615
|
+
});
|
|
311
616
|
function recursivelyFindAncestors(items, id) {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
return undefined;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
class MenuAnchorItemComponent {
|
|
328
|
-
constructor() {
|
|
329
|
-
this.item = input.required(...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
330
|
-
this.size = input.required(...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
331
|
-
this.#stateService = inject(MenuStateService);
|
|
332
|
-
this.#isSelected = computed(() => this.item().id === this.#stateService.selectedItem(), ...(ngDevMode ? [{ debugName: "#isSelected" }] : /* istanbul ignore next */ []));
|
|
333
|
-
this.#isChecked = computed(() => {
|
|
334
|
-
const id = this.item().id;
|
|
335
|
-
const checkedItems = this.#stateService.checkedItems();
|
|
336
|
-
return checkedItems.has(id);
|
|
337
|
-
}, ...(ngDevMode ? [{ debugName: "#isChecked" }] : /* istanbul ignore next */ []));
|
|
338
|
-
this.vm = {
|
|
339
|
-
item: this.item,
|
|
340
|
-
size: this.size,
|
|
341
|
-
isSelected: this.#isSelected,
|
|
342
|
-
isChecked: this.#isChecked,
|
|
343
|
-
selectItem: this.#selectItem.bind(this),
|
|
344
|
-
checkItem: this.#checkItem.bind(this),
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
#stateService;
|
|
348
|
-
#isSelected;
|
|
349
|
-
#isChecked;
|
|
350
|
-
#selectItem() {
|
|
351
|
-
this.#stateService.selectItem(this.item().id);
|
|
352
|
-
}
|
|
353
|
-
#checkItem(checked) {
|
|
354
|
-
if (checked) {
|
|
355
|
-
this.#stateService.checkItem(this.item().id);
|
|
356
|
-
}
|
|
357
|
-
else {
|
|
358
|
-
this.#stateService.uncheckItem(this.item().id);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MenuAnchorItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
362
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: MenuAnchorItemComponent, isStandalone: true, selector: "li[kirby-x-menu-anchor-item]", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.selected": "vm.isSelected()", "class.has-toggle": "!!vm.item().toggle", "class.has-badge": "!!vm.item().badge" } }, ngImport: i0, template: "@let item = vm.item();\n@switch (item.type) {\n @case ('action') {\n <a\n kirby-x-menu-item\n [class.selected]=\"vm.isSelected()\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.href]=\"item.href\"\n (click)=\"$event.preventDefault(); vm.selectItem()\"\n (keydown.enter)=\"$event.preventDefault(); vm.selectItem()\"\n >\n {{ item.title }}\n @if (item.badge) {\n <kirby-badge\n slot=\"end\"\n class=\"item-badge\"\n [themeColor]=\"item.badge.themeColor ?? 'primary'\"\n >\n {{ item.badge.value }}\n </kirby-badge>\n }\n @if (item.isLink) {\n <kirby-icon name=\"link\" slot=\"end\" class=\"external-link\"></kirby-icon>\n }\n @if (item.toggle) {\n <div slot=\"end\" class=\"toggle-spacer\"></div>\n }\n </a>\n }\n @case ('router-link') {\n <a\n kirby-x-menu-item\n [class.selected]=\"vm.isSelected()\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [routerLink]=\"item.route\"\n [queryParams]=\"item.queryParams\"\n [skipLocationChange]=\"item.skipLocationChange\"\n [replaceUrl]=\"item.replaceUrl\"\n (click)=\"vm.selectItem()\"\n (keydown.enter)=\"vm.selectItem()\"\n >\n {{ item.title }}\n @if (item.badge) {\n <kirby-badge\n slot=\"end\"\n class=\"item-badge\"\n [themeColor]=\"item.badge.themeColor ?? 'primary'\"\n >\n {{ item.badge.value }}\n </kirby-badge>\n }\n @if (item.toggle) {\n <div slot=\"end\" class=\"toggle-spacer\"></div>\n }\n </a>\n }\n @case ('external-link') {\n <a\n kirby-x-menu-item\n [class.selected]=\"vm.isSelected()\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.href]=\"item.url\"\n [attr.target]=\"item.target\"\n (click)=\"vm.selectItem()\"\n (keydown.enter)=\"vm.selectItem()\"\n >\n {{ item.title }}\n @if (item.badge) {\n <kirby-badge\n slot=\"end\"\n class=\"item-badge\"\n [themeColor]=\"item.badge.themeColor ?? 'primary'\"\n >\n {{ item.badge.value }}\n </kirby-badge>\n }\n <kirby-icon name=\"link\" slot=\"end\" class=\"external-link\"></kirby-icon>\n @if (item.toggle) {\n <div slot=\"end\" class=\"toggle-spacer\"></div>\n }\n </a>\n }\n}\n\n@if (item.toggle) {\n <kirby-toggle-button\n class=\"toggle-button-wrapper\"\n [checked]=\"vm.isChecked()\"\n (checkChanged)=\"vm.checkItem($event)\"\n >\n <button\n kirby-button\n unchecked\n size=\"xs\"\n attentionLevel=\"3\"\n tabindex=\"-1\"\n [noDecoration]=\"true\"\n class=\"toggle-button\"\n >\n <kirby-icon size=\"xs\" [name]=\"item.toggle.uncheckedIcon\"></kirby-icon>\n </button>\n <button\n kirby-button\n checked\n size=\"xs\"\n attentionLevel=\"3\"\n tabindex=\"-1\"\n [noDecoration]=\"true\"\n class=\"toggle-button\"\n >\n <kirby-icon size=\"xs\" [name]=\"item.toggle.checkedIcon\"></kirby-icon>\n </button>\n </kirby-toggle-button>\n}\n", styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;flex-direction:row;align-items:center;position:relative;overflow:visible}:host.selected{color:var(--menuitem-selected-color, var(--kirby-primary-contrast))}:host:not(.selected):hover a{background:var(--menuitem-hover-background-color, var(--kirby-inputs-background-color-hover))}:host:not(.selected):active a{background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}.selected,.selected:hover,.selected:active,.selected:focus-visible{background:var(--menuitem-selected-background-color, var(--kirby-primary));font-weight:700}.item-badge{display:inline-flex}.toggle-spacer{width:24px;display:none}:host.has-toggle:hover .item-badge,:host.has-toggle:active .item-badge,:host.has-toggle:has(a:focus-visible) .item-badge,:host.has-toggle:has(.toggle-button:focus-visible) .item-badge{display:none}:host.has-toggle:hover .toggle-spacer,:host.has-toggle:active .toggle-spacer,:host.has-toggle:has(a:focus-visible) .toggle-spacer,:host.has-toggle:has(.toggle-button:focus-visible) .toggle-spacer{display:initial}:host.has-toggle:hover .external-link,:host.has-toggle:active .external-link,:host.has-toggle:has(a:focus-visible) .external-link,:host.has-toggle:has(.toggle-button:focus-visible) .external-link{display:none}.toggle-button-wrapper{display:inline-flex;position:absolute;right:12px}.toggle-button{margin:0;transition:opacity 0ms;--kirby-button-color: inherit}.toggle-button:not(:focus-visible){opacity:0}:host:hover .toggle-button,:host:active .toggle-button,:host:has(a:focus-visible) .toggle-button{opacity:1}\n"], dependencies: [{ kind: "component", type: MenuItemComponent, selector: "a[kirby-x-menu-item],button[kirby-x-menu-item]", inputs: ["id", "size", "icon"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ToggleButtonComponent, selector: "kirby-toggle-button", inputs: ["checked"], outputs: ["checkChanged"] }, { kind: "component", type: ButtonComponent, selector: "button[kirby-button],Button[kirby-button],a[kirby-button]", inputs: ["attentionLevel", "noDecoration", "themeColor", "expand", "isFloating", "size", "showIconOnly"] }, { kind: "component", type: IconComponent, selector: "kirby-icon", inputs: ["size", "name"] }, { kind: "component", type: BadgeComponent, selector: "kirby-badge", inputs: ["text", "size"] }] }); }
|
|
617
|
+
for (const item of items) {
|
|
618
|
+
if (item.id === id) return /* @__PURE__ */ new Set([item.id]);
|
|
619
|
+
if (item.type === "submenu") {
|
|
620
|
+
const foundAncestors = recursivelyFindAncestors(item.children, id);
|
|
621
|
+
if (foundAncestors) {
|
|
622
|
+
foundAncestors.add(item.id);
|
|
623
|
+
return foundAncestors;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
363
627
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
628
|
+
var MenuAnchorItemComponent = class MenuAnchorItemComponent {
|
|
629
|
+
constructor() {
|
|
630
|
+
this.item = input.required(...ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []);
|
|
631
|
+
this.size = input.required(...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
632
|
+
this.#stateService = inject(MenuStateService);
|
|
633
|
+
this.#isSelected = computed(() => this.item().id === this.#stateService.selectedItem(), ...ngDevMode ? [{ debugName: "#isSelected" }] : /* istanbul ignore next */ []);
|
|
634
|
+
this.#isChecked = computed(() => {
|
|
635
|
+
const id = this.item().id;
|
|
636
|
+
return this.#stateService.checkedItems().has(id);
|
|
637
|
+
}, ...ngDevMode ? [{ debugName: "#isChecked" }] : /* istanbul ignore next */ []);
|
|
638
|
+
this.vm = {
|
|
639
|
+
item: this.item,
|
|
640
|
+
size: this.size,
|
|
641
|
+
isSelected: this.#isSelected,
|
|
642
|
+
isChecked: this.#isChecked,
|
|
643
|
+
selectItem: this.#selectItem.bind(this),
|
|
644
|
+
checkItem: this.#checkItem.bind(this)
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
#stateService;
|
|
648
|
+
#isSelected;
|
|
649
|
+
#isChecked;
|
|
650
|
+
#selectItem() {
|
|
651
|
+
this.#stateService.selectItem(this.item().id);
|
|
652
|
+
}
|
|
653
|
+
#checkItem(checked) {
|
|
654
|
+
if (checked) this.#stateService.checkItem(this.item().id);
|
|
655
|
+
else this.#stateService.uncheckItem(this.item().id);
|
|
656
|
+
}
|
|
657
|
+
static {
|
|
658
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
659
|
+
minVersion: "12.0.0",
|
|
660
|
+
version: "22.2.2",
|
|
661
|
+
ngImport: i0,
|
|
662
|
+
type: MenuAnchorItemComponent,
|
|
663
|
+
deps: [],
|
|
664
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
static {
|
|
668
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
669
|
+
minVersion: "17.0.0",
|
|
670
|
+
version: "22.2.2",
|
|
671
|
+
type: MenuAnchorItemComponent,
|
|
672
|
+
isStandalone: true,
|
|
673
|
+
selector: "li[kirby-x-menu-anchor-item]",
|
|
674
|
+
inputs: {
|
|
675
|
+
item: {
|
|
676
|
+
classPropertyName: "item",
|
|
677
|
+
publicName: "item",
|
|
678
|
+
isSignal: true,
|
|
679
|
+
isRequired: true,
|
|
680
|
+
transformFunction: null
|
|
681
|
+
},
|
|
682
|
+
size: {
|
|
683
|
+
classPropertyName: "size",
|
|
684
|
+
publicName: "size",
|
|
685
|
+
isSignal: true,
|
|
686
|
+
isRequired: true,
|
|
687
|
+
transformFunction: null
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
host: { properties: {
|
|
691
|
+
"class.selected": "vm.isSelected()",
|
|
692
|
+
"class.has-toggle": "!!vm.item().toggle",
|
|
693
|
+
"class.has-badge": "!!vm.item().badge"
|
|
694
|
+
} },
|
|
695
|
+
ngImport: i0,
|
|
696
|
+
template: "@let item = vm.item();\n@switch (item.type) {\n @case ('action') {\n <a\n kirby-x-menu-item\n [class.selected]=\"vm.isSelected()\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.href]=\"item.href\"\n (click)=\"$event.preventDefault(); vm.selectItem()\"\n (keydown.enter)=\"$event.preventDefault(); vm.selectItem()\"\n >\n {{ item.title }}\n @if (item.badge) {\n <kirby-badge\n slot=\"end\"\n class=\"item-badge\"\n [themeColor]=\"item.badge.themeColor ?? 'primary'\"\n >\n {{ item.badge.value }}\n </kirby-badge>\n }\n @if (item.isLink) {\n <kirby-icon name=\"link\" slot=\"end\" class=\"external-link\"></kirby-icon>\n }\n @if (item.toggle) {\n <div slot=\"end\" class=\"toggle-spacer\"></div>\n }\n </a>\n }\n @case ('router-link') {\n <a\n kirby-x-menu-item\n [class.selected]=\"vm.isSelected()\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [routerLink]=\"item.route\"\n [queryParams]=\"item.queryParams\"\n [skipLocationChange]=\"item.skipLocationChange\"\n [replaceUrl]=\"item.replaceUrl\"\n (click)=\"vm.selectItem()\"\n (keydown.enter)=\"vm.selectItem()\"\n >\n {{ item.title }}\n @if (item.badge) {\n <kirby-badge\n slot=\"end\"\n class=\"item-badge\"\n [themeColor]=\"item.badge.themeColor ?? 'primary'\"\n >\n {{ item.badge.value }}\n </kirby-badge>\n }\n @if (item.toggle) {\n <div slot=\"end\" class=\"toggle-spacer\"></div>\n }\n </a>\n }\n @case ('external-link') {\n <a\n kirby-x-menu-item\n [class.selected]=\"vm.isSelected()\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.href]=\"item.url\"\n [attr.target]=\"item.target\"\n (click)=\"vm.selectItem()\"\n (keydown.enter)=\"vm.selectItem()\"\n >\n {{ item.title }}\n @if (item.badge) {\n <kirby-badge\n slot=\"end\"\n class=\"item-badge\"\n [themeColor]=\"item.badge.themeColor ?? 'primary'\"\n >\n {{ item.badge.value }}\n </kirby-badge>\n }\n <kirby-icon name=\"link\" slot=\"end\" class=\"external-link\"></kirby-icon>\n @if (item.toggle) {\n <div slot=\"end\" class=\"toggle-spacer\"></div>\n }\n </a>\n }\n}\n\n@if (item.toggle) {\n <kirby-toggle-button\n class=\"toggle-button-wrapper\"\n [checked]=\"vm.isChecked()\"\n (checkChanged)=\"vm.checkItem($event)\"\n >\n <button\n kirby-button\n unchecked\n size=\"xs\"\n attentionLevel=\"3\"\n tabindex=\"-1\"\n [noDecoration]=\"true\"\n class=\"toggle-button\"\n >\n <kirby-icon size=\"xs\" [name]=\"item.toggle.uncheckedIcon\"></kirby-icon>\n </button>\n <button\n kirby-button\n checked\n size=\"xs\"\n attentionLevel=\"3\"\n tabindex=\"-1\"\n [noDecoration]=\"true\"\n class=\"toggle-button\"\n >\n <kirby-icon size=\"xs\" [name]=\"item.toggle.checkedIcon\"></kirby-icon>\n </button>\n </kirby-toggle-button>\n}\n",
|
|
697
|
+
styles: [":host{display:flex;flex-direction:row;align-items:center;position:relative;overflow:visible}:host.selected{color:var(--menuitem-selected-color, var(--kirby-primary-contrast))}:host:not(.selected):hover a{background:var(--menuitem-hover-background-color, var(--kirby-inputs-background-color-hover))}:host:not(.selected):active a{background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}.selected,.selected:hover,.selected:active,.selected:focus-visible{background:var(--menuitem-selected-background-color, var(--kirby-primary));font-weight:var(--kirby-font-weight-bold)}.item-badge{display:inline-flex}.toggle-spacer{width:var(--kirby-icon-font-size-sm);display:none}:host.has-toggle:hover .item-badge,:host.has-toggle:active .item-badge,:host.has-toggle:has(a:focus-visible) .item-badge,:host.has-toggle:has(.toggle-button:focus-visible) .item-badge{display:none}:host.has-toggle:hover .toggle-spacer,:host.has-toggle:active .toggle-spacer,:host.has-toggle:has(a:focus-visible) .toggle-spacer,:host.has-toggle:has(.toggle-button:focus-visible) .toggle-spacer{display:initial}:host.has-toggle:hover .external-link,:host.has-toggle:active .external-link,:host.has-toggle:has(a:focus-visible) .external-link,:host.has-toggle:has(.toggle-button:focus-visible) .external-link{display:none}.toggle-button-wrapper{display:inline-flex;position:absolute;right:var(--kirby-spacing-xs)}.toggle-button{margin:0;transition:opacity 0ms;--kirby-button-color: inherit}.toggle-button:not(:focus-visible){opacity:0}:host:hover .toggle-button,:host:active .toggle-button,:host:has(a:focus-visible) .toggle-button{opacity:1}\n"],
|
|
698
|
+
dependencies: [
|
|
699
|
+
{
|
|
700
|
+
kind: "component",
|
|
701
|
+
type: MenuItemComponent,
|
|
702
|
+
selector: "a[kirby-x-menu-item],button[kirby-x-menu-item]",
|
|
703
|
+
inputs: [
|
|
704
|
+
"id",
|
|
705
|
+
"size",
|
|
706
|
+
"icon"
|
|
707
|
+
]
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
kind: "directive",
|
|
711
|
+
type: RouterLink,
|
|
712
|
+
selector: "[routerLink]",
|
|
713
|
+
inputs: [
|
|
714
|
+
"target",
|
|
715
|
+
"queryParams",
|
|
716
|
+
"fragment",
|
|
717
|
+
"queryParamsHandling",
|
|
718
|
+
"state",
|
|
719
|
+
"info",
|
|
720
|
+
"relativeTo",
|
|
721
|
+
"preserveFragment",
|
|
722
|
+
"skipLocationChange",
|
|
723
|
+
"replaceUrl",
|
|
724
|
+
"browserUrl",
|
|
725
|
+
"routerLink"
|
|
726
|
+
]
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
kind: "component",
|
|
730
|
+
type: ToggleButtonComponent,
|
|
731
|
+
selector: "kirby-toggle-button",
|
|
732
|
+
inputs: ["checked"],
|
|
733
|
+
outputs: ["checkChanged"]
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
kind: "component",
|
|
737
|
+
type: ButtonComponent,
|
|
738
|
+
selector: "button[kirby-button],Button[kirby-button],a[kirby-button]",
|
|
739
|
+
inputs: [
|
|
740
|
+
"attentionLevel",
|
|
741
|
+
"noDecoration",
|
|
742
|
+
"themeColor",
|
|
743
|
+
"expand",
|
|
744
|
+
"isFloating",
|
|
745
|
+
"size",
|
|
746
|
+
"showIconOnly"
|
|
747
|
+
]
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
kind: "component",
|
|
751
|
+
type: IconComponent,
|
|
752
|
+
selector: "kirby-icon",
|
|
753
|
+
inputs: ["size", "name"]
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
kind: "component",
|
|
757
|
+
type: BadgeComponent,
|
|
758
|
+
selector: "kirby-badge",
|
|
759
|
+
inputs: ["text", "size"]
|
|
760
|
+
}
|
|
761
|
+
],
|
|
762
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
767
|
+
minVersion: "12.0.0",
|
|
768
|
+
version: "22.2.2",
|
|
769
|
+
ngImport: i0,
|
|
770
|
+
type: MenuAnchorItemComponent,
|
|
771
|
+
decorators: [{
|
|
772
|
+
type: Component,
|
|
773
|
+
args: [{
|
|
774
|
+
selector: "li[kirby-x-menu-anchor-item]",
|
|
775
|
+
host: {
|
|
776
|
+
"[class.selected]": "vm.isSelected()",
|
|
777
|
+
"[class.has-toggle]": "!!vm.item().toggle",
|
|
778
|
+
"[class.has-badge]": "!!vm.item().badge"
|
|
779
|
+
},
|
|
780
|
+
imports: [
|
|
781
|
+
MenuItemComponent,
|
|
782
|
+
RouterLink,
|
|
783
|
+
ToggleButtonComponent,
|
|
784
|
+
ButtonComponent,
|
|
785
|
+
IconComponent,
|
|
786
|
+
BadgeComponent
|
|
787
|
+
],
|
|
788
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
789
|
+
template: "@let item = vm.item();\n@switch (item.type) {\n @case ('action') {\n <a\n kirby-x-menu-item\n [class.selected]=\"vm.isSelected()\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.href]=\"item.href\"\n (click)=\"$event.preventDefault(); vm.selectItem()\"\n (keydown.enter)=\"$event.preventDefault(); vm.selectItem()\"\n >\n {{ item.title }}\n @if (item.badge) {\n <kirby-badge\n slot=\"end\"\n class=\"item-badge\"\n [themeColor]=\"item.badge.themeColor ?? 'primary'\"\n >\n {{ item.badge.value }}\n </kirby-badge>\n }\n @if (item.isLink) {\n <kirby-icon name=\"link\" slot=\"end\" class=\"external-link\"></kirby-icon>\n }\n @if (item.toggle) {\n <div slot=\"end\" class=\"toggle-spacer\"></div>\n }\n </a>\n }\n @case ('router-link') {\n <a\n kirby-x-menu-item\n [class.selected]=\"vm.isSelected()\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [routerLink]=\"item.route\"\n [queryParams]=\"item.queryParams\"\n [skipLocationChange]=\"item.skipLocationChange\"\n [replaceUrl]=\"item.replaceUrl\"\n (click)=\"vm.selectItem()\"\n (keydown.enter)=\"vm.selectItem()\"\n >\n {{ item.title }}\n @if (item.badge) {\n <kirby-badge\n slot=\"end\"\n class=\"item-badge\"\n [themeColor]=\"item.badge.themeColor ?? 'primary'\"\n >\n {{ item.badge.value }}\n </kirby-badge>\n }\n @if (item.toggle) {\n <div slot=\"end\" class=\"toggle-spacer\"></div>\n }\n </a>\n }\n @case ('external-link') {\n <a\n kirby-x-menu-item\n [class.selected]=\"vm.isSelected()\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.href]=\"item.url\"\n [attr.target]=\"item.target\"\n (click)=\"vm.selectItem()\"\n (keydown.enter)=\"vm.selectItem()\"\n >\n {{ item.title }}\n @if (item.badge) {\n <kirby-badge\n slot=\"end\"\n class=\"item-badge\"\n [themeColor]=\"item.badge.themeColor ?? 'primary'\"\n >\n {{ item.badge.value }}\n </kirby-badge>\n }\n <kirby-icon name=\"link\" slot=\"end\" class=\"external-link\"></kirby-icon>\n @if (item.toggle) {\n <div slot=\"end\" class=\"toggle-spacer\"></div>\n }\n </a>\n }\n}\n\n@if (item.toggle) {\n <kirby-toggle-button\n class=\"toggle-button-wrapper\"\n [checked]=\"vm.isChecked()\"\n (checkChanged)=\"vm.checkItem($event)\"\n >\n <button\n kirby-button\n unchecked\n size=\"xs\"\n attentionLevel=\"3\"\n tabindex=\"-1\"\n [noDecoration]=\"true\"\n class=\"toggle-button\"\n >\n <kirby-icon size=\"xs\" [name]=\"item.toggle.uncheckedIcon\"></kirby-icon>\n </button>\n <button\n kirby-button\n checked\n size=\"xs\"\n attentionLevel=\"3\"\n tabindex=\"-1\"\n [noDecoration]=\"true\"\n class=\"toggle-button\"\n >\n <kirby-icon size=\"xs\" [name]=\"item.toggle.checkedIcon\"></kirby-icon>\n </button>\n </kirby-toggle-button>\n}\n",
|
|
790
|
+
styles: [":host{display:flex;flex-direction:row;align-items:center;position:relative;overflow:visible}:host.selected{color:var(--menuitem-selected-color, var(--kirby-primary-contrast))}:host:not(.selected):hover a{background:var(--menuitem-hover-background-color, var(--kirby-inputs-background-color-hover))}:host:not(.selected):active a{background:var(--menuitem-active-background-color, var(--kirby-inputs-background-color-active))}.selected,.selected:hover,.selected:active,.selected:focus-visible{background:var(--menuitem-selected-background-color, var(--kirby-primary));font-weight:var(--kirby-font-weight-bold)}.item-badge{display:inline-flex}.toggle-spacer{width:var(--kirby-icon-font-size-sm);display:none}:host.has-toggle:hover .item-badge,:host.has-toggle:active .item-badge,:host.has-toggle:has(a:focus-visible) .item-badge,:host.has-toggle:has(.toggle-button:focus-visible) .item-badge{display:none}:host.has-toggle:hover .toggle-spacer,:host.has-toggle:active .toggle-spacer,:host.has-toggle:has(a:focus-visible) .toggle-spacer,:host.has-toggle:has(.toggle-button:focus-visible) .toggle-spacer{display:initial}:host.has-toggle:hover .external-link,:host.has-toggle:active .external-link,:host.has-toggle:has(a:focus-visible) .external-link,:host.has-toggle:has(.toggle-button:focus-visible) .external-link{display:none}.toggle-button-wrapper{display:inline-flex;position:absolute;right:var(--kirby-spacing-xs)}.toggle-button{margin:0;transition:opacity 0ms;--kirby-button-color: inherit}.toggle-button:not(:focus-visible){opacity:0}:host:hover .toggle-button,:host:active .toggle-button,:host:has(a:focus-visible) .toggle-button{opacity:1}\n"]
|
|
791
|
+
}]
|
|
792
|
+
}],
|
|
793
|
+
propDecorators: {
|
|
794
|
+
item: [{
|
|
795
|
+
type: i0.Input,
|
|
796
|
+
args: [{
|
|
797
|
+
isSignal: true,
|
|
798
|
+
alias: "item",
|
|
799
|
+
required: true
|
|
800
|
+
}]
|
|
801
|
+
}],
|
|
802
|
+
size: [{
|
|
803
|
+
type: i0.Input,
|
|
804
|
+
args: [{
|
|
805
|
+
isSignal: true,
|
|
806
|
+
alias: "size",
|
|
807
|
+
required: true
|
|
808
|
+
}]
|
|
809
|
+
}]
|
|
810
|
+
}
|
|
811
|
+
});
|
|
383
812
|
function ensureInView(scrollContainer, element, durationMs) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
};
|
|
395
|
-
requestAnimationFrame(updatePosition);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
const DropDownAnimation = trigger('dropDownMenu', [
|
|
399
|
-
transition(':enter', [
|
|
400
|
-
style({ height: 0, overflow: 'hidden' }),
|
|
401
|
-
animate('300ms ease', style({ height: AUTO_STYLE })),
|
|
402
|
-
]),
|
|
403
|
-
transition(':leave', [
|
|
404
|
-
style({ height: AUTO_STYLE, overflow: 'hidden' }),
|
|
405
|
-
animate('300ms ease', style({ height: 0 })),
|
|
406
|
-
]),
|
|
407
|
-
]);
|
|
408
|
-
|
|
409
|
-
class MenuSubmenuItemComponent {
|
|
410
|
-
constructor() {
|
|
411
|
-
this.item = input.required(...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
412
|
-
this.size = input.required(...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
413
|
-
this.#element = inject(ElementRef).nativeElement;
|
|
414
|
-
this.#stateService = inject(MenuStateService);
|
|
415
|
-
this.#isExpanded = computed(() => {
|
|
416
|
-
const id = this.item().id;
|
|
417
|
-
const expandedItems = this.#stateService.expandedItems();
|
|
418
|
-
return expandedItems.has(id);
|
|
419
|
-
}, ...(ngDevMode ? [{ debugName: "#isExpanded" }] : /* istanbul ignore next */ []));
|
|
420
|
-
this.#submenuSize = computed(() => {
|
|
421
|
-
switch (this.size()) {
|
|
422
|
-
case 'lg':
|
|
423
|
-
return 'md';
|
|
424
|
-
case 'md':
|
|
425
|
-
return 'sm';
|
|
426
|
-
default:
|
|
427
|
-
return 'xs';
|
|
428
|
-
}
|
|
429
|
-
}, ...(ngDevMode ? [{ debugName: "#submenuSize" }] : /* istanbul ignore next */ []));
|
|
430
|
-
this.vm = {
|
|
431
|
-
item: this.item,
|
|
432
|
-
size: this.size,
|
|
433
|
-
isExpanded: this.#isExpanded,
|
|
434
|
-
submenuId: computed(() => `item-${this.item().id}-content`),
|
|
435
|
-
submenuSize: this.#submenuSize,
|
|
436
|
-
animationsDisabled: this.#stateService.animationsDisabled,
|
|
437
|
-
toggleSubmenu: this.#toggleSubmenu.bind(this),
|
|
438
|
-
reorderItem: this.#reorderItem.bind(this),
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
#element;
|
|
442
|
-
#stateService;
|
|
443
|
-
#isExpanded;
|
|
444
|
-
#submenuSize;
|
|
445
|
-
#toggleSubmenu() {
|
|
446
|
-
const button = this.#element.querySelector('button[kirby-x-menu-item]');
|
|
447
|
-
const scrollContainer = this.#element.closest('.sidebar-content');
|
|
448
|
-
if (button && scrollContainer) {
|
|
449
|
-
ensureInView(scrollContainer, button, 400);
|
|
450
|
-
}
|
|
451
|
-
if (this.#isExpanded()) {
|
|
452
|
-
this.#stateService.collapseItem(this.item().id);
|
|
453
|
-
}
|
|
454
|
-
else {
|
|
455
|
-
this.#stateService.expandItem(this.item().id);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
#reorderItem(event) {
|
|
459
|
-
this.#stateService.reorderItems(this.item(), event.item.data, event.previousIndex, event.currentIndex);
|
|
460
|
-
}
|
|
461
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MenuSubmenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
462
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: MenuSubmenuItemComponent, isStandalone: true, selector: "li[kirby-x-menu-submenu-item]", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let item = vm.item();\n<button\n kirby-x-menu-item\n type=\"button\"\n class=\"submenu-toggle\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.aria-controls]=\"vm.submenuId()\"\n [attr.aria-expanded]=\"vm.isExpanded()\"\n (click)=\"vm.toggleSubmenu()\"\n>\n {{ item.title }}\n <kirby-icon\n slot=\"end\"\n name=\"arrow-more\"\n class=\"disclosure\"\n [class.rotate]=\"vm.isExpanded()\"\n ></kirby-icon>\n</button>\n@if (vm.isExpanded()) {\n <ul\n kirby-x-menu-item-list\n [items]=\"item.children\"\n [size]=\"vm.submenuSize()\"\n [id]=\"vm.submenuId()\"\n [@dropDownMenu]\n [@.disabled]=\"vm.animationsDisabled()\"\n cdkDropList\n (cdkDropListDropped)=\"vm.reorderItem($event)\"\n [isReorderable]=\"item.isReorderable ?? false\"\n ></ul>\n}\n", styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;overflow:visible;flex-direction:column}.submenu-toggle{width:100%}.submenu-toggle[aria-expanded=true]{font-weight:700}.disclosure{transition:transform .2s}.disclosure.rotate{transform:rotate(90deg)}\n"], dependencies: [{ kind: "component", type: i0.forwardRef(() => MenuItemComponent), selector: "a[kirby-x-menu-item],button[kirby-x-menu-item]", inputs: ["id", "size", "icon"] }, { kind: "component", type: i0.forwardRef(() => IconComponent), selector: "kirby-icon", inputs: ["size", "name"] }, { kind: "component", type: i0.forwardRef(() => MenuItemListComponent), selector: "ul[kirby-x-menu-item-list]", inputs: ["items", "size", "id", "isReorderable"] }, { kind: "directive", type: i0.forwardRef(() => CdkDropList), selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }], animations: [DropDownAnimation] }); }
|
|
463
|
-
}
|
|
464
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MenuSubmenuItemComponent, decorators: [{
|
|
465
|
-
type: Component,
|
|
466
|
-
args: [{ selector: 'li[kirby-x-menu-submenu-item]', animations: [DropDownAnimation], imports: [MenuItemComponent, IconComponent, forwardRef(() => MenuItemListComponent), CdkDropList], template: "@let item = vm.item();\n<button\n kirby-x-menu-item\n type=\"button\"\n class=\"submenu-toggle\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.aria-controls]=\"vm.submenuId()\"\n [attr.aria-expanded]=\"vm.isExpanded()\"\n (click)=\"vm.toggleSubmenu()\"\n>\n {{ item.title }}\n <kirby-icon\n slot=\"end\"\n name=\"arrow-more\"\n class=\"disclosure\"\n [class.rotate]=\"vm.isExpanded()\"\n ></kirby-icon>\n</button>\n@if (vm.isExpanded()) {\n <ul\n kirby-x-menu-item-list\n [items]=\"item.children\"\n [size]=\"vm.submenuSize()\"\n [id]=\"vm.submenuId()\"\n [@dropDownMenu]\n [@.disabled]=\"vm.animationsDisabled()\"\n cdkDropList\n (cdkDropListDropped)=\"vm.reorderItem($event)\"\n [isReorderable]=\"item.isReorderable ?? false\"\n ></ul>\n}\n", styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;overflow:visible;flex-direction:column}.submenu-toggle{width:100%}.submenu-toggle[aria-expanded=true]{font-weight:700}.disclosure{transition:transform .2s}.disclosure.rotate{transform:rotate(90deg)}\n"] }]
|
|
467
|
-
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: true }] }] } });
|
|
468
|
-
|
|
469
|
-
class MenuItemListComponent {
|
|
470
|
-
constructor() {
|
|
471
|
-
this.items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
472
|
-
this.size = input('lg', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
473
|
-
this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
|
|
474
|
-
this.isReorderable = input(false, ...(ngDevMode ? [{ debugName: "isReorderable" }] : /* istanbul ignore next */ []));
|
|
475
|
-
this.vm = {
|
|
476
|
-
id: this.id,
|
|
477
|
-
size: this.size,
|
|
478
|
-
items: this.items,
|
|
479
|
-
isReorderable: this.isReorderable,
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MenuItemListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
483
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: MenuItemListComponent, isStandalone: true, selector: "ul[kirby-x-menu-item-list]", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, isReorderable: { classPropertyName: "isReorderable", publicName: "isReorderable", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "vm.id()", "class": "vm.size()" } }, ngImport: i0, template: "@for (item of vm.items(); track item.id) {\n @switch (item.type) {\n @case ('divider') {\n <kirby-divider aria-hidden=\"true\"></kirby-divider>\n }\n @case ('submenu') {\n <li\n kirby-x-menu-submenu-item\n [item]=\"item\"\n [size]=\"vm.size()\"\n cdkDrag\n cdkDragPreviewContainer=\"parent\"\n [cdkDragBoundary]=\"'[cdkDropList]'\"\n [cdkDragDisabled]=\"!vm.isReorderable()\"\n [cdkDragData]=\"item.id\"\n ></li>\n }\n @default {\n <li\n kirby-x-menu-anchor-item\n [item]=\"item\"\n [size]=\"vm.size()\"\n cdkDrag\n cdkDragPreviewContainer=\"parent\"\n [cdkDragBoundary]=\"'[cdkDropList]'\"\n [cdkDragDisabled]=\"!vm.isReorderable()\"\n [cdkDragData]=\"item.id\"\n ></li>\n }\n }\n}\n", styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;flex-direction:column;margin:0;padding-left:0;padding-right:0;list-style-type:none}kirby-divider{display:flex;background:var(--kirby-white-overlay-20);margin:8px 0}li{margin-block-start:0!important}.cdk-drag-placeholder{opacity:0}:host.cdk-drop-list-dragging .cdk-drag:not(.cdk-drag-preview,.cdk-drag-placeholder){transition-property:transform;transition-duration:.3s;transition-timing-function:linear;pointer-events:none}:host .cdk-drag:not(.cdk-drag-preview,.cdk-drag-placeholder){transition:none}\n"], dependencies: [{ kind: "component", type: i0.forwardRef(() => DividerComponent), selector: "kirby-divider", inputs: ["hasMargin"] }, { kind: "component", type: i0.forwardRef(() => MenuAnchorItemComponent), selector: "li[kirby-x-menu-anchor-item]", inputs: ["item", "size"] }, { kind: "component", type: i0.forwardRef(() => MenuSubmenuItemComponent), selector: "li[kirby-x-menu-submenu-item]", inputs: ["item", "size"] }, { kind: "directive", type: i0.forwardRef(() => CdkDrag), selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
813
|
+
let startTime = null;
|
|
814
|
+
const updatePosition = (timestamp) => {
|
|
815
|
+
if (!startTime) startTime = timestamp;
|
|
816
|
+
if (timestamp - startTime < durationMs) {
|
|
817
|
+
scrollIntoViewIfNecessary(scrollContainer, element, "start");
|
|
818
|
+
requestAnimationFrame(updatePosition);
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
requestAnimationFrame(updatePosition);
|
|
484
822
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
823
|
+
const DropDownAnimation = trigger("dropDownMenu", [transition(":enter", [style({
|
|
824
|
+
height: 0,
|
|
825
|
+
overflow: "hidden"
|
|
826
|
+
}), animate("300ms ease", style({ height: AUTO_STYLE }))]), transition(":leave", [style({
|
|
827
|
+
height: AUTO_STYLE,
|
|
828
|
+
overflow: "hidden"
|
|
829
|
+
}), animate("300ms ease", style({ height: 0 }))])]);
|
|
830
|
+
var MenuSubmenuItemComponent = class MenuSubmenuItemComponent {
|
|
831
|
+
constructor() {
|
|
832
|
+
this.item = input.required(...ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []);
|
|
833
|
+
this.size = input.required(...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
834
|
+
this.#element = inject(ElementRef).nativeElement;
|
|
835
|
+
this.#stateService = inject(MenuStateService);
|
|
836
|
+
this.#isExpanded = computed(() => {
|
|
837
|
+
const id = this.item().id;
|
|
838
|
+
return this.#stateService.expandedItems().has(id);
|
|
839
|
+
}, ...ngDevMode ? [{ debugName: "#isExpanded" }] : /* istanbul ignore next */ []);
|
|
840
|
+
this.#submenuSize = computed(() => {
|
|
841
|
+
switch (this.size()) {
|
|
842
|
+
case "lg": return "md";
|
|
843
|
+
case "md": return "sm";
|
|
844
|
+
default: return "xs";
|
|
845
|
+
}
|
|
846
|
+
}, ...ngDevMode ? [{ debugName: "#submenuSize" }] : /* istanbul ignore next */ []);
|
|
847
|
+
this.vm = {
|
|
848
|
+
item: this.item,
|
|
849
|
+
size: this.size,
|
|
850
|
+
isExpanded: this.#isExpanded,
|
|
851
|
+
submenuId: computed(() => `item-${this.item().id}-content`),
|
|
852
|
+
submenuSize: this.#submenuSize,
|
|
853
|
+
animationsDisabled: this.#stateService.animationsDisabled,
|
|
854
|
+
toggleSubmenu: this.#toggleSubmenu.bind(this),
|
|
855
|
+
reorderItem: this.#reorderItem.bind(this)
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
#element;
|
|
859
|
+
#stateService;
|
|
860
|
+
#isExpanded;
|
|
861
|
+
#submenuSize;
|
|
862
|
+
#toggleSubmenu() {
|
|
863
|
+
const button = this.#element.querySelector("button[kirby-x-menu-item]");
|
|
864
|
+
const scrollContainer = this.#element.closest(".sidebar-content");
|
|
865
|
+
if (button && scrollContainer) ensureInView(scrollContainer, button, 400);
|
|
866
|
+
if (this.#isExpanded()) this.#stateService.collapseItem(this.item().id);
|
|
867
|
+
else this.#stateService.expandItem(this.item().id);
|
|
868
|
+
}
|
|
869
|
+
#reorderItem(event) {
|
|
870
|
+
this.#stateService.reorderItems(this.item(), event.item.data, event.previousIndex, event.currentIndex);
|
|
871
|
+
}
|
|
872
|
+
static {
|
|
873
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
874
|
+
minVersion: "12.0.0",
|
|
875
|
+
version: "22.2.2",
|
|
876
|
+
ngImport: i0,
|
|
877
|
+
type: MenuSubmenuItemComponent,
|
|
878
|
+
deps: [],
|
|
879
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
static {
|
|
883
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
884
|
+
minVersion: "17.0.0",
|
|
885
|
+
version: "22.2.2",
|
|
886
|
+
type: MenuSubmenuItemComponent,
|
|
887
|
+
isStandalone: true,
|
|
888
|
+
selector: "li[kirby-x-menu-submenu-item]",
|
|
889
|
+
inputs: {
|
|
890
|
+
item: {
|
|
891
|
+
classPropertyName: "item",
|
|
892
|
+
publicName: "item",
|
|
893
|
+
isSignal: true,
|
|
894
|
+
isRequired: true,
|
|
895
|
+
transformFunction: null
|
|
896
|
+
},
|
|
897
|
+
size: {
|
|
898
|
+
classPropertyName: "size",
|
|
899
|
+
publicName: "size",
|
|
900
|
+
isSignal: true,
|
|
901
|
+
isRequired: true,
|
|
902
|
+
transformFunction: null
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
ngImport: i0,
|
|
906
|
+
template: "@let item = vm.item();\n<button\n kirby-x-menu-item\n type=\"button\"\n class=\"submenu-toggle\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.aria-controls]=\"vm.submenuId()\"\n [attr.aria-expanded]=\"vm.isExpanded()\"\n (click)=\"vm.toggleSubmenu()\"\n>\n {{ item.title }}\n <kirby-icon\n slot=\"end\"\n name=\"arrow-more\"\n class=\"disclosure\"\n [class.rotate]=\"vm.isExpanded()\"\n ></kirby-icon>\n</button>\n@if (vm.isExpanded()) {\n <ul\n kirby-x-menu-item-list\n [items]=\"item.children\"\n [size]=\"vm.submenuSize()\"\n [id]=\"vm.submenuId()\"\n [@dropDownMenu]\n [@.disabled]=\"vm.animationsDisabled()\"\n cdkDropList\n (cdkDropListDropped)=\"vm.reorderItem($event)\"\n [isReorderable]=\"item.isReorderable ?? false\"\n ></ul>\n}\n",
|
|
907
|
+
styles: [":host{display:flex;overflow:visible;flex-direction:column}.submenu-toggle{width:100%}.submenu-toggle[aria-expanded=true]{font-weight:var(--kirby-font-weight-bold)}.disclosure{transition:transform var(--kirby-transition-duration-quick)}.disclosure.rotate{transform:rotate(90deg)}\n"],
|
|
908
|
+
dependencies: [
|
|
909
|
+
{
|
|
910
|
+
kind: "component",
|
|
911
|
+
type: i0.forwardRef(() => MenuItemComponent),
|
|
912
|
+
selector: "a[kirby-x-menu-item],button[kirby-x-menu-item]",
|
|
913
|
+
inputs: [
|
|
914
|
+
"id",
|
|
915
|
+
"size",
|
|
916
|
+
"icon"
|
|
917
|
+
]
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
kind: "component",
|
|
921
|
+
type: i0.forwardRef(() => IconComponent),
|
|
922
|
+
selector: "kirby-icon",
|
|
923
|
+
inputs: ["size", "name"]
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
kind: "component",
|
|
927
|
+
type: i0.forwardRef(() => MenuItemListComponent),
|
|
928
|
+
selector: "ul[kirby-x-menu-item-list]",
|
|
929
|
+
inputs: [
|
|
930
|
+
"items",
|
|
931
|
+
"size",
|
|
932
|
+
"id",
|
|
933
|
+
"isReorderable"
|
|
934
|
+
]
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
kind: "directive",
|
|
938
|
+
type: i0.forwardRef(() => CdkDropList),
|
|
939
|
+
selector: "[cdkDropList], cdk-drop-list",
|
|
940
|
+
inputs: [
|
|
941
|
+
"cdkDropListConnectedTo",
|
|
942
|
+
"cdkDropListData",
|
|
943
|
+
"cdkDropListOrientation",
|
|
944
|
+
"id",
|
|
945
|
+
"cdkDropListLockAxis",
|
|
946
|
+
"cdkDropListDisabled",
|
|
947
|
+
"cdkDropListSortingDisabled",
|
|
948
|
+
"cdkDropListEnterPredicate",
|
|
949
|
+
"cdkDropListSortPredicate",
|
|
950
|
+
"cdkDropListAutoScrollDisabled",
|
|
951
|
+
"cdkDropListAutoScrollStep",
|
|
952
|
+
"cdkDropListElementContainer",
|
|
953
|
+
"cdkDropListHasAnchor"
|
|
954
|
+
],
|
|
955
|
+
outputs: [
|
|
956
|
+
"cdkDropListDropped",
|
|
957
|
+
"cdkDropListEntered",
|
|
958
|
+
"cdkDropListExited",
|
|
959
|
+
"cdkDropListSorted"
|
|
960
|
+
],
|
|
961
|
+
exportAs: ["cdkDropList"]
|
|
962
|
+
}
|
|
963
|
+
],
|
|
964
|
+
animations: [DropDownAnimation],
|
|
965
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
970
|
+
minVersion: "12.0.0",
|
|
971
|
+
version: "22.2.2",
|
|
972
|
+
ngImport: i0,
|
|
973
|
+
type: MenuSubmenuItemComponent,
|
|
974
|
+
decorators: [{
|
|
975
|
+
type: Component,
|
|
976
|
+
args: [{
|
|
977
|
+
selector: "li[kirby-x-menu-submenu-item]",
|
|
978
|
+
animations: [DropDownAnimation],
|
|
979
|
+
imports: [
|
|
980
|
+
MenuItemComponent,
|
|
981
|
+
IconComponent,
|
|
982
|
+
forwardRef(() => MenuItemListComponent),
|
|
983
|
+
CdkDropList
|
|
984
|
+
],
|
|
985
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
986
|
+
template: "@let item = vm.item();\n<button\n kirby-x-menu-item\n type=\"button\"\n class=\"submenu-toggle\"\n [size]=\"vm.size()\"\n [id]=\"item.id\"\n [icon]=\"item.icon\"\n [attr.aria-controls]=\"vm.submenuId()\"\n [attr.aria-expanded]=\"vm.isExpanded()\"\n (click)=\"vm.toggleSubmenu()\"\n>\n {{ item.title }}\n <kirby-icon\n slot=\"end\"\n name=\"arrow-more\"\n class=\"disclosure\"\n [class.rotate]=\"vm.isExpanded()\"\n ></kirby-icon>\n</button>\n@if (vm.isExpanded()) {\n <ul\n kirby-x-menu-item-list\n [items]=\"item.children\"\n [size]=\"vm.submenuSize()\"\n [id]=\"vm.submenuId()\"\n [@dropDownMenu]\n [@.disabled]=\"vm.animationsDisabled()\"\n cdkDropList\n (cdkDropListDropped)=\"vm.reorderItem($event)\"\n [isReorderable]=\"item.isReorderable ?? false\"\n ></ul>\n}\n",
|
|
987
|
+
styles: [":host{display:flex;overflow:visible;flex-direction:column}.submenu-toggle{width:100%}.submenu-toggle[aria-expanded=true]{font-weight:var(--kirby-font-weight-bold)}.disclosure{transition:transform var(--kirby-transition-duration-quick)}.disclosure.rotate{transform:rotate(90deg)}\n"]
|
|
988
|
+
}]
|
|
989
|
+
}],
|
|
990
|
+
propDecorators: {
|
|
991
|
+
item: [{
|
|
992
|
+
type: i0.Input,
|
|
993
|
+
args: [{
|
|
994
|
+
isSignal: true,
|
|
995
|
+
alias: "item",
|
|
996
|
+
required: true
|
|
997
|
+
}]
|
|
998
|
+
}],
|
|
999
|
+
size: [{
|
|
1000
|
+
type: i0.Input,
|
|
1001
|
+
args: [{
|
|
1002
|
+
isSignal: true,
|
|
1003
|
+
alias: "size",
|
|
1004
|
+
required: true
|
|
1005
|
+
}]
|
|
1006
|
+
}]
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
var MenuItemListComponent = class MenuItemListComponent {
|
|
1010
|
+
constructor() {
|
|
1011
|
+
this.items = input.required(...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
1012
|
+
this.size = input("lg", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
1013
|
+
this.id = input(...ngDevMode ? [void 0, { debugName: "id" }] : /* istanbul ignore next */ []);
|
|
1014
|
+
this.isReorderable = input(false, ...ngDevMode ? [{ debugName: "isReorderable" }] : /* istanbul ignore next */ []);
|
|
1015
|
+
this.vm = {
|
|
1016
|
+
id: this.id,
|
|
1017
|
+
size: this.size,
|
|
1018
|
+
items: this.items,
|
|
1019
|
+
isReorderable: this.isReorderable
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
static {
|
|
1023
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1024
|
+
minVersion: "12.0.0",
|
|
1025
|
+
version: "22.2.2",
|
|
1026
|
+
ngImport: i0,
|
|
1027
|
+
type: MenuItemListComponent,
|
|
1028
|
+
deps: [],
|
|
1029
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
static {
|
|
1033
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1034
|
+
minVersion: "17.0.0",
|
|
1035
|
+
version: "22.2.2",
|
|
1036
|
+
type: MenuItemListComponent,
|
|
1037
|
+
isStandalone: true,
|
|
1038
|
+
selector: "ul[kirby-x-menu-item-list]",
|
|
1039
|
+
inputs: {
|
|
1040
|
+
items: {
|
|
1041
|
+
classPropertyName: "items",
|
|
1042
|
+
publicName: "items",
|
|
1043
|
+
isSignal: true,
|
|
1044
|
+
isRequired: true,
|
|
1045
|
+
transformFunction: null
|
|
1046
|
+
},
|
|
1047
|
+
size: {
|
|
1048
|
+
classPropertyName: "size",
|
|
1049
|
+
publicName: "size",
|
|
1050
|
+
isSignal: true,
|
|
1051
|
+
isRequired: false,
|
|
1052
|
+
transformFunction: null
|
|
1053
|
+
},
|
|
1054
|
+
id: {
|
|
1055
|
+
classPropertyName: "id",
|
|
1056
|
+
publicName: "id",
|
|
1057
|
+
isSignal: true,
|
|
1058
|
+
isRequired: false,
|
|
1059
|
+
transformFunction: null
|
|
1060
|
+
},
|
|
1061
|
+
isReorderable: {
|
|
1062
|
+
classPropertyName: "isReorderable",
|
|
1063
|
+
publicName: "isReorderable",
|
|
1064
|
+
isSignal: true,
|
|
1065
|
+
isRequired: false,
|
|
1066
|
+
transformFunction: null
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1069
|
+
host: { properties: {
|
|
1070
|
+
"attr.id": "vm.id()",
|
|
1071
|
+
"class": "vm.size()"
|
|
1072
|
+
} },
|
|
1073
|
+
ngImport: i0,
|
|
1074
|
+
template: "@for (item of vm.items(); track item.id) {\n @switch (item.type) {\n @case ('divider') {\n <kirby-divider aria-hidden=\"true\"></kirby-divider>\n }\n @case ('submenu') {\n <li\n kirby-x-menu-submenu-item\n [item]=\"item\"\n [size]=\"vm.size()\"\n cdkDrag\n cdkDragPreviewContainer=\"parent\"\n [cdkDragBoundary]=\"'[cdkDropList]'\"\n [cdkDragDisabled]=\"!vm.isReorderable()\"\n [cdkDragData]=\"item.id\"\n ></li>\n }\n @default {\n <li\n kirby-x-menu-anchor-item\n [item]=\"item\"\n [size]=\"vm.size()\"\n cdkDrag\n cdkDragPreviewContainer=\"parent\"\n [cdkDragBoundary]=\"'[cdkDropList]'\"\n [cdkDragDisabled]=\"!vm.isReorderable()\"\n [cdkDragData]=\"item.id\"\n ></li>\n }\n }\n}\n",
|
|
1075
|
+
styles: [":host{display:flex;flex-direction:column;margin:0;padding-left:0;padding-right:0;list-style-type:none}kirby-divider{display:flex;background:var(--kirby-white-overlay-20);margin:var(--kirby-spacing-xxs) 0}li{margin-block-start:0!important}.cdk-drag-placeholder{opacity:0}:host.cdk-drop-list-dragging .cdk-drag:not(.cdk-drag-preview,.cdk-drag-placeholder){transition-property:transform;transition-duration:var(--kirby-transition-duration-short);transition-timing-function:var(--kirby-transition-easing-static);pointer-events:none}:host .cdk-drag:not(.cdk-drag-preview,.cdk-drag-placeholder){transition:none}\n"],
|
|
1076
|
+
dependencies: [
|
|
1077
|
+
{
|
|
1078
|
+
kind: "component",
|
|
1079
|
+
type: i0.forwardRef(() => DividerComponent),
|
|
1080
|
+
selector: "kirby-divider",
|
|
1081
|
+
inputs: ["hasMargin"]
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
kind: "component",
|
|
1085
|
+
type: i0.forwardRef(() => MenuAnchorItemComponent),
|
|
1086
|
+
selector: "li[kirby-x-menu-anchor-item]",
|
|
1087
|
+
inputs: ["item", "size"]
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
kind: "component",
|
|
1091
|
+
type: i0.forwardRef(() => MenuSubmenuItemComponent),
|
|
1092
|
+
selector: "li[kirby-x-menu-submenu-item]",
|
|
1093
|
+
inputs: ["item", "size"]
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
kind: "directive",
|
|
1097
|
+
type: i0.forwardRef(() => CdkDrag),
|
|
1098
|
+
selector: "[cdkDrag]",
|
|
1099
|
+
inputs: [
|
|
1100
|
+
"cdkDragData",
|
|
1101
|
+
"cdkDragLockAxis",
|
|
1102
|
+
"cdkDragRootElement",
|
|
1103
|
+
"cdkDragBoundary",
|
|
1104
|
+
"cdkDragStartDelay",
|
|
1105
|
+
"cdkDragFreeDragPosition",
|
|
1106
|
+
"cdkDragDisabled",
|
|
1107
|
+
"cdkDragConstrainPosition",
|
|
1108
|
+
"cdkDragPreviewClass",
|
|
1109
|
+
"cdkDragPreviewContainer",
|
|
1110
|
+
"cdkDragScale"
|
|
1111
|
+
],
|
|
1112
|
+
outputs: [
|
|
1113
|
+
"cdkDragStarted",
|
|
1114
|
+
"cdkDragReleased",
|
|
1115
|
+
"cdkDragEnded",
|
|
1116
|
+
"cdkDragEntered",
|
|
1117
|
+
"cdkDragExited",
|
|
1118
|
+
"cdkDragDropped",
|
|
1119
|
+
"cdkDragMoved"
|
|
1120
|
+
],
|
|
1121
|
+
exportAs: ["cdkDrag"]
|
|
1122
|
+
}
|
|
1123
|
+
],
|
|
1124
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
};
|
|
1128
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1129
|
+
minVersion: "12.0.0",
|
|
1130
|
+
version: "22.2.2",
|
|
1131
|
+
ngImport: i0,
|
|
1132
|
+
type: MenuItemListComponent,
|
|
1133
|
+
decorators: [{
|
|
1134
|
+
type: Component,
|
|
1135
|
+
args: [{
|
|
1136
|
+
selector: "ul[kirby-x-menu-item-list]",
|
|
1137
|
+
host: {
|
|
1138
|
+
"[attr.id]": "vm.id()",
|
|
1139
|
+
"[class]": "vm.size()"
|
|
1140
|
+
},
|
|
1141
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1142
|
+
imports: [
|
|
1143
|
+
DividerComponent,
|
|
1144
|
+
MenuAnchorItemComponent,
|
|
1145
|
+
forwardRef(() => MenuSubmenuItemComponent),
|
|
1146
|
+
CdkDrag
|
|
1147
|
+
],
|
|
1148
|
+
template: "@for (item of vm.items(); track item.id) {\n @switch (item.type) {\n @case ('divider') {\n <kirby-divider aria-hidden=\"true\"></kirby-divider>\n }\n @case ('submenu') {\n <li\n kirby-x-menu-submenu-item\n [item]=\"item\"\n [size]=\"vm.size()\"\n cdkDrag\n cdkDragPreviewContainer=\"parent\"\n [cdkDragBoundary]=\"'[cdkDropList]'\"\n [cdkDragDisabled]=\"!vm.isReorderable()\"\n [cdkDragData]=\"item.id\"\n ></li>\n }\n @default {\n <li\n kirby-x-menu-anchor-item\n [item]=\"item\"\n [size]=\"vm.size()\"\n cdkDrag\n cdkDragPreviewContainer=\"parent\"\n [cdkDragBoundary]=\"'[cdkDropList]'\"\n [cdkDragDisabled]=\"!vm.isReorderable()\"\n [cdkDragData]=\"item.id\"\n ></li>\n }\n }\n}\n",
|
|
1149
|
+
styles: [":host{display:flex;flex-direction:column;margin:0;padding-left:0;padding-right:0;list-style-type:none}kirby-divider{display:flex;background:var(--kirby-white-overlay-20);margin:var(--kirby-spacing-xxs) 0}li{margin-block-start:0!important}.cdk-drag-placeholder{opacity:0}:host.cdk-drop-list-dragging .cdk-drag:not(.cdk-drag-preview,.cdk-drag-placeholder){transition-property:transform;transition-duration:var(--kirby-transition-duration-short);transition-timing-function:var(--kirby-transition-easing-static);pointer-events:none}:host .cdk-drag:not(.cdk-drag-preview,.cdk-drag-placeholder){transition:none}\n"]
|
|
1150
|
+
}]
|
|
1151
|
+
}],
|
|
1152
|
+
propDecorators: {
|
|
1153
|
+
items: [{
|
|
1154
|
+
type: i0.Input,
|
|
1155
|
+
args: [{
|
|
1156
|
+
isSignal: true,
|
|
1157
|
+
alias: "items",
|
|
1158
|
+
required: true
|
|
1159
|
+
}]
|
|
1160
|
+
}],
|
|
1161
|
+
size: [{
|
|
1162
|
+
type: i0.Input,
|
|
1163
|
+
args: [{
|
|
1164
|
+
isSignal: true,
|
|
1165
|
+
alias: "size",
|
|
1166
|
+
required: false
|
|
1167
|
+
}]
|
|
1168
|
+
}],
|
|
1169
|
+
id: [{
|
|
1170
|
+
type: i0.Input,
|
|
1171
|
+
args: [{
|
|
1172
|
+
isSignal: true,
|
|
1173
|
+
alias: "id",
|
|
1174
|
+
required: false
|
|
1175
|
+
}]
|
|
1176
|
+
}],
|
|
1177
|
+
isReorderable: [{
|
|
1178
|
+
type: i0.Input,
|
|
1179
|
+
args: [{
|
|
1180
|
+
isSignal: true,
|
|
1181
|
+
alias: "isReorderable",
|
|
1182
|
+
required: false
|
|
1183
|
+
}]
|
|
1184
|
+
}]
|
|
1185
|
+
}
|
|
1186
|
+
});
|
|
1187
|
+
var MenuContainerComponent = class MenuContainerComponent {
|
|
1188
|
+
#element;
|
|
1189
|
+
#stateService;
|
|
1190
|
+
constructor() {
|
|
1191
|
+
this.#element = inject(ElementRef).nativeElement;
|
|
1192
|
+
this.#stateService = inject(MenuStateService);
|
|
1193
|
+
this.vm = { items: this.#stateService.menuItems };
|
|
1194
|
+
this.#stateService.animationsDisabled = true;
|
|
1195
|
+
afterNextRender({ read: () => {
|
|
1196
|
+
this.#scrollSelectedItemIntoView();
|
|
1197
|
+
this.#stateService.animationsDisabled = false;
|
|
1198
|
+
} });
|
|
1199
|
+
}
|
|
1200
|
+
#scrollSelectedItemIntoView() {
|
|
1201
|
+
const selectedItem = this.#element.querySelector("li.selected");
|
|
1202
|
+
const scrollContainer = this.#element.closest(".sidebar-content");
|
|
1203
|
+
if (selectedItem && scrollContainer) scrollIntoViewIfNecessary(scrollContainer, selectedItem);
|
|
1204
|
+
}
|
|
1205
|
+
static {
|
|
1206
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1207
|
+
minVersion: "12.0.0",
|
|
1208
|
+
version: "22.2.2",
|
|
1209
|
+
ngImport: i0,
|
|
1210
|
+
type: MenuContainerComponent,
|
|
1211
|
+
deps: [],
|
|
1212
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
static {
|
|
1216
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1217
|
+
minVersion: "14.0.0",
|
|
1218
|
+
version: "22.2.2",
|
|
1219
|
+
type: MenuContainerComponent,
|
|
1220
|
+
isStandalone: true,
|
|
1221
|
+
selector: "kirby-x-menu-container",
|
|
1222
|
+
ngImport: i0,
|
|
1223
|
+
template: `
|
|
524
1224
|
<nav aria-label="Sidebar Menu">
|
|
525
1225
|
<ul kirby-x-menu-item-list [items]="vm.items()"></ul>
|
|
526
1226
|
</nav>
|
|
527
|
-
`,
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
1227
|
+
`,
|
|
1228
|
+
isInline: true,
|
|
1229
|
+
styles: ["nav{padding:0 var(--kirby-spacing-xxs)}\n"],
|
|
1230
|
+
dependencies: [{
|
|
1231
|
+
kind: "component",
|
|
1232
|
+
type: MenuItemListComponent,
|
|
1233
|
+
selector: "ul[kirby-x-menu-item-list]",
|
|
1234
|
+
inputs: [
|
|
1235
|
+
"items",
|
|
1236
|
+
"size",
|
|
1237
|
+
"id",
|
|
1238
|
+
"isReorderable"
|
|
1239
|
+
]
|
|
1240
|
+
}],
|
|
1241
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1246
|
+
minVersion: "12.0.0",
|
|
1247
|
+
version: "22.2.2",
|
|
1248
|
+
ngImport: i0,
|
|
1249
|
+
type: MenuContainerComponent,
|
|
1250
|
+
decorators: [{
|
|
1251
|
+
type: Component,
|
|
1252
|
+
args: [{
|
|
1253
|
+
selector: "kirby-x-menu-container",
|
|
1254
|
+
template: `
|
|
532
1255
|
<nav aria-label="Sidebar Menu">
|
|
533
1256
|
<ul kirby-x-menu-item-list [items]="vm.items()"></ul>
|
|
534
1257
|
</nav>
|
|
535
|
-
`,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
1258
|
+
`,
|
|
1259
|
+
imports: [MenuItemListComponent],
|
|
1260
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
1261
|
+
styles: ["nav{padding:0 var(--kirby-spacing-xxs)}\n"]
|
|
1262
|
+
}]
|
|
1263
|
+
}],
|
|
1264
|
+
ctorParameters: () => []
|
|
1265
|
+
});
|
|
1266
|
+
var SidebarMenuComponent = class SidebarMenuComponent {
|
|
1267
|
+
#sidebarService;
|
|
1268
|
+
#stateService;
|
|
1269
|
+
set menuItems(menuItems) {
|
|
1270
|
+
this.#stateService.menuItems = menuItems;
|
|
1271
|
+
}
|
|
1272
|
+
set selectedItem(value) {
|
|
1273
|
+
this.#stateService.selectedItem = value;
|
|
1274
|
+
}
|
|
1275
|
+
set expandedItems(value) {
|
|
1276
|
+
this.#stateService.expandedItems = value;
|
|
1277
|
+
}
|
|
1278
|
+
set checkedItems(value) {
|
|
1279
|
+
this.#stateService.checkedItems = value;
|
|
1280
|
+
}
|
|
1281
|
+
set autoCollapse(value) {
|
|
1282
|
+
this.#stateService.autoCollapse = value;
|
|
1283
|
+
}
|
|
1284
|
+
setMenuHeight(height) {
|
|
1285
|
+
this.#sidebarService.menuHeight = height;
|
|
1286
|
+
}
|
|
1287
|
+
constructor() {
|
|
1288
|
+
this.#sidebarService = inject(SidebarService);
|
|
1289
|
+
this.#stateService = inject(MenuStateService);
|
|
1290
|
+
this.menuItemsChange = new EventEmitter();
|
|
1291
|
+
this.selectedItemChange = new EventEmitter();
|
|
1292
|
+
this.expandedItemsChange = new EventEmitter();
|
|
1293
|
+
this.checkedItemsChange = new EventEmitter();
|
|
1294
|
+
this.expandChange = this.#stateService.expandEvents;
|
|
1295
|
+
this.checkChange = this.#stateService.checkEvents;
|
|
1296
|
+
this.itemReorder = this.#stateService.reorderEvents;
|
|
1297
|
+
this.itemSelect = this.#stateService.selectEvents;
|
|
1298
|
+
effect(() => this.menuItemsChange.emit(this.#stateService.menuItems()));
|
|
1299
|
+
effect(() => this.selectedItemChange.emit(this.#stateService.selectedItem()));
|
|
1300
|
+
effect(() => this.expandedItemsChange.emit(this.#stateService.expandedItems()));
|
|
1301
|
+
effect(() => this.checkedItemsChange.emit(this.#stateService.checkedItems()));
|
|
1302
|
+
}
|
|
1303
|
+
static {
|
|
1304
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1305
|
+
minVersion: "12.0.0",
|
|
1306
|
+
version: "22.2.2",
|
|
1307
|
+
ngImport: i0,
|
|
1308
|
+
type: SidebarMenuComponent,
|
|
1309
|
+
deps: [],
|
|
1310
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
static {
|
|
1314
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1315
|
+
minVersion: "14.0.0",
|
|
1316
|
+
version: "22.2.2",
|
|
1317
|
+
type: SidebarMenuComponent,
|
|
1318
|
+
isStandalone: true,
|
|
1319
|
+
selector: "kirby-x-sidebar-menu",
|
|
1320
|
+
inputs: {
|
|
1321
|
+
menuItems: "menuItems",
|
|
1322
|
+
selectedItem: "selectedItem",
|
|
1323
|
+
expandedItems: "expandedItems",
|
|
1324
|
+
checkedItems: "checkedItems",
|
|
1325
|
+
autoCollapse: "autoCollapse"
|
|
1326
|
+
},
|
|
1327
|
+
outputs: {
|
|
1328
|
+
menuItemsChange: "menuItemsChange",
|
|
1329
|
+
selectedItemChange: "selectedItemChange",
|
|
1330
|
+
expandedItemsChange: "expandedItemsChange",
|
|
1331
|
+
checkedItemsChange: "checkedItemsChange",
|
|
1332
|
+
expandChange: "expandChange",
|
|
1333
|
+
checkChange: "checkChange",
|
|
1334
|
+
itemReorder: "itemReorder",
|
|
1335
|
+
itemSelect: "itemSelect"
|
|
1336
|
+
},
|
|
1337
|
+
ngImport: i0,
|
|
1338
|
+
template: `
|
|
577
1339
|
<kirby-x-menu-container
|
|
578
1340
|
kirbyXHeightObserver
|
|
579
1341
|
(heightChange)="setMenuHeight($event)"
|
|
580
1342
|
></kirby-x-menu-container>
|
|
581
|
-
`,
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
1343
|
+
`,
|
|
1344
|
+
isInline: true,
|
|
1345
|
+
styles: [":host{display:flex;flex-direction:column;width:100%}\n"],
|
|
1346
|
+
dependencies: [{
|
|
1347
|
+
kind: "component",
|
|
1348
|
+
type: MenuContainerComponent,
|
|
1349
|
+
selector: "kirby-x-menu-container"
|
|
1350
|
+
}, {
|
|
1351
|
+
kind: "directive",
|
|
1352
|
+
type: HeightObserverDirective,
|
|
1353
|
+
selector: "[kirbyXHeightObserver]",
|
|
1354
|
+
outputs: ["heightChange"]
|
|
1355
|
+
}],
|
|
1356
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1360
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1361
|
+
minVersion: "12.0.0",
|
|
1362
|
+
version: "22.2.2",
|
|
1363
|
+
ngImport: i0,
|
|
1364
|
+
type: SidebarMenuComponent,
|
|
1365
|
+
decorators: [{
|
|
1366
|
+
type: Component,
|
|
1367
|
+
args: [{
|
|
1368
|
+
selector: "kirby-x-sidebar-menu",
|
|
1369
|
+
template: `
|
|
586
1370
|
<kirby-x-menu-container
|
|
587
1371
|
kirbyXHeightObserver
|
|
588
1372
|
(heightChange)="setMenuHeight($event)"
|
|
589
1373
|
></kirby-x-menu-container>
|
|
590
|
-
`,
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
1374
|
+
`,
|
|
1375
|
+
imports: [MenuContainerComponent, HeightObserverDirective],
|
|
1376
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
1377
|
+
styles: [":host{display:flex;flex-direction:column;width:100%}\n"]
|
|
1378
|
+
}]
|
|
1379
|
+
}],
|
|
1380
|
+
ctorParameters: () => [],
|
|
1381
|
+
propDecorators: {
|
|
1382
|
+
menuItems: [{ type: Input }],
|
|
1383
|
+
selectedItem: [{ type: Input }],
|
|
1384
|
+
expandedItems: [{ type: Input }],
|
|
1385
|
+
checkedItems: [{ type: Input }],
|
|
1386
|
+
autoCollapse: [{ type: Input }],
|
|
1387
|
+
menuItemsChange: [{ type: Output }],
|
|
1388
|
+
selectedItemChange: [{ type: Output }],
|
|
1389
|
+
expandedItemsChange: [{ type: Output }],
|
|
1390
|
+
checkedItemsChange: [{ type: Output }],
|
|
1391
|
+
expandChange: [{ type: Output }],
|
|
1392
|
+
checkChange: [{ type: Output }],
|
|
1393
|
+
itemReorder: [{ type: Output }],
|
|
1394
|
+
itemSelect: [{ type: Output }]
|
|
1395
|
+
}
|
|
1396
|
+
});
|
|
1397
|
+
var SidebarMenuLoaderComponent = class SidebarMenuLoaderComponent {
|
|
1398
|
+
static {
|
|
1399
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1400
|
+
minVersion: "12.0.0",
|
|
1401
|
+
version: "22.2.2",
|
|
1402
|
+
ngImport: i0,
|
|
1403
|
+
type: SidebarMenuLoaderComponent,
|
|
1404
|
+
deps: [],
|
|
1405
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
static {
|
|
1409
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1410
|
+
minVersion: "14.0.0",
|
|
1411
|
+
version: "22.2.2",
|
|
1412
|
+
type: SidebarMenuLoaderComponent,
|
|
1413
|
+
isStandalone: true,
|
|
1414
|
+
selector: "kirby-x-sidebar-menu-loader",
|
|
1415
|
+
ngImport: i0,
|
|
1416
|
+
template: "<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n",
|
|
1417
|
+
styles: [":host{display:flex;padding:0 var(--kirby-spacing-xxs, 8px);flex-direction:column;align-items:center;gap:var(--kirby-spacing-xxxs, 4px);flex:1 0 0;align-self:stretch}.skeleton-loader{height:var(--kirby-spacing-xl);align-self:stretch}\n"],
|
|
1418
|
+
dependencies: [{
|
|
1419
|
+
kind: "component",
|
|
1420
|
+
type: SkeletonLoaderComponent,
|
|
1421
|
+
selector: "kirby-x-skeleton-loader",
|
|
1422
|
+
inputs: ["theme", "shape"]
|
|
1423
|
+
}],
|
|
1424
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1429
|
+
minVersion: "12.0.0",
|
|
1430
|
+
version: "22.2.2",
|
|
1431
|
+
ngImport: i0,
|
|
1432
|
+
type: SidebarMenuLoaderComponent,
|
|
1433
|
+
decorators: [{
|
|
1434
|
+
type: Component,
|
|
1435
|
+
args: [{
|
|
1436
|
+
selector: "kirby-x-sidebar-menu-loader",
|
|
1437
|
+
imports: [SkeletonLoaderComponent],
|
|
1438
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
1439
|
+
template: "<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n<kirby-x-skeleton-loader theme=\"dark\" class=\"skeleton-loader\"></kirby-x-skeleton-loader>\n",
|
|
1440
|
+
styles: [":host{display:flex;padding:0 var(--kirby-spacing-xxs, 8px);flex-direction:column;align-items:center;gap:var(--kirby-spacing-xxxs, 4px);flex:1 0 0;align-self:stretch}.skeleton-loader{height:var(--kirby-spacing-xl);align-self:stretch}\n"]
|
|
1441
|
+
}]
|
|
1442
|
+
}]
|
|
1443
|
+
});
|
|
1444
|
+
var SidebarModule = class SidebarModule {
|
|
1445
|
+
static {
|
|
1446
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1447
|
+
minVersion: "12.0.0",
|
|
1448
|
+
version: "22.2.2",
|
|
1449
|
+
ngImport: i0,
|
|
1450
|
+
type: SidebarModule,
|
|
1451
|
+
deps: [],
|
|
1452
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
static {
|
|
1456
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1457
|
+
minVersion: "14.0.0",
|
|
1458
|
+
version: "22.2.2",
|
|
1459
|
+
ngImport: i0,
|
|
1460
|
+
type: SidebarModule,
|
|
1461
|
+
imports: [
|
|
1462
|
+
SidebarComponent,
|
|
1463
|
+
SidebarFooterComponent,
|
|
1464
|
+
SidebarHeaderComponent
|
|
1465
|
+
],
|
|
1466
|
+
exports: [
|
|
1467
|
+
SidebarComponent,
|
|
1468
|
+
SidebarFooterComponent,
|
|
1469
|
+
SidebarHeaderComponent
|
|
1470
|
+
]
|
|
1471
|
+
});
|
|
1472
|
+
}
|
|
1473
|
+
static {
|
|
1474
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
1475
|
+
minVersion: "12.0.0",
|
|
1476
|
+
version: "22.2.2",
|
|
1477
|
+
ngImport: i0,
|
|
1478
|
+
type: SidebarModule
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1483
|
+
minVersion: "12.0.0",
|
|
1484
|
+
version: "22.2.2",
|
|
1485
|
+
ngImport: i0,
|
|
1486
|
+
type: SidebarModule,
|
|
1487
|
+
decorators: [{
|
|
1488
|
+
type: NgModule,
|
|
1489
|
+
args: [{
|
|
1490
|
+
imports: [
|
|
1491
|
+
SidebarComponent,
|
|
1492
|
+
SidebarFooterComponent,
|
|
1493
|
+
SidebarHeaderComponent
|
|
1494
|
+
],
|
|
1495
|
+
exports: [
|
|
1496
|
+
SidebarComponent,
|
|
1497
|
+
SidebarFooterComponent,
|
|
1498
|
+
SidebarHeaderComponent
|
|
1499
|
+
]
|
|
1500
|
+
}]
|
|
1501
|
+
}]
|
|
1502
|
+
});
|
|
645
1503
|
export { SidebarComponent, SidebarFooterComponent, SidebarHeaderComponent, SidebarMenuComponent, SidebarMenuLoaderComponent, SidebarModule };
|
|
646
|
-
|
|
1504
|
+
|
|
1505
|
+
//# sourceMappingURL=kirbydesign-extensions-angular-sidebar-menu.mjs.map
|