@tolle_/tolle-ui 18.3.1 → 18.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/alert-dialog-dynamic.component.mjs +13 -9
- package/esm2022/lib/alert-dialog.types.mjs +6 -1
- package/fesm2022/tolle-ui.mjs +17 -8
- package/fesm2022/tolle-ui.mjs.map +1 -1
- package/lib/alert-dialog-dynamic.component.d.ts +7 -1
- package/lib/alert-dialog.types.d.ts +2 -0
- package/package.json +1 -1
- package/registry/manifest.json +1 -1
- package/registry/r/alert-dialog-dynamic.json +2 -2
- package/registry/r/alert-dialog.json +1 -1
|
@@ -8,8 +8,14 @@ export declare class AlertDialogDynamicComponent {
|
|
|
8
8
|
* content panel plays its exit animation before the overlay is torn down.
|
|
9
9
|
*/
|
|
10
10
|
closing: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Result recorded by the action/cancel buttons' `confirmed`/`cancelled`
|
|
13
|
+
* outputs, which fire *before* the button drives the dialog closed. The
|
|
14
|
+
* single close path (`onOpenChange`) then reads it, so a confirm reports
|
|
15
|
+
* `true` instead of racing with the button's own `false` close signal.
|
|
16
|
+
*/
|
|
17
|
+
result: boolean;
|
|
11
18
|
onOpenChange(open: boolean): void;
|
|
12
|
-
close(result: boolean): void;
|
|
13
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<AlertDialogDynamicComponent, never>;
|
|
14
20
|
static ɵcmp: i0.ɵɵComponentDeclaration<AlertDialogDynamicComponent, "tolle-alert-dialog-dynamic", never, {}, {}, never, never, true, never>;
|
|
15
21
|
}
|
|
@@ -11,5 +11,7 @@ export interface AlertDialogConfig {
|
|
|
11
11
|
export declare class AlertDialogRef {
|
|
12
12
|
private readonly _afterClosed;
|
|
13
13
|
afterClosed$: Observable<boolean>;
|
|
14
|
+
/** Guards against the dialog's several close paths racing to emit twice. */
|
|
15
|
+
private closed;
|
|
14
16
|
close(result?: boolean): void;
|
|
15
17
|
}
|
package/package.json
CHANGED
package/registry/manifest.json
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
{
|
|
16
16
|
"path": "alert-dialog-dynamic.component.ts",
|
|
17
17
|
"target": "ui/alert-dialog-dynamic.component.ts",
|
|
18
|
-
"content": "import { Component, Inject, inject, OnInit } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n AlertDialogComponent,\n AlertDialogContentComponent,\n AlertDialogHeaderComponent,\n AlertDialogTitleComponent,\n AlertDialogDescriptionComponent,\n AlertDialogFooterComponent,\n AlertDialogCancelComponent,\n AlertDialogActionComponent\n} from './alert-dialog.component';\nimport { ButtonComponent } from './button.component';\nimport { AlertDialogConfig, AlertDialogRef } from './alert-dialog.types';\n\n@Component({\n selector: 'tolle-alert-dialog-dynamic',\n styles: [':host { display: block; }'],\n standalone: true,\n imports: [\n CommonModule,\n AlertDialogComponent,\n AlertDialogContentComponent,\n AlertDialogHeaderComponent,\n AlertDialogTitleComponent,\n AlertDialogDescriptionComponent,\n AlertDialogFooterComponent,\n AlertDialogCancelComponent,\n AlertDialogActionComponent,\n ButtonComponent\n ],\n template: `\n <tolle-alert-dialog [open]=\"!closing\" (openChange)=\"onOpenChange($event)\">\n <tolle-alert-dialog-content [size]=\"config.size || 'lg'\">\n <tolle-alert-dialog-header>\n <tolle-alert-dialog-title>{{ config.title }}</tolle-alert-dialog-title>\n <tolle-alert-dialog-description>\n {{ config.description }}\n </tolle-alert-dialog-description>\n </tolle-alert-dialog-header>\n <tolle-alert-dialog-footer>\n <tolle-alert-dialog-cancel (
|
|
18
|
+
"content": "import { Component, Inject, inject, OnInit } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n AlertDialogComponent,\n AlertDialogContentComponent,\n AlertDialogHeaderComponent,\n AlertDialogTitleComponent,\n AlertDialogDescriptionComponent,\n AlertDialogFooterComponent,\n AlertDialogCancelComponent,\n AlertDialogActionComponent\n} from './alert-dialog.component';\nimport { ButtonComponent } from './button.component';\nimport { AlertDialogConfig, AlertDialogRef } from './alert-dialog.types';\n\n@Component({\n selector: 'tolle-alert-dialog-dynamic',\n styles: [':host { display: block; }'],\n standalone: true,\n imports: [\n CommonModule,\n AlertDialogComponent,\n AlertDialogContentComponent,\n AlertDialogHeaderComponent,\n AlertDialogTitleComponent,\n AlertDialogDescriptionComponent,\n AlertDialogFooterComponent,\n AlertDialogCancelComponent,\n AlertDialogActionComponent,\n ButtonComponent\n ],\n template: `\n <tolle-alert-dialog [open]=\"!closing\" (openChange)=\"onOpenChange($event)\">\n <tolle-alert-dialog-content [size]=\"config.size || 'lg'\">\n <tolle-alert-dialog-header>\n <tolle-alert-dialog-title>{{ config.title }}</tolle-alert-dialog-title>\n <tolle-alert-dialog-description>\n {{ config.description }}\n </tolle-alert-dialog-description>\n </tolle-alert-dialog-header>\n <tolle-alert-dialog-footer>\n <tolle-alert-dialog-cancel (cancelled)=\"result = false\">\n <tolle-button variant=\"outline\">{{ config.cancelText || 'Cancel' }}</tolle-button>\n </tolle-alert-dialog-cancel>\n <tolle-alert-dialog-action (confirmed)=\"result = true\">\n <tolle-button [variant]=\"config.variant === 'destructive' ? 'destructive' : 'default'\">\n {{ config.actionText || 'Continue' }}\n </tolle-button>\n </tolle-alert-dialog-action>\n </tolle-alert-dialog-footer>\n </tolle-alert-dialog-content>\n </tolle-alert-dialog>\n `\n})\nexport class AlertDialogDynamicComponent {\n config!: AlertDialogConfig;\n dialogRef!: AlertDialogRef;\n\n /**\n * Set by `AlertDialogService` once the dialog's result is ready, so the\n * content panel plays its exit animation before the overlay is torn down.\n */\n closing = false;\n\n /**\n * Result recorded by the action/cancel buttons' `confirmed`/`cancelled`\n * outputs, which fire *before* the button drives the dialog closed. The\n * single close path (`onOpenChange`) then reads it, so a confirm reports\n * `true` instead of racing with the button's own `false` close signal.\n */\n result = false;\n\n onOpenChange(open: boolean) {\n if (!open) {\n this.dialogRef.close(this.result);\n }\n }\n}\n"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"path": "alert-dialog.types.ts",
|
|
22
22
|
"target": "ui/alert-dialog.types.ts",
|
|
23
|
-
"content": "import { Subject, Observable } from 'rxjs';\n\nexport type AlertDialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | 'fit';\n\nexport interface AlertDialogConfig {\n title: string;\n description: string;\n cancelText?: string;\n actionText?: string;\n variant?: 'default' | 'destructive';\n size?: AlertDialogSize;\n}\n\nexport class AlertDialogRef {\n private readonly _afterClosed = new Subject<boolean>();\n afterClosed$: Observable<boolean> = this._afterClosed.asObservable();\n\n close(result: boolean = false): void {\n this._afterClosed.next(result);\n this._afterClosed.complete();\n }\n}\n"
|
|
23
|
+
"content": "import { Subject, Observable } from 'rxjs';\n\nexport type AlertDialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | 'fit';\n\nexport interface AlertDialogConfig {\n title: string;\n description: string;\n cancelText?: string;\n actionText?: string;\n variant?: 'default' | 'destructive';\n size?: AlertDialogSize;\n}\n\nexport class AlertDialogRef {\n private readonly _afterClosed = new Subject<boolean>();\n afterClosed$: Observable<boolean> = this._afterClosed.asObservable();\n\n /** Guards against the dialog's several close paths racing to emit twice. */\n private closed = false;\n\n close(result: boolean = false): void {\n if (this.closed) return;\n this.closed = true;\n this._afterClosed.next(result);\n this._afterClosed.complete();\n }\n}\n"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "utils/cn.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
{
|
|
16
16
|
"path": "alert-dialog.types.ts",
|
|
17
17
|
"target": "ui/alert-dialog.types.ts",
|
|
18
|
-
"content": "import { Subject, Observable } from 'rxjs';\n\nexport type AlertDialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | 'fit';\n\nexport interface AlertDialogConfig {\n title: string;\n description: string;\n cancelText?: string;\n actionText?: string;\n variant?: 'default' | 'destructive';\n size?: AlertDialogSize;\n}\n\nexport class AlertDialogRef {\n private readonly _afterClosed = new Subject<boolean>();\n afterClosed$: Observable<boolean> = this._afterClosed.asObservable();\n\n close(result: boolean = false): void {\n this._afterClosed.next(result);\n this._afterClosed.complete();\n }\n}\n"
|
|
18
|
+
"content": "import { Subject, Observable } from 'rxjs';\n\nexport type AlertDialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | 'fit';\n\nexport interface AlertDialogConfig {\n title: string;\n description: string;\n cancelText?: string;\n actionText?: string;\n variant?: 'default' | 'destructive';\n size?: AlertDialogSize;\n}\n\nexport class AlertDialogRef {\n private readonly _afterClosed = new Subject<boolean>();\n afterClosed$: Observable<boolean> = this._afterClosed.asObservable();\n\n /** Guards against the dialog's several close paths racing to emit twice. */\n private closed = false;\n\n close(result: boolean = false): void {\n if (this.closed) return;\n this.closed = true;\n this._afterClosed.next(result);\n this._afterClosed.complete();\n }\n}\n"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"path": "utils/cn.ts",
|