@effect-app/vue-components 2.4.9 → 2.4.11
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 +2 -2
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +5 -5
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +11 -14
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +3 -2
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +94 -71
- package/dist/vue-components.es10.js +126 -140
- package/dist/vue-components.es12.js +15 -13
- package/dist/vue-components.es16.js +1 -1
- package/dist/vue-components.es17.js +1 -1
- package/dist/vue-components.es20.js +2 -2
- package/dist/vue-components.es21.js +2 -2
- package/dist/vue-components.es22.js +1 -1
- package/dist/vue-components.es23.js +1 -1
- package/dist/vue-components.es30.js +191 -41
- package/dist/vue-components.es32.js +42 -2
- package/dist/vue-components.es33.js +2 -89
- package/dist/vue-components.es34.js +4 -0
- package/dist/vue-components.es35.js +89 -7
- package/dist/vue-components.es37.js +9 -0
- package/dist/vue-components.es38.js +27 -187
- package/dist/vue-components.es40.js +4 -23
- package/dist/vue-components.es41.js +23 -5
- package/dist/vue-components.es42.js +5 -21
- package/dist/vue-components.es43.js +16 -25
- package/dist/vue-components.es44.js +23 -15
- package/dist/vue-components.es45.js +17 -7
- package/dist/vue-components.es46.js +12 -5
- package/dist/vue-components.es47.js +5 -19
- package/dist/vue-components.es48.js +19 -9
- package/dist/vue-components.es49.js +9 -31
- package/dist/vue-components.es50.js +25 -42
- package/dist/vue-components.es51.js +38 -16
- package/dist/vue-components.es52.js +26 -4
- package/dist/vue-components.es54.js +1 -1
- package/dist/vue-components.es56.js +1 -1
- package/dist/vue-components.es58.js +3 -3
- package/dist/vue-components.es59.js +1 -1
- package/dist/vue-components.es7.js +1 -1
- package/package.json +1 -1
- package/src/components/OmegaForm/OmegaArray.vue +3 -2
- package/src/components/OmegaForm/OmegaAutoGen.vue +6 -5
- package/src/components/OmegaForm/OmegaFormInput.vue +3 -2
- package/src/components/OmegaForm/OmegaFormStuff.ts +24 -15
- package/src/components/OmegaForm/OmegaInput.vue +3 -2
- package/src/components/OmegaForm/useOmegaForm.ts +362 -225
- package/dist/vue-components.es31.js +0 -4
- package/dist/vue-components.es36.js +0 -34
|
@@ -1,28 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { NoopContextManager as f } from "./vue-components.es59.js";
|
|
2
|
+
import { registerGlobal as s, getGlobal as p, unregisterGlobal as g } from "./vue-components.es57.js";
|
|
3
|
+
import { DiagAPI as u } from "./vue-components.es54.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,6 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { registerGlobal as a, getGlobal as p, unregisterGlobal as s } from "./vue-components.es57.js";
|
|
2
|
+
import { ProxyTracerProvider as i } from "./vue-components.es45.js";
|
|
3
|
+
import { wrapSpanContext as c, isSpanContextValid as h } from "./vue-components.es48.js";
|
|
4
|
+
import { deleteSpan as g, getSpan as S, getActiveSpan as x, getSpanContext as d, setSpan as f, setSpanContext as l } from "./vue-components.es58.js";
|
|
5
|
+
import { DiagAPI as o } from "./vue-components.es54.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
|
+
);
|
|
4
26
|
export {
|
|
5
|
-
|
|
27
|
+
y as TraceAPI
|
|
6
28
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DiagComponentLogger as m } from "./vue-components.es55.js";
|
|
2
2
|
import { createLogLevelDiagLogger as y } from "./vue-components.es56.js";
|
|
3
|
-
import { DiagLogLevel as d } from "./vue-components.
|
|
3
|
+
import { DiagLogLevel as d } from "./vue-components.es42.js";
|
|
4
4
|
import { unregisterGlobal as p, getGlobal as v, registerGlobal as w } from "./vue-components.es57.js";
|
|
5
5
|
var b = function(i, n) {
|
|
6
6
|
var r = typeof Symbol == "function" && i[Symbol.iterator];
|
|
@@ -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.es41.js";
|
|
2
|
+
import { NonRecordingSpan as a } from "./vue-components.es50.js";
|
|
3
|
+
import { ContextAPI as u } from "./vue-components.es51.js";
|
|
4
4
|
var n = o("OpenTelemetry Context Key SPAN");
|
|
5
5
|
function r(e) {
|
|
6
6
|
return e.getValue(n) || void 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
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 N, computed as n, getCurrentInstance as S, useAttrs as k, useSlots as q, useId as B, renderSlot as m, normalizeProps as s, guardReactiveProps as d, createElementVNode as w, normalizeClass as I, createBlock as L, createCommentVNode as M, unref as A, openBlock as F, mergeProps as O, createSlots as R, withCtx as V } from "vue";
|
|
3
3
|
import { useStore as z } from "@tanstack/vue-form";
|
|
4
|
-
import T from "./vue-components.
|
|
4
|
+
import T from "./vue-components.es30.js";
|
|
5
5
|
|
|
6
6
|
const H = /* @__PURE__ */ N({
|
|
7
7
|
inheritAttrs: !1,
|
package/package.json
CHANGED
|
@@ -45,14 +45,15 @@
|
|
|
45
45
|
generic="
|
|
46
46
|
// dprint ignore - somehow with 120 chars, this becomes a mess. should report it.
|
|
47
47
|
From extends Record<PropertyKey, any>,
|
|
48
|
-
To extends Record<PropertyKey, any
|
|
48
|
+
To extends Record<PropertyKey, any>,
|
|
49
|
+
Name extends DeepKeys<From>
|
|
49
50
|
"
|
|
50
51
|
>
|
|
51
52
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
52
53
|
import { computed, onMounted, provide } from "vue"
|
|
53
54
|
import { type OmegaArrayProps } from "./OmegaFormStuff"
|
|
54
55
|
|
|
55
|
-
const props = defineProps<OmegaArrayProps<From, To>>()
|
|
56
|
+
const props = defineProps<OmegaArrayProps<From, To, Name>>()
|
|
56
57
|
|
|
57
58
|
defineOptions({
|
|
58
59
|
inheritAttrs: false
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:child="{ name, label, ...attrs }"
|
|
5
5
|
>
|
|
6
6
|
<form.Input
|
|
7
|
-
:name="name"
|
|
7
|
+
:name="name as FieldPath<From>"
|
|
8
8
|
:label="label"
|
|
9
9
|
v-bind="attrs"
|
|
10
10
|
/>
|
|
@@ -16,15 +16,16 @@
|
|
|
16
16
|
lang="ts"
|
|
17
17
|
generic="
|
|
18
18
|
From extends Record<PropertyKey, string>,
|
|
19
|
-
To extends Record<PropertyKey, string
|
|
19
|
+
To extends Record<PropertyKey, string>,
|
|
20
|
+
Name extends DeepKeys<From>
|
|
20
21
|
"
|
|
21
22
|
>
|
|
22
23
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
23
24
|
import { Array as A, Order, pipe } from "effect-app"
|
|
24
25
|
import { computed } from "vue"
|
|
25
|
-
import { type FieldMeta, type OmegaAutoGenMeta, type OmegaInputProps } from "./OmegaFormStuff"
|
|
26
|
+
import { type FieldMeta, type FieldPath, type OmegaAutoGenMeta, type OmegaInputProps } from "./OmegaFormStuff"
|
|
26
27
|
|
|
27
|
-
type NewMeta = OmegaAutoGenMeta<From, To>
|
|
28
|
+
type NewMeta = OmegaAutoGenMeta<From, To, Name>
|
|
28
29
|
|
|
29
30
|
const mapObject = <K extends string, A, B>(fn: (value: A, key: K) => B) => (obj: Record<K, A>): Record<K, B> =>
|
|
30
31
|
Object.fromEntries(
|
|
@@ -51,7 +52,7 @@ const filterMapRecord =
|
|
|
51
52
|
)
|
|
52
53
|
|
|
53
54
|
const props = defineProps<{
|
|
54
|
-
form: OmegaInputProps<From, To>["form"]
|
|
55
|
+
form: OmegaInputProps<From, To, Name>["form"]
|
|
55
56
|
pick?: DeepKeys<From>[]
|
|
56
57
|
omit?: DeepKeys<From>[]
|
|
57
58
|
labelMap?: (key: DeepKeys<From>) => string | undefined
|
|
@@ -27,7 +27,8 @@ import { OmegaFormKey } from "./useOmegaForm"
|
|
|
27
27
|
|
|
28
28
|
const form = inject(OmegaFormKey) as unknown as OmegaInputProps<
|
|
29
29
|
From,
|
|
30
|
-
To
|
|
30
|
+
To,
|
|
31
|
+
Name
|
|
31
32
|
>["form"]
|
|
32
33
|
|
|
33
34
|
if (!form) {
|
|
@@ -35,7 +36,7 @@ if (!form) {
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
defineProps<
|
|
38
|
-
BaseProps<From> & DefaultTypeProps
|
|
39
|
+
BaseProps<From, Name> & DefaultTypeProps
|
|
39
40
|
>()
|
|
40
41
|
|
|
41
42
|
defineSlots<{
|
|
@@ -17,19 +17,19 @@ export type FieldPath<T> = unknown extends T ? string
|
|
|
17
17
|
// technically we cannot have primitive at the root
|
|
18
18
|
: T extends string | boolean | number | null | undefined | symbol | bigint ? ""
|
|
19
19
|
// technically we cannot have array at the root
|
|
20
|
-
: T extends ReadonlyArray<infer U> ?
|
|
20
|
+
: T extends ReadonlyArray<infer U> ? FieldPath_<U, `[${number}]`>
|
|
21
21
|
: {
|
|
22
|
-
[K in keyof T]:
|
|
22
|
+
[K in keyof T]: FieldPath_<T[K], `${K & string}`>
|
|
23
23
|
}[keyof T]
|
|
24
24
|
|
|
25
25
|
export type FieldPath_<T, Path extends string> = unknown extends T ? string
|
|
26
26
|
: T extends string | boolean | number | null | undefined | symbol | bigint ? Path
|
|
27
|
-
: T extends ReadonlyArray<infer U> ?
|
|
27
|
+
: T extends ReadonlyArray<infer U> ? FieldPath_<U, `${Path}[${number}]`> | Path
|
|
28
28
|
: {
|
|
29
|
-
[K in keyof T]:
|
|
29
|
+
[K in keyof T]: FieldPath_<T[K], `${Path}.${K & string}`>
|
|
30
30
|
}[keyof T]
|
|
31
31
|
|
|
32
|
-
export type BaseProps<From, TName extends FieldPath<From
|
|
32
|
+
export type BaseProps<From, TName extends FieldPath<From>> = {
|
|
33
33
|
/**
|
|
34
34
|
* Will fallback to i18n when not specified.
|
|
35
35
|
* Can also be provided via #label slot for custom HTML labels.
|
|
@@ -64,31 +64,34 @@ export type DefaultTypeProps = {
|
|
|
64
64
|
|
|
65
65
|
export type OmegaInputPropsBase<
|
|
66
66
|
From extends Record<PropertyKey, any>,
|
|
67
|
-
To extends Record<PropertyKey, any
|
|
67
|
+
To extends Record<PropertyKey, any>,
|
|
68
|
+
Name extends DeepKeys<From>
|
|
68
69
|
> = {
|
|
69
70
|
form: OF<From, To> & {
|
|
70
71
|
meta: MetaRecord<From>
|
|
71
72
|
i18nNamespace?: string
|
|
72
73
|
}
|
|
73
|
-
} & BaseProps<From>
|
|
74
|
+
} & BaseProps<From, Name>
|
|
74
75
|
|
|
75
76
|
export type OmegaInputProps<
|
|
76
77
|
From extends Record<PropertyKey, any>,
|
|
77
78
|
To extends Record<PropertyKey, any>,
|
|
79
|
+
Name extends DeepKeys<From>,
|
|
78
80
|
TypeProps = DefaultTypeProps
|
|
79
81
|
> = {
|
|
80
82
|
form: OmegaFormReturn<From, To, TypeProps> & {
|
|
81
83
|
meta: MetaRecord<From>
|
|
82
84
|
i18nNamespace?: string
|
|
83
85
|
}
|
|
84
|
-
} & BaseProps<From>
|
|
86
|
+
} & BaseProps<From, Name>
|
|
85
87
|
|
|
86
88
|
export type OmegaArrayProps<
|
|
87
89
|
From extends Record<PropertyKey, any>,
|
|
88
|
-
To extends Record<PropertyKey, any
|
|
90
|
+
To extends Record<PropertyKey, any>,
|
|
91
|
+
Name extends DeepKeys<From>
|
|
89
92
|
> =
|
|
90
93
|
& Omit<
|
|
91
|
-
OmegaInputProps<From, To>,
|
|
94
|
+
OmegaInputProps<From, To, Name>,
|
|
92
95
|
"validators" | "options" | "label" | "type" | "items" | "name"
|
|
93
96
|
>
|
|
94
97
|
& {
|
|
@@ -758,9 +761,14 @@ export const generateInputStandardSchemaFromFieldMeta = (
|
|
|
758
761
|
}
|
|
759
762
|
|
|
760
763
|
if (meta.required) {
|
|
761
|
-
schema
|
|
762
|
-
|
|
763
|
-
|
|
764
|
+
schema = schema
|
|
765
|
+
.annotations({
|
|
766
|
+
message: () => trans("validation.empty")
|
|
767
|
+
})
|
|
768
|
+
.pipe(S.minLength(1))
|
|
769
|
+
.annotations({
|
|
770
|
+
message: () => trans("validation.empty")
|
|
771
|
+
})
|
|
764
772
|
}
|
|
765
773
|
|
|
766
774
|
if (meta.maxLength) {
|
|
@@ -886,8 +894,9 @@ export const nullableInput = <A, I, R>(
|
|
|
886
894
|
|
|
887
895
|
export type OmegaAutoGenMeta<
|
|
888
896
|
From extends Record<PropertyKey, any>,
|
|
889
|
-
To extends Record<PropertyKey, any
|
|
890
|
-
|
|
897
|
+
To extends Record<PropertyKey, any>,
|
|
898
|
+
Name extends DeepKeys<From>
|
|
899
|
+
> = Omit<OmegaInputProps<From, To, Name>, "form">
|
|
891
900
|
|
|
892
901
|
const supportedInputs = [
|
|
893
902
|
"button",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
generic="
|
|
41
41
|
// dprint ignore - somehow with 120 chars, this becomes a mess. should report it.
|
|
42
42
|
From extends Record<PropertyKey, any>,
|
|
43
|
-
To extends Record<PropertyKey, any
|
|
43
|
+
To extends Record<PropertyKey, any>,
|
|
44
|
+
Name extends DeepKeys<From>
|
|
44
45
|
"
|
|
45
46
|
>
|
|
46
47
|
import { type DeepKeys } from "@tanstack/vue-form"
|
|
@@ -49,7 +50,7 @@ import { useIntl } from "../../utils"
|
|
|
49
50
|
import { type FieldMeta, generateInputStandardSchemaFromFieldMeta, type OmegaInputPropsBase } from "./OmegaFormStuff"
|
|
50
51
|
import OmegaInternalInput from "./OmegaInternalInput.vue"
|
|
51
52
|
|
|
52
|
-
const props = defineProps<OmegaInputPropsBase<From, To>>()
|
|
53
|
+
const props = defineProps<OmegaInputPropsBase<From, To, Name>>()
|
|
53
54
|
|
|
54
55
|
// downgrade to *as* DeepKeys<From> to avoid useless and possible infinite recursion in TS
|
|
55
56
|
const propsName = computed(() => props.name as DeepKeys<From>)
|