@tagplus/components 5.3.1 → 5.3.3

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.
@@ -1,4 +1,4 @@
1
- import { getCurrentScope, onScopeDispose, getCurrentInstance, onMounted, nextTick, unref, shallowRef, watchEffect, readonly } from "vue";
1
+ import { getCurrentScope, onScopeDispose, shallowRef, watchEffect, readonly, getCurrentInstance, onMounted, nextTick, unref } from "vue";
2
2
  var __defProp$9 = Object.defineProperty;
3
3
  var __defProps$6 = Object.defineProperties;
4
4
  var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, unref, toRefs, reactive, getCurrentInstance, onBeforeUnmount, nextTick, withDirectives, createElementBlock, openBlock, withModifiers, normalizeClass, renderSlot, createElementVNode, toDisplayString, vShow } from "vue";
1
+ import { defineComponent, withDirectives, createElementBlock, openBlock, withModifiers, normalizeClass, renderSlot, createElementVNode, toDisplayString, vShow, computed, unref, toRefs, reactive, getCurrentInstance, onBeforeUnmount, nextTick } from "vue";
2
2
  import { useOption } from "./useOption.mjs";
3
3
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
4
4
  import { useNamespace } from "../../../node_modules/element-plus/es/hooks/use-namespace/index.mjs";
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, createElementBlock, openBlock, normalizeStyle, normalizeClass, createCommentVNode, renderSlot } from "vue";
1
+ import { defineComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createCommentVNode, renderSlot, ref } from "vue";
2
2
  import { useResizeObserver } from "../../../node_modules/@vueuse/core/index.mjs";
3
3
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
4
4
  import { useNamespace } from "../../../node_modules/element-plus/es/hooks/use-namespace/index.mjs";
@@ -1,7 +1,7 @@
1
1
  import { inject, computed, getCurrentInstance, toRaw, watch } from "vue";
2
2
  import { get, isEqual } from "lodash-es";
3
- import { isObject } from "../../../node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
4
3
  import { escapeStringRegexp } from "../../utils/strings.mjs";
