@effect-app/vue-components 0.5.0 → 0.6.1
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/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +30 -0
- package/dist/types/components/OmegaForm/index.d.ts +2 -6
- package/dist/vue-components.es.js +24 -27
- package/dist/vue-components.es10.js +6 -23
- package/dist/vue-components.es11.js +3 -3
- package/dist/vue-components.es15.js +1 -1
- package/dist/vue-components.es17.js +2 -5
- package/dist/vue-components.es18.js +5 -32
- package/dist/vue-components.es19.js +32 -2
- package/dist/vue-components.es2.js +16 -19
- package/dist/vue-components.es20.js +98 -2
- package/dist/vue-components.es21.js +11 -98
- package/dist/vue-components.es22.js +2 -11
- package/dist/vue-components.es23.js +1 -1
- package/dist/vue-components.es24.js +2 -115
- package/dist/vue-components.es25.js +117 -0
- package/dist/{vue-components.es26.js → vue-components.es27.js} +1 -1
- package/dist/vue-components.es3.js +3 -3
- package/dist/vue-components.es4.js +2 -2
- package/dist/vue-components.es5.js +78 -36
- package/dist/vue-components.es6.js +34 -131
- package/dist/vue-components.es7.js +128 -211
- package/dist/vue-components.es8.js +216 -6
- package/dist/vue-components.es9.js +4 -4
- package/package.json +9 -3
- package/src/components/OmegaForm/OmegaAutoGen.vue +110 -0
- package/src/components/OmegaForm/OmegaWrapper.vue +1 -1
- package/src/components/OmegaForm/index.ts +2 -19
- package/src/env.d.ts +0 -8
- package/src/stories/OmegaForm/Clearable.vue +0 -20
- package/src/stories/OmegaForm/ComplexForm.vue +0 -87
- package/src/stories/OmegaForm/EmailForm.vue +0 -48
- package/src/stories/OmegaForm/Meta.vue +0 -47
- package/src/stories/OmegaForm/OneHundredWaysToWriteAForm.vue +0 -188
- package/src/stories/OmegaForm/PersistencyForm.vue +0 -58
- package/src/stories/OmegaForm/SimpleForm.vue +0 -30
- package/src/stories/OmegaForm/SimpleFormVuetifyDefault.vue +0 -15
- package/src/stories/OmegaForm/SumExample.vue +0 -37
- package/src/stories/OmegaForm/form.Input.vue +0 -98
- package/src/stories/OmegaForm.stories.ts +0 -114
- package/src/stories/README.md +0 -29
- package/src/stories/tsconfig.json +0 -4
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type NestedKeyOf, type MetaRecord, type FormType, type OmegaInputProps } from "./OmegaFormStuff";
|
|
2
|
+
import { Order } from "effect-app";
|
|
3
|
+
export type OmegaAutoGenMeta<From, To> = Omit<OmegaInputProps<From, To>, "form">;
|
|
4
|
+
declare const _default: <From, To>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
|
|
6
|
+
form: FormType<From, To> & {
|
|
7
|
+
meta: MetaRecord<To>;
|
|
8
|
+
};
|
|
9
|
+
pick?: NestedKeyOf<To>[];
|
|
10
|
+
omit?: NestedKeyOf<To>[];
|
|
11
|
+
labelMap?: (key: NestedKeyOf<To>) => string | undefined;
|
|
12
|
+
filterMap?: <M extends OmegaAutoGenMeta<From, To>>(key: NestedKeyOf<To>, meta: M) => boolean | M;
|
|
13
|
+
order?: NestedKeyOf<To>[];
|
|
14
|
+
sort?: Order.Order<OmegaAutoGenMeta<From, To>>;
|
|
15
|
+
} & Partial<{}>> & import("vue").PublicProps;
|
|
16
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
17
|
+
attrs: any;
|
|
18
|
+
slots: {
|
|
19
|
+
default(props: {
|
|
20
|
+
child: OmegaAutoGenMeta<From, To>;
|
|
21
|
+
}): void;
|
|
22
|
+
};
|
|
23
|
+
emit: {};
|
|
24
|
+
}>) => import("vue").VNode & {
|
|
25
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_PrettifyLocal<T> = {
|
|
29
|
+
[K in keyof T]: T[K];
|
|
30
|
+
} & {};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { default as OmegaForm } from "./OmegaWrapper.vue";
|
|
2
2
|
import { default as OmegaInput } from "./OmegaInput.vue";
|
|
3
3
|
import { default as OmegaErrors } from "./OmegaErrors.vue";
|
|
4
|
+
import { default as OmegaAutoGen } from "./OmegaAutoGen.vue";
|
|
4
5
|
export * as OmegaErrorsContext from "./OmegaErrorsContext";
|
|
5
6
|
export * from "./OmegaFormStuff";
|
|
6
7
|
export { useOmegaForm } from "./useOmegaForm";
|
|
7
8
|
export { default } from "./OmegaWrapper.vue";
|
|
8
|
-
export { OmegaForm, OmegaInput, OmegaErrors };
|
|
9
|
-
declare const OmegaFormCE: import("vue").VueElementConstructor<unknown>;
|
|
10
|
-
declare const OmegaInputCE: import("vue").VueElementConstructor<unknown>;
|
|
11
|
-
declare const OmegaErrorsCE: import("vue").VueElementConstructor<unknown>;
|
|
12
|
-
export { OmegaFormCE, OmegaInputCE, OmegaErrorsCE };
|
|
13
|
-
export declare function registerOmegaForm(): void;
|
|
9
|
+
export { OmegaForm, OmegaInput, OmegaErrors, OmegaAutoGen };
|
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { provideIntl as
|
|
3
|
-
import { default as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { default as
|
|
9
|
-
import {
|
|
10
|
-
function a(
|
|
11
|
-
for (const e in
|
|
12
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
13
|
-
const o =
|
|
14
|
-
o && typeof o == "object" &&
|
|
1
|
+
import * as t from "./vue-components.es2.js";
|
|
2
|
+
import { provideIntl as l, useIntl as s } from "./vue-components.es3.js";
|
|
3
|
+
import { default as c } from "./vue-components.es4.js";
|
|
4
|
+
import { default as i } from "./vue-components.es5.js";
|
|
5
|
+
import * as m from "./vue-components.es6.js";
|
|
6
|
+
import { useOmegaForm as g } from "./vue-components.es7.js";
|
|
7
|
+
import { duplicateSchema as F, generateInputStandardSchemaFromFieldMeta as I, generateMetaFromSchema as h, nullableInput as y } from "./vue-components.es8.js";
|
|
8
|
+
import { default as b } from "./vue-components.es9.js";
|
|
9
|
+
import { default as E } from "./vue-components.es10.js";
|
|
10
|
+
function a(r) {
|
|
11
|
+
for (const e in t)
|
|
12
|
+
if (Object.prototype.hasOwnProperty.call(t, e)) {
|
|
13
|
+
const o = t[e];
|
|
14
|
+
o && typeof o == "object" && r.component(e, o);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
const n = { install: a };
|
|
18
18
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
i as OmegaAutoGen,
|
|
20
|
+
E as OmegaErrors,
|
|
21
21
|
m as OmegaErrorsContext,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
i as OmegaInput,
|
|
25
|
-
M as OmegaInputCE,
|
|
22
|
+
b as OmegaForm,
|
|
23
|
+
c as OmegaInput,
|
|
26
24
|
n as default,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
l as useIntl,
|
|
25
|
+
F as duplicateSchema,
|
|
26
|
+
I as generateInputStandardSchemaFromFieldMeta,
|
|
27
|
+
h as generateMetaFromSchema,
|
|
28
|
+
y as nullableInput,
|
|
29
|
+
l as provideIntl,
|
|
30
|
+
s as useIntl,
|
|
34
31
|
g as useOmegaForm
|
|
35
32
|
};
|
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import "@tanstack/vue-form";
|
|
7
|
-
import "effect-app";
|
|
8
|
-
const r = e(m), a = e(t), n = e(o);
|
|
9
|
-
function p() {
|
|
10
|
-
customElements.get("omega-form") || customElements.define("omega-form", r), customElements.get("omega-input") || customElements.define("omega-input", a), customElements.get("omega-errors") || customElements.define("omega-errors", n);
|
|
11
|
-
}
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");if(a.appendChild(document.createTextNode(".v-enter-from[data-v-31f11e27],.v-leave-to[data-v-31f11e27]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-31f11e27],.v-leave-active[data-v-31f11e27]{display:grid;transition:all .15s}.v-enter-to[data-v-31f11e27],.v-leave-from[data-v-31f11e27]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-31f11e27]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-31f11e27]{min-height:0}div.error-list[data-v-31f11e27]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:.5em;align-items:start}@container (max-width: 28.125rem){div.error-list[data-v-31f11e27]{grid-template-columns:auto 1fr}.error-link[data-v-31f11e27]{grid-column:1 / -1;justify-self:end}}@container (max-width: 18.75rem){div.error-list[data-v-31f11e27]{grid-template-columns:1fr}.error-message[data-v-31f11e27]{grid-column:1 / -1}}.error-item[data-v-31f11e27]{display:contents}a[data-v-31f11e27]{min-width:min-content}.error-link[data-v-31f11e27]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),document.head.appendChild(a),window.customElements){const e=window.customElements.define;window.customElements.define=function(n,t){const i=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(i&&i.call(this),this.shadowRoot){const r=document.createElement("style");r.appendChild(document.createTextNode(".v-enter-from[data-v-31f11e27],.v-leave-to[data-v-31f11e27]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-31f11e27],.v-leave-active[data-v-31f11e27]{display:grid;transition:all .15s}.v-enter-to[data-v-31f11e27],.v-leave-from[data-v-31f11e27]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-31f11e27]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-31f11e27]{min-height:0}div.error-list[data-v-31f11e27]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:.5em;align-items:start}@container (max-width: 28.125rem){div.error-list[data-v-31f11e27]{grid-template-columns:auto 1fr}.error-link[data-v-31f11e27]{grid-column:1 / -1;justify-self:end}}@container (max-width: 18.75rem){div.error-list[data-v-31f11e27]{grid-template-columns:1fr}.error-message[data-v-31f11e27]{grid-column:1 / -1}}.error-item[data-v-31f11e27]{display:contents}a[data-v-31f11e27]{min-width:min-content}.error-link[data-v-31f11e27]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),this.shadowRoot.appendChild(r)}},e.call(window.customElements,n,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import o from "./vue-components.es15.js";
|
|
3
|
+
|
|
4
|
+
import r from "./vue-components.es13.js";
|
|
5
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-31f11e27"]]);
|
|
12
6
|
export {
|
|
13
|
-
|
|
14
|
-
n as OmegaErrorsCE,
|
|
15
|
-
m as OmegaForm,
|
|
16
|
-
r as OmegaFormCE,
|
|
17
|
-
t as OmegaInput,
|
|
18
|
-
a as OmegaInputCE,
|
|
19
|
-
m as default,
|
|
20
|
-
d as duplicateSchema,
|
|
21
|
-
O as generateInputStandardSchemaFromFieldMeta,
|
|
22
|
-
F as generateMetaFromSchema,
|
|
23
|
-
C as nullableInput,
|
|
24
|
-
p as registerOmegaForm
|
|
7
|
+
e as default
|
|
25
8
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as w, computed as f, onBeforeMount as E, watch as j, createElementBlock as v, openBlock as b, withModifiers as F, createElementVNode as M, unref as c, renderSlot as p, createCommentVNode as k, Fragment as V } from "vue";
|
|
2
2
|
import { useStore as g } from "@tanstack/vue-form";
|
|
3
|
-
import { getOmegaStore as B } from "./vue-components.
|
|
4
|
-
import { provideOmegaErrors as C } from "./vue-components.
|
|
5
|
-
import { useOmegaForm as I } from "./vue-components.
|
|
3
|
+
import { getOmegaStore as B } from "./vue-components.es21.js";
|
|
4
|
+
import { provideOmegaErrors as C } from "./vue-components.es6.js";
|
|
5
|
+
import { useOmegaForm as I } from "./vue-components.es7.js";
|
|
6
6
|
const $ = ["disabled"], N = /* @__PURE__ */ w({
|
|
7
7
|
__name: "OmegaWrapper",
|
|
8
8
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as C, getCurrentInstance as x, computed as B, createBlock as o, openBlock as t, Transition as b, withCtx as l, createElementBlock as c, createCommentVNode as w, unref as e, renderSlot as I, normalizeProps as V, guardReactiveProps as N, resolveDynamicComponent as s, normalizeClass as O, createElementVNode as d, toDisplayString as u, Fragment as g, renderList as k, createTextVNode as y } from "vue";
|
|
2
|
-
import { useOmegaErrors as z } from "./vue-components.
|
|
2
|
+
import { useOmegaErrors as z } from "./vue-components.es6.js";
|
|
3
3
|
import { mdiLink as D } from "@mdi/js";
|
|
4
4
|
import { useIntl as G } from "./vue-components.es3.js";
|
|
5
5
|
const L = {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
|
|
1
|
+
import f from "./vue-components.es5.js";
|
|
3
2
|
export {
|
|
4
|
-
|
|
5
|
-
i as isObject,
|
|
6
|
-
t as isRecordOrArray
|
|
3
|
+
f as default
|
|
7
4
|
};
|
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { OmegaFormKey as c } from "./vue-components.es6.js";
|
|
4
|
-
const w = /* @__PURE__ */ a({
|
|
5
|
-
__name: "OmegaFormInput",
|
|
6
|
-
props: {
|
|
7
|
-
name: {},
|
|
8
|
-
label: {},
|
|
9
|
-
validators: {},
|
|
10
|
-
options: {},
|
|
11
|
-
type: {}
|
|
12
|
-
},
|
|
13
|
-
setup(g) {
|
|
14
|
-
const o = t(c);
|
|
15
|
-
if (!o)
|
|
16
|
-
throw new Error("OmegaFormInput must be used within an OmegaForm context");
|
|
17
|
-
return (e, b) => (m(), n(d, p(e.$props, {
|
|
18
|
-
form: s(o),
|
|
19
|
-
name: e.name,
|
|
20
|
-
label: e.label,
|
|
21
|
-
validators: e.validators,
|
|
22
|
-
options: e.options,
|
|
23
|
-
type: e.type
|
|
24
|
-
}), {
|
|
25
|
-
default: i((r) => [
|
|
26
|
-
l(e.$slots, "default", f(u(r)))
|
|
27
|
-
]),
|
|
28
|
-
_: 3
|
|
29
|
-
}, 16, ["form", "name", "label", "validators", "options", "type"]));
|
|
30
|
-
}
|
|
31
|
-
});
|
|
1
|
+
import { isFunction as c } from "./vue-components.es22.js";
|
|
2
|
+
const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
|
|
32
3
|
export {
|
|
33
|
-
|
|
4
|
+
s as isFunction,
|
|
5
|
+
i as isObject,
|
|
6
|
+
t as isRecordOrArray
|
|
34
7
|
};
|
|
@@ -1,4 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as a, inject as t, createBlock as n, openBlock as m, mergeProps as p, unref as s, withCtx as i, renderSlot as l, normalizeProps as f, guardReactiveProps as u } from "vue";
|
|
2
|
+
import d from "./vue-components.es4.js";
|
|
3
|
+
import { OmegaFormKey as c } from "./vue-components.es7.js";
|
|
4
|
+
const w = /* @__PURE__ */ a({
|
|
5
|
+
__name: "OmegaFormInput",
|
|
6
|
+
props: {
|
|
7
|
+
name: {},
|
|
8
|
+
label: {},
|
|
9
|
+
validators: {},
|
|
10
|
+
options: {},
|
|
11
|
+
type: {}
|
|
12
|
+
},
|
|
13
|
+
setup(g) {
|
|
14
|
+
const o = t(c);
|
|
15
|
+
if (!o)
|
|
16
|
+
throw new Error("OmegaFormInput must be used within an OmegaForm context");
|
|
17
|
+
return (e, b) => (m(), n(d, p(e.$props, {
|
|
18
|
+
form: s(o),
|
|
19
|
+
name: e.name,
|
|
20
|
+
label: e.label,
|
|
21
|
+
validators: e.validators,
|
|
22
|
+
options: e.options,
|
|
23
|
+
type: e.type
|
|
24
|
+
}), {
|
|
25
|
+
default: i((r) => [
|
|
26
|
+
l(e.$slots, "default", f(u(r)))
|
|
27
|
+
]),
|
|
28
|
+
_: 3
|
|
29
|
+
}, 16, ["form", "name", "label", "validators", "options", "type"]));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
2
32
|
export {
|
|
3
|
-
|
|
33
|
+
w as default
|
|
4
34
|
};
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { default as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { default as t } from "./vue-components.es9.js";
|
|
2
|
+
import { default as m } from "./vue-components.es4.js";
|
|
3
|
+
import { default as f } from "./vue-components.es10.js";
|
|
4
|
+
import { default as l } from "./vue-components.es5.js";
|
|
5
|
+
import * as e from "./vue-components.es6.js";
|
|
6
|
+
import { duplicateSchema as d, generateInputStandardSchemaFromFieldMeta as g, generateMetaFromSchema as s, nullableInput as x } from "./vue-components.es8.js";
|
|
7
|
+
import { useOmegaForm as F } from "./vue-components.es7.js";
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
l as OmegaAutoGen,
|
|
10
|
+
f as OmegaErrors,
|
|
11
11
|
e as OmegaErrorsContext,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
d as nullableInput,
|
|
20
|
-
p as registerOmegaForm,
|
|
21
|
-
n as useOmegaForm
|
|
12
|
+
t as OmegaForm,
|
|
13
|
+
m as OmegaInput,
|
|
14
|
+
d as duplicateSchema,
|
|
15
|
+
g as generateInputStandardSchemaFromFieldMeta,
|
|
16
|
+
s as generateMetaFromSchema,
|
|
17
|
+
x as nullableInput,
|
|
18
|
+
F as useOmegaForm
|
|
22
19
|
};
|
|
@@ -1,4 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(o,t){const a=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(a&&a.call(this),this.shadowRoot){const i=document.createElement("style");i.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(i)}},e.call(window.customElements,o,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { defineComponent as B, getCurrentInstance as L, useId as P, computed as l, watch as w, nextTick as S, onMounted as x, ref as T, watchEffect as z, renderSlot as A, normalizeProps as D, guardReactiveProps as F, createElementVNode as M, normalizeClass as N, createBlock as R, createCommentVNode as U, unref as j, openBlock as G, mergeProps as H } from "vue";
|
|
3
|
+
import { useStore as J } from "@tanstack/vue-form";
|
|
4
|
+
import { useOmegaErrors as K } from "./vue-components.es6.js";
|
|
5
|
+
import Q from "./vue-components.es25.js";
|
|
6
|
+
|
|
7
|
+
const te = /* @__PURE__ */ B({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "OmegaInternalInput",
|
|
10
|
+
props: {
|
|
11
|
+
field: {},
|
|
12
|
+
meta: {},
|
|
13
|
+
label: {},
|
|
14
|
+
options: {},
|
|
15
|
+
type: {},
|
|
16
|
+
validators: {}
|
|
17
|
+
},
|
|
18
|
+
setup(C) {
|
|
19
|
+
const e = C, n = L(), $ = n == null ? void 0 : n.appContext.components.VTextField, o = P(), s = e.field, a = J(s.store, (t) => t), f = l(() => {
|
|
20
|
+
var t, r;
|
|
21
|
+
return e.type ? e.type : ((t = e.meta) == null ? void 0 : t.type) === "string" ? e.meta.format === "email" ? "email" : "string" : ((r = e.meta) == null ? void 0 : r.type) || "unknown";
|
|
22
|
+
}), u = l(() => a.value.value), k = l(
|
|
23
|
+
() => (
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
a.value.meta.errors.map((t) => t == null ? void 0 : t.message).filter(Boolean)
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
w(
|
|
29
|
+
() => !!u.value,
|
|
30
|
+
(t) => {
|
|
31
|
+
t || S(() => {
|
|
32
|
+
var r;
|
|
33
|
+
s.setValue(
|
|
34
|
+
((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
), x(() => {
|
|
39
|
+
var t, r;
|
|
40
|
+
!u.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && s.setValue(null);
|
|
41
|
+
});
|
|
42
|
+
const { addError: I, removeError: O, showErrors: _, showErrorsOn: q } = K(), i = T(!1);
|
|
43
|
+
z(() => {
|
|
44
|
+
(_.value || q === "onChange") && (i.value = !0);
|
|
45
|
+
});
|
|
46
|
+
const m = () => {
|
|
47
|
+
i.value = !0;
|
|
48
|
+
};
|
|
49
|
+
x(() => {
|
|
50
|
+
u.value && m();
|
|
51
|
+
});
|
|
52
|
+
const d = l(() => !i.value && f.value !== "select" ? [] : k.value);
|
|
53
|
+
w(
|
|
54
|
+
() => a.value.meta.errors,
|
|
55
|
+
() => {
|
|
56
|
+
a.value.meta.errors.length ? I({
|
|
57
|
+
inputId: o,
|
|
58
|
+
errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
59
|
+
label: e.label
|
|
60
|
+
}) : O(o);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
const p = l(() => {
|
|
64
|
+
var t, r, c, v, g, y, h, b, E, V;
|
|
65
|
+
return {
|
|
66
|
+
id: o,
|
|
67
|
+
required: (t = e.meta) == null ? void 0 : t.required,
|
|
68
|
+
minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((c = e.meta) == null ? void 0 : c.minLength),
|
|
69
|
+
maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
|
|
70
|
+
max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
|
|
71
|
+
min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((E = e.meta) == null ? void 0 : E.minimum),
|
|
72
|
+
name: e.field.name,
|
|
73
|
+
modelValue: e.field.state.value,
|
|
74
|
+
errorMessages: d.value,
|
|
75
|
+
error: !!d.value.length,
|
|
76
|
+
field: e.field,
|
|
77
|
+
setRealDirty: m,
|
|
78
|
+
type: f.value,
|
|
79
|
+
label: `${e.label}${(V = e.meta) != null && V.required ? " *" : ""}`,
|
|
80
|
+
options: e.options
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
return (t, r) => A(t.$slots, "default", D(F(p.value)), () => [
|
|
84
|
+
M("div", {
|
|
85
|
+
class: N(t.$attrs.class),
|
|
86
|
+
onFocusout: m
|
|
87
|
+
}, [
|
|
88
|
+
j($) ? (G(), R(Q, H({
|
|
89
|
+
key: 0,
|
|
90
|
+
"input-props": p.value
|
|
91
|
+
}, t.$attrs, {
|
|
92
|
+
"vuetify-value": p.value.field.state.value
|
|
93
|
+
}), null, 16, ["input-props", "vuetify-value"])) : U("", !0)
|
|
94
|
+
], 34)
|
|
95
|
+
]);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
2
98
|
export {
|
|
3
|
-
|
|
99
|
+
te as default
|
|
4
100
|
};
|
|
@@ -1,100 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
field: {},
|
|
12
|
-
meta: {},
|
|
13
|
-
label: {},
|
|
14
|
-
options: {},
|
|
15
|
-
type: {},
|
|
16
|
-
validators: {}
|
|
17
|
-
},
|
|
18
|
-
setup(C) {
|
|
19
|
-
const e = C, n = L(), $ = n == null ? void 0 : n.appContext.components.VTextField, o = P(), s = e.field, a = J(s.store, (t) => t), f = l(() => {
|
|
20
|
-
var t, r;
|
|
21
|
-
return e.type ? e.type : ((t = e.meta) == null ? void 0 : t.type) === "string" ? e.meta.format === "email" ? "email" : "string" : ((r = e.meta) == null ? void 0 : r.type) || "unknown";
|
|
22
|
-
}), u = l(() => a.value.value), k = l(
|
|
23
|
-
() => (
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
-
a.value.meta.errors.map((t) => t == null ? void 0 : t.message).filter(Boolean)
|
|
26
|
-
)
|
|
27
|
-
);
|
|
28
|
-
w(
|
|
29
|
-
() => !!u.value,
|
|
30
|
-
(t) => {
|
|
31
|
-
t || S(() => {
|
|
32
|
-
var r;
|
|
33
|
-
s.setValue(
|
|
34
|
-
((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
|
|
35
|
-
);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
), x(() => {
|
|
39
|
-
var t, r;
|
|
40
|
-
!u.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && s.setValue(null);
|
|
41
|
-
});
|
|
42
|
-
const { addError: I, removeError: O, showErrors: _, showErrorsOn: q } = K(), i = T(!1);
|
|
43
|
-
z(() => {
|
|
44
|
-
(_.value || q === "onChange") && (i.value = !0);
|
|
45
|
-
});
|
|
46
|
-
const m = () => {
|
|
47
|
-
i.value = !0;
|
|
48
|
-
};
|
|
49
|
-
x(() => {
|
|
50
|
-
u.value && m();
|
|
51
|
-
});
|
|
52
|
-
const d = l(() => !i.value && f.value !== "select" ? [] : k.value);
|
|
53
|
-
w(
|
|
54
|
-
() => a.value.meta.errors,
|
|
55
|
-
() => {
|
|
56
|
-
a.value.meta.errors.length ? I({
|
|
57
|
-
inputId: o,
|
|
58
|
-
errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
|
|
59
|
-
label: e.label
|
|
60
|
-
}) : O(o);
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
const p = l(() => {
|
|
64
|
-
var t, r, c, v, g, y, h, b, E, V;
|
|
65
|
-
return {
|
|
66
|
-
id: o,
|
|
67
|
-
required: (t = e.meta) == null ? void 0 : t.required,
|
|
68
|
-
minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((c = e.meta) == null ? void 0 : c.minLength),
|
|
69
|
-
maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
|
|
70
|
-
max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
|
|
71
|
-
min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((E = e.meta) == null ? void 0 : E.minimum),
|
|
72
|
-
name: e.field.name,
|
|
73
|
-
modelValue: e.field.state.value,
|
|
74
|
-
errorMessages: d.value,
|
|
75
|
-
error: !!d.value.length,
|
|
76
|
-
field: e.field,
|
|
77
|
-
setRealDirty: m,
|
|
78
|
-
type: f.value,
|
|
79
|
-
label: `${e.label}${(V = e.meta) != null && V.required ? " *" : ""}`,
|
|
80
|
-
options: e.options
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
return (t, r) => A(t.$slots, "default", D(F(p.value)), () => [
|
|
84
|
-
M("div", {
|
|
85
|
-
class: N(t.$attrs.class),
|
|
86
|
-
onFocusout: m
|
|
87
|
-
}, [
|
|
88
|
-
j($) ? (G(), R(Q, H({
|
|
89
|
-
key: 0,
|
|
90
|
-
"input-props": p.value
|
|
91
|
-
}, t.$attrs, {
|
|
92
|
-
"vuetify-value": p.value.field.state.value
|
|
93
|
-
}), null, 16, ["input-props", "vuetify-value"])) : U("", !0)
|
|
94
|
-
], 34)
|
|
95
|
-
]);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
1
|
+
import { useStore as u } from "@tanstack/vue-form";
|
|
2
|
+
import { computed as f } from "vue";
|
|
3
|
+
function c(o, t) {
|
|
4
|
+
return f(() => t ? u(o.store, (n) => {
|
|
5
|
+
const r = {};
|
|
6
|
+
for (const e of t)
|
|
7
|
+
r[e] = n[e];
|
|
8
|
+
return r;
|
|
9
|
+
}).value : {});
|
|
10
|
+
}
|
|
98
11
|
export {
|
|
99
|
-
|
|
12
|
+
c as getOmegaStore
|
|
100
13
|
};
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { computed as f } from "vue";
|
|
3
|
-
function c(o, t) {
|
|
4
|
-
return f(() => t ? u(o.store, (n) => {
|
|
5
|
-
const r = {};
|
|
6
|
-
for (const e of t)
|
|
7
|
-
r[e] = n[e];
|
|
8
|
-
return r;
|
|
9
|
-
}).value : {});
|
|
10
|
-
}
|
|
1
|
+
const o = (n) => typeof n == "function";
|
|
11
2
|
export {
|
|
12
|
-
|
|
3
|
+
o as isFunction
|
|
13
4
|
};
|