@effect-app/vue-components 1.0.0-next.8 → 1.0.0-next.9

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.
@@ -121,4 +121,7 @@ export declare const nullableInput: <A, I, R>(schema: S.Schema<A, I, R>, default
121
121
  withDefault: S.PropertySignature<":", A | null, never, ":", I | null, true, R>;
122
122
  }, S.SchemaClass<A, A, never>>;
123
123
  export type OmegaAutoGenMeta<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>> = Omit<OmegaInputProps<From, To>, "form">;
124
- export declare const getInputType: (input: string) => string;
124
+ declare const supportedInputs: readonly ["button", "checkbox", "color", "date", "email", "number", "password", "radio", "range", "search", "submit", "tel", "text", "time", "url"];
125
+ export type SupportedInputs = typeof supportedInputs[number];
126
+ export declare const getInputType: (input: string) => SupportedInputs;
127
+ export {};
@@ -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 E, getCurrentInstance as V, useId as w, computed as a, watch as f, nextTick as N, onMounted as d, ref as $, watchEffect as k, renderSlot as B, normalizeProps as I, guardReactiveProps as _, createElementVNode as q, normalizeClass as L, createBlock as O, createCommentVNode as P, unref as F, openBlock as S, mergeProps as T } from "vue";
3
3
  import { useStore as z } from "@tanstack/vue-form";
4
- import A from "./vue-components.es40.js";
4
+ import A from "./vue-components.es39.js";
5
5
 
