@effect-app/vue-components 0.20.6 → 0.21.0
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/OmegaFormStuff.d.ts +2 -1
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +2 -0
- package/dist/vue-components.es12.js +2 -2
- package/dist/vue-components.es20.js +1 -1
- package/dist/vue-components.es22.js +1 -1
- package/dist/vue-components.es23.js +1 -1
- package/dist/vue-components.es24.js +1 -1
- package/dist/vue-components.es25.js +1 -1
- package/dist/vue-components.es26.js +42 -11
- package/dist/vue-components.es28.js +11 -42
- package/dist/vue-components.es29.js +23 -2
- package/dist/vue-components.es30.js +5 -23
- package/dist/vue-components.es31.js +21 -5
- package/dist/vue-components.es32.js +25 -16
- package/dist/vue-components.es33.js +15 -23
- package/dist/vue-components.es34.js +7 -17
- package/dist/vue-components.es35.js +5 -12
- package/dist/vue-components.es36.js +19 -5
- package/dist/vue-components.es37.js +9 -19
- package/dist/vue-components.es38.js +31 -9
- package/dist/vue-components.es39.js +42 -25
- package/dist/vue-components.es40.js +16 -38
- package/dist/vue-components.es41.js +2 -26
- package/dist/vue-components.es42.js +1 -1
- package/dist/vue-components.es44.js +1 -1
- package/dist/vue-components.es45.js +3 -3
- package/dist/vue-components.es46.js +3 -3
- package/dist/vue-components.es47.js +1 -1
- package/dist/vue-components.es50.js +2 -4
- package/dist/vue-components.es51.js +44 -2
- package/dist/vue-components.es52.js +2 -44
- package/dist/vue-components.es53.js +4 -2
- package/dist/vue-components.es7.js +26 -25
- package/dist/vue-components.es9.js +15 -14
- package/package.json +3 -3
- package/src/components/OmegaForm/OmegaArray.vue +2 -4
- package/src/components/OmegaForm/OmegaAutoGen.vue +2 -4
- package/src/components/OmegaForm/OmegaFormInput.vue +2 -4
- package/src/components/OmegaForm/OmegaFormStuff.ts +2 -1
- package/src/components/OmegaForm/OmegaInput.vue +13 -5
- package/src/components/OmegaForm/OmegaInputVuetify.vue +2 -4
- package/src/components/OmegaForm/OmegaInternalInput.vue +3 -5
- package/src/components/OmegaForm/OmegaWrapper.vue +2 -4
- package/src/components/OmegaForm/useOmegaForm.ts +4 -0
|
@@ -1,50 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 = (
|
|
1
|
+
import { registerGlobal as a, getGlobal as p, unregisterGlobal as s } from "./vue-components.es45.js";
|
|
2
|
+
import { ProxyTracerProvider as i } from "./vue-components.es33.js";
|
|
3
|
+
import { wrapSpanContext as c, isSpanContextValid as h } from "./vue-components.es36.js";
|
|
4
|
+
import { deleteSpan as g, getSpan as S, getActiveSpan as x, getSpanContext as d, setSpan as f, setSpanContext as l } from "./vue-components.es46.js";
|
|
5
|
+
import { DiagAPI as o } from "./vue-components.es42.js";
|
|
6
|
+
var n = "trace", y = (
|
|
25
7
|
/** @class */
|
|
26
8
|
(function() {
|
|
27
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;
|
|
28
11
|
}
|
|
29
12
|
return t.getInstance = function() {
|
|
30
13
|
return this._instance || (this._instance = new t()), this._instance;
|
|
31
|
-
}, t.prototype.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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) || _;
|
|
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);
|
|
43
21
|
}, t.prototype.disable = function() {
|
|
44
|
-
|
|
22
|
+
s(n, o.instance()), this._proxyTracerProvider = new i();
|
|
45
23
|
}, t;
|
|
46
24
|
})()
|
|
47
25
|
);
|
|
48
26
|
export {
|
|
49
|
-
|
|
27
|
+
y as TraceAPI
|
|
50
28
|
};
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ProxyTracerProvider as i } from "./vue-components.es34.js";
|
|
3
|
-
import { wrapSpanContext as c, isSpanContextValid as h } from "./vue-components.es37.js";
|
|
4
|
-
import { deleteSpan as g, getSpan as S, getActiveSpan as x, getSpanContext as d, setSpan as f, setSpanContext as l } from "./vue-components.es46.js";
|
|
5
|
-
import { DiagAPI as o } from "./vue-components.es42.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
|
-
);
|
|
1
|
+
import f from "./vue-components.es27.js";
|
|
26
2
|
export {
|
|
27
|
-
|
|
3
|
+
f as default
|
|
28
4
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DiagComponentLogger as m } from "./vue-components.es43.js";
|
|
2
2
|
import { createLogLevelDiagLogger as y } from "./vue-components.es44.js";
|
|
3
|
-
import { DiagLogLevel as d } from "./vue-components.
|
|
3
|
+
import { DiagLogLevel as d } from "./vue-components.es30.js";
|
|
4
4
|
import { unregisterGlobal as p, getGlobal as v, registerGlobal as w } from "./vue-components.es45.js";
|
|
5
5
|
var b = function(i, n) {
|
|
6
6
|
var r = typeof Symbol == "function" && i[Symbol.iterator];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VERSION as t } from "./vue-components.
|
|
2
|
-
import { isCompatible as f } from "./vue-components.
|
|
3
|
-
import { _globalThis as m } from "./vue-components.
|
|
1
|
+
import { VERSION as t } from "./vue-components.es50.js";
|
|
2
|
+
import { isCompatible as f } from "./vue-components.es51.js";
|
|
3
|
+
import { _globalThis as m } from "./vue-components.es52.js";
|
|
4
4
|
var u = t.split(".")[0], n = Symbol.for("opentelemetry.js.api." + u), l = m;
|
|
5
5
|
function d(r, o, e, i) {
|
|
6
6
|
var v;
|
|
@@ -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.es29.js";
|
|
2
|
+
import { NonRecordingSpan as a } from "./vue-components.es38.js";
|
|
3
|
+
import { ContextAPI as u } from "./vue-components.es39.js";
|
|
4
4
|
var n = o("OpenTelemetry Context Key SPAN");
|
|
5
5
|
function r(e) {
|
|
6
6
|
return e.getValue(n) || void 0;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import o from "./vue-components.es48.js";
|
|
3
|
-
|
|
1
|
+
var r = "1.9.0";
|
|
4
2
|
export {
|
|
5
|
-
|
|
3
|
+
r as VERSION
|
|
6
4
|
};
|
|
@@ -1,4 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
import { VERSION as d } from "./vue-components.es50.js";
|
|
2
|
+
var h = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
3
|
+
function s(c) {
|
|
4
|
+
var m = /* @__PURE__ */ new Set([c]), f = /* @__PURE__ */ new Set(), t = c.match(h);
|
|
5
|
+
if (!t)
|
|
6
|
+
return function() {
|
|
7
|
+
return !1;
|
|
8
|
+
};
|
|
9
|
+
var e = {
|
|
10
|
+
major: +t[1],
|
|
11
|
+
minor: +t[2],
|
|
12
|
+
patch: +t[3],
|
|
13
|
+
prerelease: t[4]
|
|
14
|
+
};
|
|
15
|
+
if (e.prerelease != null)
|
|
16
|
+
return function(r) {
|
|
17
|
+
return r === c;
|
|
18
|
+
};
|
|
19
|
+
function a(n) {
|
|
20
|
+
return f.add(n), !1;
|
|
21
|
+
}
|
|
22
|
+
function p(n) {
|
|
23
|
+
return m.add(n), !0;
|
|
24
|
+
}
|
|
25
|
+
return function(r) {
|
|
26
|
+
if (m.has(r))
|
|
27
|
+
return !0;
|
|
28
|
+
if (f.has(r))
|
|
29
|
+
return !1;
|
|
30
|
+
var i = r.match(h);
|
|
31
|
+
if (!i)
|
|
32
|
+
return a(r);
|
|
33
|
+
var u = {
|
|
34
|
+
major: +i[1],
|
|
35
|
+
minor: +i[2],
|
|
36
|
+
patch: +i[3],
|
|
37
|
+
prerelease: i[4]
|
|
38
|
+
};
|
|
39
|
+
return u.prerelease != null || e.major !== u.major ? a(r) : e.major === 0 ? e.minor === u.minor && e.patch <= u.patch ? p(r) : a(r) : e.minor <= u.minor ? p(r) : a(r);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
var v = s(d);
|
|
2
43
|
export {
|
|
3
|
-
|
|
44
|
+
s as _makeCompatibilityCheck,
|
|
45
|
+
v as isCompatible
|
|
4
46
|
};
|
|
@@ -1,46 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var h = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
3
|
-
function s(c) {
|
|
4
|
-
var m = /* @__PURE__ */ new Set([c]), f = /* @__PURE__ */ new Set(), t = c.match(h);
|
|
5
|
-
if (!t)
|
|
6
|
-
return function() {
|
|
7
|
-
return !1;
|
|
8
|
-
};
|
|
9
|
-
var e = {
|
|
10
|
-
major: +t[1],
|
|
11
|
-
minor: +t[2],
|
|
12
|
-
patch: +t[3],
|
|
13
|
-
prerelease: t[4]
|
|
14
|
-
};
|
|
15
|
-
if (e.prerelease != null)
|
|
16
|
-
return function(r) {
|
|
17
|
-
return r === c;
|
|
18
|
-
};
|
|
19
|
-
function a(n) {
|
|
20
|
-
return f.add(n), !1;
|
|
21
|
-
}
|
|
22
|
-
function p(n) {
|
|
23
|
-
return m.add(n), !0;
|
|
24
|
-
}
|
|
25
|
-
return function(r) {
|
|
26
|
-
if (m.has(r))
|
|
27
|
-
return !0;
|
|
28
|
-
if (f.has(r))
|
|
29
|
-
return !1;
|
|
30
|
-
var i = r.match(h);
|
|
31
|
-
if (!i)
|
|
32
|
-
return a(r);
|
|
33
|
-
var u = {
|
|
34
|
-
major: +i[1],
|
|
35
|
-
minor: +i[2],
|
|
36
|
-
patch: +i[3],
|
|
37
|
-
prerelease: i[4]
|
|
38
|
-
};
|
|
39
|
-
return u.prerelease != null || e.major !== u.major ? a(r) : e.major === 0 ? e.minor === u.minor && e.patch <= u.patch ? p(r) : a(r) : e.minor <= u.minor ? p(r) : a(r);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
var v = s(d);
|
|
1
|
+
var o = typeof globalThis == "object" ? globalThis : typeof self == "object" ? self : typeof window == "object" ? window : typeof global == "object" ? global : {};
|
|
43
2
|
export {
|
|
44
|
-
|
|
45
|
-
v as isCompatible
|
|
3
|
+
o as _globalThis
|
|
46
4
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
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
|
+
import o from "./vue-components.es48.js";
|
|
3
|
+
|
|
2
4
|
export {
|
|
3
|
-
o as
|
|
5
|
+
o as default
|
|
4
6
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { generateInputStandardSchemaFromFieldMeta as
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as g, inject as y, computed as m, createBlock as s, openBlock as l, resolveDynamicComponent as h, withCtx as i, createCommentVNode as C, mergeProps as M, renderSlot as $, normalizeProps as b, guardReactiveProps as F } from "vue";
|
|
2
|
+
import { generateInputStandardSchemaFromFieldMeta as k } from "./vue-components.es10.js";
|
|
3
|
+
import A from "./vue-components.es27.js";
|
|
4
|
+
import { useIntl as w } from "./vue-components.es3.js";
|
|
5
|
+
const j = /* @__PURE__ */ g({
|
|
5
6
|
inheritAttrs: !1,
|
|
6
7
|
__name: "OmegaInput",
|
|
7
8
|
props: {
|
|
@@ -12,41 +13,41 @@ const P = /* @__PURE__ */ d({
|
|
|
12
13
|
options: {},
|
|
13
14
|
type: {}
|
|
14
15
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
16
|
+
setup(p) {
|
|
17
|
+
const e = p, r = y(
|
|
17
18
|
"getMetaFromArray",
|
|
18
19
|
null
|
|
19
|
-
), t =
|
|
20
|
+
), t = m(() => r?.value && r.value(e.name) ? r.value(e.name) : e.form.meta[e.name]), u = m(() => {
|
|
20
21
|
if (!t.value)
|
|
21
|
-
throw console.log(
|
|
22
|
-
return
|
|
23
|
-
});
|
|
24
|
-
return (
|
|
25
|
-
name:
|
|
22
|
+
throw console.log(e.name, Object.keys(e.form.meta), e.form.meta), new Error("Meta is undefined");
|
|
23
|
+
return k(t.value);
|
|
24
|
+
}), { formatMessage: f } = w(), o = (a) => a.replace(/([A-Z])/g, " $1").replace(/^./, (n) => n.toUpperCase()).trim(), d = () => e.form.i18nNamespace ? f({ id: `${e.form.i18nNamespace}.inputs.${e.name}`, defaultMessage: o(e.name) }) : o(e.name);
|
|
25
|
+
return (a, n) => (l(), s(h(a.form.Field), {
|
|
26
|
+
name: a.name,
|
|
26
27
|
validators: {
|
|
27
|
-
onChange:
|
|
28
|
-
...
|
|
28
|
+
onChange: u.value,
|
|
29
|
+
...a.validators
|
|
29
30
|
}
|
|
30
31
|
}, {
|
|
31
|
-
default:
|
|
32
|
-
t.value ? (
|
|
32
|
+
default: i(({ field: c }) => [
|
|
33
|
+
t.value ? (l(), s(A, M({
|
|
33
34
|
key: 0,
|
|
34
|
-
field:
|
|
35
|
-
label:
|
|
36
|
-
options:
|
|
35
|
+
field: c,
|
|
36
|
+
label: a.label ?? d(),
|
|
37
|
+
options: a.options,
|
|
37
38
|
meta: t.value,
|
|
38
|
-
type:
|
|
39
|
-
},
|
|
40
|
-
default:
|
|
41
|
-
|
|
39
|
+
type: a.type
|
|
40
|
+
}, a.$attrs), {
|
|
41
|
+
default: i((v) => [
|
|
42
|
+
$(a.$slots, "default", b(F(v)))
|
|
42
43
|
]),
|
|
43
44
|
_: 3
|
|
44
|
-
}, 16, ["field", "label", "options", "meta", "type"])) :
|
|
45
|
+
}, 16, ["field", "label", "options", "meta", "type"])) : C("", !0)
|
|
45
46
|
]),
|
|
46
47
|
_: 3
|
|
47
48
|
}, 8, ["name", "validators"]));
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
j as default
|
|
52
53
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useForm as
|
|
2
|
-
import { S as
|
|
3
|
-
import { runtimeFiberAsPromise as
|
|
1
|
+
import { useForm as I } from "@tanstack/vue-form";
|
|
2
|
+
import { S as R, Fiber as m, Effect as p } from "effect-app";
|
|
3
|
+
import { runtimeFiberAsPromise as A } from "./vue-components.es22.js";
|
|
4
4
|
import { isObject as D } from "./vue-components.es23.js";
|
|
5
5
|
import { computed as g, onUnmounted as J, onMounted as K, onBeforeUnmount as M, provide as q } from "vue";
|
|
6
6
|
import x from "./vue-components.es6.js";
|
|
@@ -9,10 +9,10 @@ import { trace as V } from "./vue-components.es24.js";
|
|
|
9
9
|
import { context as w } from "./vue-components.es25.js";
|
|
10
10
|
const $ = Symbol("OmegaForm"), Y = (d, i, n) => {
|
|
11
11
|
if (!d) throw new Error("Schema is required");
|
|
12
|
-
const j =
|
|
12
|
+
const j = R.standardSchemaV1(d), { filterItems: E, meta: l } = _(d), o = g(() => {
|
|
13
13
|
if (n?.persistency?.id)
|
|
14
14
|
return n.persistency.id;
|
|
15
|
-
const e = window.location.pathname, r = Object.keys(
|
|
15
|
+
const e = window.location.pathname, r = Object.keys(l);
|
|
16
16
|
return `${e}-${r.join("-")}`;
|
|
17
17
|
}), L = () => {
|
|
18
18
|
const e = new URLSearchParams(window.location.search);
|
|
@@ -59,7 +59,7 @@ const $ = Symbol("OmegaForm"), Y = (d, i, n) => {
|
|
|
59
59
|
const t = i?.defaultValues;
|
|
60
60
|
return S(t, e);
|
|
61
61
|
}
|
|
62
|
-
}), U = (e, r) => e ? w.with(V.setSpan(w.active(), e), r) : r(), a =
|
|
62
|
+
}), U = (e, r) => e ? w.with(V.setSpan(w.active(), e), r) : r(), a = I({
|
|
63
63
|
...i,
|
|
64
64
|
validators: {
|
|
65
65
|
onSubmit: j,
|
|
@@ -71,29 +71,29 @@ const $ = Symbol("OmegaForm"), Y = (d, i, n) => {
|
|
|
71
71
|
meta: r,
|
|
72
72
|
value: t
|
|
73
73
|
});
|
|
74
|
-
return m.isFiber(s) && m.isRuntimeFiber(s) ? await
|
|
74
|
+
return m.isFiber(s) && m.isRuntimeFiber(s) ? await A(s) : p.isEffect(s) ? await p.runPromise(
|
|
75
75
|
s.pipe(
|
|
76
76
|
// meta?.currentSpan
|
|
77
77
|
// ? Effect.withParentSpan(meta.currentSpan)
|
|
78
78
|
// : (_) => _,
|
|
79
|
-
p.flatMap((
|
|
79
|
+
p.flatMap((c) => m.join(c))
|
|
80
80
|
)
|
|
81
81
|
) : s;
|
|
82
82
|
}) : void 0,
|
|
83
83
|
defaultValues: P.value
|
|
84
84
|
}), F = () => {
|
|
85
|
-
Object.keys(
|
|
85
|
+
Object.keys(l).forEach((e) => {
|
|
86
86
|
a.setFieldValue(e, void 0);
|
|
87
87
|
});
|
|
88
88
|
}, h = (e) => e.reduce((r, t) => {
|
|
89
89
|
const s = t.split(".");
|
|
90
|
-
return s.reduce((
|
|
90
|
+
return s.reduce((c, u, O) => (O === s.length - 1 ? c[u] = a.getFieldValue(t) : c[u] = c[u] ?? {}, c[u]), r), r;
|
|
91
91
|
}, {}), y = (e) => {
|
|
92
92
|
if (e) {
|
|
93
93
|
if (Array.isArray(e.keys))
|
|
94
94
|
return h(e.keys);
|
|
95
95
|
if (Array.isArray(e.banKeys)) {
|
|
96
|
-
const r = Object.keys(
|
|
96
|
+
const r = Object.keys(l).filter((t) => e.banKeys?.includes(t));
|
|
97
97
|
return h(r);
|
|
98
98
|
}
|
|
99
99
|
return a.store.state.values;
|
|
@@ -120,13 +120,14 @@ const $ = Symbol("OmegaForm"), Y = (d, i, n) => {
|
|
|
120
120
|
}), M(() => {
|
|
121
121
|
window.removeEventListener("beforeunload", f), window.removeEventListener("blur", v);
|
|
122
122
|
});
|
|
123
|
-
const
|
|
124
|
-
|
|
123
|
+
const N = a.handleSubmit, b = Object.assign(a, {
|
|
124
|
+
i18nNamespace: n?.i18nNamespace,
|
|
125
|
+
meta: l,
|
|
125
126
|
filterItems: E,
|
|
126
127
|
clear: F,
|
|
127
128
|
handleSubmit: (e) => {
|
|
128
129
|
const r = V.getSpan(w.active());
|
|
129
|
-
return
|
|
130
|
+
return N({ currentSpan: r, ...e });
|
|
130
131
|
}
|
|
131
132
|
// /** @experimental */
|
|
132
133
|
// handleSubmitEffect: (meta?: Record<string, any>) =>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"effect": "^3.17.13",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"vitepress": "^1.6.4",
|
|
30
30
|
"vitest": "^3.2.4",
|
|
31
31
|
"vue-tsc": "^3.0.6",
|
|
32
|
-
"@effect-app/eslint-shared-config": "0.0.
|
|
32
|
+
"@effect-app/eslint-shared-config": "0.0.10"
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"src",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@tanstack/vue-form": "^1.19.5",
|
|
49
49
|
"highlight.js": "^11.11.1",
|
|
50
50
|
"vue3-highlightjs": "^1.0.5",
|
|
51
|
-
"@effect-app/vue": "2.60.
|
|
51
|
+
"@effect-app/vue": "2.60.7",
|
|
52
52
|
"effect-app": "3.3.6"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
@@ -42,10 +42,8 @@
|
|
|
42
42
|
<script
|
|
43
43
|
setup
|
|
44
44
|
lang="ts"
|
|
45
|
-
generic="
|
|
46
|
-
|
|
47
|
-
To extends Record<PropertyKey, any>
|
|
48
|
-
"
|
|
45
|
+
generic="From extends Record<PropertyKey, any>,
|
|
46
|
+
To extends Record<PropertyKey, any>"
|
|
49
47
|
>
|
|
50
48
|
import { type DeepKeys, type DeepValue } from "@tanstack/vue-form"
|
|
51
49
|
import { computed, onMounted, provide } from "vue"
|
|
@@ -15,10 +15,8 @@
|
|
|
15
15
|
<script
|
|
16
16
|
setup
|
|
17
17
|
lang="ts"
|
|
18
|
-
generic="
|
|
19
|
-
|
|
20
|
-
To extends Record<PropertyKey, string>
|
|
21
|
-
"
|
|
18
|
+
generic="From extends Record<PropertyKey, string>,
|
|
19
|
+
To extends Record<PropertyKey, string>"
|
|
22
20
|
>
|
|
23
21
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
24
22
|
import { Array as A, Order, pipe } from "effect-app"
|
|
@@ -17,11 +17,9 @@
|
|
|
17
17
|
<script
|
|
18
18
|
setup
|
|
19
19
|
lang="ts"
|
|
20
|
-
generic="
|
|
21
|
-
From extends Record<PropertyKey, any>,
|
|
20
|
+
generic="From extends Record<PropertyKey, any>,
|
|
22
21
|
To extends Record<PropertyKey, any>,
|
|
23
|
-
Name extends DeepKeys<From>
|
|
24
|
-
"
|
|
22
|
+
Name extends DeepKeys<From>"
|
|
25
23
|
>
|
|
26
24
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
27
25
|
import { inject } from "vue"
|
|
@@ -11,10 +11,11 @@ export type ShowErrorsOn = "onChange" | "onBlur" | "onSubmit"
|
|
|
11
11
|
export type OmegaInputProps<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>> = {
|
|
12
12
|
form: OmegaFormReturn<From, To> & {
|
|
13
13
|
meta: MetaRecord<From>
|
|
14
|
+
i18nNamespace?: string
|
|
14
15
|
}
|
|
15
16
|
name: NestedKeyOf<From>
|
|
16
17
|
validators?: FieldValidators<From>
|
|
17
|
-
label
|
|
18
|
+
label?: string
|
|
18
19
|
options?: { title: string; value: string }[]
|
|
19
20
|
type?: TypeOverride
|
|
20
21
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<OmegaInternalInput
|
|
12
12
|
v-if="meta"
|
|
13
13
|
:field="field"
|
|
14
|
-
:label="label"
|
|
14
|
+
:label="label ?? i18n()"
|
|
15
15
|
:options="options"
|
|
16
16
|
:meta="meta"
|
|
17
17
|
:type="type"
|
|
@@ -28,14 +28,13 @@
|
|
|
28
28
|
<script
|
|
29
29
|
setup
|
|
30
30
|
lang="ts"
|
|
31
|
-
generic="
|
|
32
|
-
|
|
33
|
-
To extends Record<PropertyKey, any>
|
|
34
|
-
"
|
|
31
|
+
generic="From extends Record<PropertyKey, any>,
|
|
32
|
+
To extends Record<PropertyKey, any>"
|
|
35
33
|
>
|
|
36
34
|
import { computed, inject, type Ref } from "vue"
|
|
37
35
|
import { type FieldMeta, generateInputStandardSchemaFromFieldMeta, type OmegaInputProps } from "./OmegaFormStuff"
|
|
38
36
|
import OmegaInternalInput from "./OmegaInternalInput.vue"
|
|
37
|
+
import { useIntl } from "../../utils";
|
|
39
38
|
|
|
40
39
|
const props = defineProps<OmegaInputProps<From, To>>()
|
|
41
40
|
|
|
@@ -62,4 +61,13 @@ const schema = computed(() => {
|
|
|
62
61
|
}
|
|
63
62
|
return generateInputStandardSchemaFromFieldMeta(meta.value)
|
|
64
63
|
})
|
|
64
|
+
|
|
65
|
+
const { formatMessage } = useIntl()
|
|
66
|
+
const humanize = (str: string) => {
|
|
67
|
+
return str
|
|
68
|
+
.replace(/([A-Z])/g, " $1") // Add space before capital letters
|
|
69
|
+
.replace(/^./, (char) => char.toUpperCase()) // Capitalize the first letter
|
|
70
|
+
.trim() // Remove leading/trailing spaces
|
|
71
|
+
}
|
|
72
|
+
const i18n = () => props.form.i18nNamespace ? formatMessage({id:`${props.form.i18nNamespace}.inputs.${props.name}`, defaultMessage: humanize(props.name)}) : humanize(props.name)
|
|
65
73
|
</script>
|
|
@@ -111,10 +111,8 @@
|
|
|
111
111
|
<script
|
|
112
112
|
setup
|
|
113
113
|
lang="ts"
|
|
114
|
-
generic="
|
|
115
|
-
|
|
116
|
-
Name extends DeepKeys<From>
|
|
117
|
-
"
|
|
114
|
+
generic="From extends Record<PropertyKey, any>,
|
|
115
|
+
Name extends DeepKeys<From>"
|
|
118
116
|
>
|
|
119
117
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
120
118
|
import type { InputProps } from "./InputProps"
|
|
@@ -17,10 +17,8 @@
|
|
|
17
17
|
<script
|
|
18
18
|
setup
|
|
19
19
|
lang="ts"
|
|
20
|
-
generic="
|
|
21
|
-
|
|
22
|
-
Name extends DeepKeys<From>
|
|
23
|
-
"
|
|
20
|
+
generic="From extends Record<PropertyKey, any>,
|
|
21
|
+
Name extends DeepKeys<From>"
|
|
24
22
|
>
|
|
25
23
|
import { type DeepKeys, useStore } from "@tanstack/vue-form"
|
|
26
24
|
import { computed, type ComputedRef, getCurrentInstance, nextTick, onMounted, ref, useId, watch, watchEffect } from "vue"
|
|
@@ -135,7 +133,7 @@ watch(
|
|
|
135
133
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
136
134
|
.map((e: any) => e.message)
|
|
137
135
|
.filter(Boolean),
|
|
138
|
-
label: props.label
|
|
136
|
+
label: props.label,
|
|
139
137
|
})
|
|
140
138
|
} else {
|
|
141
139
|
removeError(id)
|
|
@@ -27,12 +27,10 @@
|
|
|
27
27
|
<script
|
|
28
28
|
setup
|
|
29
29
|
lang="ts"
|
|
30
|
-
generic="
|
|
31
|
-
From extends Record<PropertyKey, any>,
|
|
30
|
+
generic="From extends Record<PropertyKey, any>,
|
|
32
31
|
To extends Record<PropertyKey, any>,
|
|
33
32
|
K extends keyof OmegaFormState<From, To> =
|
|
34
|
-
keyof OmegaFormState<From, To>
|
|
35
|
-
"
|
|
33
|
+
keyof OmegaFormState<From, To>"
|
|
36
34
|
>
|
|
37
35
|
/**
|
|
38
36
|
* Form component that wraps TanStack Form's useForm hook
|
|
@@ -22,6 +22,8 @@ type keysRule<T> =
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export type OmegaConfig<T> = {
|
|
25
|
+
i18nNamespace?: string
|
|
26
|
+
|
|
25
27
|
persistency?: {
|
|
26
28
|
/** Order of importance:
|
|
27
29
|
* - "querystring": Highest priority when persisting
|
|
@@ -37,6 +39,7 @@ interface OF<From, To> extends OmegaFormApi<From, To> {
|
|
|
37
39
|
meta: MetaRecord<From>
|
|
38
40
|
filterItems?: FilterItems
|
|
39
41
|
clear: () => void
|
|
42
|
+
i18nNamespace?: string
|
|
40
43
|
// /** @experimental */
|
|
41
44
|
// handleSubmitEffect: (meta?: Record<string, any>) => Effect.Effect<void, never, never>
|
|
42
45
|
}
|
|
@@ -330,6 +333,7 @@ export const useOmegaForm = <
|
|
|
330
333
|
|
|
331
334
|
const handleSubmit = form.handleSubmit
|
|
332
335
|
const formWithExtras: OF<From, To> = Object.assign(form, {
|
|
336
|
+
i18nNamespace: omegaConfig?.i18nNamespace,
|
|
333
337
|
meta,
|
|
334
338
|
filterItems,
|
|
335
339
|
clear,
|