@overgaming/valiform 0.4.7 → 0.4.8

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 +1 @@
1
- "use strict";const u=require("#app"),t=require("@overgaming/valiform"),o=require("#build/valiform/options.mjs"),a=u.defineNuxtPlugin({enforce:"post",setup(i){var e,l,n;const{syncI18n:c,...f}=o.pluginOptions,s={...f};if((e=o.valiformConfig)!=null&&e.locales&&(s.locales=o.valiformConfig.locales),c){const r=(l=i.$i18n)==null?void 0:l.locale;r&&(s.locale=r)}i.vueApp.use(t.FormsPlugin,s),(n=o.valiformConfig)!=null&&n.rules&&t.registerRules(o.valiformConfig.rules)}});module.exports=a;
1
+ "use strict";const f=require("#app"),u=require("vue"),r=require("@overgaming/valiform"),e=require("#build/valiform/options.mjs"),a=f.defineNuxtPlugin({enforce:"post",setup(s){var i,n;const{syncI18n:c,...t}=e.pluginOptions,l={...t};if((i=e.valiformConfig)!=null&&i.locales&&(l.locales=e.valiformConfig.locales),c){const o=s.$i18n;o&&o.locale&&(l.locale=u.isRef(o.locale)?o.locale:o.locale.value||o.locale)}s.vueApp.use(r.FormsPlugin,l),(n=e.valiformConfig)!=null&&n.rules&&r.registerRules(e.valiformConfig.rules)}});module.exports=a;
@@ -1,18 +1,19 @@
1
- import { defineNuxtPlugin as c } from "#app";
2
- import { FormsPlugin as p, registerRules as u } from "@overgaming/valiform";
3
- import { pluginOptions as a, valiformConfig as o } from "#build/valiform/options.mjs";
4
- const v = c({
1
+ import { defineNuxtPlugin as f } from "#app";
2
+ import { isRef as n } from "vue";
3
+ import { FormsPlugin as a, registerRules as p } from "@overgaming/valiform";
4
+ import { pluginOptions as u, valiformConfig as l } from "#build/valiform/options.mjs";
5
+ const O = f({
5
6
  enforce: "post",
6
- setup(e) {
7
- var l, i, n;
8
- const { syncI18n: t, ...f } = a, s = { ...f };
9
- if ((l = o) != null && l.locales && (s.locales = o.locales), t) {
10
- const r = (i = e.$i18n) == null ? void 0 : i.locale;
11
- r && (s.locale = r);
7
+ setup(s) {
8
+ var i, r;
9
+ const { syncI18n: t, ...c } = u, e = { ...c };
10
+ if ((i = l) != null && i.locales && (e.locales = l.locales), t) {
11
+ const o = s.$i18n;
12
+ o && o.locale && (e.locale = n(o.locale) ? o.locale : o.locale.value || o.locale);
12
13
  }
13
- e.vueApp.use(p, s), (n = o) != null && n.rules && u(o.rules);
14
+ s.vueApp.use(a, e), (r = l) != null && r.rules && p(l.rules);
14
15
  }
15
16
  });
16
17
  export {
17
- v as default
18
+ O as default
18
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overgaming/valiform",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Vue 3 form validation library",
5
5
  "keywords": [
6
6
  "form",