@effect-app/vue-components 4.0.0-beta.282 → 4.0.0-beta.283
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/OmegaInputVuetify.vue.d.ts +6 -0
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +5 -9
- package/dist/types/components/OmegaForm/createUseFormWithCustomInput.d.ts +4 -2
- package/dist/types/components/OmegaForm/index.d.ts +1 -0
- package/dist/types/components/OmegaForm/types.d.ts +26 -3
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +4 -2
- package/dist/vue-components.es.js +9 -9
- package/dist/vue-components22.es.js +1 -0
- package/dist/vue-components30.es.js +23 -265
- package/dist/vue-components31.es.js +300 -0
- package/dist/vue-components33.es.js +7 -72
- package/dist/vue-components34.es.js +71 -3
- package/dist/vue-components35.es.js +4 -54
- package/dist/vue-components36.es.js +60 -4
- package/dist/vue-components37.es.js +4 -23
- package/dist/vue-components38.es.js +23 -4
- package/dist/vue-components39.es.js +3 -57
- package/dist/vue-components40.es.js +57 -3
- package/dist/vue-components41.es.js +4 -11
- package/dist/vue-components42.es.js +11 -21
- package/dist/vue-components43.es.js +22 -0
- package/dist/vue-components45.es.js +8 -3
- package/dist/vue-components46.es.js +3 -37
- package/dist/vue-components47.es.js +34 -23
- package/dist/vue-components48.es.js +23 -24
- package/dist/vue-components49.es.js +27 -6
- package/dist/vue-components50.es.js +6 -17
- package/dist/vue-components51.es.js +16 -34
- package/dist/vue-components52.es.js +34 -16
- package/dist/vue-components53.es.js +16 -19
- package/dist/vue-components54.es.js +10 -19
- package/dist/vue-components55.es.js +29 -6
- package/dist/vue-components56.es.js +6 -8
- package/dist/vue-components57.es.js +7 -36
- package/dist/vue-components58.es.js +37 -24
- package/dist/vue-components59.es.js +19 -122
- package/dist/vue-components60.es.js +126 -22
- package/dist/vue-components61.es.js +20 -17
- package/dist/vue-components62.es.js +18 -6
- package/dist/vue-components63.es.js +5 -15
- package/dist/vue-components64.es.js +18 -4
- package/dist/vue-components65.es.js +4 -28
- package/dist/vue-components66.es.js +28 -4
- package/dist/vue-components67.es.js +4 -42
- package/dist/vue-components68.es.js +38 -95
- package/dist/vue-components69.es.js +95 -27
- package/dist/vue-components70.es.js +35 -18
- package/dist/vue-components71.es.js +18 -47
- package/dist/vue-components72.es.js +48 -0
- package/package.json +3 -3
- package/src/components/OmegaForm/OmegaInput.vue +4 -1
- package/src/components/OmegaForm/OmegaInputVuetify.vue +49 -2
- package/src/components/OmegaForm/OmegaInternalInput.vue +16 -9
- package/src/components/OmegaForm/createUseFormWithCustomInput.ts +15 -14
- package/src/components/OmegaForm/index.ts +1 -0
- package/src/components/OmegaForm/types.ts +63 -21
- package/src/components/OmegaForm/useOmegaForm.ts +7 -6
- package/dist/vue-components32.es.js +0 -8
- package/dist/vue-components44.es.js +0 -9
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { getInputType as e } from "./vue-components11.es.js";
|
|
2
|
+
import { typeOverrides as t } from "./vue-components30.es.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createSlots as s, defineComponent as c, guardReactiveProps as l, mergeProps as u, normalizeProps as d, openBlock as f, renderList as p, renderSlot as m, resolveComponent as h, resolveDynamicComponent as g, unref as _, watchEffect as v, withCtx as y } from "vue";
|
|
4
|
+
//#region src/components/OmegaForm/OmegaInputVuetify.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var b = /*@__PURE__*/ c({
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "OmegaInputVuetify",
|
|
8
|
+
props: {
|
|
9
|
+
inputProps: {},
|
|
10
|
+
field: {},
|
|
11
|
+
state: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["focus", "blur"],
|
|
14
|
+
setup(c) {
|
|
15
|
+
let b = c, x = r(() => !t.includes(b.inputProps.type));
|
|
16
|
+
return v(() => {
|
|
17
|
+
x.value && console.warn(`[OmegaForm] Unhandled input type "${b.inputProps.type}", falling back to a text input.`);
|
|
18
|
+
}), (t, r) => {
|
|
19
|
+
let v = h("v-text-field"), b = h("v-textarea"), S = h("v-radio"), C = h("v-radio-group"), w = h("v-select"), T = h("v-autocomplete");
|
|
20
|
+
return f(), o("div", {
|
|
21
|
+
class: "omega-input",
|
|
22
|
+
onFocusout: r[8] ||= (e) => {
|
|
23
|
+
t.$emit("blur", e), c.field.handleBlur();
|
|
24
|
+
},
|
|
25
|
+
onFocusin: r[9] ||= (e) => t.$emit("focus", e)
|
|
26
|
+
}, [
|
|
27
|
+
c.inputProps.type === "boolean" || c.inputProps.type === "switch" ? (f(), i(g(c.inputProps.type === "boolean" ? "v-checkbox" : "v-switch"), u({
|
|
28
|
+
key: 0,
|
|
29
|
+
id: c.inputProps.id,
|
|
30
|
+
name: c.field.name,
|
|
31
|
+
label: c.inputProps.label,
|
|
32
|
+
"error-messages": c.inputProps.errorMessages,
|
|
33
|
+
error: c.inputProps.error,
|
|
34
|
+
ripple: ""
|
|
35
|
+
}, t.$attrs, {
|
|
36
|
+
"model-value": c.state.value,
|
|
37
|
+
onChange: r[0] ||= (e) => c.field.handleChange(e.target.checked)
|
|
38
|
+
}), s({ _: 2 }, [t.$slots.label ? {
|
|
39
|
+
name: "label",
|
|
40
|
+
fn: y(() => [m(t.$slots, "label", d(l({
|
|
41
|
+
required: c.inputProps.required,
|
|
42
|
+
id: c.inputProps.id,
|
|
43
|
+
label: c.inputProps.label
|
|
44
|
+
})))]),
|
|
45
|
+
key: "0"
|
|
46
|
+
} : void 0]), 1040, [
|
|
47
|
+
"id",
|
|
48
|
+
"name",
|
|
49
|
+
"label",
|
|
50
|
+
"error-messages",
|
|
51
|
+
"error",
|
|
52
|
+
"model-value"
|
|
53
|
+
])) : a("", !0),
|
|
54
|
+
c.inputProps.type === "email" || c.inputProps.type === "string" || c.inputProps.type === "password" || c.inputProps.type === "date" || c.inputProps.type === "tel" || c.inputProps.type === "url" || c.inputProps.type === "color" || c.inputProps.type === "time" || c.inputProps.type === "search" ? (f(), i(v, u({
|
|
55
|
+
key: 1,
|
|
56
|
+
id: c.inputProps.id,
|
|
57
|
+
required: c.inputProps.required,
|
|
58
|
+
"min-length": c.inputProps.minLength,
|
|
59
|
+
"max-length": c.inputProps.maxLength,
|
|
60
|
+
type: _(e)(c.inputProps.type),
|
|
61
|
+
name: c.field.name,
|
|
62
|
+
label: c.inputProps.label,
|
|
63
|
+
"error-messages": c.inputProps.errorMessages,
|
|
64
|
+
error: c.inputProps.error
|
|
65
|
+
}, t.$attrs, {
|
|
66
|
+
"model-value": c.state.value,
|
|
67
|
+
"onUpdate:modelValue": r[1] ||= (e) => c.field.handleChange(e)
|
|
68
|
+
}), s({ _: 2 }, [t.$slots.label ? {
|
|
69
|
+
name: "label",
|
|
70
|
+
fn: y(() => [m(t.$slots, "label", d(l({
|
|
71
|
+
required: c.inputProps.required,
|
|
72
|
+
id: c.inputProps.id,
|
|
73
|
+
label: c.inputProps.label
|
|
74
|
+
})))]),
|
|
75
|
+
key: "0"
|
|
76
|
+
} : void 0]), 1040, [
|
|
77
|
+
"id",
|
|
78
|
+
"required",
|
|
79
|
+
"min-length",
|
|
80
|
+
"max-length",
|
|
81
|
+
"type",
|
|
82
|
+
"name",
|
|
83
|
+
"label",
|
|
84
|
+
"error-messages",
|
|
85
|
+
"error",
|
|
86
|
+
"model-value"
|
|
87
|
+
])) : a("", !0),
|
|
88
|
+
c.inputProps.type === "text" ? (f(), i(b, u({
|
|
89
|
+
key: 2,
|
|
90
|
+
id: c.inputProps.id,
|
|
91
|
+
required: c.inputProps.required,
|
|
92
|
+
"min-length": c.inputProps.minLength,
|
|
93
|
+
"max-length": c.inputProps.maxLength,
|
|
94
|
+
name: c.field.name,
|
|
95
|
+
label: c.inputProps.label,
|
|
96
|
+
"error-messages": c.inputProps.errorMessages,
|
|
97
|
+
error: c.inputProps.error
|
|
98
|
+
}, t.$attrs, {
|
|
99
|
+
"model-value": c.state.value,
|
|
100
|
+
"onUpdate:modelValue": r[2] ||= (e) => c.field.handleChange(e)
|
|
101
|
+
}), s({ _: 2 }, [t.$slots.label ? {
|
|
102
|
+
name: "label",
|
|
103
|
+
fn: y(() => [m(t.$slots, "label", d(l({
|
|
104
|
+
required: c.inputProps.required,
|
|
105
|
+
id: c.inputProps.id,
|
|
106
|
+
label: c.inputProps.label
|
|
107
|
+
})))]),
|
|
108
|
+
key: "0"
|
|
109
|
+
} : void 0]), 1040, [
|
|
110
|
+
"id",
|
|
111
|
+
"required",
|
|
112
|
+
"min-length",
|
|
113
|
+
"max-length",
|
|
114
|
+
"name",
|
|
115
|
+
"label",
|
|
116
|
+
"error-messages",
|
|
117
|
+
"error",
|
|
118
|
+
"model-value"
|
|
119
|
+
])) : a("", !0),
|
|
120
|
+
c.inputProps.type === "number" || c.inputProps.type === "range" ? (f(), i(g(c.inputProps.type === "range" ? "v-slider" : "v-text-field"), u({
|
|
121
|
+
key: 3,
|
|
122
|
+
id: c.inputProps.id,
|
|
123
|
+
required: c.inputProps.required,
|
|
124
|
+
min: c.inputProps.min,
|
|
125
|
+
max: c.inputProps.max,
|
|
126
|
+
type: c.inputProps.type,
|
|
127
|
+
name: c.field.name,
|
|
128
|
+
label: c.inputProps.label,
|
|
129
|
+
"error-messages": c.inputProps.errorMessages,
|
|
130
|
+
error: c.inputProps.error
|
|
131
|
+
}, t.$attrs, {
|
|
132
|
+
"model-value": c.state.value,
|
|
133
|
+
"onUpdate:modelValue": r[3] ||= (e) => {
|
|
134
|
+
e || e === 0 ? c.field.handleChange(Number(e)) : c.field.handleChange(void 0);
|
|
135
|
+
}
|
|
136
|
+
}), s({ _: 2 }, [t.$slots.label ? {
|
|
137
|
+
name: "label",
|
|
138
|
+
fn: y(() => [m(t.$slots, "label", d(l({
|
|
139
|
+
required: c.inputProps.required,
|
|
140
|
+
id: c.inputProps.id,
|
|
141
|
+
label: c.inputProps.label
|
|
142
|
+
})))]),
|
|
143
|
+
key: "0"
|
|
144
|
+
} : void 0]), 1040, [
|
|
145
|
+
"id",
|
|
146
|
+
"required",
|
|
147
|
+
"min",
|
|
148
|
+
"max",
|
|
149
|
+
"type",
|
|
150
|
+
"name",
|
|
151
|
+
"label",
|
|
152
|
+
"error-messages",
|
|
153
|
+
"error",
|
|
154
|
+
"model-value"
|
|
155
|
+
])) : a("", !0),
|
|
156
|
+
c.inputProps.type === "radio" ? (f(), i(C, u({
|
|
157
|
+
key: 4,
|
|
158
|
+
id: c.inputProps.id,
|
|
159
|
+
name: c.field.name,
|
|
160
|
+
label: c.inputProps.label,
|
|
161
|
+
"error-messages": c.inputProps.errorMessages,
|
|
162
|
+
error: c.inputProps.error
|
|
163
|
+
}, t.$attrs, {
|
|
164
|
+
"model-value": c.state.value,
|
|
165
|
+
"onUpdate:modelValue": r[4] ||= (e) => c.field.handleChange(e)
|
|
166
|
+
}), s({
|
|
167
|
+
default: y(() => [(f(!0), o(n, null, p(c.inputProps.options, (e) => (f(), i(S, {
|
|
168
|
+
key: e.value,
|
|
169
|
+
label: e.title,
|
|
170
|
+
value: e.value
|
|
171
|
+
}, null, 8, ["label", "value"]))), 128))]),
|
|
172
|
+
_: 2
|
|
173
|
+
}, [t.$slots.label ? {
|
|
174
|
+
name: "label",
|
|
175
|
+
fn: y(() => [m(t.$slots, "label", d(l({
|
|
176
|
+
required: c.inputProps.required,
|
|
177
|
+
id: c.inputProps.id,
|
|
178
|
+
label: c.inputProps.label
|
|
179
|
+
})))]),
|
|
180
|
+
key: "0"
|
|
181
|
+
} : void 0]), 1040, [
|
|
182
|
+
"id",
|
|
183
|
+
"name",
|
|
184
|
+
"label",
|
|
185
|
+
"error-messages",
|
|
186
|
+
"error",
|
|
187
|
+
"model-value"
|
|
188
|
+
])) : a("", !0),
|
|
189
|
+
c.inputProps.type === "select" || c.inputProps.type === "multiple" ? (f(), i(w, u({
|
|
190
|
+
key: 5,
|
|
191
|
+
id: c.inputProps.id,
|
|
192
|
+
clearable: c.inputProps.type === "select",
|
|
193
|
+
required: c.inputProps.required,
|
|
194
|
+
multiple: c.inputProps.type === "multiple",
|
|
195
|
+
chips: c.inputProps.type === "multiple",
|
|
196
|
+
name: c.field.name,
|
|
197
|
+
label: c.inputProps.label,
|
|
198
|
+
items: c.inputProps.options,
|
|
199
|
+
"error-messages": c.inputProps.errorMessages,
|
|
200
|
+
error: c.inputProps.error
|
|
201
|
+
}, t.$attrs, {
|
|
202
|
+
"model-value": c.state.value,
|
|
203
|
+
onClear: r[5] ||= (e) => c.field.handleChange(void 0),
|
|
204
|
+
"onUpdate:modelValue": c.field.handleChange
|
|
205
|
+
}), s({ _: 2 }, [t.$slots.label ? {
|
|
206
|
+
name: "label",
|
|
207
|
+
fn: y(() => [m(t.$slots, "label", d(l({
|
|
208
|
+
required: c.inputProps.required,
|
|
209
|
+
id: c.inputProps.id,
|
|
210
|
+
label: c.inputProps.label
|
|
211
|
+
})))]),
|
|
212
|
+
key: "0"
|
|
213
|
+
} : void 0]), 1040, [
|
|
214
|
+
"id",
|
|
215
|
+
"clearable",
|
|
216
|
+
"required",
|
|
217
|
+
"multiple",
|
|
218
|
+
"chips",
|
|
219
|
+
"name",
|
|
220
|
+
"label",
|
|
221
|
+
"items",
|
|
222
|
+
"error-messages",
|
|
223
|
+
"error",
|
|
224
|
+
"model-value",
|
|
225
|
+
"onUpdate:modelValue"
|
|
226
|
+
])) : a("", !0),
|
|
227
|
+
c.inputProps.type === "autocomplete" || c.inputProps.type === "autocompletemultiple" ? (f(), i(T, u({
|
|
228
|
+
key: 6,
|
|
229
|
+
id: c.inputProps.id,
|
|
230
|
+
clearable: c.inputProps.type === "autocomplete",
|
|
231
|
+
multiple: c.inputProps.type === "autocompletemultiple",
|
|
232
|
+
required: c.inputProps.required,
|
|
233
|
+
name: c.field.name,
|
|
234
|
+
label: c.inputProps.label,
|
|
235
|
+
items: c.inputProps.options,
|
|
236
|
+
"error-messages": c.inputProps.errorMessages,
|
|
237
|
+
error: c.inputProps.error,
|
|
238
|
+
chips: c.inputProps.type === "autocompletemultiple"
|
|
239
|
+
}, t.$attrs, {
|
|
240
|
+
"model-value": c.state.value,
|
|
241
|
+
onClear: r[6] ||= (e) => c.field.handleChange(void 0),
|
|
242
|
+
"onUpdate:modelValue": c.field.handleChange
|
|
243
|
+
}), s({ _: 2 }, [t.$slots.label ? {
|
|
244
|
+
name: "label",
|
|
245
|
+
fn: y(() => [m(t.$slots, "label", d(l({
|
|
246
|
+
required: c.inputProps.required,
|
|
247
|
+
id: c.inputProps.id,
|
|
248
|
+
label: c.inputProps.label
|
|
249
|
+
})))]),
|
|
250
|
+
key: "0"
|
|
251
|
+
} : void 0]), 1040, [
|
|
252
|
+
"id",
|
|
253
|
+
"clearable",
|
|
254
|
+
"multiple",
|
|
255
|
+
"required",
|
|
256
|
+
"name",
|
|
257
|
+
"label",
|
|
258
|
+
"items",
|
|
259
|
+
"error-messages",
|
|
260
|
+
"error",
|
|
261
|
+
"chips",
|
|
262
|
+
"model-value",
|
|
263
|
+
"onUpdate:modelValue"
|
|
264
|
+
])) : a("", !0),
|
|
265
|
+
x.value ? (f(), i(v, u({
|
|
266
|
+
key: 7,
|
|
267
|
+
id: c.inputProps.id,
|
|
268
|
+
required: c.inputProps.required,
|
|
269
|
+
type: _(e)(c.inputProps.type),
|
|
270
|
+
name: c.field.name,
|
|
271
|
+
label: c.inputProps.label,
|
|
272
|
+
"error-messages": c.inputProps.errorMessages,
|
|
273
|
+
error: c.inputProps.error
|
|
274
|
+
}, t.$attrs, {
|
|
275
|
+
"model-value": c.state.value,
|
|
276
|
+
"onUpdate:modelValue": r[7] ||= (e) => c.field.handleChange(e)
|
|
277
|
+
}), s({ _: 2 }, [t.$slots.label ? {
|
|
278
|
+
name: "label",
|
|
279
|
+
fn: y(() => [m(t.$slots, "label", d(l({
|
|
280
|
+
required: c.inputProps.required,
|
|
281
|
+
id: c.inputProps.id,
|
|
282
|
+
label: c.inputProps.label
|
|
283
|
+
})))]),
|
|
284
|
+
key: "0"
|
|
285
|
+
} : void 0]), 1040, [
|
|
286
|
+
"id",
|
|
287
|
+
"required",
|
|
288
|
+
"type",
|
|
289
|
+
"name",
|
|
290
|
+
"label",
|
|
291
|
+
"error-messages",
|
|
292
|
+
"error",
|
|
293
|
+
"model-value"
|
|
294
|
+
])) : a("", !0)
|
|
295
|
+
], 32);
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
//#endregion
|
|
300
|
+
export { b as default };
|
|
@@ -1,73 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
__name: "OmegaInternalInput",
|
|
8
|
-
props: {
|
|
9
|
-
field: {},
|
|
10
|
-
state: {},
|
|
11
|
-
meta: {},
|
|
12
|
-
label: {},
|
|
13
|
-
type: { default: void 0 },
|
|
14
|
-
validators: { default: void 0 },
|
|
15
|
-
required: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: void 0
|
|
18
|
-
},
|
|
19
|
-
inputClass: { default: void 0 },
|
|
20
|
-
register: {},
|
|
21
|
-
options: { default: void 0 }
|
|
22
|
-
},
|
|
23
|
-
setup(o) {
|
|
24
|
-
let b = o, x = t(() => b.required ?? b?.meta?.required), S = s()?.appContext.components.VTextField, C = h(), w = _(), T = t(() => {
|
|
25
|
-
let { class: e, ...t } = C;
|
|
26
|
-
return t;
|
|
27
|
-
}), E = t(() => C.class), D = g(), O = b.field;
|
|
28
|
-
y(O.store, (e) => e);
|
|
29
|
-
let k = y(O.form.store, (e) => e.fieldMeta), A = t(() => b.type ? b.type : b.meta?.type === "string" ? b.meta.format === "email" ? "email" : "string" : b.meta?.type || "unknown");
|
|
30
|
-
b.register(t(() => ({
|
|
31
|
-
name: b.field.name,
|
|
32
|
-
label: b.label,
|
|
33
|
-
id: D
|
|
34
|
-
})));
|
|
35
|
-
let j = t(() => k.value[b.field.name]?.errors ?? []), M = t(() => j.value.map((e) => e?.message).filter(Boolean)), N = (e) => e == null || e === !1 || e === "" || Number.isNaN(e), P = (e) => {
|
|
36
|
-
N(e) && b.meta?.type !== "boolean" ? b.meta?.nullableOrUndefined ? b.field.handleChange(b.meta.nullableOrUndefined === "undefined" ? void 0 : null) : b.meta?.isOptionalKey ? b.field.form.deleteField(b.field.name) : b.field.handleChange(e) : b.field.handleChange(e), b.field.form.normalizeNullableStructs?.();
|
|
37
|
-
}, F = (e) => new Proxy(e, { get(e, t, n) {
|
|
38
|
-
return t === "handleChange" ? P : Reflect.get(...arguments);
|
|
39
|
-
} }), I = t(() => ({
|
|
40
|
-
inputProps: {
|
|
41
|
-
id: D,
|
|
42
|
-
required: x.value,
|
|
43
|
-
minLength: b.meta?.type === "string" && b.meta?.minLength,
|
|
44
|
-
maxLength: b.meta?.type === "string" && b.meta?.maxLength,
|
|
45
|
-
max: b.meta?.type === "number" ? b.meta?.maximum ?? (typeof b.meta?.exclusiveMaximum == "number" ? b.meta.exclusiveMaximum - 1 : void 0) : void 0,
|
|
46
|
-
min: b.meta?.type === "number" ? b.meta?.minimum ?? (typeof b.meta?.exclusiveMinimum == "number" ? b.meta.exclusiveMinimum + 1 : void 0) : void 0,
|
|
47
|
-
errorMessages: M.value,
|
|
48
|
-
error: !!M.value.length,
|
|
49
|
-
type: A.value,
|
|
50
|
-
label: w.label ? b.label : `${b.label}${x.value ? " *" : ""}`,
|
|
51
|
-
options: b.options,
|
|
52
|
-
inputClass: b.inputClass
|
|
53
|
-
},
|
|
54
|
-
state: b.state,
|
|
55
|
-
field: F(b.field)
|
|
56
|
-
}));
|
|
57
|
-
return (t, o) => p(t.$slots, "default", d(c({
|
|
58
|
-
...I.value.inputProps,
|
|
59
|
-
field: I.value.field,
|
|
60
|
-
state: I.value.state
|
|
61
|
-
})), () => [i("div", { class: u(E.value) }, [m(S) ? (f(), n(e, d(l({ key: 0 }, {
|
|
62
|
-
...T.value,
|
|
63
|
-
...I.value,
|
|
64
|
-
class: b.inputClass
|
|
65
|
-
})), a({ _: 2 }, [t.$slots.label ? {
|
|
66
|
-
name: "label",
|
|
67
|
-
fn: v((e) => [p(t.$slots, "label", d(c(e)))]),
|
|
68
|
-
key: "0"
|
|
69
|
-
} : void 0]), 1040)) : r("", !0)], 2)]);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.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){grid-template-rows:1fr;min-height:0;transition:all .2s;display:grid;overflow:hidden}.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;appearance:none;width:auto;box-shadow:none;min-width:auto;height:auto;padding:.5em .5em .5em 1em;display:block}`)),document.head.appendChild(e),window.customElements){let e=window.customElements.define;window.customElements.define=function(t,n){let r=n.prototype.connectedCallback;return n.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){let e=document.createElement(`style`);e.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){grid-template-rows:1fr;min-height:0;transition:all .2s;display:grid;overflow:hidden}.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;appearance:none;width:auto;box-shadow:none;min-width:auto;height:auto;padding:.5em .5em .5em 1em;display:block}`)),this.shadowRoot.appendChild(e)}},e.call(window.customElements,t,n)}}}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);if(e.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){grid-template-rows:1fr;min-height:0;transition:all .2s;display:grid;overflow:hidden}.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;appearance:none;width:auto;box-shadow:none;min-width:auto;height:auto;padding:.5em .5em .5em 1em;display:block}`)),document.head.appendChild(e),window.customElements){let e=window.customElements.define;window.customElements.define=function(t,n){let r=n.prototype.connectedCallback;return n.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){let e=document.createElement(`style`);e.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){grid-template-rows:1fr;min-height:0;transition:all .2s;display:grid;overflow:hidden}.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;appearance:none;width:auto;box-shadow:none;min-width:auto;height:auto;padding:.5em .5em .5em 1em;display:block}`)),this.shadowRoot.appendChild(e)}},e.call(window.customElements,t,n)}}}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
3
|
+
import e from "./vue-components31.es.js";
|
|
4
|
+
|
|
5
|
+
//#region src/components/OmegaForm/OmegaInputVuetify.vue
|
|
6
|
+
var t = e;
|
|
72
7
|
//#endregion
|
|
73
|
-
export {
|
|
8
|
+
export { t as default };
|
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
import e from "./vue-components33.es.js";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementVNode as i, createSlots as a, defineComponent as o, getCurrentInstance as s, guardReactiveProps as c, mergeProps as l, normalizeClass as u, normalizeProps as d, openBlock as f, renderSlot as p, resolveDynamicComponent as m, useAttrs as h, useId as g, useSlots as _, withCtx as v } from "vue";
|
|
3
|
+
import { useStore as y } from "@tanstack/vue-form";
|
|
4
|
+
//#region src/components/OmegaForm/OmegaInternalInput.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var b = /*@__PURE__*/ o({
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "OmegaInternalInput",
|
|
8
|
+
props: {
|
|
9
|
+
field: {},
|
|
10
|
+
state: {},
|
|
11
|
+
meta: {},
|
|
12
|
+
label: {},
|
|
13
|
+
type: { default: void 0 },
|
|
14
|
+
required: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
inputClass: { default: void 0 },
|
|
19
|
+
register: {},
|
|
20
|
+
options: { default: void 0 },
|
|
21
|
+
inputs: { default: void 0 }
|
|
22
|
+
},
|
|
23
|
+
setup(o) {
|
|
24
|
+
let b = o, x = t(() => b.required ?? b?.meta?.required), S = s()?.appContext.components.VTextField, C = h(), w = _(), T = t(() => {
|
|
25
|
+
let { class: e, ...t } = C;
|
|
26
|
+
return t;
|
|
27
|
+
}), E = t(() => C.class), D = g(), O = b.field;
|
|
28
|
+
y(O.store, (e) => e);
|
|
29
|
+
let k = y(O.form.store, (e) => e.fieldMeta), A = t(() => b.type ? b.type : b.meta?.type === "string" ? b.meta.format === "email" ? "email" : "string" : b.meta?.type || "unknown"), j = t(() => b.inputs?.[A.value] ?? (S ? e : void 0));
|
|
30
|
+
b.register(t(() => ({
|
|
31
|
+
name: b.field.name,
|
|
32
|
+
label: b.label,
|
|
33
|
+
id: D
|
|
34
|
+
})));
|
|
35
|
+
let M = t(() => k.value[b.field.name]?.errors ?? []), N = t(() => M.value.map((e) => e?.message).filter(Boolean)), P = (e) => e == null || e === !1 || e === "" || Number.isNaN(e), F = (e) => {
|
|
36
|
+
P(e) && b.meta?.type !== "boolean" ? b.meta?.nullableOrUndefined ? b.field.handleChange(b.meta.nullableOrUndefined === "undefined" ? void 0 : null) : b.meta?.isOptionalKey ? b.field.form.deleteField(b.field.name) : b.field.handleChange(e) : b.field.handleChange(e), b.field.form.normalizeNullableStructs?.();
|
|
37
|
+
}, I = (e) => new Proxy(e, { get(e, t, n) {
|
|
38
|
+
return t === "handleChange" ? F : Reflect.get(...arguments);
|
|
39
|
+
} }), L = t(() => ({
|
|
40
|
+
inputProps: {
|
|
41
|
+
id: D,
|
|
42
|
+
required: x.value,
|
|
43
|
+
minLength: b.meta?.type === "string" && b.meta?.minLength,
|
|
44
|
+
maxLength: b.meta?.type === "string" && b.meta?.maxLength,
|
|
45
|
+
max: b.meta?.type === "number" ? b.meta?.maximum ?? (typeof b.meta?.exclusiveMaximum == "number" ? b.meta.exclusiveMaximum - 1 : void 0) : void 0,
|
|
46
|
+
min: b.meta?.type === "number" ? b.meta?.minimum ?? (typeof b.meta?.exclusiveMinimum == "number" ? b.meta.exclusiveMinimum + 1 : void 0) : void 0,
|
|
47
|
+
errorMessages: N.value,
|
|
48
|
+
error: !!N.value.length,
|
|
49
|
+
type: A.value,
|
|
50
|
+
label: w.label ? b.label : `${b.label}${x.value ? " *" : ""}`,
|
|
51
|
+
options: b.options,
|
|
52
|
+
inputClass: b.inputClass
|
|
53
|
+
},
|
|
54
|
+
state: b.state,
|
|
55
|
+
field: I(b.field)
|
|
56
|
+
}));
|
|
57
|
+
return (e, t) => p(e.$slots, "default", d(c({
|
|
58
|
+
...L.value.inputProps,
|
|
59
|
+
field: L.value.field,
|
|
60
|
+
state: L.value.state
|
|
61
|
+
})), () => [i("div", { class: u(E.value) }, [j.value ? (f(), n(m(j.value), d(l({ key: 0 }, {
|
|
62
|
+
...T.value,
|
|
63
|
+
...L.value,
|
|
64
|
+
class: b.inputClass
|
|
65
|
+
})), a({ _: 2 }, [e.$slots.label ? {
|
|
66
|
+
name: "label",
|
|
67
|
+
fn: v((t) => [p(e.$slots, "label", d(c(t)))]),
|
|
68
|
+
key: "0"
|
|
69
|
+
} : void 0]), 1040)) : r("", !0)], 2)]);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
4
72
|
//#endregion
|
|
5
|
-
export {
|
|
73
|
+
export { b as default };
|
|
@@ -1,55 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/components/OmegaForm/OmegaInput.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var _ = /*@__PURE__*/ o({
|
|
6
|
-
inheritAttrs: !1,
|
|
7
|
-
__name: "OmegaInput",
|
|
8
|
-
props: {
|
|
9
|
-
form: {},
|
|
10
|
-
label: {},
|
|
11
|
-
validators: {},
|
|
12
|
-
name: {},
|
|
13
|
-
inputClass: {}
|
|
14
|
-
},
|
|
15
|
-
setup(o) {
|
|
16
|
-
let _ = o, v = n(() => ({
|
|
17
|
-
label: _.label,
|
|
18
|
-
validators: _.validators
|
|
19
|
-
})), y = n(() => _.name), b = h(), x = n(() => {
|
|
20
|
-
if (_.inputClass !== null) return _.inputClass === void 0 ? b.class : _.inputClass;
|
|
21
|
-
}), S = c("getMetaFromArray", null), C = n(() => S?.value && S.value(_.name) ? S.value(y.value) : _.form.meta[y.value]), w = e(_.form);
|
|
22
|
-
return (e, n) => (d(), r(p(o.form.Field), {
|
|
23
|
-
name: o.name,
|
|
24
|
-
validators: o.validators
|
|
25
|
-
}, {
|
|
26
|
-
default: g(({ field: n }) => [C.value ? (d(), r(t, l({ key: 0 }, {
|
|
27
|
-
...e.$attrs,
|
|
28
|
-
...v.value,
|
|
29
|
-
inputClass: x.value
|
|
30
|
-
}, {
|
|
31
|
-
field: n,
|
|
32
|
-
state: n.state,
|
|
33
|
-
register: o.form.registerField,
|
|
34
|
-
label: o.label ?? m(w)(y.value),
|
|
35
|
-
meta: C.value
|
|
36
|
-
}), a({
|
|
37
|
-
default: g((t) => [f(e.$slots, "default", u(s(t)))]),
|
|
38
|
-
_: 2
|
|
39
|
-
}, [e.$slots.label ? {
|
|
40
|
-
name: "label",
|
|
41
|
-
fn: g((t) => [f(e.$slots, "label", u(s(t)))]),
|
|
42
|
-
key: "0"
|
|
43
|
-
} : void 0]), 1040, [
|
|
44
|
-
"field",
|
|
45
|
-
"state",
|
|
46
|
-
"register",
|
|
47
|
-
"label",
|
|
48
|
-
"meta"
|
|
49
|
-
])) : i("", !0)]),
|
|
50
|
-
_: 3
|
|
51
|
-
}, 8, ["name", "validators"]));
|
|
52
|
-
}
|
|
53
|
-
});
|
|
1
|
+
import e from "./vue-components34.es.js";
|
|
2
|
+
//#region src/components/OmegaForm/OmegaInternalInput.vue
|
|
3
|
+
var t = e;
|
|
54
4
|
//#endregion
|
|
55
|
-
export {
|
|
5
|
+
export { t as default };
|
|
@@ -1,5 +1,61 @@
|
|
|
1
|
-
import e from "./vue-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useErrorLabel as e } from "./vue-components20.es.js";
|
|
2
|
+
import t from "./vue-components35.es.js";
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createSlots as a, defineComponent as o, guardReactiveProps as s, inject as c, mergeProps as l, normalizeProps as u, openBlock as d, renderSlot as f, resolveDynamicComponent as p, unref as m, useAttrs as h, withCtx as g } from "vue";
|
|
4
|
+
//#region src/components/OmegaForm/OmegaInput.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _ = /*@__PURE__*/ o({
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "OmegaInput",
|
|
8
|
+
props: {
|
|
9
|
+
form: {},
|
|
10
|
+
label: {},
|
|
11
|
+
validators: {},
|
|
12
|
+
required: { type: Boolean },
|
|
13
|
+
name: {},
|
|
14
|
+
inputClass: {},
|
|
15
|
+
type: {},
|
|
16
|
+
options: {}
|
|
17
|
+
},
|
|
18
|
+
setup(o) {
|
|
19
|
+
let _ = o, v = n(() => ({
|
|
20
|
+
label: _.label,
|
|
21
|
+
required: _.required,
|
|
22
|
+
type: _.type,
|
|
23
|
+
options: _.options,
|
|
24
|
+
inputs: _.form.inputs
|
|
25
|
+
})), y = n(() => _.name), b = h(), x = n(() => {
|
|
26
|
+
if (_.inputClass !== null) return _.inputClass === void 0 ? b.class : _.inputClass;
|
|
27
|
+
}), S = c("getMetaFromArray", null), C = n(() => S?.value && S.value(_.name) ? S.value(y.value) : _.form.meta[y.value]), w = e(_.form);
|
|
28
|
+
return (e, n) => (d(), r(p(o.form.Field), {
|
|
29
|
+
name: o.name,
|
|
30
|
+
validators: o.validators
|
|
31
|
+
}, {
|
|
32
|
+
default: g(({ field: n }) => [C.value ? (d(), r(t, l({ key: 0 }, {
|
|
33
|
+
...e.$attrs,
|
|
34
|
+
...v.value,
|
|
35
|
+
inputClass: x.value
|
|
36
|
+
}, {
|
|
37
|
+
field: n,
|
|
38
|
+
state: n.state,
|
|
39
|
+
register: o.form.registerField,
|
|
40
|
+
label: o.label ?? m(w)(y.value),
|
|
41
|
+
meta: C.value
|
|
42
|
+
}), a({
|
|
43
|
+
default: g((t) => [f(e.$slots, "default", u(s(t)))]),
|
|
44
|
+
_: 2
|
|
45
|
+
}, [e.$slots.label ? {
|
|
46
|
+
name: "label",
|
|
47
|
+
fn: g((t) => [f(e.$slots, "label", u(s(t)))]),
|
|
48
|
+
key: "0"
|
|
49
|
+
} : void 0]), 1040, [
|
|
50
|
+
"field",
|
|
51
|
+
"state",
|
|
52
|
+
"register",
|
|
53
|
+
"label",
|
|
54
|
+
"meta"
|
|
55
|
+
])) : i("", !0)]),
|
|
56
|
+
_: 3
|
|
57
|
+
}, 8, ["name", "validators"]));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
4
60
|
//#endregion
|
|
5
|
-
export {
|
|
61
|
+
export { _ as default };
|
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/components/OmegaForm/
|
|
3
|
-
var
|
|
4
|
-
__name: "OmegaTaggedUnionInternal",
|
|
5
|
-
props: {
|
|
6
|
-
tag: {},
|
|
7
|
-
field: {},
|
|
8
|
-
name: {},
|
|
9
|
-
form: {}
|
|
10
|
-
},
|
|
11
|
-
setup(t) {
|
|
12
|
-
let o = t, s = o.form.useStore(({ values: e }) => e);
|
|
13
|
-
return a(() => o.tag, (e, t) => {
|
|
14
|
-
e === null && o.field.setValue(null), e !== t && (o.form.reset(s.value), setTimeout(() => {
|
|
15
|
-
o.field.validate("change");
|
|
16
|
-
}, 0));
|
|
17
|
-
}, { immediate: !0 }), (a, o) => t.tag ? i(a.$slots, `${t.name ? `${t.name}.` : ""}${t.tag}`, r(n({ key: 0 }, {
|
|
18
|
-
field: t.field,
|
|
19
|
-
tag: t.tag
|
|
20
|
-
}))) : e("", !0);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
1
|
+
import e from "./vue-components36.es.js";
|
|
2
|
+
//#region src/components/OmegaForm/OmegaInput.vue
|
|
3
|
+
var t = e;
|
|
23
4
|
//#endregion
|
|
24
|
-
export {
|
|
5
|
+
export { t as default };
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
//#region src/components/OmegaForm/OmegaTaggedUnionInternal.vue
|
|
3
|
-
var
|
|
1
|
+
import { createCommentVNode as e, defineComponent as t, mergeProps as n, normalizeProps as r, renderSlot as i, watch as a } from "vue";
|
|
2
|
+
//#region src/components/OmegaForm/OmegaTaggedUnionInternal.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var o = /*@__PURE__*/ t({
|
|
4
|
+
__name: "OmegaTaggedUnionInternal",
|
|
5
|
+
props: {
|
|
6
|
+
tag: {},
|
|
7
|
+
field: {},
|
|
8
|
+
name: {},
|
|
9
|
+
form: {}
|
|
10
|
+
},
|
|
11
|
+
setup(t) {
|
|
12
|
+
let o = t, s = o.form.useStore(({ values: e }) => e);
|
|
13
|
+
return a(() => o.tag, (e, t) => {
|
|
14
|
+
e === null && o.field.setValue(null), e !== t && (o.form.reset(s.value), setTimeout(() => {
|
|
15
|
+
o.field.validate("change");
|
|
16
|
+
}, 0));
|
|
17
|
+
}, { immediate: !0 }), (a, o) => t.tag ? i(a.$slots, `${t.name ? `${t.name}.` : ""}${t.tag}`, r(n({ key: 0 }, {
|
|
18
|
+
field: t.field,
|
|
19
|
+
tag: t.tag
|
|
20
|
+
}))) : e("", !0);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
4
23
|
//#endregion
|
|
5
|
-
export {
|
|
24
|
+
export { o as default };
|