@kickstartds/ds-agency-premium 1.6.71--canary.45.2035.0 → 1.6.71--canary.45.2068.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ButtonProps-00ddee3a.d.ts → ButtonProps-4e2b2ecf.d.ts} +3 -1
- package/dist/ImageStoryProps-e853e1e7.d.ts +1 -1
- package/dist/SectionProps-d60aba86.d.ts +1 -1
- package/dist/components/blog-overview/blog-overview.schema.dereffed.json +54 -0
- package/dist/components/blog-post/blog-post.schema.dereffed.json +54 -0
- package/dist/components/blog-post/index.d.ts +1 -1
- package/dist/components/button/button.schema.dereffed.json +9 -0
- package/dist/components/button/button.schema.json +5 -0
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button-group/button-group.schema.dereffed.json +9 -0
- package/dist/components/button-group/index.d.ts +1 -1
- package/dist/components/cookie-consent/C15t.client.d.ts +5 -0
- package/dist/components/cookie-consent/C15t.client.js +94 -0
- package/dist/components/cookie-consent/CookieConsent.client.d.ts +30 -0
- package/dist/components/cookie-consent/CookieConsent.client.js +89 -0
- package/dist/components/cookie-consent/cookie-consent.css +7 -0
- package/dist/components/cookie-consent/cookie-consent.schema.dereffed.json +23 -10
- package/dist/components/cookie-consent/cookie-consent.schema.json +42 -16
- package/dist/components/cookie-consent/index.d.ts +9 -8
- package/dist/components/cookie-consent/index.js +5 -9
- package/dist/components/headline/headline.css +6 -6
- package/dist/components/image-story/image-story.schema.dereffed.json +9 -0
- package/dist/components/index/index.d.ts +1 -1
- package/dist/components/page/page.schema.dereffed.json +54 -0
- package/dist/components/page-wrapper/tokens.css +1 -1
- package/dist/components/presets.json +96 -22
- package/dist/components/section/section.schema.dereffed.json +54 -0
- package/dist/components/split-even/split-even.schema.dereffed.json +18 -0
- package/dist/components/split-weighted/split-weighted.schema.dereffed.json +18 -0
- package/dist/tokens/themes.css +4 -4
- package/dist/tokens/tokens.css +1 -1
- package/dist/tokens/tokens.js +1 -1
- package/package.json +8 -1
- /package/dist/{BlogPostProps-c760fd2a.d.ts → BlogPostProps-6b3cff22.d.ts} +0 -0
|
@@ -27,6 +27,7 @@ type Size = "small" | "medium" | "large";
|
|
|
27
27
|
* Whether the button should be disabled
|
|
28
28
|
*/
|
|
29
29
|
type Disabled = boolean;
|
|
30
|
+
type ButtonType = "button" | "submit" | "reset";
|
|
30
31
|
/**
|
|
31
32
|
* Component used for user interaction
|
|
32
33
|
*/
|
|
@@ -37,5 +38,6 @@ interface ButtonProps {
|
|
|
37
38
|
icon?: Icon;
|
|
38
39
|
size?: Size;
|
|
39
40
|
disabled?: Disabled;
|
|
41
|
+
type?: ButtonType;
|
|
40
42
|
}
|
|
41
|
-
export { Label, URL, Variant, Icon, Size, Disabled, ButtonProps };
|
|
43
|
+
export { Label, URL, Variant, Icon, Size, Disabled, ButtonType, ButtonProps };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
4
|
* and run json-schema-to-typescript to regenerate this file.
|
|
5
5
|
*/
|
|
6
|
-
import { ButtonProps } from "./ButtonProps-
|
|
6
|
+
import { ButtonProps } from "./ButtonProps-4e2b2ecf.js";
|
|
7
7
|
/**
|
|
8
8
|
* Headline for the module element
|
|
9
9
|
*/
|
|
@@ -25,7 +25,7 @@ import { TeaserCardProps } from "./TeaserCardProps-994cb119.js";
|
|
|
25
25
|
import { TestimonialsProps } from "./TestimonialsProps-e344f597.js";
|
|
26
26
|
import { TextProps } from "./TextProps-a23170d2.js";
|
|
27
27
|
import { VideoCurtainProps } from "./VideoCurtainProps-a2c0cc7f.js";
|
|
28
|
-
import { ButtonProps } from "./ButtonProps-
|
|
28
|
+
import { ButtonProps } from "./ButtonProps-4e2b2ecf.js";
|
|
29
29
|
/**
|
|
30
30
|
* Width of section to use
|
|
31
31
|
*/
|
|
@@ -1307,6 +1307,15 @@
|
|
|
1307
1307
|
"title": "Disabled?",
|
|
1308
1308
|
"description": "Whether the button should be disabled",
|
|
1309
1309
|
"default": false
|
|
1310
|
+
},
|
|
1311
|
+
"type": {
|
|
1312
|
+
"type": "string",
|
|
1313
|
+
"title": "Button Type",
|
|
1314
|
+
"enum": [
|
|
1315
|
+
"button",
|
|
1316
|
+
"submit",
|
|
1317
|
+
"reset"
|
|
1318
|
+
]
|
|
1310
1319
|
}
|
|
1311
1320
|
},
|
|
1312
1321
|
"additionalProperties": false,
|
|
@@ -3744,6 +3753,15 @@
|
|
|
3744
3753
|
"title": "Disabled?",
|
|
3745
3754
|
"description": "Whether the button should be disabled",
|
|
3746
3755
|
"default": false
|
|
3756
|
+
},
|
|
3757
|
+
"type": {
|
|
3758
|
+
"type": "string",
|
|
3759
|
+
"title": "Button Type",
|
|
3760
|
+
"enum": [
|
|
3761
|
+
"button",
|
|
3762
|
+
"submit",
|
|
3763
|
+
"reset"
|
|
3764
|
+
]
|
|
3747
3765
|
}
|
|
3748
3766
|
},
|
|
3749
3767
|
"additionalProperties": false,
|
|
@@ -6568,6 +6586,15 @@
|
|
|
6568
6586
|
"title": "Disabled?",
|
|
6569
6587
|
"description": "Whether the button should be disabled",
|
|
6570
6588
|
"default": false
|
|
6589
|
+
},
|
|
6590
|
+
"type": {
|
|
6591
|
+
"type": "string",
|
|
6592
|
+
"title": "Button Type",
|
|
6593
|
+
"enum": [
|
|
6594
|
+
"button",
|
|
6595
|
+
"submit",
|
|
6596
|
+
"reset"
|
|
6597
|
+
]
|
|
6571
6598
|
}
|
|
6572
6599
|
},
|
|
6573
6600
|
"additionalProperties": false,
|
|
@@ -9526,6 +9553,15 @@
|
|
|
9526
9553
|
"title": "Disabled?",
|
|
9527
9554
|
"description": "Whether the button should be disabled",
|
|
9528
9555
|
"default": false
|
|
9556
|
+
},
|
|
9557
|
+
"type": {
|
|
9558
|
+
"type": "string",
|
|
9559
|
+
"title": "Button Type",
|
|
9560
|
+
"enum": [
|
|
9561
|
+
"button",
|
|
9562
|
+
"submit",
|
|
9563
|
+
"reset"
|
|
9564
|
+
]
|
|
9529
9565
|
}
|
|
9530
9566
|
},
|
|
9531
9567
|
"additionalProperties": false,
|
|
@@ -12350,6 +12386,15 @@
|
|
|
12350
12386
|
"title": "Disabled?",
|
|
12351
12387
|
"description": "Whether the button should be disabled",
|
|
12352
12388
|
"default": false
|
|
12389
|
+
},
|
|
12390
|
+
"type": {
|
|
12391
|
+
"type": "string",
|
|
12392
|
+
"title": "Button Type",
|
|
12393
|
+
"enum": [
|
|
12394
|
+
"button",
|
|
12395
|
+
"submit",
|
|
12396
|
+
"reset"
|
|
12397
|
+
]
|
|
12353
12398
|
}
|
|
12354
12399
|
},
|
|
12355
12400
|
"additionalProperties": false,
|
|
@@ -14881,6 +14926,15 @@
|
|
|
14881
14926
|
"title": "Disabled?",
|
|
14882
14927
|
"description": "Whether the button should be disabled",
|
|
14883
14928
|
"default": false
|
|
14929
|
+
},
|
|
14930
|
+
"type": {
|
|
14931
|
+
"type": "string",
|
|
14932
|
+
"title": "Button Type",
|
|
14933
|
+
"enum": [
|
|
14934
|
+
"button",
|
|
14935
|
+
"submit",
|
|
14936
|
+
"reset"
|
|
14937
|
+
]
|
|
14884
14938
|
}
|
|
14885
14939
|
},
|
|
14886
14940
|
"additionalProperties": false,
|
|
@@ -1579,6 +1579,15 @@
|
|
|
1579
1579
|
"title": "Disabled?",
|
|
1580
1580
|
"description": "Whether the button should be disabled",
|
|
1581
1581
|
"default": false
|
|
1582
|
+
},
|
|
1583
|
+
"type": {
|
|
1584
|
+
"type": "string",
|
|
1585
|
+
"title": "Button Type",
|
|
1586
|
+
"enum": [
|
|
1587
|
+
"button",
|
|
1588
|
+
"submit",
|
|
1589
|
+
"reset"
|
|
1590
|
+
]
|
|
1582
1591
|
}
|
|
1583
1592
|
},
|
|
1584
1593
|
"additionalProperties": false,
|
|
@@ -4016,6 +4025,15 @@
|
|
|
4016
4025
|
"title": "Disabled?",
|
|
4017
4026
|
"description": "Whether the button should be disabled",
|
|
4018
4027
|
"default": false
|
|
4028
|
+
},
|
|
4029
|
+
"type": {
|
|
4030
|
+
"type": "string",
|
|
4031
|
+
"title": "Button Type",
|
|
4032
|
+
"enum": [
|
|
4033
|
+
"button",
|
|
4034
|
+
"submit",
|
|
4035
|
+
"reset"
|
|
4036
|
+
]
|
|
4019
4037
|
}
|
|
4020
4038
|
},
|
|
4021
4039
|
"additionalProperties": false,
|
|
@@ -6840,6 +6858,15 @@
|
|
|
6840
6858
|
"title": "Disabled?",
|
|
6841
6859
|
"description": "Whether the button should be disabled",
|
|
6842
6860
|
"default": false
|
|
6861
|
+
},
|
|
6862
|
+
"type": {
|
|
6863
|
+
"type": "string",
|
|
6864
|
+
"title": "Button Type",
|
|
6865
|
+
"enum": [
|
|
6866
|
+
"button",
|
|
6867
|
+
"submit",
|
|
6868
|
+
"reset"
|
|
6869
|
+
]
|
|
6843
6870
|
}
|
|
6844
6871
|
},
|
|
6845
6872
|
"additionalProperties": false,
|
|
@@ -9798,6 +9825,15 @@
|
|
|
9798
9825
|
"title": "Disabled?",
|
|
9799
9826
|
"description": "Whether the button should be disabled",
|
|
9800
9827
|
"default": false
|
|
9828
|
+
},
|
|
9829
|
+
"type": {
|
|
9830
|
+
"type": "string",
|
|
9831
|
+
"title": "Button Type",
|
|
9832
|
+
"enum": [
|
|
9833
|
+
"button",
|
|
9834
|
+
"submit",
|
|
9835
|
+
"reset"
|
|
9836
|
+
]
|
|
9801
9837
|
}
|
|
9802
9838
|
},
|
|
9803
9839
|
"additionalProperties": false,
|
|
@@ -12622,6 +12658,15 @@
|
|
|
12622
12658
|
"title": "Disabled?",
|
|
12623
12659
|
"description": "Whether the button should be disabled",
|
|
12624
12660
|
"default": false
|
|
12661
|
+
},
|
|
12662
|
+
"type": {
|
|
12663
|
+
"type": "string",
|
|
12664
|
+
"title": "Button Type",
|
|
12665
|
+
"enum": [
|
|
12666
|
+
"button",
|
|
12667
|
+
"submit",
|
|
12668
|
+
"reset"
|
|
12669
|
+
]
|
|
12625
12670
|
}
|
|
12626
12671
|
},
|
|
12627
12672
|
"additionalProperties": false,
|
|
@@ -15153,6 +15198,15 @@
|
|
|
15153
15198
|
"title": "Disabled?",
|
|
15154
15199
|
"description": "Whether the button should be disabled",
|
|
15155
15200
|
"default": false
|
|
15201
|
+
},
|
|
15202
|
+
"type": {
|
|
15203
|
+
"type": "string",
|
|
15204
|
+
"title": "Button Type",
|
|
15205
|
+
"enum": [
|
|
15206
|
+
"button",
|
|
15207
|
+
"submit",
|
|
15208
|
+
"reset"
|
|
15209
|
+
]
|
|
15156
15210
|
}
|
|
15157
15211
|
},
|
|
15158
15212
|
"additionalProperties": false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlogPostProps } from "../../BlogPostProps-
|
|
1
|
+
import { BlogPostProps } from "../../BlogPostProps-6b3cff22.js";
|
|
2
2
|
import { FC, PropsWithChildren } from "react";
|
|
3
3
|
declare const BlogPost: FC<PropsWithChildren<BlogPostProps>>;
|
|
4
4
|
export type { BlogPostProps };
|
|
@@ -52,6 +52,15 @@
|
|
|
52
52
|
"title": "Disabled?",
|
|
53
53
|
"description": "Whether the button should be disabled",
|
|
54
54
|
"default": false
|
|
55
|
+
},
|
|
56
|
+
"type": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"title": "Button Type",
|
|
59
|
+
"enum": [
|
|
60
|
+
"button",
|
|
61
|
+
"submit",
|
|
62
|
+
"reset"
|
|
63
|
+
]
|
|
55
64
|
}
|
|
56
65
|
},
|
|
57
66
|
"additionalProperties": false,
|
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
"title": "Disabled?",
|
|
43
43
|
"description": "Whether the button should be disabled",
|
|
44
44
|
"default": false
|
|
45
|
+
},
|
|
46
|
+
"type": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"title": "Button Type",
|
|
49
|
+
"enum": ["button", "submit", "reset"]
|
|
45
50
|
}
|
|
46
51
|
},
|
|
47
52
|
"additionalProperties": false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { HTMLAttributes, FC, PropsWithChildren } from "react";
|
|
3
|
-
import { ButtonProps } from "../../ButtonProps-
|
|
3
|
+
import { ButtonProps } from "../../ButtonProps-4e2b2ecf.js";
|
|
4
4
|
declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
5
5
|
declare const ButtonProvider: FC<PropsWithChildren>;
|
|
6
6
|
export type { ButtonProps };
|
|
@@ -62,6 +62,15 @@
|
|
|
62
62
|
"title": "Disabled?",
|
|
63
63
|
"description": "Whether the button should be disabled",
|
|
64
64
|
"default": false
|
|
65
|
+
},
|
|
66
|
+
"type": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"title": "Button Type",
|
|
69
|
+
"enum": [
|
|
70
|
+
"button",
|
|
71
|
+
"submit",
|
|
72
|
+
"reset"
|
|
73
|
+
]
|
|
65
74
|
}
|
|
66
75
|
},
|
|
67
76
|
"additionalProperties": false,
|
|
@@ -6,7 +6,7 @@ import { FC, PropsWithChildren } from "react";
|
|
|
6
6
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
7
7
|
* and run json-schema-to-typescript to regenerate this file.
|
|
8
8
|
*/
|
|
9
|
-
import { ButtonProps } from "../../ButtonProps-
|
|
9
|
+
import { ButtonProps } from "../../ButtonProps-4e2b2ecf.js";
|
|
10
10
|
/**
|
|
11
11
|
* Buttons of the Button Group
|
|
12
12
|
*/
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { define } from '@kickstartds/core/lib/component';
|
|
2
|
+
import CookieConsent from './CookieConsent.client.js';
|
|
3
|
+
|
|
4
|
+
const translate = (elements, state) => {
|
|
5
|
+
const translations = state.translationConfig.translations[state.translationConfig.defaultLanguage];
|
|
6
|
+
// Notice
|
|
7
|
+
elements.notice.title.textContent = translations.cookieBanner.title;
|
|
8
|
+
elements.notice.description.textContent =
|
|
9
|
+
translations.cookieBanner.description;
|
|
10
|
+
elements.notice.customizeBtn.textContent = translations.common.customize;
|
|
11
|
+
elements.notice.rejectAllBtn.textContent = translations.common.rejectAll;
|
|
12
|
+
elements.notice.acceptAllBtn.textContent = translations.common.acceptAll;
|
|
13
|
+
// Dialog
|
|
14
|
+
elements.dialog.title.textContent = translations.consentManagerDialog.title;
|
|
15
|
+
elements.dialog.description.textContent =
|
|
16
|
+
translations.consentManagerDialog.description;
|
|
17
|
+
elements.dialog.activateAllBtn.textContent = translations.common.acceptAll;
|
|
18
|
+
elements.dialog.deactivateAllBtn.textContent = translations.common.rejectAll;
|
|
19
|
+
elements.dialog.saveBtn.textContent = translations.common.save;
|
|
20
|
+
for (const option of elements.dialog.form.querySelectorAll(".dsa-cookie-consent-dialogue__option")) {
|
|
21
|
+
const type = option.dataset.consentType;
|
|
22
|
+
const translation = translations.consentTypes[type];
|
|
23
|
+
if (translation) {
|
|
24
|
+
option.querySelector(".dsa-headline__inner").textContent =
|
|
25
|
+
translation.title;
|
|
26
|
+
option.querySelector(".dsa-cookie-consent-dialogue__option-description").textContent = translation.description;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
class CookieConsentC15t extends CookieConsent {
|
|
31
|
+
constructor(element) {
|
|
32
|
+
super(element);
|
|
33
|
+
const store = this.constructor.store;
|
|
34
|
+
const elements = this.elements;
|
|
35
|
+
// get gdprTypes from radio buttons
|
|
36
|
+
const initialState = store.getState();
|
|
37
|
+
const gdprTypes = [];
|
|
38
|
+
for (const element of elements.dialog.form.elements) {
|
|
39
|
+
if (element.type === "radio" && element.value === "accept") {
|
|
40
|
+
gdprTypes.push(element.name);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
initialState.setGdprTypes(gdprTypes);
|
|
44
|
+
const update = (state) => {
|
|
45
|
+
// show/hide cookie banner or settings button
|
|
46
|
+
this.showNotice = state.showPopup;
|
|
47
|
+
// update dialog form
|
|
48
|
+
for (const type in state.consents) {
|
|
49
|
+
const radios = elements.dialog.form.elements[type];
|
|
50
|
+
const accepted = state.consents[type];
|
|
51
|
+
if (radios) {
|
|
52
|
+
for (const radio of radios) {
|
|
53
|
+
radio.defaultChecked =
|
|
54
|
+
radio.value === "accept" ? accepted : !accepted;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const unsub = store.subscribe(update);
|
|
60
|
+
translate(this.elements, initialState);
|
|
61
|
+
update(initialState);
|
|
62
|
+
const acceptCustom = () => {
|
|
63
|
+
const state = store.getState();
|
|
64
|
+
const consentTypes = state.getDisplayedConsents();
|
|
65
|
+
for (const type of consentTypes) {
|
|
66
|
+
if (!type.disabled) {
|
|
67
|
+
state.setConsent(type.name, elements.dialog.form.elements[type.name].value === "accept");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
state.saveConsents("custom");
|
|
71
|
+
};
|
|
72
|
+
const acceptAll = () => {
|
|
73
|
+
const state = store.getState();
|
|
74
|
+
state.saveConsents("all");
|
|
75
|
+
};
|
|
76
|
+
const rejectAll = () => {
|
|
77
|
+
const state = store.getState();
|
|
78
|
+
state.saveConsents("necessary");
|
|
79
|
+
};
|
|
80
|
+
elements.dialog.form.addEventListener("submit", acceptCustom);
|
|
81
|
+
elements.notice.acceptAllBtn.addEventListener("click", acceptAll);
|
|
82
|
+
elements.notice.rejectAllBtn.addEventListener("click", rejectAll);
|
|
83
|
+
this.onDisconnect(() => {
|
|
84
|
+
unsub();
|
|
85
|
+
elements.dialog.form.removeEventListener("submit", acceptCustom);
|
|
86
|
+
elements.notice.acceptAllBtn.removeEventListener("click", acceptAll);
|
|
87
|
+
elements.notice.rejectAllBtn.removeEventListener("click", rejectAll);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
CookieConsentC15t.identifier = "dsa.cookie-consent.c15t";
|
|
92
|
+
define(CookieConsentC15t.identifier, CookieConsentC15t);
|
|
93
|
+
|
|
94
|
+
export { CookieConsentC15t as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare class CookieConsent {
|
|
2
|
+
static identifier: string;
|
|
3
|
+
constructor(element: any);
|
|
4
|
+
elements: {
|
|
5
|
+
notice: {
|
|
6
|
+
wrapper: any;
|
|
7
|
+
title: any;
|
|
8
|
+
description: any;
|
|
9
|
+
customizeBtn: any;
|
|
10
|
+
rejectAllBtn: any;
|
|
11
|
+
acceptAllBtn: any;
|
|
12
|
+
};
|
|
13
|
+
dialog: {
|
|
14
|
+
wrapper: any;
|
|
15
|
+
overlay: any;
|
|
16
|
+
title: any;
|
|
17
|
+
description: any;
|
|
18
|
+
closeBtn: any;
|
|
19
|
+
form: any;
|
|
20
|
+
activateAllBtn: any;
|
|
21
|
+
deactivateAllBtn: any;
|
|
22
|
+
saveBtn: any;
|
|
23
|
+
};
|
|
24
|
+
settings: {
|
|
25
|
+
button: any;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
set showNotice(arg: any);
|
|
29
|
+
}
|
|
30
|
+
export { CookieConsent as default };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { define, Component } from '@kickstartds/core/lib/component';
|
|
2
|
+
|
|
3
|
+
class CookieConsent extends Component {
|
|
4
|
+
constructor(element) {
|
|
5
|
+
super(element);
|
|
6
|
+
const $ = element.querySelector.bind(element);
|
|
7
|
+
const elements = (this.elements = {
|
|
8
|
+
notice: {
|
|
9
|
+
wrapper: $(".dsa-cookie-consent-notice"),
|
|
10
|
+
title: $(".dsa-cookie-consent-notice__title .dsa-headline__inner"),
|
|
11
|
+
description: $(".dsa-cookie-consent-notice__description"),
|
|
12
|
+
customizeBtn: $(".dsa-cookie-consent-notice__button--customize"),
|
|
13
|
+
rejectAllBtn: $(".dsa-cookie-consent-notice__button--reject"),
|
|
14
|
+
acceptAllBtn: $(".dsa-cookie-consent-notice__button--accept"),
|
|
15
|
+
},
|
|
16
|
+
dialog: {
|
|
17
|
+
wrapper: $(".dsa-cookie-consent-dialogue"),
|
|
18
|
+
overlay: $(".dsa-cookie-consent-overlay"),
|
|
19
|
+
title: $(".dsa-cookie-consent-dialogue__title .dsa-headline__inner"),
|
|
20
|
+
description: $(".dsa-cookie-consent-dialogue__description"),
|
|
21
|
+
closeBtn: $(".dsa-cookie-consent-dialogue__close"),
|
|
22
|
+
form: $(".dsa-cookie-consent-dialogue__form"),
|
|
23
|
+
activateAllBtn: $(".dsa-cookie-consent-dialogue__button--activate-all"),
|
|
24
|
+
deactivateAllBtn: $(".dsa-cookie-consent-dialogue__button--deactivate-all"),
|
|
25
|
+
saveBtn: $(".dsa-cookie-consent-dialogue__button--save"),
|
|
26
|
+
},
|
|
27
|
+
settings: {
|
|
28
|
+
button: $(".dsa-cookie-consent-revisit"),
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const showDialog = () => {
|
|
32
|
+
elements.dialog.overlay.removeAttribute("hidden");
|
|
33
|
+
elements.dialog.wrapper.removeAttribute("hidden");
|
|
34
|
+
elements.dialog.wrapper.setAttribute("aria-hidden", "false");
|
|
35
|
+
};
|
|
36
|
+
const closeDialog = () => {
|
|
37
|
+
elements.dialog.overlay.setAttribute("hidden", "");
|
|
38
|
+
elements.dialog.wrapper.setAttribute("hidden", "");
|
|
39
|
+
elements.dialog.wrapper.setAttribute("aria-hidden", "true");
|
|
40
|
+
};
|
|
41
|
+
const closeDialogAndReset = () => {
|
|
42
|
+
closeDialog();
|
|
43
|
+
elements.dialog.form.reset();
|
|
44
|
+
};
|
|
45
|
+
const activateAll = () => {
|
|
46
|
+
for (const element of elements.dialog.form.elements) {
|
|
47
|
+
if (element.value === "accept") {
|
|
48
|
+
element.checked = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const deactivateAll = () => {
|
|
53
|
+
for (const element of elements.dialog.form.elements) {
|
|
54
|
+
if (element.value === "reject") {
|
|
55
|
+
element.checked = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const onSubmit = (event) => {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
closeDialog();
|
|
62
|
+
};
|
|
63
|
+
elements.notice.customizeBtn.addEventListener("click", showDialog);
|
|
64
|
+
elements.settings.button.addEventListener("click", showDialog);
|
|
65
|
+
elements.dialog.closeBtn.addEventListener("click", closeDialogAndReset);
|
|
66
|
+
elements.dialog.activateAllBtn.addEventListener("click", activateAll);
|
|
67
|
+
elements.dialog.deactivateAllBtn.addEventListener("click", deactivateAll);
|
|
68
|
+
elements.dialog.form.addEventListener("submit", onSubmit);
|
|
69
|
+
window._ks.radio.on(CookieConsent.identifier + ".showNotice", (_, value) => {
|
|
70
|
+
this.showNotice = value;
|
|
71
|
+
});
|
|
72
|
+
this.onDisconnect(() => {
|
|
73
|
+
elements.notice.customizeBtn.removeEventListener("click", showDialog);
|
|
74
|
+
elements.settings.button.removeEventListener("click", showDialog);
|
|
75
|
+
elements.dialog.closeBtn.removeEventListener("click", closeDialogAndReset);
|
|
76
|
+
elements.dialog.activateAllBtn.removeEventListener("click", activateAll);
|
|
77
|
+
elements.dialog.deactivateAllBtn.removeEventListener("click", deactivateAll);
|
|
78
|
+
elements.dialog.form.removeEventListener("submit", onSubmit);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
set showNotice(value) {
|
|
82
|
+
this.elements.notice.wrapper.hidden = !value;
|
|
83
|
+
this.elements.settings.button.hidden = value;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
CookieConsent.identifier = "dsa.cookie-consent";
|
|
87
|
+
define(CookieConsent.identifier, CookieConsent);
|
|
88
|
+
|
|
89
|
+
export { CookieConsent as default };
|
|
@@ -188,7 +188,14 @@
|
|
|
188
188
|
border-radius: var(--ks-border-radius-circle);
|
|
189
189
|
background-color: var(--dsa-cookie-consent-dialogue__close--background-color, transparent);
|
|
190
190
|
}
|
|
191
|
+
.dsa-cookie-consent-dialogue__form {
|
|
192
|
+
flex: 1;
|
|
193
|
+
overflow-y: auto;
|
|
194
|
+
display: flex;
|
|
195
|
+
flex-direction: column;
|
|
196
|
+
}
|
|
191
197
|
.dsa-cookie-consent-dialogue__content {
|
|
198
|
+
flex: 1;
|
|
192
199
|
overflow-y: auto;
|
|
193
200
|
border-top: var(--dsa-cookie-consent-dialogue__content--border, var(--ks-border-color-interface) solid var(--ks-border-width-default));
|
|
194
201
|
border-bottom: var(--dsa-cookie-consent-dialogue__content--border, var(--ks-border-color-interface) solid var(--ks-border-width-default));
|
|
@@ -105,11 +105,6 @@
|
|
|
105
105
|
"type": "string",
|
|
106
106
|
"description": "The label for the revisit button",
|
|
107
107
|
"default": "Manage Cookies"
|
|
108
|
-
},
|
|
109
|
-
"toggle": {
|
|
110
|
-
"type": "boolean",
|
|
111
|
-
"description": "Whether the revisit button is a toggle",
|
|
112
|
-
"default": true
|
|
113
108
|
}
|
|
114
109
|
},
|
|
115
110
|
"additionalProperties": false
|
|
@@ -139,6 +134,13 @@
|
|
|
139
134
|
"items": {
|
|
140
135
|
"type": "object",
|
|
141
136
|
"properties": {
|
|
137
|
+
"key": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"title": "Internal Key",
|
|
140
|
+
"examples": [
|
|
141
|
+
"necessary"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
142
144
|
"name": {
|
|
143
145
|
"type": "string",
|
|
144
146
|
"description": "The name of the required cookie",
|
|
@@ -191,6 +193,16 @@
|
|
|
191
193
|
"items": {
|
|
192
194
|
"type": "object",
|
|
193
195
|
"properties": {
|
|
196
|
+
"key": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"title": "Internal Key",
|
|
199
|
+
"examples": [
|
|
200
|
+
"functionality",
|
|
201
|
+
"measurement",
|
|
202
|
+
"experience",
|
|
203
|
+
"marketing"
|
|
204
|
+
]
|
|
205
|
+
},
|
|
194
206
|
"name": {
|
|
195
207
|
"type": "string",
|
|
196
208
|
"description": "The name of the cookie category",
|
|
@@ -204,11 +216,6 @@
|
|
|
204
216
|
"examples": [
|
|
205
217
|
"These cookies are necessary for the website to function."
|
|
206
218
|
]
|
|
207
|
-
},
|
|
208
|
-
"checked": {
|
|
209
|
-
"type": "boolean",
|
|
210
|
-
"description": "Whether the cookie category is checked by default",
|
|
211
|
-
"default": true
|
|
212
219
|
}
|
|
213
220
|
},
|
|
214
221
|
"additionalProperties": false
|
|
@@ -237,6 +244,12 @@
|
|
|
237
244
|
}
|
|
238
245
|
},
|
|
239
246
|
"additionalProperties": false
|
|
247
|
+
},
|
|
248
|
+
"component": {
|
|
249
|
+
"title": "`ks-component` attribute",
|
|
250
|
+
"description": "Optional custom component identifier",
|
|
251
|
+
"type": "string",
|
|
252
|
+
"default": "dsa.cookie-consent"
|
|
240
253
|
}
|
|
241
254
|
},
|
|
242
255
|
"additionalProperties": false
|