ngx-com 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngx-com-components-alert-testing.mjs +80 -0
- package/fesm2022/ngx-com-components-alert-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-calendar-testing.mjs +157 -0
- package/fesm2022/ngx-com-components-calendar-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-carousel-testing.mjs +121 -0
- package/fesm2022/ngx-com-components-carousel-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-checkbox-testing.mjs +113 -0
- package/fesm2022/ngx-com-components-checkbox-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-code-block-testing.mjs +88 -0
- package/fesm2022/ngx-com-components-code-block-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-collapsible-testing.mjs +104 -0
- package/fesm2022/ngx-com-components-collapsible-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-confirm-testing.mjs +150 -0
- package/fesm2022/ngx-com-components-confirm-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-datepicker-testing.mjs +137 -0
- package/fesm2022/ngx-com-components-datepicker-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-dialog-testing.mjs +109 -0
- package/fesm2022/ngx-com-components-dialog-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-dialog.mjs +18 -18
- package/fesm2022/ngx-com-components-dialog.mjs.map +1 -1
- package/fesm2022/ngx-com-components-dropdown.mjs +39 -0
- package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-com-components-form-field-testing.mjs +140 -0
- package/fesm2022/ngx-com-components-form-field-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-form-field.mjs +5 -1
- package/fesm2022/ngx-com-components-form-field.mjs.map +1 -1
- package/fesm2022/ngx-com-components-menu-testing.mjs +298 -0
- package/fesm2022/ngx-com-components-menu-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-paginator-testing.mjs +128 -0
- package/fesm2022/ngx-com-components-paginator-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-popover-testing.mjs +115 -0
- package/fesm2022/ngx-com-components-popover-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-radio-testing.mjs +157 -0
- package/fesm2022/ngx-com-components-radio-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-segmented-control-testing.mjs +122 -0
- package/fesm2022/ngx-com-components-segmented-control-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-sort-testing.mjs +108 -0
- package/fesm2022/ngx-com-components-sort-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-switch-testing.mjs +103 -0
- package/fesm2022/ngx-com-components-switch-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-table-testing.mjs +198 -0
- package/fesm2022/ngx-com-components-table-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-tabs-testing.mjs +126 -0
- package/fesm2022/ngx-com-components-tabs-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-timepicker-testing.mjs +117 -0
- package/fesm2022/ngx-com-components-timepicker-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-toast-testing.mjs +172 -0
- package/fesm2022/ngx-com-components-toast-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-toast.mjs +4 -4
- package/fesm2022/ngx-com-components-toast.mjs.map +1 -1
- package/fesm2022/ngx-com-components-tooltip-testing.mjs +117 -0
- package/fesm2022/ngx-com-components-tooltip-testing.mjs.map +1 -0
- package/package.json +89 -1
- package/types/ngx-com-components-alert-testing.d.ts +41 -0
- package/types/ngx-com-components-calendar-testing.d.ts +80 -0
- package/types/ngx-com-components-carousel-testing.d.ts +51 -0
- package/types/ngx-com-components-checkbox-testing.d.ts +56 -0
- package/types/ngx-com-components-code-block-testing.d.ts +45 -0
- package/types/ngx-com-components-collapsible-testing.d.ts +53 -0
- package/types/ngx-com-components-confirm-testing.d.ts +78 -0
- package/types/ngx-com-components-datepicker-testing.d.ts +61 -0
- package/types/ngx-com-components-dialog-testing.d.ts +57 -0
- package/types/ngx-com-components-dropdown.d.ts +12 -0
- package/types/ngx-com-components-form-field-testing.d.ts +61 -0
- package/types/ngx-com-components-menu-testing.d.ts +167 -0
- package/types/ngx-com-components-paginator-testing.d.ts +58 -0
- package/types/ngx-com-components-popover-testing.d.ts +63 -0
- package/types/ngx-com-components-radio-testing.d.ts +86 -0
- package/types/ngx-com-components-segmented-control-testing.d.ts +66 -0
- package/types/ngx-com-components-sort-testing.d.ts +62 -0
- package/types/ngx-com-components-switch-testing.d.ts +52 -0
- package/types/ngx-com-components-table-testing.d.ts +124 -0
- package/types/ngx-com-components-tabs-testing.d.ts +67 -0
- package/types/ngx-com-components-timepicker-testing.d.ts +53 -0
- package/types/ngx-com-components-toast-testing.d.ts +93 -0
- package/types/ngx-com-components-tooltip-testing.d.ts +57 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { ComponentHarness, HarnessPredicate, parallel } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Harness for interacting with an individual toast notification in tests.
|
|
5
|
+
*
|
|
6
|
+
* Because toasts are rendered inside a CDK overlay, use
|
|
7
|
+
* `TestbedHarnessEnvironment.documentRootLoader(fixture)` or
|
|
8
|
+
* `documentRootLocatorFactory()` to locate them.
|
|
9
|
+
*/
|
|
10
|
+
class ComToastHarness extends ComponentHarness {
|
|
11
|
+
static hostSelector = 'com-toast';
|
|
12
|
+
innerDiv = this.locatorFor('div[role]');
|
|
13
|
+
titleEl = this.locatorForOptional('[data-part="title"]');
|
|
14
|
+
messageEl = this.locatorForOptional('[data-part="message"]');
|
|
15
|
+
closeButton = this.locatorForOptional('button[aria-label="Dismiss notification"]');
|
|
16
|
+
actionButton = this.locatorForOptional('.flex-1 button');
|
|
17
|
+
/**
|
|
18
|
+
* Gets a HarnessPredicate for matching toasts.
|
|
19
|
+
* @param options Filter options.
|
|
20
|
+
*/
|
|
21
|
+
static with(options = {}) {
|
|
22
|
+
return new HarnessPredicate(ComToastHarness, options)
|
|
23
|
+
.addOption('message', options.message, async (harness, message) => {
|
|
24
|
+
const text = await harness.getMessageText();
|
|
25
|
+
return HarnessPredicate.stringMatches(text, message);
|
|
26
|
+
})
|
|
27
|
+
.addOption('title', options.title, async (harness, title) => {
|
|
28
|
+
const text = await harness.getTitleText();
|
|
29
|
+
return HarnessPredicate.stringMatches(text, title);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** Gets the ARIA role of the toast (`"alert"` or `"status"`). */
|
|
33
|
+
async getRole() {
|
|
34
|
+
const div = await this.innerDiv();
|
|
35
|
+
return div.getAttribute('role');
|
|
36
|
+
}
|
|
37
|
+
/** Gets the `aria-live` value of the toast (`"assertive"` or `"polite"`). */
|
|
38
|
+
async getAriaLive() {
|
|
39
|
+
const div = await this.innerDiv();
|
|
40
|
+
return div.getAttribute('aria-live');
|
|
41
|
+
}
|
|
42
|
+
/** Gets the `data-state` attribute (`"open"` or `"closed"`). */
|
|
43
|
+
async getState() {
|
|
44
|
+
const div = await this.innerDiv();
|
|
45
|
+
return div.getAttribute('data-state');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Gets the toast's title text, or `null` if no title is present.
|
|
49
|
+
*/
|
|
50
|
+
async getTitleText() {
|
|
51
|
+
const el = await this.titleEl();
|
|
52
|
+
if (!el) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return el.text();
|
|
56
|
+
}
|
|
57
|
+
/** Gets the toast's message text. */
|
|
58
|
+
async getMessageText() {
|
|
59
|
+
const el = await this.messageEl();
|
|
60
|
+
if (!el) {
|
|
61
|
+
const host = await this.host();
|
|
62
|
+
return host.text();
|
|
63
|
+
}
|
|
64
|
+
return el.text();
|
|
65
|
+
}
|
|
66
|
+
/** Whether the toast has an action button. */
|
|
67
|
+
async hasAction() {
|
|
68
|
+
const btn = await this.actionButton();
|
|
69
|
+
return btn !== null;
|
|
70
|
+
}
|
|
71
|
+
/** Gets the action button's text, or `null` if no action exists. */
|
|
72
|
+
async getActionText() {
|
|
73
|
+
const btn = await this.actionButton();
|
|
74
|
+
if (!btn) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
return btn.text();
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Clicks the action button.
|
|
81
|
+
* @throws If no action button is present.
|
|
82
|
+
*/
|
|
83
|
+
async clickAction() {
|
|
84
|
+
const btn = await this.actionButton();
|
|
85
|
+
if (!btn) {
|
|
86
|
+
throw new Error('Cannot click action: toast does not have an action button.');
|
|
87
|
+
}
|
|
88
|
+
return btn.click();
|
|
89
|
+
}
|
|
90
|
+
/** Whether the toast has a close (dismiss) button. */
|
|
91
|
+
async isDismissible() {
|
|
92
|
+
const btn = await this.closeButton();
|
|
93
|
+
return btn !== null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Clicks the close button to dismiss the toast.
|
|
97
|
+
* @throws If no close button is present.
|
|
98
|
+
*/
|
|
99
|
+
async dismiss() {
|
|
100
|
+
const btn = await this.closeButton();
|
|
101
|
+
if (!btn) {
|
|
102
|
+
throw new Error('Cannot dismiss: toast does not have a close button. '
|
|
103
|
+
+ 'Check that showClose is enabled.');
|
|
104
|
+
}
|
|
105
|
+
return btn.click();
|
|
106
|
+
}
|
|
107
|
+
/** Whether the toast is disabled. */
|
|
108
|
+
async isDisabled() {
|
|
109
|
+
const host = await this.host();
|
|
110
|
+
return (await host.getAttribute('aria-disabled')) === 'true';
|
|
111
|
+
}
|
|
112
|
+
/** Whether the toast host is focused. */
|
|
113
|
+
async isFocused() {
|
|
114
|
+
const host = await this.host();
|
|
115
|
+
return host.isFocused();
|
|
116
|
+
}
|
|
117
|
+
/** Focuses the toast host element. */
|
|
118
|
+
async focus() {
|
|
119
|
+
const host = await this.host();
|
|
120
|
+
return host.focus();
|
|
121
|
+
}
|
|
122
|
+
/** Blurs the toast host element. */
|
|
123
|
+
async blur() {
|
|
124
|
+
const host = await this.host();
|
|
125
|
+
return host.blur();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Harness for interacting with the toast container in tests.
|
|
130
|
+
*
|
|
131
|
+
* The container is rendered in a CDK overlay. Use
|
|
132
|
+
* `TestbedHarnessEnvironment.documentRootLoader(fixture)` to locate it.
|
|
133
|
+
*/
|
|
134
|
+
class ComToastContainerHarness extends ComponentHarness {
|
|
135
|
+
static hostSelector = 'com-toast-container';
|
|
136
|
+
regionDiv = this.locatorFor('[role="region"]');
|
|
137
|
+
/**
|
|
138
|
+
* Gets a HarnessPredicate for matching toast containers.
|
|
139
|
+
* @param options Filter options.
|
|
140
|
+
*/
|
|
141
|
+
static with(options = {}) {
|
|
142
|
+
return new HarnessPredicate(ComToastContainerHarness, options);
|
|
143
|
+
}
|
|
144
|
+
/** Gets the container's `aria-label` attribute. */
|
|
145
|
+
async getAriaLabel() {
|
|
146
|
+
const region = await this.regionDiv();
|
|
147
|
+
return region.getAttribute('aria-label');
|
|
148
|
+
}
|
|
149
|
+
/** Gets all toast harnesses inside the container, optionally filtered. */
|
|
150
|
+
async getToasts(filters = {}) {
|
|
151
|
+
return this.locatorForAll(ComToastHarness.with(filters))();
|
|
152
|
+
}
|
|
153
|
+
/** Gets the number of toasts currently in the container. */
|
|
154
|
+
async getToastCount() {
|
|
155
|
+
const toasts = await this.getToasts();
|
|
156
|
+
return toasts.length;
|
|
157
|
+
}
|
|
158
|
+
/** Gets the message text of all toasts. */
|
|
159
|
+
async getToastMessages() {
|
|
160
|
+
const toasts = await this.getToasts();
|
|
161
|
+
return parallel(() => toasts.map((t) => t.getMessageText()));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Testing utilities for the toast component
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Generated bundle index. Do not edit.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
export { ComToastContainerHarness, ComToastHarness };
|
|
172
|
+
//# sourceMappingURL=ngx-com-components-toast-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-com-components-toast-testing.mjs","sources":["../../../projects/com/components/toast/testing/toast.harness.ts","../../../projects/com/components/toast/testing/index.ts","../../../projects/com/components/toast/testing/ngx-com-components-toast-testing.ts"],"sourcesContent":["import {\n ComponentHarness,\n HarnessPredicate,\n parallel,\n} from '@angular/cdk/testing';\nimport type { BaseHarnessFilters } from '@angular/cdk/testing';\n\n/** Harness filters for ComToastHarness. */\nexport interface ComToastHarnessFilters extends BaseHarnessFilters {\n /** Filter by the toast's message text. */\n message?: string | RegExp;\n /** Filter by the toast's title text. */\n title?: string | RegExp;\n}\n\n/** Harness filters for ComToastContainerHarness. */\nexport type ComToastContainerHarnessFilters = BaseHarnessFilters;\n\n/**\n * Harness for interacting with an individual toast notification in tests.\n *\n * Because toasts are rendered inside a CDK overlay, use\n * `TestbedHarnessEnvironment.documentRootLoader(fixture)` or\n * `documentRootLocatorFactory()` to locate them.\n */\nexport class ComToastHarness extends ComponentHarness {\n static hostSelector = 'com-toast';\n\n private readonly innerDiv = this.locatorFor('div[role]');\n private readonly titleEl = this.locatorForOptional('[data-part=\"title\"]');\n private readonly messageEl = this.locatorForOptional(\n '[data-part=\"message\"]',\n );\n private readonly closeButton = this.locatorForOptional(\n 'button[aria-label=\"Dismiss notification\"]',\n );\n private readonly actionButton = this.locatorForOptional('.flex-1 button');\n\n /**\n * Gets a HarnessPredicate for matching toasts.\n * @param options Filter options.\n */\n static with(\n options: ComToastHarnessFilters = {},\n ): HarnessPredicate<ComToastHarness> {\n return new HarnessPredicate(ComToastHarness, options)\n .addOption('message', options.message, async (harness, message) => {\n const text = await harness.getMessageText();\n return HarnessPredicate.stringMatches(text, message);\n })\n .addOption('title', options.title, async (harness, title) => {\n const text = await harness.getTitleText();\n return HarnessPredicate.stringMatches(text, title);\n });\n }\n\n /** Gets the ARIA role of the toast (`\"alert\"` or `\"status\"`). */\n async getRole(): Promise<string | null> {\n const div = await this.innerDiv();\n return div.getAttribute('role');\n }\n\n /** Gets the `aria-live` value of the toast (`\"assertive\"` or `\"polite\"`). */\n async getAriaLive(): Promise<string | null> {\n const div = await this.innerDiv();\n return div.getAttribute('aria-live');\n }\n\n /** Gets the `data-state` attribute (`\"open\"` or `\"closed\"`). */\n async getState(): Promise<string | null> {\n const div = await this.innerDiv();\n return div.getAttribute('data-state');\n }\n\n /**\n * Gets the toast's title text, or `null` if no title is present.\n */\n async getTitleText(): Promise<string | null> {\n const el = await this.titleEl();\n if (!el) {\n return null;\n }\n return el.text();\n }\n\n /** Gets the toast's message text. */\n async getMessageText(): Promise<string> {\n const el = await this.messageEl();\n if (!el) {\n const host = await this.host();\n return host.text();\n }\n return el.text();\n }\n\n /** Whether the toast has an action button. */\n async hasAction(): Promise<boolean> {\n const btn = await this.actionButton();\n return btn !== null;\n }\n\n /** Gets the action button's text, or `null` if no action exists. */\n async getActionText(): Promise<string | null> {\n const btn = await this.actionButton();\n if (!btn) {\n return null;\n }\n return btn.text();\n }\n\n /**\n * Clicks the action button.\n * @throws If no action button is present.\n */\n async clickAction(): Promise<void> {\n const btn = await this.actionButton();\n if (!btn) {\n throw new Error(\n 'Cannot click action: toast does not have an action button.',\n );\n }\n return btn.click();\n }\n\n /** Whether the toast has a close (dismiss) button. */\n async isDismissible(): Promise<boolean> {\n const btn = await this.closeButton();\n return btn !== null;\n }\n\n /**\n * Clicks the close button to dismiss the toast.\n * @throws If no close button is present.\n */\n async dismiss(): Promise<void> {\n const btn = await this.closeButton();\n if (!btn) {\n throw new Error(\n 'Cannot dismiss: toast does not have a close button. '\n + 'Check that showClose is enabled.',\n );\n }\n return btn.click();\n }\n\n /** Whether the toast is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the toast host is focused. */\n async isFocused(): Promise<boolean> {\n const host = await this.host();\n return host.isFocused();\n }\n\n /** Focuses the toast host element. */\n async focus(): Promise<void> {\n const host = await this.host();\n return host.focus();\n }\n\n /** Blurs the toast host element. */\n async blur(): Promise<void> {\n const host = await this.host();\n return host.blur();\n }\n}\n\n/**\n * Harness for interacting with the toast container in tests.\n *\n * The container is rendered in a CDK overlay. Use\n * `TestbedHarnessEnvironment.documentRootLoader(fixture)` to locate it.\n */\nexport class ComToastContainerHarness extends ComponentHarness {\n static hostSelector = 'com-toast-container';\n\n private readonly regionDiv = this.locatorFor('[role=\"region\"]');\n\n /**\n * Gets a HarnessPredicate for matching toast containers.\n * @param options Filter options.\n */\n static with(\n options: ComToastContainerHarnessFilters = {},\n ): HarnessPredicate<ComToastContainerHarness> {\n return new HarnessPredicate(ComToastContainerHarness, options);\n }\n\n /** Gets the container's `aria-label` attribute. */\n async getAriaLabel(): Promise<string | null> {\n const region = await this.regionDiv();\n return region.getAttribute('aria-label');\n }\n\n /** Gets all toast harnesses inside the container, optionally filtered. */\n async getToasts(\n filters: ComToastHarnessFilters = {},\n ): Promise<ComToastHarness[]> {\n return this.locatorForAll(ComToastHarness.with(filters))();\n }\n\n /** Gets the number of toasts currently in the container. */\n async getToastCount(): Promise<number> {\n const toasts = await this.getToasts();\n return toasts.length;\n }\n\n /** Gets the message text of all toasts. */\n async getToastMessages(): Promise<string[]> {\n const toasts = await this.getToasts();\n return parallel(() => toasts.map((t) => t.getMessageText()));\n }\n}\n","// Testing utilities for the toast component\n\nexport {\n ComToastHarness,\n ComToastContainerHarness,\n} from './toast.harness';\n\nexport type {\n ComToastHarnessFilters,\n ComToastContainerHarnessFilters,\n} from './toast.harness';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAkBA;;;;;;AAMG;AACG,MAAO,eAAgB,SAAQ,gBAAgB,CAAA;AACnD,IAAA,OAAO,YAAY,GAAG,WAAW;AAEhB,IAAA,QAAQ,GAAG,IAAI,CAAC,UAAU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G,MAAM,IAAI,CAAC,SAAS,EAAE;AACrC,QAAA,OAAO,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC;IAC1C;;AAGA,IAAA,MAAM,SAAS,CACb,OAAA,GAAkC,EAAE,EAAA;AAEpC,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE;IAC5D;;AAGA,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE;QACrC,OAAO,MAAM,CAAC,MAAM;IACtB;;AAGA,IAAA,MAAM,gBAAgB,GAAA;AACpB,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE;QACrC,OAAO,QAAQ,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9D;;;ACtNF;;ACAA;;AAEG;;;;"}
|
|
@@ -249,9 +249,9 @@ class ComToastComponent {
|
|
|
249
249
|
/>
|
|
250
250
|
<div class="flex-1 min-w-0">
|
|
251
251
|
@if (state().data.title) {
|
|
252
|
-
<p class="text-sm font-semibold">{{ state().data.title }}</p>
|
|
252
|
+
<p data-part="title" class="text-sm font-semibold">{{ state().data.title }}</p>
|
|
253
253
|
}
|
|
254
|
-
<p class="text-sm" [class.mt-1]="state().data.title">
|
|
254
|
+
<p data-part="message" class="text-sm" [class.mt-1]="state().data.title">
|
|
255
255
|
{{ state().data.message }}
|
|
256
256
|
</p>
|
|
257
257
|
@if (state().data.action) {
|
|
@@ -312,9 +312,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
312
312
|
/>
|
|
313
313
|
<div class="flex-1 min-w-0">
|
|
314
314
|
@if (state().data.title) {
|
|
315
|
-
<p class="text-sm font-semibold">{{ state().data.title }}</p>
|
|
315
|
+
<p data-part="title" class="text-sm font-semibold">{{ state().data.title }}</p>
|
|
316
316
|
}
|
|
317
|
-
<p class="text-sm" [class.mt-1]="state().data.title">
|
|
317
|
+
<p data-part="message" class="text-sm" [class.mt-1]="state().data.title">
|
|
318
318
|
{{ state().data.message }}
|
|
319
319
|
</p>
|
|
320
320
|
@if (state().data.action) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-com-components-toast.mjs","sources":["../../../projects/com/components/toast/toast.ref.ts","../../../projects/com/components/toast/toast.variants.ts","../../../projects/com/components/toast/toast.utils.ts","../../../projects/com/components/toast/toast.component.ts","../../../projects/com/components/toast/toast.providers.ts","../../../projects/com/components/toast/toast-container.component.ts","../../../projects/com/components/toast/toast.service.ts","../../../projects/com/components/toast/index.ts","../../../projects/com/components/toast/ngx-com-components-toast.ts"],"sourcesContent":["import { Observable, Subject } from 'rxjs';\nimport type { ComToastDismissEvent } from './toast.models';\n\n/**\n * Reference to an active toast notification.\n * Returned by `ComToastService` methods for programmatic control.\n */\nexport class ComToastRef {\n private readonly dismissSubject = new Subject<ComToastDismissEvent>();\n private readonly actionSubject = new Subject<void>();\n private readonly dismissFn: () => void;\n private dismissed = false;\n\n constructor(dismissFn: () => void) {\n this.dismissFn = dismissFn;\n }\n\n /** Programmatically dismiss the toast. */\n dismiss(): void {\n if (!this.dismissed) {\n this.dismissFn();\n }\n }\n\n /** Emits once when the toast is dismissed (for any reason). */\n afterDismissed(): Observable<ComToastDismissEvent> {\n return this.dismissSubject.asObservable();\n }\n\n /** Emits when the action button is clicked. */\n afterAction(): Observable<void> {\n return this.actionSubject.asObservable();\n }\n\n /** @internal */\n _notifyDismissed(event: ComToastDismissEvent): void {\n if (this.dismissed) return;\n this.dismissed = true;\n this.dismissSubject.next(event);\n this.dismissSubject.complete();\n this.actionSubject.complete();\n }\n\n /** @internal */\n _notifyAction(): void {\n this.actionSubject.next();\n }\n}\n","import { cva } from 'class-variance-authority';\nimport type { ComToastType, ComToastPosition } from './toast.models';\n\n/**\n * CVA variants for an individual toast card.\n *\n * @tokens `--color-success`, `--color-success-foreground`,\n * `--color-warn`, `--color-warn-foreground`,\n * `--color-warn-subtle`, `--color-warn-subtle-foreground`,\n * `--color-primary-subtle`, `--color-primary-subtle-foreground`,\n * `--color-border`, `--shadow-overlay`, `--radius-card`\n */\nexport const toastVariants: (props?: {\n type?: ComToastType;\n}) => string = cva(\n [\n 'flex',\n 'w-full',\n 'max-w-sm',\n 'items-start',\n 'gap-3',\n 'rounded-card',\n 'border',\n 'p-4',\n 'shadow-overlay',\n 'pointer-events-auto',\n 'relative',\n 'overflow-hidden',\n ],\n {\n variants: {\n type: {\n success: 'bg-success text-success-foreground border-success',\n warn: 'bg-warn-subtle text-warn-subtle-foreground border-warn',\n error: 'bg-warn text-warn-foreground border-warn',\n info: 'bg-primary-subtle text-primary-subtle-foreground border-primary',\n },\n },\n defaultVariants: {\n type: 'info',\n },\n },\n);\n\n/**\n * CVA variants for the toast container positioning.\n */\nexport const toastContainerVariants: (props?: {\n position?: ComToastPosition;\n}) => string = cva(\n [\n 'flex',\n 'gap-3',\n 'pointer-events-none',\n 'max-h-screen',\n 'p-4',\n ],\n {\n variants: {\n position: {\n 'top-right': 'flex-col items-end',\n 'top-left': 'flex-col items-start',\n 'top-center': 'flex-col items-center',\n 'bottom-right': 'flex-col-reverse items-end',\n 'bottom-left': 'flex-col-reverse items-start',\n 'bottom-center': 'flex-col-reverse items-center',\n },\n },\n defaultVariants: {\n position: 'bottom-right',\n },\n },\n);\n\n/**\n * CVA variants for the toast progress bar.\n */\nexport const toastProgressVariants: (props?: {\n type?: ComToastType;\n}) => string = cva(\n [\n 'absolute',\n 'bottom-0',\n 'left-0',\n 'h-0.5',\n 'rounded-pill',\n ],\n {\n variants: {\n type: {\n success: 'bg-success-foreground-track',\n warn: 'bg-warn-subtle-foreground-track',\n error: 'bg-warn-foreground-track',\n info: 'bg-primary-subtle-foreground-track',\n },\n },\n defaultVariants: {\n type: 'info',\n },\n },\n);\n\n/**\n * CVA variants for the toast close button.\n *\n * @tokens `--color-ring`, `--radius-card`,\n * `--color-success-foreground-muted`, `--color-warn-subtle-foreground-muted`,\n * `--color-warn-foreground-muted`, `--color-primary-subtle-foreground-muted`\n */\nexport const toastCloseButtonVariants: (props?: {\n type?: ComToastType;\n}) => string = cva(\n [\n 'shrink-0',\n 'rounded-card',\n 'p-0.5',\n 'transition-colors',\n 'outline-none',\n 'focus-visible:outline-2',\n 'focus-visible:outline-offset-2',\n 'focus-visible:outline-[--color-ring]',\n ],\n {\n variants: {\n type: {\n success: 'text-success-foreground-muted hover:text-success-foreground',\n warn: 'text-warn-subtle-foreground-muted hover:text-warn-subtle-foreground',\n error: 'text-warn-foreground-muted hover:text-warn-foreground',\n info: 'text-primary-subtle-foreground-muted hover:text-primary-subtle-foreground',\n },\n },\n defaultVariants: {\n type: 'info',\n },\n },\n);\n","export { mergeClasses } from 'ngx-com/utils';\n\nlet toastIdCounter = 0;\n\n/**\n * Generate a unique ID for a toast notification.\n */\nexport function generateToastId(): number {\n return ++toastIdCounter;\n}\n\n/** Default Lucide icon names per toast type. */\nexport const DEFAULT_TOAST_ICONS: Record<string, string> = {\n success: 'circle-check',\n warn: 'triangle-alert',\n error: 'circle-x',\n info: 'info',\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n output,\n} from '@angular/core';\nimport type { InputSignal, OutputEmitterRef, Signal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ComIcon } from 'ngx-com/components/icon';\nimport {\n toastVariants,\n toastProgressVariants,\n toastCloseButtonVariants,\n} from './toast.variants';\nimport { mergeClasses, DEFAULT_TOAST_ICONS } from './toast.utils';\nimport type { ComToastState, ComToastTemplateContext } from './toast.models';\n\n/**\n * Internal toast notification component rendered inside the container.\n *\n * @internal Not exported in public API\n *\n * @tokens `--color-success`, `--color-success-foreground`,\n * `--color-warn`, `--color-warn-foreground`,\n * `--color-warn-subtle`, `--color-warn-subtle-foreground`,\n * `--color-primary-subtle`, `--color-primary-subtle-foreground`,\n * `--color-border`, `--shadow-overlay`, `--radius-card`, `--color-ring`\n */\n@Component({\n selector: 'com-toast',\n template: `\n <div\n [class]=\"toastClasses()\"\n [attr.role]=\"ariaRole()\"\n [attr.aria-live]=\"ariaLive()\"\n [attr.data-state]=\"state().visible ? 'open' : 'closed'\"\n (animationend)=\"onAnimationEnd()\"\n >\n @if (state().data.customTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"state().data.customTemplate!\"\n [ngTemplateOutletContext]=\"templateContext()\"\n />\n } @else {\n <com-icon\n [name]=\"resolvedIcon()\"\n size=\"md\"\n class=\"mt-0.5 shrink-0\"\n aria-hidden=\"true\"\n />\n <div class=\"flex-1 min-w-0\">\n @if (state().data.title) {\n <p class=\"text-sm font-semibold\">{{ state().data.title }}</p>\n }\n <p class=\"text-sm\" [class.mt-1]=\"state().data.title\">\n {{ state().data.message }}\n </p>\n @if (state().data.action) {\n <button\n type=\"button\"\n class=\"mt-2 text-sm font-medium underline underline-offset-4\n outline-none\n focus-visible:outline-2\n focus-visible:outline-offset-2\n focus-visible:outline-[--color-ring]\"\n (click)=\"onAction.emit(state().id)\"\n >\n {{ state().data.action!.label }}\n </button>\n }\n </div>\n @if (state().showClose) {\n <button\n type=\"button\"\n [class]=\"closeButtonClasses()\"\n aria-label=\"Dismiss notification\"\n (click)=\"onDismiss.emit(state().id)\"\n >\n <com-icon name=\"x\" size=\"sm\" aria-hidden=\"true\" />\n </button>\n }\n }\n @if (state().showProgress && state().duration > 0) {\n <div\n [class]=\"progressClasses()\"\n [style.width.%]=\"state().remainingPercent\"\n ></div>\n }\n </div>\n `,\n styles: `\n :host {\n display: contents;\n }\n\n [data-state='open'] {\n --tw-enter-opacity: 0;\n --tw-enter-translate-x: 0;\n --tw-enter-translate-y: 0;\n }\n\n [data-state='closed'] {\n --tw-exit-opacity: 0;\n --tw-exit-translate-x: 0;\n --tw-exit-translate-y: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n [data-state='open'],\n [data-state='closed'] {\n animation: none;\n }\n }\n `,\n imports: [NgTemplateOutlet, ComIcon],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ComToastComponent {\n /** The toast state, set by the container. */\n readonly state: InputSignal<ComToastState> = input.required<ComToastState>();\n\n /** Emitted when the toast should be dismissed. */\n // eslint-disable-next-line @angular-eslint/no-output-on-prefix -- intentional API naming for toast event delegation\n readonly onDismiss: OutputEmitterRef<number> = output<number>();\n\n /** Emitted when the action button is clicked. */\n // eslint-disable-next-line @angular-eslint/no-output-on-prefix -- intentional API naming for toast event delegation\n readonly onAction: OutputEmitterRef<number> = output<number>();\n\n /** Emitted when the mouse enters the toast. */\n readonly mouseEnter: OutputEmitterRef<void> = output<void>();\n\n /** Emitted when the mouse leaves the toast. */\n readonly mouseLeave: OutputEmitterRef<void> = output<void>();\n\n /** Emitted when the exit animation completes. */\n readonly animationDone: OutputEmitterRef<number> = output<number>();\n\n /** Resolved icon name. */\n protected readonly resolvedIcon: Signal<string> = computed(\n () => this.state().data.icon ?? DEFAULT_TOAST_ICONS[this.state().type] ?? 'info',\n );\n\n /** ARIA role based on toast type. */\n protected readonly ariaRole: Signal<string> = computed(() =>\n this.state().type === 'error' ? 'alert' : 'status',\n );\n\n /** ARIA live region politeness. */\n protected readonly ariaLive: Signal<string> = computed(() =>\n this.state().type === 'error' ? 'assertive' : 'polite',\n );\n\n /** Computed toast card classes. */\n protected readonly toastClasses: Signal<string> = computed(() =>\n mergeClasses(\n toastVariants({ type: this.state().type }),\n this.state().visible\n ? 'animate-in fade-in-0 slide-in-from-bottom-2'\n : 'animate-out fade-out-0 slide-out-to-right-full',\n ),\n );\n\n /** Computed progress bar classes. */\n protected readonly progressClasses: Signal<string> = computed(() =>\n mergeClasses(toastProgressVariants({ type: this.state().type })),\n );\n\n /** Computed close button classes. */\n protected readonly closeButtonClasses: Signal<string> = computed(() =>\n mergeClasses(toastCloseButtonVariants({ type: this.state().type })),\n );\n\n /** Template context for custom templates. */\n protected readonly templateContext: Signal<ComToastTemplateContext> = computed(() => ({\n $implicit: this.state().data,\n dismiss: () => this.onDismiss.emit(this.state().id),\n action: () => this.onAction.emit(this.state().id),\n }));\n\n protected onAnimationEnd(): void {\n if (!this.state().visible) {\n this.animationDone.emit(this.state().id);\n }\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport type { Provider } from '@angular/core';\nimport type { ComToastConfig, ComToastContainerData } from './toast.models';\n\n/**\n * Injection token for global toast configuration.\n */\nexport const COM_TOAST_CONFIG: InjectionToken<ComToastConfig> =\n new InjectionToken<ComToastConfig>('COM_TOAST_CONFIG');\n\n/**\n * Injection token for internal container communication.\n * @internal\n */\nexport const COM_TOAST_CONTAINER_DATA: InjectionToken<ComToastContainerData> =\n new InjectionToken<ComToastContainerData>('COM_TOAST_CONTAINER_DATA');\n\n/**\n * Provides global toast configuration.\n *\n * @example\n * ```typescript\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideComToastConfig({ position: 'top-center', duration: 3000 }),\n * ],\n * });\n * ```\n */\nexport function provideComToastConfig(config: ComToastConfig): Provider {\n return { provide: COM_TOAST_CONFIG, useValue: config };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n} from '@angular/core';\nimport type { Signal } from '@angular/core';\nimport { ComToastComponent } from './toast.component';\nimport { toastContainerVariants } from './toast.variants';\nimport { mergeClasses } from './toast.utils';\nimport { COM_TOAST_CONTAINER_DATA } from './toast.providers';\nimport type { ComToastContainerData, ComToastState } from './toast.models';\n\n/**\n * Internal toast container component that manages positioning and stacking.\n *\n * @internal Not exported in public API\n *\n * @tokens `--color-success`, `--color-success-foreground`,\n * `--color-warn`, `--color-warn-foreground`,\n * `--color-warn-subtle`, `--color-warn-subtle-foreground`,\n * `--color-primary-subtle`, `--color-primary-subtle-foreground`,\n * `--color-border`, `--shadow-overlay`, `--radius-card`\n */\n@Component({\n selector: 'com-toast-container',\n host: {\n '(keydown.escape)': 'onEscapeKey()',\n tabindex: '-1',\n },\n template: `\n <div\n [class]=\"containerClasses()\"\n role=\"region\"\n aria-label=\"Notifications\"\n >\n @for (toast of toasts(); track toast.id) {\n <com-toast\n [state]=\"toast\"\n (onDismiss)=\"containerData.onDismiss($event)\"\n (onAction)=\"containerData.onAction($event)\"\n (mouseEnter)=\"containerData.onMouseEnter(toast.id)\"\n (mouseLeave)=\"containerData.onMouseLeave(toast.id)\"\n (animationDone)=\"containerData.onAnimationDone($event)\"\n />\n }\n </div>\n `,\n styles: `\n :host {\n display: contents;\n }\n `,\n imports: [ComToastComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ComToastContainerComponent {\n protected readonly containerData: ComToastContainerData = inject(COM_TOAST_CONTAINER_DATA);\n\n /** Active toast states, read from the service's signal. */\n protected readonly toasts: Signal<ComToastState[]> = computed(() => this.containerData.toasts());\n\n /** Computed container positioning classes. */\n protected readonly containerClasses: Signal<string> = computed(() =>\n mergeClasses(toastContainerVariants({ position: this.containerData.position() })),\n );\n\n protected onEscapeKey(): void {\n this.containerData.onDismissLatest();\n }\n}\n","import {\n DestroyRef,\n inject,\n Injectable,\n Injector,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport type { WritableSignal } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { Overlay } from '@angular/cdk/overlay';\nimport type { GlobalPositionStrategy, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { ComToastRef } from './toast.ref';\nimport { ComToastContainerComponent } from './toast-container.component';\nimport { COM_TOAST_CONFIG, COM_TOAST_CONTAINER_DATA } from './toast.providers';\nimport { generateToastId } from './toast.utils';\nimport type {\n ComToastConfig,\n ComToastContainerData,\n ComToastData,\n ComToastDismissReason,\n ComToastPosition,\n ComToastState,\n ComToastTimerState,\n ComToastType,\n} from './toast.models';\n\n/** Default durations by toast type. */\nconst DEFAULT_DURATION: Record<ComToastType, number> = {\n success: 5000,\n warn: 5000,\n error: 0,\n info: 5000,\n};\n\n/** Fallback timeout for exit animation removal when animationend doesn't fire. */\nconst ANIMATION_FALLBACK_MS = 200;\n\n/**\n * Service for creating toast notifications imperatively.\n *\n * @example\n * ```typescript\n * const toast = inject(ComToastService);\n * toast.success('File uploaded successfully.');\n * toast.error('Failed to save.', 'Error');\n *\n * const ref = toast.show({ type: 'info', message: 'Item deleted.', action: { label: 'Undo' } });\n * ref.afterAction().subscribe(() => undoDelete());\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ComToastService {\n private readonly overlay = inject(Overlay);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly document = inject(DOCUMENT);\n private readonly globalConfig = inject(COM_TOAST_CONFIG, { optional: true });\n\n private overlayRef: OverlayRef | null = null;\n private readonly toasts: WritableSignal<ComToastState[]> = signal([]);\n private readonly position: WritableSignal<ComToastPosition>;\n private readonly timers = new Map<number, ComToastTimerState>();\n private readonly refs = new Map<number, ComToastRef>();\n private readonly animationFallbacks = new Map<number, ReturnType<typeof setTimeout>>();\n private readonly dismissReasons = new Map<number, ComToastDismissReason>();\n private rafHandle: number | null = null;\n\n private readonly config: Required<ComToastConfig>;\n\n constructor() {\n this.config = {\n position: 'bottom-right',\n duration: 5000,\n maxVisible: 5,\n pauseOnHover: true,\n showProgress: true,\n showClose: true,\n ...this.globalConfig,\n };\n this.position = signal(this.config.position);\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /**\n * Show a toast notification with full configuration.\n */\n show(data: ComToastData): ComToastRef {\n this.ensureContainer();\n\n const id = generateToastId();\n const type: ComToastType = data.type ?? 'info';\n const duration = data.duration ?? DEFAULT_DURATION[type] ?? this.config.duration;\n const showProgress = data.showProgress ?? this.config.showProgress;\n const showClose = data.showClose ?? this.config.showClose;\n\n const ref = new ComToastRef(() => this.dismiss(id, 'manual'));\n this.refs.set(id, ref);\n\n const state: ComToastState = {\n id,\n data,\n type,\n duration,\n showProgress,\n showClose,\n visible: true,\n remainingPercent: 100,\n };\n\n this.toasts.update((list) => [...list, state]);\n this.enforceMaxVisible();\n\n if (duration > 0) {\n this.startTimer(id, duration);\n }\n\n return ref;\n }\n\n /** Show a success toast. */\n success(message: string, title?: string): ComToastRef {\n return this.showByType('success', message, title);\n }\n\n /** Show a warning toast. */\n warn(message: string, title?: string): ComToastRef {\n return this.showByType('warn', message, title);\n }\n\n /** Show an error toast. */\n error(message: string, title?: string): ComToastRef {\n return this.showByType('error', message, title);\n }\n\n /** Show an info toast. */\n info(message: string, title?: string): ComToastRef {\n return this.showByType('info', message, title);\n }\n\n /** Dismiss all active toasts. */\n dismissAll(): void {\n for (const toast of this.toasts()) {\n this.dismiss(toast.id, 'manual');\n }\n }\n\n // ─── Private ───\n\n private showByType(type: ComToastType, message: string, title?: string): ComToastRef {\n const data: ComToastData = { type, message };\n if (title !== undefined) data.title = title;\n return this.show(data);\n }\n\n private ensureContainer(): void {\n if (this.overlayRef || !isPlatformBrowser(this.platformId)) return;\n\n const positionStrategy = this.buildPositionStrategy(this.config.position);\n\n const containerData: ComToastContainerData = {\n toasts: this.toasts.asReadonly(),\n position: this.position.asReadonly(),\n onMouseEnter: (id: number) => this.pauseTimer(id),\n onMouseLeave: (id: number) => this.resumeTimer(id),\n onDismiss: (id: number) => this.dismiss(id, 'manual'),\n onAction: (id: number) => this.handleAction(id),\n onDismissLatest: () => this.dismissLatest(),\n onAnimationDone: (id: number) => this.removeToast(id),\n };\n\n const containerInjector = Injector.create({\n providers: [{ provide: COM_TOAST_CONTAINER_DATA, useValue: containerData }],\n parent: this.injector,\n });\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n hasBackdrop: false,\n panelClass: 'com-toast-overlay',\n disposeOnNavigation: false,\n });\n\n const portal = new ComponentPortal(ComToastContainerComponent, null, containerInjector);\n this.overlayRef.attach(portal);\n }\n\n private buildPositionStrategy(position: ComToastPosition): GlobalPositionStrategy {\n const strategy = this.overlay.position().global();\n\n switch (position) {\n case 'top-right':\n return strategy.top('0').right('0');\n case 'top-left':\n return strategy.top('0').left('0');\n case 'top-center':\n return strategy.top('0').centerHorizontally();\n case 'bottom-right':\n return strategy.bottom('0').right('0');\n case 'bottom-left':\n return strategy.bottom('0').left('0');\n case 'bottom-center':\n return strategy.bottom('0').centerHorizontally();\n }\n }\n\n private dismiss(id: number, reason: ComToastDismissReason): void {\n this.clearTimer(id);\n this.dismissReasons.set(id, reason);\n\n // Trigger exit animation\n this.updateToast(id, { visible: false });\n\n // Set fallback timeout in case animationend doesn't fire\n const fallback = setTimeout(() => this.removeToast(id), ANIMATION_FALLBACK_MS);\n this.animationFallbacks.set(id, fallback);\n }\n\n private removeToast(id: number): void {\n // Clear animation fallback\n const fallback = this.animationFallbacks.get(id);\n if (fallback) {\n clearTimeout(fallback);\n this.animationFallbacks.delete(id);\n }\n\n // Check if toast still exists (may have been removed already)\n if (!this.toasts().some((t) => t.id === id)) return;\n\n this.toasts.update((list) => list.filter((t) => t.id !== id));\n\n const reason = this.dismissReasons.get(id) ?? 'auto';\n this.dismissReasons.delete(id);\n\n const ref = this.refs.get(id);\n if (ref) {\n ref._notifyDismissed({ reason });\n this.refs.delete(id);\n }\n\n if (this.toasts().length === 0) {\n this.disposeOverlay();\n }\n }\n\n private handleAction(id: number): void {\n const ref = this.refs.get(id);\n if (ref) {\n ref._notifyAction();\n }\n this.dismiss(id, 'action');\n }\n\n private dismissLatest(): void {\n const visible = this.toasts().filter((t) => t.visible);\n const latest = visible[visible.length - 1];\n if (latest) {\n this.dismiss(latest.id, 'manual');\n }\n }\n\n private enforceMaxVisible(): void {\n const currentToasts = this.toasts();\n const visibleCount = currentToasts.filter((t) => t.visible).length;\n\n if (visibleCount > this.config.maxVisible) {\n const oldest = currentToasts.find((t) => t.visible);\n if (oldest) {\n this.dismiss(oldest.id, 'limit');\n }\n }\n }\n\n // ─── Timer (rAF) ───\n\n private startTimer(id: number, duration: number): void {\n const now = this.now();\n this.timers.set(id, {\n startTime: now,\n elapsed: 0,\n duration,\n paused: false,\n pausedAt: 0,\n });\n\n this.ensureRafLoop();\n }\n\n private ensureRafLoop(): void {\n if (this.rafHandle !== null) return;\n\n const win = this.document.defaultView;\n if (!win) return;\n\n const tick = (): void => {\n const now = this.now();\n let needsUpdate = false;\n\n for (const [id, timer] of this.timers) {\n if (timer.paused) continue;\n\n const elapsed = timer.elapsed + (now - timer.startTime);\n const remaining = Math.max(0, 100 - (elapsed / timer.duration) * 100);\n const rounded = Math.round(remaining);\n\n // Find current state to compare\n const toast = this.toasts().find((t) => t.id === id);\n if (!toast || !toast.visible) {\n this.clearTimer(id);\n continue;\n }\n\n if (Math.round(toast.remainingPercent) !== rounded) {\n needsUpdate = true;\n }\n\n if (remaining <= 0) {\n this.clearTimer(id);\n this.dismiss(id, 'auto');\n needsUpdate = true;\n }\n }\n\n // Batch-update all progress values in a single signal write\n if (needsUpdate) {\n const now2 = this.now();\n this.toasts.update((list) =>\n list.map((t) => {\n const timer = this.timers.get(t.id);\n if (!timer || timer.paused) return t;\n\n const elapsed = timer.elapsed + (now2 - timer.startTime);\n const remaining = Math.max(0, 100 - (elapsed / timer.duration) * 100);\n return { ...t, remainingPercent: remaining };\n }),\n );\n }\n\n // Continue loop if there are active timers\n if (this.timers.size > 0) {\n this.rafHandle = win.requestAnimationFrame(tick);\n } else {\n this.rafHandle = null;\n }\n };\n\n this.rafHandle = win.requestAnimationFrame(tick);\n }\n\n private pauseTimer(id: number): void {\n if (!this.config.pauseOnHover) return;\n\n const timer = this.timers.get(id);\n if (!timer || timer.paused) return;\n\n const now = this.now();\n timer.elapsed += now - timer.startTime;\n timer.paused = true;\n timer.pausedAt = now;\n }\n\n private resumeTimer(id: number): void {\n if (!this.config.pauseOnHover) return;\n\n const timer = this.timers.get(id);\n if (!timer || !timer.paused) return;\n\n timer.paused = false;\n timer.startTime = this.now();\n }\n\n private clearTimer(id: number): void {\n this.timers.delete(id);\n }\n\n private now(): number {\n return this.document.defaultView?.performance.now() ?? Date.now();\n }\n\n // ─── Helpers ───\n\n private updateToast(id: number, patch: Partial<ComToastState>): void {\n this.toasts.update((list) =>\n list.map((t) => (t.id === id ? { ...t, ...patch } : t)),\n );\n }\n\n private disposeOverlay(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n\n const win = this.document.defaultView;\n if (this.rafHandle !== null && win) {\n win.cancelAnimationFrame(this.rafHandle);\n this.rafHandle = null;\n }\n }\n\n private dispose(): void {\n for (const id of this.timers.keys()) {\n this.clearTimer(id);\n }\n for (const [, fallback] of this.animationFallbacks) {\n clearTimeout(fallback);\n }\n this.animationFallbacks.clear();\n this.dismissReasons.clear();\n this.refs.clear();\n this.disposeOverlay();\n }\n}\n","// Public API for the toast notification system\n\n// Service\nexport { ComToastService } from './toast.service';\n\n// Ref\nexport { ComToastRef } from './toast.ref';\n\n// Types and interfaces\nexport type {\n ComToastConfig,\n ComToastData,\n ComToastType,\n ComToastPosition,\n ComToastDismissEvent,\n ComToastDismissReason,\n ComToastTemplateContext,\n} from './toast.models';\n\n// Providers\nexport { provideComToastConfig, COM_TOAST_CONFIG } from './toast.providers';\n\n// Variants (for advanced customization)\nexport {\n toastVariants,\n toastContainerVariants,\n toastProgressVariants,\n toastCloseButtonVariants,\n} from './toast.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAGA;;;AAGG;MACU,WAAW,CAAA;AACL,IAAA,cAAc,GAAG,IAAI,OAAO,EAAwB;AACpD,IAAA,aAAa,GAAG,IAAI,OAAO,EAAQ;AACnC,IAAA,SAAS;IAClB,SAAS,GAAG,KAAK;AAEzB,IAAA,WAAA,CAAY,SAAqB,EAAA;AAC/B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;IAC5B;;IAGA,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IA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A,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAf,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cADF,MAAM,EAAA,CAAA;;2FACnB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpDlC;AAEA;;ACFA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-com-components-toast.mjs","sources":["../../../projects/com/components/toast/toast.ref.ts","../../../projects/com/components/toast/toast.variants.ts","../../../projects/com/components/toast/toast.utils.ts","../../../projects/com/components/toast/toast.component.ts","../../../projects/com/components/toast/toast.providers.ts","../../../projects/com/components/toast/toast-container.component.ts","../../../projects/com/components/toast/toast.service.ts","../../../projects/com/components/toast/index.ts","../../../projects/com/components/toast/ngx-com-components-toast.ts"],"sourcesContent":["import { Observable, Subject } from 'rxjs';\nimport type { ComToastDismissEvent } from './toast.models';\n\n/**\n * Reference to an active toast notification.\n * Returned by `ComToastService` methods for programmatic control.\n */\nexport class ComToastRef {\n private readonly dismissSubject = new Subject<ComToastDismissEvent>();\n private readonly actionSubject = new Subject<void>();\n private readonly dismissFn: () => void;\n private dismissed = false;\n\n constructor(dismissFn: () => void) {\n this.dismissFn = dismissFn;\n }\n\n /** Programmatically dismiss the toast. */\n dismiss(): void {\n if (!this.dismissed) {\n this.dismissFn();\n }\n }\n\n /** Emits once when the toast is dismissed (for any reason). */\n afterDismissed(): Observable<ComToastDismissEvent> {\n return this.dismissSubject.asObservable();\n }\n\n /** Emits when the action button is clicked. */\n afterAction(): Observable<void> {\n return this.actionSubject.asObservable();\n }\n\n /** @internal */\n _notifyDismissed(event: ComToastDismissEvent): void {\n if (this.dismissed) return;\n this.dismissed = true;\n this.dismissSubject.next(event);\n this.dismissSubject.complete();\n this.actionSubject.complete();\n }\n\n /** @internal */\n _notifyAction(): void {\n this.actionSubject.next();\n }\n}\n","import { cva } from 'class-variance-authority';\nimport type { ComToastType, ComToastPosition } from './toast.models';\n\n/**\n * CVA variants for an individual toast card.\n *\n * @tokens `--color-success`, `--color-success-foreground`,\n * `--color-warn`, `--color-warn-foreground`,\n * `--color-warn-subtle`, `--color-warn-subtle-foreground`,\n * `--color-primary-subtle`, `--color-primary-subtle-foreground`,\n * `--color-border`, `--shadow-overlay`, `--radius-card`\n */\nexport const toastVariants: (props?: {\n type?: ComToastType;\n}) => string = cva(\n [\n 'flex',\n 'w-full',\n 'max-w-sm',\n 'items-start',\n 'gap-3',\n 'rounded-card',\n 'border',\n 'p-4',\n 'shadow-overlay',\n 'pointer-events-auto',\n 'relative',\n 'overflow-hidden',\n ],\n {\n variants: {\n type: {\n success: 'bg-success text-success-foreground border-success',\n warn: 'bg-warn-subtle text-warn-subtle-foreground border-warn',\n error: 'bg-warn text-warn-foreground border-warn',\n info: 'bg-primary-subtle text-primary-subtle-foreground border-primary',\n },\n },\n defaultVariants: {\n type: 'info',\n },\n },\n);\n\n/**\n * CVA variants for the toast container positioning.\n */\nexport const toastContainerVariants: (props?: {\n position?: ComToastPosition;\n}) => string = cva(\n [\n 'flex',\n 'gap-3',\n 'pointer-events-none',\n 'max-h-screen',\n 'p-4',\n ],\n {\n variants: {\n position: {\n 'top-right': 'flex-col items-end',\n 'top-left': 'flex-col items-start',\n 'top-center': 'flex-col items-center',\n 'bottom-right': 'flex-col-reverse items-end',\n 'bottom-left': 'flex-col-reverse items-start',\n 'bottom-center': 'flex-col-reverse items-center',\n },\n },\n defaultVariants: {\n position: 'bottom-right',\n },\n },\n);\n\n/**\n * CVA variants for the toast progress bar.\n */\nexport const toastProgressVariants: (props?: {\n type?: ComToastType;\n}) => string = cva(\n [\n 'absolute',\n 'bottom-0',\n 'left-0',\n 'h-0.5',\n 'rounded-pill',\n ],\n {\n variants: {\n type: {\n success: 'bg-success-foreground-track',\n warn: 'bg-warn-subtle-foreground-track',\n error: 'bg-warn-foreground-track',\n info: 'bg-primary-subtle-foreground-track',\n },\n },\n defaultVariants: {\n type: 'info',\n },\n },\n);\n\n/**\n * CVA variants for the toast close button.\n *\n * @tokens `--color-ring`, `--radius-card`,\n * `--color-success-foreground-muted`, `--color-warn-subtle-foreground-muted`,\n * `--color-warn-foreground-muted`, `--color-primary-subtle-foreground-muted`\n */\nexport const toastCloseButtonVariants: (props?: {\n type?: ComToastType;\n}) => string = cva(\n [\n 'shrink-0',\n 'rounded-card',\n 'p-0.5',\n 'transition-colors',\n 'outline-none',\n 'focus-visible:outline-2',\n 'focus-visible:outline-offset-2',\n 'focus-visible:outline-[--color-ring]',\n ],\n {\n variants: {\n type: {\n success: 'text-success-foreground-muted hover:text-success-foreground',\n warn: 'text-warn-subtle-foreground-muted hover:text-warn-subtle-foreground',\n error: 'text-warn-foreground-muted hover:text-warn-foreground',\n info: 'text-primary-subtle-foreground-muted hover:text-primary-subtle-foreground',\n },\n },\n defaultVariants: {\n type: 'info',\n },\n },\n);\n","export { mergeClasses } from 'ngx-com/utils';\n\nlet toastIdCounter = 0;\n\n/**\n * Generate a unique ID for a toast notification.\n */\nexport function generateToastId(): number {\n return ++toastIdCounter;\n}\n\n/** Default Lucide icon names per toast type. */\nexport const DEFAULT_TOAST_ICONS: Record<string, string> = {\n success: 'circle-check',\n warn: 'triangle-alert',\n error: 'circle-x',\n info: 'info',\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n output,\n} from '@angular/core';\nimport type { InputSignal, OutputEmitterRef, Signal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ComIcon } from 'ngx-com/components/icon';\nimport {\n toastVariants,\n toastProgressVariants,\n toastCloseButtonVariants,\n} from './toast.variants';\nimport { mergeClasses, DEFAULT_TOAST_ICONS } from './toast.utils';\nimport type { ComToastState, ComToastTemplateContext } from './toast.models';\n\n/**\n * Internal toast notification component rendered inside the container.\n *\n * @internal Not exported in public API\n *\n * @tokens `--color-success`, `--color-success-foreground`,\n * `--color-warn`, `--color-warn-foreground`,\n * `--color-warn-subtle`, `--color-warn-subtle-foreground`,\n * `--color-primary-subtle`, `--color-primary-subtle-foreground`,\n * `--color-border`, `--shadow-overlay`, `--radius-card`, `--color-ring`\n */\n@Component({\n selector: 'com-toast',\n template: `\n <div\n [class]=\"toastClasses()\"\n [attr.role]=\"ariaRole()\"\n [attr.aria-live]=\"ariaLive()\"\n [attr.data-state]=\"state().visible ? 'open' : 'closed'\"\n (animationend)=\"onAnimationEnd()\"\n >\n @if (state().data.customTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"state().data.customTemplate!\"\n [ngTemplateOutletContext]=\"templateContext()\"\n />\n } @else {\n <com-icon\n [name]=\"resolvedIcon()\"\n size=\"md\"\n class=\"mt-0.5 shrink-0\"\n aria-hidden=\"true\"\n />\n <div class=\"flex-1 min-w-0\">\n @if (state().data.title) {\n <p data-part=\"title\" class=\"text-sm font-semibold\">{{ state().data.title }}</p>\n }\n <p data-part=\"message\" class=\"text-sm\" [class.mt-1]=\"state().data.title\">\n {{ state().data.message }}\n </p>\n @if (state().data.action) {\n <button\n type=\"button\"\n class=\"mt-2 text-sm font-medium underline underline-offset-4\n outline-none\n focus-visible:outline-2\n focus-visible:outline-offset-2\n focus-visible:outline-[--color-ring]\"\n (click)=\"onAction.emit(state().id)\"\n >\n {{ state().data.action!.label }}\n </button>\n }\n </div>\n @if (state().showClose) {\n <button\n type=\"button\"\n [class]=\"closeButtonClasses()\"\n aria-label=\"Dismiss notification\"\n (click)=\"onDismiss.emit(state().id)\"\n >\n <com-icon name=\"x\" size=\"sm\" aria-hidden=\"true\" />\n </button>\n }\n }\n @if (state().showProgress && state().duration > 0) {\n <div\n [class]=\"progressClasses()\"\n [style.width.%]=\"state().remainingPercent\"\n ></div>\n }\n </div>\n `,\n styles: `\n :host {\n display: contents;\n }\n\n [data-state='open'] {\n --tw-enter-opacity: 0;\n --tw-enter-translate-x: 0;\n --tw-enter-translate-y: 0;\n }\n\n [data-state='closed'] {\n --tw-exit-opacity: 0;\n --tw-exit-translate-x: 0;\n --tw-exit-translate-y: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n [data-state='open'],\n [data-state='closed'] {\n animation: none;\n }\n }\n `,\n imports: [NgTemplateOutlet, ComIcon],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ComToastComponent {\n /** The toast state, set by the container. */\n readonly state: InputSignal<ComToastState> = input.required<ComToastState>();\n\n /** Emitted when the toast should be dismissed. */\n // eslint-disable-next-line @angular-eslint/no-output-on-prefix -- intentional API naming for toast event delegation\n readonly onDismiss: OutputEmitterRef<number> = output<number>();\n\n /** Emitted when the action button is clicked. */\n // eslint-disable-next-line @angular-eslint/no-output-on-prefix -- intentional API naming for toast event delegation\n readonly onAction: OutputEmitterRef<number> = output<number>();\n\n /** Emitted when the mouse enters the toast. */\n readonly mouseEnter: OutputEmitterRef<void> = output<void>();\n\n /** Emitted when the mouse leaves the toast. */\n readonly mouseLeave: OutputEmitterRef<void> = output<void>();\n\n /** Emitted when the exit animation completes. */\n readonly animationDone: OutputEmitterRef<number> = output<number>();\n\n /** Resolved icon name. */\n protected readonly resolvedIcon: Signal<string> = computed(\n () => this.state().data.icon ?? DEFAULT_TOAST_ICONS[this.state().type] ?? 'info',\n );\n\n /** ARIA role based on toast type. */\n protected readonly ariaRole: Signal<string> = computed(() =>\n this.state().type === 'error' ? 'alert' : 'status',\n );\n\n /** ARIA live region politeness. */\n protected readonly ariaLive: Signal<string> = computed(() =>\n this.state().type === 'error' ? 'assertive' : 'polite',\n );\n\n /** Computed toast card classes. */\n protected readonly toastClasses: Signal<string> = computed(() =>\n mergeClasses(\n toastVariants({ type: this.state().type }),\n this.state().visible\n ? 'animate-in fade-in-0 slide-in-from-bottom-2'\n : 'animate-out fade-out-0 slide-out-to-right-full',\n ),\n );\n\n /** Computed progress bar classes. */\n protected readonly progressClasses: Signal<string> = computed(() =>\n mergeClasses(toastProgressVariants({ type: this.state().type })),\n );\n\n /** Computed close button classes. */\n protected readonly closeButtonClasses: Signal<string> = computed(() =>\n mergeClasses(toastCloseButtonVariants({ type: this.state().type })),\n );\n\n /** Template context for custom templates. */\n protected readonly templateContext: Signal<ComToastTemplateContext> = computed(() => ({\n $implicit: this.state().data,\n dismiss: () => this.onDismiss.emit(this.state().id),\n action: () => this.onAction.emit(this.state().id),\n }));\n\n protected onAnimationEnd(): void {\n if (!this.state().visible) {\n this.animationDone.emit(this.state().id);\n }\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport type { Provider } from '@angular/core';\nimport type { ComToastConfig, ComToastContainerData } from './toast.models';\n\n/**\n * Injection token for global toast configuration.\n */\nexport const COM_TOAST_CONFIG: InjectionToken<ComToastConfig> =\n new InjectionToken<ComToastConfig>('COM_TOAST_CONFIG');\n\n/**\n * Injection token for internal container communication.\n * @internal\n */\nexport const COM_TOAST_CONTAINER_DATA: InjectionToken<ComToastContainerData> =\n new InjectionToken<ComToastContainerData>('COM_TOAST_CONTAINER_DATA');\n\n/**\n * Provides global toast configuration.\n *\n * @example\n * ```typescript\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideComToastConfig({ position: 'top-center', duration: 3000 }),\n * ],\n * });\n * ```\n */\nexport function provideComToastConfig(config: ComToastConfig): Provider {\n return { provide: COM_TOAST_CONFIG, useValue: config };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n} from '@angular/core';\nimport type { Signal } from '@angular/core';\nimport { ComToastComponent } from './toast.component';\nimport { toastContainerVariants } from './toast.variants';\nimport { mergeClasses } from './toast.utils';\nimport { COM_TOAST_CONTAINER_DATA } from './toast.providers';\nimport type { ComToastContainerData, ComToastState } from './toast.models';\n\n/**\n * Internal toast container component that manages positioning and stacking.\n *\n * @internal Not exported in public API\n *\n * @tokens `--color-success`, `--color-success-foreground`,\n * `--color-warn`, `--color-warn-foreground`,\n * `--color-warn-subtle`, `--color-warn-subtle-foreground`,\n * `--color-primary-subtle`, `--color-primary-subtle-foreground`,\n * `--color-border`, `--shadow-overlay`, `--radius-card`\n */\n@Component({\n selector: 'com-toast-container',\n host: {\n '(keydown.escape)': 'onEscapeKey()',\n tabindex: '-1',\n },\n template: `\n <div\n [class]=\"containerClasses()\"\n role=\"region\"\n aria-label=\"Notifications\"\n >\n @for (toast of toasts(); track toast.id) {\n <com-toast\n [state]=\"toast\"\n (onDismiss)=\"containerData.onDismiss($event)\"\n (onAction)=\"containerData.onAction($event)\"\n (mouseEnter)=\"containerData.onMouseEnter(toast.id)\"\n (mouseLeave)=\"containerData.onMouseLeave(toast.id)\"\n (animationDone)=\"containerData.onAnimationDone($event)\"\n />\n }\n </div>\n `,\n styles: `\n :host {\n display: contents;\n }\n `,\n imports: [ComToastComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ComToastContainerComponent {\n protected readonly containerData: ComToastContainerData = inject(COM_TOAST_CONTAINER_DATA);\n\n /** Active toast states, read from the service's signal. */\n protected readonly toasts: Signal<ComToastState[]> = computed(() => this.containerData.toasts());\n\n /** Computed container positioning classes. */\n protected readonly containerClasses: Signal<string> = computed(() =>\n mergeClasses(toastContainerVariants({ position: this.containerData.position() })),\n );\n\n protected onEscapeKey(): void {\n this.containerData.onDismissLatest();\n }\n}\n","import {\n DestroyRef,\n inject,\n Injectable,\n Injector,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport type { WritableSignal } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { Overlay } from '@angular/cdk/overlay';\nimport type { GlobalPositionStrategy, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { ComToastRef } from './toast.ref';\nimport { ComToastContainerComponent } from './toast-container.component';\nimport { COM_TOAST_CONFIG, COM_TOAST_CONTAINER_DATA } from './toast.providers';\nimport { generateToastId } from './toast.utils';\nimport type {\n ComToastConfig,\n ComToastContainerData,\n ComToastData,\n ComToastDismissReason,\n ComToastPosition,\n ComToastState,\n ComToastTimerState,\n ComToastType,\n} from './toast.models';\n\n/** Default durations by toast type. */\nconst DEFAULT_DURATION: Record<ComToastType, number> = {\n success: 5000,\n warn: 5000,\n error: 0,\n info: 5000,\n};\n\n/** Fallback timeout for exit animation removal when animationend doesn't fire. */\nconst ANIMATION_FALLBACK_MS = 200;\n\n/**\n * Service for creating toast notifications imperatively.\n *\n * @example\n * ```typescript\n * const toast = inject(ComToastService);\n * toast.success('File uploaded successfully.');\n * toast.error('Failed to save.', 'Error');\n *\n * const ref = toast.show({ type: 'info', message: 'Item deleted.', action: { label: 'Undo' } });\n * ref.afterAction().subscribe(() => undoDelete());\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ComToastService {\n private readonly overlay = inject(Overlay);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly document = inject(DOCUMENT);\n private readonly globalConfig = inject(COM_TOAST_CONFIG, { optional: true });\n\n private overlayRef: OverlayRef | null = null;\n private readonly toasts: WritableSignal<ComToastState[]> = signal([]);\n private readonly position: WritableSignal<ComToastPosition>;\n private readonly timers = new Map<number, ComToastTimerState>();\n private readonly refs = new Map<number, ComToastRef>();\n private readonly animationFallbacks = new Map<number, ReturnType<typeof setTimeout>>();\n private readonly dismissReasons = new Map<number, ComToastDismissReason>();\n private rafHandle: number | null = null;\n\n private readonly config: Required<ComToastConfig>;\n\n constructor() {\n this.config = {\n position: 'bottom-right',\n duration: 5000,\n maxVisible: 5,\n pauseOnHover: true,\n showProgress: true,\n showClose: true,\n ...this.globalConfig,\n };\n this.position = signal(this.config.position);\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /**\n * Show a toast notification with full configuration.\n */\n show(data: ComToastData): ComToastRef {\n this.ensureContainer();\n\n const id = generateToastId();\n const type: ComToastType = data.type ?? 'info';\n const duration = data.duration ?? DEFAULT_DURATION[type] ?? this.config.duration;\n const showProgress = data.showProgress ?? this.config.showProgress;\n const showClose = data.showClose ?? this.config.showClose;\n\n const ref = new ComToastRef(() => this.dismiss(id, 'manual'));\n this.refs.set(id, ref);\n\n const state: ComToastState = {\n id,\n data,\n type,\n duration,\n showProgress,\n showClose,\n visible: true,\n remainingPercent: 100,\n };\n\n this.toasts.update((list) => [...list, state]);\n this.enforceMaxVisible();\n\n if (duration > 0) {\n this.startTimer(id, duration);\n }\n\n return ref;\n }\n\n /** Show a success toast. */\n success(message: string, title?: string): ComToastRef {\n return this.showByType('success', message, title);\n }\n\n /** Show a warning toast. */\n warn(message: string, title?: string): ComToastRef {\n return this.showByType('warn', message, title);\n }\n\n /** Show an error toast. */\n error(message: string, title?: string): ComToastRef {\n return this.showByType('error', message, title);\n }\n\n /** Show an info toast. */\n info(message: string, title?: string): ComToastRef {\n return this.showByType('info', message, title);\n }\n\n /** Dismiss all active toasts. */\n dismissAll(): void {\n for (const toast of this.toasts()) {\n this.dismiss(toast.id, 'manual');\n }\n }\n\n // ─── Private ───\n\n private showByType(type: ComToastType, message: string, title?: string): ComToastRef {\n const data: ComToastData = { type, message };\n if (title !== undefined) data.title = title;\n return this.show(data);\n }\n\n private ensureContainer(): void {\n if (this.overlayRef || !isPlatformBrowser(this.platformId)) return;\n\n const positionStrategy = this.buildPositionStrategy(this.config.position);\n\n const containerData: ComToastContainerData = {\n toasts: this.toasts.asReadonly(),\n position: this.position.asReadonly(),\n onMouseEnter: (id: number) => this.pauseTimer(id),\n onMouseLeave: (id: number) => this.resumeTimer(id),\n onDismiss: (id: number) => this.dismiss(id, 'manual'),\n onAction: (id: number) => this.handleAction(id),\n onDismissLatest: () => this.dismissLatest(),\n onAnimationDone: (id: number) => this.removeToast(id),\n };\n\n const containerInjector = Injector.create({\n providers: [{ provide: COM_TOAST_CONTAINER_DATA, useValue: containerData }],\n parent: this.injector,\n });\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n hasBackdrop: false,\n panelClass: 'com-toast-overlay',\n disposeOnNavigation: false,\n });\n\n const portal = new ComponentPortal(ComToastContainerComponent, null, containerInjector);\n this.overlayRef.attach(portal);\n }\n\n private buildPositionStrategy(position: ComToastPosition): GlobalPositionStrategy {\n const strategy = this.overlay.position().global();\n\n switch (position) {\n case 'top-right':\n return strategy.top('0').right('0');\n case 'top-left':\n return strategy.top('0').left('0');\n case 'top-center':\n return strategy.top('0').centerHorizontally();\n case 'bottom-right':\n return strategy.bottom('0').right('0');\n case 'bottom-left':\n return strategy.bottom('0').left('0');\n case 'bottom-center':\n return strategy.bottom('0').centerHorizontally();\n }\n }\n\n private dismiss(id: number, reason: ComToastDismissReason): void {\n this.clearTimer(id);\n this.dismissReasons.set(id, reason);\n\n // Trigger exit animation\n this.updateToast(id, { visible: false });\n\n // Set fallback timeout in case animationend doesn't fire\n const fallback = setTimeout(() => this.removeToast(id), ANIMATION_FALLBACK_MS);\n this.animationFallbacks.set(id, fallback);\n }\n\n private removeToast(id: number): void {\n // Clear animation fallback\n const fallback = this.animationFallbacks.get(id);\n if (fallback) {\n clearTimeout(fallback);\n this.animationFallbacks.delete(id);\n }\n\n // Check if toast still exists (may have been removed already)\n if (!this.toasts().some((t) => t.id === id)) return;\n\n this.toasts.update((list) => list.filter((t) => t.id !== id));\n\n const reason = this.dismissReasons.get(id) ?? 'auto';\n this.dismissReasons.delete(id);\n\n const ref = this.refs.get(id);\n if (ref) {\n ref._notifyDismissed({ reason });\n this.refs.delete(id);\n }\n\n if (this.toasts().length === 0) {\n this.disposeOverlay();\n }\n }\n\n private handleAction(id: number): void {\n const ref = this.refs.get(id);\n if (ref) {\n ref._notifyAction();\n }\n this.dismiss(id, 'action');\n }\n\n private dismissLatest(): void {\n const visible = this.toasts().filter((t) => t.visible);\n const latest = visible[visible.length - 1];\n if (latest) {\n this.dismiss(latest.id, 'manual');\n }\n }\n\n private enforceMaxVisible(): void {\n const currentToasts = this.toasts();\n const visibleCount = currentToasts.filter((t) => t.visible).length;\n\n if (visibleCount > this.config.maxVisible) {\n const oldest = currentToasts.find((t) => t.visible);\n if (oldest) {\n this.dismiss(oldest.id, 'limit');\n }\n }\n }\n\n // ─── Timer (rAF) ───\n\n private startTimer(id: number, duration: number): void {\n const now = this.now();\n this.timers.set(id, {\n startTime: now,\n elapsed: 0,\n duration,\n paused: false,\n pausedAt: 0,\n });\n\n this.ensureRafLoop();\n }\n\n private ensureRafLoop(): void {\n if (this.rafHandle !== null) return;\n\n const win = this.document.defaultView;\n if (!win) return;\n\n const tick = (): void => {\n const now = this.now();\n let needsUpdate = false;\n\n for (const [id, timer] of this.timers) {\n if (timer.paused) continue;\n\n const elapsed = timer.elapsed + (now - timer.startTime);\n const remaining = Math.max(0, 100 - (elapsed / timer.duration) * 100);\n const rounded = Math.round(remaining);\n\n // Find current state to compare\n const toast = this.toasts().find((t) => t.id === id);\n if (!toast || !toast.visible) {\n this.clearTimer(id);\n continue;\n }\n\n if (Math.round(toast.remainingPercent) !== rounded) {\n needsUpdate = true;\n }\n\n if (remaining <= 0) {\n this.clearTimer(id);\n this.dismiss(id, 'auto');\n needsUpdate = true;\n }\n }\n\n // Batch-update all progress values in a single signal write\n if (needsUpdate) {\n const now2 = this.now();\n this.toasts.update((list) =>\n list.map((t) => {\n const timer = this.timers.get(t.id);\n if (!timer || timer.paused) return t;\n\n const elapsed = timer.elapsed + (now2 - timer.startTime);\n const remaining = Math.max(0, 100 - (elapsed / timer.duration) * 100);\n return { ...t, remainingPercent: remaining };\n }),\n );\n }\n\n // Continue loop if there are active timers\n if (this.timers.size > 0) {\n this.rafHandle = win.requestAnimationFrame(tick);\n } else {\n this.rafHandle = null;\n }\n };\n\n this.rafHandle = win.requestAnimationFrame(tick);\n }\n\n private pauseTimer(id: number): void {\n if (!this.config.pauseOnHover) return;\n\n const timer = this.timers.get(id);\n if (!timer || timer.paused) return;\n\n const now = this.now();\n timer.elapsed += now - timer.startTime;\n timer.paused = true;\n timer.pausedAt = now;\n }\n\n private resumeTimer(id: number): void {\n if (!this.config.pauseOnHover) return;\n\n const timer = this.timers.get(id);\n if (!timer || !timer.paused) return;\n\n timer.paused = false;\n timer.startTime = this.now();\n }\n\n private clearTimer(id: number): void {\n this.timers.delete(id);\n }\n\n private now(): number {\n return this.document.defaultView?.performance.now() ?? Date.now();\n }\n\n // ─── Helpers ───\n\n private updateToast(id: number, patch: Partial<ComToastState>): void {\n this.toasts.update((list) =>\n list.map((t) => (t.id === id ? { ...t, ...patch } : t)),\n );\n }\n\n private disposeOverlay(): void {\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n\n const win = this.document.defaultView;\n if (this.rafHandle !== null && win) {\n win.cancelAnimationFrame(this.rafHandle);\n this.rafHandle = null;\n }\n }\n\n private dispose(): void {\n for (const id of this.timers.keys()) {\n this.clearTimer(id);\n }\n for (const [, fallback] of this.animationFallbacks) {\n clearTimeout(fallback);\n }\n this.animationFallbacks.clear();\n this.dismissReasons.clear();\n this.refs.clear();\n this.disposeOverlay();\n }\n}\n","// Public API for the toast notification system\n\n// Service\nexport { ComToastService } from './toast.service';\n\n// Ref\nexport { ComToastRef } from './toast.ref';\n\n// Types and interfaces\nexport type {\n ComToastConfig,\n ComToastData,\n ComToastType,\n ComToastPosition,\n ComToastDismissEvent,\n ComToastDismissReason,\n ComToastTemplateContext,\n} from './toast.models';\n\n// Providers\nexport { provideComToastConfig, COM_TOAST_CONFIG } from './toast.providers';\n\n// Variants (for advanced customization)\nexport {\n toastVariants,\n toastContainerVariants,\n toastProgressVariants,\n toastCloseButtonVariants,\n} from './toast.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAGA;;;AAGG;MACU,WAAW,CAAA;AACL,IAAA,cAAc,GAAG,IAAI,OAAO,EAAwB;AACpD,IAAA,aAAa,GAAG,IAAI,OAAO,EAAQ;AACnC,IAAA,SAAS;IAClB,SAAS,GAAG,KAAK;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IAAI,CAAC,cAAc,CAAC,KAAK,EAAE;AAC3B,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;QACjB,IAAI,CAAC,cAAc,EAAE;IACvB;uGAzWW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAf,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cADF,MAAM,EAAA,CAAA;;2FACnB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpDlC;AAEA;;ACFA;;AAEG;;;;"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Harness for interacting with a `[comTooltip]` directive in tests.
|
|
5
|
+
*
|
|
6
|
+
* The tooltip panel is rendered in a CDK overlay, so this harness uses
|
|
7
|
+
* `documentRootLocatorFactory()` to locate the panel in the document root.
|
|
8
|
+
*/
|
|
9
|
+
class ComTooltipHarness extends ComponentHarness {
|
|
10
|
+
static hostSelector = '[comTooltip]';
|
|
11
|
+
documentRootLocator = this.documentRootLocatorFactory();
|
|
12
|
+
/**
|
|
13
|
+
* Gets a HarnessPredicate for matching tooltip triggers.
|
|
14
|
+
* @param options Filter options.
|
|
15
|
+
*/
|
|
16
|
+
static with(options = {}) {
|
|
17
|
+
return new HarnessPredicate(ComTooltipHarness, options)
|
|
18
|
+
.addOption('text', options.text, async (harness, text) => {
|
|
19
|
+
const triggerText = await harness.getText();
|
|
20
|
+
return HarnessPredicate.stringMatches(triggerText, text);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/** Gets the trigger element's text content. */
|
|
24
|
+
async getText() {
|
|
25
|
+
const host = await this.host();
|
|
26
|
+
return host.text();
|
|
27
|
+
}
|
|
28
|
+
/** Whether the tooltip is currently open/visible. */
|
|
29
|
+
async isOpen() {
|
|
30
|
+
const host = await this.host();
|
|
31
|
+
const describedBy = await host.getAttribute('aria-describedby');
|
|
32
|
+
return describedBy !== null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Shows the tooltip by hovering over the trigger element.
|
|
36
|
+
* If the tooltip is already open, this is a no-op.
|
|
37
|
+
*/
|
|
38
|
+
async show() {
|
|
39
|
+
if (await this.isOpen()) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const host = await this.host();
|
|
43
|
+
await host.hover();
|
|
44
|
+
await this.forceStabilize();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Hides the tooltip by pressing Escape on the trigger element.
|
|
48
|
+
* If the tooltip is already closed, this is a no-op.
|
|
49
|
+
*/
|
|
50
|
+
async hide() {
|
|
51
|
+
if (!(await this.isOpen())) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const host = await this.host();
|
|
55
|
+
await host.sendKeys(TestKey.ESCAPE);
|
|
56
|
+
await this.forceStabilize();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Gets the text content of the tooltip panel.
|
|
60
|
+
* Returns `null` if the tooltip is not open.
|
|
61
|
+
*/
|
|
62
|
+
async getTooltipText() {
|
|
63
|
+
if (!(await this.isOpen())) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
const tooltipEl = await this.documentRootLocator.locatorForOptional('com-tooltip-panel [role="tooltip"]')();
|
|
67
|
+
if (!tooltipEl) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return tooltipEl.text();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Gets the side the tooltip is positioned on (`data-side` attribute).
|
|
74
|
+
* Returns `null` if the tooltip is not open.
|
|
75
|
+
*/
|
|
76
|
+
async getTooltipSide() {
|
|
77
|
+
if (!(await this.isOpen())) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const panelWrapper = await this.documentRootLocator.locatorForOptional('com-tooltip-panel [data-side]')();
|
|
81
|
+
if (!panelWrapper) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return panelWrapper.getAttribute('data-side');
|
|
85
|
+
}
|
|
86
|
+
/** Gets the `aria-describedby` value from the trigger element. */
|
|
87
|
+
async getAriaDescribedBy() {
|
|
88
|
+
const host = await this.host();
|
|
89
|
+
return host.getAttribute('aria-describedby');
|
|
90
|
+
}
|
|
91
|
+
/** Focuses the trigger element (also shows the tooltip via focusin). */
|
|
92
|
+
async focus() {
|
|
93
|
+
const host = await this.host();
|
|
94
|
+
await host.focus();
|
|
95
|
+
await this.forceStabilize();
|
|
96
|
+
}
|
|
97
|
+
/** Blurs the trigger element (hides the tooltip via focusout). */
|
|
98
|
+
async blur() {
|
|
99
|
+
const host = await this.host();
|
|
100
|
+
await host.blur();
|
|
101
|
+
await this.forceStabilize();
|
|
102
|
+
}
|
|
103
|
+
/** Whether the trigger element is currently focused. */
|
|
104
|
+
async isFocused() {
|
|
105
|
+
const host = await this.host();
|
|
106
|
+
return host.isFocused();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Testing utilities for the tooltip directive
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Generated bundle index. Do not edit.
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
export { ComTooltipHarness };
|
|
117
|
+
//# sourceMappingURL=ngx-com-components-tooltip-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-com-components-tooltip-testing.mjs","sources":["../../../projects/com/components/tooltip/testing/tooltip.harness.ts","../../../projects/com/components/tooltip/testing/index.ts","../../../projects/com/components/tooltip/testing/ngx-com-components-tooltip-testing.ts"],"sourcesContent":["import {\n ComponentHarness,\n HarnessPredicate,\n TestKey,\n} from '@angular/cdk/testing';\nimport type { BaseHarnessFilters } from '@angular/cdk/testing';\n\n/** Harness filters for ComTooltipHarness. */\nexport interface ComTooltipHarnessFilters extends BaseHarnessFilters {\n /** Filter by the trigger element's text content. */\n text?: string | RegExp;\n}\n\n/**\n * Harness for interacting with a `[comTooltip]` directive in tests.\n *\n * The tooltip panel is rendered in a CDK overlay, so this harness uses\n * `documentRootLocatorFactory()` to locate the panel in the document root.\n */\nexport class ComTooltipHarness extends ComponentHarness {\n static hostSelector = '[comTooltip]';\n\n private readonly documentRootLocator = this.documentRootLocatorFactory();\n\n /**\n * Gets a HarnessPredicate for matching tooltip triggers.\n * @param options Filter options.\n */\n static with(options: ComTooltipHarnessFilters = {}): HarnessPredicate<ComTooltipHarness> {\n return new HarnessPredicate(ComTooltipHarness, options)\n .addOption('text', options.text, async (harness, text) => {\n const triggerText = await harness.getText();\n return HarnessPredicate.stringMatches(triggerText, text);\n });\n }\n\n /** Gets the trigger element's text content. */\n async getText(): Promise<string> {\n const host = await this.host();\n return host.text();\n }\n\n /** Whether the tooltip is currently open/visible. */\n async isOpen(): Promise<boolean> {\n const host = await this.host();\n const describedBy = await host.getAttribute('aria-describedby');\n return describedBy !== null;\n }\n\n /**\n * Shows the tooltip by hovering over the trigger element.\n * If the tooltip is already open, this is a no-op.\n */\n async show(): Promise<void> {\n if (await this.isOpen()) {\n return;\n }\n const host = await this.host();\n await host.hover();\n await this.forceStabilize();\n }\n\n /**\n * Hides the tooltip by pressing Escape on the trigger element.\n * If the tooltip is already closed, this is a no-op.\n */\n async hide(): Promise<void> {\n if (!(await this.isOpen())) {\n return;\n }\n const host = await this.host();\n await host.sendKeys(TestKey.ESCAPE);\n await this.forceStabilize();\n }\n\n /**\n * Gets the text content of the tooltip panel.\n * Returns `null` if the tooltip is not open.\n */\n async getTooltipText(): Promise<string | null> {\n if (!(await this.isOpen())) {\n return null;\n }\n const tooltipEl = await this.documentRootLocator.locatorForOptional(\n 'com-tooltip-panel [role=\"tooltip\"]',\n )();\n if (!tooltipEl) {\n return null;\n }\n return tooltipEl.text();\n }\n\n /**\n * Gets the side the tooltip is positioned on (`data-side` attribute).\n * Returns `null` if the tooltip is not open.\n */\n async getTooltipSide(): Promise<string | null> {\n if (!(await this.isOpen())) {\n return null;\n }\n const panelWrapper = await this.documentRootLocator.locatorForOptional(\n 'com-tooltip-panel [data-side]',\n )();\n if (!panelWrapper) {\n return null;\n }\n return panelWrapper.getAttribute('data-side');\n }\n\n /** Gets the `aria-describedby` value from the trigger element. */\n async getAriaDescribedBy(): Promise<string | null> {\n const host = await this.host();\n return host.getAttribute('aria-describedby');\n }\n\n /** Focuses the trigger element (also shows the tooltip via focusin). */\n async focus(): Promise<void> {\n const host = await this.host();\n await host.focus();\n await this.forceStabilize();\n }\n\n /** Blurs the trigger element (hides the tooltip via focusout). */\n async blur(): Promise<void> {\n const host = await this.host();\n await host.blur();\n await this.forceStabilize();\n }\n\n /** Whether the trigger element is currently focused. */\n async isFocused(): Promise<boolean> {\n const host = await this.host();\n return host.isFocused();\n }\n}\n","// Testing utilities for the tooltip directive\n\nexport { ComTooltipHarness } from './tooltip.harness';\n\nexport type { ComTooltipHarnessFilters } from './tooltip.harness';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAaA;;;;;AAKG;AACG,MAAO,iBAAkB,SAAQ,gBAAgB,CAAA;AACrD,IAAA,OAAO,YAAY,GAAG,cAAc;AAEnB,IAAA,mBAAmB,GAAG,IAAI,CAAC,0BAA0B,EAAE;AAExE;;;AAGG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAoC,EAAE,EAAA;AAChD,QAAA,OAAO,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,OAAO;AACnD,aAAA,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,OAAO,EAAE,IAAI,KAAI;AACvD,YA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