@dargmuesli/nuxt-cookie-control 3.0.0-beta.2 → 3.0.0-beta.4
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/README.md +3 -0
- package/dist/module.d.ts +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -1
- package/dist/runtime/components/CookieControl.vue +12 -3
- package/dist/runtime/types.d.ts +1 -0
- package/dist/runtime/types.mjs +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -154,6 +154,9 @@ isAcceptNecessaryButtonEnabled: true
|
|
|
154
154
|
// Switch to toggle the button that opens the configuration modal.
|
|
155
155
|
isControlButtonEnabled: true,
|
|
156
156
|
|
|
157
|
+
// Switch to toggle the concatenation of target cookie ids to the cookie description.
|
|
158
|
+
isCookieIdVisible: false,
|
|
159
|
+
|
|
157
160
|
// Switch to toggle the inclusion of this module's css.
|
|
158
161
|
// If css is set to false, you will still be able to access your color variables.
|
|
159
162
|
isCssEnabled: true,
|
package/dist/module.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ interface ModuleOptions {
|
|
|
39
39
|
cookieNameCookiesEnabledIds: string;
|
|
40
40
|
isAcceptNecessaryButtonEnabled?: boolean;
|
|
41
41
|
isControlButtonEnabled?: boolean;
|
|
42
|
+
isCookieIdVisible?: boolean;
|
|
42
43
|
isCssEnabled?: boolean;
|
|
43
44
|
isCssPolyfillEnabled?: boolean;
|
|
44
45
|
isDashInDescriptionEnabled?: boolean;
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { resolve } from 'node:path';
|
|
|
2
2
|
import { createResolver, defineNuxtModule, addPlugin, addImports, addTemplate, extendWebpackConfig, resolvePath } from '@nuxt/kit';
|
|
3
3
|
|
|
4
4
|
const name = "@dargmuesli/nuxt-cookie-control";
|
|
5
|
-
const version = "3.0.0-beta.
|
|
5
|
+
const version = "3.0.0-beta.4";
|
|
6
6
|
|
|
7
7
|
const en = {
|
|
8
8
|
acceptAll: "Accept all",
|
|
@@ -60,6 +60,7 @@ const DEFAULTS = {
|
|
|
60
60
|
cookieNameCookiesEnabledIds: "cookie_control_cookies_enabled_ids",
|
|
61
61
|
isAcceptNecessaryButtonEnabled: true,
|
|
62
62
|
isControlButtonEnabled: true,
|
|
63
|
+
isCookieIdVisible: false,
|
|
63
64
|
isCssEnabled: true,
|
|
64
65
|
isCssPolyfillEnabled: true,
|
|
65
66
|
isDashInDescriptionEnabled: true,
|
|
@@ -84,7 +84,9 @@
|
|
|
84
84
|
:id="resolveTranslatable(cookie.name)"
|
|
85
85
|
type="checkbox"
|
|
86
86
|
:checked="
|
|
87
|
-
|
|
87
|
+
getCookieIds(localCookiesEnabled)?.includes(
|
|
88
|
+
getCookieId(cookie)
|
|
89
|
+
) ||
|
|
88
90
|
(Cookies.get(
|
|
89
91
|
moduleOptions.cookieNameIsConsentGiven
|
|
90
92
|
) !== 'true' &&
|
|
@@ -101,7 +103,12 @@
|
|
|
101
103
|
<span v-if="cookie.description">
|
|
102
104
|
{{ getDescription(cookie.description) }}
|
|
103
105
|
</span>
|
|
104
|
-
<span
|
|
106
|
+
<span
|
|
107
|
+
v-if="
|
|
108
|
+
moduleOptions.isCookieIdVisible &&
|
|
109
|
+
cookie.targetCookieIds
|
|
110
|
+
"
|
|
111
|
+
>
|
|
105
112
|
{{
|
|
106
113
|
' IDs: ' +
|
|
107
114
|
cookie.targetCookieIds
|
|
@@ -159,7 +166,7 @@ import Cookies from 'js-cookie'
|
|
|
159
166
|
import { ref, computed, onBeforeMount, watch } from 'vue'
|
|
160
167
|
|
|
161
168
|
import { Cookie, CookieType, Locale, Translatable } from '../types'
|
|
162
|
-
import { getCookieIds, useResolveTranslatable } from '../methods'
|
|
169
|
+
import { getCookieId, getCookieIds, useResolveTranslatable } from '../methods'
|
|
163
170
|
|
|
164
171
|
import { useCookieControl } from '#imports'
|
|
165
172
|
|
|
@@ -303,6 +310,8 @@ onBeforeMount(async () => {
|
|
|
303
310
|
watch(
|
|
304
311
|
() => cookiesEnabled.value,
|
|
305
312
|
(current, _previous) => {
|
|
313
|
+
localCookiesEnabled.value = [...(current || [])]
|
|
314
|
+
|
|
306
315
|
if (isConsentGiven.value) {
|
|
307
316
|
Cookies.set(
|
|
308
317
|
moduleOptions.cookieNameCookiesEnabledIds,
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export interface ModuleOptions {
|
|
|
42
42
|
cookieNameCookiesEnabledIds: string;
|
|
43
43
|
isAcceptNecessaryButtonEnabled?: boolean;
|
|
44
44
|
isControlButtonEnabled?: boolean;
|
|
45
|
+
isCookieIdVisible?: boolean;
|
|
45
46
|
isCssEnabled?: boolean;
|
|
46
47
|
isCssPolyfillEnabled?: boolean;
|
|
47
48
|
isDashInDescriptionEnabled?: boolean;
|
package/dist/runtime/types.mjs
CHANGED
|
@@ -42,6 +42,7 @@ export const DEFAULTS = {
|
|
|
42
42
|
cookieNameCookiesEnabledIds: "cookie_control_cookies_enabled_ids",
|
|
43
43
|
isAcceptNecessaryButtonEnabled: true,
|
|
44
44
|
isControlButtonEnabled: true,
|
|
45
|
+
isCookieIdVisible: false,
|
|
45
46
|
isCssEnabled: true,
|
|
46
47
|
isCssPolyfillEnabled: true,
|
|
47
48
|
isDashInDescriptionEnabled: true,
|