@molecule/app-ui-angular 1.4.2 → 1.5.1
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 +966 -1013
- 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 +134 -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 +25 -21
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +42 -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 +34 -41
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -1
- package/dist/components/responsive-app-shell.component.js +126 -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 +14 -11
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +47 -47
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/components/user-menu-popover.component.d.ts +6 -12
- package/dist/components/user-menu-popover.component.d.ts.map +1 -1
- package/dist/components/user-menu-popover.component.js +40 -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
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* React provides the close callback through a React context, which follows
|
|
5
5
|
* the rendered tree — including projected children. Angular DI does not reach
|
|
6
|
-
* projected content, so the value is registered on
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* projected content, so the value is registered on a DOM element and looked
|
|
7
|
+
* up through the DOM ancestors (`utilities/dom-context.ts`), the same way
|
|
8
|
+
* React's context resolves.
|
|
9
9
|
*
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
12
|
import { type OnDestroy } from '@angular/core';
|
|
13
13
|
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "@molecule/app-angular";
|
|
14
15
|
/**
|
|
15
16
|
* Props for {@link PanelCloseProvider} (React's `PanelCloseProviderProps`, in
|
|
16
17
|
* Angular's form). The panel content is projected content, so it has no
|
|
@@ -24,20 +25,25 @@ export interface PanelCloseProviderProps {
|
|
|
24
25
|
* Provides the drawer-close callback to descendants.
|
|
25
26
|
*
|
|
26
27
|
* Rendered internally by `UserMenu` and `SidebarUserCard` around their panel
|
|
27
|
-
* content; apps do not normally render it directly.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* content; apps do not normally render it directly. React's context provider
|
|
29
|
+
* renders its children and no DOM of its own, so the projected children
|
|
30
|
+
* render in front of the host (`placeContentBefore`) and the host itself
|
|
31
|
+
* leaves the page. The context is registered on the parent element — the one
|
|
32
|
+
* whose child list the content now belongs to — so a consumer in the content
|
|
33
|
+
* still resolves it from its DOM ancestors.
|
|
30
34
|
*/
|
|
31
35
|
export declare class PanelCloseProvider implements OnDestroy {
|
|
32
36
|
/** Callback that dismisses the enclosing drawer/modal. */
|
|
33
37
|
close?: PanelCloseProviderProps['close'];
|
|
34
38
|
private readonly host;
|
|
35
|
-
/**
|
|
39
|
+
/** The value consumers read; its closure keeps the CURRENT `close` prop. */
|
|
40
|
+
private readonly value;
|
|
41
|
+
/** Renders the children in front of the host and registers the context where they render. */
|
|
36
42
|
constructor();
|
|
37
43
|
/** Removes the context registration (unmount). */
|
|
38
44
|
ngOnDestroy(): void;
|
|
39
45
|
static ɵfac: i0.ɵɵFactoryDeclaration<PanelCloseProvider, never>;
|
|
40
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PanelCloseProvider, "mol-panel-close-provider", never, { "close": { "alias": "close"; "required": false; }; }, {}, never, ["*"], true,
|
|
46
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PanelCloseProvider, "mol-panel-close-provider", never, { "close": { "alias": "close"; "required": false; }; }, {}, never, ["*"], true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
41
47
|
}
|
|
42
48
|
/**
|
|
43
49
|
* Returns the callback that dismisses the drawer the current panel is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-close.component.d.ts","sourceRoot":"","sources":["../../src/components/panel-close.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA
|
|
1
|
+
{"version":3,"file":"panel-close.component.d.ts","sourceRoot":"","sources":["../../src/components/panel-close.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA;;;AAW7E;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,0DAA0D;IAC1D,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED;;;;;;;;;;GAUG;AACH,qBAOa,kBAAmB,YAAW,SAAS;IAClD,0DAA0D;IAC1D,KAAK,CAAC,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAA;IAExC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA8C;IACnE,4EAA4E;IAC5E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwC;IAE9D,6FAA6F;;IAU7F,kDAAkD;IAClD,WAAW,IAAI,IAAI;yCAnBR,kBAAkB;2CAAlB,kBAAkB;CAsB9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,MAAM,IAAI,CAS1C"}
|
|
@@ -3,38 +3,50 @@
|
|
|
3
3
|
*
|
|
4
4
|
* React provides the close callback through a React context, which follows
|
|
5
5
|
* the rendered tree — including projected children. Angular DI does not reach
|
|
6
|
-
* projected content, so the value is registered on
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* projected content, so the value is registered on a DOM element and looked
|
|
7
|
+
* up through the DOM ancestors (`utilities/dom-context.ts`), the same way
|
|
8
|
+
* React's context resolves.
|
|
9
9
|
*
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
12
|
import { Component, ElementRef, inject } from '@angular/core';
|
|
13
|
-
import {
|
|
13
|
+
import { MolPlacement, placeContentBefore, setElementPresent, usePlacement, } from '@molecule/app-angular';
|
|
14
|
+
import { createDomContext } from '../utilities/dom-context.js';
|
|
14
15
|
import * as i0 from "@angular/core";
|
|
16
|
+
import * as i1 from "@molecule/app-angular";
|
|
15
17
|
const _c0 = ["*"];
|
|
16
18
|
/**
|
|
17
19
|
* Provides the drawer-close callback to descendants.
|
|
18
20
|
*
|
|
19
21
|
* Rendered internally by `UserMenu` and `SidebarUserCard` around their panel
|
|
20
|
-
* content; apps do not normally render it directly.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
22
|
+
* content; apps do not normally render it directly. React's context provider
|
|
23
|
+
* renders its children and no DOM of its own, so the projected children
|
|
24
|
+
* render in front of the host (`placeContentBefore`) and the host itself
|
|
25
|
+
* leaves the page. The context is registered on the parent element — the one
|
|
26
|
+
* whose child list the content now belongs to — so a consumer in the content
|
|
27
|
+
* still resolves it from its DOM ancestors.
|
|
23
28
|
*/
|
|
24
29
|
export class PanelCloseProvider {
|
|
25
30
|
/** Callback that dismisses the enclosing drawer/modal. */
|
|
26
31
|
close;
|
|
27
32
|
host = inject(ElementRef);
|
|
28
|
-
/**
|
|
33
|
+
/** The value consumers read; its closure keeps the CURRENT `close` prop. */
|
|
34
|
+
value = { close: () => this.close?.() };
|
|
35
|
+
/** Renders the children in front of the host and registers the context where they render. */
|
|
29
36
|
constructor() {
|
|
30
|
-
|
|
37
|
+
const host = this.host.nativeElement;
|
|
38
|
+
PanelCloseDomContext.provide(host, this.value);
|
|
39
|
+
usePlacement(() => {
|
|
40
|
+
placeContentBefore(host, host);
|
|
41
|
+
setElementPresent(host, false);
|
|
42
|
+
});
|
|
31
43
|
}
|
|
32
44
|
/** Removes the context registration (unmount). */
|
|
33
45
|
ngOnDestroy() {
|
|
34
|
-
|
|
46
|
+
PanelCloseDomContext.remove(this.host.nativeElement);
|
|
35
47
|
}
|
|
36
48
|
static ɵfac = function PanelCloseProvider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PanelCloseProvider)(); };
|
|
37
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PanelCloseProvider, selectors: [["mol-panel-close-provider"]],
|
|
49
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PanelCloseProvider, selectors: [["mol-panel-close-provider"]], inputs: { close: "close" }, features: [i0.ɵɵHostDirectivesFeature([i1.MolPlacement])], ngContentSelectors: _c0, decls: 1, vars: 0, template: function PanelCloseProvider_Template(rf, ctx) { if (rf & 1) {
|
|
38
50
|
i0.ɵɵprojectionDef();
|
|
39
51
|
i0.ɵɵprojection(0);
|
|
40
52
|
} }, encapsulation: 2 });
|
|
@@ -44,15 +56,12 @@ export class PanelCloseProvider {
|
|
|
44
56
|
args: [{
|
|
45
57
|
selector: 'mol-panel-close-provider',
|
|
46
58
|
standalone: true,
|
|
59
|
+
hostDirectives: [MolPlacement],
|
|
47
60
|
inputs: ['close'],
|
|
48
|
-
host: {
|
|
49
|
-
'data-parity-unwrap': '',
|
|
50
|
-
style: 'display: contents',
|
|
51
|
-
},
|
|
52
61
|
template: `<ng-content></ng-content>`,
|
|
53
62
|
}]
|
|
54
63
|
}], () => [], null); })();
|
|
55
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PanelCloseProvider, { className: "PanelCloseProvider", filePath: "components/panel-close.component.ts", lineNumber:
|
|
64
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PanelCloseProvider, { className: "PanelCloseProvider", filePath: "components/panel-close.component.ts", lineNumber: 52 }); })();
|
|
56
65
|
/**
|
|
57
66
|
* Returns the callback that dismisses the drawer the current panel is
|
|
58
67
|
* mounted in. Safe to call anywhere — a no-op outside a provider.
|
|
@@ -68,8 +77,10 @@ export function usePanelClose() {
|
|
|
68
77
|
// its constructor, before Angular has inserted its host into the DOM, so the
|
|
69
78
|
// provider is only reachable from the ancestor walk once the tree is built.
|
|
70
79
|
return () => {
|
|
71
|
-
const found =
|
|
80
|
+
const found = PanelCloseDomContext.find(el?.nativeElement ?? null);
|
|
72
81
|
found?.close();
|
|
73
82
|
};
|
|
74
83
|
}
|
|
84
|
+
/** The context a provider registers and its consumers find. */
|
|
85
|
+
const PanelCloseDomContext = createDomContext('PanelCloseDomContext');
|
|
75
86
|
//# sourceMappingURL=panel-close.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-close.component.js","sourceRoot":"","sources":["../../src/components/panel-close.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAA;AAE7E,OAAO,
|
|
1
|
+
{"version":3,"file":"panel-close.component.js","sourceRoot":"","sources":["../../src/components/panel-close.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAA;AAE7E,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;;;;AAY9D;;;;;;;;;;GAUG;AAQH,MAAM,OAAO,kBAAkB;IAC7B,0DAA0D;IAC1D,KAAK,CAAmC;IAEvB,IAAI,GAA4B,MAAM,CAAC,UAAU,CAAC,CAAA;IACnE,4EAA4E;IAC3D,KAAK,GAAG,EAAE,KAAK,EAAE,GAAS,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,CAAA;IAE9D,6FAA6F;IAC7F;QACE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAA;QACpC,oBAAoB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;QAC9C,YAAY,CAAC,GAAG,EAAE;YAChB,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;YAC9B,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAChC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,kDAAkD;IAClD,WAAW;QACT,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACtD,CAAC;4GArBU,kBAAkB;6DAAlB,kBAAkB;;YAFlB,kBAAyB;;;iFAEzB,kBAAkB;cAP9B,SAAS;eAAC;gBACT,QAAQ,EAAE,0BAA0B;gBACpC,UAAU,EAAE,IAAI;gBAChB,cAAc,EAAE,CAAC,YAAY,CAAC;gBAC9B,MAAM,EAAE,CAAC,OAAO,CAAC;gBACjB,QAAQ,EAAE,2BAA2B;aACtC;;kFACY,kBAAkB;AAwB/B;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAmC,CAAA;IACnF,8EAA8E;IAC9E,6EAA6E;IAC7E,4EAA4E;IAC5E,OAAO,GAAG,EAAE;QACV,MAAM,KAAK,GAAG,oBAAoB,CAAC,IAAI,CAAC,EAAE,EAAE,aAAa,IAAI,IAAI,CAAC,CAAA;QAClE,KAAK,EAAE,KAAK,EAAE,CAAA;IAChB,CAAC,CAAA;AACH,CAAC;AAED,+DAA+D;AAC/D,MAAM,oBAAoB,GAAG,gBAAgB,CAAwB,sBAAsB,CAAC,CAAA"}
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { type AfterViewChecked, type AfterViewInit, type DoCheck,
|
|
7
|
+
import { type AfterViewChecked, type AfterViewInit, type DoCheck, ElementRef, EventEmitter, type TemplateRef } from '@angular/core';
|
|
8
|
+
import { type SlotReader } from '@molecule/app-angular';
|
|
8
9
|
import type { UIClassMap } from '@molecule/app-ui';
|
|
9
|
-
import { asTemplate, isGiven, nodeText } from '../utilities/node-value.js';
|
|
10
|
+
import { asTemplate, isGiven, nodeText, rendersNode } from '../utilities/node-value.js';
|
|
10
11
|
import { Input } from './input.component.js';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "@molecule/app-angular";
|
|
12
14
|
/**
|
|
13
15
|
* Props for {@link PromptDialog} (React's `PromptDialogProps`, in Angular's
|
|
14
16
|
* form).
|
|
@@ -50,8 +52,9 @@ export interface PromptDialogProps {
|
|
|
50
52
|
*
|
|
51
53
|
* Composed from `Modal`, `Input` and `Button` exactly as React composes
|
|
52
54
|
* them. Resolving `onSubmit` closes the dialog and resets it; a rejection
|
|
53
|
-
* keeps it open with the value intact.
|
|
54
|
-
*
|
|
55
|
+
* keeps it open with the value intact. React's root is a `Modal`, which
|
|
56
|
+
* renders a portal while open and nothing while closed, so the host element
|
|
57
|
+
* leaves the page and the portal renders in `document.body`.
|
|
55
58
|
*/
|
|
56
59
|
export declare class PromptDialog implements AfterViewInit, AfterViewChecked, DoCheck {
|
|
57
60
|
/** Whether the dialog is open. */
|
|
@@ -87,16 +90,20 @@ export declare class PromptDialog implements AfterViewInit, AfterViewChecked, Do
|
|
|
87
90
|
readonly nodeText: typeof nodeText;
|
|
88
91
|
/** Whether a node-valued prop was given. */
|
|
89
92
|
readonly isGiven: typeof isGiven;
|
|
93
|
+
/** Whether a node-valued prop renders anything. */
|
|
94
|
+
readonly rendersNode: typeof rendersNode;
|
|
90
95
|
/** Fires when the dialog should close (escape, backdrop, cancel, a fulfilled submit). */
|
|
91
96
|
readonly close: EventEmitter<unknown>;
|
|
92
97
|
/** The dialog heading element (its text seeds the input's aria-label). */
|
|
93
98
|
titleSlot?: ElementRef<HTMLHeadingElement>;
|
|
94
99
|
/** The composed input (its native element receives React's aria-label). */
|
|
95
100
|
inputComponent?: Input;
|
|
101
|
+
/** The composed Modal's element: what the caller binds on this tag lands there, and Modal passes it to its dialog. */
|
|
102
|
+
modalElement?: ElementRef<HTMLElement>;
|
|
96
103
|
/**
|
|
97
104
|
* Per-instance id of the rendered title heading, wired as the dialog's
|
|
98
|
-
* accessible name: the binding on `<mol-modal>`
|
|
99
|
-
*
|
|
105
|
+
* accessible name: the binding on `<mol-modal>` reaches the dialog `<div>`,
|
|
106
|
+
* React's `{...rest}` target (Modal names it with `setHostRoot`) —
|
|
100
107
|
* `aria-labelledby` pointing at the visible `<h2>` (WAI-ARIA dialog
|
|
101
108
|
* pattern; axe `aria-dialog-name`).
|
|
102
109
|
*/
|
|
@@ -107,6 +114,11 @@ export declare class PromptDialog implements AfterViewInit, AfterViewChecked, Do
|
|
|
107
114
|
* a reference to nothing fails axe `aria-valid-attr-value`).
|
|
108
115
|
*/
|
|
109
116
|
readonly descriptionId: string;
|
|
117
|
+
/**
|
|
118
|
+
* The title heading's id, which the dialog's `aria-labelledby` points at, or null while the title
|
|
119
|
+
* renders nothing (React's `slot(title)`): a heading with no text names nothing.
|
|
120
|
+
*/
|
|
121
|
+
readonly ariaLabelledBy: import("@angular/core").WritableSignal<string | null>;
|
|
110
122
|
/** The current input value. */
|
|
111
123
|
readonly value: import("@angular/core").WritableSignal<string>;
|
|
112
124
|
/** Whether a submit is in flight. */
|
|
@@ -117,12 +129,18 @@ export declare class PromptDialog implements AfterViewInit, AfterViewChecked, Do
|
|
|
117
129
|
* does not).
|
|
118
130
|
*/
|
|
119
131
|
private readonly i18n;
|
|
132
|
+
private readonly host;
|
|
120
133
|
private lastOpen;
|
|
121
134
|
private lastInitial;
|
|
122
135
|
/** Whether an open transition is waiting for the after-view input focus. */
|
|
123
136
|
private pendingInputFocus;
|
|
124
137
|
/** Schedules the deferred focus from the view hook (outside an injection context). */
|
|
125
138
|
private readonly injector;
|
|
139
|
+
/**
|
|
140
|
+
* Takes the host out of the page (React renders the composed `Modal`'s
|
|
141
|
+
* portal, nothing here); what the caller binds on the tag lands on the Modal.
|
|
142
|
+
*/
|
|
143
|
+
constructor();
|
|
126
144
|
/**
|
|
127
145
|
* The current class map.
|
|
128
146
|
* @returns The UIClassMap.
|
|
@@ -141,9 +159,10 @@ export declare class PromptDialog implements AfterViewInit, AfterViewChecked, Do
|
|
|
141
159
|
/**
|
|
142
160
|
* The input's accessible label: React uses the title when it is a plain
|
|
143
161
|
* string, otherwise the placeholder.
|
|
162
|
+
* @param hasContent - Reads the projected title.
|
|
144
163
|
* @returns The label, or null when React would render none.
|
|
145
164
|
*/
|
|
146
|
-
inputLabel(): string | null;
|
|
165
|
+
inputLabel(hasContent: SlotReader): string | null;
|
|
147
166
|
/**
|
|
148
167
|
* Seeds the value when the dialog opens (React's `[open, initialValue]`
|
|
149
168
|
* effect). The composed `Modal`'s view init has already run (children init
|
|
@@ -171,8 +190,11 @@ export declare class PromptDialog implements AfterViewInit, AfterViewChecked, Do
|
|
|
171
190
|
*/
|
|
172
191
|
focusInput(): void;
|
|
173
192
|
/**
|
|
174
|
-
* Applies React's `aria-label` to the inner input (it is a rest prop there
|
|
175
|
-
*
|
|
193
|
+
* Applies React's `aria-label` to the inner input (it is a rest prop there).
|
|
194
|
+
* Runs in the placement function, so a title slot added or removed is read
|
|
195
|
+
* in the same pass.
|
|
196
|
+
*
|
|
197
|
+
* @param hasContent - Reads the projected title.
|
|
176
198
|
*/
|
|
177
199
|
private applyInputLabel;
|
|
178
200
|
/**
|
|
@@ -194,6 +216,6 @@ export declare class PromptDialog implements AfterViewInit, AfterViewChecked, Do
|
|
|
194
216
|
*/
|
|
195
217
|
handleSubmit(event: Event): void;
|
|
196
218
|
static ɵfac: i0.ɵɵFactoryDeclaration<PromptDialog, never>;
|
|
197
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PromptDialog, "mol-prompt-dialog", never, { "open": { "alias": "open"; "required": false; }; "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "initialValue": { "alias": "initialValue"; "required": false; }; "onSubmit": { "alias": "onSubmit"; "required": false; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; }; "destructive": { "alias": "destructive"; "required": false; }; "inputMolId": { "alias": "inputMolId"; "required": false; }; "confirmMolId": { "alias": "confirmMolId"; "required": false; }; "cancelMolId": { "alias": "cancelMolId"; "required": false; }; }, { "close": "close"; }, never, ["[slot=title]", "*"], true,
|
|
219
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PromptDialog, "mol-prompt-dialog", never, { "open": { "alias": "open"; "required": false; }; "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "initialValue": { "alias": "initialValue"; "required": false; }; "onSubmit": { "alias": "onSubmit"; "required": false; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; }; "destructive": { "alias": "destructive"; "required": false; }; "inputMolId": { "alias": "inputMolId"; "required": false; }; "confirmMolId": { "alias": "confirmMolId"; "required": false; }; "cancelMolId": { "alias": "cancelMolId"; "required": false; }; }, { "close": "close"; }, never, ["[slot=title]", "*"], true, [{ directive: typeof i1.MolPlacement; inputs: {}; outputs: {}; }]>;
|
|
198
220
|
}
|
|
199
221
|
//# sourceMappingURL=prompt-dialog.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-dialog.component.d.ts","sourceRoot":"","sources":["../../src/components/prompt-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAElB,KAAK,OAAO,EACZ,
|
|
1
|
+
{"version":3,"file":"prompt-dialog.component.d.ts","sourceRoot":"","sources":["../../src/components/prompt-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAElB,KAAK,OAAO,EACZ,UAAU,EACV,YAAY,EAKZ,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAIL,KAAK,UAAU,EAGhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;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