@effect-app/vue-components 4.0.0-beta.314 → 4.0.0-beta.316

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 (57) hide show
  1. package/dist/types/components/Dialog.vue.d.ts +1 -1
  2. package/dist/types/components/OmegaForm/InputProps.d.ts +1 -0
  3. package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +6 -0
  4. package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +1 -0
  5. package/dist/types/components/OmegaForm/decimalSeparatorInput.d.ts +13 -0
  6. package/dist/vue-components.es.js +9 -9
  7. package/dist/vue-components21.es.js +14 -4
  8. package/dist/vue-components32.es.js +14 -23
  9. package/dist/vue-components33.es.js +23 -299
  10. package/dist/vue-components34.es.js +344 -0
  11. package/dist/vue-components36.es.js +7 -72
  12. package/dist/vue-components37.es.js +72 -3
  13. package/dist/vue-components38.es.js +4 -63
  14. package/dist/vue-components39.es.js +63 -4
  15. package/dist/vue-components40.es.js +4 -23
  16. package/dist/vue-components41.es.js +23 -4
  17. package/dist/vue-components42.es.js +3 -57
  18. package/dist/vue-components43.es.js +57 -3
  19. package/dist/vue-components44.es.js +4 -11
  20. package/dist/vue-components45.es.js +11 -21
  21. package/dist/vue-components46.es.js +22 -0
  22. package/dist/vue-components48.es.js +8 -3
  23. package/dist/vue-components49.es.js +3 -37
  24. package/dist/vue-components50.es.js +34 -23
  25. package/dist/vue-components51.es.js +23 -24
  26. package/dist/vue-components52.es.js +27 -6
  27. package/dist/vue-components53.es.js +6 -17
  28. package/dist/vue-components54.es.js +16 -34
  29. package/dist/vue-components55.es.js +34 -16
  30. package/dist/vue-components56.es.js +16 -19
  31. package/dist/vue-components57.es.js +10 -19
  32. package/dist/vue-components58.es.js +29 -6
  33. package/dist/vue-components59.es.js +6 -8
  34. package/dist/vue-components60.es.js +7 -36
  35. package/dist/vue-components61.es.js +37 -24
  36. package/dist/vue-components62.es.js +19 -122
  37. package/dist/vue-components63.es.js +126 -22
  38. package/dist/vue-components64.es.js +20 -17
  39. package/dist/vue-components65.es.js +18 -6
  40. package/dist/vue-components66.es.js +5 -15
  41. package/dist/vue-components67.es.js +18 -4
  42. package/dist/vue-components68.es.js +4 -28
  43. package/dist/vue-components69.es.js +28 -4
  44. package/dist/vue-components70.es.js +4 -42
  45. package/dist/vue-components71.es.js +38 -96
  46. package/dist/vue-components72.es.js +95 -30
  47. package/dist/vue-components73.es.js +35 -18
  48. package/dist/vue-components74.es.js +18 -49
  49. package/dist/vue-components75.es.js +50 -0
  50. package/package.json +3 -3
  51. package/src/components/OmegaForm/InputProps.ts +1 -0
  52. package/src/components/OmegaForm/OmegaInputVuetify.vue +65 -9
  53. package/src/components/OmegaForm/OmegaInternalInput.vue +1 -0
  54. package/src/components/OmegaForm/decimalSeparatorInput.ts +38 -0
  55. package/src/components/OmegaForm/validation/localized.ts +15 -4
  56. package/dist/vue-components35.es.js +0 -8
  57. package/dist/vue-components47.es.js +0 -9
@@ -8,7 +8,7 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
8
  declare var __VLS_11: {
9
9
  open: boolean;
10
10
  cancel: () => void;
11
- isActive: any;
11
+ isActive: import("vue").Ref<boolean, boolean>;
12
12
  }, __VLS_15: string, __VLS_16: any;
13
13
  type __VLS_Slots = {} & {
14
14
  [K in NonNullable<typeof __VLS_15>]?: (props: typeof __VLS_16) => any;
@@ -9,6 +9,7 @@ export type InputProps<From extends Record<PropertyKey, any>, TName extends Deep
9
9
  maxLength?: number | false;
10
10
  max?: number | false;
11
11
  min?: number | false;
12
+ refinement?: "int";
12
13
  errorMessages: string[];
13
14
  error: boolean;
14
15
  label: string;
@@ -57,6 +57,12 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, Name extends
57
57
  id: string;
58
58
  label: string;
59
59
  }) => any;
60
+ } & {
61
+ label?: (props: {
62
+ required: boolean | undefined;
63
+ id: string;
64
+ label: string;
65
+ }) => any;
60
66
  };
