@molecule/app-settings-container-angular 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,303 @@
1
+ /**
2
+ * SettingsSection component (React parity).
3
+ *
4
+ * @module
5
+ */
6
+ import { NgTemplateOutlet } from '@angular/common';
7
+ import { Component, signal, ViewChild, } from '@angular/core';
8
+ import { getClassMap } from '@molecule/app-ui';
9
+ import { hasRenderableContent, hasText, isTemplate } from './slots.js';
10
+ import * as i0 from "@angular/core";
11
+ const _c0 = ["descriptionEl"];
12
+ const _c1 = ["footerEl"];
13
+ const _c2 = [[["", "slot", "title"]], "*", [["", "slot", "description"]], [["", "slot", "footer"]]];
14
+ const _c3 = ["[slot=title]", "*", "[slot=description]", "[slot=footer]"];
15
+ function SettingsSection_Conditional_3_Template(rf, ctx) { if (rf & 1) {
16
+ i0.ɵɵelementContainer(0, 2);
17
+ } if (rf & 2) {
18
+ i0.ɵɵproperty("ngTemplateOutlet", ctx);
19
+ } }
20
+ function SettingsSection_Conditional_4_Template(rf, ctx) { if (rf & 1) {
21
+ i0.ɵɵelementContainerStart(0);
22
+ i0.ɵɵtext(1);
23
+ i0.ɵɵelementContainerEnd();
24
+ } if (rf & 2) {
25
+ const ctx_r0 = i0.ɵɵnextContext();
26
+ i0.ɵɵadvance();
27
+ i0.ɵɵtextInterpolate(ctx_r0.textOf(ctx_r0.title));
28
+ } }
29
+ function SettingsSection_Conditional_6_Conditional_2_Template(rf, ctx) { if (rf & 1) {
30
+ i0.ɵɵelementContainer(0, 2);
31
+ } if (rf & 2) {
32
+ i0.ɵɵproperty("ngTemplateOutlet", ctx);
33
+ } }
34
+ function SettingsSection_Conditional_6_Conditional_3_Template(rf, ctx) { if (rf & 1) {
35
+ i0.ɵɵelementContainerStart(0);
36
+ i0.ɵɵtext(1);
37
+ i0.ɵɵelementContainerEnd();
38
+ } if (rf & 2) {
39
+ const ctx_r0 = i0.ɵɵnextContext(2);
40
+ i0.ɵɵadvance();
41
+ i0.ɵɵtextInterpolate(ctx_r0.textOf(ctx_r0.description));
42
+ } }
43
+ function SettingsSection_Conditional_6_Template(rf, ctx) { if (rf & 1) {
44
+ i0.ɵɵelementStart(0, "p", null, 0);
45
+ i0.ɵɵconditionalCreate(2, SettingsSection_Conditional_6_Conditional_2_Template, 1, 1, "ng-container", 2)(3, SettingsSection_Conditional_6_Conditional_3_Template, 2, 1, "ng-container");
46
+ i0.ɵɵprojection(4, 2);
47
+ i0.ɵɵelementEnd();
48
+ } if (rf & 2) {
49
+ let tmp_3_0;
50
+ const ctx_r0 = i0.ɵɵnextContext();
51
+ i0.ɵɵclassMap(ctx_r0.descriptionClasses());
52
+ i0.ɵɵadvance(2);
53
+ i0.ɵɵconditional((tmp_3_0 = ctx_r0.descriptionTemplate()) ? 2 : ctx_r0.hasDescriptionText() ? 3 : -1, tmp_3_0);
54
+ } }
55
+ function SettingsSection_Conditional_9_Conditional_2_Template(rf, ctx) { if (rf & 1) {
56
+ i0.ɵɵelementContainer(0, 2);
57
+ } if (rf & 2) {
58
+ i0.ɵɵproperty("ngTemplateOutlet", ctx);
59
+ } }
60
+ function SettingsSection_Conditional_9_Conditional_3_Template(rf, ctx) { if (rf & 1) {
61
+ i0.ɵɵelementContainerStart(0);
62
+ i0.ɵɵtext(1);
63
+ i0.ɵɵelementContainerEnd();
64
+ } if (rf & 2) {
65
+ const ctx_r0 = i0.ɵɵnextContext(2);
66
+ i0.ɵɵadvance();
67
+ i0.ɵɵtextInterpolate(ctx_r0.textOf(ctx_r0.footer));
68
+ } }
69
+ function SettingsSection_Conditional_9_Template(rf, ctx) { if (rf & 1) {
70
+ i0.ɵɵelementStart(0, "footer", null, 1);
71
+ i0.ɵɵconditionalCreate(2, SettingsSection_Conditional_9_Conditional_2_Template, 1, 1, "ng-container", 2)(3, SettingsSection_Conditional_9_Conditional_3_Template, 2, 1, "ng-container");
72
+ i0.ɵɵprojection(4, 3);
73
+ i0.ɵɵelementEnd();
74
+ } if (rf & 2) {
75
+ let tmp_3_0;
76
+ const ctx_r0 = i0.ɵɵnextContext();
77
+ i0.ɵɵclassMap(ctx_r0.footerClasses());
78
+ i0.ɵɵadvance(2);
79
+ i0.ɵɵconditional((tmp_3_0 = ctx_r0.footerTemplate()) ? 2 : ctx_r0.hasFooterText() ? 3 : -1, tmp_3_0);
80
+ } }
81
+ /**
82
+ * One configuration section inside a settings page.
83
+ *
84
+ * Card-wrapped, with a title / description header, body content and an
85
+ * optional footer action row. The host IS the Card `<div>`
86
+ * (`div[mol-settings-section]`), matching React's root exactly: the Card's
87
+ * `elevated` variant, `md` padding and the callers' `className` /
88
+ * `data-mol-id` are the host's. `title`, `description` and `footer` are
89
+ * projected content (`[slot=title]`, `[slot=description]`, `[slot=footer]`)
90
+ * or plain text; the optional regions render only when React would render
91
+ * them.
92
+ */
93
+ export class SettingsSection {
94
+ /** Section heading — a projected node template, or plain text. */
95
+ title;
96
+ /** Optional description under the heading — a projected node template, or plain text. */
97
+ description;
98
+ /** Section body, projected as the element's default content. */
99
+ children;
100
+ /** Optional footer row — a projected node template, or plain text. */
101
+ footer;
102
+ /** Extra classes on the Card. */
103
+ className;
104
+ /** `data-mol-id` for AI-agent selectors. */
105
+ dataMolId;
106
+ /** The optional description paragraph (projected content lands here; read once). */
107
+ descriptionEl;
108
+ /** The optional footer row (projected content lands here; read once). */
109
+ footerEl;
110
+ /** Whether a `[slot=description]` projection landed (`null`: decided by the text input). */
111
+ descriptionProjected = signal(true, /* @ts-ignore */
112
+ ...(ngDevMode ? [{ debugName: "descriptionProjected" }] : /* istanbul ignore next */ []));
113
+ /** Whether a `[slot=footer]` projection landed (`null`: decided by the text input). */
114
+ footerProjected = signal(true, /* @ts-ignore */
115
+ ...(ngDevMode ? [{ debugName: "footerProjected" }] : /* istanbul ignore next */ []));
116
+ /**
117
+ * Reads the optional regions' first render: when neither a text input nor
118
+ * projected content landed, React would not render the region at all, so the
119
+ * optimistic render is withdrawn.
120
+ */
121
+ ngAfterViewInit() {
122
+ this.descriptionProjected.set(this.hasDescriptionText() ? null : hasRenderableContent(this.descriptionEl?.nativeElement));
123
+ this.footerProjected.set(this.hasFooterText() ? null : hasRenderableContent(this.footerEl?.nativeElement));
124
+ }
125
+ /**
126
+ * The current class map.
127
+ * @returns The UIClassMap.
128
+ */
129
+ cm() {
130
+ return getClassMap();
131
+ }
132
+ /**
133
+ * Renders a text value the way React renders a node string.
134
+ * @param value - The prop value.
135
+ * @returns The text to render, or `''` when there is nothing.
136
+ */
137
+ textOf(value) {
138
+ return value === null || value === undefined ? '' : String(value);
139
+ }
140
+ /**
141
+ * The host's class list — Card's own computation with React's defaults
142
+ * (`elevated` variant, `md` padding) and the caller's `className`.
143
+ * @returns The class string.
144
+ */
145
+ classes() {
146
+ return this.cm().cn(this.cm().card({ variant: 'elevated' }), this.cm().cardPadding('md'), this.className);
147
+ }
148
+ /**
149
+ * The body stack's class (`cm.stack(4)`).
150
+ * @returns The class string.
151
+ */
152
+ innerClasses() {
153
+ return this.cm().stack(4);
154
+ }
155
+ /**
156
+ * The header's class (`cm.stack(1)`).
157
+ * @returns The class string.
158
+ */
159
+ headerClasses() {
160
+ return this.cm().stack(1);
161
+ }
162
+ /**
163
+ * The title's class list (`cm.cn(cm.textSize('lg'), cm.fontWeight('semibold'))`).
164
+ * @returns The class string.
165
+ */
166
+ titleClasses() {
167
+ return this.cm().cn(this.cm().textSize('lg'), this.cm().fontWeight('semibold'));
168
+ }
169
+ /**
170
+ * The description's class (`cm.textSize('sm')`).
171
+ * @returns The class string.
172
+ */
173
+ descriptionClasses() {
174
+ return this.cm().textSize('sm');
175
+ }
176
+ /**
177
+ * The footer row's class (`cm.flex({ justify: 'end', align: 'center', gap: 'sm' })`).
178
+ * @returns The class string.
179
+ */
180
+ footerClasses() {
181
+ return this.cm().flex({ justify: 'end', align: 'center', gap: 'sm' });
182
+ }
183
+ /**
184
+ * The title as a template, when the caller passed a node.
185
+ * @returns The title template, or null.
186
+ */
187
+ titleTemplate() {
188
+ return isTemplate(this.title) ? this.title : null;
189
+ }
190
+ /**
191
+ * The description as a template, when the caller passed a node.
192
+ * @returns The description template, or null.
193
+ */
194
+ descriptionTemplate() {
195
+ return isTemplate(this.description) ? this.description : null;
196
+ }
197
+ /**
198
+ * The footer as a template, when the caller passed a node.
199
+ * @returns The footer template, or null.
200
+ */
201
+ footerTemplate() {
202
+ return isTemplate(this.footer) ? this.footer : null;
203
+ }
204
+ /**
205
+ * Whether the title input renders as text (React renders strings and numbers).
206
+ * @returns True when the title is text.
207
+ */
208
+ hasTitleText() {
209
+ return typeof this.title === 'string' || typeof this.title === 'number';
210
+ }
211
+ /**
212
+ * Whether the description input renders as truthy text (React's `description && …`).
213
+ * @returns True when the description text renders.
214
+ */
215
+ hasDescriptionText() {
216
+ return hasText(this.description);
217
+ }
218
+ /**
219
+ * Whether the footer input renders as truthy text (React's `footer && …`).
220
+ * @returns True when the footer text renders.
221
+ */
222
+ hasFooterText() {
223
+ return hasText(this.footer);
224
+ }
225
+ /**
226
+ * Whether the description paragraph renders: React's `description && …` on
227
+ * the text input, a template, or projected content.
228
+ * @returns True when the paragraph shows.
229
+ */
230
+ showDescription() {
231
+ return (this.hasDescriptionText() ||
232
+ isTemplate(this.description) ||
233
+ this.descriptionProjected() === true);
234
+ }
235
+ /**
236
+ * Whether the footer row renders: React's `footer && …` on the text input, a
237
+ * template, or projected content.
238
+ * @returns True when the footer shows.
239
+ */
240
+ showFooter() {
241
+ return this.hasFooterText() || isTemplate(this.footer) || this.footerProjected() === true;
242
+ }
243
+ static ɵfac = function SettingsSection_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SettingsSection)(); };
244
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SettingsSection, selectors: [["div", "mol-settings-section", ""]], viewQuery: function SettingsSection_Query(rf, ctx) { if (rf & 1) {
245
+ i0.ɵɵviewQuery(_c0, 5)(_c1, 5);
246
+ } if (rf & 2) {
247
+ let _t;
248
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.descriptionEl = _t.first);
249
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.footerEl = _t.first);
250
+ } }, hostVars: 3, hostBindings: function SettingsSection_HostBindings(rf, ctx) { if (rf & 2) {
251
+ i0.ɵɵattribute("data-mol-id", ctx.dataMolId ?? null);
252
+ i0.ɵɵclassMap(ctx.classes());
253
+ } }, inputs: { title: "title", description: "description", footer: "footer", className: "className", dataMolId: "dataMolId" }, ngContentSelectors: _c3, decls: 10, vars: 9, consts: [["descriptionEl", ""], ["footerEl", ""], [3, "ngTemplateOutlet"], [3, "class"]], template: function SettingsSection_Template(rf, ctx) { if (rf & 1) {
254
+ i0.ɵɵprojectionDef(_c2);
255
+ i0.ɵɵelementStart(0, "div")(1, "header")(2, "h2");
256
+ i0.ɵɵconditionalCreate(3, SettingsSection_Conditional_3_Template, 1, 1, "ng-container", 2)(4, SettingsSection_Conditional_4_Template, 2, 1, "ng-container");
257
+ i0.ɵɵprojection(5);
258
+ i0.ɵɵelementEnd();
259
+ i0.ɵɵconditionalCreate(6, SettingsSection_Conditional_6_Template, 5, 3, "p", 3);
260
+ i0.ɵɵelementEnd();
261
+ i0.ɵɵelementStart(7, "div");
262
+ i0.ɵɵprojection(8, 1);
263
+ i0.ɵɵelementEnd();
264
+ i0.ɵɵconditionalCreate(9, SettingsSection_Conditional_9_Template, 5, 3, "footer", 3);
265
+ i0.ɵɵelementEnd();
266
+ } if (rf & 2) {
267
+ let tmp_3_0;
268
+ i0.ɵɵclassMap(ctx.innerClasses());
269
+ i0.ɵɵadvance();
270
+ i0.ɵɵclassMap(ctx.headerClasses());
271
+ i0.ɵɵadvance();
272
+ i0.ɵɵclassMap(ctx.titleClasses());
273
+ i0.ɵɵadvance();
274
+ i0.ɵɵconditional((tmp_3_0 = ctx.titleTemplate()) ? 3 : ctx.hasTitleText() ? 4 : -1, tmp_3_0);
275
+ i0.ɵɵadvance(3);
276
+ i0.ɵɵconditional(ctx.showDescription() ? 6 : -1);
277
+ i0.ɵɵadvance(3);
278
+ i0.ɵɵconditional(ctx.showFooter() ? 9 : -1);
279
+ } }, dependencies: [NgTemplateOutlet], encapsulation: 2 });
280
+ }
281
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SettingsSection, [{
282
+ type: Component,
283
+ args: [{
284
+ selector: 'div[mol-settings-section]',
285
+ standalone: true,
286
+ imports: [NgTemplateOutlet],
287
+ inputs: ['title', 'description', 'footer', 'className', 'dataMolId'],
288
+ host: {
289
+ '[class]': 'classes()',
290
+ '[attr.data-mol-id]': 'dataMolId ?? null',
291
+ },
292
+ // prettier-ignore
293
+ template: `<div [class]="innerClasses()"><header [class]="headerClasses()"><h2 [class]="titleClasses()">@if (titleTemplate(); as titleTpl) {<ng-container [ngTemplateOutlet]="titleTpl" />}@else if (hasTitleText()) {<ng-container>{{ textOf(title) }}</ng-container>}<ng-content select="[slot=title]"></ng-content></h2>@if (showDescription()) {<p #descriptionEl [class]="descriptionClasses()">@if (descriptionTemplate(); as descriptionTpl) {<ng-container [ngTemplateOutlet]="descriptionTpl" />}@else if (hasDescriptionText()) {<ng-container>{{ textOf(description) }}</ng-container>}<ng-content select="[slot=description]"></ng-content></p>}</header><div><ng-content></ng-content></div>@if (showFooter()) {<footer #footerEl [class]="footerClasses()">@if (footerTemplate(); as footerTpl) {<ng-container [ngTemplateOutlet]="footerTpl" />}@else if (hasFooterText()) {<ng-container>{{ textOf(footer) }}</ng-container>}<ng-content select="[slot=footer]"></ng-content></footer>}</div>`,
294
+ }]
295
+ }], null, { descriptionEl: [{
296
+ type: ViewChild,
297
+ args: ['descriptionEl']
298
+ }], footerEl: [{
299
+ type: ViewChild,
300
+ args: ['footerEl']
301
+ }] }); })();
302
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SettingsSection, { className: "SettingsSection", filePath: "settings-section.component.ts", lineNumber: 46 }); })();
303
+ //# sourceMappingURL=settings-section.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-section.component.js","sourceRoot":"","sources":["../src/settings-section.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAEL,SAAS,EAET,MAAM,EAEN,SAAS,GACV,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;;;;;;;IAwBwE,2BAA8C;;IAAhC,sCAA6B;;;IAA+B,6BAAc;IAAA,YAAmB;;;;IAAnB,cAAmB;IAAnB,iDAAmB;;;IAA8L,2BAAoD;;IAAtC,sCAAmC;;;IAAqC,6BAAc;IAAA,YAAyB;;;;IAAzB,cAAyB;IAAzB,uDAAyB;;;IAA9N,kCAAiD;IAAqG,AAArG,wGAAgD,+EAAsF;IAAuD,qBAAqD;IAAA,iBAAI;;;;IAArR,0CAA8B;IAAC,eAA6L;IAA7L,8GAA6L;;;IAA6M,2BAA+C;;IAAjC,sCAA8B;;;IAAgC,6BAAc;IAAA,YAAoB;;;;IAApB,cAAoB;IAApB,kDAAoB;;;IAAhM,uCAA4C;IAAsF,AAAtF,wGAAsC,+EAA4E;IAAkD,qBAAgD;IAAA,iBAAS;;;;IAAvP,qCAAyB;IAAC,eAAoK;IAApK,oGAAoK;;AAtB/4B;;;;;;;;;;;GAWG;AAaH,MAAM,OAAO,eAAe;IAC1B,kEAAkE;IAClE,KAAK,CAAU;IACf,yFAAyF;IACzF,WAAW,CAAU;IACrB,gEAAgE;IAChE,QAAQ,CAAU;IAClB,sEAAsE;IACtE,MAAM,CAAU;IAChB,iCAAiC;IACjC,SAAS,CAAS;IAClB,4CAA4C;IAC5C,SAAS,CAAS;IAElB,oFAAoF;IAChD,aA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,EAAE,o8BAAo8B;aAC/8B;;kBAgBE,SAAS;mBAAC,eAAe;;kBAEzB,SAAS;mBAAC,UAAU;;kFAjBV,eAAe"}
@@ -0,0 +1,110 @@
1
+ import { type AfterViewInit, type TemplateRef } from '@angular/core';
2
+ import type { UIClassMap } from '@molecule/app-ui';
3
+ import type { SettingsSidebarItem } from './types.js';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Vertical side-nav for settings pages.
7
+ *
8
+ * Controlled — the caller owns `activeId`; every item calls `onSelect` with
9
+ * its id. The host IS the `<nav>` (`nav[mol-settings-sidebar]`), matching
10
+ * React's root exactly, including the region name: the default `aria-label`
11
+ * resolves through `t()` with the `settingsContainer.aria.settings` key, so it
12
+ * follows the active locale; `ariaLabel` overrides it. An item's `label` and
13
+ * `icon` are projected node templates or plain text; the optional `footer` is
14
+ * `[slot=footer]` content or text, and renders only when React would render it.
15
+ */
16
+ export declare class SettingsSidebar implements AfterViewInit {
17
+ /** Items to render, in order. */
18
+ items: SettingsSidebarItem[];
19
+ /** The id of the active item (controlled — the caller owns it). */
20
+ activeId?: string;
21
+ /** Called with the clicked item's id. */
22
+ onSelect?: (id: string) => void;
23
+ /** Optional footer — a template, `[slot=footer]` content, or plain text. */
24
+ footer?: unknown;
25
+ /** Accessible label override; defaults to `t('settingsContainer.aria.settings', …)`. */
26
+ ariaLabel?: string;
27
+ /** Extra classes. */
28
+ className?: string;
29
+ /** The optional footer container (projected content lands here; read once). */
30
+ private footerEl?;
31
+ /** Whether a `[slot=footer]` projection landed (`null`: decided by the text input). */
32
+ private readonly footerProjected;
33
+ /** The i18n provider access (locale-reactive through the notifications signal). */
34
+ private readonly i18n;
35
+ /**
36
+ * Reads the optional footer's first render: when neither text nor projected
37
+ * content landed, React would not render it at all, so the optimistic render
38
+ * is withdrawn.
39
+ */
40
+ ngAfterViewInit(): void;
41
+ /**
42
+ * The current class map.
43
+ * @returns The UIClassMap.
44
+ */
45
+ cm(): UIClassMap;
46
+ /**
47
+ * Renders a text value the way React renders a node string.
48
+ * @param value - The prop value.
49
+ * @returns The text to render, or `''` when there is nothing.
50
+ */
51
+ textOf(value: unknown): string;
52
+ /**
53
+ * Whether a value renders as text (React renders strings and numbers).
54
+ * @param value - The prop value.
55
+ * @returns True when the value renders as text.
56
+ */
57
+ isText(value: unknown): boolean;
58
+ /**
59
+ * A data value's node template, when it is one.
60
+ * @param value - The prop value.
61
+ * @returns The template, or null.
62
+ */
63
+ templateOf(value: unknown): TemplateRef<unknown> | null;
64
+ /**
65
+ * The nav's class list (React's `cm.cn(cm.stack(1), className)`).
66
+ * @returns The class string.
67
+ */
68
+ classes(): string;
69
+ /**
70
+ * The nav's accessible name (React's
71
+ * `ariaLabel ?? t('settingsContainer.aria.settings', …)`).
72
+ * @returns The label text.
73
+ */
74
+ navLabel(): string;
75
+ /**
76
+ * One item's button class list, with React's active/inactive weight branch.
77
+ * @param item - The item.
78
+ * @returns The class string.
79
+ */
80
+ itemClasses(item: SettingsSidebarItem): string;
81
+ /**
82
+ * The footer container's class (`cm.sp('mt', 4)`).
83
+ * @returns The class string.
84
+ */
85
+ footerClasses(): string;
86
+ /**
87
+ * The footer as a template, when the caller passed a node.
88
+ * @returns The footer template, or null.
89
+ */
90
+ footerTemplate(): TemplateRef<unknown> | null;
91
+ /**
92
+ * Whether the footer input renders as truthy text (React's `footer && …`).
93
+ * @returns True when the footer text renders.
94
+ */
95
+ hasFooterText(): boolean;
96
+ /**
97
+ * Whether the footer renders: React's `footer && …` on the text input, a
98
+ * template, or projected content.
99
+ * @returns True when the footer shows.
100
+ */
101
+ showFooter(): boolean;
102
+ /**
103
+ * Activates an item (React's `onClick={() => onSelect(item.id)}`).
104
+ * @param item - The clicked item.
105
+ */
106
+ select(item: SettingsSidebarItem): void;
107
+ static ɵfac: i0.ɵɵFactoryDeclaration<SettingsSidebar, never>;
108
+ static ɵcmp: i0.ɵɵComponentDeclaration<SettingsSidebar, "nav[mol-settings-sidebar]", never, { "items": { "alias": "items"; "required": false; }; "activeId": { "alias": "activeId"; "required": false; }; "onSelect": { "alias": "onSelect"; "required": false; }; "footer": { "alias": "footer"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, ["[slot=footer]"], true, never>;
109
+ }
110
+ //# sourceMappingURL=settings-sidebar.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-sidebar.component.d.ts","sourceRoot":"","sources":["../src/settings-sidebar.component.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,aAAa,EAIlB,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;;AAErD;;;;;;;;;;GAUG;AACH,qBAYa,eAAgB,YAAW,aAAa;IACnD,iCAAiC;IACjC,KAAK,EAAE,mBAAmB,EAAE,CAAK;IACjC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,+EAA+E;IACxD,OAAO,CAAC,QAAQ,CAAC,CAAyB;IAEjE,uFAAuF;IACvF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+B;IAE/D,mFAAmF;IACnF,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IAExC;;;;OAIG;IACH,eAAe,IAAI,IAAI;IAMvB;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;IAI9B;;;;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