@overgaming/valiform 0.4.8 → 0.4.9
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.
- package/dist/nuxt.cjs +2 -2
- package/dist/nuxt.js +11 -9
- package/dist/runtime/plugin-i18n.cjs +1 -0
- package/dist/runtime/plugin-i18n.js +11 -0
- package/dist/runtime/plugin.cjs +1 -1
- package/dist/runtime/plugin.js +6 -15
- package/dist/runtime/setup.cjs +1 -0
- package/dist/runtime/setup.js +14 -0
- package/package.json +1 -1
package/dist/nuxt.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("@nuxt/kit");var t=typeof document<"u"?document.currentScript:null;const
|
|
2
|
-
`),write:!0}),e.addPlugin(
|
|
1
|
+
"use strict";const e=require("@nuxt/kit");var t=typeof document<"u"?document.currentScript:null;const u=e.defineNuxtModule({meta:{name:"@overgaming/valiform",configKey:"valiform",compatibility:{nuxt:">=3.0.0"}},defaults:{},async setup(r){const a=e.createResolver(typeof document>"u"?require("url").pathToFileURL(__filename).href:t&&t.tagName.toUpperCase()==="SCRIPT"&&t.src||new URL("nuxt.cjs",document.baseURI).href),{config:o,...i}=r,n=[];if(o){const l=await e.resolvePath(o);n.push(`import _config from ${JSON.stringify(l)};`)}n.push(`export const pluginOptions = ${JSON.stringify(i)};`),n.push(`export const valiformConfig = ${o?"_config":"null"};`),e.addTemplate({filename:"valiform/options.mjs",getContents:()=>n.join(`
|
|
2
|
+
`),write:!0});const m=e.hasNuxtModule("@nuxtjs/i18n"),s=i.syncI18n&&m;e.addPlugin(a.resolve(s?"./runtime/plugin-i18n":"./runtime/plugin")),e.addComponent({name:"Form",export:"Form",filePath:"@overgaming/valiform"}),e.addComponent({name:"Field",export:"Field",filePath:"@overgaming/valiform"}),e.addImports([{name:"useLocale",from:"@overgaming/valiform"},{name:"useFormContext",from:"@overgaming/valiform"},{name:"useFieldContext",from:"@overgaming/valiform"},{name:"useInputContext",from:"@overgaming/valiform"}])}});module.exports=u;
|
package/dist/nuxt.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { defineNuxtModule as
|
|
2
|
-
const
|
|
1
|
+
import { defineNuxtModule as l, createResolver as f, resolvePath as g, addTemplate as u, hasNuxtModule as p, addPlugin as v, addComponent as i, addImports as c } from "@nuxt/kit";
|
|
2
|
+
const x = l({
|
|
3
3
|
meta: {
|
|
4
4
|
name: "@overgaming/valiform",
|
|
5
5
|
configKey: "valiform",
|
|
6
6
|
compatibility: { nuxt: ">=3.0.0" }
|
|
7
7
|
},
|
|
8
8
|
defaults: {},
|
|
9
|
-
async setup(
|
|
10
|
-
const
|
|
9
|
+
async setup(t) {
|
|
10
|
+
const a = f(import.meta.url), { config: e, ...n } = t, o = [];
|
|
11
11
|
if (e) {
|
|
12
|
-
const
|
|
13
|
-
o.push(`import _config from ${JSON.stringify(
|
|
12
|
+
const s = await g(e);
|
|
13
|
+
o.push(`import _config from ${JSON.stringify(s)};`);
|
|
14
14
|
}
|
|
15
|
-
o.push(`export const pluginOptions = ${JSON.stringify(
|
|
15
|
+
o.push(`export const pluginOptions = ${JSON.stringify(n)};`), o.push(`export const valiformConfig = ${e ? "_config" : "null"};`), u({
|
|
16
16
|
filename: "valiform/options.mjs",
|
|
17
17
|
getContents: () => o.join(`
|
|
18
18
|
`),
|
|
19
19
|
write: !0
|
|
20
|
-
})
|
|
20
|
+
});
|
|
21
|
+
const r = p("@nuxtjs/i18n"), m = n.syncI18n && r;
|
|
22
|
+
v(a.resolve(m ? "./runtime/plugin-i18n" : "./runtime/plugin")), i({ name: "Form", export: "Form", filePath: "@overgaming/valiform" }), i({ name: "Field", export: "Field", filePath: "@overgaming/valiform" }), c([
|
|
21
23
|
{ name: "useLocale", from: "@overgaming/valiform" },
|
|
22
24
|
{ name: "useFormContext", from: "@overgaming/valiform" },
|
|
23
25
|
{ name: "useFieldContext", from: "@overgaming/valiform" },
|
|
@@ -26,5 +28,5 @@ const v = a({
|
|
|
26
28
|
}
|
|
27
29
|
});
|
|
28
30
|
export {
|
|
29
|
-
|
|
31
|
+
x as default
|
|
30
32
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("#app"),n=require("./setup.cjs"),s=e.defineNuxtPlugin({name:"valiform",enforce:"post",dependsOn:["i18n:plugin"],setup:n.setupFormsPlugin});module.exports=s;
|
package/dist/runtime/plugin.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const e=require("#app"),t=require("./setup.cjs"),s=e.defineNuxtPlugin({name:"valiform",enforce:"post",setup:t.setupFormsPlugin});module.exports=s;
|
package/dist/runtime/plugin.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import { defineNuxtPlugin as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const O = f({
|
|
1
|
+
import { defineNuxtPlugin as o } from "#app";
|
|
2
|
+
import { setupFormsPlugin as e } from "./setup.js";
|
|
3
|
+
const i = o({
|
|
4
|
+
name: "valiform",
|
|
6
5
|
enforce: "post",
|
|
7
|
-
setup
|
|
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);
|
|
13
|
-
}
|
|
14
|
-
s.vueApp.use(a, e), (r = l) != null && r.rules && p(l.rules);
|
|
15
|
-
}
|
|
6
|
+
setup: e
|
|
16
7
|
});
|
|
17
8
|
export {
|
|
18
|
-
|
|
9
|
+
i as default
|
|
19
10
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@overgaming/valiform"),o=require("#build/valiform/options.mjs");function u(s){var e,n;const{syncI18n:t,...f}=o.pluginOptions,i={...f};if((e=o.valiformConfig)!=null&&e.locales&&(i.locales=o.valiformConfig.locales),t){const l=s.$i18n;l&&l.locale&&(i.locale=l.locale)}s.vueApp.use(r.FormsPlugin,i),(n=o.valiformConfig)!=null&&n.rules&&r.registerRules(o.valiformConfig.rules)}exports.setupFormsPlugin=u;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormsPlugin as t, registerRules as f } from "@overgaming/valiform";
|
|
2
|
+
import { pluginOptions as u, valiformConfig as o } from "#build/valiform/options.mjs";
|
|
3
|
+
function a(i) {
|
|
4
|
+
var e, n;
|
|
5
|
+
const { syncI18n: r, ...c } = u, l = { ...c };
|
|
6
|
+
if ((e = o) != null && e.locales && (l.locales = o.locales), r) {
|
|
7
|
+
const s = i.$i18n;
|
|
8
|
+
s && s.locale && (l.locale = s.locale);
|
|
9
|
+
}
|
|
10
|
+
i.vueApp.use(t, l), (n = o) != null && n.rules && f(o.rules);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
a as setupFormsPlugin
|
|
14
|
+
};
|