@effect-app/vue-components 1.8.12 → 1.8.13
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/InputProps.d.ts +4 -3
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +1 -0
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +2 -0
- package/dist/vue-components.es10.js +9 -9
- package/dist/vue-components.es12.js +1 -1
- package/dist/vue-components.es13.js +1 -1
- package/dist/vue-components.es16.js +2 -2
- package/dist/vue-components.es17.js +2 -2
- package/dist/vue-components.es18.js +1 -1
- package/dist/vue-components.es19.js +1 -1
- package/dist/vue-components.es24.js +135 -41
- package/dist/vue-components.es26.js +42 -2
- package/dist/vue-components.es27.js +2 -89
- package/dist/vue-components.es28.js +4 -0
- package/dist/vue-components.es29.js +89 -7
- package/dist/vue-components.es31.js +9 -0
- package/dist/vue-components.es32.js +25 -129
- package/dist/vue-components.es34.js +4 -23
- package/dist/vue-components.es35.js +23 -5
- package/dist/vue-components.es36.js +5 -21
- package/dist/vue-components.es37.js +16 -25
- package/dist/vue-components.es38.js +23 -15
- package/dist/vue-components.es39.js +17 -7
- package/dist/vue-components.es40.js +12 -5
- package/dist/vue-components.es41.js +5 -19
- package/dist/vue-components.es42.js +19 -9
- package/dist/vue-components.es43.js +9 -31
- package/dist/vue-components.es44.js +25 -42
- package/dist/vue-components.es45.js +38 -16
- package/dist/vue-components.es46.js +26 -11
- package/dist/vue-components.es47.js +11 -4
- package/dist/vue-components.es48.js +1 -1
- package/dist/vue-components.es5.js +16 -15
- package/dist/vue-components.es50.js +1 -1
- package/dist/vue-components.es52.js +3 -3
- package/dist/vue-components.es53.js +1 -1
- package/dist/vue-components.es6.js +13 -11
- package/package.json +3 -3
- package/src/components/OmegaForm/InputProps.ts +4 -3
- package/src/components/OmegaForm/OmegaInput.vue +2 -1
- package/src/components/OmegaForm/OmegaInputVuetify.vue +7 -7
- package/src/components/OmegaForm/OmegaInternalInput.vue +3 -1
- package/src/components/OmegaForm/createUseFormWithCustomInput.ts +2 -2
- package/dist/vue-components.es25.js +0 -4
- package/dist/vue-components.es30.js +0 -33
|
@@ -1,28 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { NoopContextManager as f } from "./vue-components.es53.js";
|
|
2
|
+
import { registerGlobal as s, getGlobal as p, unregisterGlobal as g } from "./vue-components.es51.js";
|
|
3
|
+
import { DiagAPI as u } from "./vue-components.es48.js";
|
|
4
|
+
var y = function(t, e) {
|
|
5
|
+
var a = typeof Symbol == "function" && t[Symbol.iterator];
|
|
6
|
+
if (!a) return t;
|
|
7
|
+
var n = a.call(t), o, r = [], i;
|
|
8
|
+
try {
|
|
9
|
+
for (; (e === void 0 || e-- > 0) && !(o = n.next()).done; ) r.push(o.value);
|
|
10
|
+
} catch (c) {
|
|
11
|
+
i = { error: c };
|
|
12
|
+
} finally {
|
|
13
|
+
try {
|
|
14
|
+
o && !o.done && (a = n.return) && a.call(n);
|
|
15
|
+
} finally {
|
|
16
|
+
if (i) throw i.error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return r;
|
|
20
|
+
}, d = function(t, e, a) {
|
|
21
|
+
if (a || arguments.length === 2) for (var n = 0, o = e.length, r; n < o; n++)
|
|
22
|
+
(r || !(n in e)) && (r || (r = Array.prototype.slice.call(e, 0, n)), r[n] = e[n]);
|
|
23
|
+
return t.concat(r || Array.prototype.slice.call(e));
|
|
24
|
+
}, l = "context", _ = new f(), A = (
|
|
7
25
|
/** @class */
|
|
8
26
|
(function() {
|
|
9
27
|
function t() {
|
|
10
|
-
this._proxyTracerProvider = new i(), this.wrapSpanContext = c, this.isSpanContextValid = h, this.deleteSpan = g, this.getSpan = S, this.getActiveSpan = x, this.getSpanContext = d, this.setSpan = f, this.setSpanContext = l;
|
|
11
28
|
}
|
|
12
29
|
return t.getInstance = function() {
|
|
13
30
|
return this._instance || (this._instance = new t()), this._instance;
|
|
14
|
-
}, t.prototype.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
}, t.prototype.setGlobalContextManager = function(e) {
|
|
32
|
+
return s(l, e, u.instance());
|
|
33
|
+
}, t.prototype.active = function() {
|
|
34
|
+
return this._getContextManager().active();
|
|
35
|
+
}, t.prototype.with = function(e, a, n) {
|
|
36
|
+
for (var o, r = [], i = 3; i < arguments.length; i++)
|
|
37
|
+
r[i - 3] = arguments[i];
|
|
38
|
+
return (o = this._getContextManager()).with.apply(o, d([e, a, n], y(r), !1));
|
|
39
|
+
}, t.prototype.bind = function(e, a) {
|
|
40
|
+
return this._getContextManager().bind(e, a);
|
|
41
|
+
}, t.prototype._getContextManager = function() {
|
|
42
|
+
return p(l) || _;
|
|
21
43
|
}, t.prototype.disable = function() {
|
|
22
|
-
|
|
44
|
+
this._getContextManager().disable(), g(l, u.instance());
|
|
23
45
|
}, t;
|
|
24
46
|
})()
|
|
25
47
|
);
|
|
26
48
|
export {
|
|
27
|
-
|
|
49
|
+
A as ContextAPI
|
|
28
50
|
};
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { registerGlobal as a, getGlobal as p, unregisterGlobal as s } from "./vue-components.es51.js";
|
|
2
|
+
import { ProxyTracerProvider as i } from "./vue-components.es39.js";
|
|
3
|
+
import { wrapSpanContext as c, isSpanContextValid as h } from "./vue-components.es42.js";
|
|
4
|
+
import { deleteSpan as g, getSpan as S, getActiveSpan as x, getSpanContext as d, setSpan as f, setSpanContext as l } from "./vue-components.es52.js";
|
|
5
|
+
import { DiagAPI as o } from "./vue-components.es48.js";
|
|
6
|
+
var n = "trace", y = (
|
|
7
|
+
/** @class */
|
|
8
|
+
(function() {
|
|
9
|
+
function t() {
|
|
10
|
+
this._proxyTracerProvider = new i(), this.wrapSpanContext = c, this.isSpanContextValid = h, this.deleteSpan = g, this.getSpan = S, this.getActiveSpan = x, this.getSpanContext = d, this.setSpan = f, this.setSpanContext = l;
|
|
11
|
+
}
|
|
12
|
+
return t.getInstance = function() {
|
|
13
|
+
return this._instance || (this._instance = new t()), this._instance;
|
|
14
|
+
}, t.prototype.setGlobalTracerProvider = function(r) {
|
|
15
|
+
var e = a(n, this._proxyTracerProvider, o.instance());
|
|
16
|
+
return e && this._proxyTracerProvider.setDelegate(r), e;
|
|
17
|
+
}, t.prototype.getTracerProvider = function() {
|
|
18
|
+
return p(n) || this._proxyTracerProvider;
|
|
19
|
+
}, t.prototype.getTracer = function(r, e) {
|
|
20
|
+
return this.getTracerProvider().getTracer(r, e);
|
|
21
|
+
}, t.prototype.disable = function() {
|
|
22
|
+
s(n, o.instance()), this._proxyTracerProvider = new i();
|
|
23
|
+
}, t;
|
|
24
|
+
})()
|
|
25
|
+
);
|
|
11
26
|
export {
|
|
12
|
-
|
|
27
|
+
y as TraceAPI
|
|
13
28
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
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
|
+
}
|
|
4
11
|
export {
|
|
5
|
-
|
|
12
|
+
c as getOmegaStore
|
|
6
13
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DiagComponentLogger as m } from "./vue-components.es49.js";
|
|
2
2
|
import { createLogLevelDiagLogger as y } from "./vue-components.es50.js";
|
|
3
|
-
import { DiagLogLevel as d } from "./vue-components.
|
|
3
|
+
import { DiagLogLevel as d } from "./vue-components.es36.js";
|
|
4
4
|
import { unregisterGlobal as p, getGlobal as v, registerGlobal as w } from "./vue-components.es51.js";
|
|
5
5
|
var b = function(i, n) {
|
|
6
6
|
var r = typeof Symbol == "function" && i[Symbol.iterator];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { generateInputStandardSchemaFromFieldMeta as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as $, inject as M, computed as s, createBlock as i, openBlock as f, resolveDynamicComponent as b, withCtx as u, createCommentVNode as C, mergeProps as F, renderSlot as k, normalizeProps as y, guardReactiveProps as A } from "vue";
|
|
2
|
+
import { useIntl as w } from "./vue-components.es3.js";
|
|
3
|
+
import { generateInputStandardSchemaFromFieldMeta as I } from "./vue-components.es9.js";
|
|
4
|
+
import N from "./vue-components.es6.js";
|
|
5
|
+
const B = /* @__PURE__ */ $({
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "OmegaInput",
|
|
8
8
|
props: {
|
|
@@ -12,38 +12,39 @@ const z = /* @__PURE__ */ h({
|
|
|
12
12
|
name: {}
|
|
13
13
|
},
|
|
14
14
|
setup(a) {
|
|
15
|
-
const e = a, n =
|
|
15
|
+
const e = a, n = M(
|
|
16
16
|
"getMetaFromArray",
|
|
17
17
|
null
|
|
18
18
|
), r = s(() => n?.value && n.value(e.name) ? n.value(e.name) : e.form.meta[e.name]), c = s(() => {
|
|
19
19
|
if (!r.value)
|
|
20
20
|
throw console.log(e.name, Object.keys(e.form.meta), e.form.meta), new Error("Meta is undefined");
|
|
21
|
-
return
|
|
22
|
-
}), { formatMessage: o } =
|
|
23
|
-
return (t, l) => (f(), i(
|
|
21
|
+
return I(r.value);
|
|
22
|
+
}), { formatMessage: o } = w(), d = (t) => t.replace(/([A-Z])/g, " $1").replace(/^./, (l) => l.toUpperCase()).trim(), m = () => o({ id: `general.fields.${e.name}`, defaultMessage: d(e.name) }), p = () => e.form.i18nNamespace ? o({ id: `${e.form.i18nNamespace}.fields.${e.name}`, defaultMessage: m() }) : m();
|
|
23
|
+
return (t, l) => (f(), i(b(a.form.Field), {
|
|
24
24
|
name: a.name,
|
|
25
25
|
validators: {
|
|
26
26
|
onChange: c.value,
|
|
27
27
|
...a.validators
|
|
28
28
|
}
|
|
29
29
|
}, {
|
|
30
|
-
default: u(({ field: g }) => [
|
|
31
|
-
r.value ? (f(), i(
|
|
30
|
+
default: u(({ field: g, state: v }) => [
|
|
31
|
+
r.value ? (f(), i(N, F({ key: 0 }, { ...t.$attrs, ...t.$props }, {
|
|
32
32
|
field: g,
|
|
33
|
+
state: v,
|
|
33
34
|
register: a.form.registerField,
|
|
34
35
|
label: a.label ?? p(),
|
|
35
36
|
meta: r.value
|
|
36
37
|
}), {
|
|
37
|
-
default: u((
|
|
38
|
-
|
|
38
|
+
default: u((h) => [
|
|
39
|
+
k(t.$slots, "default", y(A(h)))
|
|
39
40
|
]),
|
|
40
41
|
_: 3
|
|
41
|
-
}, 16, ["field", "register", "label", "meta"])) :
|
|
42
|
+
}, 16, ["field", "state", "register", "label", "meta"])) : C("", !0)
|
|
42
43
|
]),
|
|
43
44
|
_: 3
|
|
44
45
|
}, 8, ["name", "validators"]));
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
+
B as default
|
|
49
50
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createContextKey as o } from "./vue-components.
|
|
2
|
-
import { NonRecordingSpan as a } from "./vue-components.
|
|
3
|
-
import { ContextAPI as u } from "./vue-components.
|
|
1
|
+
import { createContextKey as o } from "./vue-components.es35.js";
|
|
2
|
+
import { NonRecordingSpan as a } from "./vue-components.es44.js";
|
|
3
|
+
import { ContextAPI as u } from "./vue-components.es45.js";
|
|
4
4
|
var n = o("OpenTelemetry Context Key SPAN");
|
|
5
5
|
function r(e) {
|
|
6
6
|
return e.getValue(n) || void 0;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");if(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;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(i),window.customElements){const e=window.customElements.define;window.customElements.define=function(s,t){const n=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(n&&n.call(this),this.shadowRoot){const a=document.createElement("style");a.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;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(a)}},e.call(window.customElements,s,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
import { defineComponent as b, getCurrentInstance as C, useId as x, computed as n, onMounted as _, renderSlot as P, normalizeProps as m, guardReactiveProps as M, createElementVNode as N, normalizeClass as $, createBlock as V, createCommentVNode as k, unref as q, openBlock as B, mergeProps as F } from "vue";
|
|
3
3
|
import { useStore as I } from "@tanstack/vue-form";
|
|
4
|
-
import L from "./vue-components.
|
|
4
|
+
import L from "./vue-components.es24.js";
|
|
5
5
|
|
|
6
6
|
const U = /* @__PURE__ */ b({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "OmegaInternalInput",
|
|
9
9
|
props: {
|
|
10
10
|
field: {},
|
|
11
|
+
state: {},
|
|
11
12
|
meta: {},
|
|
12
13
|
label: {},
|
|
13
14
|
type: {},
|
|
@@ -16,9 +17,9 @@ const U = /* @__PURE__ */ b({
|
|
|
16
17
|
options: {}
|
|
17
18
|
},
|
|
18
19
|
setup(u) {
|
|
19
|
-
const e = u, p = C()?.appContext.components.VTextField,
|
|
20
|
-
e.register(n(() => ({ name: e.field.name, label: e.label, id:
|
|
21
|
-
const f = n(() => o.value.value), c = n(() => o.value.meta.errors ?? []),
|
|
20
|
+
const e = u, p = C()?.appContext.components.VTextField, s = x(), l = e.field, o = I(l.store, (t) => t), d = n(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown");
|
|
21
|
+
e.register(n(() => ({ name: e.field.name, label: e.label, id: s })));
|
|
22
|
+
const f = n(() => o.value.value), c = n(() => o.value.meta.errors ?? []), i = n(
|
|
22
23
|
() => (
|
|
23
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
25
|
c.value.map((t) => t?.message).filter(Boolean)
|
|
@@ -31,7 +32,7 @@ const U = /* @__PURE__ */ b({
|
|
|
31
32
|
_(() => {
|
|
32
33
|
if (!f.value && !e.meta?.required && e.meta?.nullableOrUndefined === "null") {
|
|
33
34
|
const t = o.value.meta.isDirty;
|
|
34
|
-
|
|
35
|
+
l.setValue(null), l.setMeta((r) => ({ ...r, isDirty: t }));
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
38
|
const h = (t) => {
|
|
@@ -41,27 +42,28 @@ const U = /* @__PURE__ */ b({
|
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
return new Proxy(t, r);
|
|
44
|
-
},
|
|
45
|
+
}, a = n(() => ({
|
|
45
46
|
inputProps: {
|
|
46
|
-
id:
|
|
47
|
+
id: s,
|
|
47
48
|
required: e.meta?.required,
|
|
48
49
|
minLength: e.meta?.type === "string" && e.meta?.minLength,
|
|
49
50
|
maxLength: e.meta?.type === "string" && e.meta?.maxLength,
|
|
50
51
|
max: e.meta?.type === "number" && e.meta?.maximum,
|
|
51
52
|
min: e.meta?.type === "number" && e.meta?.minimum,
|
|
52
|
-
errorMessages:
|
|
53
|
-
error: !!
|
|
53
|
+
errorMessages: i.value,
|
|
54
|
+
error: !!i.value.length,
|
|
54
55
|
type: d.value,
|
|
55
56
|
label: `${e.label}${e.meta?.required ? " *" : ""}`,
|
|
56
57
|
options: e.options
|
|
57
58
|
},
|
|
59
|
+
state: e.state,
|
|
58
60
|
field: h(e.field)
|
|
59
61
|
}));
|
|
60
|
-
return (t, r) => P(t.$slots, "default", m(M({ ...
|
|
62
|
+
return (t, r) => P(t.$slots, "default", m(M({ ...a.value.inputProps, field: a.value.field, state: a.value.state })), () => [
|
|
61
63
|
N("div", {
|
|
62
64
|
class: $(t.$attrs.class)
|
|
63
65
|
}, [
|
|
64
|
-
q(p) ? (B(), V(L, m(F({ key: 0 }, { ...t.$attrs, ...
|
|
66
|
+
q(p) ? (B(), V(L, m(F({ key: 0 }, { ...t.$attrs, ...a.value })), null, 16)) : k("", !0)
|
|
65
67
|
], 2)
|
|
66
68
|
]);
|
|
67
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.13",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"effect": "^3.18.0",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"highlight.js": "^11.11.1",
|
|
52
52
|
"mitt": "^3.0.1",
|
|
53
53
|
"vue3-highlightjs": "^1.0.5",
|
|
54
|
-
"effect-app": "
|
|
55
|
-
"
|
|
54
|
+
"@effect-app/vue": "2.84.3",
|
|
55
|
+
"effect-app": "3.10.2"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "pnpm build:run",
|
|
@@ -41,16 +41,17 @@ export type InputProps<From extends Record<PropertyKey, any>, TName extends Deep
|
|
|
41
41
|
type: string
|
|
42
42
|
}
|
|
43
43
|
field: OmegaFieldInternalApi<From, TName>
|
|
44
|
+
/** be sure to use this state and not `field.state` as it is not reactive */
|
|
45
|
+
state: OmegaFieldInternalApi<From, TName>["state"]
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export type MergedInputProps<From extends Record<PropertyKey, any>, TName extends DeepKeys<From>> =
|
|
47
49
|
& InputProps<From, TName>["inputProps"]
|
|
48
|
-
& Pick<InputProps<From, TName>, "field">
|
|
50
|
+
& Pick<InputProps<From, TName>, "field" | "state">
|
|
49
51
|
|
|
50
52
|
export type VuetifyInputProps<From extends Record<PropertyKey, any>, TName extends DeepKeys<From>> = {
|
|
51
53
|
inputProps: InputProps<From, TName>["inputProps"] & {
|
|
52
54
|
type: string
|
|
53
55
|
options?: { title: string; value: string }[]
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
+
} & Pick<InputProps<From, TName>, "field" | "state">
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
...validators
|
|
8
8
|
}"
|
|
9
9
|
>
|
|
10
|
-
<template #default="{ field }">
|
|
10
|
+
<template #default="{ field, state }">
|
|
11
11
|
<OmegaInternalInput
|
|
12
12
|
v-if="meta"
|
|
13
13
|
v-bind="{ ...$attrs, ...$props }"
|
|
14
14
|
:field="field"
|
|
15
|
+
:state="state"
|
|
15
16
|
:register="form.registerField"
|
|
16
17
|
:label="label ?? i18n()"
|
|
17
18
|
:meta="meta"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
:error="inputProps.error"
|
|
15
15
|
ripple
|
|
16
16
|
v-bind="$attrs"
|
|
17
|
-
:model-value="
|
|
17
|
+
:model-value="state.value"
|
|
18
18
|
@change="(e: any) => field.handleChange(e.target.checked)"
|
|
19
19
|
/>
|
|
20
20
|
<v-text-field
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
:error-messages="inputProps.errorMessages"
|
|
30
30
|
:error="inputProps.error"
|
|
31
31
|
v-bind="$attrs"
|
|
32
|
-
:model-value="
|
|
32
|
+
:model-value="state.value"
|
|
33
33
|
@update:model-value="field.handleChange"
|
|
34
34
|
/>
|
|
35
35
|
<v-textarea
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
:error-messages="inputProps.errorMessages"
|
|
44
44
|
:error="inputProps.error"
|
|
45
45
|
v-bind="$attrs"
|
|
46
|
-
:model-value="
|
|
46
|
+
:model-value="state.value"
|
|
47
47
|
@update:model-value="field.handleChange"
|
|
48
48
|
/>
|
|
49
49
|
<component
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
:error-messages="inputProps.errorMessages"
|
|
60
60
|
:error="inputProps.error"
|
|
61
61
|
v-bind="$attrs"
|
|
62
|
-
:model-value="
|
|
62
|
+
:model-value="state.value"
|
|
63
63
|
@update:model-value="(e: any) => {
|
|
64
64
|
if (e || e === 0) {
|
|
65
65
|
field.handleChange(Number(e) as any)
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
:error-messages="inputProps.errorMessages"
|
|
77
77
|
:error="inputProps.error"
|
|
78
78
|
v-bind="$attrs"
|
|
79
|
-
:model-value="
|
|
79
|
+
:model-value="state.value"
|
|
80
80
|
@update:model-value="field.handleChange"
|
|
81
81
|
>
|
|
82
82
|
<v-radio
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
:error-messages="inputProps.errorMessages"
|
|
101
101
|
:error="inputProps.error"
|
|
102
102
|
v-bind="$attrs"
|
|
103
|
-
:model-value="
|
|
103
|
+
:model-value="state.value"
|
|
104
104
|
@clear="field.handleChange(undefined as any)"
|
|
105
105
|
@update:model-value="field.handleChange"
|
|
106
106
|
/>
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
:error="inputProps.error"
|
|
120
120
|
:chips="inputProps.type === 'autocompletemultiple'"
|
|
121
121
|
v-bind="$attrs"
|
|
122
|
-
:model-value="
|
|
122
|
+
:model-value="state.value"
|
|
123
123
|
@clear="field.handleChange(undefined as any)"
|
|
124
124
|
@update:model-value="field.handleChange"
|
|
125
125
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<slot v-bind="{ ...inputProps.inputProps, field: inputProps.field }">
|
|
2
|
+
<slot v-bind="{ ...inputProps.inputProps, field: inputProps.field, state: inputProps.state }">
|
|
3
3
|
<div :class="$attrs.class">
|
|
4
4
|
<OmegaInputVuetify
|
|
5
5
|
v-if="vuetified"
|
|
@@ -26,6 +26,7 @@ defineOptions({
|
|
|
26
26
|
|
|
27
27
|
const props = defineProps<{
|
|
28
28
|
field: OmegaFieldInternalApi<From, Name>
|
|
29
|
+
state: OmegaFieldInternalApi<From, Name>["state"]
|
|
29
30
|
meta: MetaRecord<From>[NestedKeyOf<From>]
|
|
30
31
|
label: string
|
|
31
32
|
type?: TypeOverride
|
|
@@ -137,6 +138,7 @@ const inputProps: ComputedRef<InputProps<From, Name>> = computed(() => ({
|
|
|
137
138
|
options: props.options
|
|
138
139
|
},
|
|
139
140
|
|
|
141
|
+
state: props.state,
|
|
140
142
|
field: wrapField(props.field)
|
|
141
143
|
}))
|
|
142
144
|
</script>
|
|
@@ -27,7 +27,7 @@ export const createUseFormWithCustomInput = <
|
|
|
27
27
|
...attrs
|
|
28
28
|
}, {
|
|
29
29
|
// Override the default slot that OmegaInternalInput provides
|
|
30
|
-
default: <TName extends DeepKeys<From>>({ field, ...inputProps }: MergedInputProps<From, TName>) => {
|
|
30
|
+
default: <TName extends DeepKeys<From>>({ field, state, ...inputProps }: MergedInputProps<From, TName>) => {
|
|
31
31
|
// Filter out attrs that are already in inputProps or are special like 'form'
|
|
32
32
|
const filteredAttrs = Object.fromEntries(
|
|
33
33
|
Object.entries(attrs).filter(([key]) =>
|
|
@@ -35,7 +35,7 @@ export const createUseFormWithCustomInput = <
|
|
|
35
35
|
&& key !== "form"
|
|
36
36
|
)
|
|
37
37
|
)
|
|
38
|
-
return h(CustomInputComponent, { ...filteredAttrs, field, inputProps })
|
|
38
|
+
return h(CustomInputComponent, { ...filteredAttrs, field, state, inputProps })
|
|
39
39
|
}
|
|
40
40
|
})
|
|
41
41
|
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { defineComponent as m, createElementBlock as d, openBlock as a, withModifiers as l, createElementVNode as u, unref as s, renderSlot as b } from "vue";
|
|
2
|
-
import { useStore as f } from "@tanstack/vue-form";
|
|
3
|
-
import { getOmegaStore as c } from "./vue-components.es46.js";
|
|
4
|
-
const p = ["disabled"], V = /* @__PURE__ */ m({
|
|
5
|
-
__name: "OmegaWrapper",
|
|
6
|
-
props: {
|
|
7
|
-
form: {},
|
|
8
|
-
disabled: { type: Boolean },
|
|
9
|
-
subscribe: {}
|
|
10
|
-
},
|
|
11
|
-
setup(e) {
|
|
12
|
-
const t = e, i = f(
|
|
13
|
-
t.form.store,
|
|
14
|
-
(o) => o.isSubmitting
|
|
15
|
-
), n = c(
|
|
16
|
-
t.form,
|
|
17
|
-
t.subscribe
|
|
18
|
-
);
|
|
19
|
-
return (o, r) => (a(), d("form", {
|
|
20
|
-
novalidate: "",
|
|
21
|
-
onSubmit: r[0] || (r[0] = l((S) => e.form.handleSubmit(), ["prevent", "stop"]))
|
|
22
|
-
}, [
|
|
23
|
-
u("fieldset", {
|
|
24
|
-
disabled: s(i) || e.disabled
|
|
25
|
-
}, [
|
|
26
|
-
b(o.$slots, "default", { subscribedValues: s(n) }, void 0, !0)
|
|
27
|
-
], 8, p)
|
|
28
|
-
], 32));
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
export {
|
|
32
|
-
V as default
|
|
33
|
-
};
|