@uncinc/uncinc-react-kitchen-sink 2.8.5 → 2.8.9
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/components/Cookie/Checkbox/style.scss +0 -1
- package/dist/components/GoogleConsentCookieBanner/Checkbox/index.d.ts +14 -0
- package/dist/components/GoogleConsentCookieBanner/Checkbox/index.js +29 -0
- package/dist/components/GoogleConsentCookieBanner/Checkbox/style.scss +40 -0
- package/dist/components/GoogleConsentCookieBanner/CookieCategoryContents/index.d.ts +14 -0
- package/dist/components/GoogleConsentCookieBanner/CookieCategoryContents/index.js +19 -0
- package/dist/components/GoogleConsentCookieBanner/CookieCategoryContentsPartners/index.d.ts +14 -0
- package/dist/components/GoogleConsentCookieBanner/CookieCategoryContentsPartners/index.js +23 -0
- package/dist/components/GoogleConsentCookieBanner/index.d.ts +15 -0
- package/dist/components/GoogleConsentCookieBanner/index.js +338 -0
- package/dist/components/GoogleConsentCookieBanner/style.scss +105 -0
- package/dist/components/GoogleConsentCookieBanner/types.d.ts +67 -0
- package/dist/components/GoogleConsentCookieBanner/types.js +22 -0
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/SearchKit/SearchPage/index.js +1 -1
- package/dist/components/Tag/index.d.ts +2 -2
- package/dist/config/i18next/locales/nl.json +33 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/package.json +12 -11
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ChangeEventHandler } from 'react';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
interface Props {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
subLabel?: string;
|
|
9
|
+
checked: boolean;
|
|
10
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const Checkbox: React.FC<Props>;
|
|
14
|
+
export default Checkbox;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
var Checkbox = function Checkbox(_ref) {
|
|
4
|
+
var name = _ref.name,
|
|
5
|
+
id = _ref.id,
|
|
6
|
+
value = _ref.value,
|
|
7
|
+
label = _ref.label,
|
|
8
|
+
subLabel = _ref.subLabel,
|
|
9
|
+
_ref$checked = _ref.checked,
|
|
10
|
+
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
11
|
+
onChange = _ref.onChange,
|
|
12
|
+
disabled = _ref.disabled;
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "Checkbox GoogleConsentCookieBanner__checkbox"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
16
|
+
type: "checkbox",
|
|
17
|
+
className: "Checkbox__input",
|
|
18
|
+
name: name,
|
|
19
|
+
id: id,
|
|
20
|
+
value: value,
|
|
21
|
+
checked: checked,
|
|
22
|
+
onChange: onChange,
|
|
23
|
+
disabled: disabled
|
|
24
|
+
}), /*#__PURE__*/React.createElement("label", {
|
|
25
|
+
htmlFor: id,
|
|
26
|
+
className: "icon-before icon-checkmark"
|
|
27
|
+
}, label, " ", /*#__PURE__*/React.createElement("span", null, subLabel)));
|
|
28
|
+
};
|
|
29
|
+
export default Checkbox;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@import '../../../styles/assets/mixins';
|
|
2
|
+
@import '../../../styles/assets/variables';
|
|
3
|
+
|
|
4
|
+
// Radio's and checkboxes
|
|
5
|
+
.GoogleConsentCookieBanner {
|
|
6
|
+
|
|
7
|
+
&__checkbox {
|
|
8
|
+
label span {
|
|
9
|
+
font-size: 1.4rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
input[type='checkbox'] {
|
|
13
|
+
position: absolute;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
|
|
16
|
+
// Unchecked
|
|
17
|
+
~ label:not(.no-styling) {
|
|
18
|
+
position: relative;
|
|
19
|
+
display: inline-block;
|
|
20
|
+
user-select: none;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
|
|
26
|
+
&:before {
|
|
27
|
+
background-position-y: -1em;
|
|
28
|
+
font-size: 1.8rem;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Checked
|
|
33
|
+
&:checked ~ label:not(.no-styling) {
|
|
34
|
+
&:before {
|
|
35
|
+
background-position-y: 0em;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CookieInformation {
|
|
3
|
+
title: string;
|
|
4
|
+
duration: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CookieCategoryContentsProps {
|
|
8
|
+
cookies: Array<CookieInformation>;
|
|
9
|
+
cookieNameLabel?: string;
|
|
10
|
+
durationLabel?: string;
|
|
11
|
+
descriptionLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const CookieCategoryContents: React.FC<CookieCategoryContentsProps>;
|
|
14
|
+
export default CookieCategoryContents;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var CookieCategoryContents = function CookieCategoryContents(_ref) {
|
|
3
|
+
var _ref$cookies = _ref.cookies,
|
|
4
|
+
cookies = _ref$cookies === void 0 ? [] : _ref$cookies,
|
|
5
|
+
_ref$cookieNameLabel = _ref.cookieNameLabel,
|
|
6
|
+
cookieNameLabel = _ref$cookieNameLabel === void 0 ? 'Cookie' : _ref$cookieNameLabel,
|
|
7
|
+
_ref$durationLabel = _ref.durationLabel,
|
|
8
|
+
durationLabel = _ref$durationLabel === void 0 ? 'Looptijd' : _ref$durationLabel,
|
|
9
|
+
_ref$descriptionLabel = _ref.descriptionLabel,
|
|
10
|
+
descriptionLabel = _ref$descriptionLabel === void 0 ? 'Beschrijving' : _ref$descriptionLabel;
|
|
11
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
12
|
+
className: "CookieCategoryContents"
|
|
13
|
+
}, cookies.map(function (cookie) {
|
|
14
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
15
|
+
key: "cookie-description-".concat(cookie.title)
|
|
16
|
+
}, /*#__PURE__*/React.createElement("h3", null, cookieNameLabel), /*#__PURE__*/React.createElement("p", null, cookie.title), /*#__PURE__*/React.createElement("h3", null, durationLabel), /*#__PURE__*/React.createElement("p", null, cookie.duration), /*#__PURE__*/React.createElement("h3", null, descriptionLabel), /*#__PURE__*/React.createElement("p", null, cookie.description));
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
export default CookieCategoryContents;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PartnerInformation {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
privacyPolicy: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CookieCategoryContentsProps {
|
|
8
|
+
partners: Array<PartnerInformation>;
|
|
9
|
+
partnerNameLabel?: string;
|
|
10
|
+
descriptionLabel?: string;
|
|
11
|
+
privacyPolicyLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const CookieCategoryContentsPartners: React.FC<CookieCategoryContentsProps>;
|
|
14
|
+
export default CookieCategoryContentsPartners;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var CookieCategoryContentsPartners = function CookieCategoryContentsPartners(_ref) {
|
|
3
|
+
var _ref$partners = _ref.partners,
|
|
4
|
+
partners = _ref$partners === void 0 ? [] : _ref$partners,
|
|
5
|
+
_ref$partnerNameLabel = _ref.partnerNameLabel,
|
|
6
|
+
partnerNameLabel = _ref$partnerNameLabel === void 0 ? 'Partner' : _ref$partnerNameLabel,
|
|
7
|
+
_ref$descriptionLabel = _ref.descriptionLabel,
|
|
8
|
+
descriptionLabel = _ref$descriptionLabel === void 0 ? 'Beschrijving' : _ref$descriptionLabel,
|
|
9
|
+
_ref$privacyPolicyLab = _ref.privacyPolicyLabel,
|
|
10
|
+
privacyPolicyLabel = _ref$privacyPolicyLab === void 0 ? 'Privacy Policy' : _ref$privacyPolicyLab;
|
|
11
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
12
|
+
className: "CookieCategoryContents"
|
|
13
|
+
}, partners.map(function (partner) {
|
|
14
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
15
|
+
key: "partner-description-".concat(partner.name)
|
|
16
|
+
}, /*#__PURE__*/React.createElement("h3", null, partnerNameLabel), /*#__PURE__*/React.createElement("p", null, partner.name), /*#__PURE__*/React.createElement("h3", null, descriptionLabel), /*#__PURE__*/React.createElement("p", null, partner.description), /*#__PURE__*/React.createElement("a", {
|
|
17
|
+
href: partner.privacyPolicy,
|
|
18
|
+
rel: "noreferrer",
|
|
19
|
+
target: "_blank"
|
|
20
|
+
}, privacyPolicyLabel));
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
export default CookieCategoryContentsPartners;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
import { CookieCompliancePopupProps } from './types';
|
|
4
|
+
export declare const COOKIE_CONSENT_CATEGORIES = "cookie_consent_categories";
|
|
5
|
+
export declare const COOKIE_CONSENT_STATE = "cookie_consent_state";
|
|
6
|
+
export declare const DEFAULT_COOKIE_EXPIRATION_DAYS = 365;
|
|
7
|
+
export declare const CONSENT_UPDATE_EVENT = "consentUpdate";
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
dataLayer: any;
|
|
11
|
+
gtag: any;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
declare const CookieCompliancePopup: React.FC<CookieCompliancePopupProps>;
|
|
15
|
+
export default CookieCompliancePopup;
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useEffect, useState } from 'react';
|
|
14
|
+
import useCookie from 'react-use-cookie';
|
|
15
|
+
import Cookies from 'js-cookie';
|
|
16
|
+
import classNames from 'classnames';
|
|
17
|
+
import { useTranslation } from 'react-i18next';
|
|
18
|
+
import Accordion from '../Accordion';
|
|
19
|
+
import AccordionItemVariant from '../Accordion/AccordionItemVariant';
|
|
20
|
+
import Button from '../Button';
|
|
21
|
+
import Container from '../Layout/Container';
|
|
22
|
+
import Checkbox from './Checkbox';
|
|
23
|
+
import './style.scss';
|
|
24
|
+
import { LocalConsentStatus, AvailableConsentPermissions } from './types';
|
|
25
|
+
export var COOKIE_CONSENT_CATEGORIES = 'cookie_consent_categories';
|
|
26
|
+
export var COOKIE_CONSENT_STATE = 'cookie_consent_state';
|
|
27
|
+
export var DEFAULT_COOKIE_EXPIRATION_DAYS = 365;
|
|
28
|
+
export var CONSENT_UPDATE_EVENT = 'consentUpdate';
|
|
29
|
+
var CookieCompliancePopup = function CookieCompliancePopup(props) {
|
|
30
|
+
var _useTranslation = useTranslation(),
|
|
31
|
+
t = _useTranslation.t;
|
|
32
|
+
var className = props.className,
|
|
33
|
+
children = props.children,
|
|
34
|
+
_props$title = props.title,
|
|
35
|
+
title = _props$title === void 0 ? t('cookies.title') : _props$title,
|
|
36
|
+
_props$manualText = props.manualText,
|
|
37
|
+
manualText = _props$manualText === void 0 ? t('cookies.manual') : _props$manualText,
|
|
38
|
+
_props$acceptAllText = props.acceptAllText,
|
|
39
|
+
acceptAllText = _props$acceptAllText === void 0 ? t('cookies.acceptAll') : _props$acceptAllText,
|
|
40
|
+
_props$acceptSelectio = props.acceptSelectionText,
|
|
41
|
+
acceptSelectionText = _props$acceptSelectio === void 0 ? t('cookies.acceptSelection') : _props$acceptSelectio,
|
|
42
|
+
_props$onlyNecessaryT = props.onlyNecessaryText,
|
|
43
|
+
onlyNecessaryText = _props$onlyNecessaryT === void 0 ? t('cookies.acceptOnlyNecessary') : _props$onlyNecessaryT,
|
|
44
|
+
_props$cookieContents = props.cookieContentsShowMore,
|
|
45
|
+
cookieContentsShowMore = _props$cookieContents === void 0 ? /*#__PURE__*/React.createElement("div", null, t('cookies.showDetails')) : _props$cookieContents,
|
|
46
|
+
_props$cookieContents2 = props.cookieContentsShowLess,
|
|
47
|
+
cookieContentsShowLess = _props$cookieContents2 === void 0 ? /*#__PURE__*/React.createElement("div", null, t('cookies.hideDetails')) : _props$cookieContents2,
|
|
48
|
+
_props$showAcceptOnly = props.showAcceptOnlyNeeded,
|
|
49
|
+
showAcceptOnlyNeeded = _props$showAcceptOnly === void 0 ? true : _props$showAcceptOnly,
|
|
50
|
+
_props$onAgree = props.onAgree,
|
|
51
|
+
onAgree = _props$onAgree === void 0 ? function () {} : _props$onAgree,
|
|
52
|
+
_props$cookieLevels = props.cookieLevels,
|
|
53
|
+
cookieLevels = _props$cookieLevels === void 0 ? [{
|
|
54
|
+
value: 'necessary',
|
|
55
|
+
label: t('cookies.categories.necessary.label'),
|
|
56
|
+
subLabel: t('cookies.categories.necessary.subLabel'),
|
|
57
|
+
description: t('cookies.categories.necessary.description'),
|
|
58
|
+
disabled: true,
|
|
59
|
+
consentOptions: ['security_storage']
|
|
60
|
+
}, {
|
|
61
|
+
value: 'preferences',
|
|
62
|
+
label: t('cookies.categories.preferences.label'),
|
|
63
|
+
description: t('cookies.categories.preferences.description'),
|
|
64
|
+
disabled: false,
|
|
65
|
+
consentOptions: ['functionality_storage', 'personalization_storage']
|
|
66
|
+
}, {
|
|
67
|
+
value: 'statistics',
|
|
68
|
+
label: t('cookies.categories.statistics.label'),
|
|
69
|
+
description: t('cookies.categories.statistics.description'),
|
|
70
|
+
disabled: false,
|
|
71
|
+
consentOptions: ['analytics_storage']
|
|
72
|
+
}, {
|
|
73
|
+
value: 'marketing',
|
|
74
|
+
label: t('cookies.categories.marketing.label'),
|
|
75
|
+
description: t('cookies.categories.marketing.description'),
|
|
76
|
+
disabled: false,
|
|
77
|
+
consentOptions: ['ad_personalization', 'ad_user_data', 'ad_storage']
|
|
78
|
+
}] : _props$cookieLevels,
|
|
79
|
+
_props$cookieOptions = props.cookieOptions,
|
|
80
|
+
cookieOptions = _props$cookieOptions === void 0 ? {
|
|
81
|
+
days: DEFAULT_COOKIE_EXPIRATION_DAYS,
|
|
82
|
+
path: '/'
|
|
83
|
+
} : _props$cookieOptions,
|
|
84
|
+
_props$version = props.version,
|
|
85
|
+
version = _props$version === void 0 ? '1.0.0' : _props$version,
|
|
86
|
+
_props$cookieDomain = props.cookieDomain,
|
|
87
|
+
cookieDomain = _props$cookieDomain === void 0 ? null : _props$cookieDomain,
|
|
88
|
+
_props$defaultValues = props.defaultValues,
|
|
89
|
+
defaultValues = _props$defaultValues === void 0 ? {
|
|
90
|
+
necessary: true,
|
|
91
|
+
preferences: false,
|
|
92
|
+
statistics: false,
|
|
93
|
+
marketing: false
|
|
94
|
+
} : _props$defaultValues,
|
|
95
|
+
_props$manualHeader = props.manualHeader,
|
|
96
|
+
manualHeader = _props$manualHeader === void 0 ? '' : _props$manualHeader,
|
|
97
|
+
_props$manualButtonCl = props.manualButtonClassname,
|
|
98
|
+
manualButtonClassname = _props$manualButtonCl === void 0 ? 'Button' : _props$manualButtonCl;
|
|
99
|
+
if (!window.dataLayer) {
|
|
100
|
+
window.dataLayer = window.dataLayer || [];
|
|
101
|
+
}
|
|
102
|
+
if (!window.gtag) {
|
|
103
|
+
window.gtag = function () {
|
|
104
|
+
window.dataLayer.push(arguments.length <= 0 ? undefined : arguments[0]);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// This is an internal state to check whether we should show the options.
|
|
109
|
+
var _useState = useState(false),
|
|
110
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
111
|
+
manualChoiceVisible = _useState2[0],
|
|
112
|
+
setManualChoiceVisible = _useState2[1];
|
|
113
|
+
// This is an internal state to check whether the user has answered in the current session.
|
|
114
|
+
// It is either null (because we don't know if it was already in the cookies) or true
|
|
115
|
+
var _useState3 = useState(null),
|
|
116
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
117
|
+
answeredInCurrentSession = _useState4[0],
|
|
118
|
+
setAnsweredInCurrentSession = _useState4[1];
|
|
119
|
+
|
|
120
|
+
// Cookie stating if the cookie has already been accepted. Uses the following states:
|
|
121
|
+
// null: unknown
|
|
122
|
+
// STATUS DECLINED (0 as cookie value)
|
|
123
|
+
// STATUS NOT YET ANSWERED (1 as cookie value)
|
|
124
|
+
// STATUS ACCEPTED_ALL (2 as cookie value)
|
|
125
|
+
var _useCookie = useCookie(COOKIE_CONSENT_STATE, LocalConsentStatus.STATUS_DEFAULT),
|
|
126
|
+
_useCookie2 = _slicedToArray(_useCookie, 2),
|
|
127
|
+
didConsent = _useCookie2[0],
|
|
128
|
+
setDidConsent = _useCookie2[1];
|
|
129
|
+
var categories = cookieLevels.map(function (item) {
|
|
130
|
+
return item.value;
|
|
131
|
+
});
|
|
132
|
+
var defaultState = categories.reduce(function (prev, category) {
|
|
133
|
+
// eslint-disable-next-line valid-typeof
|
|
134
|
+
var newPartialState = prev;
|
|
135
|
+
if (defaultValues[category] !== undefined) {
|
|
136
|
+
newPartialState[category] = defaultValues[category];
|
|
137
|
+
} else {
|
|
138
|
+
newPartialState[category] = true;
|
|
139
|
+
}
|
|
140
|
+
return newPartialState;
|
|
141
|
+
}, {});
|
|
142
|
+
|
|
143
|
+
// Default choices for select, this way we can locally manage the state of the form.
|
|
144
|
+
var _useState5 = useState(defaultState),
|
|
145
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
146
|
+
choicesSelected = _useState6[0],
|
|
147
|
+
setChoicesSelected = _useState6[1];
|
|
148
|
+
useEffect(function () {
|
|
149
|
+
// We now know the value of the cookie. If there is no cookie set,
|
|
150
|
+
// immediately set the didConsent state to STATUS_NOT_YET_ANSWERED.
|
|
151
|
+
if (didConsent === LocalConsentStatus.STATUS_DEFAULT) {
|
|
152
|
+
setDidConsent(JSON.stringify({
|
|
153
|
+
status: LocalConsentStatus.STATUS_NOT_YET_ANSWERED,
|
|
154
|
+
version: version
|
|
155
|
+
}), cookieOptions);
|
|
156
|
+
}
|
|
157
|
+
}, [didConsent, cookieOptions, setDidConsent]);
|
|
158
|
+
var isLoading = didConsent === undefined;
|
|
159
|
+
var didConsentContent = typeof didConsent === 'string' && didConsent.length > 0 ? JSON.parse(didConsent) : null;
|
|
160
|
+
var isPrompting = (didConsentContent === null || didConsentContent === void 0 ? void 0 : didConsentContent.status) === LocalConsentStatus.STATUS_NOT_YET_ANSWERED;
|
|
161
|
+
var isAnswered = (didConsentContent === null || didConsentContent === void 0 ? void 0 : didConsentContent.status) === LocalConsentStatus.STATUS_ACCEPTED || (didConsentContent === null || didConsentContent === void 0 ? void 0 : didConsentContent.status) === LocalConsentStatus.STATUS_ONLY_NECESSARY;
|
|
162
|
+
|
|
163
|
+
// This function expands the notification to show the options.
|
|
164
|
+
var displayConsentChoices = function displayConsentChoices(e) {
|
|
165
|
+
e.preventDefault();
|
|
166
|
+
setManualChoiceVisible(true);
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
// Build an object of passed consent, send that to google via "update"
|
|
170
|
+
// Set the cookie containing the consent categories and version
|
|
171
|
+
var handleGoogleConsent = function handleGoogleConsent() {
|
|
172
|
+
var selectedConsent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
173
|
+
var selectedCategories = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
174
|
+
var consentEventObject = {};
|
|
175
|
+
Object.values(AvailableConsentPermissions).forEach(function (consentOption) {
|
|
176
|
+
consentEventObject[consentOption] = selectedConsent.indexOf(consentOption) > -1 ? 'granted' : 'denied';
|
|
177
|
+
});
|
|
178
|
+
window.gtag('consent', 'update', consentEventObject);
|
|
179
|
+
window.gtag('event', CONSENT_UPDATE_EVENT);
|
|
180
|
+
Cookies.set(COOKIE_CONSENT_CATEGORIES, JSON.stringify({
|
|
181
|
+
categories: selectedCategories,
|
|
182
|
+
consent: consentEventObject
|
|
183
|
+
}), {
|
|
184
|
+
expires: cookieOptions.days,
|
|
185
|
+
domain: cookieDomain
|
|
186
|
+
});
|
|
187
|
+
setDidConsent(JSON.stringify({
|
|
188
|
+
status: LocalConsentStatus.STATUS_ACCEPTED,
|
|
189
|
+
version: version
|
|
190
|
+
}), cookieOptions);
|
|
191
|
+
setAnsweredInCurrentSession(true);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// On agree clicked, send consent for categories to Google
|
|
195
|
+
// Update cookie and fire agree callback
|
|
196
|
+
var onInternalAgree = function onInternalAgree(choices) {
|
|
197
|
+
var selectedCategories = Object.keys(choices).filter(function (key) {
|
|
198
|
+
return choices[key];
|
|
199
|
+
});
|
|
200
|
+
var selectedConsent = [];
|
|
201
|
+
cookieLevels.forEach(function (cookieLevel) {
|
|
202
|
+
if (selectedCategories.indexOf(cookieLevel.value) > -1) {
|
|
203
|
+
selectedConsent = selectedConsent.concat(cookieLevel.consentOptions);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
handleGoogleConsent(selectedConsent, selectedCategories);
|
|
207
|
+
onAgree({
|
|
208
|
+
selectedCategories: selectedCategories,
|
|
209
|
+
consent: selectedConsent
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// Function for accepting al categories at once.
|
|
214
|
+
var onConsentAll = function onConsentAll() {
|
|
215
|
+
var allCategoriesSelected = categories.reduce(function (prev, category) {
|
|
216
|
+
var newPartialState = prev;
|
|
217
|
+
newPartialState[category] = true;
|
|
218
|
+
return newPartialState;
|
|
219
|
+
}, {});
|
|
220
|
+
onInternalAgree(allCategoriesSelected);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
// This function is fired when the accept button is pressed.
|
|
224
|
+
// Also has eventual support for a false case.
|
|
225
|
+
var onConsent = function onConsent(onlyNecessary) {
|
|
226
|
+
return function () {
|
|
227
|
+
if (onlyNecessary === true) {
|
|
228
|
+
onInternalAgree(defaultValues);
|
|
229
|
+
} else {
|
|
230
|
+
onInternalAgree(choicesSelected);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
// This function sets the value of the checkmark in the form state.
|
|
236
|
+
var handleChoiceState = function handleChoiceState(event) {
|
|
237
|
+
var _ref = event.target,
|
|
238
|
+
value = _ref.value,
|
|
239
|
+
checked = _ref.checked;
|
|
240
|
+
setChoicesSelected(_objectSpread(_objectSpread({}, choicesSelected), {}, _defineProperty({}, value, checked)));
|
|
241
|
+
};
|
|
242
|
+
var classes = classNames('GoogleConsentCookieBanner', className, {
|
|
243
|
+
'GoogleConsentCookieBanner--prompting': isPrompting,
|
|
244
|
+
'GoogleConsentCookieBanner--loading': isLoading,
|
|
245
|
+
'GoogleConsentCookieBanner--answered': isAnswered,
|
|
246
|
+
// answering refers to the fact that the user has answered in the current session.
|
|
247
|
+
'GoogleConsentCookieBanner--answering': answeredInCurrentSession,
|
|
248
|
+
'GoogleConsentCookieBanner--hidden': isAnswered
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
// if it is answered in the current session
|
|
252
|
+
// we still render the cookie but with the --hidden modifier,
|
|
253
|
+
// allowing consumers to apply an animation if desired.
|
|
254
|
+
// In other words, don't render only if a user has
|
|
255
|
+
// answered in a previous session.
|
|
256
|
+
if (isAnswered && !answeredInCurrentSession) {
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// This function renders the different options of checkboxes,
|
|
261
|
+
// allowing us to add more checkboxes eventually.
|
|
262
|
+
var renderChoices = function renderChoices() {
|
|
263
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, cookieLevels.map(function (choice) {
|
|
264
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
265
|
+
className: "GoogleConsentCookieBanner__category",
|
|
266
|
+
key: choice.value
|
|
267
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
268
|
+
className: "CheckboxContainer"
|
|
269
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
270
|
+
name: "cookie-categories",
|
|
271
|
+
id: "cookie-category-".concat(choice.value),
|
|
272
|
+
onChange: handleChoiceState,
|
|
273
|
+
label: choice.label,
|
|
274
|
+
subLabel: choice.subLabel,
|
|
275
|
+
value: choice.value,
|
|
276
|
+
checked: choicesSelected[choice.value],
|
|
277
|
+
disabled: choice.disabled
|
|
278
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
279
|
+
className: "GoogleConsentCookieBanner__category__description"
|
|
280
|
+
}, choice.description), choice.contents && typeof choice.contents === 'function' && /*#__PURE__*/React.createElement(Accordion, null, /*#__PURE__*/React.createElement(AccordionItemVariant, {
|
|
281
|
+
title: "",
|
|
282
|
+
buttonOpened: cookieContentsShowLess,
|
|
283
|
+
buttonClosed: cookieContentsShowMore,
|
|
284
|
+
onClick: function onClick() {}
|
|
285
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
286
|
+
className: "GoogleConsentCookieBanner__category__description"
|
|
287
|
+
}, choice.contents()))));
|
|
288
|
+
}));
|
|
289
|
+
};
|
|
290
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
291
|
+
className: classes
|
|
292
|
+
}, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement("div", {
|
|
293
|
+
className: "GoogleConsentCookieBanner__content ".concat(manualChoiceVisible ? 'GoogleConsentCookieBanner__content--full-height' : '')
|
|
294
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
295
|
+
className: "row"
|
|
296
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
297
|
+
className: "col-12 GoogleConsentCookieBanner__content_header"
|
|
298
|
+
}, title && /*#__PURE__*/React.createElement("h3", null, title))), !manualChoiceVisible ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
299
|
+
className: "row"
|
|
300
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
301
|
+
className: "col-12 GoogleConsentCookieBanner__content__message"
|
|
302
|
+
}, children), /*#__PURE__*/React.createElement("div", {
|
|
303
|
+
className: "col-12 GoogleConsentCookieBanner__content__buttons"
|
|
304
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
305
|
+
id: "complete-agree",
|
|
306
|
+
className: "Button--cta",
|
|
307
|
+
primary: true,
|
|
308
|
+
onClick: onConsentAll
|
|
309
|
+
}, acceptAllText), showAcceptOnlyNeeded && /*#__PURE__*/React.createElement(Button, {
|
|
310
|
+
id: "only-necessary-agree",
|
|
311
|
+
className: "Button--cta",
|
|
312
|
+
inverted: true,
|
|
313
|
+
onClick: onConsent(true)
|
|
314
|
+
}, onlyNecessaryText), /*#__PURE__*/React.createElement("button", {
|
|
315
|
+
type: "button",
|
|
316
|
+
className: "GoogleConsentCookieBanner__content__buttons__manual GoogleConsentCookieBanner__content__buttons__manual-agree ".concat(manualButtonClassname),
|
|
317
|
+
onClick: function onClick(e) {
|
|
318
|
+
displayConsentChoices(e);
|
|
319
|
+
}
|
|
320
|
+
}, manualText)))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
321
|
+
className: "GoogleConsentCookieBanner__content__message"
|
|
322
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
323
|
+
className: "GoogleConsentCookieBanner__checkboxes-container"
|
|
324
|
+
}, manualHeader && /*#__PURE__*/React.createElement("div", {
|
|
325
|
+
className: "manualHeader"
|
|
326
|
+
}, manualHeader), renderChoices())), /*#__PURE__*/React.createElement("div", {
|
|
327
|
+
className: "GoogleConsentCookieBanner__content__buttons"
|
|
328
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
329
|
+
className: "Button--cta",
|
|
330
|
+
primary: true,
|
|
331
|
+
onClick: onConsent(false)
|
|
332
|
+
}, acceptSelectionText), /*#__PURE__*/React.createElement(Button, {
|
|
333
|
+
className: "Button--cta",
|
|
334
|
+
inverted: true,
|
|
335
|
+
onClick: onConsentAll
|
|
336
|
+
}, acceptAllText))))));
|
|
337
|
+
};
|
|
338
|
+
export default CookieCompliancePopup;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
@import '../../styles/assets/mixins';
|
|
2
|
+
@import '../../styles/assets/variables';
|
|
3
|
+
|
|
4
|
+
@keyframes slide {
|
|
5
|
+
0% {
|
|
6
|
+
transform: translateX(-50%) translateY(110vh);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
100% {
|
|
10
|
+
transform: translateX(-50%) translateY(0);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.GoogleConsentCookieBanner {
|
|
15
|
+
position: fixed;
|
|
16
|
+
z-index: 10000;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 50%;
|
|
19
|
+
width: 100%;
|
|
20
|
+
max-height: 100%;
|
|
21
|
+
|
|
22
|
+
&__content {
|
|
23
|
+
max-height: 80vh;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
|
|
27
|
+
&__message {
|
|
28
|
+
overflow-y: auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&__full-height {
|
|
32
|
+
overflow-y: scroll;
|
|
33
|
+
|
|
34
|
+
@media #{$normal} {
|
|
35
|
+
overflow-y: unset;
|
|
36
|
+
height: auto;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&__buttons {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
align-items: center;
|
|
44
|
+
|
|
45
|
+
@media #{$tablet} {
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.Button {
|
|
50
|
+
margin-right: 1rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.GoogleConsentCookieBanner__content__buttons__manual {
|
|
54
|
+
margin-right: 1rem;
|
|
55
|
+
padding: 0;
|
|
56
|
+
font-family: inherit;
|
|
57
|
+
font-size: inherit;
|
|
58
|
+
background: none;
|
|
59
|
+
border: 0;
|
|
60
|
+
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.AccordionItem {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
|
|
70
|
+
&__title__wrapper {
|
|
71
|
+
order: 2;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&__title {
|
|
76
|
+
display: none;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__category {
|
|
81
|
+
display: inline-block;
|
|
82
|
+
margin-bottom: 2rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&--hidden {
|
|
86
|
+
display: none;
|
|
87
|
+
|
|
88
|
+
&__content__full-height {
|
|
89
|
+
position: inherit;
|
|
90
|
+
top: inherit;
|
|
91
|
+
right: inherit;
|
|
92
|
+
bottom: inherit;
|
|
93
|
+
left: inherit;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--prompting {
|
|
98
|
+
transform: translateX(-50%) translateY(0);
|
|
99
|
+
animation: slide 1s forwards;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--loading {
|
|
103
|
+
transform: translateX(-50%) translateY(110vh);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare enum LocalConsentStatus {
|
|
2
|
+
STATUS_DEFAULT = "-1",
|
|
3
|
+
STATUS_ONLY_NECESSARY = "0",
|
|
4
|
+
STATUS_NOT_YET_ANSWERED = "1",
|
|
5
|
+
STATUS_ACCEPTED = "2"
|
|
6
|
+
}
|
|
7
|
+
export declare enum AvailableConsentPermissions {
|
|
8
|
+
SECURITY_STORAGE = "security_storage",
|
|
9
|
+
FUNCTIONALITY_STORAGE = "functionality_storage",
|
|
10
|
+
PERSONALISATION_STORAGE = "personalization_storage",
|
|
11
|
+
ANALYTICS_STORAGE = "analytics_storage",
|
|
12
|
+
AD_PERSONALISATION = "ad_personalization",
|
|
13
|
+
AD_USER_DATA = "ad_user_data",
|
|
14
|
+
AD_STORAGE = "ad_storage"
|
|
15
|
+
}
|
|
16
|
+
export declare enum ConsentEventOption {
|
|
17
|
+
GRANTED = "granted",
|
|
18
|
+
DENIED = "denied"
|
|
19
|
+
}
|
|
20
|
+
export interface CategoryDefaultValues extends Record<string, boolean> {
|
|
21
|
+
necessary: boolean;
|
|
22
|
+
preferences: boolean;
|
|
23
|
+
statistics: boolean;
|
|
24
|
+
marketing: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface CookieLevel {
|
|
27
|
+
value: string;
|
|
28
|
+
label: string;
|
|
29
|
+
subLabel?: string;
|
|
30
|
+
description: string;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
consentOptions: Array<AvailableConsentPermissions>;
|
|
33
|
+
contents?: Function;
|
|
34
|
+
}
|
|
35
|
+
export interface CookieOptions {
|
|
36
|
+
days: Number;
|
|
37
|
+
path: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ConsentEvent extends Record<string, string | undefined> {
|
|
40
|
+
security_storage?: ConsentEventOption;
|
|
41
|
+
functionality_storage?: ConsentEventOption;
|
|
42
|
+
personalization_storage?: ConsentEventOption;
|
|
43
|
+
analytics_storage?: ConsentEventOption;
|
|
44
|
+
ad_personalization?: ConsentEventOption;
|
|
45
|
+
ad_user_data?: ConsentEventOption;
|
|
46
|
+
ad_storage?: ConsentEventOption;
|
|
47
|
+
}
|
|
48
|
+
export interface CookieCompliancePopupProps {
|
|
49
|
+
className?: string;
|
|
50
|
+
children?: any;
|
|
51
|
+
acceptAllText?: string;
|
|
52
|
+
acceptSelectionText?: string;
|
|
53
|
+
onlyNecessaryText?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
cookieContentsShowMore?: string;
|
|
56
|
+
cookieContentsShowLess?: string;
|
|
57
|
+
manualText?: string;
|
|
58
|
+
manualHeader?: string;
|
|
59
|
+
onAgree?: Function;
|
|
60
|
+
showAcceptOnlyNeeded?: boolean;
|
|
61
|
+
manualButtonClassname?: string;
|
|
62
|
+
cookieLevels?: Array<CookieLevel>;
|
|
63
|
+
defaultValues?: CategoryDefaultValues;
|
|
64
|
+
cookieDomain?: string;
|
|
65
|
+
cookieOptions?: CookieOptions;
|
|
66
|
+
version?: string;
|
|
67
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var LocalConsentStatus = /*#__PURE__*/function (LocalConsentStatus) {
|
|
2
|
+
LocalConsentStatus["STATUS_DEFAULT"] = "-1";
|
|
3
|
+
LocalConsentStatus["STATUS_ONLY_NECESSARY"] = "0";
|
|
4
|
+
LocalConsentStatus["STATUS_NOT_YET_ANSWERED"] = "1";
|
|
5
|
+
LocalConsentStatus["STATUS_ACCEPTED"] = "2";
|
|
6
|
+
return LocalConsentStatus;
|
|
7
|
+
}({});
|
|
8
|
+
export var AvailableConsentPermissions = /*#__PURE__*/function (AvailableConsentPermissions) {
|
|
9
|
+
AvailableConsentPermissions["SECURITY_STORAGE"] = "security_storage";
|
|
10
|
+
AvailableConsentPermissions["FUNCTIONALITY_STORAGE"] = "functionality_storage";
|
|
11
|
+
AvailableConsentPermissions["PERSONALISATION_STORAGE"] = "personalization_storage";
|
|
12
|
+
AvailableConsentPermissions["ANALYTICS_STORAGE"] = "analytics_storage";
|
|
13
|
+
AvailableConsentPermissions["AD_PERSONALISATION"] = "ad_personalization";
|
|
14
|
+
AvailableConsentPermissions["AD_USER_DATA"] = "ad_user_data";
|
|
15
|
+
AvailableConsentPermissions["AD_STORAGE"] = "ad_storage";
|
|
16
|
+
return AvailableConsentPermissions;
|
|
17
|
+
}({});
|
|
18
|
+
export var ConsentEventOption = /*#__PURE__*/function (ConsentEventOption) {
|
|
19
|
+
ConsentEventOption["GRANTED"] = "granted";
|
|
20
|
+
ConsentEventOption["DENIED"] = "denied";
|
|
21
|
+
return ConsentEventOption;
|
|
22
|
+
}({});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function Pagination({ currentPage, totalPages, pageRangeDisplayed, marginPagesDisplayed, setCurrentPage, previousLabel, nextLabel, containerClassName, disabledClassName, activeClassName, breakClassName, showWhenOnePage, controlled, scrollToTop, scrollToTopOffset, scrollToTopBehavior }: {
|
|
1
|
+
export function Pagination({ currentPage, totalPages, pageRangeDisplayed, marginPagesDisplayed, setCurrentPage, previousLabel, nextLabel, containerClassName, disabledClassName, activeClassName, breakClassName, showWhenOnePage, controlled, scrollToTop, scrollToTopOffset, scrollToTopBehavior, }: {
|
|
2
2
|
currentPage: any;
|
|
3
3
|
totalPages: any;
|
|
4
4
|
pageRangeDisplayed: any;
|
|
@@ -33,7 +33,7 @@ export var routeToStateFn = function routeToStateFn(routeState) {
|
|
|
33
33
|
item.max = Number(item.max);
|
|
34
34
|
}
|
|
35
35
|
if (item.boolValue) {
|
|
36
|
-
item.boolValue = item.boolValue ==
|
|
36
|
+
item.boolValue = item.boolValue == 'true';
|
|
37
37
|
}
|
|
38
38
|
if (item.geoBoundingBox) {
|
|
39
39
|
item.geoBoundingBox.topLeft.lat = Number(item.geoBoundingBox.topLeft.lat);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './style.scss';
|
|
3
3
|
export interface TagProps {
|
|
4
|
-
name:
|
|
4
|
+
name: React.ReactNode;
|
|
5
5
|
stretchClickableArea?: boolean;
|
|
6
6
|
deleteButtonAriaLabel?: string;
|
|
7
7
|
className?: string;
|
|
8
|
-
onDelete?: (name: string) => void;
|
|
8
|
+
onDelete?: (name: string | React.ReactNode) => void;
|
|
9
9
|
link?: string;
|
|
10
10
|
onClick?: () => void;
|
|
11
11
|
target?: HTMLAnchorElement['target'];
|
|
@@ -19,6 +19,39 @@
|
|
|
19
19
|
"dec": "December"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
+
"cookie": {
|
|
23
|
+
"title": "Cookies",
|
|
24
|
+
"manual": "Zelf instellen",
|
|
25
|
+
"acceptAll": "Alles Accepteren",
|
|
26
|
+
"acceptSelection": "Accepteer selectie",
|
|
27
|
+
"acceptOnlyNecessary": "Alleen noodzakelijke",
|
|
28
|
+
"showDetails": "Show details",
|
|
29
|
+
"hideDetails": "Verberg details",
|
|
30
|
+
"contents": {
|
|
31
|
+
"partner": "Partner",
|
|
32
|
+
"description": "Beschrijving",
|
|
33
|
+
"privacyPolicy": "Privacy Policy"
|
|
34
|
+
},
|
|
35
|
+
"categories": {
|
|
36
|
+
"necessary": {
|
|
37
|
+
"label": "Noodzakelijk",
|
|
38
|
+
"subLabel": "(altijd actief)",
|
|
39
|
+
"description": "Noodzakelijke cookies helpen een website bruikbaarder te maken, door basisfuncties als paginanavigatie en toegang tot beveiligde gedeelten van de website mogelijk te maken. Zonder deze cookies kan de website niet naar behoren werken."
|
|
40
|
+
},
|
|
41
|
+
"preferences": {
|
|
42
|
+
"label": "Voorkeuren",
|
|
43
|
+
"description": "Voorkeuren cookies geven inzicht in je interesses, je acties op de website en maken het ook mogelijk een contactformulier te gebruiken."
|
|
44
|
+
},
|
|
45
|
+
"statistics": {
|
|
46
|
+
"label": "Statistieken",
|
|
47
|
+
"description": "Statistische cookies helpen ons te begrijpen hoe bezoekers de website gebruiken, door anoniem gegevens te verzamelen en te rapporteren."
|
|
48
|
+
},
|
|
49
|
+
"marketing": {
|
|
50
|
+
"label": "Marketing",
|
|
51
|
+
"description": "Marketing cookies maken het mogelijk om onze campagne resultaten te meten, zo kunnen wij gerichter adverteren en kosten besparen. \uFEFF"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
22
55
|
"form": {
|
|
23
56
|
"required": "vereist",
|
|
24
57
|
"optional": "optioneel"
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,9 @@ export { default as TitleWithText } from "./components/TitleWithText";
|
|
|
49
49
|
export { default as TableRender } from "./components/TableRender";
|
|
50
50
|
export { default as ApiAutocomplete } from "./components/ApiAutocomplete";
|
|
51
51
|
export { default as Cookie } from "./components/Cookie";
|
|
52
|
+
export { default as GoogleConsentCookieBanner } from "./components/GoogleConsentCookieBanner";
|
|
53
|
+
export { default as CookieCategoryContents } from "./components/GoogleConsentCookieBanner/CookieCategoryContents";
|
|
54
|
+
export { default as CookieCategoryContentsPartners } from "./components/GoogleConsentCookieBanner/CookieCategoryContentsPartners";
|
|
52
55
|
export { default as Downloads } from "./organisms/Downloads";
|
|
53
56
|
export { default as Header } from "./components/Header";
|
|
54
57
|
export { default as MediaPlayer } from "./components/MediaPlayer";
|
package/dist/index.js
CHANGED
|
@@ -56,6 +56,9 @@ export { default as TableRender } from './components/TableRender';
|
|
|
56
56
|
// Organisms
|
|
57
57
|
export { default as ApiAutocomplete } from './components/ApiAutocomplete';
|
|
58
58
|
export { default as Cookie } from './components/Cookie';
|
|
59
|
+
export { default as GoogleConsentCookieBanner } from './components/GoogleConsentCookieBanner';
|
|
60
|
+
export { default as CookieCategoryContents } from './components/GoogleConsentCookieBanner/CookieCategoryContents';
|
|
61
|
+
export { default as CookieCategoryContentsPartners } from './components/GoogleConsentCookieBanner/CookieCategoryContentsPartners';
|
|
59
62
|
export { default as Downloads } from './organisms/Downloads';
|
|
60
63
|
export { default as Header } from './components/Header';
|
|
61
64
|
export { default as MediaPlayer } from './components/MediaPlayer';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uncinc/uncinc-react-kitchen-sink",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.9",
|
|
4
4
|
"description": "Default React components that are easily extended.",
|
|
5
5
|
"author": "uncinc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,16 +54,6 @@
|
|
|
54
54
|
"@loadable/component": "^5.15.0",
|
|
55
55
|
"@searchkit/client": "^3.0.0",
|
|
56
56
|
"@searchkit/elastic-ui": "^3.0.0",
|
|
57
|
-
"@types/jest": "^29.5.1",
|
|
58
|
-
"@types/node": "^20.1.0",
|
|
59
|
-
"@types/react": "^18.2.6",
|
|
60
|
-
"@types/react-dom": "^18.2.4",
|
|
61
|
-
"@types/react-html-parser": "^2.0.2",
|
|
62
|
-
"@types/react-pdf": "^6",
|
|
63
|
-
"@types/react-router": "^5.1.20",
|
|
64
|
-
"@types/uuid": "^9.0.2",
|
|
65
|
-
"@types/video.js": "^7.3.52",
|
|
66
|
-
"@types/webpack-env": "^1.18.0",
|
|
67
57
|
"apollo-server-micro": "^3.4.0",
|
|
68
58
|
"bootstrap": "^4",
|
|
69
59
|
"eslint-webpack-plugin": "^2",
|
|
@@ -135,6 +125,17 @@
|
|
|
135
125
|
"@testing-library/jest-dom": "^5.11.2",
|
|
136
126
|
"@testing-library/react": "^14.0.0",
|
|
137
127
|
"@testing-library/user-event": "^7.1.2",
|
|
128
|
+
"@types/jest": "^29.5.1",
|
|
129
|
+
"@types/js-cookie": "^3.0.6",
|
|
130
|
+
"@types/node": "^20.1.0",
|
|
131
|
+
"@types/react": "^18.2.6",
|
|
132
|
+
"@types/react-dom": "^18.2.4",
|
|
133
|
+
"@types/react-html-parser": "^2.0.2",
|
|
134
|
+
"@types/react-pdf": "^6",
|
|
135
|
+
"@types/react-router": "^5.1.20",
|
|
136
|
+
"@types/uuid": "^9.0.2",
|
|
137
|
+
"@types/video.js": "^7.3.52",
|
|
138
|
+
"@types/webpack-env": "^1.18.0",
|
|
138
139
|
"@uncinc/eslint-config": "^1.1.2",
|
|
139
140
|
"@uncinc/stylelint-config": "^1.0.2",
|
|
140
141
|
"babel-jest": "^29.4.3",
|