6
6
  const G = /* @__PURE__ */ E({
7
7
  inheritAttrs: !1,
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as m, createElementBlock as d, openBlock as a, withModifiers as l, createElementVNode as u, unref as r, renderSlot as b } from "vue";
2
2
  import { useStore as f } from "@tanstack/vue-form";
3
- import { getOmegaStore as p } from "./vue-components.es39.js";
3
+ import { getOmegaStore as p } from "./vue-components.es41.js";
4
4
  const c = ["disabled"], V = /* @__PURE__ */ m({
5
5
  __name: "OmegaWrapper",
6
6
  props: {
@@ -1,13 +1,117 @@
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
+ import { defineComponent as P, resolveComponent as s, createElementBlock as g, openBlock as o, createBlock as n, createCommentVNode as l, resolveDynamicComponent as u, mergeProps as i, unref as y } from "vue";
2
+ import { getInputType as v } from "./vue-components.es7.js";
3
+ const V = /* @__PURE__ */ P({
4
+ inheritAttrs: !1,
5
+ __name: "OmegaInputVuetify",
6
+ props: {
7
+ inputProps: {},
8
+ vuetifyValue: {}
9
+ },
10
+ emits: ["focus", "blur"],
11
+ setup(f) {
12
+ return (e, r) => {
13
+ const a = s("v-text-field"), t = s("v-textarea"), m = s("v-select"), d = s("v-autocomplete");
14
+ return o(), g("div", {
15
+ class: "omega-input",
16
+ onFocusout: r[4] || (r[4] = (p) => e.$emit("blur", p)),
17
+ onFocusin: r[5] || (r[5] = (p) => e.$emit("focus", p))
18
+ }, [
19
+ e.inputProps.type === "boolean" || e.inputProps.type === "switch" ? (o(), n(u(e.inputProps.type === "boolean" ? "v-checkbox" : "v-switch"), i({
20
+ key: 0,
21
+ id: e.inputProps.id,
22
+ name: e.inputProps.name,
23
+ label: e.inputProps.label,
24
+ "error-messages": e.inputProps.errorMessages,
25
+ error: e.inputProps.error,
26
+ ripple: ""
27
+ }, e.$attrs, {
28
+ "model-value": e.vuetifyValue,
29
+ onChange: r[0] || (r[0] = (p) => e.inputProps.field.handleChange(p.target.checked))
30
+ }), null, 16, ["id", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
31
+ e.inputProps.type === "email" || e.inputProps.type === "string" || e.inputProps.type === "password" ? (o(), n(a, i({
32
+ key: 1,
33
+ id: e.inputProps.id,
34
+ required: e.inputProps.required,
35
+ "min-length": e.inputProps.minLength,
36
+ "max-length": e.inputProps.maxLength,
37
+ type: y(v)(e.inputProps.type),
38
+ name: e.inputProps.name,
39
+ label: e.inputProps.label,
40
+ "error-messages": e.inputProps.errorMessages,
41
+ error: e.inputProps.error
42
+ }, e.$attrs, {
43
+ "model-value": e.vuetifyValue,
44
+ "onUpdate:modelValue": e.inputProps.field.handleChange
45
+ }), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
46
+ e.inputProps.type === "text" ? (o(), n(t, i({
47
+ key: 2,
48
+ id: e.inputProps.id,
49
+ required: e.inputProps.required,
50
+ "min-length": e.inputProps.minLength,
51
+ "max-length": e.inputProps.maxLength,
52
+ name: e.inputProps.name,
53
+ label: e.inputProps.label,
54
+ "error-messages": e.inputProps.errorMessages,
55
+ error: e.inputProps.error
56
+ }, e.$attrs, {
57
+ "model-value": e.vuetifyValue,
58
+ "onUpdate:modelValue": e.inputProps.field.handleChange
59
+ }), null, 16, ["id", "required", "min-length", "max-length", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
60
+ e.inputProps.type === "number" || e.inputProps.type === "range" ? (o(), n(u(e.inputProps.type === "range" ? "v-slider" : "v-text-field"), i({
61
+ key: 3,
62
+ id: e.inputProps.id,
63
+ required: e.inputProps.required,
64
+ min: e.inputProps.min,
65
+ max: e.inputProps.max,
66
+ type: e.inputProps.type,
67
+ name: e.inputProps.name,
68
+ label: e.inputProps.label,
69
+ "error-messages": e.inputProps.errorMessages,
70
+ error: e.inputProps.error
71
+ }, e.$attrs, {
72
+ "model-value": e.vuetifyValue,
73
+ "onUpdate:modelValue": r[1] || (r[1] = (p) => {
74
+ p || p === 0 ? e.inputProps.field.handleChange(Number(p)) : e.inputProps.field.handleChange(void 0);
75
+ })
76
+ }), null, 16, ["id", "required", "min", "max", "type", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
77
+ e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (o(), n(m, i({
78
+ key: 4,
79
+ id: e.inputProps.id,
80
+ clearable: e.inputProps.type === "select",
81
+ required: e.inputProps.required,
82
+ multiple: e.inputProps.type === "multiple",
83
+ chips: e.inputProps.type === "multiple",
84
+ name: e.inputProps.name,
85
+ label: e.inputProps.label,
86
+ items: e.inputProps.options,
87
+ "error-messages": e.inputProps.errorMessages,
88
+ error: e.inputProps.error
89
+ }, e.$attrs, {
90
+ "model-value": e.vuetifyValue,
91
+ onClear: r[2] || (r[2] = (p) => e.inputProps.field.handleChange(void 0)),
92
+ "onUpdate:modelValue": e.inputProps.field.handleChange
93
+ }), null, 16, ["id", "clearable", "required", "multiple", "chips", "name", "label", "items", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
94
+ e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (o(), n(d, i({
95
+ key: 5,
96
+ id: e.inputProps.id,
97
+ clearable: e.inputProps.type === "autocomplete",
98
+ multiple: e.inputProps.type === "autocompletemultiple",
99
+ required: e.inputProps.required,
100
+ name: e.inputProps.name,
101
+ label: e.inputProps.label,
102
+ items: e.inputProps.options,
103
+ "error-messages": e.inputProps.errorMessages,
104
+ error: e.inputProps.error,
105
+ chips: e.inputProps.type === "autocompletemultiple"
106
+ }, e.$attrs, {
107
+ "model-value": e.vuetifyValue,
108
+ onClear: r[3] || (r[3] = (p) => e.inputProps.field.handleChange(void 0)),
109
+ "onUpdate:modelValue": e.inputProps.field.handleChange
110
+ }), null, 16, ["id", "clearable", "multiple", "required", "name", "label", "items", "error-messages", "error", "chips", "model-value", "onUpdate:modelValue"])) : l("", !0)
111
+ ], 32);
112
+ };
113
+ }
114
+ });
11
115
  export {
12
- c as getOmegaStore
116
+ V as default
13
117
  };
@@ -0,0 +1,13 @@
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
+ }
11
+ export {
12
+ c as getOmegaStore
13
+ };
@@ -1,5 +1,5 @@
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.es40.js";
2
+ import o from "./vue-components.es39.js";
3
3
 
4
4
  export {
5
5
  o as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/vue-components",
3
- "version": "1.0.0-next.8",
3
+ "version": "1.0.0-next.9",
4
4
  "peerDependencies": {
5
5
  "@mdi/js": "^7.4.47",
6
6
  "effect": "^3.17.13",
@@ -49,8 +49,8 @@
49
49
  "@tanstack/vue-form": "^1.23.0",
50
50
  "highlight.js": "^11.11.1",
51
51
  "vue3-highlightjs": "^1.0.5",
52
- "effect-app": "3.8.0",
53
- "@effect-app/vue": "2.80.2"
52
+ "@effect-app/vue": "2.80.2",
53
+ "effect-app": "3.8.0"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "pnpm build:run",
@@ -825,5 +825,7 @@ const supportedInputs = [
825
825
  "text",
826
826
  "time",
827
827
  "url"
828
- ]
829
- export const getInputType = (input: string) => supportedInputs.includes(input) ? input : "text"
828
+ ] as const
829
+ export type SupportedInputs = typeof supportedInputs[number]
830
+ export const getInputType = (input: string): SupportedInputs =>
831
+ (supportedInputs as readonly string[]).includes(input) ? input as SupportedInputs : "text"
@@ -1,117 +0,0 @@
1
- import { defineComponent as P, resolveComponent as s, createElementBlock as g, openBlock as o, createBlock as n, createCommentVNode as l, resolveDynamicComponent as u, mergeProps as i, unref as y } from "vue";
2
- import { getInputType as v } from "./vue-components.es7.js";
3
- const V = /* @__PURE__ */ P({
4
- inheritAttrs: !1,
5
- __name: "OmegaInputVuetify",
6
- props: {
7
- inputProps: {},
8
- vuetifyValue: {}
9
- },
10
- emits: ["focus", "blur"],
11
- setup(f) {
12
- return (e, r) => {
13
- const a = s("v-text-field"), t = s("v-textarea"), m = s("v-select"), d = s("v-autocomplete");
14
- return o(), g("div", {
15
- class: "omega-input",
16
- onFocusout: r[4] || (r[4] = (p) => e.$emit("blur", p)),
17
- onFocusin: r[5] || (r[5] = (p) => e.$emit("focus", p))
18
- }, [
19
- e.inputProps.type === "boolean" || e.inputProps.type === "switch" ? (o(), n(u(e.inputProps.type === "boolean" ? "v-checkbox" : "v-switch"), i({
20
- key: 0,
21
- id: e.inputProps.id,
22
- name: e.inputProps.name,
23
- label: e.inputProps.label,
24
- "error-messages": e.inputProps.errorMessages,
25
- error: e.inputProps.error,
26
- ripple: ""
27
- }, e.$attrs, {
28
- "model-value": e.vuetifyValue,
29
- onChange: r[0] || (r[0] = (p) => e.inputProps.field.handleChange(p.target.checked))
30
- }), null, 16, ["id", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
31
- e.inputProps.type === "email" || e.inputProps.type === "string" || e.inputProps.type === "password" ? (o(), n(a, i({
32
- key: 1,
33
- id: e.inputProps.id,
34
- required: e.inputProps.required,
35
- "min-length": e.inputProps.minLength,
36
- "max-length": e.inputProps.maxLength,
37
- type: y(v)(e.inputProps.type),
38
- name: e.inputProps.name,
39
- label: e.inputProps.label,
40
- "error-messages": e.inputProps.errorMessages,
41
- error: e.inputProps.error
42
- }, e.$attrs, {
43
- "model-value": e.vuetifyValue,
44
- "onUpdate:modelValue": e.inputProps.field.handleChange
45
- }), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
46
- e.inputProps.type === "text" ? (o(), n(t, i({
47
- key: 2,
48
- id: e.inputProps.id,
49
- required: e.inputProps.required,
50
- "min-length": e.inputProps.minLength,
51
- "max-length": e.inputProps.maxLength,
52
- name: e.inputProps.name,
53
- label: e.inputProps.label,
54
- "error-messages": e.inputProps.errorMessages,
55
- error: e.inputProps.error
56
- }, e.$attrs, {
57
- "model-value": e.vuetifyValue,
58
- "onUpdate:modelValue": e.inputProps.field.handleChange
59
- }), null, 16, ["id", "required", "min-length", "max-length", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
60
- e.inputProps.type === "number" || e.inputProps.type === "range" ? (o(), n(u(e.inputProps.type === "range" ? "v-slider" : "v-text-field"), i({
61
- key: 3,
62
- id: e.inputProps.id,
63
- required: e.inputProps.required,
64
- min: e.inputProps.min,
65
- max: e.inputProps.max,
66
- type: e.inputProps.type,
67
- name: e.inputProps.name,
68
- label: e.inputProps.label,
69
- "error-messages": e.inputProps.errorMessages,
70
- error: e.inputProps.error
71
- }, e.$attrs, {
72
- "model-value": e.vuetifyValue,
73
- "onUpdate:modelValue": r[1] || (r[1] = (p) => {
74
- p || p === 0 ? e.inputProps.field.handleChange(Number(p)) : e.inputProps.field.handleChange(void 0);
75
- })
76
- }), null, 16, ["id", "required", "min", "max", "type", "name", "label", "error-messages", "error", "model-value"])) : l("", !0),
77
- e.inputProps.type === "select" || e.inputProps.type === "multiple" ? (o(), n(m, i({
78
- key: 4,
79
- id: e.inputProps.id,
80
- clearable: e.inputProps.type === "select",
81
- required: e.inputProps.required,
82
- multiple: e.inputProps.type === "multiple",
83
- chips: e.inputProps.type === "multiple",
84
- name: e.inputProps.name,
85
- label: e.inputProps.label,
86
- items: e.inputProps.options,
87
- "error-messages": e.inputProps.errorMessages,
88
- error: e.inputProps.error
89
- }, e.$attrs, {
90
- "model-value": e.vuetifyValue,
91
- onClear: r[2] || (r[2] = (p) => e.inputProps.field.handleChange(void 0)),
92
- "onUpdate:modelValue": e.inputProps.field.handleChange
93
- }), null, 16, ["id", "clearable", "required", "multiple", "chips", "name", "label", "items", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : l("", !0),
94
- e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (o(), n(d, i({
95
- key: 5,
96
- id: e.inputProps.id,
97
- clearable: e.inputProps.type === "autocomplete",
98
- multiple: e.inputProps.type === "autocompletemultiple",
99
- required: e.inputProps.required,
100
- name: e.inputProps.name,
101
- label: e.inputProps.label,
102
- items: e.inputProps.options,
103
- "error-messages": e.inputProps.errorMessages,
104
- error: e.inputProps.error,
105
- chips: e.inputProps.type === "autocompletemultiple"
106
- }, e.$attrs, {
107
- "model-value": e.vuetifyValue,
108
- onClear: r[3] || (r[3] = (p) => e.inputProps.field.handleChange(void 0)),
109
- "onUpdate:modelValue": e.inputProps.field.handleChange
110
- }), null, 16, ["id", "clearable", "multiple", "required", "name", "label", "items", "error-messages", "error", "chips", "model-value", "onUpdate:modelValue"])) : l("", !0)
111
- ], 32);
112
- };
113
- }
114
- });
115
- export {
116
- V as default
117
- };