@onsvisual/svelte-components 0.1.93 → 0.1.94-set-new-ons-cookies
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/@types/index.d.ts +1 -0
- package/dist/@types/inputs/AccessibleSelect/AccessibleSelect.svelte.d.ts +6 -6
- package/dist/@types/inputs/Button/Button.svelte.d.ts +2 -2
- package/dist/@types/inputs/Select/Select.svelte.d.ts +10 -10
- package/dist/index.js +1 -0
- package/dist/layout/AnalyticsBanner/AnalyticsBanner.svelte +6 -6
- package/package.json +1 -1
package/dist/@types/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export { default as Tabs } from "./layout/Tabs/Tabs.svelte";
|
|
|
34
34
|
export { default as Tab } from "./layout/Tabs/Tab.svelte";
|
|
35
35
|
export { default as Titleblock } from "./layout/Titleblock/Titleblock.svelte";
|
|
36
36
|
export { default as Twisty } from "./layout/Twisty/Twisty.svelte";
|
|
37
|
+
export { default as AccessibleSelect } from "./inputs/AccessibleSelect/AccessibleSelect.svelte";
|
|
37
38
|
export { default as Button } from "./inputs/Button/Button.svelte";
|
|
38
39
|
export { default as Checkbox } from "./inputs/Checkbox/Checkbox.svelte";
|
|
39
40
|
export { default as Checkboxes } from "./inputs/Checkboxes/Checkboxes.svelte";
|
|
@@ -6,15 +6,15 @@ export default class AccessibleSelect extends SvelteComponentTyped<{
|
|
|
6
6
|
label?: string;
|
|
7
7
|
mode?: "default" | "search";
|
|
8
8
|
value?: any;
|
|
9
|
+
clearable?: boolean;
|
|
10
|
+
autoClear?: boolean;
|
|
9
11
|
hideLabel?: boolean;
|
|
10
12
|
placeholder?: string;
|
|
11
13
|
options?: any[];
|
|
12
|
-
clearable?: boolean;
|
|
13
|
-
autoClear?: boolean;
|
|
14
14
|
labelKey?: string;
|
|
15
15
|
groupKey?: string;
|
|
16
|
-
loadOptions?: Function;
|
|
17
16
|
minLength?: number;
|
|
17
|
+
loadOptions?: Function;
|
|
18
18
|
scriptUrl?: string;
|
|
19
19
|
}, {
|
|
20
20
|
change: CustomEvent<any>;
|
|
@@ -32,15 +32,15 @@ declare const __propDef: {
|
|
|
32
32
|
label?: string;
|
|
33
33
|
mode?: "default" | "search";
|
|
34
34
|
value?: object;
|
|
35
|
+
clearable?: boolean;
|
|
36
|
+
autoClear?: boolean;
|
|
35
37
|
hideLabel?: boolean;
|
|
36
38
|
placeholder?: string;
|
|
37
39
|
options?: any[];
|
|
38
|
-
clearable?: boolean;
|
|
39
|
-
autoClear?: boolean;
|
|
40
40
|
labelKey?: string;
|
|
41
41
|
groupKey?: string | null;
|
|
42
|
-
loadOptions?: Function;
|
|
43
42
|
minLength?: number;
|
|
43
|
+
loadOptions?: Function;
|
|
44
44
|
scriptUrl?: string;
|
|
45
45
|
};
|
|
46
46
|
events: {
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
export default class Button extends SvelteComponentTyped<{
|
|
5
5
|
small?: boolean;
|
|
6
6
|
href?: string;
|
|
7
|
+
hideLabel?: boolean;
|
|
7
8
|
type?: "button" | "reset" | "sumbit";
|
|
8
9
|
variant?: "primary" | "secondary" | "ghost";
|
|
9
10
|
icon?: string;
|
|
10
11
|
iconPosition?: "before" | "after";
|
|
11
12
|
disabled?: boolean;
|
|
12
|
-
hideLabel?: boolean;
|
|
13
13
|
arialabel?: string;
|
|
14
14
|
download?: string;
|
|
15
15
|
}, {
|
|
@@ -29,12 +29,12 @@ declare const __propDef: {
|
|
|
29
29
|
props: {
|
|
30
30
|
small?: boolean;
|
|
31
31
|
href?: string;
|
|
32
|
+
hideLabel?: boolean;
|
|
32
33
|
type?: "button" | "sumbit" | "reset";
|
|
33
34
|
variant?: "primary" | "secondary" | "ghost";
|
|
34
35
|
icon?: string;
|
|
35
36
|
iconPosition?: "before" | "after";
|
|
36
37
|
disabled?: boolean;
|
|
37
|
-
hideLabel?: boolean;
|
|
38
38
|
arialabel?: string;
|
|
39
39
|
download?: string | null;
|
|
40
40
|
};
|
|
@@ -7,22 +7,22 @@ export default class Select extends SvelteComponentTyped<{
|
|
|
7
7
|
label?: string;
|
|
8
8
|
mode?: "default" | "search";
|
|
9
9
|
value?: any;
|
|
10
|
+
clearable?: boolean;
|
|
11
|
+
autoClear?: boolean;
|
|
10
12
|
hideLabel?: boolean;
|
|
11
13
|
placeholder?: string;
|
|
12
14
|
options?: any[];
|
|
15
|
+
labelKey?: string;
|
|
16
|
+
groupKey?: string;
|
|
17
|
+
loadOptions?: Function;
|
|
13
18
|
filterText?: string;
|
|
14
19
|
multiple?: boolean;
|
|
15
20
|
maxSelected?: number;
|
|
16
|
-
clearable?: boolean;
|
|
17
|
-
autoClear?: boolean;
|
|
18
21
|
idKey?: string;
|
|
19
|
-
labelKey?: string;
|
|
20
|
-
groupKey?: string;
|
|
21
22
|
clusterByGroup?: boolean;
|
|
22
23
|
hideIcon?: boolean;
|
|
23
24
|
colors?: any[];
|
|
24
25
|
itemFilter?: Function;
|
|
25
|
-
loadOptions?: Function;
|
|
26
26
|
floatingConfig?: any;
|
|
27
27
|
}, {
|
|
28
28
|
input: CustomEvent<any>;
|
|
@@ -45,22 +45,22 @@ declare const __propDef: {
|
|
|
45
45
|
label?: string;
|
|
46
46
|
mode?: "default" | "search";
|
|
47
47
|
value?: object;
|
|
48
|
+
clearable?: boolean;
|
|
49
|
+
autoClear?: boolean;
|
|
48
50
|
hideLabel?: boolean;
|
|
49
51
|
placeholder?: string;
|
|
50
52
|
options?: any[];
|
|
53
|
+
labelKey?: string;
|
|
54
|
+
groupKey?: string | null;
|
|
55
|
+
loadOptions?: Function;
|
|
51
56
|
filterText?: string;
|
|
52
57
|
multiple?: boolean;
|
|
53
58
|
maxSelected?: number;
|
|
54
|
-
clearable?: boolean;
|
|
55
|
-
autoClear?: boolean;
|
|
56
59
|
idKey?: string;
|
|
57
|
-
labelKey?: string;
|
|
58
|
-
groupKey?: string | null;
|
|
59
60
|
clusterByGroup?: boolean;
|
|
60
61
|
hideIcon?: boolean;
|
|
61
62
|
colors?: any[];
|
|
62
63
|
itemFilter?: Function;
|
|
63
|
-
loadOptions?: Function;
|
|
64
64
|
floatingConfig?: object;
|
|
65
65
|
};
|
|
66
66
|
events: {
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ export { default as Titleblock } from "./layout/Titleblock/Titleblock.svelte";
|
|
|
41
41
|
export { default as Twisty } from "./layout/Twisty/Twisty.svelte";
|
|
42
42
|
|
|
43
43
|
// Inputs
|
|
44
|
+
export { default as AccessibleSelect } from "./inputs/AccessibleSelect/AccessibleSelect.svelte";
|
|
44
45
|
export { default as Button } from "./inputs/Button/Button.svelte";
|
|
45
46
|
export { default as Checkbox } from "./inputs/Checkbox/Checkbox.svelte";
|
|
46
47
|
export { default as Checkboxes } from "./inputs/Checkboxes/Checkboxes.svelte";
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
let baseurl = "//www.ons.gov.uk";
|
|
50
50
|
|
|
51
51
|
function hasCookiesPreferencesSet() {
|
|
52
|
-
return -1 < document.cookie.indexOf("
|
|
52
|
+
return -1 < document.cookie.indexOf("ons_cookie_preferences_set=true");
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// extractValue extracts the value from a undecodeable json cookie string
|
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
let oneYearInSeconds = 60 * 60 * 24 * 365;
|
|
101
101
|
let cookiesDomain = window.location.hostname;
|
|
102
102
|
let cookiesPreference = !0;
|
|
103
|
-
let
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
let acceptAllCookiesPolicy = `{'essential':true,'settings':true,'usage':true,'campaigns':true}`;
|
|
104
|
+
let rejectAllCookiesPolicy = `{'essential':true,'settings':false,'usage':false,'campaigns':false}`;
|
|
105
|
+
let cookiesPolicy = option == "all" ? acceptAllCookiesPolicy : rejectAllCookiesPolicy;
|
|
106
106
|
let cookiesPath = "/";
|
|
107
107
|
|
|
108
|
-
document.cookie = `
|
|
109
|
-
document.cookie = `
|
|
108
|
+
document.cookie = `ons_cookie_message_displayed=${cookiesPreference};max-age=${oneYearInSeconds};domain=${cookiesDomain};path=${cookiesPath};`;
|
|
109
|
+
document.cookie = `ons_cookies_policy=${cookiesPolicy};max-age=${oneYearInSeconds};domain=${cookiesDomain};path=${cookiesPath};`;
|
|
110
110
|
|
|
111
111
|
message = `You have ${option == "all" ? "accepted" : "rejected"} all additional cookies.`;
|
|
112
112
|
if (option == "all") usageCookies = true;
|