@effect-app/vue-components 0.6.3 → 0.7.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/OmegaArray.vue.d.ts +24 -0
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +15 -1
- package/dist/types/components/OmegaForm/index.d.ts +2 -1
- package/dist/vue-components.es.js +22 -19
- package/dist/vue-components.es10.js +5 -5
- package/dist/vue-components.es11.js +6 -108
- package/dist/vue-components.es12.js +110 -0
- package/dist/vue-components.es14.js +7 -2
- package/dist/vue-components.es15.js +2 -88
- package/dist/vue-components.es16.js +90 -0
- package/dist/vue-components.es18.js +2 -5
- package/dist/vue-components.es19.js +2 -32
- package/dist/vue-components.es2.js +14 -11
- package/dist/vue-components.es20.js +5 -2
- package/dist/vue-components.es21.js +32 -2
- package/dist/vue-components.es23.js +2 -2
- package/dist/vue-components.es24.js +2 -2
- package/dist/vue-components.es25.js +2 -115
- package/dist/vue-components.es26.js +4 -0
- package/dist/vue-components.es27.js +115 -4
- package/dist/vue-components.es29.js +6 -0
- package/dist/vue-components.es4.js +22 -18
- package/dist/vue-components.es6.js +50 -36
- package/dist/vue-components.es7.js +34 -131
- package/dist/vue-components.es8.js +128 -211
- package/dist/vue-components.es9.js +218 -6
- package/package.json +3 -3
- package/src/components/OmegaForm/OmegaArray.vue +67 -0
- package/src/components/OmegaForm/OmegaErrors.vue +7 -3
- package/src/components/OmegaForm/OmegaFormInput.vue +6 -2
- package/src/components/OmegaForm/OmegaFormStuff.ts +4 -1
- package/src/components/OmegaForm/OmegaInput.vue +11 -1
- package/src/components/OmegaForm/index.ts +2 -1
- package/dist/vue-components.es13.js +0 -9
- package/dist/vue-components.es17.js +0 -4
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type OmegaInputProps } from "./OmegaFormStuff";
|
|
2
|
+
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<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & Omit<OmegaInputProps<From, To>, "type" | "validators" | "label" | "options"> & Partial<{}>> & import("vue").PublicProps;
|
|
4
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
5
|
+
attrs: any;
|
|
6
|
+
slots: {
|
|
7
|
+
default?: ((props: {
|
|
8
|
+
field: any;
|
|
9
|
+
subField: any;
|
|
10
|
+
subState: any;
|
|
11
|
+
index: number;
|
|
12
|
+
}) => any) | undefined;
|
|
13
|
+
field?: ((props: {
|
|
14
|
+
field: any;
|
|
15
|
+
}) => any) | undefined;
|
|
16
|
+
};
|
|
17
|
+
emit: {};
|
|
18
|
+
}>) => import("vue").VNode & {
|
|
19
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_PrettifyLocal<T> = {
|
|
23
|
+
[K in keyof T]: T[K];
|
|
24
|
+
} & {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S, type Effect } from "effect-app";
|
|
1
|
+
import { S, type Record, type Effect } from "effect-app";
|
|
2
2
|
import { type FormAsyncValidateOrFn, type FormValidateOrFn, type StandardSchemaV1, type FormApi, type VueFormApi, type FieldComponent, type FormOptions, type DeepKeys, type FieldValidateOrFn, type FieldAsyncValidateOrFn, type FormState } from "@tanstack/vue-form";
|
|
3
3
|
import type { Component } from "vue";
|
|
4
4
|
export type ShowErrorsOn = "onChange" | "onBlur" | "onSubmit";
|
|
@@ -67,6 +67,7 @@ export type SelectFieldMeta = BaseFieldMeta & {
|
|
|
67
67
|
export type MultipleFieldMeta = BaseFieldMeta & {
|
|
68
68
|
type: "multiple";
|
|
69
69
|
members: any[];
|
|
70
|
+
rest: S.AST.Type[];
|
|
70
71
|
};
|
|
71
72
|
export type BooleanFieldMeta = BaseFieldMeta & {
|
|
72
73
|
type: "boolean";
|
|
@@ -84,6 +85,18 @@ export type FilterItems = {
|
|
|
84
85
|
readonly message: string | Effect.Effect<string>;
|
|
85
86
|
};
|
|
86
87
|
};
|
|
88
|
+
type CreateMeta = {
|
|
89
|
+
parent?: string;
|
|
90
|
+
meta?: Record<string, any>;
|
|
91
|
+
nullableOrUndefined?: false | "undefined" | "null";
|
|
92
|
+
} & ({
|
|
93
|
+
propertySignatures: readonly S.AST.PropertySignature[];
|
|
94
|
+
property?: never;
|
|
95
|
+
} | {
|
|
96
|
+
propertySignatures?: never;
|
|
97
|
+
property: S.AST.AST;
|
|
98
|
+
});
|
|
99
|
+
export declare const createMeta: <T = any>({ meta, parent, property, propertySignatures }: CreateMeta, acc?: Partial<MetaRecord<T>>) => MetaRecord<T> | FieldMeta;
|
|
87
100
|
export declare const duplicateSchema: <From, To>(schema: S.Schema<From, To, never>) => S.extend<S.Schema<From, To, never>, import("effect/Schema").Struct<{}>>;
|
|
88
101
|
export declare const generateMetaFromSchema: <From, To>(schema: S.Schema<From, To, never>) => {
|
|
89
102
|
schema: S.Schema<From, To, never>;
|
|
@@ -94,3 +107,4 @@ export declare const generateInputStandardSchemaFromFieldMeta: (meta: FieldMeta)
|
|
|
94
107
|
export declare const nullableInput: <A, I, R>(schema: S.Schema<A, I, R>, defaultValue: () => A) => S.transform<import("effect/Schema").NullOr<S.Schema<A, I, R>> & {
|
|
95
108
|
withDefault: S.PropertySignature<":", A | null, never, ":", I | null, true, R>;
|
|
96
109
|
}, S.SchemaClass<A, A, never>>;
|
|
110
|
+
export {};
|
|
@@ -2,8 +2,9 @@ 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
4
|
import { default as OmegaAutoGen } from "./OmegaAutoGen.vue";
|
|
5
|
+
import { default as OmegaArray } from "./OmegaArray.vue";
|
|
5
6
|
export * as OmegaErrorsContext from "./OmegaErrorsContext";
|
|
6
7
|
export * from "./OmegaFormStuff";
|
|
7
8
|
export { useOmegaForm, type OmegaFormReturn } from "./useOmegaForm";
|
|
8
9
|
export { default } from "./OmegaWrapper.vue";
|
|
9
|
-
export { OmegaForm, OmegaInput, OmegaErrors, OmegaAutoGen };
|
|
10
|
+
export { OmegaForm, OmegaInput, OmegaErrors, OmegaAutoGen, OmegaArray };
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as o from "./vue-components.es2.js";
|
|
2
2
|
import { provideIntl as l, useIntl as s } from "./vue-components.es3.js";
|
|
3
3
|
import { default as c } from "./vue-components.es4.js";
|
|
4
|
-
import { default as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { default as
|
|
4
|
+
import { default as x } from "./vue-components.es5.js";
|
|
5
|
+
import { default as g } from "./vue-components.es6.js";
|
|
6
|
+
import * as m from "./vue-components.es7.js";
|
|
7
|
+
import { useOmegaForm as y } from "./vue-components.es8.js";
|
|
8
|
+
import { createMeta as I, duplicateSchema as h, generateInputStandardSchemaFromFieldMeta as S, generateMetaFromSchema as b, nullableInput as M } from "./vue-components.es9.js";
|
|
9
|
+
import { default as A } from "./vue-components.es10.js";
|
|
10
|
+
import { default as k } from "./vue-components.es11.js";
|
|
10
11
|
function a(r) {
|
|
11
|
-
for (const e in
|
|
12
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
for (const e in o)
|
|
13
|
+
if (Object.prototype.hasOwnProperty.call(o, e)) {
|
|
14
|
+
const t = o[e];
|
|
15
|
+
t && typeof t == "object" && r.component(e, t);
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
const n = { install: a };
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
g as OmegaArray,
|
|
21
|
+
x as OmegaAutoGen,
|
|
22
|
+
k as OmegaErrors,
|
|
21
23
|
m as OmegaErrorsContext,
|
|
22
|
-
|
|
24
|
+
A as OmegaForm,
|
|
23
25
|
c as OmegaInput,
|
|
26
|
+
I as createMeta,
|
|
24
27
|
n as default,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
h as duplicateSchema,
|
|
29
|
+
S as generateInputStandardSchemaFromFieldMeta,
|
|
30
|
+
b as generateMetaFromSchema,
|
|
31
|
+
M as nullableInput,
|
|
29
32
|
l as provideIntl,
|
|
30
33
|
s as useIntl,
|
|
31
|
-
|
|
34
|
+
y as useOmegaForm
|
|
32
35
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
import o from "./vue-components.
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-a32b1c91]{display:contents}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(c,t){const o=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(o&&o.call(this),this.shadowRoot){const d=document.createElement("style");d.appendChild(document.createTextNode("fieldset[data-v-a32b1c91]{display:contents}")),this.shadowRoot.appendChild(d)}},e.call(window.customElements,c,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import o from "./vue-components.es12.js";
|
|
3
3
|
|
|
4
|
-
import r from "./vue-components.
|
|
5
|
-
const
|
|
4
|
+
import r from "./vue-components.es14.js";
|
|
5
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a32b1c91"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,110 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const $ = ["disabled"], N = /* @__PURE__ */ w({
|
|
7
|
-
__name: "OmegaWrapper",
|
|
8
|
-
props: {
|
|
9
|
-
omegaConfig: {},
|
|
10
|
-
subscribe: {},
|
|
11
|
-
showErrorsOn: {},
|
|
12
|
-
defaultValues: {},
|
|
13
|
-
defaultState: {},
|
|
14
|
-
asyncAlways: { type: Boolean },
|
|
15
|
-
asyncDebounceMs: {},
|
|
16
|
-
validators: {},
|
|
17
|
-
onSubmitMeta: {},
|
|
18
|
-
onSubmitInvalid: { type: Function },
|
|
19
|
-
transform: {},
|
|
20
|
-
onSubmit: { type: Function },
|
|
21
|
-
form: {},
|
|
22
|
-
schema: {}
|
|
23
|
-
},
|
|
24
|
-
setup(O) {
|
|
25
|
-
const o = O, m = f(() => {
|
|
26
|
-
if (!(o.form || !o.schema))
|
|
27
|
-
return I(o.schema, o, o.omegaConfig);
|
|
28
|
-
}), t = f(() => o.form ?? m.value);
|
|
29
|
-
E(() => {
|
|
30
|
-
if (!o.form) return;
|
|
31
|
-
const e = Object.keys(o.form.options || {}), s = /* @__PURE__ */ new Set([
|
|
32
|
-
"omegaConfig",
|
|
33
|
-
"subscribe",
|
|
34
|
-
"showErrorsOn",
|
|
35
|
-
"asyncAlways",
|
|
36
|
-
"form",
|
|
37
|
-
"schema"
|
|
38
|
-
]), i = Object.fromEntries(
|
|
39
|
-
Object.entries(o).filter(
|
|
40
|
-
([a, u]) => !s.has(a) && u !== void 0
|
|
41
|
-
)
|
|
42
|
-
), r = Object.keys(i), n = e.filter(
|
|
43
|
-
(a) => r.includes(a) && i[a] !== void 0
|
|
44
|
-
);
|
|
45
|
-
n.length > 0 && console.warn(
|
|
46
|
-
`[OmegaWrapper] Overlapping keys found between form options and filtered props:
|
|
47
|
-
${n.join(
|
|
48
|
-
`,
|
|
49
|
-
`
|
|
50
|
-
)}.
|
|
51
|
-
Props will overwrite existing form options. This might indicate a configuration issue.`
|
|
52
|
-
);
|
|
53
|
-
const S = {
|
|
54
|
-
...t.value.options,
|
|
55
|
-
...i
|
|
56
|
-
};
|
|
57
|
-
t.value.options = Object.fromEntries(
|
|
58
|
-
Object.entries(S).filter(([a, u]) => u !== void 0)
|
|
59
|
-
);
|
|
60
|
-
});
|
|
61
|
-
const h = g(
|
|
62
|
-
t.value.store,
|
|
63
|
-
(e) => e.isSubmitting
|
|
64
|
-
), d = B(
|
|
65
|
-
t.value,
|
|
66
|
-
o.subscribe
|
|
67
|
-
), y = g(
|
|
68
|
-
t.value.store,
|
|
69
|
-
(e) => e.submissionAttempts
|
|
70
|
-
), l = f(() => t.value.useStore((e) => e.errors));
|
|
71
|
-
return j(
|
|
72
|
-
() => [t.value.filterItems, l.value.value],
|
|
73
|
-
() => {
|
|
74
|
-
const e = t.value.filterItems, s = l.value.value;
|
|
75
|
-
return e ? s ? (Object.values(s).filter(
|
|
76
|
-
(r) => !!r
|
|
77
|
-
).flatMap(
|
|
78
|
-
(r) => Object.values(r).flat().map((n) => n.message)
|
|
79
|
-
).some((r) => r === e.message) && e.items.forEach((r) => {
|
|
80
|
-
const n = t.value.getFieldMeta(r);
|
|
81
|
-
n && t.value.setFieldMeta(r, {
|
|
82
|
-
...n,
|
|
83
|
-
errorMap: {
|
|
84
|
-
onSubmit: [
|
|
85
|
-
{ path: [r], message: e.message }
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}), {}) : {} : {};
|
|
90
|
-
}
|
|
91
|
-
), C(y, l.value, o.showErrorsOn), (e, s) => (b(), v("form", {
|
|
92
|
-
novalidate: "",
|
|
93
|
-
onSubmit: s[0] || (s[0] = F((i) => t.value.handleSubmit(), ["prevent", "stop"]))
|
|
94
|
-
}, [
|
|
95
|
-
M("fieldset", { disabled: c(h) }, [
|
|
96
|
-
o.form ? (b(), v(V, { key: 0 }, [
|
|
97
|
-
p(e.$slots, "externalForm", { subscribedValues: c(d) }, void 0, !0),
|
|
98
|
-
p(e.$slots, "default", {}, void 0, !0)
|
|
99
|
-
], 64)) : m.value ? p(e.$slots, "internalForm", {
|
|
100
|
-
key: 1,
|
|
101
|
-
form: m.value,
|
|
102
|
-
subscribedValues: c(d)
|
|
103
|
-
}, void 0, !0) : k("", !0)
|
|
104
|
-
], 8, $)
|
|
105
|
-
], 32));
|
|
106
|
-
}
|
|
107
|
-
});
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");if(t.appendChild(document.createTextNode(".v-enter-from[data-v-9c44b8ac],.v-leave-to[data-v-9c44b8ac]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-9c44b8ac],.v-leave-active[data-v-9c44b8ac]{display:grid;transition:all .15s}.v-enter-to[data-v-9c44b8ac],.v-leave-from[data-v-9c44b8ac]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-9c44b8ac]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-9c44b8ac]{min-height:0}.error-list[data-v-9c44b8ac]{list-style-position:inside}div.error-list[data-v-9c44b8ac]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-9c44b8ac]{grid-template-columns:auto 1fr}.error-link[data-v-9c44b8ac]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-9c44b8ac]{grid-template-columns:1fr}.error-message[data-v-9c44b8ac]{grid-column:1 / -1}}.error-item[data-v-9c44b8ac]{display:contents}a[data-v-9c44b8ac]{min-width:min-content}.error-link[data-v-9c44b8ac]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),document.head.appendChild(t),window.customElements){const a=window.customElements.define;window.customElements.define=function(c,e){const i=e.prototype.connectedCallback;return e.prototype.connectedCallback=function(){if(i&&i.call(this),this.shadowRoot){const r=document.createElement("style");r.appendChild(document.createTextNode(".v-enter-from[data-v-9c44b8ac],.v-leave-to[data-v-9c44b8ac]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-9c44b8ac],.v-leave-active[data-v-9c44b8ac]{display:grid;transition:all .15s}.v-enter-to[data-v-9c44b8ac],.v-leave-from[data-v-9c44b8ac]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-9c44b8ac]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-9c44b8ac]{min-height:0}.error-list[data-v-9c44b8ac]{list-style-position:inside}div.error-list[data-v-9c44b8ac]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-9c44b8ac]{grid-template-columns:auto 1fr}.error-link[data-v-9c44b8ac]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-9c44b8ac]{grid-template-columns:1fr}.error-message[data-v-9c44b8ac]{grid-column:1 / -1}}.error-item[data-v-9c44b8ac]{display:contents}a[data-v-9c44b8ac]{min-width:min-content}.error-link[data-v-9c44b8ac]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),this.shadowRoot.appendChild(r)}},a.call(window.customElements,c,e)}}}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
+
import o from "./vue-components.es16.js";
|
|
3
|
+
|
|
4
|
+
import r from "./vue-components.es14.js";
|
|
5
|
+
const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9c44b8ac"]]);
|
|
108
6
|
export {
|
|
109
|
-
|
|
7
|
+
c as default
|
|
110
8
|
};
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
import { useStore as g } from "@tanstack/vue-form";
|
|
3
|
+
import { getOmegaStore as B } from "./vue-components.es22.js";
|
|
4
|
+
import { provideOmegaErrors as C } from "./vue-components.es7.js";
|
|
5
|
+
import { useOmegaForm as I } from "./vue-components.es8.js";
|
|
6
|
+
const $ = ["disabled"], N = /* @__PURE__ */ w({
|
|
7
|
+
__name: "OmegaWrapper",
|
|
8
|
+
props: {
|
|
9
|
+
omegaConfig: {},
|
|
10
|
+
subscribe: {},
|
|
11
|
+
showErrorsOn: {},
|
|
12
|
+
defaultValues: {},
|
|
13
|
+
defaultState: {},
|
|
14
|
+
asyncAlways: { type: Boolean },
|
|
15
|
+
asyncDebounceMs: {},
|
|
16
|
+
validators: {},
|
|
17
|
+
onSubmitMeta: {},
|
|
18
|
+
onSubmitInvalid: { type: Function },
|
|
19
|
+
transform: {},
|
|
20
|
+
onSubmit: { type: Function },
|
|
21
|
+
form: {},
|
|
22
|
+
schema: {}
|
|
23
|
+
},
|
|
24
|
+
setup(O) {
|
|
25
|
+
const o = O, m = f(() => {
|
|
26
|
+
if (!(o.form || !o.schema))
|
|
27
|
+
return I(o.schema, o, o.omegaConfig);
|
|
28
|
+
}), t = f(() => o.form ?? m.value);
|
|
29
|
+
E(() => {
|
|
30
|
+
if (!o.form) return;
|
|
31
|
+
const e = Object.keys(o.form.options || {}), s = /* @__PURE__ */ new Set([
|
|
32
|
+
"omegaConfig",
|
|
33
|
+
"subscribe",
|
|
34
|
+
"showErrorsOn",
|
|
35
|
+
"asyncAlways",
|
|
36
|
+
"form",
|
|
37
|
+
"schema"
|
|
38
|
+
]), i = Object.fromEntries(
|
|
39
|
+
Object.entries(o).filter(
|
|
40
|
+
([a, u]) => !s.has(a) && u !== void 0
|
|
41
|
+
)
|
|
42
|
+
), r = Object.keys(i), n = e.filter(
|
|
43
|
+
(a) => r.includes(a) && i[a] !== void 0
|
|
44
|
+
);
|
|
45
|
+
n.length > 0 && console.warn(
|
|
46
|
+
`[OmegaWrapper] Overlapping keys found between form options and filtered props:
|
|
47
|
+
${n.join(
|
|
48
|
+
`,
|
|
49
|
+
`
|
|
50
|
+
)}.
|
|
51
|
+
Props will overwrite existing form options. This might indicate a configuration issue.`
|
|
52
|
+
);
|
|
53
|
+
const S = {
|
|
54
|
+
...t.value.options,
|
|
55
|
+
...i
|
|
56
|
+
};
|
|
57
|
+
t.value.options = Object.fromEntries(
|
|
58
|
+
Object.entries(S).filter(([a, u]) => u !== void 0)
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
const h = g(
|
|
62
|
+
t.value.store,
|
|
63
|
+
(e) => e.isSubmitting
|
|
64
|
+
), d = B(
|
|
65
|
+
t.value,
|
|
66
|
+
o.subscribe
|
|
67
|
+
), y = g(
|
|
68
|
+
t.value.store,
|
|
69
|
+
(e) => e.submissionAttempts
|
|
70
|
+
), l = f(() => t.value.useStore((e) => e.errors));
|
|
71
|
+
return j(
|
|
72
|
+
() => [t.value.filterItems, l.value.value],
|
|
73
|
+
() => {
|
|
74
|
+
const e = t.value.filterItems, s = l.value.value;
|
|
75
|
+
return e ? s ? (Object.values(s).filter(
|
|
76
|
+
(r) => !!r
|
|
77
|
+
).flatMap(
|
|
78
|
+
(r) => Object.values(r).flat().map((n) => n.message)
|
|
79
|
+
).some((r) => r === e.message) && e.items.forEach((r) => {
|
|
80
|
+
const n = t.value.getFieldMeta(r);
|
|
81
|
+
n && t.value.setFieldMeta(r, {
|
|
82
|
+
...n,
|
|
83
|
+
errorMap: {
|
|
84
|
+
onSubmit: [
|
|
85
|
+
{ path: [r], message: e.message }
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}), {}) : {} : {};
|
|
90
|
+
}
|
|
91
|
+
), C(y, l.value, o.showErrorsOn), (e, s) => (b(), v("form", {
|
|
92
|
+
novalidate: "",
|
|
93
|
+
onSubmit: s[0] || (s[0] = F((i) => t.value.handleSubmit(), ["prevent", "stop"]))
|
|
94
|
+
}, [
|
|
95
|
+
M("fieldset", { disabled: c(h) }, [
|
|
96
|
+
o.form ? (b(), v(V, { key: 0 }, [
|
|
97
|
+
p(e.$slots, "externalForm", { subscribedValues: c(d) }, void 0, !0),
|
|
98
|
+
p(e.$slots, "default", {}, void 0, !0)
|
|
99
|
+
], 64)) : m.value ? p(e.$slots, "internalForm", {
|
|
100
|
+
key: 1,
|
|
101
|
+
form: m.value,
|
|
102
|
+
subscribedValues: c(d)
|
|
103
|
+
}, void 0, !0) : k("", !0)
|
|
104
|
+
], 8, $)
|
|
105
|
+
], 32));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
export {
|
|
109
|
+
N as default
|
|
110
|
+
};
|
|
@@ -1,90 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useOmegaErrors as z } from "./vue-components.es6.js";
|
|
3
|
-
import { mdiLink as D } from "@mdi/js";
|
|
4
|
-
import { useIntl as G } from "./vue-components.es3.js";
|
|
5
|
-
const L = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "error-alert"
|
|
8
|
-
}, M = { class: "text-h6 mb-3" }, P = { class: "font-weight-medium" }, S = { class: "error-message" }, T = ["href"], $ = { key: 1 }, H = /* @__PURE__ */ C({
|
|
9
|
-
__name: "OmegaErrors",
|
|
10
|
-
setup(j) {
|
|
11
|
-
const m = x(), f = m == null ? void 0 : m.appContext.components.VAlert, { errors: n, generalErrors: _, showErrors: E } = z(), { trans: h } = G(), p = B(() => _.value ? _.value.filter(
|
|
12
|
-
(i) => !!i
|
|
13
|
-
).flatMap(
|
|
14
|
-
(i) => Object.values(i).filter((a) => !!a).flatMap(
|
|
15
|
-
(a) => a.filter(
|
|
16
|
-
(r) => !!(r != null && r.message)
|
|
17
|
-
).map((r) => r.message)
|
|
18
|
-
)
|
|
19
|
-
) : []);
|
|
20
|
-
return (i, a) => (t(), o(b, null, {
|
|
21
|
-
default: l(() => [
|
|
22
|
-
e(E) && (e(n).length || p.value.length) ? (t(), c("div", L, [
|
|
23
|
-
I(i.$slots, "default", V(N({ errors: e(n), showedGeneralErrors: p.value })), () => [
|
|
24
|
-
(t(), o(s(e(f) ? "v-alert" : "div"), {
|
|
25
|
-
class: O([e(f) ? "mb-4" : "error-alert-content", "mb-4"]),
|
|
26
|
-
type: "error",
|
|
27
|
-
variant: "tonal",
|
|
28
|
-
role: "alert",
|
|
29
|
-
"aria-live": "polite"
|
|
30
|
-
}, {
|
|
31
|
-
default: l(() => [
|
|
32
|
-
d("div", M, u(e(h)("form.includes_error")) + ":", 1),
|
|
33
|
-
e(n).length ? (t(), o(s(e(n).length > 1 ? "ul" : "div"), {
|
|
34
|
-
key: 0,
|
|
35
|
-
class: "error-list"
|
|
36
|
-
}, {
|
|
37
|
-
default: l(() => [
|
|
38
|
-
(t(!0), c(g, null, k(e(n), (r) => (t(), o(s(e(n).length > 1 ? "li" : "div"), {
|
|
39
|
-
key: r.inputId,
|
|
40
|
-
class: "error-item"
|
|
41
|
-
}, {
|
|
42
|
-
default: l(() => [
|
|
43
|
-
d("div", P, u(r.label), 1),
|
|
44
|
-
d("div", S, [
|
|
45
|
-
(t(), o(s(r.errors.length > 1 ? "ul" : "div"), { class: "error-list" }, {
|
|
46
|
-
default: l(() => [
|
|
47
|
-
(t(!0), c(g, null, k(r.errors, (v) => (t(), o(s(r.errors.length > 1 ? "li" : "span"), { key: v }, {
|
|
48
|
-
default: l(() => [
|
|
49
|
-
y(u(v), 1)
|
|
50
|
-
]),
|
|
51
|
-
_: 2
|
|
52
|
-
}, 1024))), 128))
|
|
53
|
-
]),
|
|
54
|
-
_: 2
|
|
55
|
-
}, 1024))
|
|
56
|
-
]),
|
|
57
|
-
d("a", {
|
|
58
|
-
href: `#${r.inputId}`,
|
|
59
|
-
class: "error-link"
|
|
60
|
-
}, [
|
|
61
|
-
(t(), o(s(e(f) ? "v-icon" : "i"), {
|
|
62
|
-
icon: e(D),
|
|
63
|
-
"aria-hidden": "true"
|
|
64
|
-
}, {
|
|
65
|
-
default: l(() => a[0] || (a[0] = [
|
|
66
|
-
d("i", null, "🔗", -1)
|
|
67
|
-
])),
|
|
68
|
-
_: 1
|
|
69
|
-
}, 8, ["icon"])),
|
|
70
|
-
y(" " + u(e(h)("form.fix_input")), 1)
|
|
71
|
-
], 8, T)
|
|
72
|
-
]),
|
|
73
|
-
_: 2
|
|
74
|
-
}, 1024))), 128))
|
|
75
|
-
]),
|
|
76
|
-
_: 1
|
|
77
|
-
})) : (t(), c("span", $, u(p.value[0]), 1))
|
|
78
|
-
]),
|
|
79
|
-
_: 1
|
|
80
|
-
}, 8, ["class"]))
|
|
81
|
-
], !0)
|
|
82
|
-
])) : w("", !0)
|
|
83
|
-
]),
|
|
84
|
-
_: 3
|
|
85
|
-
}));
|
|
86
|
-
}
|
|
87
|
-
});
|
|
1
|
+
import f from "./vue-components.es4.js";
|
|
88
2
|
export {
|
|
89
|
-
|
|
3
|
+
f as default
|
|
90
4
|
};
|
|
@@ -0,0 +1,90 @@
|
|
|
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.es7.js";
|
|
3
|
+
import { mdiLink as D } from "@mdi/js";
|
|
4
|
+
import { useIntl as G } from "./vue-components.es3.js";
|
|
5
|
+
const L = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "error-alert"
|
|
8
|
+
}, M = { class: "text-h6 mb-3" }, P = { class: "font-weight-medium" }, S = { class: "error-message" }, T = ["href"], $ = { key: 1 }, H = /* @__PURE__ */ C({
|
|
9
|
+
__name: "OmegaErrors",
|
|
10
|
+
setup(j) {
|
|
11
|
+
const m = x(), f = m == null ? void 0 : m.appContext.components.VAlert, { errors: n, generalErrors: _, showErrors: E } = z(), { trans: h } = G(), p = B(() => _.value ? _.value.filter(
|
|
12
|
+
(i) => !!i
|
|
13
|
+
).flatMap(
|
|
14
|
+
(i) => Object.values(i).filter((a) => !!a).flatMap(
|
|
15
|
+
(a) => a.filter(
|
|
16
|
+
(r) => !!(r != null && r.message)
|
|
17
|
+
).map((r) => r.message)
|
|
18
|
+
)
|
|
19
|
+
) : []);
|
|
20
|
+
return (i, a) => (t(), o(b, null, {
|
|
21
|
+
default: l(() => [
|
|
22
|
+
e(E) && (e(n).length || p.value.length) ? (t(), c("div", L, [
|
|
23
|
+
I(i.$slots, "default", V(N({ errors: e(n), showedGeneralErrors: p.value })), () => [
|
|
24
|
+
(t(), o(s(e(f) ? "v-alert" : "div"), {
|
|
25
|
+
class: O([e(f) ? "mb-4" : "error-alert-content", "mb-4"]),
|
|
26
|
+
type: "error",
|
|
27
|
+
variant: "tonal",
|
|
28
|
+
role: "alert",
|
|
29
|
+
"aria-live": "polite"
|
|
30
|
+
}, {
|
|
31
|
+
default: l(() => [
|
|
32
|
+
d("div", M, u(e(h)("form.includes_error")) + ":", 1),
|
|
33
|
+
e(n).length ? (t(), o(s(e(n).length > 1 ? "ul" : "div"), {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "error-list"
|
|
36
|
+
}, {
|
|
37
|
+
default: l(() => [
|
|
38
|
+
(t(!0), c(g, null, k(e(n), (r) => (t(), o(s(e(n).length > 1 ? "li" : "div"), {
|
|
39
|
+
key: r.inputId,
|
|
40
|
+
class: "error-item"
|
|
41
|
+
}, {
|
|
42
|
+
default: l(() => [
|
|
43
|
+
d("div", P, u(r.label), 1),
|
|
44
|
+
d("div", S, [
|
|
45
|
+
(t(), o(s(r.errors.length > 1 ? "ul" : "div"), { class: "error-list" }, {
|
|
46
|
+
default: l(() => [
|
|
47
|
+
(t(!0), c(g, null, k(r.errors, (v) => (t(), o(s(r.errors.length > 1 ? "li" : "span"), { key: v }, {
|
|
48
|
+
default: l(() => [
|
|
49
|
+
y(u(v), 1)
|
|
50
|
+
]),
|
|
51
|
+
_: 2
|
|
52
|
+
}, 1024))), 128))
|
|
53
|
+
]),
|
|
54
|
+
_: 2
|
|
55
|
+
}, 1024))
|
|
56
|
+
]),
|
|
57
|
+
d("a", {
|
|
58
|
+
href: `#${r.inputId}`,
|
|
59
|
+
class: "error-link"
|
|
60
|
+
}, [
|
|
61
|
+
(t(), o(s(e(f) ? "v-icon" : "i"), {
|
|
62
|
+
icon: e(D),
|
|
63
|
+
"aria-hidden": "true"
|
|
64
|
+
}, {
|
|
65
|
+
default: l(() => a[0] || (a[0] = [
|
|
66
|
+
d("i", null, "🔗", -1)
|
|
67
|
+
])),
|
|
68
|
+
_: 1
|
|
69
|
+
}, 8, ["icon"])),
|
|
70
|
+
y(" " + u(e(h)("form.fix_input")), 1)
|
|
71
|
+
], 8, T)
|
|
72
|
+
]),
|
|
73
|
+
_: 2
|
|
74
|
+
}, 1024))), 128))
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
})) : (t(), c("span", $, u(p.value[0]), 1))
|
|
78
|
+
]),
|
|
79
|
+
_: 1
|
|
80
|
+
}, 8, ["class"]))
|
|
81
|
+
], !0)
|
|
82
|
+
])) : w("", !0)
|
|
83
|
+
]),
|
|
84
|
+
_: 3
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
H as default
|
|
90
|
+
};
|
|
@@ -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,4 @@
|
|
|
1
|
-
import
|
|
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
|
-
});
|
|
1
|
+
import f from "./vue-components.es6.js";
|
|
32
2
|
export {
|
|
33
|
-
|
|
3
|
+
f as default
|
|
34
4
|
};
|