@effect-app/vue-components 2.7.4 → 2.7.6

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.
Files changed (42) hide show
  1. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +1 -0
  2. package/dist/vue-components.es.js +12 -11
  3. package/dist/vue-components.es10.js +177 -179
  4. package/dist/vue-components.es12.js +1 -0
  5. package/dist/vue-components.es16.js +1 -1
  6. package/dist/vue-components.es17.js +1 -1
  7. package/dist/vue-components.es2.js +14 -13
  8. package/dist/vue-components.es20.js +2 -2
  9. package/dist/vue-components.es21.js +2 -2
  10. package/dist/vue-components.es22.js +1 -1
  11. package/dist/vue-components.es23.js +1 -1
  12. package/dist/vue-components.es30.js +41 -191
  13. package/dist/vue-components.es31.js +4 -0
  14. package/dist/vue-components.es32.js +2 -42
  15. package/dist/vue-components.es33.js +89 -2
  16. package/dist/vue-components.es35.js +7 -89
  17. package/dist/vue-components.es36.js +34 -0
  18. package/dist/vue-components.es38.js +187 -27
  19. package/dist/vue-components.es40.js +23 -4
  20. package/dist/vue-components.es41.js +5 -23
  21. package/dist/vue-components.es42.js +21 -5
  22. package/dist/vue-components.es43.js +25 -16
  23. package/dist/vue-components.es44.js +15 -23
  24. package/dist/vue-components.es45.js +7 -17
  25. package/dist/vue-components.es46.js +5 -12
  26. package/dist/vue-components.es47.js +19 -5
  27. package/dist/vue-components.es48.js +9 -19
  28. package/dist/vue-components.es49.js +31 -9
  29. package/dist/vue-components.es50.js +42 -25
  30. package/dist/vue-components.es51.js +16 -38
  31. package/dist/vue-components.es52.js +11 -26
  32. package/dist/vue-components.es53.js +4 -11
  33. package/dist/vue-components.es54.js +1 -1
  34. package/dist/vue-components.es56.js +1 -1
  35. package/dist/vue-components.es58.js +3 -3
  36. package/dist/vue-components.es59.js +1 -1
  37. package/dist/vue-components.es7.js +1 -1
  38. package/package.json +1 -1
  39. package/src/components/OmegaForm/OmegaFormStuff.ts +1 -1
  40. package/src/components/OmegaForm/useOmegaForm.ts +17 -57
  41. package/dist/vue-components.es34.js +0 -4
  42. package/dist/vue-components.es37.js +0 -9
@@ -1,50 +1,28 @@
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 = (
1
+ import { registerGlobal as a, getGlobal as p, unregisterGlobal as s } from "./vue-components.es57.js";
2
+ import { ProxyTracerProvider as i } from "./vue-components.es44.js";
3
+ import { wrapSpanContext as c, isSpanContextValid as h } from "./vue-components.es47.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 = (
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.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) || _;
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
- this._getContextManager().disable(), g(l, u.instance());
22
+ s(n, o.instance()), this._proxyTracerProvider = new i();
45
23
  }, t;
46
24
  })()
47
25
  );
48
26
  export {
49
- A as ContextAPI
27
+ y as TraceAPI
50
28
  };
@@ -1,28 +1,13 @@
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
- );
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
+ }
26
11
  export {
27
- y as TraceAPI
12
+ c as getOmegaStore
28
13
  };
@@ -1,13 +1,6 @@
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
- }
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.es38.js";
3
+
11
4
  export {
12
- c as getOmegaStore
5
+ o as default
13
6
  };