61
67
  emit: {
62
68
  (e: "focus", event: Event): void;
@@ -37,6 +37,7 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, Name extends
37
37
  maxLength?: number | false;
38
38
  max?: number | false;
39
39
  min?: number | false;
40
+ refinement?: "int";
40
41
  errorMessages: string[];
41
42
  error: boolean;
42
43
  label: string;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * VNumberInput only accepts the active decimal separator and silently drops
3
+ * the other one while typing. Attached in capture phase on the component
4
+ * root, this handler lets users type either "." or ",": the wrong character
5
+ * is translated to the active separator before Vuetify's own beforeinput
6
+ * filter can reject it.
7
+ *
8
+ * No validation beyond Vuetify's own single-separator typing rule: OmegaForm
9
+ * deliberately lets out-of-schema values through so schema errors show,
10
+ * instead of silently blocking input (same reasoning as min/max not being
11
+ * passed as props).
12
+ */
13
+ export declare const handleDecimalSeparatorBeforeinput: (e: InputEvent, separator: string) => void;
@@ -10,15 +10,15 @@ import { toFormSchema as h } from "./vue-components18.es.js";
10
10
  import { deepMerge as g } from "./vue-components20.es.js";
11
11
  import { makeStandardSchemaV1Hooks as _, toLocalizedStandardSchemaV1 as v } from "./vue-components21.es.js";
12
12
  import { useErrorLabel as y } from "./vue-components22.es.js";
13
- import b from "./vue-components37.es.js";
14
- import x from "./vue-components39.es.js";
15
- import S from "./vue-components41.es.js";
16
- import C from "./vue-components43.es.js";
17
- import { FormErrors as w } from "./vue-components70.es.js";
18
- import { OmegaFormKey as T, useOmegaForm as E } from "./vue-components71.es.js";
19
- import { createUseFormWithCustomInput as D } from "./vue-components72.es.js";
20
- import { duplicateSchema as O } from "./vue-components73.es.js";
21
- import { components_exports as k } from "./vue-components74.es.js";
13
+ import b from "./vue-components38.es.js";
14
+ import x from "./vue-components40.es.js";
15
+ import S from "./vue-components42.es.js";
16
+ import C from "./vue-components44.es.js";
17
+ import { FormErrors as w } from "./vue-components71.es.js";
18
+ import { OmegaFormKey as T, useOmegaForm as E } from "./vue-components72.es.js";
19
+ import { createUseFormWithCustomInput as D } from "./vue-components73.es.js";
20
+ import { duplicateSchema as O } from "./vue-components74.es.js";
21
+ import { components_exports as k } from "./vue-components75.es.js";
22
22
  //#region src/index.ts
23
23
  function A(e) {
24
24
  for (let t in k) if (Object.prototype.hasOwnProperty.call(k, t)) {
@@ -31,20 +31,30 @@ var t = (e) => {
31
31
  }
32
32
  case "isGreaterThanOrEqualTo": return r(a.minimum === 0 ? "validation.number.positive" : "validation.number.min", {
33
33
  minimum: a.minimum,
34
- isExclusive: !0
34
+ isExclusive: !1
35
35
  });
36
36
  case "isGreaterThan": return r(a.exclusiveMinimum === 0 ? "validation.number.positive" : "validation.number.min", {
37
37
  minimum: a.exclusiveMinimum,
38
- isExclusive: !1
38
+ isExclusive: !0
39
39
  });
40
40
  case "isLessThanOrEqualTo": return r("validation.number.max", {
41
41
  maximum: a.maximum,
42
- isExclusive: !0
42
+ isExclusive: !1
43
43
  });
44
44
  case "isLessThan": return r("validation.number.max", {
45
45
  maximum: a.exclusiveMaximum,
46
- isExclusive: !1
46
+ isExclusive: !0
47
47
  });
48
+ case "isBetween": {
49
+ let e = n(i);
50
+ return typeof e == "number" && e < a.minimum ? r("validation.number.min", {
51
+ minimum: a.minimum,
52
+ isExclusive: !1
53
+ }) : r("validation.number.max", {
54
+ maximum: a.maximum,
55
+ isExclusive: !1
56
+ });
57
+ }
48
58
  default: return e.SchemaIssue.defaultCheckHook(i);
49
59
  }
50
60
  }
@@ -1,24 +1,15 @@
1
- //#region src/components/OmegaForm/types.ts
2
- var e = [
3
- "string",
4
- "text",
5
- "number",
6
- "select",
7
- "multiple",
8
- "boolean",
9
- "radio",
10
- "autocomplete",
11
- "autocompletemultiple",
12
- "switch",
13
- "range",
14
- "password",
15
- "email",
16
- "date",
17
- "tel",
18
- "url",
19
- "color",
20
- "time",
21
- "search"
22
- ];
1
+ //#region src/components/OmegaForm/decimalSeparatorInput.ts
2
+ var e = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), t = (t, n) => {
3
+ if (!t.data) return;
4
+ let r = [".", ","].filter((e) => e !== n);
5
+ if (!r.some((e) => t.data.includes(e))) return;
6
+ let i = t.target;
7
+ t.preventDefault(), t.stopPropagation();
8
+ let a = r.reduce((e, t) => e.replaceAll(t, n), t.data), o = i.selectionStart ?? i.value.length, s = i.selectionEnd ?? i.value.length, c = i.value.slice(0, o) + a + i.value.slice(s);
9
+ if (!RegExp(`^-?\\d*${e(n)}?\\d*$`).test(c)) return;
10
+ i.value = c;
11
+ let l = o + a.length;
12
+ i.setSelectionRange(l, l), i.dispatchEvent(new Event("input", { bubbles: !0 }));
13
+ };
23
14
  //#endregion
24
- export { e as typeOverrides };
15
+ export { t as handleDecimalSeparatorBeforeinput };
@@ -1,300 +1,24 @@
1
- import { getInputType as e } from "./vue-components13.es.js";
2
- import { typeOverrides as t } from "./vue-components32.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
- });
1
+ //#region src/components/OmegaForm/types.ts
2
+ var e = [
3
+ "string",
4
+ "text",
5
+ "number",
6
+ "select",
7
+ "multiple",
8
+ "boolean",
9
+ "radio",
10
+ "autocomplete",
11
+ "autocompletemultiple",
12
+ "switch",
13
+ "range",
14
+ "password",
15
+ "email",
16
+ "date",
17
+ "tel",
18
+ "url",
19
+ "color",
20
+ "time",
21
+ "search"
22
+ ];
299
23
  //#endregion
300
- export { b as default };
24
+ export { e as typeOverrides };