4
+ import { isObject } from "../../../node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
5
5
  function useOption(props, states) {
6
6
  const select = inject("select");
7
7
  const selectGroup = inject("ElSelectGroup", { disabled: false });
@@ -2,14 +2,14 @@ import { ref, getCurrentInstance, reactive, computed, watch, onMounted, onUpdate
2
2
  import { isNil } from "lodash-es";
3
3
  import { isNumber, isUndefined } from "../../utils/types.mjs";
4
4
  import { debugWarn, throwError } from "../../utils/error.mjs";
5
- import { isString } from "../../../node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
6
- import { ArrowDown as arrow_down_default, Minus as minus_default, ArrowUp as arrow_up_default, Plus as plus_default } from "../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
7
5
  import { useFormItem } from "../../utils/use-form-item.mjs";
8
6
  import { useFormSize, useFormDisabled } from "../../utils/use-form-common-props.mjs";
9
7
  import { vRepeatClick } from "element-plus";
8
+ import { ArrowDown as arrow_down_default, Minus as minus_default, ArrowUp as arrow_up_default, Plus as plus_default } from "../../../node_modules/@element-plus/icons-vue/dist/index.mjs";
10
9
  import { inputNumberEmits, inputNumberProps } from "./input-number.mjs";
11
10
  import { useLocale } from "../../../node_modules/element-plus/es/hooks/use-locale/index.mjs";
12
11
  import { useNamespace } from "../../../node_modules/element-plus/es/hooks/use-namespace/index.mjs";
12
+ import { isString } from "../../../node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
13
13
  const _hoisted_1 = ["aria-label"];
14
14
  const _hoisted_2 = ["aria-label"];
15
15
  const UPDATE_MODEL_EVENT = "update:modelValue";
@@ -1,32 +1,22 @@
1
- import { default as default2 } from "./Autosuggest/Autosuggest.vue.mjs";
2
- import { default as default3 } from "./Inline/Inline.vue.mjs";
3
- import { default as default4 } from "./Money/Money.vue.mjs";
4
- import { default as default5 } from "./Percent/Percent.vue.mjs";
5
- import { default as default6 } from "./OptionsList/OptionsList.vue.mjs";
6
- import { default as default7 } from "./OptionsListItem/OptionsListItem.vue.mjs";
7
- import { default as default8 } from "./Loader/Loader.vue.mjs";
8
- import { default as default9 } from "./Skeleton/Skeleton.vue.mjs";
9
- import { default as default10 } from "./Tip/Tip.vue.mjs";
10
- import { default as default11 } from "./Autosuggest/Multisuggest.vue.mjs";
11
- import { default as default12 } from "./Step/Step.vue.mjs";
12
- import { default as default13 } from "./Steps/Steps.vue.mjs";
13
- import { default as default14 } from "./InputNumber/InputNumber.vue.mjs";
14
1
  import { ElDialog } from "element-plus";
15
2
  ElDialog.name = "TpDialog";
16
3
  const Dialog = ElDialog;
4
+ const components = {
5
+ TpAutosuggest: () => import("./Autosuggest/Autosuggest.vue.mjs"),
6
+ TpInline: () => import("./Inline/index.mjs"),
7
+ TpMoney: () => import("./Money/index.mjs"),
8
+ TpPercent: () => import("./Percent/index.mjs"),
9
+ TpOptionsList: () => import("./OptionsList/index.mjs"),
10
+ TpOptionsListItem: () => import("./OptionsListItem/index.mjs"),
11
+ TpLoader: () => import("./Loader/index.mjs"),
12
+ TpSkeleton: () => import("./Skeleton/index.mjs"),
13
+ TpTip: () => import("./Tip/index.mjs"),
14
+ TpMultisuggest: () => import("./Multisuggest/index.mjs"),
15
+ TpStep: () => import("./Step/index.mjs"),
16
+ TpSteps: () => import("./Steps/index.mjs"),
17
+ TpInputNumber: () => import("./InputNumber/index.mjs"),
18
+ TpDialog: Dialog
19
+ };
17
20
  export {
18
- default2 as Autosuggest,
19
- Dialog,
20
- default3 as Inline,
21
- default14 as InputNumber,
22
- default8 as Loader,
23
- default4 as Money,
24
- default11 as Multisuggest,
25
- default6 as OptionsList,
26
- default7 as OptionsListItem,
27
- default5 as Percent,
28
- default9 as Skeleton,
29
- default12 as Step,
30
- default13 as Steps,
31
- default10 as Tip
21
+ components as default
32
22
  };
@@ -1,17 +1,18 @@
1
- import * as index from "./components/index.mjs";
1
+ import components from "./components/index.mjs";
2
+ import { default as default2 } from "./locale/i18nCreator.mjs";
2
3
  import Currency from "./plugins/currency.mjs";
3
- import i18nCreator from "./locale/i18nCreator.mjs";
4
+ import { defineAsyncComponent } from "vue";
4
5
  const install = function(app) {
5
6
  app.use(Currency);
6
- for (const componentName in index) {
7
- const component = index[componentName];
8
- app.component(component.name, component);
7
+ for (const componentName in components) {
8
+ const component = components[componentName];
9
+ app.component(component.name, defineAsyncComponent(component));
9
10
  }
10
11
  };
11
- if (typeof window !== "undefined" && window.Vue) {
12
- install(window.Vue);
13
- }
14
- const main = { ...index, install, i18nCreator };
12
+ const main = { install };
15
13
  export {
16
- main as default
14
+ components,
15
+ main as default,
16
+ default2 as i18nCreator,
17
+ install
17
18
  };
@@ -1,6 +1,4 @@
1
1
  import { isString } from "../../node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
2
- import "lodash-es";
3
- import "vue";
4
2
  class ElementPlusError extends Error {
5
3
  constructor(m) {
6
4
  super(m);
@@ -1,11 +1,8 @@
1
- import "lodash-es";
2
- import { isVNode } from "vue";
3
1
  const UPDATE_MODEL_EVENT = "update:modelValue";
4
2
  const CHANGE_EVENT = "change";
5
3
  const INPUT_EVENT = "input";
6
4
  export {
7
5
  CHANGE_EVENT,
8
6
  INPUT_EVENT,
9
- UPDATE_MODEL_EVENT,
10
- isVNode
7
+ UPDATE_MODEL_EVENT
11
8
  };
@@ -1,5 +1,3 @@
1
- import "lodash-es";
2
- import "vue";
3
1
  import { isClient } from "../../node_modules/@vueuse/shared/index.mjs";
4
2
  function scrollIntoView(container, selected) {
5
3
  if (!isClient) return;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("vue");
4
4
  const lodashEs = require("lodash-es");
5
- const shared_esmBundler = require("../../../node_modules/@vue/shared/dist/shared.esm-bundler.js");
6
5
  const strings = require("../../utils/strings.js");
6
+ const shared_esmBundler = require("../../../node_modules/@vue/shared/dist/shared.esm-bundler.js");
7
7
  function useOption(props, states) {
8
8
  const select = vue.inject("select");
9
9
  const selectGroup = vue.inject("ElSelectGroup", { disabled: false });
@@ -4,14 +4,14 @@ const vue = require("vue");
4
4
  const lodashEs = require("lodash-es");
5
5
  const types = require("../../utils/types.js");
6
6
  const error = require("../../utils/error.js");
7
- const shared_esmBundler = require("../../../node_modules/@vue/shared/dist/shared.esm-bundler.js");
8
- const index$2 = require("../../../node_modules/@element-plus/icons-vue/dist/index.js");
9
7
  const useFormItem = require("../../utils/use-form-item.js");
10
8
  const useFormCommonProps = require("../../utils/use-form-common-props.js");
11
9
  const elementPlus = require("element-plus");
10
+ const index$2 = require("../../../node_modules/@element-plus/icons-vue/dist/index.js");
12
11
  const inputNumber = require("./input-number.js");
13
12
  const index = require("../../../node_modules/element-plus/es/hooks/use-locale/index.js");
14
13
  const index$1 = require("../../../node_modules/element-plus/es/hooks/use-namespace/index.js");
14
+ const shared_esmBundler = require("../../../node_modules/@vue/shared/dist/shared.esm-bundler.js");
15
15
  const _hoisted_1 = ["aria-label"];
16
16
  const _hoisted_2 = ["aria-label"];
17
17
  const UPDATE_MODEL_EVENT = "update:modelValue";
@@ -1,32 +1,22 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const Autosuggest = require("./Autosuggest/Autosuggest.vue.js");
4
- const Inline = require("./Inline/Inline.vue.js");
5
- const Money = require("./Money/Money.vue.js");
6
- const Percent = require("./Percent/Percent.vue.js");
7
- const OptionsList = require("./OptionsList/OptionsList.vue.js");
8
- const OptionsListItem = require("./OptionsListItem/OptionsListItem.vue.js");
9
- const Loader = require("./Loader/Loader.vue.js");
10
- const Skeleton = require("./Skeleton/Skeleton.vue.js");
11
- const Tip = require("./Tip/Tip.vue.js");
12
- const Multisuggest = require("./Autosuggest/Multisuggest.vue.js");
13
- const Step = require("./Step/Step.vue.js");
14
- const Steps = require("./Steps/Steps.vue.js");
15
- const InputNumber = require("./InputNumber/InputNumber.vue.js");
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
16
3
  const elementPlus = require("element-plus");
17
4
  elementPlus.ElDialog.name = "TpDialog";
18
5
  const Dialog = elementPlus.ElDialog;
19
- exports.Autosuggest = Autosuggest.default;
20
- exports.Inline = Inline.default;
21
- exports.Money = Money.default;
22
- exports.Percent = Percent.default;
23
- exports.OptionsList = OptionsList.default;
24
- exports.OptionsListItem = OptionsListItem.default;
25
- exports.Loader = Loader.default;
26
- exports.Skeleton = Skeleton.default;
27
- exports.Tip = Tip.default;
28
- exports.Multisuggest = Multisuggest.default;
29
- exports.Step = Step.default;
30
- exports.Steps = Steps.default;
31
- exports.InputNumber = InputNumber.default;
32
- exports.Dialog = Dialog;
6
+ const components = {
7
+ TpAutosuggest: () => Promise.resolve().then(() => require("./Autosuggest/Autosuggest.vue.js")),
8
+ TpInline: () => Promise.resolve().then(() => require("./Inline/index.js")),
9
+ TpMoney: () => Promise.resolve().then(() => require("./Money/index.js")),
10
+ TpPercent: () => Promise.resolve().then(() => require("./Percent/index.js")),
11
+ TpOptionsList: () => Promise.resolve().then(() => require("./OptionsList/index.js")),
12
+ TpOptionsListItem: () => Promise.resolve().then(() => require("./OptionsListItem/index.js")),
13
+ TpLoader: () => Promise.resolve().then(() => require("./Loader/index.js")),
14
+ TpSkeleton: () => Promise.resolve().then(() => require("./Skeleton/index.js")),
15
+ TpTip: () => Promise.resolve().then(() => require("./Tip/index.js")),
16
+ TpMultisuggest: () => Promise.resolve().then(() => require("./Multisuggest/index.js")),
17
+ TpStep: () => Promise.resolve().then(() => require("./Step/index.js")),
18
+ TpSteps: () => Promise.resolve().then(() => require("./Steps/index.js")),
19
+ TpInputNumber: () => Promise.resolve().then(() => require("./InputNumber/index.js")),
20
+ TpDialog: Dialog
21
+ };
22
+ exports.default = components;
@@ -1,17 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const index = require("./components/index.js");
4
- const currency = require("./plugins/currency.js");
5
4
  const i18nCreator = require("./locale/i18nCreator.js");
5
+ const currency = require("./plugins/currency.js");
6
+ const vue = require("vue");
6
7
  const install = function(app) {
7
8
  app.use(currency.default);
8
- for (const componentName in index) {
9
- const component = index[componentName];
10
- app.component(component.name, component);
9
+ for (const componentName in index.default) {
10
+ const component = index.default[componentName];
11
+ app.component(component.name, vue.defineAsyncComponent(component));
11
12
  }
12
13
  };
13
- if (typeof window !== "undefined" && window.Vue) {
14
- install(window.Vue);
15
- }
16
- const main = { ...index, install, i18nCreator: i18nCreator.default };
14
+ const main = { install };
15
+ exports.components = index.default;
16
+ exports.i18nCreator = i18nCreator.default;
17
17
  exports.default = main;
18
+ exports.install = install;
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const shared_esmBundler = require("../../node_modules/@vue/shared/dist/shared.esm-bundler.js");
4
- require("lodash-es");
5
- require("vue");
6
4
  class ElementPlusError extends Error {
7
5
  constructor(m) {
8
6
  super(m);
@@ -1,14 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("lodash-es");
4
- const vue = require("vue");
5
3
  const UPDATE_MODEL_EVENT = "update:modelValue";
6
4
  const CHANGE_EVENT = "change";
7
5
  const INPUT_EVENT = "input";
8
- Object.defineProperty(exports, "isVNode", {
9
- enumerable: true,
10
- get: () => vue.isVNode
11
- });
12
6
  exports.CHANGE_EVENT = CHANGE_EVENT;
13
7
  exports.INPUT_EVENT = INPUT_EVENT;
14
8
  exports.UPDATE_MODEL_EVENT = UPDATE_MODEL_EVENT;
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("lodash-es");
4
- require("vue");
5
3
  const index = require("../../node_modules/@vueuse/shared/index.js");
6
4
  function scrollIntoView(container, selected) {
7
5
  if (!index.isClient) return;
package/package.json CHANGED
@@ -8,17 +8,26 @@
8
8
  "email": "qualidade@tagplus.com.br"
9
9
  }
10
10
  ],
11
- "version": "5.3.1",
11
+ "version": "5.3.3",
12
12
  "type": "module",
13
13
  "main": "./dist/lib/src/main.js",
14
14
  "module": "./dist/es/src/main.mjs",
15
15
  "exports": {
16
- "require": "./dist/lib/src/main.js",
17
- "import": "./dist/es/src/main.mjs"
16
+ ".": {
17
+ "require": "./dist/lib/src/main.js",
18
+ "import": "./dist/es/src/main.mjs"
19
+ },
20
+ "./styles": {
21
+ "require": "./dist/lib/components.css",
22
+ "import": "./dist/es/components.css"
23
+ },
24
+ "./lang": "./dist/lang"
18
25
  },
19
26
  "files": [
20
- "dist",
21
- "src/locale"
27
+ "dist"
28
+ ],
29
+ "sideEffects": [
30
+ "./dist/components.css"
22
31
  ],
23
32
  "engines": {
24
33
  "node": ">=22.0"
@@ -84,6 +93,7 @@
84
93
  "stylelint-config-recommended-vue": "^1.5.0",
85
94
  "stylelint-config-standard-scss": "^13.1.0",
86
95
  "vite": "^6.1.0",
96
+ "vite-plugin-static-copy": "^2.2.0",
87
97
  "vue-axios": "^3.5.2",
88
98
  "vue-eslint-parser": "^9.4.2",
89
99
  "vue-i18n": "^9.9.1",
@@ -1,170 +0,0 @@
1
- import { createI18n } from 'vue-i18n'
2
- import { reactive } from 'vue'
3
-
4
- let i18n
5
-
6
- const loadedLanguages = []
7
-
8
- const i18nHelper = {
9
- global: false,
10
- importLangFile: false,
11
- /**
12
- * Eventos que podem ser observados com watch
13
- */
14
- hooks: reactive({
15
- onLanguageChanged: ''
16
- })
17
- }
18
-
19
- /**
20
- * Asynchronously imports and processes custom language files for the i18n instance.
21
- * If the importLangFile function is provided in the i18nHelper options, it will be used to import the custom language file.
22
- * If the imported file does not have a default export, it will be wrapped in a default export.
23
- * @param {String} filename - The name of the language file to be imported.
24
- * @returns {Promise<Object>} - A promise that resolves to an object containing the custom language messages.
25
- * @throws {Error} - Throws an error if the importLangFile function is not provided or if it does not return an object.
26
- */
27
- const importLangFiles = async function (filename) {
28
- let langsCustom = {}
29
-
30
- if (i18nHelper.importLangFile && typeof i18nHelper.importLangFile === 'function') {
31
- langsCustom = await i18nHelper.importLangFile(filename)
32
- if (!(Object.keys(langsCustom).length === 1 && langsCustom.default)) {
33
- langsCustom.default = langsCustom
34
- }
35
- }
36
-
37
- return langsCustom
38
- }
39
-
40
- /**
41
- * Essa função deve ser impementada no i18nHelper para executar ações após trocar a linguagem,
42
- * como salvar nos cookies ou session a linguagem atual
43
- *
44
- * @param {String} locale - The locale string representing the language to be set.
45
- * @throws {Error} Throws an error if the onLanguageSet function is not implemented.
46
- * @returns {void}
47
- */
48
- i18nHelper.onLanguageSet = function (locale) {
49
- throw new Error('Implemente a função onLanguageSet na definição do plugin i18n')
50
- }
51
-
52
- /**
53
- * Sets the current language and updates the i18n instance accordingly.
54
- * Triggers the onLanguageChanged hook and calls the onLanguageSet function.
55
- * @param {String} locale - The locale string representing the language to be set. EX: 'pt-br', 'en'
56
- * @returns {String} - The updated locale string.
57
- */
58
- i18nHelper.setI18nLanguage = function (locale) {
59
- if (i18n.mode === 'legacy') {
60
- i18n.global.locale = locale
61
- } else {
62
- i18n.global.locale.value = locale
63
- }
64
-
65
- i18nHelper.hooks.onLanguageChanged = locale
66
- document.querySelector('html').setAttribute('lang', locale)
67
- i18nHelper.onLanguageSet(locale)
68
- return locale
69
- }
70
-
71
- /**
72
- * Asynchronously loads and sets the current language for the i18n instance.
73
- * If the language is already loaded, it returns immediately.
74
- * @param {String} locale - The locale string representing the language to be set. EX: 'pt-br', 'en'
75
- * @returns {Promise}
76
- */
77
- i18nHelper.loadLanguageAsync = async function (locale) {
78
- // If the language was already loaded
79
- if (loadedLanguages.includes(locale)) {
80
- return locale
81
- }
82
-
83
- // load locale messages with dynamic import
84
- const messages = await importLangFiles(locale)
85
- // set locale and locale message
86
- i18n.global.setLocaleMessage(locale, messages.default)
87
- loadedLanguages.push(locale)
88
- return locale
89
- }
90
-
91
- /**
92
- * Asynchronously sets up and initializes the i18n instance with the provided options.
93
- * If the i18n instance is already created, it returns the existing instance.
94
- *
95
- * @param {Object} [options={}] - An optional object containing configuration options for the i18n instance.
96
- * @param {String} [options.locale='pt-br'] - The default locale for the i18n instance.
97
- * @param {Object} [options.i18nOptions] - Additional options to be passed to the createI18n function.
98
- *
99
- * @returns {Promise<I18n>} - A promise that resolves to the initialized i18n instance.
100
- */
101
- async function setupI18n (options = {}) {
102
- if (!i18n) {
103
- const locale = options.locale || 'pt-br'
104
-
105
- i18n = createI18n({
106
- legacy: false,
107
- locale,
108
- missing: (locale, key) => {
109
- console.warn(`translation missing: locale=${locale}, key=${key}`)
110
- },
111
- ...options
112
- })
113
-
114
- await i18nHelper.loadLanguageAsync(locale)
115
- i18nHelper.setI18nLanguage(locale)
116
- }
117
- return i18n
118
- }
119
-
120
- /**
121
- * A plugin for Vue.js that initializes and configures the i18n instance with customizable options.
122
- * It also provides a helper object for managing language settings and loading language files asynchronously.
123
- *
124
- * @param {Object} options - An object containing configuration options for the plugin.
125
- * @param {Object} options.i18nHelper - An object containing custom functions for managing language settings.
126
- * @param {Function} [options.i18nHelper.importLangFile] - A function for asynchronously importing custom language files.
127
- * @param {Function} [options.i18nHelper.onLanguageSet] - A function to be called after setting the language.
128
- * @param {Object} [options.i18nOptions] - Additional options to be passed to the createI18n function.
129
- * @param {Function} [postInstall] - A function to be called after the plugin is installed.
130
- *
131
- * @returns {Object} - An object with an install function for Vue.js plugins.
132
- */
133
- export default async (options = {}, postInstall = (app, options, i18nHelper) => {}) => {
134
- // Validating the options
135
- const keys = Object.keys(options).filter(key => !['i18nHelper', 'i18nOptions'].includes(key))
136
- if (keys.length) {
137
- throw new Error(`Invalid options: ${keys.join(', ')}, expected { i18nOptions, i18nHelper }`)
138
- }
139
-
140
- // Overriding the importLangFile function if provided in options
141
- if (options.i18nHelper && typeof options.i18nHelper.importLangFile === 'function') {
142
- i18nHelper.importLangFile = options.i18nHelper.importLangFile
143
- }
144
-
145
- // Overriding the onLanguageSet function if provided in options
146
- if (options.i18nHelper && typeof options.i18nHelper.onLanguageSet === 'function') {
147
- i18nHelper.onLanguageSet = options.i18nHelper.onLanguageSet
148
- }
149
-
150
- let i18nOptions = {}
151
- // Using provided i18nOptions if available
152
- if (options.i18nOptions && typeof options.i18nOptions === 'object') {
153
- i18nOptions = options.i18nOptions
154
- }
155
-
156
- // Initializing the i18n instance with the provided options
157
- i18n = await setupI18n(i18nOptions)
158
-
159
- i18nHelper.global = i18n.global
160
-
161
- return {
162
- install: (app, opts) => {
163
- // Installing the original i18n instance
164
- i18n.install(app, i18nOptions)
165
- if (typeof postInstall === 'function') {
166
- postInstall(app, options, i18nHelper)
167
- }
168
- }
169
- }
170
- }
File without changes
File without changes