@@ -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.es42.js";
3
+ import { DiagLogLevel as d } from "./vue-components.es41.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,4 +1,4 @@
1
- import { DiagLogLevel as r } from "./vue-components.es42.js";
1
+ import { DiagLogLevel as r } from "./vue-components.es41.js";
2
2
  function c(n, o) {
3
3
  n < r.NONE ? n = r.NONE : n > r.ALL && (n = r.ALL), o = o || {};
4
4
  function i(t, f) {
@@ -1,6 +1,6 @@
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";
1
+ import { createContextKey as o } from "./vue-components.es40.js";
2
+ import { NonRecordingSpan as a } from "./vue-components.es49.js";
3
+ import { ContextAPI as u } from "./vue-components.es50.js";
4
4
  var n = o("OpenTelemetry Context Key SPAN");
5
5
  function r(e) {
6
6
  return e.getValue(n) || void 0;
@@ -1,4 +1,4 @@
1
- import { ROOT_CONTEXT as l } from "./vue-components.es41.js";
1
+ import { ROOT_CONTEXT as l } from "./vue-components.es40.js";
2
2
  var c = function(t, o) {
3
3
  var n = typeof Symbol == "function" && t[Symbol.iterator];
4
4
  if (!n) return t;
@@ -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 $, computed as n, getCurrentInstance as N, useAttrs as S, useSlots as k, useId as q, renderSlot as u, normalizeProps as s, guardReactiveProps as d, createElementVNode as B, normalizeClass as w, createBlock as I, createCommentVNode as L, 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.es30.js";
4
+ import T from "./vue-components.es38.js";
5
5
 
6
6
  const H = /* @__PURE__ */ $({
7
7
  inheritAttrs: !1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/vue-components",
3
- "version": "2.7.4",
3
+ "version": "2.7.6",
4
4
  "peerDependencies": {
5
5
  "@mdi/js": "^7.4.47",
6
6
  "effect": "^3.18.0",
@@ -321,7 +321,7 @@ const getNullableOrUndefined = (property: S.AST.AST) => {
321
321
  )
322
322
  }
323
323
 
324
- const isNullableOrUndefined = (property: false | S.AST.AST | undefined) => {
324
+ export const isNullableOrUndefined = (property: false | S.AST.AST | undefined) => {
325
325
  if (!property || !S.AST.isUnion(property)) return false
326
326
  if (property.types.find((_) => _._tag === "UndefinedKeyword")) {
327
327
  return "undefined"
@@ -11,7 +11,7 @@ import { MergedInputProps } from "./InputProps"
11
11
  import OmegaArray from "./OmegaArray.vue"
12
12
  import OmegaAutoGen from "./OmegaAutoGen.vue"
13
13
  import OmegaErrorsInternal from "./OmegaErrorsInternal.vue"
14
- import { BaseProps, DefaultTypeProps, FieldPath, type FormProps, generateMetaFromSchema, type MetaRecord, type NestedKeyOf, OmegaArrayProps, OmegaAutoGenMeta, OmegaError, type OmegaFormApi, OmegaFormState } from "./OmegaFormStuff"
14
+ import { BaseProps, DefaultTypeProps, FieldPath, type FormProps, generateMetaFromSchema, isNullableOrUndefined, type MetaRecord, type NestedKeyOf, OmegaArrayProps, OmegaAutoGenMeta, OmegaError, type OmegaFormApi, OmegaFormState } from "./OmegaFormStuff"
15
15
  import OmegaInput from "./OmegaInput.vue"
16
16
  import OmegaTaggedUnion from "./OmegaTaggedUnion.vue"
17
17
  import OmegaForm from "./OmegaWrapper.vue"
@@ -758,54 +758,6 @@ export const useOmegaForm = <
758
758
  return target
759
759
  }
760
760
 
761
- // Normalize default values based on schema metadata
762
- // Convert empty strings to null/undefined for nullable fields
763
- // Also initialize missing nullable fields with null/undefined
764
- const normalizeDefaultValues = (values?: Partial<From>): Partial<From> | undefined => {
765
- if (!values) return undefined
766
- const normalized: any = { ...values }
767
-
768
- // Helper to get nested value from object using dot notation
769
- const getNestedValue = (obj: any, path: string) => {
770
- return path.split(".").reduce((current, key) => current?.[key], obj)
771
- }
772
-
773
- // Helper to set nested value in object using dot notation
774
- const setNestedValue = (obj: any, path: string, value: any) => {
775
- const parts = path.split(".")
776
- const last = parts.pop()!
777
- const target = parts.reduce((current, key) => {
778
- if (!current[key]) current[key] = {}
779
- return current[key]
780
- }, obj)
781
- target[last] = value
782
- }
783
-
784
- // Process all fields in the schema metadata
785
- for (const key in meta) {
786
- const fieldMeta = meta[key as keyof typeof meta]
787
- const value = getNestedValue(normalized, key)
788
-
789
- // Check if the value is falsy (but not boolean false or zero)
790
- const isFalsyButNotZero = value == null || value === false || value === "" || Number.isNaN(value)
791
- const isFalsy = isFalsyButNotZero && value !== false && value !== 0
792
-
793
- if (
794
- fieldMeta
795
- && !fieldMeta.required
796
- && fieldMeta.nullableOrUndefined
797
- && fieldMeta.type !== "boolean"
798
- ) {
799
- // If value is missing or falsy, set to null or undefined based on schema
800
- if (value === undefined || isFalsy) {
801
- setNestedValue(normalized, key, fieldMeta.nullableOrUndefined === "undefined" ? undefined : null)
802
- }
803
- }
804
- }
805
-
806
- return normalized
807
- }
808
-
809
761
  // Helper function to recursively extract default values from schema AST
810
762
  const extractDefaultsFromAST = (schemaObj: any): any => {
811
763
  const result: Record<string, any> = {}
@@ -861,12 +813,22 @@ export const useOmegaForm = <
861
813
  if ((fieldSchema as any)?.ast?.defaultValue) {
862
814
  try {
863
815
  const defaultValue = (fieldSchema as any).ast.defaultValue()
864
- if (defaultValue !== undefined) {
865
- result[key] = defaultValue
866
- }
816
+ result[key] = defaultValue
867
817
  } catch {
868
818
  // Silently ignore if defaultValue() throws
869
819
  }
820
+ } else {
821
+ // TODO Should we put to null/undefined only leaves?
822
+ const ast = (fieldSchema as any).ast
823
+ const nullableOrUndefined = isNullableOrUndefined(ast)
824
+ switch (nullableOrUndefined) {
825
+ case "null":
826
+ result[key] = null
827
+ break
828
+ case "undefined":
829
+ result[key] = undefined
830
+ break
831
+ }
870
832
  }
871
833
 
872
834
  // Recursively check nested fields for structs and unions
@@ -959,11 +921,9 @@ export const useOmegaForm = <
959
921
 
960
922
  // we just return what we gathered from the query/storage
961
923
  return extractSchemaDefaults(
962
- normalizeDefaultValues(
963
- omegaConfig?.persistency?.overrideDefaultValues
964
- ? deepMerge(tanstackFormOptions?.defaultValues || {}, defValuesPatch)
965
- : deepMerge(defValuesPatch, tanstackFormOptions?.defaultValues || {})
966
- )
924
+ omegaConfig?.persistency?.overrideDefaultValues
925
+ ? deepMerge(tanstackFormOptions?.defaultValues || {}, defValuesPatch)
926
+ : deepMerge(defValuesPatch, tanstackFormOptions?.defaultValues || {})
967
927
  )
968
928
  })
969
929
 
@@ -1,4 +0,0 @@
1
- import f from "./vue-components.es19.js";
2
- export {
3
- f as default
4
- };
@@ -1,9 +0,0 @@
1
- const s = (t, e) => {
2
- const o = t.__vccOpts || t;
3
- for (const [r, c] of e)
4
- o[r] = c;
5
- return o;
6
- };
7
- export {
8
- s as default
9
- };