@memberjunction/ng-ui-components 5.44.0 → 5.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/confirm-dialog/confirm-dialog.component.d.ts +102 -0
- package/dist/lib/confirm-dialog/confirm-dialog.component.d.ts.map +1 -0
- package/dist/lib/confirm-dialog/confirm-dialog.component.js +259 -0
- package/dist/lib/confirm-dialog/confirm-dialog.component.js.map +1 -0
- package/dist/lib/confirm-dialog/confirm-dialog.service.d.ts +78 -0
- package/dist/lib/confirm-dialog/confirm-dialog.service.d.ts.map +1 -0
- package/dist/lib/confirm-dialog/confirm-dialog.service.js +125 -0
- package/dist/lib/confirm-dialog/confirm-dialog.service.js.map +1 -0
- package/dist/lib/dialog/dialog.component.d.ts +8 -1
- package/dist/lib/dialog/dialog.component.d.ts.map +1 -1
- package/dist/lib/dialog/dialog.component.js +15 -6
- package/dist/lib/dialog/dialog.component.js.map +1 -1
- package/dist/lib/slide-panel/slide-panel.component.js +2 -2
- package/dist/public-api.d.ts +2 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +2 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Visual intent of an `<mj-confirm-dialog>`. Drives the header icon and the
|
|
5
|
+
* confirm button's color, so callers rarely restate either.
|
|
6
|
+
*
|
|
7
|
+
* - `default` — a neutral question (e.g. "Discard unsaved changes?"). Blue confirm button.
|
|
8
|
+
* - `danger` — a destructive / irreversible action (delete). Red confirm button.
|
|
9
|
+
* - `warning` — a non-destructive but consequential action. Blue confirm button, caution icon.
|
|
10
|
+
* - `info` — an informational confirmation. Blue confirm button, info icon.
|
|
11
|
+
*/
|
|
12
|
+
export type MJConfirmDialogType = 'default' | 'danger' | 'warning' | 'info';
|
|
13
|
+
/**
|
|
14
|
+
* mj-confirm-dialog — Canonical confirmation prompt. The shared replacement for
|
|
15
|
+
* native `window.confirm()` and the many hand-rolled "Are you sure?" modals
|
|
16
|
+
* (`@if (showDeleteConfirm) { … backdrop + centered dialog }`) scattered across
|
|
17
|
+
* the app, plus the duplicate local `mj-confirm-dialog` / `mj-ev-confirm-dialog`
|
|
18
|
+
* components.
|
|
19
|
+
*
|
|
20
|
+
* Built on `<mj-dialog>` (so it inherits the backdrop, animations, mobile
|
|
21
|
+
* full-screen behavior, and Esc/backdrop handling) and uses `role="alertdialog"`
|
|
22
|
+
* for screen readers. Buttons follow the MJ convention: the affirmative action
|
|
23
|
+
* is **leftmost**, Cancel on the right.
|
|
24
|
+
*
|
|
25
|
+
* Visibility is two-way bindable. Cancelling (Cancel button, backdrop, Esc, or
|
|
26
|
+
* the ✕) auto-closes and emits `Cancelled`. Confirming emits `Confirmed` and
|
|
27
|
+
* **leaves the dialog open** so the handler can run async work — set `Visible`
|
|
28
|
+
* to `false` (or update your bound property) when done. Bind `[Processing]` to a
|
|
29
|
+
* loading flag during that async work to show a spinner, disable both buttons,
|
|
30
|
+
* and block dismissal until it completes.
|
|
31
|
+
*
|
|
32
|
+
* Usage:
|
|
33
|
+
* ```html
|
|
34
|
+
* <!-- Simple destructive confirm -->
|
|
35
|
+
* <mj-confirm-dialog
|
|
36
|
+
* [(Visible)]="showDeleteConfirm"
|
|
37
|
+
* Type="danger"
|
|
38
|
+
* Title="Delete view"
|
|
39
|
+
* Message="Are you sure you want to delete this view?"
|
|
40
|
+
* DetailMessage="This action cannot be undone."
|
|
41
|
+
* ConfirmText="Delete"
|
|
42
|
+
* (Confirmed)="onDeleteConfirmed()">
|
|
43
|
+
* </mj-confirm-dialog>
|
|
44
|
+
*
|
|
45
|
+
* <!-- Async confirm with a spinner while the work runs -->
|
|
46
|
+
* <mj-confirm-dialog
|
|
47
|
+
* [(Visible)]="confirmOpen"
|
|
48
|
+
* [Processing]="isDeleting"
|
|
49
|
+
* Type="danger" Title="Delete user" Message="Remove this user permanently?"
|
|
50
|
+
* ConfirmText="Delete" (Confirmed)="deleteUser()">
|
|
51
|
+
* </mj-confirm-dialog>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare class MJConfirmDialogComponent {
|
|
55
|
+
/** Whether the dialog is shown. Two-way bindable: `[(Visible)]`. */
|
|
56
|
+
Visible: boolean;
|
|
57
|
+
/** Two-way `Visible` change channel — fires when the dialog auto-closes on cancel. */
|
|
58
|
+
VisibleChange: EventEmitter<boolean>;
|
|
59
|
+
/** Heading shown in the dialog title bar. */
|
|
60
|
+
Title: string;
|
|
61
|
+
/** Primary prompt text. For rich content, project default `<ng-content>` instead. */
|
|
62
|
+
Message: string;
|
|
63
|
+
/** Optional secondary line, rendered smaller/muted beneath the message. */
|
|
64
|
+
DetailMessage: string;
|
|
65
|
+
/** Visual intent — drives the header icon + confirm button color. Defaults to 'default'. */
|
|
66
|
+
Type: MJConfirmDialogType;
|
|
67
|
+
/** Affirmative button label. */
|
|
68
|
+
ConfirmText: string;
|
|
69
|
+
/** Dismiss button label. */
|
|
70
|
+
CancelText: string;
|
|
71
|
+
/**
|
|
72
|
+
* Font Awesome icon class (e.g. "fa-solid fa-trash") for the header. When
|
|
73
|
+
* omitted, a sensible default is chosen from `Type`. Set to `''` for no icon.
|
|
74
|
+
*/
|
|
75
|
+
Icon: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* When true, shows a spinner on the confirm button, disables both buttons, and
|
|
78
|
+
* blocks dismissal (Esc / backdrop / ✕) — bind this to your loading flag while
|
|
79
|
+
* the `Confirmed` handler runs async work.
|
|
80
|
+
*/
|
|
81
|
+
Processing: boolean;
|
|
82
|
+
/** Fired when the user confirms. The dialog stays open; close it when ready. */
|
|
83
|
+
Confirmed: EventEmitter<void>;
|
|
84
|
+
/** Fired when the user cancels (button, backdrop, Esc, or ✕). The dialog auto-closes. */
|
|
85
|
+
Cancelled: EventEmitter<void>;
|
|
86
|
+
/** mjButton variant for the confirm button — red for `danger`, blue otherwise. */
|
|
87
|
+
get ConfirmVariant(): 'primary' | 'danger';
|
|
88
|
+
/**
|
|
89
|
+
* Icon actually rendered: the explicit `Icon` when provided (including `""`
|
|
90
|
+
* to suppress it), otherwise the per-type default.
|
|
91
|
+
*/
|
|
92
|
+
get ResolvedIcon(): string;
|
|
93
|
+
onConfirm(): void;
|
|
94
|
+
onCancel(): void;
|
|
95
|
+
/** Backdrop / Esc / ✕ from the underlying dialog — ignored while Processing. */
|
|
96
|
+
onDismiss(): void;
|
|
97
|
+
private close;
|
|
98
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MJConfirmDialogComponent, never>;
|
|
99
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MJConfirmDialogComponent, "mj-confirm-dialog", never, { "Visible": { "alias": "Visible"; "required": false; }; "Title": { "alias": "Title"; "required": false; }; "Message": { "alias": "Message"; "required": false; }; "DetailMessage": { "alias": "DetailMessage"; "required": false; }; "Type": { "alias": "Type"; "required": false; }; "ConfirmText": { "alias": "ConfirmText"; "required": false; }; "CancelText": { "alias": "CancelText"; "required": false; }; "Icon": { "alias": "Icon"; "required": false; }; "Processing": { "alias": "Processing"; "required": false; }; }, { "VisibleChange": "VisibleChange"; "Confirmed": "Confirmed"; "Cancelled": "Cancelled"; }, never, ["*"], true, never>;
|
|
100
|
+
static ngAcceptInputType_Processing: unknown;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=confirm-dialog.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-dialog.component.d.ts","sourceRoot":"","sources":["../../../src/lib/confirm-dialog/confirm-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAmC,MAAM,eAAe,CAAC;;AAIzF;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAS5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBA+Ea,wBAAwB;IACnC,oEAAoE;IAC3D,OAAO,UAAS;IACzB,sFAAsF;IAC5E,aAAa,wBAA+B;IAEtD,6CAA6C;IACpC,KAAK,SAAa;IAE3B,qFAAqF;IAC5E,OAAO,SAAmB;IAEnC,2EAA2E;IAClE,aAAa,SAAM;IAE5B,4FAA4F;IACnF,IAAI,EAAE,mBAAmB,CAAa;IAE/C,gCAAgC;IACvB,WAAW,SAAa;IAEjC,4BAA4B;IACnB,UAAU,SAAY;IAE/B;;;OAGG;IACM,IAAI,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEpC;;;;OAIG;IACqC,UAAU,UAAS;IAE3D,gFAAgF;IACtE,SAAS,qBAA4B;IAE/C,yFAAyF;IAC/E,SAAS,qBAA4B;IAE/C,kFAAkF;IAClF,IAAI,cAAc,IAAI,SAAS,GAAG,QAAQ,CAEzC;IAED;;;OAGG;IACH,IAAI,YAAY,IAAI,MAAM,CAKzB;IAED,SAAS,IAAI,IAAI;IAIjB,QAAQ,IAAI,IAAI;IAKhB,gFAAgF;IAChF,SAAS,IAAI,IAAI;IAOjB,OAAO,CAAC,KAAK;yCA5EF,wBAAwB;2CAAxB,wBAAwB;yCAiFms7L,OAAQ;CAD/u7L"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output, booleanAttribute } from '@angular/core';
|
|
2
|
+
import { MJDialogComponent, MJDialogActionsComponent } from '../dialog/dialog.component';
|
|
3
|
+
import { MJButtonDirective } from '../button/button.directive';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
const _c0 = ["*"];
|
|
6
|
+
function MJConfirmDialogComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
7
|
+
i0.ɵɵelement(0, "i", 9);
|
|
8
|
+
} if (rf & 2) {
|
|
9
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
10
|
+
i0.ɵɵclassMap(i0.ɵɵinterpolate2("mj-confirm__icon mj-confirm__icon--", ctx_r0.Type, " ", ctx_r0.ResolvedIcon));
|
|
11
|
+
} }
|
|
12
|
+
function MJConfirmDialogComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
13
|
+
i0.ɵɵelementStart(0, "p", 4);
|
|
14
|
+
i0.ɵɵtext(1);
|
|
15
|
+
i0.ɵɵelementEnd();
|
|
16
|
+
} if (rf & 2) {
|
|
17
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
18
|
+
i0.ɵɵadvance();
|
|
19
|
+
i0.ɵɵtextInterpolate(ctx_r0.Message);
|
|
20
|
+
} }
|
|
21
|
+
function MJConfirmDialogComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
+
i0.ɵɵelementStart(0, "p", 5);
|
|
23
|
+
i0.ɵɵtext(1);
|
|
24
|
+
i0.ɵɵelementEnd();
|
|
25
|
+
} if (rf & 2) {
|
|
26
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
27
|
+
i0.ɵɵadvance();
|
|
28
|
+
i0.ɵɵtextInterpolate(ctx_r0.DetailMessage);
|
|
29
|
+
} }
|
|
30
|
+
function MJConfirmDialogComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
31
|
+
i0.ɵɵelement(0, "i", 7);
|
|
32
|
+
} }
|
|
33
|
+
const DEFAULT_ICONS = {
|
|
34
|
+
default: 'fa-solid fa-circle-question',
|
|
35
|
+
danger: 'fa-solid fa-triangle-exclamation',
|
|
36
|
+
warning: 'fa-solid fa-triangle-exclamation',
|
|
37
|
+
info: 'fa-solid fa-circle-info',
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* mj-confirm-dialog — Canonical confirmation prompt. The shared replacement for
|
|
41
|
+
* native `window.confirm()` and the many hand-rolled "Are you sure?" modals
|
|
42
|
+
* (`@if (showDeleteConfirm) { … backdrop + centered dialog }`) scattered across
|
|
43
|
+
* the app, plus the duplicate local `mj-confirm-dialog` / `mj-ev-confirm-dialog`
|
|
44
|
+
* components.
|
|
45
|
+
*
|
|
46
|
+
* Built on `<mj-dialog>` (so it inherits the backdrop, animations, mobile
|
|
47
|
+
* full-screen behavior, and Esc/backdrop handling) and uses `role="alertdialog"`
|
|
48
|
+
* for screen readers. Buttons follow the MJ convention: the affirmative action
|
|
49
|
+
* is **leftmost**, Cancel on the right.
|
|
50
|
+
*
|
|
51
|
+
* Visibility is two-way bindable. Cancelling (Cancel button, backdrop, Esc, or
|
|
52
|
+
* the ✕) auto-closes and emits `Cancelled`. Confirming emits `Confirmed` and
|
|
53
|
+
* **leaves the dialog open** so the handler can run async work — set `Visible`
|
|
54
|
+
* to `false` (or update your bound property) when done. Bind `[Processing]` to a
|
|
55
|
+
* loading flag during that async work to show a spinner, disable both buttons,
|
|
56
|
+
* and block dismissal until it completes.
|
|
57
|
+
*
|
|
58
|
+
* Usage:
|
|
59
|
+
* ```html
|
|
60
|
+
* <!-- Simple destructive confirm -->
|
|
61
|
+
* <mj-confirm-dialog
|
|
62
|
+
* [(Visible)]="showDeleteConfirm"
|
|
63
|
+
* Type="danger"
|
|
64
|
+
* Title="Delete view"
|
|
65
|
+
* Message="Are you sure you want to delete this view?"
|
|
66
|
+
* DetailMessage="This action cannot be undone."
|
|
67
|
+
* ConfirmText="Delete"
|
|
68
|
+
* (Confirmed)="onDeleteConfirmed()">
|
|
69
|
+
* </mj-confirm-dialog>
|
|
70
|
+
*
|
|
71
|
+
* <!-- Async confirm with a spinner while the work runs -->
|
|
72
|
+
* <mj-confirm-dialog
|
|
73
|
+
* [(Visible)]="confirmOpen"
|
|
74
|
+
* [Processing]="isDeleting"
|
|
75
|
+
* Type="danger" Title="Delete user" Message="Remove this user permanently?"
|
|
76
|
+
* ConfirmText="Delete" (Confirmed)="deleteUser()">
|
|
77
|
+
* </mj-confirm-dialog>
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export class MJConfirmDialogComponent {
|
|
81
|
+
/** Whether the dialog is shown. Two-way bindable: `[(Visible)]`. */
|
|
82
|
+
Visible = false;
|
|
83
|
+
/** Two-way `Visible` change channel — fires when the dialog auto-closes on cancel. */
|
|
84
|
+
VisibleChange = new EventEmitter();
|
|
85
|
+
/** Heading shown in the dialog title bar. */
|
|
86
|
+
Title = 'Confirm';
|
|
87
|
+
/** Primary prompt text. For rich content, project default `<ng-content>` instead. */
|
|
88
|
+
Message = 'Are you sure?';
|
|
89
|
+
/** Optional secondary line, rendered smaller/muted beneath the message. */
|
|
90
|
+
DetailMessage = '';
|
|
91
|
+
/** Visual intent — drives the header icon + confirm button color. Defaults to 'default'. */
|
|
92
|
+
Type = 'default';
|
|
93
|
+
/** Affirmative button label. */
|
|
94
|
+
ConfirmText = 'Confirm';
|
|
95
|
+
/** Dismiss button label. */
|
|
96
|
+
CancelText = 'Cancel';
|
|
97
|
+
/**
|
|
98
|
+
* Font Awesome icon class (e.g. "fa-solid fa-trash") for the header. When
|
|
99
|
+
* omitted, a sensible default is chosen from `Type`. Set to `''` for no icon.
|
|
100
|
+
*/
|
|
101
|
+
Icon = null;
|
|
102
|
+
/**
|
|
103
|
+
* When true, shows a spinner on the confirm button, disables both buttons, and
|
|
104
|
+
* blocks dismissal (Esc / backdrop / ✕) — bind this to your loading flag while
|
|
105
|
+
* the `Confirmed` handler runs async work.
|
|
106
|
+
*/
|
|
107
|
+
Processing = false;
|
|
108
|
+
/** Fired when the user confirms. The dialog stays open; close it when ready. */
|
|
109
|
+
Confirmed = new EventEmitter();
|
|
110
|
+
/** Fired when the user cancels (button, backdrop, Esc, or ✕). The dialog auto-closes. */
|
|
111
|
+
Cancelled = new EventEmitter();
|
|
112
|
+
/** mjButton variant for the confirm button — red for `danger`, blue otherwise. */
|
|
113
|
+
get ConfirmVariant() {
|
|
114
|
+
return this.Type === 'danger' ? 'danger' : 'primary';
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Icon actually rendered: the explicit `Icon` when provided (including `""`
|
|
118
|
+
* to suppress it), otherwise the per-type default.
|
|
119
|
+
*/
|
|
120
|
+
get ResolvedIcon() {
|
|
121
|
+
if (this.Icon != null) {
|
|
122
|
+
return this.Icon;
|
|
123
|
+
}
|
|
124
|
+
return DEFAULT_ICONS[this.Type] ?? DEFAULT_ICONS.default;
|
|
125
|
+
}
|
|
126
|
+
onConfirm() {
|
|
127
|
+
this.Confirmed.emit();
|
|
128
|
+
}
|
|
129
|
+
onCancel() {
|
|
130
|
+
this.close();
|
|
131
|
+
this.Cancelled.emit();
|
|
132
|
+
}
|
|
133
|
+
/** Backdrop / Esc / ✕ from the underlying dialog — ignored while Processing. */
|
|
134
|
+
onDismiss() {
|
|
135
|
+
if (this.Processing) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.onCancel();
|
|
139
|
+
}
|
|
140
|
+
close() {
|
|
141
|
+
this.Visible = false;
|
|
142
|
+
this.VisibleChange.emit(false);
|
|
143
|
+
}
|
|
144
|
+
static ɵfac = function MJConfirmDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MJConfirmDialogComponent)(); };
|
|
145
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJConfirmDialogComponent, selectors: [["mj-confirm-dialog"]], inputs: { Visible: "Visible", Title: "Title", Message: "Message", DetailMessage: "DetailMessage", Type: "Type", ConfirmText: "ConfirmText", CancelText: "CancelText", Icon: "Icon", Processing: [2, "Processing", "Processing", booleanAttribute] }, outputs: { VisibleChange: "VisibleChange", Confirmed: "Confirmed", Cancelled: "Cancelled" }, ngContentSelectors: _c0, decls: 13, vars: 12, consts: [["Size", "sm", "Role", "alertdialog", 3, "Close", "Visible", "Title", "Closeable"], [1, "mj-confirm"], ["aria-hidden", "true", 3, "class"], [1, "mj-confirm__body"], [1, "mj-confirm__message"], [1, "mj-confirm__detail"], ["mjButton", "", 3, "click", "variant", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-spinner", "fa-spin"], ["mjButton", "", "variant", "secondary", 3, "click", "disabled"], ["aria-hidden", "true"]], template: function MJConfirmDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
146
|
+
i0.ɵɵprojectionDef();
|
|
147
|
+
i0.ɵɵelementStart(0, "mj-dialog", 0);
|
|
148
|
+
i0.ɵɵlistener("Close", function MJConfirmDialogComponent_Template_mj_dialog_Close_0_listener() { return ctx.onDismiss(); });
|
|
149
|
+
i0.ɵɵelementStart(1, "div", 1);
|
|
150
|
+
i0.ɵɵconditionalCreate(2, MJConfirmDialogComponent_Conditional_2_Template, 1, 4, "i", 2);
|
|
151
|
+
i0.ɵɵelementStart(3, "div", 3);
|
|
152
|
+
i0.ɵɵconditionalCreate(4, MJConfirmDialogComponent_Conditional_4_Template, 2, 1, "p", 4);
|
|
153
|
+
i0.ɵɵconditionalCreate(5, MJConfirmDialogComponent_Conditional_5_Template, 2, 1, "p", 5);
|
|
154
|
+
i0.ɵɵprojection(6);
|
|
155
|
+
i0.ɵɵelementEnd()();
|
|
156
|
+
i0.ɵɵelementStart(7, "mj-dialog-actions")(8, "button", 6);
|
|
157
|
+
i0.ɵɵlistener("click", function MJConfirmDialogComponent_Template_button_click_8_listener() { return ctx.onConfirm(); });
|
|
158
|
+
i0.ɵɵconditionalCreate(9, MJConfirmDialogComponent_Conditional_9_Template, 1, 0, "i", 7);
|
|
159
|
+
i0.ɵɵtext(10);
|
|
160
|
+
i0.ɵɵelementEnd();
|
|
161
|
+
i0.ɵɵelementStart(11, "button", 8);
|
|
162
|
+
i0.ɵɵlistener("click", function MJConfirmDialogComponent_Template_button_click_11_listener() { return ctx.onCancel(); });
|
|
163
|
+
i0.ɵɵtext(12);
|
|
164
|
+
i0.ɵɵelementEnd()()();
|
|
165
|
+
} if (rf & 2) {
|
|
166
|
+
i0.ɵɵproperty("Visible", ctx.Visible)("Title", ctx.Title)("Closeable", !ctx.Processing);
|
|
167
|
+
i0.ɵɵadvance(2);
|
|
168
|
+
i0.ɵɵconditional(ctx.ResolvedIcon ? 2 : -1);
|
|
169
|
+
i0.ɵɵadvance(2);
|
|
170
|
+
i0.ɵɵconditional(ctx.Message ? 4 : -1);
|
|
171
|
+
i0.ɵɵadvance();
|
|
172
|
+
i0.ɵɵconditional(ctx.DetailMessage ? 5 : -1);
|
|
173
|
+
i0.ɵɵadvance(3);
|
|
174
|
+
i0.ɵɵproperty("variant", ctx.ConfirmVariant)("disabled", ctx.Processing);
|
|
175
|
+
i0.ɵɵadvance();
|
|
176
|
+
i0.ɵɵconditional(ctx.Processing ? 9 : -1);
|
|
177
|
+
i0.ɵɵadvance();
|
|
178
|
+
i0.ɵɵtextInterpolate1(" ", ctx.ConfirmText, " ");
|
|
179
|
+
i0.ɵɵadvance();
|
|
180
|
+
i0.ɵɵproperty("disabled", ctx.Processing);
|
|
181
|
+
i0.ɵɵadvance();
|
|
182
|
+
i0.ɵɵtextInterpolate1(" ", ctx.CancelText, " ");
|
|
183
|
+
} }, dependencies: [MJDialogComponent, MJDialogActionsComponent, MJButtonDirective], styles: [".mj-confirm[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-start;\n gap: var(--mj-space-3);\n }\n .mj-confirm__icon[_ngcontent-%COMP%] {\n flex-shrink: 0;\n font-size: 1.5rem;\n margin-top: 0.05em;\n color: var(--mj-text-muted);\n }\n .mj-confirm__icon--danger[_ngcontent-%COMP%] { color: var(--mj-status-error); }\n .mj-confirm__icon--warning[_ngcontent-%COMP%] { color: var(--mj-status-warning); }\n .mj-confirm__icon--info[_ngcontent-%COMP%] { color: var(--mj-status-info); }\n\n .mj-confirm__body[_ngcontent-%COMP%] { flex: 1; min-width: 0; }\n .mj-confirm__message[_ngcontent-%COMP%] {\n margin: 0;\n color: var(--mj-text-primary);\n line-height: 1.5;\n }\n .mj-confirm__detail[_ngcontent-%COMP%] {\n margin: var(--mj-space-2) 0 0;\n font-size: var(--mj-text-sm);\n color: var(--mj-text-secondary);\n line-height: 1.45;\n }"] });
|
|
184
|
+
}
|
|
185
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJConfirmDialogComponent, [{
|
|
186
|
+
type: Component,
|
|
187
|
+
args: [{ selector: 'mj-confirm-dialog', standalone: true, imports: [MJDialogComponent, MJDialogActionsComponent, MJButtonDirective], template: `
|
|
188
|
+
<mj-dialog
|
|
189
|
+
[Visible]="Visible"
|
|
190
|
+
[Title]="Title"
|
|
191
|
+
Size="sm"
|
|
192
|
+
Role="alertdialog"
|
|
193
|
+
[Closeable]="!Processing"
|
|
194
|
+
(Close)="onDismiss()">
|
|
195
|
+
|
|
196
|
+
<div class="mj-confirm">
|
|
197
|
+
@if (ResolvedIcon) {
|
|
198
|
+
<i class="mj-confirm__icon mj-confirm__icon--{{ Type }} {{ ResolvedIcon }}" aria-hidden="true"></i>
|
|
199
|
+
}
|
|
200
|
+
<div class="mj-confirm__body">
|
|
201
|
+
@if (Message) {
|
|
202
|
+
<p class="mj-confirm__message">{{ Message }}</p>
|
|
203
|
+
}
|
|
204
|
+
@if (DetailMessage) {
|
|
205
|
+
<p class="mj-confirm__detail">{{ DetailMessage }}</p>
|
|
206
|
+
}
|
|
207
|
+
<ng-content></ng-content>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<mj-dialog-actions>
|
|
212
|
+
<button
|
|
213
|
+
mjButton
|
|
214
|
+
[variant]="ConfirmVariant"
|
|
215
|
+
[disabled]="Processing"
|
|
216
|
+
(click)="onConfirm()">
|
|
217
|
+
@if (Processing) {
|
|
218
|
+
<i class="fa-solid fa-spinner fa-spin" aria-hidden="true"></i>
|
|
219
|
+
}
|
|
220
|
+
{{ ConfirmText }}
|
|
221
|
+
</button>
|
|
222
|
+
<button
|
|
223
|
+
mjButton
|
|
224
|
+
variant="secondary"
|
|
225
|
+
[disabled]="Processing"
|
|
226
|
+
(click)="onCancel()">
|
|
227
|
+
{{ CancelText }}
|
|
228
|
+
</button>
|
|
229
|
+
</mj-dialog-actions>
|
|
230
|
+
</mj-dialog>
|
|
231
|
+
`, styles: ["\n .mj-confirm {\n display: flex;\n align-items: flex-start;\n gap: var(--mj-space-3);\n }\n .mj-confirm__icon {\n flex-shrink: 0;\n font-size: 1.5rem;\n margin-top: 0.05em;\n color: var(--mj-text-muted);\n }\n .mj-confirm__icon--danger { color: var(--mj-status-error); }\n .mj-confirm__icon--warning { color: var(--mj-status-warning); }\n .mj-confirm__icon--info { color: var(--mj-status-info); }\n\n .mj-confirm__body { flex: 1; min-width: 0; }\n .mj-confirm__message {\n margin: 0;\n color: var(--mj-text-primary);\n line-height: 1.5;\n }\n .mj-confirm__detail {\n margin: var(--mj-space-2) 0 0;\n font-size: var(--mj-text-sm);\n color: var(--mj-text-secondary);\n line-height: 1.45;\n }\n "] }]
|
|
232
|
+
}], null, { Visible: [{
|
|
233
|
+
type: Input
|
|
234
|
+
}], VisibleChange: [{
|
|
235
|
+
type: Output
|
|
236
|
+
}], Title: [{
|
|
237
|
+
type: Input
|
|
238
|
+
}], Message: [{
|
|
239
|
+
type: Input
|
|
240
|
+
}], DetailMessage: [{
|
|
241
|
+
type: Input
|
|
242
|
+
}], Type: [{
|
|
243
|
+
type: Input
|
|
244
|
+
}], ConfirmText: [{
|
|
245
|
+
type: Input
|
|
246
|
+
}], CancelText: [{
|
|
247
|
+
type: Input
|
|
248
|
+
}], Icon: [{
|
|
249
|
+
type: Input
|
|
250
|
+
}], Processing: [{
|
|
251
|
+
type: Input,
|
|
252
|
+
args: [{ transform: booleanAttribute }]
|
|
253
|
+
}], Confirmed: [{
|
|
254
|
+
type: Output
|
|
255
|
+
}], Cancelled: [{
|
|
256
|
+
type: Output
|
|
257
|
+
}] }); })();
|
|
258
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJConfirmDialogComponent, { className: "MJConfirmDialogComponent", filePath: "lib/confirm-dialog/confirm-dialog.component.ts", lineNumber: 143 }); })();
|
|
259
|
+
//# sourceMappingURL=confirm-dialog.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/confirm-dialog/confirm-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;;;;IA4ErD,uBAAmG;;;IAAhG,cAAA,+FAAwE,CAAA;;;IAIzE,4BAA+B;IAAA,YAAa;IAAA,iBAAI;;;IAAjB,cAAa;IAAb,oCAAa;;;IAG5C,4BAA8B;IAAA,YAAmB;IAAA,iBAAI;;;IAAvB,cAAmB;IAAnB,0CAAmB;;;IAajD,uBAA8D;;AAnF1E,MAAM,aAAa,GAAwC;IACzD,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,kCAAkC;IAC1C,OAAO,EAAE,kCAAkC;IAC3C,IAAI,EAAE,yBAAyB;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAgFH,MAAM,OAAO,wBAAwB;IACnC,oEAAoE;IAC3D,OAAO,GAAG,KAAK,CAAC;IACzB,sFAAsF;IAC5E,aAAa,GAAG,IAAI,YAAY,EAAW,CAAC;IAEtD,6CAA6C;IACpC,KAAK,GAAG,SAAS,CAAC;IAE3B,qFAAqF;IAC5E,OAAO,GAAG,eAAe,CAAC;IAEnC,2EAA2E;IAClE,aAAa,GAAG,EAAE,CAAC;IAE5B,4FAA4F;IACnF,IAAI,GAAwB,SAAS,CAAC;IAE/C,gCAAgC;IACvB,WAAW,GAAG,SAAS,CAAC;IAEjC,4BAA4B;IACnB,UAAU,GAAG,QAAQ,CAAC;IAE/B;;;OAGG;IACM,IAAI,GAAkB,IA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AW,IAAC;YACrB,wFAAkB;YAGlB,aACF;YAAA,iBAAS;YACT,kCAIuB;YAArB,sGAAS,cAAU,IAAC;YACpB,aACF;YAEJ,AADE,AADE,iBAAS,EACS,EACV;;YArCV,AAHA,AADA,qCAAmB,oBACJ,8BAGU;YAIvB,eAEC;YAFD,2CAEC;YAEC,eAEC;YAFD,sCAEC;YACD,cAEC;YAFD,4CAEC;YAQD,eAA0B;YAC1B,AADA,4CAA0B,4BACH;YAEvB,cAEC;YAFD,yCAEC;YACD,cACF;YADE,gDACF;YAIE,cAAuB;YAAvB,yCAAuB;YAEvB,cACF;YADE,+CACF;4BA1CI,iBAAiB,EAAE,wBAAwB,EAAE,iBAAiB;;iFA4E7D,wBAAwB;cA/EpC,SAAS;2BACE,mBAAmB,cACjB,IAAI,WACP,CAAC,iBAAiB,EAAE,wBAAwB,EAAE,iBAAiB,CAAC,YAC/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CT;;kBAiCA,KAAK;;kBAEL,MAAM;;kBAGN,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAML,KAAK;;kBAOL,KAAK;mBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;kBAGrC,MAAM;;kBAGN,MAAM;;kFAzCI,wBAAwB","sourcesContent":["import { Component, EventEmitter, Input, Output, booleanAttribute } from '@angular/core';\nimport { MJDialogComponent, MJDialogActionsComponent } from '../dialog/dialog.component';\nimport { MJButtonDirective } from '../button/button.directive';\n\n/**\n * Visual intent of an `<mj-confirm-dialog>`. Drives the header icon and the\n * confirm button's color, so callers rarely restate either.\n *\n * - `default` — a neutral question (e.g. \"Discard unsaved changes?\"). Blue confirm button.\n * - `danger` — a destructive / irreversible action (delete). Red confirm button.\n * - `warning` — a non-destructive but consequential action. Blue confirm button, caution icon.\n * - `info` — an informational confirmation. Blue confirm button, info icon.\n */\nexport type MJConfirmDialogType = 'default' | 'danger' | 'warning' | 'info';\n\nconst DEFAULT_ICONS: Record<MJConfirmDialogType, string> = {\n default: 'fa-solid fa-circle-question',\n danger: 'fa-solid fa-triangle-exclamation',\n warning: 'fa-solid fa-triangle-exclamation',\n info: 'fa-solid fa-circle-info',\n};\n\n/**\n * mj-confirm-dialog — Canonical confirmation prompt. The shared replacement for\n * native `window.confirm()` and the many hand-rolled \"Are you sure?\" modals\n * (`@if (showDeleteConfirm) { … backdrop + centered dialog }`) scattered across\n * the app, plus the duplicate local `mj-confirm-dialog` / `mj-ev-confirm-dialog`\n * components.\n *\n * Built on `<mj-dialog>` (so it inherits the backdrop, animations, mobile\n * full-screen behavior, and Esc/backdrop handling) and uses `role=\"alertdialog\"`\n * for screen readers. Buttons follow the MJ convention: the affirmative action\n * is **leftmost**, Cancel on the right.\n *\n * Visibility is two-way bindable. Cancelling (Cancel button, backdrop, Esc, or\n * the ✕) auto-closes and emits `Cancelled`. Confirming emits `Confirmed` and\n * **leaves the dialog open** so the handler can run async work — set `Visible`\n * to `false` (or update your bound property) when done. Bind `[Processing]` to a\n * loading flag during that async work to show a spinner, disable both buttons,\n * and block dismissal until it completes.\n *\n * Usage:\n * ```html\n * <!-- Simple destructive confirm -->\n * <mj-confirm-dialog\n * [(Visible)]=\"showDeleteConfirm\"\n * Type=\"danger\"\n * Title=\"Delete view\"\n * Message=\"Are you sure you want to delete this view?\"\n * DetailMessage=\"This action cannot be undone.\"\n * ConfirmText=\"Delete\"\n * (Confirmed)=\"onDeleteConfirmed()\">\n * </mj-confirm-dialog>\n *\n * <!-- Async confirm with a spinner while the work runs -->\n * <mj-confirm-dialog\n * [(Visible)]=\"confirmOpen\"\n * [Processing]=\"isDeleting\"\n * Type=\"danger\" Title=\"Delete user\" Message=\"Remove this user permanently?\"\n * ConfirmText=\"Delete\" (Confirmed)=\"deleteUser()\">\n * </mj-confirm-dialog>\n * ```\n */\n@Component({\n selector: 'mj-confirm-dialog',\n standalone: true,\n imports: [MJDialogComponent, MJDialogActionsComponent, MJButtonDirective],\n template: `\n <mj-dialog\n [Visible]=\"Visible\"\n [Title]=\"Title\"\n Size=\"sm\"\n Role=\"alertdialog\"\n [Closeable]=\"!Processing\"\n (Close)=\"onDismiss()\">\n\n <div class=\"mj-confirm\">\n @if (ResolvedIcon) {\n <i class=\"mj-confirm__icon mj-confirm__icon--{{ Type }} {{ ResolvedIcon }}\" aria-hidden=\"true\"></i>\n }\n <div class=\"mj-confirm__body\">\n @if (Message) {\n <p class=\"mj-confirm__message\">{{ Message }}</p>\n }\n @if (DetailMessage) {\n <p class=\"mj-confirm__detail\">{{ DetailMessage }}</p>\n }\n <ng-content></ng-content>\n </div>\n </div>\n\n <mj-dialog-actions>\n <button\n mjButton\n [variant]=\"ConfirmVariant\"\n [disabled]=\"Processing\"\n (click)=\"onConfirm()\">\n @if (Processing) {\n <i class=\"fa-solid fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n }\n {{ ConfirmText }}\n </button>\n <button\n mjButton\n variant=\"secondary\"\n [disabled]=\"Processing\"\n (click)=\"onCancel()\">\n {{ CancelText }}\n </button>\n </mj-dialog-actions>\n </mj-dialog>\n `,\n styles: [`\n .mj-confirm {\n display: flex;\n align-items: flex-start;\n gap: var(--mj-space-3);\n }\n .mj-confirm__icon {\n flex-shrink: 0;\n font-size: 1.5rem;\n margin-top: 0.05em;\n color: var(--mj-text-muted);\n }\n .mj-confirm__icon--danger { color: var(--mj-status-error); }\n .mj-confirm__icon--warning { color: var(--mj-status-warning); }\n .mj-confirm__icon--info { color: var(--mj-status-info); }\n\n .mj-confirm__body { flex: 1; min-width: 0; }\n .mj-confirm__message {\n margin: 0;\n color: var(--mj-text-primary);\n line-height: 1.5;\n }\n .mj-confirm__detail {\n margin: var(--mj-space-2) 0 0;\n font-size: var(--mj-text-sm);\n color: var(--mj-text-secondary);\n line-height: 1.45;\n }\n `]\n})\nexport class MJConfirmDialogComponent {\n /** Whether the dialog is shown. Two-way bindable: `[(Visible)]`. */\n @Input() Visible = false;\n /** Two-way `Visible` change channel — fires when the dialog auto-closes on cancel. */\n @Output() VisibleChange = new EventEmitter<boolean>();\n\n /** Heading shown in the dialog title bar. */\n @Input() Title = 'Confirm';\n\n /** Primary prompt text. For rich content, project default `<ng-content>` instead. */\n @Input() Message = 'Are you sure?';\n\n /** Optional secondary line, rendered smaller/muted beneath the message. */\n @Input() DetailMessage = '';\n\n /** Visual intent — drives the header icon + confirm button color. Defaults to 'default'. */\n @Input() Type: MJConfirmDialogType = 'default';\n\n /** Affirmative button label. */\n @Input() ConfirmText = 'Confirm';\n\n /** Dismiss button label. */\n @Input() CancelText = 'Cancel';\n\n /**\n * Font Awesome icon class (e.g. \"fa-solid fa-trash\") for the header. When\n * omitted, a sensible default is chosen from `Type`. Set to `''` for no icon.\n */\n @Input() Icon: string | null = null;\n\n /**\n * When true, shows a spinner on the confirm button, disables both buttons, and\n * blocks dismissal (Esc / backdrop / ✕) — bind this to your loading flag while\n * the `Confirmed` handler runs async work.\n */\n @Input({ transform: booleanAttribute }) Processing = false;\n\n /** Fired when the user confirms. The dialog stays open; close it when ready. */\n @Output() Confirmed = new EventEmitter<void>();\n\n /** Fired when the user cancels (button, backdrop, Esc, or ✕). The dialog auto-closes. */\n @Output() Cancelled = new EventEmitter<void>();\n\n /** mjButton variant for the confirm button — red for `danger`, blue otherwise. */\n get ConfirmVariant(): 'primary' | 'danger' {\n return this.Type === 'danger' ? 'danger' : 'primary';\n }\n\n /**\n * Icon actually rendered: the explicit `Icon` when provided (including `\"\"`\n * to suppress it), otherwise the per-type default.\n */\n get ResolvedIcon(): string {\n if (this.Icon != null) {\n return this.Icon;\n }\n return DEFAULT_ICONS[this.Type] ?? DEFAULT_ICONS.default;\n }\n\n onConfirm(): void {\n this.Confirmed.emit();\n }\n\n onCancel(): void {\n this.close();\n this.Cancelled.emit();\n }\n\n /** Backdrop / Esc / ✕ from the underlying dialog — ignored while Processing. */\n onDismiss(): void {\n if (this.Processing) {\n return;\n }\n this.onCancel();\n }\n\n private close(): void {\n this.Visible = false;\n this.VisibleChange.emit(false);\n }\n}\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { MJConfirmDialogType } from './confirm-dialog.component';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link MJConfirmService.Confirm}. Mirror the `<mj-confirm-dialog>`
|
|
5
|
+
* inputs, but in a flat options bag suited to an imperative call.
|
|
6
|
+
*/
|
|
7
|
+
export interface MJConfirmOptions {
|
|
8
|
+
/** Primary prompt text. */
|
|
9
|
+
message: string;
|
|
10
|
+
/** Title-bar heading. Defaults to 'Confirm'. */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** Optional secondary line, rendered smaller/muted beneath the message. */
|
|
13
|
+
detail?: string;
|
|
14
|
+
/** Visual intent — drives the header icon + confirm button color. Defaults to 'default'. */
|
|
15
|
+
type?: MJConfirmDialogType;
|
|
16
|
+
/** Affirmative button label. Defaults to 'Confirm'. */
|
|
17
|
+
confirmText?: string;
|
|
18
|
+
/** Dismiss button label. Defaults to 'Cancel'. */
|
|
19
|
+
cancelText?: string;
|
|
20
|
+
/** Font Awesome icon override (e.g. "fa-solid fa-trash"). `''` suppresses the icon. */
|
|
21
|
+
icon?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* MJConfirmService — Imperative, Promise-based confirmation prompts.
|
|
25
|
+
*
|
|
26
|
+
* The one-liner replacement for native `window.confirm()` (an anti-pattern this
|
|
27
|
+
* codebase bans) and for the boilerplate of wiring `<mj-confirm-dialog>` into a
|
|
28
|
+
* template just to ask a yes/no question. It dynamically mounts an
|
|
29
|
+
* `MJConfirmDialogComponent` to `document.body`, shows it, and resolves a
|
|
30
|
+
* `Promise<boolean>` — `true` on confirm, `false` on cancel/backdrop/Esc — then
|
|
31
|
+
* tears the component down.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* private confirm = inject(MJConfirmService);
|
|
36
|
+
*
|
|
37
|
+
* // Simplest — replaces `if (window.confirm('Discard changes?')) { ... }`
|
|
38
|
+
* if (await this.confirm.Confirm('Discard unsaved changes?')) {
|
|
39
|
+
* this.discard();
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* // Destructive delete with a detail line
|
|
43
|
+
* if (await this.confirm.ConfirmDelete({
|
|
44
|
+
* message: 'Delete this user?',
|
|
45
|
+
* detail: 'This action cannot be undone.',
|
|
46
|
+
* })) {
|
|
47
|
+
* await this.deleteUser();
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* **Async work after confirm:** because this resolves a boolean, the dialog has
|
|
52
|
+
* already closed by the time your `await` continues — there's no in-dialog
|
|
53
|
+
* spinner. When you need a "keep open + spinner while I save" UX, use the
|
|
54
|
+
* `<mj-confirm-dialog>` component directly with its `Processing` input instead.
|
|
55
|
+
*
|
|
56
|
+
* **Synchronous guards:** `window.confirm` blocks the thread; a synchronous
|
|
57
|
+
* `CanClose`/`beforeunload` guard that must return a boolean *immediately*
|
|
58
|
+
* cannot use this async service. Those rare cases stay on `window.confirm` as a
|
|
59
|
+
* documented exception.
|
|
60
|
+
*/
|
|
61
|
+
export declare class MJConfirmService {
|
|
62
|
+
private appRef;
|
|
63
|
+
/**
|
|
64
|
+
* Ask the user to confirm. Pass a bare string for the simplest case, or an
|
|
65
|
+
* options bag for control over title/type/labels/detail.
|
|
66
|
+
* @returns a Promise resolving `true` if confirmed, `false` otherwise.
|
|
67
|
+
*/
|
|
68
|
+
Confirm(options: MJConfirmOptions | string): Promise<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* Convenience for destructive deletes — `type: 'danger'` and a 'Delete'
|
|
71
|
+
* confirm label by default (both overridable via `options`).
|
|
72
|
+
*/
|
|
73
|
+
ConfirmDelete(options: Omit<MJConfirmOptions, 'type'>): Promise<boolean>;
|
|
74
|
+
private applyInputs;
|
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MJConfirmService, never>;
|
|
76
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MJConfirmService>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=confirm-dialog.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-dialog.service.d.ts","sourceRoot":"","sources":["../../../src/lib/confirm-dialog/confirm-dialog.service.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;;AAE3F;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBACa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAA0B;IAExC;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA6C7D;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxE,OAAO,CAAC,WAAW;yCA7DR,gBAAgB;6CAAhB,gBAAgB;CAmF5B"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ApplicationRef, Injectable, createComponent, inject } from '@angular/core';
|
|
2
|
+
import { MJConfirmDialogComponent } from './confirm-dialog.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* MJConfirmService — Imperative, Promise-based confirmation prompts.
|
|
6
|
+
*
|
|
7
|
+
* The one-liner replacement for native `window.confirm()` (an anti-pattern this
|
|
8
|
+
* codebase bans) and for the boilerplate of wiring `<mj-confirm-dialog>` into a
|
|
9
|
+
* template just to ask a yes/no question. It dynamically mounts an
|
|
10
|
+
* `MJConfirmDialogComponent` to `document.body`, shows it, and resolves a
|
|
11
|
+
* `Promise<boolean>` — `true` on confirm, `false` on cancel/backdrop/Esc — then
|
|
12
|
+
* tears the component down.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* private confirm = inject(MJConfirmService);
|
|
17
|
+
*
|
|
18
|
+
* // Simplest — replaces `if (window.confirm('Discard changes?')) { ... }`
|
|
19
|
+
* if (await this.confirm.Confirm('Discard unsaved changes?')) {
|
|
20
|
+
* this.discard();
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* // Destructive delete with a detail line
|
|
24
|
+
* if (await this.confirm.ConfirmDelete({
|
|
25
|
+
* message: 'Delete this user?',
|
|
26
|
+
* detail: 'This action cannot be undone.',
|
|
27
|
+
* })) {
|
|
28
|
+
* await this.deleteUser();
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* **Async work after confirm:** because this resolves a boolean, the dialog has
|
|
33
|
+
* already closed by the time your `await` continues — there's no in-dialog
|
|
34
|
+
* spinner. When you need a "keep open + spinner while I save" UX, use the
|
|
35
|
+
* `<mj-confirm-dialog>` component directly with its `Processing` input instead.
|
|
36
|
+
*
|
|
37
|
+
* **Synchronous guards:** `window.confirm` blocks the thread; a synchronous
|
|
38
|
+
* `CanClose`/`beforeunload` guard that must return a boolean *immediately*
|
|
39
|
+
* cannot use this async service. Those rare cases stay on `window.confirm` as a
|
|
40
|
+
* documented exception.
|
|
41
|
+
*/
|
|
42
|
+
export class MJConfirmService {
|
|
43
|
+
appRef = inject(ApplicationRef);
|
|
44
|
+
/**
|
|
45
|
+
* Ask the user to confirm. Pass a bare string for the simplest case, or an
|
|
46
|
+
* options bag for control over title/type/labels/detail.
|
|
47
|
+
* @returns a Promise resolving `true` if confirmed, `false` otherwise.
|
|
48
|
+
*/
|
|
49
|
+
Confirm(options) {
|
|
50
|
+
const opts = typeof options === 'string' ? { message: options } : options;
|
|
51
|
+
return new Promise((resolve) => {
|
|
52
|
+
const ref = createComponent(MJConfirmDialogComponent, {
|
|
53
|
+
environmentInjector: this.appRef.injector,
|
|
54
|
+
});
|
|
55
|
+
this.applyInputs(ref, opts);
|
|
56
|
+
// An imperative confirm must layer above whatever surface launched it —
|
|
57
|
+
// bespoke drawers/panels go up to ~1101 and mj-window sits at 10000,
|
|
58
|
+
// all above the shared mj-dialog backdrop (1000). Without this, a
|
|
59
|
+
// confirm opened from such an overlay renders UNDER its backdrop:
|
|
60
|
+
// unclickable, and each swallowed click can re-trigger the caller and
|
|
61
|
+
// stack another dialog. position:relative + z-index forms a stacking
|
|
62
|
+
// context on the host that lifts the fixed backdrop/dialog inside it
|
|
63
|
+
// to this level (20000 — above mj-window, below toasts at 100000)
|
|
64
|
+
// without touching the fixed element's viewport-relative geometry.
|
|
65
|
+
const host = ref.location.nativeElement;
|
|
66
|
+
host.style.position = 'relative';
|
|
67
|
+
host.style.zIndex = '20000';
|
|
68
|
+
document.body.appendChild(host);
|
|
69
|
+
this.appRef.attachView(ref.hostView);
|
|
70
|
+
let settled = false;
|
|
71
|
+
const finish = (result) => {
|
|
72
|
+
if (settled) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
settled = true;
|
|
76
|
+
confirmedSub.unsubscribe();
|
|
77
|
+
cancelledSub.unsubscribe();
|
|
78
|
+
this.appRef.detachView(ref.hostView);
|
|
79
|
+
ref.location.nativeElement.remove();
|
|
80
|
+
ref.destroy();
|
|
81
|
+
resolve(result);
|
|
82
|
+
};
|
|
83
|
+
const confirmedSub = ref.instance.Confirmed.subscribe(() => finish(true));
|
|
84
|
+
const cancelledSub = ref.instance.Cancelled.subscribe(() => finish(false));
|
|
85
|
+
ref.instance.Visible = true;
|
|
86
|
+
ref.changeDetectorRef.detectChanges();
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Convenience for destructive deletes — `type: 'danger'` and a 'Delete'
|
|
91
|
+
* confirm label by default (both overridable via `options`).
|
|
92
|
+
*/
|
|
93
|
+
ConfirmDelete(options) {
|
|
94
|
+
return this.Confirm({ confirmText: 'Delete', ...options, type: 'danger' });
|
|
95
|
+
}
|
|
96
|
+
applyInputs(ref, opts) {
|
|
97
|
+
const i = ref.instance;
|
|
98
|
+
i.Message = opts.message;
|
|
99
|
+
if (opts.title != null) {
|
|
100
|
+
i.Title = opts.title;
|
|
101
|
+
}
|
|
102
|
+
if (opts.detail != null) {
|
|
103
|
+
i.DetailMessage = opts.detail;
|
|
104
|
+
}
|
|
105
|
+
if (opts.type != null) {
|
|
106
|
+
i.Type = opts.type;
|
|
107
|
+
}
|
|
108
|
+
if (opts.confirmText != null) {
|
|
109
|
+
i.ConfirmText = opts.confirmText;
|
|
110
|
+
}
|
|
111
|
+
if (opts.cancelText != null) {
|
|
112
|
+
i.CancelText = opts.cancelText;
|
|
113
|
+
}
|
|
114
|
+
if (opts.icon != null) {
|
|
115
|
+
i.Icon = opts.icon;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
static ɵfac = function MJConfirmService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MJConfirmService)(); };
|
|
119
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MJConfirmService, factory: MJConfirmService.ɵfac, providedIn: 'root' });
|
|
120
|
+
}
|
|
121
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJConfirmService, [{
|
|
122
|
+
type: Injectable,
|
|
123
|
+
args: [{ providedIn: 'root' }]
|
|
124
|
+
}], null, null); })();
|
|
125
|
+
//# sourceMappingURL=confirm-dialog.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-dialog.service.js","sourceRoot":"","sources":["../../../src/lib/confirm-dialog/confirm-dialog.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgB,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAuB,MAAM,4BAA4B,CAAC;;AAuB3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,MAAM,OAAO,gBAAgB;IACnB,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAExC;;;;OAIG;IACH,OAAO,CAAC,OAAkC;QACxC,MAAM,IAAI,GAAqB,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAE5F,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;YACtC,MAAM,GAAG,GAAG,eAAe,CAAC,wBAAwB,EAAE;gBACpD,mBAAmB,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;aAC1C,CAAC,CAAC;YACH,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAC5B,wEAAwE;YACxE,qEAAqE;YACrE,kEAAkE;YAClE,kEAAkE;YAClE,sEAAsE;YACtE,qEAAqE;YACrE,qEAAqE;YACrE,kEAAkE;YAClE,mEAAmE;YACnE,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,aAA4B,CAAC;YACvD,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;YACjC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC;YAC5B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IA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CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QACzB,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YACvB,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACvB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;YACxB,CAAC,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;QAChC,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;YAC7B,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACnC,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;YAC5B,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;0GAlFU,gBAAgB;gEAAhB,gBAAgB,WAAhB,gBAAgB,mBADH,MAAM;;iFACnB,gBAAgB;cAD5B,UAAU;eAAC,EAAE,UAAU,EAAE,MAAM,EAAE","sourcesContent":["import { ApplicationRef, ComponentRef, Injectable, createComponent, inject } from '@angular/core';\nimport { MJConfirmDialogComponent, MJConfirmDialogType } from './confirm-dialog.component';\n\n/**\n * Options for {@link MJConfirmService.Confirm}. Mirror the `<mj-confirm-dialog>`\n * inputs, but in a flat options bag suited to an imperative call.\n */\nexport interface MJConfirmOptions {\n /** Primary prompt text. */\n message: string;\n /** Title-bar heading. Defaults to 'Confirm'. */\n title?: string;\n /** Optional secondary line, rendered smaller/muted beneath the message. */\n detail?: string;\n /** Visual intent — drives the header icon + confirm button color. Defaults to 'default'. */\n type?: MJConfirmDialogType;\n /** Affirmative button label. Defaults to 'Confirm'. */\n confirmText?: string;\n /** Dismiss button label. Defaults to 'Cancel'. */\n cancelText?: string;\n /** Font Awesome icon override (e.g. \"fa-solid fa-trash\"). `''` suppresses the icon. */\n icon?: string;\n}\n\n/**\n * MJConfirmService — Imperative, Promise-based confirmation prompts.\n *\n * The one-liner replacement for native `window.confirm()` (an anti-pattern this\n * codebase bans) and for the boilerplate of wiring `<mj-confirm-dialog>` into a\n * template just to ask a yes/no question. It dynamically mounts an\n * `MJConfirmDialogComponent` to `document.body`, shows it, and resolves a\n * `Promise<boolean>` — `true` on confirm, `false` on cancel/backdrop/Esc — then\n * tears the component down.\n *\n * @example\n * ```typescript\n * private confirm = inject(MJConfirmService);\n *\n * // Simplest — replaces `if (window.confirm('Discard changes?')) { ... }`\n * if (await this.confirm.Confirm('Discard unsaved changes?')) {\n * this.discard();\n * }\n *\n * // Destructive delete with a detail line\n * if (await this.confirm.ConfirmDelete({\n * message: 'Delete this user?',\n * detail: 'This action cannot be undone.',\n * })) {\n * await this.deleteUser();\n * }\n * ```\n *\n * **Async work after confirm:** because this resolves a boolean, the dialog has\n * already closed by the time your `await` continues — there's no in-dialog\n * spinner. When you need a \"keep open + spinner while I save\" UX, use the\n * `<mj-confirm-dialog>` component directly with its `Processing` input instead.\n *\n * **Synchronous guards:** `window.confirm` blocks the thread; a synchronous\n * `CanClose`/`beforeunload` guard that must return a boolean *immediately*\n * cannot use this async service. Those rare cases stay on `window.confirm` as a\n * documented exception.\n */\n@Injectable({ providedIn: 'root' })\nexport class MJConfirmService {\n private appRef = inject(ApplicationRef);\n\n /**\n * Ask the user to confirm. Pass a bare string for the simplest case, or an\n * options bag for control over title/type/labels/detail.\n * @returns a Promise resolving `true` if confirmed, `false` otherwise.\n */\n Confirm(options: MJConfirmOptions | string): Promise<boolean> {\n const opts: MJConfirmOptions = typeof options === 'string' ? { message: options } : options;\n\n return new Promise<boolean>((resolve) => {\n const ref = createComponent(MJConfirmDialogComponent, {\n environmentInjector: this.appRef.injector,\n });\n this.applyInputs(ref, opts);\n // An imperative confirm must layer above whatever surface launched it —\n // bespoke drawers/panels go up to ~1101 and mj-window sits at 10000,\n // all above the shared mj-dialog backdrop (1000). Without this, a\n // confirm opened from such an overlay renders UNDER its backdrop:\n // unclickable, and each swallowed click can re-trigger the caller and\n // stack another dialog. position:relative + z-index forms a stacking\n // context on the host that lifts the fixed backdrop/dialog inside it\n // to this level (20000 — above mj-window, below toasts at 100000)\n // without touching the fixed element's viewport-relative geometry.\n const host = ref.location.nativeElement as HTMLElement;\n host.style.position = 'relative';\n host.style.zIndex = '20000';\n document.body.appendChild(host);\n this.appRef.attachView(ref.hostView);\n\n let settled = false;\n const finish = (result: boolean): void => {\n if (settled) {\n return;\n }\n settled = true;\n confirmedSub.unsubscribe();\n cancelledSub.unsubscribe();\n this.appRef.detachView(ref.hostView);\n ref.location.nativeElement.remove();\n ref.destroy();\n resolve(result);\n };\n\n const confirmedSub = ref.instance.Confirmed.subscribe(() => finish(true));\n const cancelledSub = ref.instance.Cancelled.subscribe(() => finish(false));\n\n ref.instance.Visible = true;\n ref.changeDetectorRef.detectChanges();\n });\n }\n\n /**\n * Convenience for destructive deletes — `type: 'danger'` and a 'Delete'\n * confirm label by default (both overridable via `options`).\n */\n ConfirmDelete(options: Omit<MJConfirmOptions, 'type'>): Promise<boolean> {\n return this.Confirm({ confirmText: 'Delete', ...options, type: 'danger' });\n }\n\n private applyInputs(ref: ComponentRef<MJConfirmDialogComponent>, opts: MJConfirmOptions): void {\n const i = ref.instance;\n i.Message = opts.message;\n if (opts.title != null) {\n i.Title = opts.title;\n }\n if (opts.detail != null) {\n i.DetailMessage = opts.detail;\n }\n if (opts.type != null) {\n i.Type = opts.type;\n }\n if (opts.confirmText != null) {\n i.ConfirmText = opts.confirmText;\n }\n if (opts.cancelText != null) {\n i.CancelText = opts.cancelText;\n }\n if (opts.icon != null) {\n i.Icon = opts.icon;\n }\n }\n}\n"]}
|
|
@@ -31,6 +31,13 @@ export declare class MJDialogComponent implements OnDestroy {
|
|
|
31
31
|
Size: MjDialogSize;
|
|
32
32
|
Closeable: boolean;
|
|
33
33
|
MinWidth: number | null;
|
|
34
|
+
/**
|
|
35
|
+
* ARIA role for the dialog container. Defaults to `'dialog'`; pass
|
|
36
|
+
* `'alertdialog'` for confirmation / destructive prompts that interrupt the
|
|
37
|
+
* user (per WAI-ARIA, an alertdialog conveys an urgent message requiring a
|
|
38
|
+
* response). Backward compatible — existing callers keep `'dialog'`.
|
|
39
|
+
*/
|
|
40
|
+
Role: 'dialog' | 'alertdialog';
|
|
34
41
|
Close: EventEmitter<void>;
|
|
35
42
|
DialogId: number;
|
|
36
43
|
get dialogId(): number;
|
|
@@ -43,7 +50,7 @@ export declare class MJDialogComponent implements OnDestroy {
|
|
|
43
50
|
private onCloseInternal;
|
|
44
51
|
ngOnDestroy(): void;
|
|
45
52
|
static ɵfac: i0.ɵɵFactoryDeclaration<MJDialogComponent, never>;
|
|
46
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MJDialogComponent, "mj-dialog", never, { "Visible": { "alias": "Visible"; "required": false; }; "Title": { "alias": "Title"; "required": false; }; "Width": { "alias": "Width"; "required": false; }; "Height": { "alias": "Height"; "required": false; }; "Size": { "alias": "Size"; "required": false; }; "Closeable": { "alias": "Closeable"; "required": false; }; "MinWidth": { "alias": "MinWidth"; "required": false; }; }, { "Close": "Close"; }, never, ["mj-dialog-titlebar", "*", "mj-dialog-actions"], true, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MJDialogComponent, "mj-dialog", never, { "Visible": { "alias": "Visible"; "required": false; }; "Title": { "alias": "Title"; "required": false; }; "Width": { "alias": "Width"; "required": false; }; "Height": { "alias": "Height"; "required": false; }; "Size": { "alias": "Size"; "required": false; }; "Closeable": { "alias": "Closeable"; "required": false; }; "MinWidth": { "alias": "MinWidth"; "required": false; }; "Role": { "alias": "Role"; "required": false; }; }, { "Close": "Close"; }, never, ["mj-dialog-titlebar", "*", "mj-dialog-actions"], true, never>;
|
|
47
54
|
}
|
|
48
55
|
/**
|
|
49
56
|
* mj-dialog-titlebar — Custom titlebar content for mj-dialog.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dialog/dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAKZ,SAAS,EAEV,MAAM,eAAe,CAAC;;AAEvB,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAU9D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBA2Ca,iBAAkB,YAAW,SAAS;IACjD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAK;IAE1B,IACI,OAAO,CAAC,KAAK,EAAE,OAAO,EASzB;IACD,IAAI,OAAO,IAAI,OAAO,CAErB;IAEQ,KAAK,SAAM;IACX,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAQ;IACrC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAQ;IACtC,IAAI,EAAE,YAAY,CAAU;IAC5B,SAAS,UAAQ;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;
|
|
1
|
+
{"version":3,"file":"dialog.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dialog/dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAKZ,SAAS,EAEV,MAAM,eAAe,CAAC;;AAEvB,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAU9D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBA2Ca,iBAAkB,YAAW,SAAS;IACjD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAK;IAE1B,IACI,OAAO,CAAC,KAAK,EAAE,OAAO,EASzB;IACD,IAAI,OAAO,IAAI,OAAO,CAErB;IAEQ,KAAK,SAAM;IACX,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAQ;IACrC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAQ;IACtC,IAAI,EAAE,YAAY,CAAU;IAC5B,SAAS,UAAQ;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAExC;;;;;OAKG;IACM,IAAI,EAAE,QAAQ,GAAG,aAAa,CAAY;IAEzC,KAAK,qBAA4B;IAE3C,QAAQ,SAA8B;IAEtC,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,aAAa,IAAI,MAAM,CAK1B;IAED,IAAI,cAAc,IAAI,MAAM,CAK3B;IAGD,WAAW,IAAI,IAAI;IAMnB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAMnC,YAAY,IAAI,IAAI;IAIpB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,eAAe;IAIvB,WAAW,IAAI,IAAI;yCAjFR,iBAAiB;2CAAjB,iBAAiB;CAoF7B;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAKa,yBAAyB;yCAAzB,yBAAyB;2CAAzB,yBAAyB;CAAG;AAEzC;;;;;;;;;;;;GAYG;AACH,qBASa,wBAAwB;yCAAxB,wBAAwB;2CAAxB,wBAAwB;CAAG"}
|
|
@@ -48,7 +48,7 @@ function MJDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
48
48
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
49
49
|
i0.ɵɵadvance();
|
|
50
50
|
i0.ɵɵstyleProp("width", ctx_r1.resolvedWidth)("height", ctx_r1.resolvedHeight)("max-width", "90vw")("max-height", "90vh");
|
|
51
|
-
i0.ɵɵattribute("aria-labelledby", ctx_r1.Title ? "mj-dialog-title-" + ctx_r1.dialogId : null);
|
|
51
|
+
i0.ɵɵattribute("role", ctx_r1.Role)("aria-labelledby", ctx_r1.Title ? "mj-dialog-title-" + ctx_r1.dialogId : null);
|
|
52
52
|
i0.ɵɵadvance();
|
|
53
53
|
i0.ɵɵconditional(ctx_r1.Title || ctx_r1.Closeable ? 2 : -1);
|
|
54
54
|
} }
|
|
@@ -101,6 +101,13 @@ export class MJDialogComponent {
|
|
|
101
101
|
Size = 'auto';
|
|
102
102
|
Closeable = true;
|
|
103
103
|
MinWidth = null;
|
|
104
|
+
/**
|
|
105
|
+
* ARIA role for the dialog container. Defaults to `'dialog'`; pass
|
|
106
|
+
* `'alertdialog'` for confirmation / destructive prompts that interrupt the
|
|
107
|
+
* user (per WAI-ARIA, an alertdialog conveys an urgent message requiring a
|
|
108
|
+
* response). Backward compatible — existing callers keep `'dialog'`.
|
|
109
|
+
*/
|
|
110
|
+
Role = 'dialog';
|
|
104
111
|
Close = new EventEmitter();
|
|
105
112
|
DialogId = MJDialogComponent.nextId++;
|
|
106
113
|
get dialogId() {
|
|
@@ -143,9 +150,9 @@ export class MJDialogComponent {
|
|
|
143
150
|
static ɵfac = function MJDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MJDialogComponent)(); };
|
|
144
151
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJDialogComponent, selectors: [["mj-dialog"]], hostBindings: function MJDialogComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
145
152
|
i0.ɵɵlistener("keydown.escape", function MJDialogComponent_keydown_escape_HostBindingHandler() { return ctx.OnEscapeKey(); }, i0.ɵɵresolveDocument);
|
|
146
|
-
} }, inputs: { Visible: "Visible", Title: "Title", Width: "Width", Height: "Height", Size: "Size", Closeable: "Closeable", MinWidth: "MinWidth" }, outputs: { Close: "Close" }, ngContentSelectors: _c1, decls: 1, vars: 1, consts: [[1, "mj-dialog-backdrop"], [1, "mj-dialog-backdrop", 3, "click"], ["
|
|
153
|
+
} }, inputs: { Visible: "Visible", Title: "Title", Width: "Width", Height: "Height", Size: "Size", Closeable: "Closeable", MinWidth: "MinWidth", Role: "Role" }, outputs: { Close: "Close" }, ngContentSelectors: _c1, decls: 1, vars: 1, consts: [[1, "mj-dialog-backdrop"], [1, "mj-dialog-backdrop", 3, "click"], ["aria-modal", "true", 1, "mj-dialog-container", 3, "click"], [1, "mj-dialog-titlebar"], [1, "mj-dialog-body"], [1, "mj-dialog-title", 3, "id"], ["aria-label", "Close dialog", 1, "mj-dialog-close"], ["aria-label", "Close dialog", 1, "mj-dialog-close", 3, "click"], [1, "fa-solid", "fa-times"]], template: function MJDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
147
154
|
i0.ɵɵprojectionDef(_c0);
|
|
148
|
-
i0.ɵɵconditionalCreate(0, MJDialogComponent_Conditional_0_Template, 6,
|
|
155
|
+
i0.ɵɵconditionalCreate(0, MJDialogComponent_Conditional_0_Template, 6, 11, "div", 0);
|
|
149
156
|
} if (rf & 2) {
|
|
150
157
|
i0.ɵɵconditional(ctx.Visible ? 0 : -1);
|
|
151
158
|
} }, encapsulation: 2 });
|
|
@@ -159,7 +166,7 @@ export class MJDialogComponent {
|
|
|
159
166
|
@if (Visible) {
|
|
160
167
|
<div class="mj-dialog-backdrop" (click)="OnBackdropClick($event)">
|
|
161
168
|
<div class="mj-dialog-container"
|
|
162
|
-
role="
|
|
169
|
+
[attr.role]="Role"
|
|
163
170
|
aria-modal="true"
|
|
164
171
|
[attr.aria-labelledby]="Title ? 'mj-dialog-title-' + dialogId : null"
|
|
165
172
|
[style.width]="resolvedWidth"
|
|
@@ -209,6 +216,8 @@ export class MJDialogComponent {
|
|
|
209
216
|
type: Input
|
|
210
217
|
}], MinWidth: [{
|
|
211
218
|
type: Input
|
|
219
|
+
}], Role: [{
|
|
220
|
+
type: Input
|
|
212
221
|
}], Close: [{
|
|
213
222
|
type: Output
|
|
214
223
|
}], OnEscapeKey: [{
|
|
@@ -246,7 +255,7 @@ export class MJDialogTitlebarComponent {
|
|
|
246
255
|
template: `<ng-content></ng-content>`
|
|
247
256
|
}]
|
|
248
257
|
}], null, null); })();
|
|
249
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogTitlebarComponent, { className: "MJDialogTitlebarComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber:
|
|
258
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogTitlebarComponent, { className: "MJDialogTitlebarComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber: 192 }); })();
|
|
250
259
|
/**
|
|
251
260
|
* mj-dialog-actions — Footer action bar for mj-dialog.
|
|
252
261
|
*
|
|
@@ -281,5 +290,5 @@ export class MJDialogActionsComponent {
|
|
|
281
290
|
`
|
|
282
291
|
}]
|
|
283
292
|
}], null, null); })();
|
|
284
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogActionsComponent, { className: "MJDialogActionsComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber:
|
|
293
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogActionsComponent, { className: "MJDialogActionsComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber: 216 }); })();
|
|
285
294
|
//# sourceMappingURL=dialog.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dialog/dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EAMb,MAAM,eAAe,CAAC;;;;;IAmDP,gCAAiE;IAAA,YAAW;IAAA,oBAAK;;;IAArD,4DAAoC;IAAC,cAAW;IAAX,kCAAW;;;;IAI5E,oCAAmF;IAAnD,qNAAS,qBAAc,KAAC;IACtD,0BAAiC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EAAE,2BAA2B;aACtC;;kFACY,yBAAyB;AAEtC;;;;;;;;;;;;GAYG;AAUH,MAAM,OAAO,wBAAwB;kHAAxB,wBAAwB;6DAAxB,wBAAwB;;YALjC,iCAA+B;YAC7B,kBAAyB;YAC3B,oBAAM;;;iFAGG,wBAAwB;cATpC,SAAS;eAAC;gBACT,QAAQ,EAAE,mBAAmB;gBAC7B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;GAIT;aACF;;kFACY,wBAAwB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n HostListener,\n ElementRef,\n ViewChild,\n AfterViewInit,\n OnDestroy,\n inject\n} from '@angular/core';\n\nexport type MjDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'auto';\n\nconst SIZE_MAP: Record<MjDialogSize, string> = {\n sm: '400px',\n md: '600px',\n lg: '800px',\n xl: '1000px',\n auto: 'auto'\n};\n\n/**\n * mj-dialog — Modal dialog component using native `<dialog>` element.\n *\n * Replaces `<kendo-dialog>`.\n *\n * Supports both explicit width/height and size presets.\n * Content is projected, with an optional `<mj-dialog-actions>` for the footer.\n *\n * @example\n * ```html\n * <mj-dialog [Visible]=\"showDialog\" Title=\"Confirm\" (Close)=\"onClose()\">\n * <p>Are you sure?</p>\n * <mj-dialog-actions>\n * <button mjButton variant=\"primary\" (click)=\"onConfirm()\">Yes</button>\n * <button mjButton (click)=\"onClose()\">No</button>\n * </mj-dialog-actions>\n * </mj-dialog>\n * ```\n */\n@Component({\n selector: 'mj-dialog',\n standalone: true,\n template: `\n @if (Visible) {\n <div class=\"mj-dialog-backdrop\" (click)=\"OnBackdropClick($event)\">\n <div class=\"mj-dialog-container\"\n [attr.role]=\"Role\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"Title ? 'mj-dialog-title-' + dialogId : null\"\n [style.width]=\"resolvedWidth\"\n [style.height]=\"resolvedHeight\"\n [style.max-width]=\"'90vw'\"\n [style.max-height]=\"'90vh'\"\n (click)=\"$event.stopPropagation()\">\n\n <!-- Title bar -->\n @if (Title || Closeable) {\n <div class=\"mj-dialog-titlebar\">\n @if (Title) {\n <h2 class=\"mj-dialog-title\" [id]=\"'mj-dialog-title-' + dialogId\">{{ Title }}</h2>\n }\n <ng-content select=\"mj-dialog-titlebar\"></ng-content>\n @if (Closeable) {\n <button class=\"mj-dialog-close\" (click)=\"OnCloseClick()\" aria-label=\"Close dialog\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n }\n </div>\n }\n\n <!-- Body -->\n <div class=\"mj-dialog-body\">\n <ng-content></ng-content>\n </div>\n\n <!-- Actions (projected) -->\n <ng-content select=\"mj-dialog-actions\"></ng-content>\n </div>\n </div>\n }\n `\n})\nexport class MJDialogComponent implements OnDestroy {\n private _visible = false;\n private static nextId = 0;\n\n @Input()\n set Visible(value: boolean) {\n const wasVisible = this._visible;\n this._visible = value;\n if (value && !wasVisible) {\n this.onOpen();\n }\n if (!value && wasVisible) {\n this.onCloseInternal();\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n\n @Input() Title = '';\n @Input() Width: number | string | null = null;\n @Input() Height: number | string | null = null;\n @Input() Size: MjDialogSize = 'auto';\n @Input() Closeable = true;\n @Input() MinWidth: number | null = null;\n\n /**\n * ARIA role for the dialog container. Defaults to `'dialog'`; pass\n * `'alertdialog'` for confirmation / destructive prompts that interrupt the\n * user (per WAI-ARIA, an alertdialog conveys an urgent message requiring a\n * response). Backward compatible — existing callers keep `'dialog'`.\n */\n @Input() Role: 'dialog' | 'alertdialog' = 'dialog';\n\n @Output() Close = new EventEmitter<void>();\n\n DialogId = MJDialogComponent.nextId++;\n\n get dialogId(): number {\n return this.DialogId;\n }\n\n get resolvedWidth(): string {\n if (this.Width) {\n return typeof this.Width === 'number' ? `${this.Width}px` : this.Width;\n }\n return SIZE_MAP[this.Size] ?? 'auto';\n }\n\n get resolvedHeight(): string {\n if (this.Height) {\n return typeof this.Height === 'number' ? `${this.Height}px` : this.Height;\n }\n return 'auto';\n }\n\n @HostListener('document:keydown.escape')\n OnEscapeKey(): void {\n if (this.Visible && this.Closeable) {\n this.OnCloseClick();\n }\n }\n\n OnBackdropClick(event: Event): void {\n if (this.Closeable) {\n this.OnCloseClick();\n }\n }\n\n OnCloseClick(): void {\n this.Close.emit();\n }\n\n private onOpen(): void {\n document.body.style.overflow = 'hidden';\n }\n\n private onCloseInternal(): void {\n document.body.style.overflow = '';\n }\n\n ngOnDestroy(): void {\n document.body.style.overflow = '';\n }\n}\n\n/**\n * mj-dialog-titlebar — Custom titlebar content for mj-dialog.\n *\n * Replaces `<kendo-dialog-titlebar>`.\n *\n * @example\n * ```html\n * <mj-dialog [Visible]=\"show\" (Close)=\"onClose()\">\n * <mj-dialog-titlebar>\n * <i class=\"fa-solid fa-save\"></i> Custom Title\n * </mj-dialog-titlebar>\n * <p>Dialog content</p>\n * </mj-dialog>\n * ```\n */\n@Component({\n selector: 'mj-dialog-titlebar',\n standalone: true,\n template: `<ng-content></ng-content>`\n})\nexport class MJDialogTitlebarComponent {}\n\n/**\n * mj-dialog-actions — Footer action bar for mj-dialog.\n *\n * Replaces `<kendo-dialog-actions>`.\n *\n * @example\n * ```html\n * <mj-dialog-actions>\n * <button mjButton variant=\"primary\">Save</button>\n * <button mjButton>Cancel</button>\n * </mj-dialog-actions>\n * ```\n */\n@Component({\n selector: 'mj-dialog-actions',\n standalone: true,\n template: `\n <div class=\"mj-dialog-actions\">\n <ng-content></ng-content>\n </div>\n `\n})\nexport class MJDialogActionsComponent {}\n"]}
|
|
@@ -223,11 +223,11 @@ export class MjSlidePanelComponent {
|
|
|
223
223
|
i0.ɵɵconditional(ctx.Mode === "slide" ? 1 : -1);
|
|
224
224
|
i0.ɵɵadvance();
|
|
225
225
|
i0.ɵɵconditional(ctx.Mode === "dialog" ? 2 : -1);
|
|
226
|
-
} }, styles: ["\n\n\n\n\n\n\n.sp-backdrop[_ngcontent-%COMP%] {\n position: fixed;\n inset: 0;\n background: transparent;\n z-index: 1000;\n transition: background 0.3s ease;\n pointer-events: none;\n}\n\n.sp-backdrop.visible[_ngcontent-%COMP%] {\n background: var(--mj-bg-overlay);\n pointer-events: auto;\n}\n\n.sp-dialog-backdrop.visible[_ngcontent-%COMP%] {\n background: var(--mj-bg-overlay);\n}\n\n\n\n\n\n\n\n\n.sp-panel[_ngcontent-%COMP%] {\n position: fixed;\n top: 0;\n right: 0;\n height: 100vh;\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-lg);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n transform: translateX(100%);\n transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n min-width: 400px;\n max-width: 92vw;\n}\n\n.sp-panel.visible[_ngcontent-%COMP%] {\n transform:
|
|
226
|
+
} }, styles: ["\n\n\n\n\n\n\n.sp-backdrop[_ngcontent-%COMP%] {\n position: fixed;\n inset: 0;\n background: transparent;\n z-index: 1000;\n transition: background 0.3s ease;\n pointer-events: none;\n}\n\n.sp-backdrop.visible[_ngcontent-%COMP%] {\n background: var(--mj-bg-overlay);\n pointer-events: auto;\n}\n\n.sp-dialog-backdrop.visible[_ngcontent-%COMP%] {\n background: var(--mj-bg-overlay);\n}\n\n\n\n\n\n\n\n\n.sp-panel[_ngcontent-%COMP%] {\n position: fixed;\n top: 0;\n right: 0;\n height: 100vh;\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-lg);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n transform: translateX(100%);\n transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n min-width: 400px;\n max-width: 92vw;\n}\n\n.sp-panel.visible[_ngcontent-%COMP%] {\n \n\n\n\n\n\n transform: none;\n}\n\n\n\n\n\n\n\n\n.sp-dialog[_ngcontent-%COMP%] {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.95);\n max-height: 85vh;\n background: var(--mj-bg-surface);\n border-radius: 16px;\n box-shadow: var(--mj-shadow-lg);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n opacity: 0;\n transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);\n min-width: 360px;\n max-width: 95vw;\n}\n\n.sp-dialog.visible[_ngcontent-%COMP%] {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n}\n\n\n\n\n\n\n\n\n.sp-resize-handle[_ngcontent-%COMP%] {\n position: absolute;\n left: -4px;\n top: 0;\n width: 8px;\n height: 100%;\n cursor: col-resize;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.sp-resize-handle[_ngcontent-%COMP%]:hover .sp-resize-grip[_ngcontent-%COMP%], \n.sp-resize-handle[_ngcontent-%COMP%]:active .sp-resize-grip[_ngcontent-%COMP%] {\n opacity: 1;\n background: var(--mj-brand-primary);\n}\n\n.sp-resize-grip[_ngcontent-%COMP%] {\n width: 3px;\n height: 40px;\n background: var(--mj-border-strong);\n border-radius: 3px;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.2s ease;\n}\n\n.sp-resize-handle[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 4%, transparent);\n}\n\n\n\n\n\n\n\n\n.sp-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n border-bottom: 1px solid var(--mj-border-default);\n flex-shrink: 0;\n}\n\n.sp-title[_ngcontent-%COMP%] {\n font-size: 18px;\n font-weight: 700;\n color: var(--mj-text-primary);\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n}\n\n.sp-close-btn[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n background: none;\n border: none;\n border-radius: 8px;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.15s ease;\n font-size: 16px;\n flex-shrink: 0;\n}\n\n.sp-close-btn[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-primary);\n}\n\n\n\n\n\n\n\n\n.sp-body[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.sp-dialog-body[_ngcontent-%COMP%] {\n padding: 0;\n}\n\n\n\n\n\n\n\n\n@media (max-width: 768px) {\n .sp-panel[_ngcontent-%COMP%] {\n width: 100% !important;\n min-width: unset;\n }\n\n .sp-resize-handle[_ngcontent-%COMP%] {\n display: none;\n }\n\n .sp-dialog[_ngcontent-%COMP%] {\n width: 95vw !important;\n max-height: 90vh;\n }\n}"], changeDetection: 0 });
|
|
227
227
|
}
|
|
228
228
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MjSlidePanelComponent, [{
|
|
229
229
|
type: Component,
|
|
230
|
-
args: [{ standalone: true, selector: 'mj-slide-panel', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Backdrop overlay -->\n<div class=\"sp-backdrop\"\n [class.visible]=\"IsVisible\"\n [class.sp-dialog-backdrop]=\"Mode === 'dialog'\"\n (click)=\"OnBackdropClick()\">\n</div>\n\n<!-- Panel (slide-in from right) -->\n@if (Mode === 'slide') {\n <div\n class=\"sp-panel\"\n [class.visible]=\"IsVisible\"\n [style.width.px]=\"WidthPx\"\n [style.max-width]=\"(MaxWidthRatio * 100) + 'vw'\">\n <!-- Resize handle -->\n @if (Resizable) {\n <div class=\"sp-resize-handle\" (mousedown)=\"OnResizeStart($event)\">\n <div class=\"sp-resize-grip\"></div>\n </div>\n }\n <!-- Header (if Title provided) -->\n @if (Title) {\n <div class=\"sp-header\">\n <h2 class=\"sp-title\">{{Title}}</h2>\n <button class=\"sp-close-btn\" (click)=\"OnClose()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n }\n <!-- Content projection -->\n <div class=\"sp-body\">\n <ng-content></ng-content>\n </div>\n </div>\n}\n\n<!-- Dialog (centered modal) -->\n@if (Mode === 'dialog') {\n <div\n class=\"sp-dialog\"\n [class.visible]=\"IsVisible\"\n [style.width.px]=\"WidthPx\">\n <!-- Header (if Title provided) -->\n @if (Title) {\n <div class=\"sp-header\">\n <h2 class=\"sp-title\">{{Title}}</h2>\n <button class=\"sp-close-btn\" (click)=\"OnClose()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n }\n <!-- Content projection -->\n <div class=\"sp-body sp-dialog-body\">\n <ng-content select=\"[dialog-content]\"></ng-content>\n </div>\n </div>\n}\n", styles: ["/* ================================================================= */\n/* BACKDROP */\n/* ================================================================= */\n\n.sp-backdrop {\n position: fixed;\n inset: 0;\n background: transparent;\n z-index: 1000;\n transition: background 0.3s ease;\n pointer-events: none;\n}\n\n.sp-backdrop.visible {\n background: var(--mj-bg-overlay);\n pointer-events: auto;\n}\n\n.sp-dialog-backdrop.visible {\n background: var(--mj-bg-overlay);\n}\n\n/* ================================================================= */\n/* SLIDE PANEL */\n/* ================================================================= */\n\n.sp-panel {\n position: fixed;\n top: 0;\n right: 0;\n height: 100vh;\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-lg);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n transform: translateX(100%);\n transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n min-width: 400px;\n max-width: 92vw;\n}\n\n.sp-panel.visible {\n
|
|
230
|
+
args: [{ standalone: true, selector: 'mj-slide-panel', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Backdrop overlay -->\n<div class=\"sp-backdrop\"\n [class.visible]=\"IsVisible\"\n [class.sp-dialog-backdrop]=\"Mode === 'dialog'\"\n (click)=\"OnBackdropClick()\">\n</div>\n\n<!-- Panel (slide-in from right) -->\n@if (Mode === 'slide') {\n <div\n class=\"sp-panel\"\n [class.visible]=\"IsVisible\"\n [style.width.px]=\"WidthPx\"\n [style.max-width]=\"(MaxWidthRatio * 100) + 'vw'\">\n <!-- Resize handle -->\n @if (Resizable) {\n <div class=\"sp-resize-handle\" (mousedown)=\"OnResizeStart($event)\">\n <div class=\"sp-resize-grip\"></div>\n </div>\n }\n <!-- Header (if Title provided) -->\n @if (Title) {\n <div class=\"sp-header\">\n <h2 class=\"sp-title\">{{Title}}</h2>\n <button class=\"sp-close-btn\" (click)=\"OnClose()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n }\n <!-- Content projection -->\n <div class=\"sp-body\">\n <ng-content></ng-content>\n </div>\n </div>\n}\n\n<!-- Dialog (centered modal) -->\n@if (Mode === 'dialog') {\n <div\n class=\"sp-dialog\"\n [class.visible]=\"IsVisible\"\n [style.width.px]=\"WidthPx\">\n <!-- Header (if Title provided) -->\n @if (Title) {\n <div class=\"sp-header\">\n <h2 class=\"sp-title\">{{Title}}</h2>\n <button class=\"sp-close-btn\" (click)=\"OnClose()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n }\n <!-- Content projection -->\n <div class=\"sp-body sp-dialog-body\">\n <ng-content select=\"[dialog-content]\"></ng-content>\n </div>\n </div>\n}\n", styles: ["/* ================================================================= */\n/* BACKDROP */\n/* ================================================================= */\n\n.sp-backdrop {\n position: fixed;\n inset: 0;\n background: transparent;\n z-index: 1000;\n transition: background 0.3s ease;\n pointer-events: none;\n}\n\n.sp-backdrop.visible {\n background: var(--mj-bg-overlay);\n pointer-events: auto;\n}\n\n.sp-dialog-backdrop.visible {\n background: var(--mj-bg-overlay);\n}\n\n/* ================================================================= */\n/* SLIDE PANEL */\n/* ================================================================= */\n\n.sp-panel {\n position: fixed;\n top: 0;\n right: 0;\n height: 100vh;\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-lg);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n transform: translateX(100%);\n transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n min-width: 400px;\n max-width: 92vw;\n}\n\n.sp-panel.visible {\n /* `none` (not translateX(0)) on purpose: a non-none transform makes this panel\n the containing block for position:fixed DESCENDANTS (dropdown panels, popovers\n that position via getBoundingClientRect viewport math), displacing them\n offscreen. `none` interpolates as the identity matrix, so the slide-in\n animation is unaffected while open-state descendants get the real viewport. */\n transform: none;\n}\n\n/* ================================================================= */\n/* DIALOG (centered modal) */\n/* ================================================================= */\n\n.sp-dialog {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.95);\n max-height: 85vh;\n background: var(--mj-bg-surface);\n border-radius: 16px;\n box-shadow: var(--mj-shadow-lg);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n opacity: 0;\n transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);\n min-width: 360px;\n max-width: 95vw;\n}\n\n.sp-dialog.visible {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n}\n\n/* ================================================================= */\n/* RESIZE HANDLE */\n/* ================================================================= */\n\n.sp-resize-handle {\n position: absolute;\n left: -4px;\n top: 0;\n width: 8px;\n height: 100%;\n cursor: col-resize;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.sp-resize-handle:hover .sp-resize-grip,\n.sp-resize-handle:active .sp-resize-grip {\n opacity: 1;\n background: var(--mj-brand-primary);\n}\n\n.sp-resize-grip {\n width: 3px;\n height: 40px;\n background: var(--mj-border-strong);\n border-radius: 3px;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.2s ease;\n}\n\n.sp-resize-handle:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 4%, transparent);\n}\n\n/* ================================================================= */\n/* HEADER */\n/* ================================================================= */\n\n.sp-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n border-bottom: 1px solid var(--mj-border-default);\n flex-shrink: 0;\n}\n\n.sp-title {\n font-size: 18px;\n font-weight: 700;\n color: var(--mj-text-primary);\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n}\n\n.sp-close-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n background: none;\n border: none;\n border-radius: 8px;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.15s ease;\n font-size: 16px;\n flex-shrink: 0;\n}\n\n.sp-close-btn:hover {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-primary);\n}\n\n/* ================================================================= */\n/* BODY */\n/* ================================================================= */\n\n.sp-body {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.sp-dialog-body {\n padding: 0;\n}\n\n/* ================================================================= */\n/* RESPONSIVE */\n/* ================================================================= */\n\n@media (max-width: 768px) {\n .sp-panel {\n width: 100% !important;\n min-width: unset;\n }\n\n .sp-resize-handle {\n display: none;\n }\n\n .sp-dialog {\n width: 95vw !important;\n max-height: 90vh;\n }\n}\n"] }]
|
|
231
231
|
}], () => [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i0.ElementRef }], { Mode: [{
|
|
232
232
|
type: Input
|
|
233
233
|
}], Title: [{
|
package/dist/public-api.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export * from './lib/button/button.directive';
|
|
|
2
2
|
export * from './lib/clickable/clickable.directive';
|
|
3
3
|
export * from './lib/dialog/dialog.component';
|
|
4
4
|
export * from './lib/dialog/dialog.service';
|
|
5
|
+
export * from './lib/confirm-dialog/confirm-dialog.component';
|
|
6
|
+
export * from './lib/confirm-dialog/confirm-dialog.service';
|
|
5
7
|
export * from './lib/dropdown/dropdown.component';
|
|
6
8
|
export * from './lib/switch/switch.component';
|
|
7
9
|
export * from './lib/numeric-input/numeric-input.component';
|
package/dist/public-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAGA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;A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A+B,CAAC;AAC9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,yCAAyC,CAAC"}
|
package/dist/public-api.js
CHANGED
|
@@ -4,6 +4,8 @@ export * from './lib/button/button.directive';
|
|
|
4
4
|
export * from './lib/clickable/clickable.directive';
|
|
5
5
|
export * from './lib/dialog/dialog.component';
|
|
6
6
|
export * from './lib/dialog/dialog.service';
|
|
7
|
+
export * from './lib/confirm-dialog/confirm-dialog.component';
|
|
8
|
+
export * from './lib/confirm-dialog/confirm-dialog.service';
|
|
7
9
|
export * from './lib/dropdown/dropdown.component';
|
|
8
10
|
export * from './lib/switch/switch.component';
|
|
9
11
|
export * from './lib/numeric-input/numeric-input.component';
|
package/dist/public-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,+DAA+D;AAE/D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,yCAAyC,CAAC","sourcesContent":["// @memberjunction/ng-ui-components\n// Reusable standalone Angular UI components for MemberJunction\n\nexport * from './lib/button/button.directive';\nexport * from './lib/clickable/clickable.directive';\nexport * from './lib/dialog/dialog.component';\nexport * from './lib/dialog/dialog.service';\nexport * from './lib/dropdown/dropdown.component';\nexport * from './lib/switch/switch.component';\nexport * from './lib/numeric-input/numeric-input.component';\nexport * from './lib/progress-bar/progress-bar.component';\nexport * from './lib/calendar/calendar-utils';\nexport * from './lib/datepicker/datepicker.component';\nexport * from './lib/splitter/splitter.component';\nexport * from './lib/accordion/accordion.component';\nexport * from './lib/alert/alert.component';\nexport * from './lib/window/window.component';\nexport * from './lib/slide-panel/slide-panel.component';\nexport * from './lib/combobox/combobox.component';\nexport * from './lib/page-header/page-header.component';\nexport * from './lib/page-layout/page-layout.component';\nexport * from './lib/page-body/page-body.component';\nexport * from './lib/stat-badge/stat-badge.component';\nexport * from './lib/refresh-button/refresh-button.component';\nexport * from './lib/filter-popover/filter-popover.component';\nexport * from './lib/page-search/page-search.component';\nexport * from './lib/filter-chip/filter-chip.component';\nexport * from './lib/filter-field/filter-field.component';\nexport * from './lib/filter-panel/filter-panel.component';\nexport * from './lib/tab-nav/tab-nav.component';\nexport * from './lib/view-toggle/view-toggle.component';\nexport * from './lib/left-nav/left-nav.component';\nexport * from './lib/left-nav/left-nav-content.component';\nexport * from './lib/page-header-interior/page-header-interior.component';\nexport * from './lib/page-body-interior/page-body-interior.component';\nexport * from './lib/empty-state/empty-state.component';\n"]}
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,+DAA+D;AAE/D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,yCAAyC,CAAC","sourcesContent":["// @memberjunction/ng-ui-components\n// Reusable standalone Angular UI components for MemberJunction\n\nexport * from './lib/button/button.directive';\nexport * from './lib/clickable/clickable.directive';\nexport * from './lib/dialog/dialog.component';\nexport * from './lib/dialog/dialog.service';\nexport * from './lib/confirm-dialog/confirm-dialog.component';\nexport * from './lib/confirm-dialog/confirm-dialog.service';\nexport * from './lib/dropdown/dropdown.component';\nexport * from './lib/switch/switch.component';\nexport * from './lib/numeric-input/numeric-input.component';\nexport * from './lib/progress-bar/progress-bar.component';\nexport * from './lib/calendar/calendar-utils';\nexport * from './lib/datepicker/datepicker.component';\nexport * from './lib/splitter/splitter.component';\nexport * from './lib/accordion/accordion.component';\nexport * from './lib/alert/alert.component';\nexport * from './lib/window/window.component';\nexport * from './lib/slide-panel/slide-panel.component';\nexport * from './lib/combobox/combobox.component';\nexport * from './lib/page-header/page-header.component';\nexport * from './lib/page-layout/page-layout.component';\nexport * from './lib/page-body/page-body.component';\nexport * from './lib/stat-badge/stat-badge.component';\nexport * from './lib/refresh-button/refresh-button.component';\nexport * from './lib/filter-popover/filter-popover.component';\nexport * from './lib/page-search/page-search.component';\nexport * from './lib/filter-chip/filter-chip.component';\nexport * from './lib/filter-field/filter-field.component';\nexport * from './lib/filter-panel/filter-panel.component';\nexport * from './lib/tab-nav/tab-nav.component';\nexport * from './lib/view-toggle/view-toggle.component';\nexport * from './lib/left-nav/left-nav.component';\nexport * from './lib/left-nav/left-nav-content.component';\nexport * from './lib/page-header-interior/page-header-interior.component';\nexport * from './lib/page-body-interior/page-body-interior.component';\nexport * from './lib/empty-state/empty-state.component';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-ui-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.45.0",
|
|
4
4
|
"description": "MemberJunction: Angular UI Components - reusable standalone components replacing Kendo UI dependencies.",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@angular/compiler": "21.1.3",
|
|
25
25
|
"@angular/compiler-cli": "21.1.3",
|
|
26
|
-
"@memberjunction/ng-test-utils": "5.
|
|
26
|
+
"@memberjunction/ng-test-utils": "5.45.0",
|
|
27
27
|
"vitest": "^4.0.18"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|