From 82c339f45d561ee3e07c17b72223c0e98c9b0071 Mon Sep 17 00:00:00 2001 From: Antony Date: Wed, 11 Oct 2023 13:24:18 +0100 Subject: [PATCH] cleanup attributes --- README.MD | 41 +++++++++++++++++++++++++++++++++++------ src/lib/Banner.svelte | 17 +---------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/README.MD b/README.MD index e17e136..cc87d99 100644 --- a/README.MD +++ b/README.MD @@ -71,16 +71,16 @@ Just use it as a regular svelte component: ``` -#### HTML +#### HTML / Web Component Use the custom HTML element `cookie-consent-banner`: ```html - - + + +``` +#### HTML / Web Components + +```html + + + +``` \ No newline at end of file diff --git a/src/lib/Banner.svelte b/src/lib/Banner.svelte index 4e641f7..5dc5d58 100644 --- a/src/lib/Banner.svelte +++ b/src/lib/Banner.svelte @@ -15,19 +15,7 @@ cookieConfig: { attribute: 'cookie-config', type: 'Object' }, shown: { attribute: 'shown', type: 'Boolean' }, choices: { attribute: 'choices', type: 'Object' } - }, - extend: cec => { - return class extends cec { - constructor () { - super() - this.emitConsent = (name) => { - this.dispatchEvent( - new CustomEvent(name) - ) - } - } - } - } + } }} /> @@ -39,8 +27,6 @@ const dispatch = createEventDispatcher() - export let emitConsent - /** * @type {string|undefined|null} */ @@ -175,7 +161,6 @@ } if (agreed) { dispatch(t) - emitConsent(t) } }) shown = false