@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
|
@@ -8,6 +8,7 @@ import type { FocusEventHandler, KeyboardEventHandler, MouseEventHandler, UIClas
|
|
|
8
8
|
import type { HasElement } from '../utilities/element.js';
|
|
9
9
|
import type { FormFieldContext } from '../utilities/form-field-context.js';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@molecule/app-angular";
|
|
11
12
|
/**
|
|
12
13
|
* Checkbox component.
|
|
13
14
|
*
|
|
@@ -76,9 +77,10 @@ export declare class Checkbox implements AfterViewChecked, HasElement<HTMLInputE
|
|
|
76
77
|
private restDescribedByCaptured;
|
|
77
78
|
/** The `data-mol-id` a caller bound on the host (React spreads it onto the input). */
|
|
78
79
|
private externalMolId;
|
|
79
|
-
private readonly sync;
|
|
80
80
|
private hasLabel;
|
|
81
81
|
private syncIndeterminate;
|
|
82
|
+
/** Applies React's `{!!label && <span>}` label condition. */
|
|
83
|
+
constructor();
|
|
82
84
|
/**
|
|
83
85
|
* The current class map.
|
|
84
86
|
* @returns The UIClassMap.
|
|
@@ -141,11 +143,10 @@ export declare class Checkbox implements AfterViewChecked, HasElement<HTMLInputE
|
|
|
141
143
|
handleChange(event: Event): void;
|
|
142
144
|
private justClicked;
|
|
143
145
|
/**
|
|
144
|
-
* Applies the indeterminate DOM flag (a property, not an attribute)
|
|
145
|
-
* React's `{!!label && <span>}` label condition.
|
|
146
|
+
* Applies the indeterminate DOM flag (a property, not an attribute).
|
|
146
147
|
*/
|
|
147
148
|
ngAfterViewChecked(): void;
|
|
148
149
|
static ɵfac: i0.ɵɵFactoryDeclaration<Checkbox, never>;
|
|
149
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Checkbox, "div[mol-checkbox]", never, { "label": { "alias": "label"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "size": { "alias": "size"; "required": false; }; "error": { "alias": "error"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; "onClick": { "alias": "onClick"; "required": false; }; "onFocus": { "alias": "onFocus"; "required": false; }; "onBlur": { "alias": "onBlur"; "required": false; }; "onKeyDown": { "alias": "onKeyDown"; "required": false; }; }, { "change": "change"; }, never, ["[slot=label]"], true,
|
|
150
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Checkbox, "div[mol-checkbox]", never, { "label": { "alias": "label"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "size": { "alias": "size"; "required": false; }; "error": { "alias": "error"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "defaultChecked": { "alias": "defaultChecked"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; "onClick": { "alias": "onClick"; "required": false; }; "onFocus": { "alias": "onFocus"; "required": false; }; "onBlur": { "alias": "onBlur"; "required": false; }; "onKeyDown": { "alias": "onKeyDown"; "required": false; }; }, { "change": "change"; }, never, ["[slot=label]"], true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
150
151
|
}
|
|
151
152
|
//# sourceMappingURL=checkbox.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.component.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EAErB,UAAU,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"checkbox.component.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EAErB,UAAU,EACV,YAAY,EAKb,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACX,MAAM,kBAAkB,CAAA;AAGzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;;;AAO1E;;;;;;;GAOG;AACH,qBA0Da,QAAS,YAAW,gBAAgB,EAAE,UAAU,CAAC,gBAAgB,CAAC;IAC7E,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sDAAs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AO,CAAC,uBAAuB,CAAQ;IACvC,sFAAsF;IACtF,OAAO,CAAC,aAAa,CAAoB;IACzC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,iBAAiB,CAAQ;IAEjC,6DAA6D;;IAQ7D;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,UAAU,IAAI,MAAM,GAAG,SAAS;IAIhC;;;;OAIG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,YAAY,IAAI,gBAAgB,GAAG,IAAI;IAIvC;;;;OAIG;IACH,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAQlC;;;OAGG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B;;;OAGG;IACH,KAAK,IAAI,MAAM,GAAG,SAAS;IAI3B;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAOpC;;;;;;;;OAQG;IACH,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAMhC,OAAO,CAAC,WAAW,CAAQ;IAE3B;;OAEG;IACH,kBAAkB,IAAI,IAAI;yCA1Lf,QAAQ;2CAAR,QAAQ;CAgNpB"}
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { Component, ElementRef, EventEmitter, inject, Output,
|
|
6
|
+
import { Component, ElementRef, EventEmitter, inject, Output, signal, ViewChild, } from '@angular/core';
|
|
7
|
+
import { MolPlacement, setElementPresent, usePlacement } from '@molecule/app-angular';
|
|
7
8
|
import { getClassMap } from '@molecule/app-ui';
|
|
8
9
|
import { fieldContext } from '../utilities/form-field-context.js';
|
|
9
10
|
import { nextInstanceId } from '../utilities/ids.js';
|
|
10
11
|
import { adoptHostDataMolId, moveRestAttributes } from '../utilities/rest-attrs.js';
|
|
11
12
|
import { styleText } from '../utilities/style.js';
|
|
12
|
-
import { hasNodes, SlotWrapper } from './button.component.js';
|
|
13
13
|
import { MolControlledChecked } from './controlled-checked.directive.js';
|
|
14
14
|
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "@molecule/app-angular";
|
|
15
16
|
const _c0 = ["input"];
|
|
16
17
|
const _c1 = ["labelSlot"];
|
|
17
18
|
const _c2 = [[["", "slot", "label"]]];
|
|
@@ -99,9 +100,15 @@ export class Checkbox {
|
|
|
99
100
|
restDescribedByCaptured = false;
|
|
100
101
|
/** The `data-mol-id` a caller bound on the host (React spreads it onto the input). */
|
|
101
102
|
externalMolId;
|
|
102
|
-
sync = new SlotWrapper(inject(ElementRef), inject(Renderer2));
|
|
103
103
|
hasLabel = false;
|
|
104
104
|
syncIndeterminate = false;
|
|
105
|
+
/** Applies React's `{!!label && <span>}` label condition. */
|
|
106
|
+
constructor() {
|
|
107
|
+
usePlacement((hasContent) => {
|
|
108
|
+
this.hasLabel = !!this.label || hasContent(this.labelSlot?.nativeElement);
|
|
109
|
+
setElementPresent(this.labelSlot?.nativeElement, this.hasLabel);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
105
112
|
/**
|
|
106
113
|
* The current class map.
|
|
107
114
|
* @returns The UIClassMap.
|
|
@@ -193,8 +200,7 @@ export class Checkbox {
|
|
|
193
200
|
}
|
|
194
201
|
justClicked = false;
|
|
195
202
|
/**
|
|
196
|
-
* Applies the indeterminate DOM flag (a property, not an attribute)
|
|
197
|
-
* React's `{!!label && <span>}` label condition.
|
|
203
|
+
* Applies the indeterminate DOM flag (a property, not an attribute).
|
|
198
204
|
*/
|
|
199
205
|
ngAfterViewChecked() {
|
|
200
206
|
const input = this.input?.nativeElement;
|
|
@@ -212,8 +218,6 @@ export class Checkbox {
|
|
|
212
218
|
this.syncIndeterminate = !!this.indeterminate;
|
|
213
219
|
}
|
|
214
220
|
}
|
|
215
|
-
this.hasLabel = !!this.label || hasNodes(this.labelSlot?.nativeElement);
|
|
216
|
-
this.sync.sync(this.labelSlot?.nativeElement, this.hasLabel, this.labelSlot?.nativeElement.parentElement ?? undefined);
|
|
217
221
|
}
|
|
218
222
|
static ɵfac = function Checkbox_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Checkbox)(); };
|
|
219
223
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Checkbox, selectors: [["div", "mol-checkbox", ""]], viewQuery: function Checkbox_Query(rf, ctx) { if (rf & 1) {
|
|
@@ -224,7 +228,7 @@ export class Checkbox {
|
|
|
224
228
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.labelSlot = _t.first);
|
|
225
229
|
} }, hostVars: 2, hostBindings: function Checkbox_HostBindings(rf, ctx) { if (rf & 2) {
|
|
226
230
|
i0.ɵɵclassMap(ctx.cm().formFieldWrapper);
|
|
227
|
-
} }, inputs: { label: "label", checked: "checked", indeterminate: "indeterminate", size: "size", error: "error", className: "className", style: "style", testId: "testId", disabled: "disabled", name: "name", id: "id", defaultChecked: "defaultChecked", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"], onClick: "onClick", onFocus: "onFocus", onBlur: "onBlur", onKeyDown: "onKeyDown" }, outputs: { change: "change" }, ngContentSelectors: _c3, decls: 8, vars: 19, consts: [["input", ""], ["labelSlot", ""], ["type", "checkbox", 3, "click", "change", "focusin", "focusout", "keydown", "molChecked", "molDefaultChecked", "disabled"], [3, "class"]], template: function Checkbox_Template(rf, ctx) { if (rf & 1) {
|
|
231
|
+
} }, inputs: { label: "label", checked: "checked", indeterminate: "indeterminate", size: "size", error: "error", className: "className", style: "style", testId: "testId", disabled: "disabled", name: "name", id: "id", defaultChecked: "defaultChecked", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"], onClick: "onClick", onFocus: "onFocus", onBlur: "onBlur", onKeyDown: "onKeyDown" }, outputs: { change: "change" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], ngContentSelectors: _c3, decls: 8, vars: 19, consts: [["input", ""], ["labelSlot", ""], ["type", "checkbox", 3, "click", "change", "focusin", "focusout", "keydown", "molChecked", "molDefaultChecked", "disabled"], [3, "class"]], template: function Checkbox_Template(rf, ctx) { if (rf & 1) {
|
|
228
232
|
i0.ɵɵprojectionDef(_c2);
|
|
229
233
|
i0.ɵɵelementStart(0, "label")(1, "input", 2, 0);
|
|
230
234
|
i0.ɵɵlistener("click", function Checkbox_Template_input_click_1_listener($event) { return ctx.handleClick($event); })("change", function Checkbox_Template_input_change_1_listener($event) { return ctx.handleChange($event); })("focusin", function Checkbox_Template_input_focusin_1_listener($event) { return ctx.onFocus?.($event); })("focusout", function Checkbox_Template_input_focusout_1_listener($event) { return ctx.onBlur?.($event); })("keydown", function Checkbox_Template_input_keydown_1_listener($event) { return ctx.onKeyDown?.($event); });
|
|
@@ -253,6 +257,7 @@ export class Checkbox {
|
|
|
253
257
|
args: [{
|
|
254
258
|
selector: 'div[mol-checkbox]',
|
|
255
259
|
standalone: true,
|
|
260
|
+
hostDirectives: [MolPlacement],
|
|
256
261
|
imports: [MolControlledChecked],
|
|
257
262
|
inputs: [
|
|
258
263
|
'label',
|
|
@@ -307,7 +312,7 @@ export class Checkbox {
|
|
|
307
312
|
<p [attr.id]="errorId()" [class]="cm().cn(cm().formError, cm().sp('mt', 1))">{{ error }}</p>
|
|
308
313
|
}`,
|
|
309
314
|
}]
|
|
310
|
-
}],
|
|
315
|
+
}], () => [], { change: [{
|
|
311
316
|
type: Output
|
|
312
317
|
}], inputQuery: [{
|
|
313
318
|
type: ViewChild,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.component.js","sourceRoot":"","sources":["../../src/components/checkbox.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"checkbox.component.js","sourceRoot":"","sources":["../../src/components/checkbox.component.ts"],"names":[],"mappings":"AAAA;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
import { ElementRef, type OnDestroy, type TemplateRef } from '@angular/core';
|
|
7
7
|
import type { ButtonVariant, ColorVariant, Size, UIClassMap } from '@molecule/app-ui';
|
|
8
8
|
import { type HasElement } from '../utilities/element.js';
|
|
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 ConfirmButton} (React's `ConfirmButtonProps`, in Angular's
|
|
13
14
|
* form).
|
|
@@ -62,7 +63,7 @@ export interface ConfirmButtonProps {
|
|
|
62
63
|
* the slot for the armed/pending phase is given, the localized default text
|
|
63
64
|
* renders instead (React's `confirmLabel ?? t(…)`).
|
|
64
65
|
*/
|
|
65
|
-
export declare class ConfirmButton implements
|
|
66
|
+
export declare class ConfirmButton implements OnDestroy, HasElement<HTMLButtonElement> {
|
|
66
67
|
/** Button variant (passed through to the button classes). */
|
|
67
68
|
variant?: ConfirmButtonProps['variant'];
|
|
68
69
|
/** Button color; the armed state always shows the error color. */
|
|
@@ -107,19 +108,16 @@ export declare class ConfirmButton implements AfterViewInit, DoCheck, OnDestroy,
|
|
|
107
108
|
confirmSlot?: ElementRef<HTMLSpanElement>;
|
|
108
109
|
/** The pending-state label capture span. */
|
|
109
110
|
pendingSlot?: ElementRef<HTMLSpanElement>;
|
|
110
|
-
/** Whether the armed label slot carries content (
|
|
111
|
-
hasConfirmLabel: boolean
|
|
112
|
-
/** Whether the pending label slot carries content (
|
|
113
|
-
hasPendingLabel: boolean
|
|
111
|
+
/** Whether the armed label slot carries content (a signal the template reads). */
|
|
112
|
+
readonly hasConfirmLabel: import("@angular/core").WritableSignal<boolean>;
|
|
113
|
+
/** Whether the pending label slot carries content (a signal the template reads). */
|
|
114
|
+
readonly hasPendingLabel: import("@angular/core").WritableSignal<boolean>;
|
|
114
115
|
/** The current phase: idle → armed → pending → idle. */
|
|
115
116
|
readonly phase: import("@angular/core").WritableSignal<"idle" | "armed" | "pending">;
|
|
116
117
|
private readonly el;
|
|
117
118
|
/** The element a caller's ref receives: the host `<button>`. */
|
|
118
119
|
readonly element: import("@angular/core").Signal<HTMLButtonElement | null>;
|
|
119
|
-
private readonly renderer;
|
|
120
|
-
private readonly sync;
|
|
121
120
|
private disarmTimer;
|
|
122
|
-
private anchor;
|
|
123
121
|
/**
|
|
124
122
|
* Arms the auto-disarm timer for the armed phase (React's `useEffect` on
|
|
125
123
|
* `[phase, disarmSeconds]`).
|
|
@@ -159,22 +157,13 @@ export declare class ConfirmButton implements AfterViewInit, DoCheck, OnDestroy,
|
|
|
159
157
|
* React's `disarm`: cancels the timer and returns to idle.
|
|
160
158
|
*/
|
|
161
159
|
private disarm;
|
|
162
|
-
/**
|
|
163
|
-
* Reads slot presence at view init (view queries resolve only then) and
|
|
164
|
-
* takes the capture spans out of the DOM.
|
|
165
|
-
*/
|
|
166
|
-
ngAfterViewInit(): void;
|
|
167
|
-
/**
|
|
168
|
-
* Re-reconciles the visible label on every pass (phase changes and later
|
|
169
|
-
* `props` steps both go through a refresh).
|
|
170
|
-
*/
|
|
171
|
-
ngDoCheck(): void;
|
|
172
|
-
/** The nodes currently shown on the button, and the slot they came from. */
|
|
173
|
-
private visibleNodes;
|
|
160
|
+
/** The slot whose content is currently shown on the button. */
|
|
174
161
|
private visibleFrom;
|
|
175
162
|
/**
|
|
176
163
|
* Shows exactly the visible phase's projected children on the button —
|
|
177
164
|
* React renders exactly one label and no wrapper element.
|
|
165
|
+
*
|
|
166
|
+
* @param hasContent - Reads whether a slot has content.
|
|
178
167
|
*/
|
|
179
168
|
private syncLabels;
|
|
180
169
|
/**
|
|
@@ -184,15 +173,9 @@ export declare class ConfirmButton implements AfterViewInit, DoCheck, OnDestroy,
|
|
|
184
173
|
* @param span - The capture span to show (null parks everything).
|
|
185
174
|
*/
|
|
186
175
|
private showSlot;
|
|
187
|
-
/**
|
|
188
|
-
* The insertion point for the visible projected label (a comment the DOM
|
|
189
|
-
* normalizer strips), kept before the fallback texts.
|
|
190
|
-
* @returns The anchor comment.
|
|
191
|
-
*/
|
|
192
|
-
private labelAnchor;
|
|
193
176
|
/** Clears the auto-disarm timer (React's unmount cleanup). */
|
|
194
177
|
ngOnDestroy(): void;
|
|
195
178
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmButton, never>;
|
|
196
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmButton, "button[mol-confirm-button]", never, { "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; "onConfirm": { "alias": "onConfirm"; "required": false; }; "label": { "alias": "label"; "required": false; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; }; "pendingLabel": { "alias": "pendingLabel"; "required": false; }; "disarmSeconds": { "alias": "disarmSeconds"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; }, {}, never, ["[slot=label]", "[slot=confirmLabel]", "[slot=pendingLabel]"], true,
|
|
179
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmButton, "button[mol-confirm-button]", never, { "variant": { "alias": "variant"; "required": false; }; "color": { "alias": "color"; "required": false; }; "size": { "alias": "size"; "required": false; }; "onConfirm": { "alias": "onConfirm"; "required": false; }; "label": { "alias": "label"; "required": false; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; }; "pendingLabel": { "alias": "pendingLabel"; "required": false; }; "disarmSeconds": { "alias": "disarmSeconds"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; }, {}, never, ["[slot=label]", "[slot=confirmLabel]", "[slot=pendingLabel]"], true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
197
180
|
}
|
|
198
181
|
//# sourceMappingURL=confirm-button.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-button.component.d.ts","sourceRoot":"","sources":["../../src/components/confirm-button.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"confirm-button.component.d.ts","sourceRoot":"","sources":["../../src/components/confirm-button.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,UAAU,EAEV,KAAK,SAAS,EAEd,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAA;AAStB,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGrF,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;;;AAI1E;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtC,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAC9C,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IACrD,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IACrD,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oCAAoC;I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iBlB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IAShB,8DAA8D;IAC9D,WAAW,IAAI,IAAI;yCAnNR,aAAa;2CAAb,aAAa;CAsNzB"}
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { Component, effect, ElementRef, inject,
|
|
6
|
+
import { Component, effect, ElementRef, inject, signal, ViewChild, } from '@angular/core';
|
|
7
|
+
import { MolPlacement, placeContent, setElementPresent, usePlacement, } from '@molecule/app-angular';
|
|
7
8
|
import { getClassMap } from '@molecule/app-ui';
|
|
8
9
|
import { hostElement } from '../utilities/element.js';
|
|
9
10
|
import { asTemplate, isGiven, nodeText } from '../utilities/node-value.js';
|
|
10
11
|
import { styleText } from '../utilities/style.js';
|
|
11
|
-
import { hasNodes, SlotWrapper } from './button.component.js';
|
|
12
12
|
import { MolTemplateOutlet } from './template-outlet.directive.js';
|
|
13
13
|
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "@molecule/app-angular";
|
|
14
15
|
const _c0 = ["labelSlot"];
|
|
15
16
|
const _c1 = ["confirmSlot"];
|
|
16
17
|
const _c2 = ["pendingSlot"];
|
|
@@ -106,25 +107,25 @@ export class ConfirmButton {
|
|
|
106
107
|
confirmSlot;
|
|
107
108
|
/** The pending-state label capture span. */
|
|
108
109
|
pendingSlot;
|
|
109
|
-
/** Whether the armed label slot carries content (
|
|
110
|
-
hasConfirmLabel = false
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
/** Whether the armed label slot carries content (a signal the template reads). */
|
|
111
|
+
hasConfirmLabel = signal(false, /* @ts-ignore */
|
|
112
|
+
...(ngDevMode ? [{ debugName: "hasConfirmLabel" }] : /* istanbul ignore next */ []));
|
|
113
|
+
/** Whether the pending label slot carries content (a signal the template reads). */
|
|
114
|
+
hasPendingLabel = signal(false, /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "hasPendingLabel" }] : /* istanbul ignore next */ []));
|
|
113
116
|
/** The current phase: idle → armed → pending → idle. */
|
|
114
117
|
phase = signal('idle', /* @ts-ignore */
|
|
115
118
|
...(ngDevMode ? [{ debugName: "phase" }] : /* istanbul ignore next */ []));
|
|
116
119
|
el = inject(ElementRef);
|
|
117
120
|
/** The element a caller's ref receives: the host `<button>`. */
|
|
118
121
|
element = hostElement(this.el);
|
|
119
|
-
renderer = inject(Renderer2);
|
|
120
|
-
sync = new SlotWrapper(this.el, this.renderer);
|
|
121
122
|
disarmTimer = null;
|
|
122
|
-
anchor = null;
|
|
123
123
|
/**
|
|
124
124
|
* Arms the auto-disarm timer for the armed phase (React's `useEffect` on
|
|
125
125
|
* `[phase, disarmSeconds]`).
|
|
126
126
|
*/
|
|
127
127
|
constructor() {
|
|
128
|
+
usePlacement((hasContent) => this.syncLabels(hasContent));
|
|
128
129
|
effect(() => {
|
|
129
130
|
if (this.disarmTimer) {
|
|
130
131
|
clearTimeout(this.disarmTimer);
|
|
@@ -218,38 +219,25 @@ export class ConfirmButton {
|
|
|
218
219
|
}
|
|
219
220
|
this.phase.set('idle');
|
|
220
221
|
}
|
|
221
|
-
/**
|
|
222
|
-
* Reads slot presence at view init (view queries resolve only then) and
|
|
223
|
-
* takes the capture spans out of the DOM.
|
|
224
|
-
*/
|
|
225
|
-
ngAfterViewInit() {
|
|
226
|
-
this.hasConfirmLabel = hasNodes(this.confirmSlot?.nativeElement);
|
|
227
|
-
this.hasPendingLabel = hasNodes(this.pendingSlot?.nativeElement);
|
|
228
|
-
for (const span of [this.labelSlot, this.confirmSlot, this.pendingSlot])
|
|
229
|
-
this.sync.sync(span?.nativeElement, false);
|
|
230
|
-
this.syncLabels();
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Re-reconciles the visible label on every pass (phase changes and later
|
|
234
|
-
* `props` steps both go through a refresh).
|
|
235
|
-
*/
|
|
236
|
-
ngDoCheck() {
|
|
237
|
-
this.syncLabels();
|
|
238
|
-
}
|
|
239
|
-
/** The nodes currently shown on the button, and the slot they came from. */
|
|
240
|
-
visibleNodes = [];
|
|
222
|
+
/** The slot whose content is currently shown on the button. */
|
|
241
223
|
visibleFrom = null;
|
|
242
224
|
/**
|
|
243
225
|
* Shows exactly the visible phase's projected children on the button —
|
|
244
226
|
* React renders exactly one label and no wrapper element.
|
|
227
|
+
*
|
|
228
|
+
* @param hasContent - Reads whether a slot has content.
|
|
245
229
|
*/
|
|
246
|
-
syncLabels() {
|
|
230
|
+
syncLabels(hasContent) {
|
|
231
|
+
this.hasConfirmLabel.set(hasContent(this.confirmSlot?.nativeElement));
|
|
232
|
+
this.hasPendingLabel.set(hasContent(this.pendingSlot?.nativeElement));
|
|
233
|
+
for (const span of [this.labelSlot, this.confirmSlot, this.pendingSlot])
|
|
234
|
+
setElementPresent(span?.nativeElement, false);
|
|
247
235
|
const phase = this.phase();
|
|
248
236
|
const target = phase === 'idle'
|
|
249
237
|
? (this.labelSlot?.nativeElement ?? null)
|
|
250
|
-
: phase === 'armed' && this.hasConfirmLabel
|
|
238
|
+
: phase === 'armed' && this.hasConfirmLabel()
|
|
251
239
|
? (this.confirmSlot?.nativeElement ?? null)
|
|
252
|
-
: phase === 'pending' && this.hasPendingLabel
|
|
240
|
+
: phase === 'pending' && this.hasPendingLabel()
|
|
253
241
|
? (this.pendingSlot?.nativeElement ?? null)
|
|
254
242
|
: null;
|
|
255
243
|
this.showSlot(target);
|
|
@@ -264,33 +252,12 @@ export class ConfirmButton {
|
|
|
264
252
|
const host = this.el.nativeElement;
|
|
265
253
|
if (span === this.visibleFrom)
|
|
266
254
|
return;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
this.visibleNodes = [];
|
|
272
|
-
this.visibleFrom = null;
|
|
255
|
+
if (this.visibleFrom)
|
|
256
|
+
placeContent(this.visibleFrom, null);
|
|
257
|
+
this.visibleFrom = span;
|
|
273
258
|
if (!span)
|
|
274
259
|
return;
|
|
275
|
-
|
|
276
|
-
for (const node of nodes)
|
|
277
|
-
host.insertBefore(node, this.labelAnchor());
|
|
278
|
-
this.visibleNodes = nodes;
|
|
279
|
-
this.visibleFrom = span;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* The insertion point for the visible projected label (a comment the DOM
|
|
283
|
-
* normalizer strips), kept before the fallback texts.
|
|
284
|
-
* @returns The anchor comment.
|
|
285
|
-
*/
|
|
286
|
-
labelAnchor() {
|
|
287
|
-
if (this.anchor)
|
|
288
|
-
return this.anchor;
|
|
289
|
-
const anchor = this.renderer.createComment('label');
|
|
290
|
-
const host = this.el.nativeElement;
|
|
291
|
-
host.insertBefore(anchor, host.firstChild);
|
|
292
|
-
this.anchor = anchor;
|
|
293
|
-
return anchor;
|
|
260
|
+
placeContent(span, host);
|
|
294
261
|
}
|
|
295
262
|
/** Clears the auto-disarm timer (React's unmount cleanup). */
|
|
296
263
|
ngOnDestroy() {
|
|
@@ -312,7 +279,7 @@ export class ConfirmButton {
|
|
|
312
279
|
i0.ɵɵattribute("type", "button")("aria-live", "polite")("data-state", ctx.phase())("data-testid", ctx.testId)("data-mol-id", ctx.molId());
|
|
313
280
|
i0.ɵɵstyleMap(ctx.hostStyle());
|
|
314
281
|
i0.ɵɵclassMap(ctx.classes());
|
|
315
|
-
} }, inputs: { variant: "variant", color: "color", size: "size", onConfirm: "onConfirm", label: "label", confirmLabel: "confirmLabel", pendingLabel: "pendingLabel", disarmSeconds: "disarmSeconds", disabled: "disabled", testId: "testId", className: "className", style: "style", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"] }, ngContentSelectors: _c4, decls: 14, vars: 5, consts: [["labelSlot", ""], ["confirmSlot", ""], ["pendingSlot", ""], [3, "molTemplateOutlet"]], template: function ConfirmButton_Template(rf, ctx) { if (rf & 1) {
|
|
282
|
+
} }, inputs: { variant: "variant", color: "color", size: "size", onConfirm: "onConfirm", label: "label", confirmLabel: "confirmLabel", pendingLabel: "pendingLabel", disarmSeconds: "disarmSeconds", disabled: "disabled", testId: "testId", className: "className", style: "style", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"] }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], ngContentSelectors: _c4, decls: 14, vars: 5, consts: [["labelSlot", ""], ["confirmSlot", ""], ["pendingSlot", ""], [3, "molTemplateOutlet"]], template: function ConfirmButton_Template(rf, ctx) { if (rf & 1) {
|
|
316
283
|
i0.ɵɵprojectionDef(_c3);
|
|
317
284
|
i0.ɵɵconditionalCreate(0, ConfirmButton_Conditional_0_Template, 1, 0);
|
|
318
285
|
i0.ɵɵconditionalCreate(1, ConfirmButton_Conditional_1_Template, 1, 0);
|
|
@@ -329,9 +296,9 @@ export class ConfirmButton {
|
|
|
329
296
|
i0.ɵɵprojection(13, 2);
|
|
330
297
|
i0.ɵɵelementEnd();
|
|
331
298
|
} if (rf & 2) {
|
|
332
|
-
i0.ɵɵconditional(ctx.phase() === "armed" && !ctx.hasConfirmLabel && !ctx.isGiven(ctx.confirmLabel) ? 0 : -1);
|
|
299
|
+
i0.ɵɵconditional(ctx.phase() === "armed" && !ctx.hasConfirmLabel() && !ctx.isGiven(ctx.confirmLabel) ? 0 : -1);
|
|
333
300
|
i0.ɵɵadvance();
|
|
334
|
-
i0.ɵɵconditional(ctx.phase() === "pending" && !ctx.hasPendingLabel && !ctx.isGiven(ctx.pendingLabel) ? 1 : -1);
|
|
301
|
+
i0.ɵɵconditional(ctx.phase() === "pending" && !ctx.hasPendingLabel() && !ctx.isGiven(ctx.pendingLabel) ? 1 : -1);
|
|
335
302
|
i0.ɵɵadvance();
|
|
336
303
|
i0.ɵɵconditional(ctx.phase() === "idle" && ctx.isGiven(ctx.label) ? 2 : -1);
|
|
337
304
|
i0.ɵɵadvance();
|
|
@@ -345,6 +312,7 @@ export class ConfirmButton {
|
|
|
345
312
|
args: [{
|
|
346
313
|
selector: 'button[mol-confirm-button]',
|
|
347
314
|
standalone: true,
|
|
315
|
+
hostDirectives: [MolPlacement],
|
|
348
316
|
imports: [MolTemplateOutlet],
|
|
349
317
|
inputs: [
|
|
350
318
|
'variant',
|
|
@@ -374,10 +342,10 @@ export class ConfirmButton {
|
|
|
374
342
|
'[class]': 'classes()',
|
|
375
343
|
'[style]': 'hostStyle()',
|
|
376
344
|
},
|
|
377
|
-
template: `@if (phase() === 'armed' && !hasConfirmLabel && !isGiven(confirmLabel)) {
|
|
345
|
+
template: `@if (phase() === 'armed' && !hasConfirmLabel() && !isGiven(confirmLabel)) {
|
|
378
346
|
Confirm?
|
|
379
347
|
}
|
|
380
|
-
@if (phase() === 'pending' && !hasPendingLabel && !isGiven(pendingLabel)) {
|
|
348
|
+
@if (phase() === 'pending' && !hasPendingLabel() && !isGiven(pendingLabel)) {
|
|
381
349
|
Working…
|
|
382
350
|
}
|
|
383
351
|
@if (phase() === 'idle' && isGiven(label)) {
|
|
@@ -405,5 +373,5 @@ export class ConfirmButton {
|
|
|
405
373
|
type: ViewChild,
|
|
406
374
|
args: ['pendingSlot']
|
|
407
375
|
}] }); })();
|
|
408
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ConfirmButton, { className: "ConfirmButton", filePath: "components/confirm-button.component.ts", lineNumber:
|
|
376
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ConfirmButton, { className: "ConfirmButton", filePath: "components/confirm-button.component.ts", lineNumber: 142 }); })();
|
|
409
377
|
//# sourceMappingURL=confirm-button.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-button.component.js","sourceRoot":"","sources":["../../src/components/confirm-button.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"confirm-button.component.js","sourceRoot":"","sources":["../../src/components/confirm-button.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,MAAM,EACN,UAAU,EACV,MAAM,EAEN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D,cAEC;YAFD,2EAEC;YACD,cAGC;YAHD,mFAGC;YACD,cAGC;YAHD,qFAGC;4BA7CO,iBAAiB;;iFAkDhB,aAAa;cAtDzB,SAAS;eAAC;gBACT,QAAQ,EAAE,4BAA4B;gBACtC,UAAU,EAAE,IAAI;gBAChB,cAAc,EAAE,CAAC,YAAY,CAAC;gBAC9B,OAAO,EAAE,CAAC,iBAAiB,CAAC;gBAC5B,MAAM,EAAE;oBACN,SAAS;oBACT,OAAO;oBACP,MAAM;oBACN,WAAW;oBACX,OAAO;oBACP,cAAc;oBACd,cAAc;oBACd,eAAe;oBACf,UAAU;oBACV,QAAQ;oBACR,WAAW;oBACX,OAAO;oBACP,cAAc;oBACd,wBAAwB;iBACzB;gBACD,IAAI,EAAE;oBACJ,aAAa,EAAE,UAAU;oBACzB,SAAS,EAAE,eAAe;oBAC1B,2BAA2B,EAAE,gBAAgB;oBAC7C,YAAY,EAAE,mCAAmC;oBACjD,kBAAkB,EAAE,UAAU;oBAC9B,mBAAmB,EAAE,SAAS;oBAC9B,oBAAoB,EAAE,QAAQ;oBAC9B,oBAAoB,EAAE,SAAS;oBAC/B,SAAS,EAAE,WAAW;oBACtB,SAAS,EAAE,aAAa;iBACzB;gBACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;sFAmB0E;aACrF;;kBA2CE,SAAS;mBAAC,WAAW;;kBAErB,SAAS;mBAAC,aAAa;;kBAEvB,SAAS;mBAAC,aAAa;;kFA9Cb,aAAa"}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { ElementRef, EventEmitter, type TemplateRef } from '@angular/core';
|
|
7
7
|
import type { UIClassMap } from '@molecule/app-ui';
|
|
8
8
|
import { asTemplate, isGiven, nodeText } from '../utilities/node-value.js';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "@molecule/app-angular";
|
|
10
11
|
/**
|
|
11
12
|
* Props for {@link ConfirmDialog} (React's `ConfirmDialogProps`, in Angular's
|
|
12
13
|
* form).
|
|
@@ -41,28 +42,30 @@ export interface ConfirmDialogProps {
|
|
|
41
42
|
*
|
|
42
43
|
* Composed from `Modal` and `Button` exactly as React composes them; the
|
|
43
44
|
* dialog's own title/description/children are projected content (`[slot=title]`,
|
|
44
|
-
* `[slot=description]`, default) or node-valued inputs.
|
|
45
|
-
*
|
|
45
|
+
* `[slot=description]`, default) or node-valued inputs. React's root is a
|
|
46
|
+
* `Modal`, which renders a portal while open and nothing while closed, so the
|
|
47
|
+
* host element leaves the page and the portal renders in `document.body`.
|
|
46
48
|
*/
|
|
47
|
-
export declare class ConfirmDialog
|
|
49
|
+
export declare class ConfirmDialog {
|
|
48
50
|
/**
|
|
49
51
|
* Per-instance id of the rendered title heading, wired as the dialog's
|
|
50
|
-
* accessible name: the binding on `<mol-modal>`
|
|
51
|
-
*
|
|
52
|
+
* accessible name: the binding on `<mol-modal>` reaches the dialog `<div>`,
|
|
53
|
+
* React's `{...rest}` target (Modal names it with `setHostRoot`) —
|
|
52
54
|
* `aria-labelledby` pointing at the visible `<h2>` (WAI-ARIA dialog
|
|
53
55
|
* pattern; axe `aria-dialog-name`).
|
|
54
56
|
*/
|
|
55
57
|
readonly titleId: string;
|
|
56
58
|
/**
|
|
57
59
|
* Per-instance id of the rendered description paragraph, wired as the
|
|
58
|
-
* dialog's accessible description
|
|
59
|
-
* the title (only bound when projected description content renders — a
|
|
60
|
+
* dialog's accessible description the same way as the title (only bound when projected description content renders — a
|
|
60
61
|
* reference to an empty paragraph describes nothing, axe
|
|
61
62
|
* `aria-dialog-name`/`aria-valid-attr-value`).
|
|
62
63
|
*/
|
|
63
64
|
readonly descriptionId: string;
|
|
64
65
|
/** The rendered description paragraph (its projected nodes decide the wiring). */
|
|
65
66
|
descriptionSlot?: ElementRef<HTMLParagraphElement>;
|
|
67
|
+
/** The title heading (its projected nodes decide whether the dialog points at it). */
|
|
68
|
+
titleSlot?: ElementRef<HTMLHeadingElement>;
|
|
66
69
|
/** Whether the dialog is open. */
|
|
67
70
|
open: ConfirmDialogProps['open'];
|
|
68
71
|
/** Title (node-valued prop). */
|
|
@@ -100,17 +103,25 @@ export declare class ConfirmDialog implements DoCheck {
|
|
|
100
103
|
cm(): UIClassMap;
|
|
101
104
|
/**
|
|
102
105
|
* The dialog's accessible description id, or null when no description
|
|
103
|
-
* content renders. A
|
|
104
|
-
*
|
|
105
|
-
* value forever. Re-read each pass from the projected description nodes.
|
|
106
|
+
* content renders. A signal the template reads, so the association follows
|
|
107
|
+
* the projected description in the pass where it changes.
|
|
106
108
|
*/
|
|
107
|
-
ariaDescribedBy: string | null
|
|
109
|
+
readonly ariaDescribedBy: import("@angular/core").WritableSignal<string | null>;
|
|
108
110
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* later change to what renders is picked up on the next pass.
|
|
111
|
+
* The title heading's id, which the dialog's `aria-labelledby` points at, or null while the title
|
|
112
|
+
* renders nothing (React's `slot(title)`): a heading with no text names nothing.
|
|
112
113
|
*/
|
|
113
|
-
|
|
114
|
+
readonly ariaLabelledBy: import("@angular/core").WritableSignal<string | null>;
|
|
115
|
+
/** The composed Modal's element: what the caller binds on this tag lands there, and Modal passes it to its dialog. */
|
|
116
|
+
modalElement?: ElementRef<HTMLElement>;
|
|
117
|
+
private readonly host;
|
|
118
|
+
/**
|
|
119
|
+
* Recomputes {@link ariaLabelledBy} and {@link ariaDescribedBy} from the
|
|
120
|
+
* title and description inputs and their projected nodes in
|
|
121
|
+
* the placement function, and takes the host out of the page (React renders
|
|
122
|
+
* the composed `Modal`'s portal in `document.body`, nothing here).
|
|
123
|
+
*/
|
|
124
|
+
constructor();
|
|
114
125
|
/**
|
|
115
126
|
* The cancel button's label.
|
|
116
127
|
* @returns The label text.
|
|
@@ -123,6 +134,6 @@ export declare class ConfirmDialog implements DoCheck {
|
|
|
123
134
|
*/
|
|
124
135
|
confirmText(): string;
|
|
125
136
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialog, never>;
|
|
126
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialog, "mol-confirm-dialog", never, { "open": { "alias": "open"; "required": false; }; "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; }; "destructive": { "alias": "destructive"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; }, { "close": "close"; "confirm": "confirm"; }, never, ["[slot=title]", "[slot=description]", "*"], true,
|
|
137
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialog, "mol-confirm-dialog", never, { "open": { "alias": "open"; "required": false; }; "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; }; "destructive": { "alias": "destructive"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; }, { "close": "close"; "confirm": "confirm"; }, never, ["[slot=title]", "[slot=description]", "*"], true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
127
138
|
}
|
|
128
139
|
//# sourceMappingURL=confirm-dialog.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-dialog.component.d.ts","sourceRoot":"","sources":["../../src/components/confirm-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,
|
|
1
|
+
{"version":3,"file":"confirm-dialog.component.d.ts","sourceRoot":"","sources":["../../src/components/confirm-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,UAAU,EACV,YAAY,EAIZ,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAA;AAStB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,EAAE,UAAU,EAAE,O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