@nanahoshi/mona-ui 0.24.8 → 0.24.10
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/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -9
- package/fesm2022/nanahoshi-mona-ui-button.mjs +8 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +4 -3
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +101 -47
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +342 -102
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +119 -69
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +1054 -452
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-DdyHnUIr.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DhKLnW06.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-B6gq7Hu3.mjs → nanahoshi-mona-ui-grid-grid-list.component-voGbKOiB.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-DdUY3I7P.mjs → nanahoshi-mona-ui-grid-grid-row.component-HQ1Kv6R9.mjs} +2 -3
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DG8Bu4Dy.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-PNLJFcuH.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CVqpbMcb.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BO19AVwC.mjs} +9 -9
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +23 -0
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +567 -33
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +20 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +127 -133
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +473 -240
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +202 -90
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +609 -256
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +45 -10
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +102 -58
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +286 -443
- package/fesm2022/nanahoshi-mona-ui-window.mjs +594 -311
- package/i18n/catalogs/en-US.messages.json +24 -4
- package/locales/ar-sa/ar-sa.messages.json +20 -0
- package/locales/de-de/de-de.messages.json +20 -0
- package/locales/es-es/es-es.messages.json +20 -0
- package/locales/fr-fr/fr-fr.messages.json +20 -0
- package/locales/id-id/id-id.messages.json +20 -0
- package/locales/it-it/it-it.messages.json +20 -0
- package/locales/ja-jp/ja-jp.messages.json +20 -0
- package/locales/ko-kr/ko-kr.messages.json +20 -0
- package/locales/pt-br/pt-br.messages.json +20 -0
- package/locales/ru-ru/ru-ru.messages.json +20 -0
- package/locales/tr-tr/tr-tr.messages.json +20 -0
- package/locales/zh-cn/zh-cn.messages.json +20 -0
- package/locales/zh-tw/zh-tw.messages.json +20 -0
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-button-group.d.ts +13 -3
- package/types/nanahoshi-mona-ui-button.d.ts +20 -3
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +5 -6
- package/types/nanahoshi-mona-ui-dialog.d.ts +131 -20
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +75 -56
- package/types/nanahoshi-mona-ui-editor.d.ts +118 -21
- package/types/nanahoshi-mona-ui-i18n.d.ts +37 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +142 -16
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +20 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +20 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +65 -62
- package/types/nanahoshi-mona-ui-notification.d.ts +76 -16
- package/types/nanahoshi-mona-ui-popover.d.ts +44 -17
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +110 -32
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -0
- package/types/nanahoshi-mona-ui-sheet.d.ts +16 -5
- package/types/nanahoshi-mona-ui-split-button.d.ts +29 -7
- package/types/nanahoshi-mona-ui-tooltip.d.ts +43 -20
- package/types/nanahoshi-mona-ui-window.d.ts +103 -14
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
|
|
2
|
-
import * as
|
|
2
|
+
import * as _nanahoshi_mona_ui_button from '@nanahoshi/mona-ui/button';
|
|
3
3
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
4
|
+
import * as _angular_core from '@angular/core';
|
|
4
5
|
import { SelectionMode } from '@nanahoshi/mona-ui/common';
|
|
5
6
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
7
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -17,9 +18,18 @@ type ButtonGroupVariantsInput = VariantInputs<ButtonGroupVariantProps>;
|
|
|
17
18
|
declare class ButtonGroupComponent implements ButtonGroupVariantsInput {
|
|
18
19
|
#private;
|
|
19
20
|
protected readonly baseClass: _angular_core.Signal<string>;
|
|
21
|
+
/**
|
|
22
|
+
* The group's own buttons: they follow its look, size, rounding and disabled state, and its selection.
|
|
23
|
+
*/
|
|
20
24
|
protected readonly buttons: _angular_core.Signal<readonly ButtonDirective[]>;
|
|
21
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Dropdown and split buttons placed in the group. Their buttons follow the group's look, size, rounding and
|
|
27
|
+
* disabled state, but not its selection.
|
|
28
|
+
*/
|
|
29
|
+
protected readonly components: _angular_core.Signal<readonly _nanahoshi_mona_ui_button.ButtonGroupMember[]>;
|
|
22
30
|
protected readonly effectiveAriaLabel: _angular_core.Signal<string>;
|
|
31
|
+
protected readonly members: _angular_core.Signal<ButtonDirective[]>;
|
|
32
|
+
protected readonly messages: _angular_core.Signal<_nanahoshi_mona_ui_i18n.MonaButtonGroupMessages>;
|
|
23
33
|
/**
|
|
24
34
|
* @description When `false` and `selection` is `"single"`, at least one button must remain selected;
|
|
25
35
|
* the active button cannot be deselected. Has no effect in `"multiple"` mode.
|
|
@@ -71,7 +81,7 @@ declare class ButtonGroupComponent implements ButtonGroupVariantsInput {
|
|
|
71
81
|
constructor();
|
|
72
82
|
private setSubscriptions;
|
|
73
83
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ButtonGroupComponent, never>;
|
|
74
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ButtonGroupComponent, "mona-button-group", never, { "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "buttonClick": "buttonClick"; "disabled": "disabledChange"; "selection": "selectionChange"; }, ["buttons"], ["[monaButton]"], true, never>;
|
|
84
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ButtonGroupComponent, "mona-button-group", never, { "allowEmpty": { "alias": "allowEmpty"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "buttonClick": "buttonClick"; "disabled": "disabledChange"; "selection": "selectionChange"; }, ["buttons", "components"], ["[monaButton], mona-dropdown-button, mona-split-button"], true, never>;
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
declare const BUTTON_GROUP_DEFAULT_MESSAGES: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Signal } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Signal } from '@angular/core';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantInputs } from '@nanahoshi/mona-ui/internal';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -111,6 +111,23 @@ declare class ButtonDirective implements ButtonVariantsInput {
|
|
|
111
111
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ButtonDirective, "button[monaButton]", never, { "ariaHasPopup": { "alias": "aria-haspopup"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "iconOnly": { "alias": "iconOnly"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "toggleable": { "alias": "toggleable"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "look": "lookChange"; "selected": "selectedChange"; }, never, never, true, never>;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* A component whose own buttons join the `mona-button-group` it is placed in, such as a dropdown or split button.
|
|
116
|
+
* Those buttons follow the group's look, size, rounding and disabled state, but they aren't toggleable and take no
|
|
117
|
+
* part in the group's selection.
|
|
118
|
+
*/
|
|
119
|
+
interface ButtonGroupMember {
|
|
120
|
+
/**
|
|
121
|
+
* The component's buttons that join the group.
|
|
122
|
+
*/
|
|
123
|
+
readonly groupButtons: Signal<readonly ButtonDirective[]>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Provided by a component that implements {@link ButtonGroupMember}, so a `mona-button-group` can find it among its
|
|
127
|
+
* content children.
|
|
128
|
+
*/
|
|
129
|
+
declare const BUTTON_GROUP_MEMBER: InjectionToken<ButtonGroupMember>;
|
|
130
|
+
|
|
114
131
|
/**
|
|
115
132
|
* Coordinates a `mona-button-group` with its buttons: the group publishes its look, size, rounding, disabled state
|
|
116
133
|
* and members here, and buttons report clicks and receive selection changes through it. It is public so the
|
|
@@ -137,5 +154,5 @@ declare class ButtonService {
|
|
|
137
154
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ButtonService>;
|
|
138
155
|
}
|
|
139
156
|
|
|
140
|
-
export { ButtonDirective, ButtonService };
|
|
141
|
-
export type { ButtonAriaHasPopup, ButtonVariantProps, ButtonVariantsInput };
|
|
157
|
+
export { BUTTON_GROUP_MEMBER, ButtonDirective, ButtonService };
|
|
158
|
+
export type { ButtonAriaHasPopup, ButtonGroupMember, ButtonVariantProps, ButtonVariantsInput };
|
|
@@ -15,8 +15,7 @@ declare class ContextMenuComponent implements ContextMenuVariantInput {
|
|
|
15
15
|
protected readonly shortcutTemplate: i0.Signal<TemplateRef<any> | undefined>;
|
|
16
16
|
protected readonly textTemplate: i0.Signal<TemplateRef<any> | undefined>;
|
|
17
17
|
/**
|
|
18
|
-
* @description
|
|
19
|
-
* Not currently applied to the target element or the rendered menu.
|
|
18
|
+
* @description Accessible name for the menu. When empty, the menu is named by the target if it has an `id`.
|
|
20
19
|
*/
|
|
21
20
|
readonly ariaLabel: i0.InputSignal<string>;
|
|
22
21
|
/**
|
|
@@ -42,7 +41,10 @@ declare class ContextMenuComponent implements ContextMenuVariantInput {
|
|
|
42
41
|
*/
|
|
43
42
|
readonly size: i0.InputSignal<"small" | "medium" | "large" | null | undefined>;
|
|
44
43
|
/**
|
|
45
|
-
* @description The target element that will be used to trigger the context menu.
|
|
44
|
+
* @description The target element that will be used to trigger the context menu. It can change: the menu, its
|
|
45
|
+
* keyboard shortcuts and its ARIA attributes follow. `aria-haspopup`, `aria-expanded` and `aria-controls` are set
|
|
46
|
+
* only on targets whose role allows them (button, link, gridcell, menuitem, tab, treeitem), and are put back
|
|
47
|
+
* when the target changes or the menu is destroyed.
|
|
46
48
|
*/
|
|
47
49
|
readonly target: i0.InputSignal<HTMLElement | ElementRef<HTMLElement>>;
|
|
48
50
|
/**
|
|
@@ -54,9 +56,6 @@ declare class ContextMenuComponent implements ContextMenuVariantInput {
|
|
|
54
56
|
protected onMenuClose(): void;
|
|
55
57
|
protected onMenuOpen(): void;
|
|
56
58
|
private openMenuViaKeyboard;
|
|
57
|
-
private setKeyboardEvents;
|
|
58
|
-
private setTargetAriaAttributes;
|
|
59
|
-
private updateTargetAriaAttributes;
|
|
60
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuComponent, never>;
|
|
61
60
|
static ɵcmp: i0.ɵɵComponentDeclaration<ContextMenuComponent, "mona-contextmenu", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": true; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, { "menuClick": "menuClick"; }, ["menuItemComponents", "groupTemplate", "iconTemplate", "shortcutTemplate", "textTemplate"], never, true, never>;
|
|
62
61
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _nanahoshi_mona_ui_i18n from '@nanahoshi/mona-ui/i18n';
|
|
2
2
|
import { DialogMessages, MonaDialogMessages } from '@nanahoshi/mona-ui/i18n';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
|
-
import { ElementRef, TemplateRef, ComponentRef } from '@angular/core';
|
|
5
|
-
import { PopupCloseEvent, PopupRef } from '@nanahoshi/mona-ui/popup';
|
|
4
|
+
import { ElementRef, TemplateRef, Type, Injector, ComponentRef, InjectionToken } from '@angular/core';
|
|
5
|
+
import { PopupCloseEvent, PopupCloseSource, PopupRef } from '@nanahoshi/mona-ui/popup';
|
|
6
6
|
import { ButtonVariantProps } from '@nanahoshi/mona-ui/button';
|
|
7
7
|
import { PreventableEvent } from '@nanahoshi/mona-ui/common';
|
|
8
8
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -15,6 +15,11 @@ type ActionsLayout = "end" | "center" | "start" | "stretched";
|
|
|
15
15
|
interface DialogAction<T = unknown> {
|
|
16
16
|
cssClass?: string;
|
|
17
17
|
data?: T;
|
|
18
|
+
/**
|
|
19
|
+
* The action Enter triggers when focus is in the dialog but not on a button, link, text area or other control
|
|
20
|
+
* that handles Enter itself. Mark at most one action.
|
|
21
|
+
*/
|
|
22
|
+
default?: boolean;
|
|
18
23
|
iconOnly?: boolean;
|
|
19
24
|
look?: ButtonVariantProps["look"];
|
|
20
25
|
rounded?: ButtonVariantProps["rounded"];
|
|
@@ -71,14 +76,19 @@ declare class DialogComponent implements DialogVariantInput {
|
|
|
71
76
|
* @default "end"
|
|
72
77
|
*/
|
|
73
78
|
readonly actionsLayout: _angular_core.InputSignal<ActionsLayout>;
|
|
79
|
+
/**
|
|
80
|
+
* @description Accessible name for the dialog when it has no `title` or title template.
|
|
81
|
+
*/
|
|
82
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
74
83
|
/**
|
|
75
84
|
* @description Sets the visibility of the close button in the dialog header.
|
|
76
85
|
* @default true
|
|
77
86
|
*/
|
|
78
87
|
readonly closable: _angular_core.InputSignal<boolean>;
|
|
79
88
|
/**
|
|
80
|
-
* @description Emits
|
|
81
|
-
*
|
|
89
|
+
* @description Emits before the dialog closes, whatever closes it: an action, the close button, Escape, or the
|
|
90
|
+
* component being destroyed. Call `preventDefault()` to keep it open (a close caused by destruction can't be
|
|
91
|
+
* kept).
|
|
82
92
|
*/
|
|
83
93
|
readonly close: _angular_core.OutputEmitterRef<PopupCloseEvent<unknown>>;
|
|
84
94
|
/**
|
|
@@ -87,7 +97,7 @@ declare class DialogComponent implements DialogVariantInput {
|
|
|
87
97
|
*/
|
|
88
98
|
readonly closeOnEscape: _angular_core.InputSignal<boolean>;
|
|
89
99
|
/**
|
|
90
|
-
* @description Emits when the dialog
|
|
100
|
+
* @description Emits when the dialog has closed and its leave animation has finished.
|
|
91
101
|
*/
|
|
92
102
|
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
93
103
|
/**
|
|
@@ -128,7 +138,8 @@ declare class DialogComponent implements DialogVariantInput {
|
|
|
128
138
|
*/
|
|
129
139
|
readonly minWidth: _angular_core.InputSignal<number | undefined>;
|
|
130
140
|
/**
|
|
131
|
-
* @description
|
|
141
|
+
* @description Whether the dialog is modal: a backdrop, `aria-modal="true"`, focus kept inside, page scroll
|
|
142
|
+
* locked, and the rest of the page inert.
|
|
132
143
|
* @default true
|
|
133
144
|
*/
|
|
134
145
|
readonly modal: _angular_core.InputSignal<boolean>;
|
|
@@ -161,7 +172,7 @@ declare class DialogComponent implements DialogVariantInput {
|
|
|
161
172
|
readonly width: _angular_core.InputSignal<number | undefined>;
|
|
162
173
|
constructor();
|
|
163
174
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DialogComponent, never>;
|
|
164
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DialogComponent, "mona-dialog", never, { "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "actionsLayout": { "alias": "actionsLayout"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "focusedElement": { "alias": "focusedElement"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "left": { "alias": "left"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "messages": { "alias": "messages"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "modal": { "alias": "modal"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "top": { "alias": "top"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, { "action": "action"; "close": "close"; "closed": "closed"; }, ["contentTemplate", "descriptionTemplate", "footerTemplate", "iconTemplate", "titleTemplate"], never, true, never>;
|
|
175
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DialogComponent, "mona-dialog", never, { "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "actionsLayout": { "alias": "actionsLayout"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "focusedElement": { "alias": "focusedElement"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "left": { "alias": "left"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "messages": { "alias": "messages"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "modal": { "alias": "modal"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "top": { "alias": "top"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, { "action": "action"; "close": "close"; "closed": "closed"; }, ["contentTemplate", "descriptionTemplate", "footerTemplate", "iconTemplate", "titleTemplate"], never, true, never>;
|
|
165
176
|
}
|
|
166
177
|
|
|
167
178
|
declare class DialogContentTemplateDirective {
|
|
@@ -189,81 +200,181 @@ declare class DialogTitleTemplateDirective {
|
|
|
189
200
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DialogTitleTemplateDirective, "ng-template[monaDialogTitleTemplate]", never, {}, {}, never, never, true, never>;
|
|
190
201
|
}
|
|
191
202
|
|
|
192
|
-
|
|
193
|
-
|
|
203
|
+
/**
|
|
204
|
+
* How a dialog closed. Every close produces one: an action button (`viaClose: false`), or anything else
|
|
205
|
+
* (`viaClose: true`): the close button, Escape, a backdrop click, or `close()`.
|
|
206
|
+
*/
|
|
207
|
+
type DialogResult<R = unknown> = {
|
|
208
|
+
/** The action that closed the dialog. */
|
|
209
|
+
readonly action: DialogAction;
|
|
210
|
+
readonly via: PopupCloseSource.Action;
|
|
211
|
+
readonly viaClose: false;
|
|
194
212
|
} | {
|
|
195
|
-
|
|
196
|
-
|
|
213
|
+
/** What closed the dialog. */
|
|
214
|
+
readonly via: Exclude<PopupCloseSource, PopupCloseSource.Action>;
|
|
215
|
+
/** The value passed to `close(value)`, when the dialog was closed that way. */
|
|
216
|
+
readonly value?: R;
|
|
217
|
+
readonly viaClose: true;
|
|
197
218
|
};
|
|
198
219
|
|
|
199
|
-
interface DialogSettings {
|
|
220
|
+
interface DialogSettings<D = unknown> {
|
|
200
221
|
actions?: Iterable<DialogAction>;
|
|
201
222
|
actionsLayout?: ActionsLayout;
|
|
223
|
+
/** Accessible name for the dialog when it has no `title` or `titleTemplate`. */
|
|
224
|
+
ariaLabel?: string;
|
|
202
225
|
closable?: boolean;
|
|
203
226
|
closeOnEscape?: boolean;
|
|
204
|
-
|
|
227
|
+
/**
|
|
228
|
+
* The dialog's body: a template, or a component. A template gets the dialog's `data` as `$implicit` and the
|
|
229
|
+
* `DialogRef` as `dialogRef`; a component can inject `DIALOG_DATA` and `DialogRef`.
|
|
230
|
+
*/
|
|
231
|
+
content?: TemplateRef<unknown> | Type<unknown>;
|
|
232
|
+
/** Data for the content: `DIALOG_DATA` in a component, `$implicit` in a template. */
|
|
233
|
+
data?: D;
|
|
205
234
|
description?: string;
|
|
206
235
|
descriptionTemplate?: TemplateRef<unknown>;
|
|
207
236
|
focusedElement?: HTMLElement | ElementRef<HTMLElement> | string | null;
|
|
208
237
|
footerTemplate?: TemplateRef<unknown>;
|
|
209
238
|
height?: number;
|
|
210
239
|
iconTemplate?: TemplateRef<unknown>;
|
|
240
|
+
/**
|
|
241
|
+
* Parent injector for the dialog's content, so a component given as `content` can inject what the opener
|
|
242
|
+
* provides. Defaults to the application injector.
|
|
243
|
+
*/
|
|
244
|
+
injector?: Injector;
|
|
245
|
+
/** Distance from the viewport's left edge in pixels. When omitted, the dialog is centered horizontally. */
|
|
211
246
|
left?: number;
|
|
247
|
+
/** Maximum height in pixels. When omitted, the dialog stays 1rem inside the viewport and its body scrolls. */
|
|
212
248
|
maxHeight?: number;
|
|
249
|
+
/** Maximum width in pixels. When omitted, the dialog stays 1rem inside the viewport. */
|
|
213
250
|
maxWidth?: number;
|
|
214
251
|
messages?: Partial<DialogMessages>;
|
|
215
252
|
minHeight?: number;
|
|
216
253
|
minWidth?: number;
|
|
254
|
+
/**
|
|
255
|
+
* Whether the dialog is modal: a backdrop, `aria-modal="true"`, focus kept inside, page scroll locked, and the
|
|
256
|
+
* rest of the page inert. A non-modal dialog does none of these.
|
|
257
|
+
* @default true
|
|
258
|
+
*/
|
|
217
259
|
modal?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Whether focus goes back to where it was when the dialog opened, once it closes.
|
|
262
|
+
* @default true
|
|
263
|
+
*/
|
|
264
|
+
restoreFocus?: boolean;
|
|
218
265
|
rounded?: DialogVariantProps["rounded"];
|
|
219
266
|
text?: string;
|
|
220
267
|
title?: string;
|
|
221
268
|
titleTemplate?: TemplateRef<unknown>;
|
|
269
|
+
/** Distance from the viewport's top edge in pixels. When omitted, the dialog is centered vertically. */
|
|
222
270
|
top?: number;
|
|
223
271
|
type?: DialogVariantProps["type"];
|
|
224
272
|
width?: number;
|
|
225
273
|
}
|
|
226
274
|
|
|
227
275
|
interface DialogRefParams<R = unknown> {
|
|
276
|
+
get action$(): Observable<DialogActionEvent>;
|
|
228
277
|
close: (result?: R) => void;
|
|
229
278
|
get close$(): Observable<PopupCloseEvent<R>>;
|
|
230
|
-
get closed$(): Observable<
|
|
279
|
+
get closed$(): Observable<DialogResult<R>>;
|
|
231
280
|
get component(): ComponentRef<unknown> | null;
|
|
232
281
|
get element(): HTMLElement;
|
|
233
282
|
get height(): number;
|
|
234
283
|
get popupRef(): PopupRef;
|
|
235
|
-
get result(): Observable<DialogResult
|
|
284
|
+
get result(): Observable<DialogResult<R>>;
|
|
236
285
|
update: (data: Partial<DialogSettings>) => void;
|
|
237
286
|
get width(): number;
|
|
238
287
|
}
|
|
239
288
|
|
|
289
|
+
/**
|
|
290
|
+
* A handle on an open dialog. The close contract:
|
|
291
|
+
* - `action$` emits when an action button is clicked, before the dialog closes; `preventDefault()` keeps it open.
|
|
292
|
+
* - `close$` emits before any close, and `preventDefault()` keeps the dialog open.
|
|
293
|
+
* - `result` emits how the dialog closed as soon as the close goes ahead, and `closed$` emits the same result once
|
|
294
|
+
* the dialog is gone. All of them complete when it closes.
|
|
295
|
+
*/
|
|
240
296
|
declare class DialogRef<R = unknown> implements DialogRefParams<R> {
|
|
241
297
|
#private;
|
|
242
298
|
constructor(options: DialogRefParams<R>);
|
|
299
|
+
/**
|
|
300
|
+
* @description Closes the dialog. The value is the `value` of the result, which reports the close as
|
|
301
|
+
* programmatic.
|
|
302
|
+
*/
|
|
243
303
|
close(result?: R): void;
|
|
244
304
|
/**
|
|
245
305
|
* @description Updates the dialog's content and appearance in place without closing and reopening it.
|
|
246
306
|
* Only the fields provided are changed; anything omitted keeps its current value.
|
|
247
307
|
*/
|
|
248
308
|
update(data: Partial<DialogSettings>): void;
|
|
309
|
+
/**
|
|
310
|
+
* @description Emits when an action button is clicked, before the dialog closes. Call `preventDefault()` on
|
|
311
|
+
* the event to keep the dialog open. Completes when the dialog closes.
|
|
312
|
+
*/
|
|
313
|
+
get action$(): Observable<DialogActionEvent>;
|
|
314
|
+
/**
|
|
315
|
+
* @description Emits before the dialog closes, whatever closes it. Call `preventDefault()` to keep it open.
|
|
316
|
+
* Completes when the dialog closes.
|
|
317
|
+
*/
|
|
249
318
|
get close$(): Observable<PopupCloseEvent<R>>;
|
|
250
|
-
|
|
319
|
+
/**
|
|
320
|
+
* @description Emits the dialog's result once it has closed and its leave animation has finished, then
|
|
321
|
+
* completes.
|
|
322
|
+
*/
|
|
323
|
+
get closed$(): Observable<DialogResult<R>>;
|
|
324
|
+
/**
|
|
325
|
+
* @description The component given as `content`, or `null` for template and text content.
|
|
326
|
+
*/
|
|
251
327
|
get component(): ComponentRef<unknown> | null;
|
|
252
328
|
get element(): HTMLElement;
|
|
253
329
|
get height(): number;
|
|
254
330
|
get popupRef(): PopupRef;
|
|
255
|
-
|
|
331
|
+
/**
|
|
332
|
+
* @description Emits how the dialog closed (an action, the close button, Escape, a backdrop click or
|
|
333
|
+
* `close()`) as soon as the close goes ahead, then completes when the dialog is gone. Late subscribers get the
|
|
334
|
+
* result too.
|
|
335
|
+
*/
|
|
336
|
+
get result(): Observable<DialogResult<R>>;
|
|
256
337
|
get width(): number;
|
|
257
338
|
}
|
|
258
339
|
|
|
340
|
+
/** Settings for the `alert()` and `confirm()` helpers, which bring their own buttons. */
|
|
341
|
+
type DialogPromptSettings = Omit<DialogSettings, "actions" | "content" | "data" | "footerTemplate">;
|
|
342
|
+
/** Marks the buttons `confirm()` and `alert()` add, so their result can be read without comparing text. */
|
|
343
|
+
declare const DIALOG_OK = "ok";
|
|
344
|
+
declare const DIALOG_CANCEL = "cancel";
|
|
259
345
|
declare class DialogService {
|
|
260
346
|
#private;
|
|
261
|
-
|
|
347
|
+
/**
|
|
348
|
+
* Opens a dialog with an OK button. Emits once it closes, however it closes, then completes.
|
|
349
|
+
* The dialog opens when `alert()` is called, whether or not the result is subscribed to.
|
|
350
|
+
*/
|
|
351
|
+
alert(settings: DialogPromptSettings): Observable<void>;
|
|
352
|
+
/**
|
|
353
|
+
* Opens a confirmation dialog with OK and Cancel buttons. Emits `true` for OK and `false` for anything else
|
|
354
|
+
* (Cancel, the close button, Escape), then completes. The dialog opens when `confirm()` is called, whether or
|
|
355
|
+
* not the result is subscribed to.
|
|
356
|
+
*/
|
|
357
|
+
confirm(settings: DialogPromptSettings): Observable<boolean>;
|
|
358
|
+
/**
|
|
359
|
+
* Opens a dialog.
|
|
360
|
+
* @typeParam R the type of the value passed to `DialogRef.close(value)`
|
|
361
|
+
* @typeParam D the type of `data`
|
|
362
|
+
*/
|
|
363
|
+
show<R = unknown, D = unknown>(settings: DialogSettings<D>): DialogRef<R>;
|
|
262
364
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DialogService, never>;
|
|
263
365
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DialogService>;
|
|
264
366
|
}
|
|
265
367
|
|
|
368
|
+
/**
|
|
369
|
+
* The `data` a dialog was opened with, for a component given as its `content`.
|
|
370
|
+
* @example
|
|
371
|
+
* ```ts
|
|
372
|
+
* readonly #data = inject<{ name: string }>(DIALOG_DATA);
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
declare const DIALOG_DATA: InjectionToken<unknown>;
|
|
376
|
+
|
|
266
377
|
declare const DIALOG_DEFAULT_MESSAGES: MonaDialogMessages;
|
|
267
378
|
|
|
268
|
-
export { DIALOG_DEFAULT_MESSAGES, DialogActionEvent, DialogComponent, DialogContentTemplateDirective, DialogDescriptionTemplateDirective, DialogFooterTemplateDirective, DialogIconTemplateDirective, DialogRef, DialogService, DialogTitleTemplateDirective };
|
|
269
|
-
export type { ActionsLayout, DialogAction, DialogResult, DialogSettings, DialogVariantProps };
|
|
379
|
+
export { DIALOG_CANCEL, DIALOG_DATA, DIALOG_DEFAULT_MESSAGES, DIALOG_OK, DialogActionEvent, DialogComponent, DialogContentTemplateDirective, DialogDescriptionTemplateDirective, DialogFooterTemplateDirective, DialogIconTemplateDirective, DialogRef, DialogService, DialogTitleTemplateDirective };
|
|
380
|
+
export type { ActionsLayout, DialogAction, DialogPromptSettings, DialogResult, DialogSettings, DialogVariantProps };
|