@effect-app/vue-components 1.6.5 → 1.6.7
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/createUseFormWithCustomInput.d.ts +2 -1
- package/dist/types/components/OmegaForm/index.d.ts +2 -1
- package/dist/vue-components.es10.js +14 -16
- package/package.json +1 -1
- package/src/components/OmegaForm/createUseFormWithCustomInput.ts +8 -13
- package/src/components/OmegaForm/index.ts +2 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { type Component } from "vue";
|
|
2
|
+
import { type DefaultInputProps } from "./OmegaFormStuff";
|
|
2
3
|
import { useOmegaForm } from "./useOmegaForm";
|
|
3
|
-
export declare const createUseFormWithCustomInput: (CustomInputComponent: Component) => <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>>(...args: Parameters<typeof useOmegaForm<From, To>>) => import("./useOmegaForm").OmegaFormReturn<From, To,
|
|
4
|
+
export declare const createUseFormWithCustomInput: (CustomInputComponent: Component) => <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Props = DefaultInputProps<From>>(...args: Parameters<typeof useOmegaForm<From, To>>) => import("./useOmegaForm").OmegaFormReturn<From, To, Props>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as OmegaErrorsContext from "./OmegaErrorsContext";
|
|
2
2
|
export * from "./OmegaFormStuff";
|
|
3
|
-
export { type OmegaFormReturn, useOmegaForm } from "./useOmegaForm";
|
|
3
|
+
export { type OmegaConfig, type OmegaFormReturn, useOmegaForm } from "./useOmegaForm";
|
|
4
|
+
export { type InputProps, type MergedInputProps } from "./InputProps";
|
|
4
5
|
export { default as OmegaInput } from "./OmegaInput.vue";
|
|
5
6
|
export { default as OmegaVuetifyInput } from "./OmegaInternalInput.vue";
|
|
6
7
|
export { useOnClose, usePreventClose } from "./blockDialog";
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import
|
|
3
|
-
import { useOmegaForm as
|
|
4
|
-
const
|
|
5
|
-
const [
|
|
6
|
-
return
|
|
7
|
-
m,
|
|
1
|
+
import { h as t } from "vue";
|
|
2
|
+
import i from "./vue-components.es4.js";
|
|
3
|
+
import { useOmegaForm as f } from "./vue-components.es7.js";
|
|
4
|
+
const g = (r) => (...e) => {
|
|
5
|
+
const [o, n, m] = e;
|
|
6
|
+
return f(
|
|
8
7
|
o,
|
|
8
|
+
n,
|
|
9
9
|
{
|
|
10
|
-
...
|
|
10
|
+
...m,
|
|
11
11
|
input: {
|
|
12
12
|
name: "WrappedInput",
|
|
13
13
|
inheritAttrs: !1,
|
|
14
|
-
setup(
|
|
15
|
-
return () =>
|
|
16
|
-
...
|
|
17
|
-
...
|
|
14
|
+
setup(p, { attrs: s }) {
|
|
15
|
+
return () => t(i, {
|
|
16
|
+
...p,
|
|
17
|
+
...s
|
|
18
18
|
}, {
|
|
19
19
|
// Override the default slot that OmegaInternalInput provides
|
|
20
|
-
default: (
|
|
21
|
-
inputProps: t
|
|
22
|
-
}) : p.default?.(t)
|
|
20
|
+
default: ({ field: a, ...u }) => t(r, { field: a, inputProps: u })
|
|
23
21
|
});
|
|
24
22
|
}
|
|
25
23
|
}
|
|
@@ -27,5 +25,5 @@ const W = (e) => (...n) => {
|
|
|
27
25
|
);
|
|
28
26
|
};
|
|
29
27
|
export {
|
|
30
|
-
|
|
28
|
+
g as createUseFormWithCustomInput
|
|
31
29
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { DeepKeys } from "@tanstack/vue-form"
|
|
2
2
|
import { type Component, h } from "vue"
|
|
3
|
-
import type {
|
|
3
|
+
import type { MergedInputProps } from "./InputProps"
|
|
4
|
+
import { type DefaultInputProps } from "./OmegaFormStuff"
|
|
4
5
|
import OmegaInput from "./OmegaInput.vue"
|
|
5
6
|
import { useOmegaForm } from "./useOmegaForm"
|
|
6
7
|
|
|
7
8
|
export const createUseFormWithCustomInput = (CustomInputComponent: Component) => {
|
|
8
9
|
return <
|
|
9
10
|
From extends Record<PropertyKey, any>,
|
|
10
|
-
To extends Record<PropertyKey, any
|
|
11
|
+
To extends Record<PropertyKey, any>,
|
|
12
|
+
Props = DefaultInputProps<From>
|
|
11
13
|
>(
|
|
12
14
|
...args: Parameters<typeof useOmegaForm<From, To>>
|
|
13
15
|
) => {
|
|
@@ -17,28 +19,21 @@ export const createUseFormWithCustomInput = (CustomInputComponent: Component) =>
|
|
|
17
19
|
const WrappedInput = {
|
|
18
20
|
name: "WrappedInput",
|
|
19
21
|
inheritAttrs: false,
|
|
20
|
-
setup(props: any, { attrs
|
|
22
|
+
setup(props: any, { attrs }: any) {
|
|
21
23
|
return () =>
|
|
22
24
|
h(OmegaInput, {
|
|
23
25
|
...props,
|
|
24
26
|
...attrs
|
|
25
27
|
}, {
|
|
26
28
|
// Override the default slot that OmegaInternalInput provides
|
|
27
|
-
default: <TName extends DeepKeys<From>>(inputProps:
|
|
28
|
-
|
|
29
|
-
if (inputProps && "field" in inputProps) {
|
|
30
|
-
return h(CustomInputComponent, {
|
|
31
|
-
inputProps
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
// Otherwise, pass through the slot content
|
|
35
|
-
return slots.default?.(inputProps)
|
|
29
|
+
default: <TName extends DeepKeys<From>>({ field, ...inputProps }: MergedInputProps<From, TName>) => {
|
|
30
|
+
return h(CustomInputComponent, { field, inputProps })
|
|
36
31
|
}
|
|
37
32
|
})
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
35
|
|
|
41
|
-
const form = useOmegaForm<From, To>(
|
|
36
|
+
const form = useOmegaForm<From, To, Props>(
|
|
42
37
|
schema,
|
|
43
38
|
tanstackFormOptions,
|
|
44
39
|
{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * as OmegaErrorsContext from "./OmegaErrorsContext"
|
|
2
2
|
export * from "./OmegaFormStuff"
|
|
3
|
-
export { type OmegaFormReturn, useOmegaForm } from "./useOmegaForm"
|
|
3
|
+
export { type OmegaConfig, type OmegaFormReturn, useOmegaForm } from "./useOmegaForm"
|
|
4
4
|
|
|
5
|
+
export { type InputProps, type MergedInputProps } from "./InputProps"
|
|
5
6
|
export { default as OmegaInput } from "./OmegaInput.vue"
|
|
6
7
|
export { default as OmegaVuetifyInput } from "./OmegaInternalInput.vue"
|
|
7
8
|
|