@consent.software/catalog 1.3.2 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_bundle/bundle.js +38 -46
- package/dist_bundle/bundle.js.map +4 -4
- package/dist_ts_web/00_commitinfo_data.d.ts +1 -1
- package/dist_ts_web/00_commitinfo_data.js +5 -5
- package/dist_ts_web/elements/consentsoftware-cookieconsent.d.ts +27 -6
- package/dist_ts_web/elements/consentsoftware-cookieconsent.js +265 -178
- package/dist_ts_web/elements/consentsoftware-header.d.ts +7 -0
- package/dist_ts_web/elements/consentsoftware-header.js +45 -0
- package/dist_ts_web/elements/consentsoftware-mainselection.d.ts +10 -0
- package/dist_ts_web/elements/consentsoftware-mainselection.js +74 -0
- package/dist_ts_web/elements/consentsoftware-tabs.d.ts +8 -0
- package/dist_ts_web/elements/consentsoftware-tabs.js +73 -0
- package/dist_ts_web/elements/consentsoftware-toggle.d.ts +13 -0
- package/dist_ts_web/elements/consentsoftware-toggle.js +137 -0
- package/dist_ts_web/elements/index.d.ts +4 -0
- package/dist_ts_web/elements/index.js +5 -1
- package/dist_ts_web/elements/shared.d.ts +1 -0
- package/dist_ts_web/elements/shared.js +3 -0
- package/dist_ts_web/pages/index.d.ts +0 -1
- package/dist_ts_web/pages/index.js +1 -2
- package/dist_ts_web/pages/page1.d.ts +1 -1
- package/dist_ts_web/pages/page1.js +3 -6
- package/dist_watch/bundle.js +15901 -24255
- package/dist_watch/bundle.js.map +4 -4
- package/package.json +6 -5
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/consentsoftware-cookieconsent.ts +5 -4
- package/ts_web/elements/consentsoftware-header.ts +2 -2
- package/ts_web/elements/consentsoftware-mainselection.ts +2 -3
- package/ts_web/elements/consentsoftware-tabs.ts +1 -1
- package/dist_ts_web/pages/page2.d.ts +0 -1
- package/dist_ts_web/pages/page2.js +0 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* autocreated commitinfo by @
|
|
2
|
+
* autocreated commitinfo by @push.rocks/commitinfo
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
|
-
name: '@consent.
|
|
6
|
-
version: '1.
|
|
7
|
-
description: '
|
|
5
|
+
name: '@consent.software/catalog',
|
|
6
|
+
version: '1.3.5',
|
|
7
|
+
description: 'A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.'
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHNfd2ViLzAwX2NvbW1pdGluZm9fZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLFVBQVUsR0FBRztJQUN4QixJQUFJLEVBQUUsMkJBQTJCO0lBQ2pDLE9BQU8sRUFBRSxPQUFPO0lBQ2hCLFdBQVcsRUFBRSwrSkFBK0o7Q0FDN0ssQ0FBQSJ9
|
|
@@ -1,16 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '@design.estate/dees-catalog';
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
3
2
|
import * as csWebclient from '@consent.software/webclient';
|
|
4
|
-
export declare class ConsentsoftwareCookieconsent extends
|
|
3
|
+
export declare class ConsentsoftwareCookieconsent extends LitElement {
|
|
5
4
|
static demo: () => TemplateResult<1>;
|
|
6
5
|
csWebclientInstance: csWebclient.CsWebclient;
|
|
7
6
|
csWebclientRan: boolean;
|
|
7
|
+
theme: 'light' | 'dark';
|
|
8
|
+
/**
|
|
9
|
+
* We bind `heightPixels` to a CSS variable (--cookieconsent-height).
|
|
10
|
+
* Then we can do margin-bottom animations in CSS.
|
|
11
|
+
*/
|
|
12
|
+
static styles: import("lit").CSSResult;
|
|
8
13
|
constructor();
|
|
9
|
-
static styles: import("@design.estate/dees-element").CSSResult[];
|
|
10
14
|
render(): TemplateResult;
|
|
11
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Called when the element is inserted into the DOM.
|
|
17
|
+
*/
|
|
12
18
|
connectedCallback(): Promise<void>;
|
|
13
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Called after the first render of the component.
|
|
21
|
+
* We measure the actual height of the banner and update the CSS variable.
|
|
22
|
+
*/
|
|
23
|
+
firstUpdated(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Called whenever the element is updated or re-rendered.
|
|
26
|
+
*/
|
|
14
27
|
updated(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the user’s chosen cookie level(s) and hides the banner.
|
|
30
|
+
*/
|
|
15
31
|
private setLevel;
|
|
32
|
+
/**
|
|
33
|
+
* Dynamically switches the theme between light/dark,
|
|
34
|
+
* respecting `prefers-color-scheme` by default.
|
|
35
|
+
*/
|
|
36
|
+
private updateTheme;
|
|
16
37
|
}
|
|
@@ -7,205 +7,271 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import '
|
|
10
|
+
import * as shared from './shared.js';
|
|
11
|
+
import { LitElement, html, css } from 'lit';
|
|
12
|
+
import { customElement } from 'lit/decorators.js';
|
|
13
|
+
import { property } from 'lit/decorators/property.js';
|
|
13
14
|
import * as csInterfaces from '@consent.software/interfaces';
|
|
14
15
|
import * as csWebclient from '@consent.software/webclient';
|
|
15
16
|
import { delayFor } from '@push.rocks/smartdelay';
|
|
16
|
-
|
|
17
|
+
let ConsentsoftwareCookieconsent = class ConsentsoftwareCookieconsent extends LitElement {
|
|
17
18
|
static { this.demo = () => html `<consentsoftware-cookieconsent></consentsoftware-cookieconsent>`; }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
margin: auto;
|
|
36
|
-
line-height: var(--cookieconsent-height);
|
|
37
|
-
padding-bottom: 20px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.text-container {
|
|
42
|
-
line-height: var(--cookieconsent-height);
|
|
43
|
-
display: grid;
|
|
44
|
-
grid-template-columns: 30px auto;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.text-container .icon-container {
|
|
48
|
-
height: var(--cookieconsent-height);
|
|
49
|
-
display: inline-block;
|
|
50
|
-
color: #4496F5;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.text-container .toptext {
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.text-container a {
|
|
58
|
-
color: ${cssManager.bdTheme('#333', '#fff')};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.button-container {
|
|
62
|
-
display: grid;
|
|
63
|
-
grid-template-columns: ${cssManager.cssGridColumns(4, 20)};
|
|
64
|
-
grid-column-gap: 20px;
|
|
65
|
-
grid-row-gap: 20px;
|
|
66
|
-
}
|
|
19
|
+
/**
|
|
20
|
+
* We bind `heightPixels` to a CSS variable (--cookieconsent-height).
|
|
21
|
+
* Then we can do margin-bottom animations in CSS.
|
|
22
|
+
*/
|
|
23
|
+
static { this.styles = css `
|
|
24
|
+
:host {
|
|
25
|
+
font-family: ${shared.fontStack};
|
|
26
|
+
/* Default theme variables */
|
|
27
|
+
--text-color: #333;
|
|
28
|
+
--background-color: #eeeeee;
|
|
29
|
+
--accent-color: #333333;
|
|
30
|
+
--button-bg: #ffffff;
|
|
31
|
+
--button-hover-bg: #f2f2f2;
|
|
32
|
+
--icon-color: #4496f5;
|
|
33
|
+
--link-color: #333;
|
|
34
|
+
--padding-sides: 16px;
|
|
35
|
+
}
|
|
67
36
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
37
|
+
:host([theme='dark']) {
|
|
38
|
+
--text-color: #fff;
|
|
39
|
+
--background-color: #111;
|
|
40
|
+
--accent-color: #333333;
|
|
41
|
+
--button-bg: #252525;
|
|
42
|
+
--button-hover-bg: #222222;
|
|
43
|
+
--icon-color: #4496f5;
|
|
44
|
+
--link-color: #fff;
|
|
45
|
+
}
|
|
72
46
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
47
|
+
:host([theme='light']) {
|
|
48
|
+
--text-color: #333;
|
|
49
|
+
--background-color: #eeeeee;
|
|
50
|
+
--accent-color: #333333;
|
|
51
|
+
--button-bg: #ffffff;
|
|
52
|
+
--button-hover-bg: #f2f2f2;
|
|
53
|
+
--icon-color: #4496f5;
|
|
54
|
+
--link-color: #333;
|
|
55
|
+
}
|
|
78
56
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
57
|
+
.pageOverlay {
|
|
58
|
+
position: fixed;
|
|
59
|
+
top: 0px;
|
|
60
|
+
bottom: 0px;
|
|
61
|
+
right: 0px;
|
|
62
|
+
left: 0px;
|
|
63
|
+
display: grid;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
z-index: 1000; /* standard z-index for fixed elements */
|
|
67
|
+
background: rgba(0, 0, 0, 0);
|
|
68
|
+
backdrop-filter: blur(0px);
|
|
69
|
+
transition: all 0.2s;
|
|
70
|
+
}
|
|
82
71
|
|
|
72
|
+
.modalBox {
|
|
73
|
+
display: block;
|
|
74
|
+
color: var(--text-color);
|
|
75
|
+
background: var(--background-color);
|
|
76
|
+
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.6);
|
|
77
|
+
position: realtive;
|
|
78
|
+
border: 1px dotted rgba(255, 255, 255, 0.1);
|
|
79
|
+
border-top: 1px solid var(--accent-color);
|
|
80
|
+
border-radius: 16px;
|
|
81
|
+
max-width: 1100px;
|
|
82
|
+
min-width: calc(100vw / 3);
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
/*
|
|
86
|
+
* We start with margin-bottom as negative to hide the banner.
|
|
87
|
+
* The animation occurs when we toggle the gotIt/show attributes.
|
|
88
|
+
*/
|
|
89
|
+
will-change: transform; /* ensure efficient rendering */
|
|
90
|
+
transition: all 0.3s;
|
|
91
|
+
transform: scale(0.95);
|
|
92
|
+
opacity: 0;
|
|
93
|
+
}
|
|
83
94
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
/*
|
|
96
|
+
* Toggle display based on [show] attribute
|
|
97
|
+
* (so if show=false, the banner doesn't show at all).
|
|
98
|
+
*/
|
|
99
|
+
:host([show='false']) {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
:host([show='true']) {
|
|
103
|
+
display: block;
|
|
104
|
+
}
|
|
94
105
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
/*
|
|
107
|
+
* Animate margin-bottom when [gotIt] toggles.
|
|
108
|
+
* If gotIt=true, push the banner down off-screen.
|
|
109
|
+
* If gotIt=false, pull the banner into view.
|
|
110
|
+
*/
|
|
111
|
+
:host([gotIt='true']) {
|
|
112
|
+
background: blue;
|
|
113
|
+
}
|
|
114
|
+
:host([gotIt='false']) {
|
|
115
|
+
background: red;
|
|
116
|
+
}
|
|
98
117
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
118
|
+
.content {
|
|
119
|
+
margin: auto;
|
|
120
|
+
}
|
|
102
121
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
122
|
+
.text-container {
|
|
123
|
+
padding-left: var(--padding-sides);
|
|
124
|
+
padding-right: var(--padding-sides);
|
|
125
|
+
display: grid;
|
|
126
|
+
grid-template-columns: auto;
|
|
127
|
+
}
|
|
109
128
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
129
|
+
.text-container a {
|
|
130
|
+
color: var(--link-color);
|
|
131
|
+
text-decoration: none;
|
|
132
|
+
}
|
|
114
133
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
134
|
+
.button-container {
|
|
135
|
+
padding: var(--padding-sides);
|
|
136
|
+
display: grid;
|
|
137
|
+
grid-template-columns: repeat(3, 1fr);
|
|
138
|
+
gap: 16px;
|
|
139
|
+
}
|
|
118
140
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
141
|
+
.info-container {
|
|
142
|
+
color: var(--text-color);
|
|
143
|
+
text-align: center;
|
|
144
|
+
line-height: 3em;
|
|
145
|
+
background: rgba(0, 0, 0, 0.1);
|
|
146
|
+
border-top: 1px dotted rgba(255, 255, 255, 0.1);
|
|
147
|
+
font-size: 0.8em;
|
|
148
|
+
color: rgba(255, 255, 255, 0.5);
|
|
149
|
+
}
|
|
124
150
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
151
|
+
.info-container a {
|
|
152
|
+
text-decoration: underline;
|
|
153
|
+
color: var(--link-color);
|
|
154
|
+
transition: color 0.2s;
|
|
155
|
+
}
|
|
156
|
+
.info-container a:hover {
|
|
157
|
+
color: #ffffff;
|
|
158
|
+
}
|
|
130
159
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
160
|
+
.consent-button {
|
|
161
|
+
border-radius: 3px;
|
|
162
|
+
background: var(--button-bg);
|
|
163
|
+
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
|
|
164
|
+
padding: 10px;
|
|
165
|
+
line-height: 30px;
|
|
166
|
+
text-align: center;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
transition: background 0.2s;
|
|
169
|
+
}
|
|
135
170
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
171
|
+
.consent-button:hover {
|
|
172
|
+
background: var(--button-hover-bg);
|
|
173
|
+
}
|
|
174
|
+
`; }
|
|
175
|
+
constructor() {
|
|
176
|
+
super();
|
|
177
|
+
this.csWebclientInstance = new csWebclient.CsWebclient();
|
|
178
|
+
this.csWebclientRan = false;
|
|
179
|
+
this.theme = 'light';
|
|
180
|
+
this.setAttribute('gotIt', 'true');
|
|
181
|
+
this.setAttribute('show', 'false');
|
|
182
|
+
}
|
|
143
183
|
render() {
|
|
144
184
|
return html `
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
<div class="pageOverlay">
|
|
186
|
+
<div class="modalBox">
|
|
187
|
+
<div class="content">
|
|
188
|
+
<consentsoftware-header></consentsoftware-header>
|
|
189
|
+
<consentsoftware-tabs></consentsoftware-tabs>
|
|
190
|
+
<div class="text-container" style="padding: 16px;">
|
|
191
|
+
<div class="toptext">
|
|
192
|
+
This page uses cookies. Please review our
|
|
193
|
+
<a href="https://lossless.gmbh/cookie" target="_blank">cookie policy</a>
|
|
194
|
+
and choose which cookie level you are willing to accept.
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
<!-- <div class="button-container">
|
|
198
|
+
<div
|
|
199
|
+
class="consent-button"
|
|
200
|
+
@click=${(event) => this.setLevel(event, ['functional'])}
|
|
201
|
+
>
|
|
202
|
+
Functional cookies
|
|
203
|
+
</div>
|
|
204
|
+
<div
|
|
205
|
+
class="consent-button"
|
|
206
|
+
@click=${(event) => this.setLevel(event, ['functional', 'analytics'])}
|
|
207
|
+
>
|
|
208
|
+
Analytics cookies
|
|
209
|
+
</div>
|
|
210
|
+
<div
|
|
211
|
+
class="consent-button"
|
|
212
|
+
@click=${(event) => this.setLevel(event, ['functional', 'analytics', 'marketing'])}
|
|
213
|
+
>
|
|
214
|
+
Marketing cookies
|
|
215
|
+
</div>
|
|
216
|
+
<div
|
|
217
|
+
class="consent-button"
|
|
218
|
+
@click=${(event) => this.setLevel(event, ['functional', 'analytics', 'marketing', 'all'])}
|
|
219
|
+
>
|
|
220
|
+
All cookies
|
|
221
|
+
</div>
|
|
222
|
+
</div> -->
|
|
223
|
+
<consentsoftware-mainselection></consentsoftware-mainselection>
|
|
224
|
+
<div class="button-container">
|
|
225
|
+
<div
|
|
226
|
+
class="consent-button"
|
|
227
|
+
@click=${(event) => this.setLevel(event, ['functional'])}
|
|
228
|
+
>
|
|
229
|
+
Deny
|
|
230
|
+
</div>
|
|
231
|
+
<div
|
|
232
|
+
class="consent-button"
|
|
233
|
+
@click=${(event) => this.setLevel(event, ['functional', 'analytics'])}
|
|
234
|
+
>
|
|
235
|
+
Accept selection
|
|
236
|
+
</div>
|
|
237
|
+
<div
|
|
238
|
+
class="consent-button"
|
|
239
|
+
@click=${(event) => this.setLevel(event, ['functional', 'analytics', 'marketing'])}
|
|
240
|
+
>
|
|
241
|
+
Accept all cookies
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
<div class="info-container">
|
|
245
|
+
consent management powered by
|
|
246
|
+
<a href="https://consent.software">consent.software</a>
|
|
247
|
+
</div>
|
|
186
248
|
</div>
|
|
187
|
-
<div class="toptext">This page uses cookies. Please review our <a href="https://lossless.gmbh/cookie" target="_blank">cookie policy</a> and choose which cookie level you are willing to accept.</div>
|
|
188
|
-
</div>
|
|
189
|
-
<div class="button-container">
|
|
190
|
-
<div class="consent-button" @click=${event => { this.setLevel(event, ['functional']); }}>Functional cookies</div>
|
|
191
|
-
<div class="consent-button" @click=${event => { this.setLevel(event, ['functional', 'analytics']); }}>Analytics cookies</div>
|
|
192
|
-
<div class="consent-button" @click=${event => { this.setLevel(event, ['functional', 'analytics', 'marketing']); }}>Marketing cookies</div>
|
|
193
|
-
<div class="consent-button" @click=${event => { this.setLevel(event, ['functional', 'analytics', 'marketing', 'all']); }}>All cookies</div>
|
|
194
|
-
</div>
|
|
195
|
-
<div class="info-container">
|
|
196
|
-
consent management powered by <a href="https://consent.software">consent.software</a>
|
|
197
249
|
</div>
|
|
198
250
|
</div>
|
|
199
251
|
`;
|
|
200
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* Called when the element is inserted into the DOM.
|
|
255
|
+
*/
|
|
201
256
|
async connectedCallback() {
|
|
202
257
|
super.connectedCallback();
|
|
203
|
-
this.
|
|
258
|
+
this.updateTheme();
|
|
204
259
|
const cookieLevel = await this.csWebclientInstance.getCookieLevels();
|
|
205
260
|
if (!cookieLevel) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
261
|
+
this.setAttribute('show', 'true');
|
|
262
|
+
this.setAttribute('gotIt', 'false');
|
|
263
|
+
requestAnimationFrame(async () => {
|
|
264
|
+
await this.updated();
|
|
265
|
+
const pageOverlay = this.shadowRoot?.querySelector('.pageOverlay');
|
|
266
|
+
if (pageOverlay) {
|
|
267
|
+
pageOverlay.style.background = 'rgba(0, 0, 0, 0.1)';
|
|
268
|
+
pageOverlay.style.backdropFilter = 'blur(2px)';
|
|
269
|
+
}
|
|
270
|
+
const modalBox = this.shadowRoot?.querySelector('.modalBox');
|
|
271
|
+
if (modalBox) {
|
|
272
|
+
modalBox.style.transform = `scale(1)`;
|
|
273
|
+
modalBox.style.opacity = '1';
|
|
274
|
+
}
|
|
209
275
|
});
|
|
210
276
|
}
|
|
211
277
|
else {
|
|
@@ -213,32 +279,53 @@ export let ConsentsoftwareCookieconsent = class ConsentsoftwareCookieconsent ext
|
|
|
213
279
|
this.setAttribute('gotIt', 'true');
|
|
214
280
|
}
|
|
215
281
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
282
|
+
/**
|
|
283
|
+
* Called after the first render of the component.
|
|
284
|
+
* We measure the actual height of the banner and update the CSS variable.
|
|
285
|
+
*/
|
|
286
|
+
async firstUpdated() { }
|
|
287
|
+
/**
|
|
288
|
+
* Called whenever the element is updated or re-rendered.
|
|
289
|
+
*/
|
|
219
290
|
async updated() {
|
|
220
|
-
console.log(`The height of the cookie banner is ${this.shadowRoot
|
|
291
|
+
console.log(`The height of the cookie banner is ${this.shadowRoot?.host?.clientHeight}px`);
|
|
221
292
|
const acceptedCookieLevels = await this.csWebclientInstance.getCookieLevels();
|
|
222
293
|
if (!this.csWebclientRan && acceptedCookieLevels) {
|
|
223
294
|
this.csWebclientRan = true;
|
|
224
295
|
await this.csWebclientInstance.getAndRunConsentTuples();
|
|
225
296
|
}
|
|
226
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Sets the user’s chosen cookie level(s) and hides the banner.
|
|
300
|
+
*/
|
|
227
301
|
async setLevel(event, levelsArg) {
|
|
228
302
|
console.log(`Set level to ${levelsArg}`);
|
|
229
303
|
await this.csWebclientInstance.setCookieLevels(levelsArg);
|
|
230
304
|
this.setAttribute('gotIt', 'true');
|
|
231
305
|
await delayFor(300);
|
|
232
306
|
this.setAttribute('show', 'false');
|
|
307
|
+
// After user selection, re-check for any required scripts to run
|
|
233
308
|
this.updated();
|
|
234
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Dynamically switches the theme between light/dark,
|
|
312
|
+
* respecting `prefers-color-scheme` by default.
|
|
313
|
+
*/
|
|
314
|
+
updateTheme() {
|
|
315
|
+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
316
|
+
this.theme = prefersDark ? 'dark' : 'light';
|
|
317
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
|
|
318
|
+
this.theme = e.matches ? 'dark' : 'light';
|
|
319
|
+
});
|
|
320
|
+
}
|
|
235
321
|
};
|
|
236
322
|
__decorate([
|
|
237
|
-
property({ type:
|
|
238
|
-
__metadata("design:type",
|
|
239
|
-
], ConsentsoftwareCookieconsent.prototype, "
|
|
323
|
+
property({ type: String, reflect: true }),
|
|
324
|
+
__metadata("design:type", String)
|
|
325
|
+
], ConsentsoftwareCookieconsent.prototype, "theme", void 0);
|
|
240
326
|
ConsentsoftwareCookieconsent = __decorate([
|
|
241
327
|
customElement('consentsoftware-cookieconsent'),
|
|
242
328
|
__metadata("design:paramtypes", [])
|
|
243
329
|
], ConsentsoftwareCookieconsent);
|
|
244
|
-
|
|
330
|
+
export { ConsentsoftwareCookieconsent };
|
|
331
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc2VudHNvZnR3YXJlLWNvb2tpZWNvbnNlbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c193ZWIvZWxlbWVudHMvY29uc2VudHNvZnR3YXJlLWNvb2tpZWNvbnNlbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsT0FBTyxLQUFLLE1BQU0sTUFBTSxhQUFhLENBQUM7QUFFdEMsT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
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import * as shared from './shared.js';
|
|
11
|
+
import { LitElement, html, css } from 'lit';
|
|
12
|
+
import { customElement } from 'lit/decorators.js';
|
|
13
|
+
import { property } from 'lit/decorators/property.js';
|
|
14
|
+
let ConsentsoftwareHeader = class ConsentsoftwareHeader extends LitElement {
|
|
15
|
+
static { this.demo = () => html `<consentsoftware-tabs></consentsoftware-tabs>`; }
|
|
16
|
+
static { this.styles = css `
|
|
17
|
+
:host {
|
|
18
|
+
display: block;
|
|
19
|
+
line-height: 3em;
|
|
20
|
+
text-align: center;
|
|
21
|
+
font-family: ${shared.fontStack};
|
|
22
|
+
border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.heading {
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
`; }
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return html `
|
|
34
|
+
<div class="heading">
|
|
35
|
+
What about cookies?
|
|
36
|
+
</div>
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
ConsentsoftwareHeader = __decorate([
|
|
41
|
+
customElement('consentsoftware-header'),
|
|
42
|
+
__metadata("design:paramtypes", [])
|
|
43
|
+
], ConsentsoftwareHeader);
|
|
44
|
+
export { ConsentsoftwareHeader };
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc2VudHNvZnR3YXJlLWhlYWRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX3dlYi9lbGVtZW50cy9jb25zZW50c29mdHdhcmUtaGVhZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBLE9BQU8sS0FBSyxNQUFNLE1BQU0sYUFBYSxDQUFDO0FBRXRDLE9BQU8sRUFBRSxVQUFVLEVBQUUsSUFBSSxFQUFFLEdBQUcsRUFBdUIsTUFBTSxLQUFLLENBQUM7QUFDakUsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ2xELE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUcvQyxJQUFNLHFCQUFxQixHQUEzQixNQUFNLHFCQUFzQixTQUFRLFVBQVU7YUFDckMsU0FBSSxHQUFHLEdBQUcsRUFBRSxDQUFDLElBQUksQ0FBQSwrQ0FBK0MsQUFBNUQsQ0FBNkQ7YUFFakUsV0FBTSxHQUFHLEdBQUcsQ0FBQTs7Ozs7cUJBS1AsTUFBTSxDQUFDLFNBQVM7Ozs7Ozs7R0FPbEMsQUFabUIsQ0FZbEI7SUFFRjtRQUNFLEtBQUssRUFBRSxDQUFDO0lBQ1YsQ0FBQztJQUVNLE1BQU07UUFDWCxPQUFPLElBQUksQ0FBQTs7OztLQUlWLENBQUM7SUFDSixDQUFDOztBQTNCVSxxQkFBcUI7SUFEakMsYUFBYSxDQUFDLHdCQUF3QixDQUFDOztHQUMzQixxQkFBcUIsQ0E0QmpDIn0=
|