@molecule/app-ui-angular 1.4.2 → 1.5.2
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/README.md +987 -1015
- package/dist/components/alert.component.d.ts +11 -16
- package/dist/components/alert.component.d.ts.map +1 -1
- package/dist/components/alert.component.js +22 -51
- package/dist/components/alert.component.js.map +1 -1
- package/dist/components/auth-guard.component.d.ts +36 -28
- package/dist/components/auth-guard.component.d.ts.map +1 -1
- package/dist/components/auth-guard.component.js +59 -67
- package/dist/components/auth-guard.component.js.map +1 -1
- package/dist/components/avatar.component.d.ts +13 -10
- package/dist/components/avatar.component.d.ts.map +1 -1
- package/dist/components/avatar.component.js +27 -25
- package/dist/components/avatar.component.js.map +1 -1
- package/dist/components/button.component.d.ts +26 -30
- package/dist/components/button.component.d.ts.map +1 -1
- package/dist/components/button.component.js +41 -75
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/checkbox.component.d.ts +5 -4
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.component.js +14 -9
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/confirm-button.component.d.ts +11 -28
- package/dist/components/confirm-button.component.d.ts.map +1 -1
- package/dist/components/confirm-button.component.js +31 -63
- package/dist/components/confirm-button.component.js.map +1 -1
- package/dist/components/confirm-dialog.component.d.ts +28 -17
- package/dist/components/confirm-dialog.component.d.ts.map +1 -1
- package/dist/components/confirm-dialog.component.js +98 -69
- package/dist/components/confirm-dialog.component.js.map +1 -1
- package/dist/components/dropdown.component.d.ts +29 -16
- package/dist/components/dropdown.component.d.ts.map +1 -1
- package/dist/components/dropdown.component.js +143 -105
- package/dist/components/dropdown.component.js.map +1 -1
- package/dist/components/empty-state.component.d.ts +10 -15
- package/dist/components/empty-state.component.d.ts.map +1 -1
- package/dist/components/empty-state.component.js +23 -27
- package/dist/components/empty-state.component.js.map +1 -1
- package/dist/components/form-field.component.d.ts +26 -11
- package/dist/components/form-field.component.d.ts.map +1 -1
- package/dist/components/form-field.component.js +86 -25
- package/dist/components/form-field.component.js.map +1 -1
- package/dist/components/input.component.d.ts +20 -23
- package/dist/components/input.component.d.ts.map +1 -1
- package/dist/components/input.component.js +45 -54
- package/dist/components/input.component.js.map +1 -1
- package/dist/components/language-picker.component.d.ts +15 -18
- package/dist/components/language-picker.component.d.ts.map +1 -1
- package/dist/components/language-picker.component.js +25 -35
- package/dist/components/language-picker.component.js.map +1 -1
- package/dist/components/load-error-banner.component.d.ts +14 -26
- package/dist/components/load-error-banner.component.d.ts.map +1 -1
- package/dist/components/load-error-banner.component.js +28 -62
- package/dist/components/load-error-banner.component.js.map +1 -1
- package/dist/components/modal.component.d.ts +38 -21
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +55 -78
- package/dist/components/modal.component.js.map +1 -1
- package/dist/components/molecule/button.component.d.ts +13 -2
- package/dist/components/molecule/button.component.d.ts.map +1 -1
- package/dist/components/molecule/button.component.js +45 -15
- package/dist/components/molecule/button.component.js.map +1 -1
- package/dist/components/molecule/toast.component.d.ts +2 -1
- package/dist/components/molecule/toast.component.d.ts.map +1 -1
- package/dist/components/molecule/toast.component.js +9 -7
- package/dist/components/molecule/toast.component.js.map +1 -1
- package/dist/components/molecule/tooltip.component.d.ts +4 -2
- package/dist/components/molecule/tooltip.component.d.ts.map +1 -1
- package/dist/components/molecule/tooltip.component.js +19 -14
- package/dist/components/molecule/tooltip.component.js.map +1 -1
- package/dist/components/optimistic-toggle-button.component.d.ts +13 -25
- package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -1
- package/dist/components/optimistic-toggle-button.component.js +33 -63
- package/dist/components/optimistic-toggle-button.component.js.map +1 -1
- package/dist/components/page-header.component.d.ts +8 -13
- package/dist/components/page-header.component.d.ts.map +1 -1
- package/dist/components/page-header.component.js +16 -24
- package/dist/components/page-header.component.js.map +1 -1
- package/dist/components/page-shell.component.d.ts +8 -14
- package/dist/components/page-shell.component.d.ts.map +1 -1
- package/dist/components/page-shell.component.js +18 -28
- package/dist/components/page-shell.component.js.map +1 -1
- package/dist/components/panel-close.component.d.ts +14 -8
- package/dist/components/panel-close.component.d.ts.map +1 -1
- package/dist/components/panel-close.component.js +28 -17
- package/dist/components/panel-close.component.js.map +1 -1
- package/dist/components/prompt-dialog.component.d.ts +32 -10
- package/dist/components/prompt-dialog.component.d.ts.map +1 -1
- package/dist/components/prompt-dialog.component.js +110 -73
- package/dist/components/prompt-dialog.component.js.map +1 -1
- package/dist/components/responsive-app-shell.component.d.ts +46 -41
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -1
- package/dist/components/responsive-app-shell.component.js +138 -147
- package/dist/components/responsive-app-shell.component.js.map +1 -1
- package/dist/components/sidebar-user-card.component.d.ts +8 -12
- package/dist/components/sidebar-user-card.component.d.ts.map +1 -1
- package/dist/components/sidebar-user-card.component.js +19 -35
- package/dist/components/sidebar-user-card.component.js.map +1 -1
- package/dist/components/switch.component.d.ts +13 -8
- package/dist/components/switch.component.d.ts.map +1 -1
- package/dist/components/switch.component.js +29 -20
- package/dist/components/switch.component.js.map +1 -1
- package/dist/components/table.component.d.ts +22 -14
- package/dist/components/table.component.d.ts.map +1 -1
- package/dist/components/table.component.js +34 -32
- package/dist/components/table.component.js.map +1 -1
- package/dist/components/toast.component.d.ts +34 -30
- package/dist/components/toast.component.d.ts.map +1 -1
- package/dist/components/toast.component.js +74 -84
- package/dist/components/toast.component.js.map +1 -1
- package/dist/components/tooltip.component.d.ts +27 -11
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +62 -47
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/components/user-menu-popover.component.d.ts +18 -12
- package/dist/components/user-menu-popover.component.d.ts.map +1 -1
- package/dist/components/user-menu-popover.component.js +52 -77
- package/dist/components/user-menu-popover.component.js.map +1 -1
- package/dist/components/user-menu.component.d.ts +8 -11
- package/dist/components/user-menu.component.d.ts.map +1 -1
- package/dist/components/user-menu.component.js +19 -27
- package/dist/components/user-menu.component.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/utilities/dom-context.d.ts +62 -15
- package/dist/utilities/dom-context.d.ts.map +1 -1
- package/dist/utilities/dom-context.js +79 -34
- package/dist/utilities/dom-context.js.map +1 -1
- package/dist/utilities/form-field-context.d.ts +2 -0
- package/dist/utilities/form-field-context.d.ts.map +1 -1
- package/dist/utilities/form-field-context.js +4 -2
- package/dist/utilities/form-field-context.js.map +1 -1
- package/dist/utilities/node-value.d.ts +8 -0
- package/dist/utilities/node-value.d.ts.map +1 -1
- package/dist/utilities/node-value.js +10 -0
- package/dist/utilities/node-value.js.map +1 -1
- package/dist/utilities/rest-attrs.d.ts +2 -2
- package/dist/utilities/rest-attrs.js +1 -1
- package/package.json +3 -3
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import { NgTemplateOutlet } from '@angular/common';
|
|
7
|
-
import { Component, ElementRef, EventEmitter, inject, Output,
|
|
8
|
-
import { useTranslation } from '@molecule/app-angular';
|
|
7
|
+
import { Component, ElementRef, EventEmitter, inject, Output, signal, TemplateRef, ViewChild, } from '@angular/core';
|
|
8
|
+
import { MolPlacement, setElementPresent, usePlacement, useTranslation, } from '@molecule/app-angular';
|
|
9
9
|
import { getClassMap } from '@molecule/app-ui';
|
|
10
10
|
import { fieldContext } from '../utilities/form-field-context.js';
|
|
11
11
|
import { nextInstanceId } from '../utilities/ids.js';
|
|
12
12
|
import { MolIconSvg, resolveIcon } from '../utilities/render-icon.js';
|
|
13
13
|
import { adoptHostDataMolId, moveRestAttributes, reapplyRestAttributes, } from '../utilities/rest-attrs.js';
|
|
14
14
|
import { styleText } from '../utilities/style.js';
|
|
15
|
-
import { hasNodes, SlotWrapper } from './button.component.js';
|
|
16
15
|
import * as i0 from "@angular/core";
|
|
16
|
+
import * as i1 from "@molecule/app-angular";
|
|
17
17
|
const _c0 = ["inputEl"];
|
|
18
18
|
const _c1 = ["leftSlot"];
|
|
19
19
|
const _c2 = ["rightSlot"];
|
|
@@ -99,8 +99,8 @@ function Input_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
|
99
99
|
*
|
|
100
100
|
* The adornment wrappers React renders conditionally
|
|
101
101
|
* (`{!!leftElement && <div …>}` / `{(rightElement || (clearable && value)) && …}`)
|
|
102
|
-
* are always-mounted `<ng-content>` capture points that are
|
|
103
|
-
* DOM whenever React would render nothing (
|
|
102
|
+
* are always-mounted `<ng-content>` capture points that are taken out of the
|
|
103
|
+
* DOM whenever React would render nothing (`setElementPresent`).
|
|
104
104
|
*/
|
|
105
105
|
export class Input {
|
|
106
106
|
/** Input type. */
|
|
@@ -175,6 +175,15 @@ export class Input {
|
|
|
175
175
|
/** The right adornment inner span (React's ternary else branch). */
|
|
176
176
|
rightInner;
|
|
177
177
|
host = inject(ElementRef);
|
|
178
|
+
/** Whether an adornment wrapper renders on each side (signals the class list reads). */
|
|
179
|
+
hasLeft = signal(false, /* @ts-ignore */
|
|
180
|
+
...(ngDevMode ? [{ debugName: "hasLeft" }] : /* istanbul ignore next */ []));
|
|
181
|
+
hasRight = signal(false, /* @ts-ignore */
|
|
182
|
+
...(ngDevMode ? [{ debugName: "hasRight" }] : /* istanbul ignore next */ []));
|
|
183
|
+
/** Attaches or detaches each adornment wrapper exactly when React renders it. */
|
|
184
|
+
constructor() {
|
|
185
|
+
usePlacement((hasContent) => this.syncAdornments(hasContent));
|
|
186
|
+
}
|
|
178
187
|
/** The per-instance id used when the caller gives no `id` or `name` (React's `useId`). */
|
|
179
188
|
generatedId = nextInstanceId();
|
|
180
189
|
/**
|
|
@@ -183,10 +192,6 @@ export class Input {
|
|
|
183
192
|
* does not).
|
|
184
193
|
*/
|
|
185
194
|
i18n = useTranslation();
|
|
186
|
-
sync = new SlotWrapper(inject(ElementRef), inject(Renderer2));
|
|
187
|
-
parents = new Map();
|
|
188
|
-
hasLeft = false;
|
|
189
|
-
hasRight = false;
|
|
190
195
|
movedRest = false;
|
|
191
196
|
/** The `aria-describedby` the caller spread onto the host (React's rest). */
|
|
192
197
|
restDescribedBy = null;
|
|
@@ -245,7 +250,7 @@ export class Input {
|
|
|
245
250
|
error: !!this.error,
|
|
246
251
|
size: this.size ?? 'md',
|
|
247
252
|
align: this.align === 'right' ? undefined : this.align,
|
|
248
|
-
}), this.hasLeft && this.cm().inputPadLeft, (this.hasRight || this.clearable) && this.cm().inputPadRight, this.className);
|
|
253
|
+
}), this.hasLeft() && this.cm().inputPadLeft, (this.hasRight() || this.clearable) && this.cm().inputPadRight, this.className);
|
|
249
254
|
}
|
|
250
255
|
/**
|
|
251
256
|
* The clear button's accessible label.
|
|
@@ -308,13 +313,32 @@ export class Input {
|
|
|
308
313
|
}, () => this.molId());
|
|
309
314
|
}
|
|
310
315
|
/**
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
* Attaches or detaches each adornment wrapper exactly when React renders
|
|
317
|
+
* it. The input's class list reads the presence signals, so the padding
|
|
318
|
+
* classes follow.
|
|
319
|
+
*
|
|
320
|
+
* @param hasContent - Reads whether a slot has content.
|
|
321
|
+
*/
|
|
322
|
+
syncAdornments(hasContent) {
|
|
323
|
+
// The placement function runs after the view exists (MolPlacement's
|
|
324
|
+
// after-view-init), so the view queries are set here.
|
|
325
|
+
const left = this.leftSlot?.nativeElement;
|
|
326
|
+
const right = this.rightSlot?.nativeElement;
|
|
327
|
+
const inner = this.rightInner?.nativeElement ??
|
|
328
|
+
(right ? right.querySelector('span') : null) ??
|
|
329
|
+
undefined;
|
|
330
|
+
const hasLeft = this.isGiven(this.leftElement) || hasContent(left);
|
|
331
|
+
const hasRight = this.isGiven(this.rightElement) || hasContent(inner);
|
|
332
|
+
this.hasLeft.set(hasLeft);
|
|
333
|
+
this.hasRight.set(hasRight);
|
|
334
|
+
const clear = !!(this.clearable && this.value);
|
|
335
|
+
setElementPresent(left, hasLeft);
|
|
336
|
+
setElementPresent(inner, hasRight && !clear);
|
|
337
|
+
setElementPresent(right, hasRight || clear);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Moves the caller's rest attributes onto the input and keeps its controlled
|
|
341
|
+
* value in step with the `value` input.
|
|
318
342
|
*/
|
|
319
343
|
ngDoCheck() {
|
|
320
344
|
// Registering this view against the locale: a switch marks it for check,
|
|
@@ -325,21 +349,6 @@ export class Input {
|
|
|
325
349
|
void this.i18n.locale();
|
|
326
350
|
const host = this.host.nativeElement;
|
|
327
351
|
const input = this.inputEl?.nativeElement ?? host.querySelector('input');
|
|
328
|
-
const left = this.leftSlot?.nativeElement ??
|
|
329
|
-
input?.previousElementSibling ??
|
|
330
|
-
undefined;
|
|
331
|
-
const right = this.rightSlot?.nativeElement ??
|
|
332
|
-
input?.nextElementSibling ??
|
|
333
|
-
undefined;
|
|
334
|
-
const inner = this.rightInner?.nativeElement ??
|
|
335
|
-
(right ? right.querySelector('span') : null) ??
|
|
336
|
-
undefined;
|
|
337
|
-
this.hasLeft = this.isGiven(this.leftElement) || hasNodes(left);
|
|
338
|
-
this.hasRight = this.isGiven(this.rightElement) || hasNodes(inner);
|
|
339
|
-
const clear = !!(this.clearable && this.value);
|
|
340
|
-
this.sync.sync(left, this.hasLeft, this.parentOf(left));
|
|
341
|
-
this.sync.sync(inner, this.hasRight && !clear, this.parentOf(inner));
|
|
342
|
-
this.sync.sync(right, this.hasRight || clear, this.parentOf(right));
|
|
343
352
|
if (!this.movedRest && input) {
|
|
344
353
|
this.restDescribedBy = host.getAttribute('aria-describedby');
|
|
345
354
|
this.movedRest = true;
|
|
@@ -360,25 +369,6 @@ export class Input {
|
|
|
360
369
|
if (this.value !== undefined && input && input.value !== String(this.value))
|
|
361
370
|
input.value = String(this.value);
|
|
362
371
|
}
|
|
363
|
-
/**
|
|
364
|
-
* Remembers where an element lives while connected, so a re-attach after a
|
|
365
|
-
* detach lands in the original parent (never the component host).
|
|
366
|
-
*
|
|
367
|
-
* @param el - The wrapper element.
|
|
368
|
-
* @returns The original parent, if known.
|
|
369
|
-
*/
|
|
370
|
-
parentOf(el) {
|
|
371
|
-
if (!el)
|
|
372
|
-
return undefined;
|
|
373
|
-
const cached = this.parents.get(el);
|
|
374
|
-
if (cached)
|
|
375
|
-
return cached;
|
|
376
|
-
if (el.parentElement) {
|
|
377
|
-
this.parents.set(el, el.parentElement);
|
|
378
|
-
return el.parentElement;
|
|
379
|
-
}
|
|
380
|
-
return undefined;
|
|
381
|
-
}
|
|
382
372
|
/**
|
|
383
373
|
* Casts a node-valued input to its TemplateRef form (the adapter projects
|
|
384
374
|
* node props as templates).
|
|
@@ -418,7 +408,7 @@ export class Input {
|
|
|
418
408
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rightInner = _t.first);
|
|
419
409
|
} }, hostVars: 2, hostBindings: function Input_HostBindings(rf, ctx) { if (rf & 2) {
|
|
420
410
|
i0.ɵɵclassMap(ctx.cm().inputWrapper);
|
|
421
|
-
} }, inputs: { type: "type", size: "size", align: "align", label: "label", error: "error", hint: "hint", leftElement: "leftElement", rightElement: "rightElement", clearable: "clearable", clearLabel: "clearLabel", className: "className", style: "style", testId: "testId", disabled: "disabled", required: "required", value: "value", defaultValue: "defaultValue", placeholder: "placeholder", name: "name", id: "id", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"], onFocus: "onFocus", onBlur: "onBlur", onKeyDown: "onKeyDown" }, outputs: { change: "change", clear: "clear" }, ngContentSelectors: _c5, decls: 19, vars: 28, consts: [["leftSlot", ""], ["inputEl", ""], ["rightSlot", ""], ["rightInner", ""], [3, "class"], [3, "ngTemplateOutlet"], [3, "input", "change", "focusin", "focusout", "keydown", "disabled"], ["type", "button", 3, "class"], ["type", "button", 3, "click"], ["mol-icon", "", 3, "data"]], template: function Input_Template(rf, ctx) { if (rf & 1) {
|
|
411
|
+
} }, inputs: { type: "type", size: "size", align: "align", label: "label", error: "error", hint: "hint", leftElement: "leftElement", rightElement: "rightElement", clearable: "clearable", clearLabel: "clearLabel", className: "className", style: "style", testId: "testId", disabled: "disabled", required: "required", value: "value", defaultValue: "defaultValue", placeholder: "placeholder", name: "name", id: "id", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"], onFocus: "onFocus", onBlur: "onBlur", onKeyDown: "onKeyDown" }, outputs: { change: "change", clear: "clear" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], ngContentSelectors: _c5, decls: 19, vars: 28, consts: [["leftSlot", ""], ["inputEl", ""], ["rightSlot", ""], ["rightInner", ""], [3, "class"], [3, "ngTemplateOutlet"], [3, "input", "change", "focusin", "focusout", "keydown", "disabled"], ["type", "button", 3, "class"], ["type", "button", 3, "click"], ["mol-icon", "", 3, "data"]], template: function Input_Template(rf, ctx) { if (rf & 1) {
|
|
422
412
|
i0.ɵɵprojectionDef(_c4);
|
|
423
413
|
i0.ɵɵconditionalCreate(0, Input_Conditional_0_Template, 2, 6, "label", 4);
|
|
424
414
|
i0.ɵɵelementStart(1, "div")(2, "div", null, 0);
|
|
@@ -469,6 +459,7 @@ export class Input {
|
|
|
469
459
|
args: [{
|
|
470
460
|
selector: 'div[mol-input]',
|
|
471
461
|
standalone: true,
|
|
462
|
+
hostDirectives: [MolPlacement],
|
|
472
463
|
imports: [MolIconSvg, NgTemplateOutlet],
|
|
473
464
|
inputs: [
|
|
474
465
|
'type',
|
|
@@ -565,7 +556,7 @@ export class Input {
|
|
|
565
556
|
<p [attr.id]="inputId() + '-hint'" [class]="cm().formHint">{{ hint }}</p>
|
|
566
557
|
}`,
|
|
567
558
|
}]
|
|
568
|
-
}],
|
|
559
|
+
}], () => [], { change: [{
|
|
569
560
|
type: Output
|
|
570
561
|
}], clear: [{
|
|
571
562
|
type: Output
|
|
@@ -582,5 +573,5 @@ export class Input {
|
|
|
582
573
|
type: ViewChild,
|
|
583
574
|
args: ['rightInner']
|
|
584
575
|
}] }); })();
|
|
585
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Input, { className: "Input", filePath: "components/input.component.ts", lineNumber:
|
|
576
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Input, { className: "Input", filePath: "components/input.component.ts", lineNumber: 154 }); })();
|
|
586
577
|
//# sourceMappingURL=input.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.component.js","sourceRoot":"","sources":["../../src/components/input.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAEL,SAAS,
|
|
1
|
+
{"version":3,"file":"input.component.js","sourceRoot":"","sources":["../../src/components/input.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAEL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,MAAM,EACN,MAAM,EACN,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,YAAY,EACZ,iBAAiB,EAEjB,YAAY,EACZ,cAAc,GACf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAI9C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAqB,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACxF,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;IAkD3C,6BAGG;IAAA,YAAW;IAAA,iBACb;;;IAFC,uHAAwE;;I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AK;cApGjB,SAAS;eAAC;gBACT,QAAQ,EAAE,gBAAgB;gBAC1B,UAAU,EAAE,IAAI;gBAChB,cAAc,EAAE,CAAC,YAAY,CAAC;gBAC9B,OAAO,EAAE,CAAC,UAAU,EAAE,gBAAgB,CAAC;gBACvC,MAAM,EAAE;oBACN,MAAM;oBACN,MAAM;oBACN,OAAO;oBACP,OAAO;oBACP,OAAO;oBACP,MAAM;oBACN,aAAa;oBACb,cAAc;oBACd,WAAW;oBACX,YAAY;oBACZ,WAAW;oBACX,OAAO;oBACP,QAAQ;oBACR,UAAU;oBACV,UAAU;oBACV,OAAO;oBACP,cAAc;oBACd,aAAa;oBACb,MAAM;oBACN,IAAI;oBACJ,cAAc;oBACd,wBAAwB;oBACxB,SAAS;oBACT,QAAQ;oBACR,WAAW;iBACZ;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,mBAAmB;iBAC/B;gBACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+DN;aACL;;kBAuDE,MAAM;;kBAEN,MAAM;;kBAKN,SAAS;mBAAC,SAAS;;kBAUnB,SAAS;mBAAC,UAAU;;kBAEpB,SAAS;mBAAC,WAAW;;kBAErB,SAAS;mBAAC,YAAY;;kFA3EZ,KAAK"}
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { ElementRef, TemplateRef } from '@angular/core';
|
|
8
8
|
import type { IconName } from '@molecule/app-icons';
|
|
9
9
|
import type { UIClassMap } from '@molecule/app-ui';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@molecule/app-angular";
|
|
11
12
|
/**
|
|
12
13
|
* Props for {@link LanguagePicker} (React's `LanguagePickerProps`, in
|
|
13
14
|
* Angular's form).
|
|
@@ -42,12 +43,14 @@ export interface LanguagePickerProps {
|
|
|
42
43
|
/**
|
|
43
44
|
* LanguagePicker component.
|
|
44
45
|
*
|
|
45
|
-
* React's root is a FRAGMENT (trigger button + locale modal), so
|
|
46
|
-
*
|
|
46
|
+
* React's root is a FRAGMENT (trigger button + locale modal), so everything
|
|
47
|
+
* the host holds renders in front of the host (`placeContentBefore`) and the
|
|
48
|
+
* host itself leaves the page: the rendered tree is React's, with no wrapper
|
|
49
|
+
* element around the trigger. Rest props (`title`,
|
|
47
50
|
* `data-*`, `aria-*`, native event handlers) are spread onto the trigger
|
|
48
51
|
* button in React; here they land on the host and are moved onto it.
|
|
49
52
|
*/
|
|
50
|
-
export declare class LanguagePicker
|
|
53
|
+
export declare class LanguagePicker {
|
|
51
54
|
/** i18n key for the trigger label / aria-label (default `footer.language`). */
|
|
52
55
|
labelKey?: LanguagePickerProps['labelKey'];
|
|
53
56
|
/** Fallback label if the i18n key is missing (default `Language`). */
|
|
@@ -84,8 +87,13 @@ export declare class LanguagePicker implements AfterViewInit, DoCheck {
|
|
|
84
87
|
*/
|
|
85
88
|
readonly i18n: import("@molecule/app-angular").UseTranslationResult;
|
|
86
89
|
private readonly host;
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Renders everything the host holds (the trigger, or the caller's
|
|
92
|
+
* `renderTrigger` output, and the locale modal) in front of the host, which
|
|
93
|
+
* leaves the page: React's root is a fragment. What the caller binds on the
|
|
94
|
+
* tag lands on the trigger button, React's `{...rest}` target.
|
|
95
|
+
*/
|
|
96
|
+
constructor();
|
|
89
97
|
/**
|
|
90
98
|
* The current class map.
|
|
91
99
|
* @returns The UIClassMap.
|
|
@@ -143,18 +151,7 @@ export declare class LanguagePicker implements AfterViewInit, DoCheck {
|
|
|
143
151
|
* @param code - The locale code.
|
|
144
152
|
*/
|
|
145
153
|
pick(code: string): Promise<void>;
|
|
146
|
-
/**
|
|
147
|
-
* Moves React's rest props (title, data-*, aria-*, native handlers) from
|
|
148
|
-
* the host onto the trigger button, and drops the capture wrapper.
|
|
149
|
-
*/
|
|
150
|
-
ngAfterViewInit(): void;
|
|
151
|
-
/**
|
|
152
|
-
* Re-applies rest attributes on later passes (a props step may add them).
|
|
153
|
-
*/
|
|
154
|
-
ngDoCheck(): void;
|
|
155
|
-
/** Moves any host rest attributes onto the trigger button. */
|
|
156
|
-
private syncRest;
|
|
157
154
|
static ɵfac: i0.ɵɵFactoryDeclaration<LanguagePicker, never>;
|
|
158
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LanguagePicker, "mol-language-picker", never, { "labelKey": { "alias": "labelKey"; "required": false; }; "labelDefault": { "alias": "labelDefault"; "required": false; }; "modalTitleKey": { "alias": "modalTitleKey"; "required": false; }; "modalTitleDefault": { "alias": "modalTitleDefault"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "display": { "alias": "display"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "renderTrigger": { "alias": "renderTrigger"; "required": false; }; }, {}, never, never, true,
|
|
155
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LanguagePicker, "mol-language-picker", never, { "labelKey": { "alias": "labelKey"; "required": false; }; "labelDefault": { "alias": "labelDefault"; "required": false; }; "modalTitleKey": { "alias": "modalTitleKey"; "required": false; }; "modalTitleDefault": { "alias": "modalTitleDefault"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "display": { "alias": "display"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "renderTrigger": { "alias": "renderTrigger"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
159
156
|
}
|
|
160
157
|
//# sourceMappingURL=language-picker.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language-picker.component.d.ts","sourceRoot":"","sources":["../../src/components/language-picker.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"language-picker.component.d.ts","sourceRoot":"","sources":["../../src/components/language-picker.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAa,UAAU,EAAkB,WAAW,EAAa,MAAM,eAAe,CAAA;AAU7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;;AAQlD;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,mEAAmE;IACnE,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IAClC,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,0EAA0E;IAC1E,aAAa,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CACrC;AAED;;;;;;;;;GASG;AACH,qBA4Da,cAAc;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAA;IAC1C,sEAAsE;IACtE,YAAY,CAAC,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAA;IAClD,0EAA0E;IAC1E,aAAa,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAA;IACpD,mFAAmF;IACnF,i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CAAA;KAAE,EAAE;IAIjD;;;OAGG;IACH,YAAY,IAAI,MAAM,GAAG,IAAI;IAO7B,8BAA8B;IAC9B,IAAI,IAAI,IAAI;IAIZ;;;OAGG;IACG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;yCA9J5B,cAAc;2CAAd,cAAc;CAkK1B"}
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { Component, ElementRef, inject,
|
|
8
|
-
import { useTranslation } from '@molecule/app-angular';
|
|
7
|
+
import { Component, ElementRef, inject, signal, TemplateRef, ViewChild } from '@angular/core';
|
|
8
|
+
import { MolPlacement, placeContentBefore, setElementPresent, setHostRoot, usePlacement, useTranslation, } from '@molecule/app-angular';
|
|
9
9
|
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
-
import { moveRestAttributes } from '../utilities/rest-attrs.js';
|
|
11
10
|
import { styleText } from '../utilities/style.js';
|
|
12
11
|
import { Icon } from './icon.component.js';
|
|
13
12
|
import { Modal } from './modal.component.js';
|
|
14
13
|
import { MolTemplateOutlet } from './template-outlet.directive.js';
|
|
15
14
|
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "@molecule/app-angular";
|
|
16
16
|
const _c0 = ["trigger"];
|
|
17
17
|
const _forTrack0 = ($index, $item) => $item.code;
|
|
18
18
|
function LanguagePicker_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -65,8 +65,10 @@ function LanguagePicker_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
65
65
|
/**
|
|
66
66
|
* LanguagePicker component.
|
|
67
67
|
*
|
|
68
|
-
* React's root is a FRAGMENT (trigger button + locale modal), so
|
|
69
|
-
*
|
|
68
|
+
* React's root is a FRAGMENT (trigger button + locale modal), so everything
|
|
69
|
+
* the host holds renders in front of the host (`placeContentBefore`) and the
|
|
70
|
+
* host itself leaves the page: the rendered tree is React's, with no wrapper
|
|
71
|
+
* element around the trigger. Rest props (`title`,
|
|
70
72
|
* `data-*`, `aria-*`, native event handlers) are spread onto the trigger
|
|
71
73
|
* button in React; here they land on the host and are moved onto it.
|
|
72
74
|
*/
|
|
@@ -111,8 +113,20 @@ export class LanguagePicker {
|
|
|
111
113
|
*/
|
|
112
114
|
i18n = useTranslation();
|
|
113
115
|
host = inject(ElementRef);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Renders everything the host holds (the trigger, or the caller's
|
|
118
|
+
* `renderTrigger` output, and the locale modal) in front of the host, which
|
|
119
|
+
* leaves the page: React's root is a fragment. What the caller binds on the
|
|
120
|
+
* tag lands on the trigger button, React's `{...rest}` target.
|
|
121
|
+
*/
|
|
122
|
+
constructor() {
|
|
123
|
+
usePlacement(() => {
|
|
124
|
+
const host = this.host.nativeElement;
|
|
125
|
+
placeContentBefore(host, host);
|
|
126
|
+
setElementPresent(host, false);
|
|
127
|
+
setHostRoot(host, this.trigger?.nativeElement);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
116
130
|
/**
|
|
117
131
|
* The current class map.
|
|
118
132
|
* @returns The UIClassMap.
|
|
@@ -199,34 +213,13 @@ export class LanguagePicker {
|
|
|
199
213
|
await this.i18n.setLocale(code);
|
|
200
214
|
this.isOpen.set(false);
|
|
201
215
|
}
|
|
202
|
-
/**
|
|
203
|
-
* Moves React's rest props (title, data-*, aria-*, native handlers) from
|
|
204
|
-
* the host onto the trigger button, and drops the capture wrapper.
|
|
205
|
-
*/
|
|
206
|
-
ngAfterViewInit() {
|
|
207
|
-
this.syncRest();
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Re-applies rest attributes on later passes (a props step may add them).
|
|
211
|
-
*/
|
|
212
|
-
ngDoCheck() {
|
|
213
|
-
this.syncRest();
|
|
214
|
-
}
|
|
215
|
-
/** Moves any host rest attributes onto the trigger button. */
|
|
216
|
-
syncRest() {
|
|
217
|
-
const trigger = this.trigger?.nativeElement;
|
|
218
|
-
if (!trigger || this.movedRest)
|
|
219
|
-
return;
|
|
220
|
-
moveRestAttributes(this.host.nativeElement, trigger);
|
|
221
|
-
this.movedRest = true;
|
|
222
|
-
}
|
|
223
216
|
static ɵfac = function LanguagePicker_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LanguagePicker)(); };
|
|
224
217
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LanguagePicker, selectors: [["mol-language-picker"]], viewQuery: function LanguagePicker_Query(rf, ctx) { if (rf & 1) {
|
|
225
218
|
i0.ɵɵviewQuery(_c0, 5);
|
|
226
219
|
} if (rf & 2) {
|
|
227
220
|
let _t;
|
|
228
221
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.trigger = _t.first);
|
|
229
|
-
} },
|
|
222
|
+
} }, inputs: { labelKey: "labelKey", labelDefault: "labelDefault", modalTitleKey: "modalTitleKey", modalTitleDefault: "modalTitleDefault", icon: "icon", iconSize: "iconSize", display: "display", className: "className", style: "style", renderTrigger: "renderTrigger" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], decls: 6, vars: 6, consts: [["trigger", ""], [3, "molTemplateOutlet", "molTemplateOutletContext"], ["type", "button", "data-mol-id", "language-picker-trigger", 3, "class", "style"], ["data-mol-id", "language-picker-modal", 3, "close", "open", "title", "size"], ["type", "button", 3, "class"], ["type", "button", "data-mol-id", "language-picker-trigger", 3, "click"], ["mol-icon-root", "", 3, "name", "size"], ["type", "button", 3, "click"]], template: function LanguagePicker_Template(rf, ctx) { if (rf & 1) {
|
|
230
223
|
i0.ɵɵconditionalCreate(0, LanguagePicker_Conditional_0_Template, 1, 2, "ng-container", 1)(1, LanguagePicker_Conditional_1_Template, 4, 8, "button", 2);
|
|
231
224
|
i0.ɵɵelementStart(2, "mol-modal", 3);
|
|
232
225
|
i0.ɵɵlistener("close", function LanguagePicker_Template_mol_modal_close_2_listener() { return ctx.isOpen.set(false); });
|
|
@@ -249,6 +242,7 @@ export class LanguagePicker {
|
|
|
249
242
|
args: [{
|
|
250
243
|
selector: 'mol-language-picker',
|
|
251
244
|
standalone: true,
|
|
245
|
+
hostDirectives: [MolPlacement],
|
|
252
246
|
imports: [Icon, Modal, MolTemplateOutlet],
|
|
253
247
|
inputs: [
|
|
254
248
|
'labelKey',
|
|
@@ -262,10 +256,6 @@ export class LanguagePicker {
|
|
|
262
256
|
'style',
|
|
263
257
|
'renderTrigger',
|
|
264
258
|
],
|
|
265
|
-
host: {
|
|
266
|
-
'data-parity-unwrap': '',
|
|
267
|
-
style: 'display: contents',
|
|
268
|
-
},
|
|
269
259
|
template: `@if (asTemplate(renderTrigger); as customTrigger) {
|
|
270
260
|
<ng-container
|
|
271
261
|
[molTemplateOutlet]="customTrigger"
|
|
@@ -309,9 +299,9 @@ export class LanguagePicker {
|
|
|
309
299
|
</div></mol-modal
|
|
310
300
|
>`,
|
|
311
301
|
}]
|
|
312
|
-
}],
|
|
302
|
+
}], () => [], { trigger: [{
|
|
313
303
|
type: ViewChild,
|
|
314
304
|
args: ['trigger']
|
|
315
305
|
}] }); })();
|
|
316
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LanguagePicker, { className: "LanguagePicker", filePath: "components/language-picker.component.ts", lineNumber:
|
|
306
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LanguagePicker, { className: "LanguagePicker", filePath: "components/language-picker.component.ts", lineNumber: 129 }); })();
|
|
317
307
|
//# sourceMappingURL=language-picker.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language-picker.component.js","sourceRoot":"","sources":["../../src/components/language-picker.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"language-picker.component.js","sourceRoot":"","sources":["../../src/components/language-picker.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAA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KAAK,CAAC,IAAI,CAAC,IAAY;QACrB,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAC/B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACxB,CAAC;wGAjKU,cAAc;6DAAd,cAAc;;;;;;YAtCrB,AALO,yFAAmD,6DAKnD;YAgBT,oCAMG;YAJD,8FAAS,eAAW,KAAK,CAAC,IAAC;YAI1B,2BAAiC;YAChC,oFAWC;YACG,AAAN,iBAAM,EACP;;;YAzCQ,gFAoBR;YAEC,eAAiB;YAGjB,AADA,AAFA,mCAAiB,2BAEK,cACT;YAEP,cAA2B;YAA3B,oCAA2B;YAC/B,cAWC;YAXD,cAAA,mBAAe,CAWd;4BApDG,IAAI,EAAE,KAAK,EAAE,iBAAiB;;iFAwD7B,cAAc;cA5D1B,SAAS;eAAC;gBACT,QAAQ,EAAE,qBAAqB;gBAC/B,UAAU,EAAE,IAAI;gBAChB,cAAc,EAAE,CAAC,YAAY,CAAC;gBAC9B,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC;gBACzC,MAAM,EAAE;oBACN,UAAU;oBACV,cAAc;oBACd,eAAe;oBACf,mBAAmB;oBACnB,MAAM;oBACN,UAAU;oBACV,SAAS;oBACT,WAAW;oBACX,OAAO;oBACP,eAAe;iBAChB;gBACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyCN;aACL;;kBAiCE,SAAS;mBAAC,SAAS;;kFAhCT,cAAc"}
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { type
|
|
7
|
+
import { type ElementRef, type TemplateRef } from '@angular/core';
|
|
8
8
|
import type { UIClassMap } from '@molecule/app-ui';
|
|
9
9
|
import { asTemplate, isGiven, nodeText } from '../utilities/node-value.js';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@molecule/app-angular";
|
|
11
12
|
/**
|
|
12
13
|
* Props for {@link LoadErrorBanner} (React's `LoadErrorBannerProps`, in
|
|
13
14
|
* Angular's form). Rest props (`data-*`, `aria-*`, `id`) land on the host, so
|
|
@@ -36,7 +37,7 @@ export interface LoadErrorBannerProps {
|
|
|
36
37
|
* as `[slot=message]` / `[slot=detail]` / `[slot=retryLabel]`. The detail
|
|
37
38
|
* paragraph and the retry row render only when React would render them.
|
|
38
39
|
*/
|
|
39
|
-
export declare class LoadErrorBanner
|
|
40
|
+
export declare class LoadErrorBanner {
|
|
40
41
|
/** The primary error line (node-valued prop). */
|
|
41
42
|
message?: LoadErrorBannerProps['message'];
|
|
42
43
|
/** Secondary line under the message (node-valued prop). */
|
|
@@ -69,12 +70,10 @@ export declare class LoadErrorBanner implements AfterViewInit, DoCheck, OnDestro
|
|
|
69
70
|
* does not).
|
|
70
71
|
*/
|
|
71
72
|
private readonly i18n;
|
|
72
|
-
|
|
73
|
-
private hasDetail;
|
|
74
|
-
/** Whether the projected retry label exists (a signal: it is read after view init). */
|
|
73
|
+
/** Whether the projected retry label exists (a signal the placement function sets). */
|
|
75
74
|
private readonly hasRetryLabel;
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
/** Reconciles the detail/retry wrappers and the projected retry label. */
|
|
76
|
+
constructor();
|
|
78
77
|
/**
|
|
79
78
|
* The current class map.
|
|
80
79
|
* @returns The UIClassMap.
|
|
@@ -102,34 +101,23 @@ export declare class LoadErrorBanner implements AfterViewInit, DoCheck, OnDestro
|
|
|
102
101
|
*/
|
|
103
102
|
handleRetry(): void;
|
|
104
103
|
/**
|
|
105
|
-
*
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
* Re-reconciles the conditional wrappers on later passes.
|
|
104
|
+
* Applies React's detail/retry conditions and moves the projected retry
|
|
105
|
+
* label onto the retry button.
|
|
106
|
+
*
|
|
107
|
+
* @param hasContent - Reads whether a slot has content.
|
|
110
108
|
*/
|
|
111
|
-
|
|
109
|
+
private reconcile;
|
|
112
110
|
/**
|
|
113
111
|
* Whether React would render the detail paragraph (a given node value or
|
|
114
112
|
* projected slot content).
|
|
113
|
+
*
|
|
114
|
+
* @param hasContent - Reads whether a slot has content.
|
|
115
115
|
* @returns True when the detail renders.
|
|
116
116
|
*/
|
|
117
117
|
private detailPresent;
|
|
118
|
-
/** Restores the retry-label capture span on unmount. */
|
|
119
|
-
ngOnDestroy(): void;
|
|
120
118
|
/** Moves the projected retry label onto the retry button (React: no wrapper). */
|
|
121
119
|
private showRetryLabel;
|
|
122
|
-
private visibleNodes;
|
|
123
|
-
private visibleFrom;
|
|
124
|
-
/**
|
|
125
|
-
* Shows one capture span's children inside a target element, parking any
|
|
126
|
-
* previously shown nodes back in their span.
|
|
127
|
-
*
|
|
128
|
-
* @param target - The element to show the nodes in.
|
|
129
|
-
* @param span - The capture span (null parks everything).
|
|
130
|
-
*/
|
|
131
|
-
private showNodes;
|
|
132
120
|
static ɵfac: i0.ɵɵFactoryDeclaration<LoadErrorBanner, never>;
|
|
133
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LoadErrorBanner, "div[mol-load-error-banner]", never, { "message": { "alias": "message"; "required": false; }; "detail": { "alias": "detail"; "required": false; }; "retryLabel": { "alias": "retryLabel"; "required": false; }; "retryMolId": { "alias": "retryMolId"; "required": false; }; "onRetry": { "alias": "onRetry"; "required": false; }; }, {}, never, ["[slot=message]", "[slot=detail]", "*", "[slot=retryLabel]"], true,
|
|
121
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LoadErrorBanner, "div[mol-load-error-banner]", never, { "message": { "alias": "message"; "required": false; }; "detail": { "alias": "detail"; "required": false; }; "retryLabel": { "alias": "retryLabel"; "required": false; }; "retryMolId": { "alias": "retryMolId"; "required": false; }; "onRetry": { "alias": "onRetry"; "required": false; }; }, {}, never, ["[slot=message]", "[slot=detail]", "*", "[slot=retryLabel]"], true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
134
122
|
}
|
|
135
123
|
//# sourceMappingURL=load-error-banner.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-error-banner.component.d.ts","sourceRoot":"","sources":["../../src/components/load-error-banner.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"load-error-banner.component.d.ts","sourceRoot":"","sources":["../../src/components/load-error-banner.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAa,KAAK,UAAU,EAAU,KAAK,WAAW,EAAa,MAAM,eAAe,CAAA;AAU/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;;;AAI1E;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAChD,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAC/C,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpC,0BAA0B;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IACnD,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;GAQG;AACH,qBAyCa,eAAe;IAC1B,iDAAiD;IACjD,OAAO,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAA;IACzC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,oBAAoB,C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