@molecule/app-cookie-banner-angular 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +406 -2
- package/dist/cookie-banner.component.d.ts +244 -0
- package/dist/cookie-banner.component.d.ts.map +1 -0
- package/dist/cookie-banner.component.js +633 -0
- package/dist/cookie-banner.component.js.map +1 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +69 -0
- package/dist/index.js.map +1 -0
- package/dist/slot-dom.d.ts +31 -0
- package/dist/slot-dom.d.ts.map +1 -0
- package/dist/slot-dom.js +64 -0
- package/dist/slot-dom.js.map +1 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +69 -4
|
@@ -0,0 +1,633 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CookieBanner component (React parity).
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
7
|
+
import { Component, ElementRef, inject, ViewChild, } from '@angular/core';
|
|
8
|
+
import { useTranslation } from '@molecule/app-angular';
|
|
9
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
10
|
+
import { Button, styleText, Switch } from '@molecule/app-ui-angular';
|
|
11
|
+
import { applyNodeLayout, hasNodes } from './slot-dom.js';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
const _c0 = ["titleFallback"];
|
|
14
|
+
const _c1 = ["titleSlot"];
|
|
15
|
+
const _c2 = ["descriptionFallback"];
|
|
16
|
+
const _c3 = ["descriptionSlot"];
|
|
17
|
+
const _c4 = [[["", "slot", "title"]], [["", "slot", "description"]]];
|
|
18
|
+
const _c5 = ["[slot=title]", "[slot=description]"];
|
|
19
|
+
const _c6 = () => [];
|
|
20
|
+
const _forTrack0 = ($index, $item) => $item.id;
|
|
21
|
+
function CookieBanner_Conditional_15_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
+
i0.ɵɵelementContainerStart(0);
|
|
23
|
+
i0.ɵɵtext(1);
|
|
24
|
+
i0.ɵɵelementContainerEnd();
|
|
25
|
+
i0.ɵɵelementStart(2, "a");
|
|
26
|
+
i0.ɵɵtext(3);
|
|
27
|
+
i0.ɵɵelementEnd();
|
|
28
|
+
i0.ɵɵtext(4, ".");
|
|
29
|
+
} if (rf & 2) {
|
|
30
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
31
|
+
i0.ɵɵadvance();
|
|
32
|
+
i0.ɵɵtextInterpolate(ctx_r0.leadingSpace);
|
|
33
|
+
i0.ɵɵadvance();
|
|
34
|
+
i0.ɵɵclassMap(ctx_r0.cm().link);
|
|
35
|
+
i0.ɵɵattribute("href", ctx_r0.policyHref, i0.ɵɵsanitizeUrl);
|
|
36
|
+
i0.ɵɵadvance();
|
|
37
|
+
i0.ɵɵtextInterpolate(ctx_r0.learnMoreText());
|
|
38
|
+
} }
|
|
39
|
+
function CookieBanner_Conditional_16_For_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
+
i0.ɵɵelementContainer(0, 9);
|
|
41
|
+
} if (rf & 2) {
|
|
42
|
+
const category_r3 = i0.ɵɵnextContext().$implicit;
|
|
43
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
44
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.asTemplate(category_r3.label));
|
|
45
|
+
} }
|
|
46
|
+
function CookieBanner_Conditional_16_For_2_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
+
i0.ɵɵtext(0);
|
|
48
|
+
} if (rf & 2) {
|
|
49
|
+
const category_r3 = i0.ɵɵnextContext().$implicit;
|
|
50
|
+
i0.ɵɵtextInterpolate(category_r3.label);
|
|
51
|
+
} }
|
|
52
|
+
function CookieBanner_Conditional_16_For_2_Conditional_5_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
53
|
+
i0.ɵɵelementContainer(0, 9);
|
|
54
|
+
} if (rf & 2) {
|
|
55
|
+
const category_r3 = i0.ɵɵnextContext(2).$implicit;
|
|
56
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
57
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.asTemplate(category_r3.description));
|
|
58
|
+
} }
|
|
59
|
+
function CookieBanner_Conditional_16_For_2_Conditional_5_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
60
|
+
i0.ɵɵtext(0);
|
|
61
|
+
} if (rf & 2) {
|
|
62
|
+
const category_r3 = i0.ɵɵnextContext(2).$implicit;
|
|
63
|
+
i0.ɵɵtextInterpolate(category_r3.description);
|
|
64
|
+
} }
|
|
65
|
+
function CookieBanner_Conditional_16_For_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
66
|
+
i0.ɵɵelementStart(0, "span");
|
|
67
|
+
i0.ɵɵconditionalCreate(1, CookieBanner_Conditional_16_For_2_Conditional_5_Conditional_1_Template, 1, 1, "ng-container", 9)(2, CookieBanner_Conditional_16_For_2_Conditional_5_Conditional_2_Template, 1, 1);
|
|
68
|
+
i0.ɵɵelementEnd();
|
|
69
|
+
} if (rf & 2) {
|
|
70
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
|
71
|
+
const category_r3 = ctx_r3.$implicit;
|
|
72
|
+
const ɵ$index_30_r5 = ctx_r3.$index;
|
|
73
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
74
|
+
i0.ɵɵclassMap(ctx_r0.cm().textSize("xs"));
|
|
75
|
+
i0.ɵɵattribute("id", ctx_r0.descriptionId(ɵ$index_30_r5));
|
|
76
|
+
i0.ɵɵadvance();
|
|
77
|
+
i0.ɵɵconditional(ctx_r0.isTemplate(category_r3.description) ? 1 : 2);
|
|
78
|
+
} }
|
|
79
|
+
function CookieBanner_Conditional_16_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
80
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
81
|
+
i0.ɵɵelementStart(0, "div")(1, "div")(2, "span");
|
|
82
|
+
i0.ɵɵconditionalCreate(3, CookieBanner_Conditional_16_For_2_Conditional_3_Template, 1, 1, "ng-container", 9)(4, CookieBanner_Conditional_16_For_2_Conditional_4_Template, 1, 1);
|
|
83
|
+
i0.ɵɵelementEnd();
|
|
84
|
+
i0.ɵɵconditionalCreate(5, CookieBanner_Conditional_16_For_2_Conditional_5_Template, 3, 4, "span", 4);
|
|
85
|
+
i0.ɵɵelementEnd();
|
|
86
|
+
i0.ɵɵelementStart(6, "mol-switch", 10);
|
|
87
|
+
i0.ɵɵlistener("change", function CookieBanner_Conditional_16_For_2_Template_mol_switch_change_6_listener($event) { const category_r3 = i0.ɵɵrestoreView(_r2).$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.toggle(category_r3, $event)); });
|
|
88
|
+
i0.ɵɵelementEnd()();
|
|
89
|
+
} if (rf & 2) {
|
|
90
|
+
const category_r3 = ctx.$implicit;
|
|
91
|
+
const ɵ$index_30_r5 = ctx.$index;
|
|
92
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
93
|
+
i0.ɵɵclassMap(ctx_r0.rowClasses());
|
|
94
|
+
i0.ɵɵadvance();
|
|
95
|
+
i0.ɵɵclassMap(ctx_r0.textColumnClasses());
|
|
96
|
+
i0.ɵɵadvance();
|
|
97
|
+
i0.ɵɵclassMap(ctx_r0.labelClasses());
|
|
98
|
+
i0.ɵɵattribute("id", ctx_r0.labelId(ɵ$index_30_r5));
|
|
99
|
+
i0.ɵɵadvance();
|
|
100
|
+
i0.ɵɵconditional(ctx_r0.isTemplate(category_r3.label) ? 3 : 4);
|
|
101
|
+
i0.ɵɵadvance(2);
|
|
102
|
+
i0.ɵɵconditional(category_r3.description ? 5 : -1);
|
|
103
|
+
i0.ɵɵadvance();
|
|
104
|
+
i0.ɵɵproperty("checked", ctx_r0.isChecked(category_r3))("disabled", category_r3.required === true);
|
|
105
|
+
i0.ɵɵattribute("aria-labelledby", ctx_r0.labelId(ɵ$index_30_r5))("aria-describedby", category_r3.description ? ctx_r0.descriptionId(ɵ$index_30_r5) : null);
|
|
106
|
+
} }
|
|
107
|
+
function CookieBanner_Conditional_16_Template(rf, ctx) { if (rf & 1) {
|
|
108
|
+
i0.ɵɵelementStart(0, "div");
|
|
109
|
+
i0.ɵɵrepeaterCreate(1, CookieBanner_Conditional_16_For_2_Template, 7, 13, "div", 4, _forTrack0);
|
|
110
|
+
i0.ɵɵelementEnd();
|
|
111
|
+
} if (rf & 2) {
|
|
112
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
113
|
+
i0.ɵɵclassMap(ctx_r0.cm().stack(2));
|
|
114
|
+
i0.ɵɵattribute("id", ctx_r0.detailsId);
|
|
115
|
+
i0.ɵɵadvance();
|
|
116
|
+
i0.ɵɵrepeater(ctx_r0.categories ?? i0.ɵɵpureFunction0(3, _c6));
|
|
117
|
+
} }
|
|
118
|
+
function CookieBanner_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
119
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
120
|
+
i0.ɵɵelementStart(0, "button", 11);
|
|
121
|
+
i0.ɵɵlistener("click", function CookieBanner_Conditional_18_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.toggleDetails()); });
|
|
122
|
+
i0.ɵɵtext(1);
|
|
123
|
+
i0.ɵɵelementEnd();
|
|
124
|
+
} if (rf & 2) {
|
|
125
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
126
|
+
i0.ɵɵproperty("variant", "ghost")("size", "sm");
|
|
127
|
+
i0.ɵɵattribute("aria-expanded", ctx_r0.showDetails)("aria-controls", ctx_r0.showDetails && ctx_r0.hasCategories() ? ctx_r0.detailsId : null);
|
|
128
|
+
i0.ɵɵadvance();
|
|
129
|
+
i0.ɵɵtextInterpolate(ctx_r0.detailsLabel());
|
|
130
|
+
} }
|
|
131
|
+
function CookieBanner_Conditional_21_Template(rf, ctx) { if (rf & 1) {
|
|
132
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
133
|
+
i0.ɵɵelementStart(0, "button", 6);
|
|
134
|
+
i0.ɵɵlistener("click", function CookieBanner_Conditional_21_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.save()); });
|
|
135
|
+
i0.ɵɵtext(1);
|
|
136
|
+
i0.ɵɵelementEnd();
|
|
137
|
+
} if (rf & 2) {
|
|
138
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
139
|
+
i0.ɵɵproperty("variant", "outline");
|
|
140
|
+
i0.ɵɵadvance();
|
|
141
|
+
i0.ɵɵtextInterpolate(ctx_r0.saveText());
|
|
142
|
+
} }
|
|
143
|
+
/** React's inline style for the banner, serialized the way React writes it. */
|
|
144
|
+
const BANNER_STYLE = {
|
|
145
|
+
position: 'fixed',
|
|
146
|
+
left: 16,
|
|
147
|
+
right: 16,
|
|
148
|
+
bottom: 16,
|
|
149
|
+
zIndex: 60,
|
|
150
|
+
background: 'var(--color-surface, #fff)',
|
|
151
|
+
border: '1px solid rgba(0,0,0,0.1)',
|
|
152
|
+
borderRadius: 12,
|
|
153
|
+
boxShadow: '0 12px 36px rgba(0,0,0,0.18)',
|
|
154
|
+
maxWidth: 720,
|
|
155
|
+
marginLeft: 'auto',
|
|
156
|
+
marginRight: 'auto',
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Whether a value is one of the cases' projected node templates (a
|
|
160
|
+
* `{ $nodes }` value inside a data prop becomes a `TemplateRef`).
|
|
161
|
+
*
|
|
162
|
+
* @param value - The field value.
|
|
163
|
+
* @returns True for a projected node template.
|
|
164
|
+
*/
|
|
165
|
+
const isTemplate = (value) => typeof value === 'object' && value !== null && 'createEmbeddedView' in value;
|
|
166
|
+
/**
|
|
167
|
+
* CookieBanner component.
|
|
168
|
+
*
|
|
169
|
+
* GDPR / cookie-consent banner: two modes, Accept / Reject only or per-category
|
|
170
|
+
* switches behind "Customize" when `categories` are supplied. The host IS the
|
|
171
|
+
* root `<div>` (`div[mol-cookie-banner]`), matching React's root exactly, so the
|
|
172
|
+
* banner's ClassMap classes, `role`, `aria-label` and inline style are the
|
|
173
|
+
* host's.
|
|
174
|
+
*
|
|
175
|
+
* React renders `null` while `visible` is false — Angular's host element always
|
|
176
|
+
* exists, so it is detached from the DOM in that state and restored when the
|
|
177
|
+
* banner is shown again. The node props are projected slots: `title` renders
|
|
178
|
+
* inside the `<h3>`, `description` inside the `<p>`; plain string inputs render
|
|
179
|
+
* as text instead, the same values React renders.
|
|
180
|
+
*/
|
|
181
|
+
export class CookieBanner {
|
|
182
|
+
/** Cookie categories to offer (omit for a simple accept/reject banner). */
|
|
183
|
+
categories;
|
|
184
|
+
/** Called when accept-all is clicked. */
|
|
185
|
+
onAcceptAll;
|
|
186
|
+
/** Called when reject-non-essential is clicked. */
|
|
187
|
+
onRejectAll;
|
|
188
|
+
/** Called when "Save preferences" is clicked. */
|
|
189
|
+
onSave;
|
|
190
|
+
/** Optional title (string/number renders as text; nodes are `[slot=title]` content). */
|
|
191
|
+
title;
|
|
192
|
+
/** Optional description (string/number as text; nodes are `[slot=description]` content). */
|
|
193
|
+
description;
|
|
194
|
+
/** Privacy policy link URL. */
|
|
195
|
+
policyHref;
|
|
196
|
+
/** Whether the banner is visible (controlled; true unless this is `false`). */
|
|
197
|
+
visible;
|
|
198
|
+
/** Called when dismissed via Save / Accept / Reject. */
|
|
199
|
+
onDismiss;
|
|
200
|
+
/** Extra classes. */
|
|
201
|
+
className;
|
|
202
|
+
/** The title's text capture point. */
|
|
203
|
+
titleFallback;
|
|
204
|
+
/** The title's projected-nodes capture point. */
|
|
205
|
+
titleSlot;
|
|
206
|
+
/** The description's text capture point. */
|
|
207
|
+
descriptionFallback;
|
|
208
|
+
/** The description's projected-nodes capture point. */
|
|
209
|
+
descriptionSlot;
|
|
210
|
+
/** Whether the user opened the granular details (React's `showDetails`). */
|
|
211
|
+
showDetails = false;
|
|
212
|
+
/** React's `{' '}` between the description and the policy link. */
|
|
213
|
+
leadingSpace = ' ';
|
|
214
|
+
/** Per-instance counter backing the generated ids (React numbers `useId()` ids). */
|
|
215
|
+
static nextId = 0;
|
|
216
|
+
/** The details list's id, which the Customize/Hide details button's `aria-controls` names while the list renders. */
|
|
217
|
+
detailsId = `mol-cookie-banner-details-${CookieBanner.nextId++}`;
|
|
218
|
+
/** Base of each category row's label/description ids, which name and describe that row's switch. */
|
|
219
|
+
nameBase = `mol-cookie-banner-name-${CookieBanner.nextId++}`;
|
|
220
|
+
/** The reactive i18n binding, read in the injection context. */
|
|
221
|
+
i18n = useTranslation();
|
|
222
|
+
/** The host element (the root `<div>`), for the null-render detach. */
|
|
223
|
+
el = inject(ElementRef);
|
|
224
|
+
/** React's `useState` map: captured once, at mount. */
|
|
225
|
+
enabled = new Map();
|
|
226
|
+
/** Whether `[slot=title]` content was projected (read once). */
|
|
227
|
+
hasTitleSlot = false;
|
|
228
|
+
/** Whether `[slot=description]` content was projected (read once). */
|
|
229
|
+
hasDescriptionSlot = false;
|
|
230
|
+
/** Whether the node-props layout was applied (React renders it once). */
|
|
231
|
+
nodeLayoutApplied = false;
|
|
232
|
+
/** Where the detached host lives, for the restore. */
|
|
233
|
+
detachedParent = null;
|
|
234
|
+
/** The node the detached host is restored before. */
|
|
235
|
+
detachedAnchor = null;
|
|
236
|
+
/**
|
|
237
|
+
* The current class map.
|
|
238
|
+
* @returns The UIClassMap.
|
|
239
|
+
*/
|
|
240
|
+
cm() {
|
|
241
|
+
return getClassMap();
|
|
242
|
+
}
|
|
243
|
+
/** Reads React's `useState` initial enabled map, once the inputs are bound. */
|
|
244
|
+
ngOnInit() {
|
|
245
|
+
for (const category of this.categories ?? [])
|
|
246
|
+
this.enabled.set(category.id, category.required === true || !!category.defaultEnabled);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Reads the projected slots' presence (view queries resolve only at view
|
|
250
|
+
* init), applies the node-prop layout and the visible-state host detach.
|
|
251
|
+
*/
|
|
252
|
+
ngAfterViewInit() {
|
|
253
|
+
this.hasTitleSlot = hasNodes(this.titleSlot?.nativeElement);
|
|
254
|
+
this.hasDescriptionSlot = hasNodes(this.descriptionSlot?.nativeElement);
|
|
255
|
+
this.applyNodeProps();
|
|
256
|
+
this.syncHostVisibility();
|
|
257
|
+
}
|
|
258
|
+
/** Re-reconciles after input writes (a props step) and state changes. */
|
|
259
|
+
ngDoCheck() {
|
|
260
|
+
this.syncHostVisibility();
|
|
261
|
+
}
|
|
262
|
+
/** Restores the host before Angular removes it (unmount). */
|
|
263
|
+
ngOnDestroy() {
|
|
264
|
+
const host = this.el.nativeElement;
|
|
265
|
+
// The host must be inside its parent for Angular's own removal to succeed.
|
|
266
|
+
if (!host.isConnected && this.detachedParent) {
|
|
267
|
+
this.detachedParent.insertBefore(host, this.detachedAnchor);
|
|
268
|
+
this.detachedParent = null;
|
|
269
|
+
this.detachedAnchor = null;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Computes the banner's class list (React's `cm.cn(cm.stack(3), cm.sp('p', 4), className)`).
|
|
274
|
+
* @returns The class string.
|
|
275
|
+
*/
|
|
276
|
+
classes() {
|
|
277
|
+
return this.cm().cn(this.cm().stack(3), this.cm().sp('p', 4), this.className);
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* The banner's inline style text (React's fixed-position surface).
|
|
281
|
+
* @returns The style attribute text.
|
|
282
|
+
*/
|
|
283
|
+
hostStyle() {
|
|
284
|
+
return styleText(BANNER_STYLE);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* The translated dialog label (React's `aria-label`).
|
|
288
|
+
* @returns The label text.
|
|
289
|
+
*/
|
|
290
|
+
ariaLabel() {
|
|
291
|
+
return this.i18n.t('cookieBanner.title', {}, { defaultValue: 'Cookie preferences' });
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* The title heading's class (`cm.cn(cm.textSize('base'), cm.fontWeight('semibold'))`).
|
|
295
|
+
* @returns The class string.
|
|
296
|
+
*/
|
|
297
|
+
titleClasses() {
|
|
298
|
+
return this.cm().cn(this.cm().textSize('base'), this.cm().fontWeight('semibold'));
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* A category row's class (`cm.flex({ align: 'center', justify: 'between', gap: 'sm' })`).
|
|
302
|
+
* @returns The class string.
|
|
303
|
+
*/
|
|
304
|
+
rowClasses() {
|
|
305
|
+
return this.cm().flex({ align: 'center', justify: 'between', gap: 'sm' });
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* A category's text column class (`cm.cn(cm.flex1, cm.stack(0))`).
|
|
309
|
+
* @returns The class string.
|
|
310
|
+
*/
|
|
311
|
+
textColumnClasses() {
|
|
312
|
+
return this.cm().cn(this.cm().flex1, this.cm().stack(0));
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* A category label's class (`cm.cn(cm.textSize('sm'), cm.fontWeight('semibold'))`).
|
|
316
|
+
* @returns The class string.
|
|
317
|
+
*/
|
|
318
|
+
labelClasses() {
|
|
319
|
+
return this.cm().cn(this.cm().textSize('sm'), this.cm().fontWeight('semibold'));
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* A category row's label id, which its switch is named by
|
|
323
|
+
* (React's `${nameId()}-${index}`).
|
|
324
|
+
* @param index - The category's index in the list.
|
|
325
|
+
* @returns The id.
|
|
326
|
+
*/
|
|
327
|
+
labelId(index) {
|
|
328
|
+
return `${this.nameBase}-${index}`;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* A category row's description id, which its switch is described by
|
|
332
|
+
* (React's `${nameId()}-${index}-description`).
|
|
333
|
+
* @param index - The category's index in the list.
|
|
334
|
+
* @returns The id.
|
|
335
|
+
*/
|
|
336
|
+
descriptionId(index) {
|
|
337
|
+
return `${this.nameBase}-${index}-description`;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* The footer's class (`cm.flex({ align: 'center', justify: 'end', gap: 'sm', wrap: 'wrap' })`).
|
|
341
|
+
* @returns The class string.
|
|
342
|
+
*/
|
|
343
|
+
footerClasses() {
|
|
344
|
+
return this.cm().flex({ align: 'center', justify: 'end', gap: 'sm', wrap: 'wrap' });
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* The title input's text (React's `{title ?? t('cookieBanner.title')}`): the
|
|
348
|
+
* input for strings and numbers, the i18n default when it is nullish, and
|
|
349
|
+
* nothing while node content is projected.
|
|
350
|
+
* @returns The text to render.
|
|
351
|
+
*/
|
|
352
|
+
titleText() {
|
|
353
|
+
if (this.hasTitleSlot)
|
|
354
|
+
return '';
|
|
355
|
+
const value = this.title;
|
|
356
|
+
if (typeof value === 'string' || typeof value === 'number')
|
|
357
|
+
return String(value);
|
|
358
|
+
if (value === null || value === undefined)
|
|
359
|
+
return this.ariaLabel();
|
|
360
|
+
return '';
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* The description input's text (React's `{description ?? t('cookieBanner.description')}`).
|
|
364
|
+
* @returns The text to render.
|
|
365
|
+
*/
|
|
366
|
+
descriptionText() {
|
|
367
|
+
if (this.hasDescriptionSlot)
|
|
368
|
+
return '';
|
|
369
|
+
const value = this.description;
|
|
370
|
+
if (typeof value === 'string' || typeof value === 'number')
|
|
371
|
+
return String(value);
|
|
372
|
+
if (value === null || value === undefined)
|
|
373
|
+
return this.i18n.t('cookieBanner.description', {}, { defaultValue: 'We use cookies to improve your experience and analyse traffic.' });
|
|
374
|
+
return '';
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* The policy link's label (React's `t('cookieBanner.learnMore')`).
|
|
378
|
+
* @returns The label text.
|
|
379
|
+
*/
|
|
380
|
+
learnMoreText() {
|
|
381
|
+
return this.i18n.t('cookieBanner.learnMore', {}, { defaultValue: 'Learn more' });
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* The Customize/Hide-details button's label.
|
|
385
|
+
* @returns The label text.
|
|
386
|
+
*/
|
|
387
|
+
detailsLabel() {
|
|
388
|
+
return this.showDetails
|
|
389
|
+
? this.i18n.t('cookieBanner.hideDetails', {}, { defaultValue: 'Hide details' })
|
|
390
|
+
: this.i18n.t('cookieBanner.customize', {}, { defaultValue: 'Customize' });
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* The Reject button's label.
|
|
394
|
+
* @returns The label text.
|
|
395
|
+
*/
|
|
396
|
+
rejectText() {
|
|
397
|
+
return this.i18n.t('cookieBanner.reject', {}, { defaultValue: 'Reject all' });
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* The Save button's label.
|
|
401
|
+
* @returns The label text.
|
|
402
|
+
*/
|
|
403
|
+
saveText() {
|
|
404
|
+
return this.i18n.t('cookieBanner.save', {}, { defaultValue: 'Save preferences' });
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* The Accept button's label.
|
|
408
|
+
* @returns The label text.
|
|
409
|
+
*/
|
|
410
|
+
acceptText() {
|
|
411
|
+
return this.i18n.t('cookieBanner.accept', {}, { defaultValue: 'Accept all' });
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Whether React's `categories &&` branches render (a nullish list does not).
|
|
415
|
+
* @returns True when categories were supplied.
|
|
416
|
+
*/
|
|
417
|
+
hasCategories() {
|
|
418
|
+
return this.categories !== null && this.categories !== undefined;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Whether React's `showDetails && categories && onSave` Save branch renders.
|
|
422
|
+
* @returns True when the Save button renders.
|
|
423
|
+
*/
|
|
424
|
+
saveVisible() {
|
|
425
|
+
return this.showDetails && this.hasCategories() && !!this.onSave;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Whether a value is one of the cases' projected node templates.
|
|
429
|
+
* @param value - The field value.
|
|
430
|
+
* @returns True for a projected node template.
|
|
431
|
+
*/
|
|
432
|
+
isTemplate(value) {
|
|
433
|
+
return isTemplate(value);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* The value as a template (call under {@link CookieBanner.isTemplate}).
|
|
437
|
+
* @param value - The field value.
|
|
438
|
+
* @returns The template.
|
|
439
|
+
*/
|
|
440
|
+
asTemplate(value) {
|
|
441
|
+
return value;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Whether a category's switch is on (React's `!!enabled[c.id] || !!c.required`).
|
|
445
|
+
* @param category - The category.
|
|
446
|
+
* @returns Whether the switch is checked.
|
|
447
|
+
*/
|
|
448
|
+
isChecked(category) {
|
|
449
|
+
return !!this.enabled.get(category.id) || category.required === true;
|
|
450
|
+
}
|
|
451
|
+
/** Flips the details block, as React's `setShowDetails((x) => !x)` does. */
|
|
452
|
+
toggleDetails() {
|
|
453
|
+
this.showDetails = !this.showDetails;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Toggles one category, as React's `setEnabled` does.
|
|
457
|
+
* @param category - The category whose switch changed.
|
|
458
|
+
* @param event - The native change event the UI Switch re-emitted.
|
|
459
|
+
*/
|
|
460
|
+
toggle(category, event) {
|
|
461
|
+
const checked = event.target?.checked ?? false;
|
|
462
|
+
this.enabled.set(category.id, checked);
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* The enabled categories as React's plain `Record<string, boolean>`.
|
|
466
|
+
* @returns The enabled map.
|
|
467
|
+
*/
|
|
468
|
+
enabledMap() {
|
|
469
|
+
const out = {};
|
|
470
|
+
for (const [id, enabled] of this.enabled)
|
|
471
|
+
out[id] = enabled;
|
|
472
|
+
return out;
|
|
473
|
+
}
|
|
474
|
+
/** Calls `onRejectAll`, then `onDismiss`. */
|
|
475
|
+
reject() {
|
|
476
|
+
this.dismissAfter(this.onRejectAll);
|
|
477
|
+
}
|
|
478
|
+
/** Calls `onSave(enabled)`, then `onDismiss`. */
|
|
479
|
+
save() {
|
|
480
|
+
this.dismissAfter(() => this.onSave?.(this.enabledMap()));
|
|
481
|
+
}
|
|
482
|
+
/** Calls `onAcceptAll`, then `onDismiss`. */
|
|
483
|
+
accept() {
|
|
484
|
+
this.dismissAfter(this.onAcceptAll);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Calls the optional callback then the shared onDismiss handler.
|
|
488
|
+
* @param fn - The mode-specific callback.
|
|
489
|
+
*/
|
|
490
|
+
dismissAfter(fn) {
|
|
491
|
+
fn?.();
|
|
492
|
+
this.onDismiss?.();
|
|
493
|
+
}
|
|
494
|
+
/** Applies React's node-prop DOM: whichever capture span React would render is unwrapped. */
|
|
495
|
+
applyNodeProps() {
|
|
496
|
+
if (this.nodeLayoutApplied)
|
|
497
|
+
return;
|
|
498
|
+
this.nodeLayoutApplied = true;
|
|
499
|
+
applyNodeLayout(this.titleFallback?.nativeElement, this.titleSlot?.nativeElement, this.hasTitleSlot);
|
|
500
|
+
applyNodeLayout(this.descriptionFallback?.nativeElement, this.descriptionSlot?.nativeElement, this.hasDescriptionSlot);
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Removes the host element from the DOM while React would render null
|
|
504
|
+
* (`visible === false`), and restores it when the banner is shown again.
|
|
505
|
+
*/
|
|
506
|
+
syncHostVisibility() {
|
|
507
|
+
const host = this.el.nativeElement;
|
|
508
|
+
if (this.visible === false) {
|
|
509
|
+
if (host.isConnected) {
|
|
510
|
+
this.detachedParent = host.parentNode;
|
|
511
|
+
this.detachedAnchor = host.nextSibling;
|
|
512
|
+
host.parentNode?.removeChild(host);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
else if (this.detachedParent && !host.isConnected) {
|
|
516
|
+
this.detachedParent.insertBefore(host, this.detachedAnchor);
|
|
517
|
+
this.detachedParent = null;
|
|
518
|
+
this.detachedAnchor = null;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
static ɵfac = function CookieBanner_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CookieBanner)(); };
|
|
522
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CookieBanner, selectors: [["div", "mol-cookie-banner", ""]], viewQuery: function CookieBanner_Query(rf, ctx) { if (rf & 1) {
|
|
523
|
+
i0.ɵɵviewQuery(_c0, 5)(_c1, 5)(_c2, 5)(_c3, 5);
|
|
524
|
+
} if (rf & 2) {
|
|
525
|
+
let _t;
|
|
526
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.titleFallback = _t.first);
|
|
527
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.titleSlot = _t.first);
|
|
528
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.descriptionFallback = _t.first);
|
|
529
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.descriptionSlot = _t.first);
|
|
530
|
+
} }, hostAttrs: ["role", "dialog"], hostVars: 5, hostBindings: function CookieBanner_HostBindings(rf, ctx) { if (rf & 2) {
|
|
531
|
+
i0.ɵɵattribute("aria-label", ctx.ariaLabel());
|
|
532
|
+
i0.ɵɵstyleMap(ctx.hostStyle());
|
|
533
|
+
i0.ɵɵclassMap(ctx.classes());
|
|
534
|
+
} }, inputs: { categories: "categories", onAcceptAll: "onAcceptAll", onRejectAll: "onRejectAll", onSave: "onSave", title: "title", description: "description", policyHref: "policyHref", visible: "visible", onDismiss: "onDismiss", className: "className" }, ngContentSelectors: _c5, decls: 24, vars: 19, consts: [["titleFallback", ""], ["titleSlot", ""], ["descriptionFallback", ""], ["descriptionSlot", ""], [3, "class"], ["mol-button", "", 3, "variant", "size"], ["mol-button", "", 3, "click", "variant"], ["mol-button", "", 3, "variant"], ["mol-button", "", 3, "click", "variant", "color"], [3, "ngTemplateOutlet"], [3, "change", "checked", "disabled"], ["mol-button", "", 3, "click", "variant", "size"]], template: function CookieBanner_Template(rf, ctx) { if (rf & 1) {
|
|
535
|
+
i0.ɵɵprojectionDef(_c4);
|
|
536
|
+
i0.ɵɵelementStart(0, "header")(1, "h3")(2, "span", null, 0);
|
|
537
|
+
i0.ɵɵtext(4);
|
|
538
|
+
i0.ɵɵelementEnd();
|
|
539
|
+
i0.ɵɵelementStart(5, "span", null, 1);
|
|
540
|
+
i0.ɵɵprojection(7);
|
|
541
|
+
i0.ɵɵelementEnd()();
|
|
542
|
+
i0.ɵɵelementStart(8, "p")(9, "span", null, 2);
|
|
543
|
+
i0.ɵɵtext(11);
|
|
544
|
+
i0.ɵɵelementEnd();
|
|
545
|
+
i0.ɵɵelementStart(12, "span", null, 3);
|
|
546
|
+
i0.ɵɵprojection(14, 1);
|
|
547
|
+
i0.ɵɵelementEnd();
|
|
548
|
+
i0.ɵɵconditionalCreate(15, CookieBanner_Conditional_15_Template, 5, 5);
|
|
549
|
+
i0.ɵɵelementEnd()();
|
|
550
|
+
i0.ɵɵconditionalCreate(16, CookieBanner_Conditional_16_Template, 3, 4, "div", 4);
|
|
551
|
+
i0.ɵɵelementStart(17, "footer");
|
|
552
|
+
i0.ɵɵconditionalCreate(18, CookieBanner_Conditional_18_Template, 2, 5, "button", 5);
|
|
553
|
+
i0.ɵɵelementStart(19, "button", 6);
|
|
554
|
+
i0.ɵɵlistener("click", function CookieBanner_Template_button_click_19_listener() { return ctx.reject(); });
|
|
555
|
+
i0.ɵɵtext(20);
|
|
556
|
+
i0.ɵɵelementEnd();
|
|
557
|
+
i0.ɵɵconditionalCreate(21, CookieBanner_Conditional_21_Template, 2, 2, "button", 7);
|
|
558
|
+
i0.ɵɵelementStart(22, "button", 8);
|
|
559
|
+
i0.ɵɵlistener("click", function CookieBanner_Template_button_click_22_listener() { return ctx.accept(); });
|
|
560
|
+
i0.ɵɵtext(23);
|
|
561
|
+
i0.ɵɵelementEnd()();
|
|
562
|
+
} if (rf & 2) {
|
|
563
|
+
i0.ɵɵclassMap(ctx.cm().stack(1));
|
|
564
|
+
i0.ɵɵadvance();
|
|
565
|
+
i0.ɵɵclassMap(ctx.titleClasses());
|
|
566
|
+
i0.ɵɵadvance(3);
|
|
567
|
+
i0.ɵɵtextInterpolate(ctx.titleText());
|
|
568
|
+
i0.ɵɵadvance(4);
|
|
569
|
+
i0.ɵɵclassMap(ctx.cm().textSize("sm"));
|
|
570
|
+
i0.ɵɵadvance(3);
|
|
571
|
+
i0.ɵɵtextInterpolate(ctx.descriptionText());
|
|
572
|
+
i0.ɵɵadvance(4);
|
|
573
|
+
i0.ɵɵconditional(ctx.policyHref ? 15 : -1);
|
|
574
|
+
i0.ɵɵadvance();
|
|
575
|
+
i0.ɵɵconditional(ctx.showDetails && ctx.hasCategories() ? 16 : -1);
|
|
576
|
+
i0.ɵɵadvance();
|
|
577
|
+
i0.ɵɵclassMap(ctx.footerClasses());
|
|
578
|
+
i0.ɵɵadvance();
|
|
579
|
+
i0.ɵɵconditional(ctx.hasCategories() ? 18 : -1);
|
|
580
|
+
i0.ɵɵadvance();
|
|
581
|
+
i0.ɵɵproperty("variant", "ghost");
|
|
582
|
+
i0.ɵɵadvance();
|
|
583
|
+
i0.ɵɵtextInterpolate(ctx.rejectText());
|
|
584
|
+
i0.ɵɵadvance();
|
|
585
|
+
i0.ɵɵconditional(ctx.saveVisible() ? 21 : -1);
|
|
586
|
+
i0.ɵɵadvance();
|
|
587
|
+
i0.ɵɵproperty("variant", "solid")("color", "primary");
|
|
588
|
+
i0.ɵɵadvance();
|
|
589
|
+
i0.ɵɵtextInterpolate(ctx.acceptText());
|
|
590
|
+
} }, dependencies: [Button, NgTemplateOutlet, Switch], encapsulation: 2 });
|
|
591
|
+
}
|
|
592
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CookieBanner, [{
|
|
593
|
+
type: Component,
|
|
594
|
+
args: [{
|
|
595
|
+
selector: 'div[mol-cookie-banner]',
|
|
596
|
+
standalone: true,
|
|
597
|
+
imports: [Button, NgTemplateOutlet, Switch],
|
|
598
|
+
inputs: [
|
|
599
|
+
'categories',
|
|
600
|
+
'onAcceptAll',
|
|
601
|
+
'onRejectAll',
|
|
602
|
+
'onSave',
|
|
603
|
+
'title',
|
|
604
|
+
'description',
|
|
605
|
+
'policyHref',
|
|
606
|
+
'visible',
|
|
607
|
+
'onDismiss',
|
|
608
|
+
'className',
|
|
609
|
+
],
|
|
610
|
+
host: {
|
|
611
|
+
role: 'dialog',
|
|
612
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
613
|
+
'[class]': 'classes()',
|
|
614
|
+
'[style]': 'hostStyle()',
|
|
615
|
+
},
|
|
616
|
+
// prettier-ignore
|
|
617
|
+
template: `<header [class]="cm().stack(1)"><h3 [class]="titleClasses()"><span #titleFallback>{{ titleText() }}</span><span #titleSlot><ng-content select="[slot=title]"></ng-content></span></h3><p [class]="cm().textSize('sm')"><span #descriptionFallback>{{ descriptionText() }}</span><span #descriptionSlot><ng-content select="[slot=description]"></ng-content></span>@if (policyHref) {<ng-container>{{ leadingSpace }}</ng-container><a [class]="cm().link" [attr.href]="policyHref">{{ learnMoreText() }}</a>.}</p></header>@if (showDetails && hasCategories()) {<div [attr.id]="detailsId" [class]="cm().stack(2)">@for (category of categories ?? []; track category.id; let i = $index) {<div [class]="rowClasses()"><div [class]="textColumnClasses()"><span [attr.id]="labelId(i)" [class]="labelClasses()">@if (isTemplate(category.label)) {<ng-container [ngTemplateOutlet]="asTemplate(category.label)" />} @else {{{ category.label }}}</span>@if (category.description) {<span [attr.id]="descriptionId(i)" [class]="cm().textSize('xs')">@if (isTemplate(category.description)) {<ng-container [ngTemplateOutlet]="asTemplate(category.description)" />} @else {{{ category.description }}}</span>}</div><mol-switch [checked]="isChecked(category)" [disabled]="category.required === true" [attr.aria-labelledby]="labelId(i)" [attr.aria-describedby]="category.description ? descriptionId(i) : null" (change)="toggle(category, $event)"></mol-switch></div>}</div>}<footer [class]="footerClasses()">@if (hasCategories()) {<button mol-button [variant]="'ghost'" [size]="'sm'" [attr.aria-expanded]="showDetails" [attr.aria-controls]="showDetails && hasCategories() ? detailsId : null" (click)="toggleDetails()">{{ detailsLabel() }}</button>}<button mol-button [variant]="'ghost'" (click)="reject()">{{ rejectText() }}</button>@if (saveVisible()) {<button mol-button [variant]="'outline'" (click)="save()">{{ saveText() }}</button>}<button mol-button [variant]="'solid'" [color]="'primary'" (click)="accept()">{{ acceptText() }}</button></footer>`,
|
|
618
|
+
}]
|
|
619
|
+
}], null, { titleFallback: [{
|
|
620
|
+
type: ViewChild,
|
|
621
|
+
args: ['titleFallback']
|
|
622
|
+
}], titleSlot: [{
|
|
623
|
+
type: ViewChild,
|
|
624
|
+
args: ['titleSlot']
|
|
625
|
+
}], descriptionFallback: [{
|
|
626
|
+
type: ViewChild,
|
|
627
|
+
args: ['descriptionFallback']
|
|
628
|
+
}], descriptionSlot: [{
|
|
629
|
+
type: ViewChild,
|
|
630
|
+
args: ['descriptionSlot']
|
|
631
|
+
}] }); })();
|
|
632
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CookieBanner, { className: "CookieBanner", filePath: "cookie-banner.component.ts", lineNumber: 94 }); })();
|
|
633
|
+
//# sourceMappingURL=cookie-banner.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookie-banner.component.js","sourceRoot":"","sources":["../src/cookie-banner.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAEL,SAAS,EAET,UAAU,EACV,MAAM,EAIN,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,SAAS,EA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