From 4502ae30c8322631e0a735df2e1a393800968f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dabiel=20Gonz=C3=A1lez=20Ramos?= Date: Thu, 16 May 2024 00:29:03 +0300 Subject: [PATCH] fix(Beeq Vue): remove applyPolyfills function BEEQ integration with Vue.js is broken, 'cuz the latest Stencil version no longer copy polyfills to the dist OT unless building es5. --- packages/beeq-vue/src/plugin.ts | 34 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/packages/beeq-vue/src/plugin.ts b/packages/beeq-vue/src/plugin.ts index 060978755..9782e715a 100644 --- a/packages/beeq-vue/src/plugin.ts +++ b/packages/beeq-vue/src/plugin.ts @@ -1,24 +1,22 @@ import { Plugin } from 'vue'; -import { applyPolyfills, defineCustomElements } from '@beeq/core/dist/loader'; +import { defineCustomElements } from '@beeq/core/dist/loader'; export const BeeqVue: Plugin = { async install() { - applyPolyfills().then(() => { - // @stencil/vue-output-target does not support camelCase event names - // so we are attaching a custom event listener to map camelCase to kebab-case event names - const camelCaseToKebab = (str: string) => { - return str - .split(/(?=[A-Z])/) - .join('-') - .toLowerCase(); - }; - defineCustomElements(window, { - ael: (el: any, eventName: string, cb: any, opts: any) => - el.addEventListener(camelCaseToKebab(eventName), cb, opts), - rel: (el: any, eventName: string, cb: any, opts: any) => - el.removeEventListener(camelCaseToKebab(eventName), cb, opts), - ce: (eventName: string, opts: any) => new CustomEvent(camelCaseToKebab(eventName), opts), - } as any); - }); + // @stencil/vue-output-target does not support camelCase event names + // so we are attaching a custom event listener to map camelCase to kebab-case event names + const camelCaseToKebab = (str: string) => { + return str + .split(/(?=[A-Z])/) + .join('-') + .toLowerCase(); + }; + defineCustomElements(window, { + ael: (el: any, eventName: string, cb: any, opts: any) => + el.addEventListener(camelCaseToKebab(eventName), cb, opts), + rel: (el: any, eventName: string, cb: any, opts: any) => + el.removeEventListener(camelCaseToKebab(eventName), cb, opts), + ce: (eventName: string, opts: any) => new CustomEvent(camelCaseToKebab(eventName), opts), + } as any); }, };