From f5a2379671b7aebed9a5f2690583fa5c6b569d3f Mon Sep 17 00:00:00 2001 From: NicolasRichel Date: Thu, 29 Jun 2023 17:34:35 +0200 Subject: [PATCH] MINOR: feat: add ability to register smart components with vue plugin --- src/BIMDataSmartComponents/index.js | 2 +- src/assets/css/fonts.css | 2 +- vue3-plugin.js | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/BIMDataSmartComponents/index.js b/src/BIMDataSmartComponents/index.js index e266f708..07c06fcd 100644 --- a/src/BIMDataSmartComponents/index.js +++ b/src/BIMDataSmartComponents/index.js @@ -1,4 +1,4 @@ -import "../assets/css/_BIMDataVariables.css"; +import "../assets/css/variables.css"; import "../assets/css/utilities/_colors.css"; import "../assets/css/utilities/_flex.css"; diff --git a/src/assets/css/fonts.css b/src/assets/css/fonts.css index 45bd2878..9c8ae13f 100644 --- a/src/assets/css/fonts.css +++ b/src/assets/css/fonts.css @@ -23,4 +23,4 @@ font-weight: 100 400; font-style: normal; font-display: fallback; -} +} \ No newline at end of file diff --git a/vue3-plugin.js b/vue3-plugin.js index 57f7cb43..f1b55547 100644 --- a/vue3-plugin.js +++ b/vue3-plugin.js @@ -1,4 +1,5 @@ import * as Components from "./src/BIMDataComponents/index.js"; +import * as SmartComponents from "./src/BIMDataSmartComponents/index.js"; import * as Directives from "./src/BIMDataDirectives/index.js"; /** @@ -6,9 +7,10 @@ import * as Directives from "./src/BIMDataDirectives/index.js"; * * @param { * { - * directives?: boolean, * includedComponents?: string[], - * excludedComponents?: string[] + * excludedComponents?: string[], + * smartComponents?: boolean, + * directives?: boolean, * } * } [cfg] */ @@ -35,6 +37,15 @@ const pluginFactory = cfg => { } }); + // SMART COMPONENTS + if (cfg?.smartComponents) { + Object.entries(SmartComponents).forEach( + ([componentName, component]) => { + app.component(componentName, component); + } + ); + } + // DIRECTIVES if (!cfg || cfg.directives !== false) { Object.entries(Directives).forEach(([directiveName, directive]) =>