@formisch/qwik 0.1.0 → 0.2.0

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 (66) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +395 -0
  3. package/dist/index.qwik.js +701 -0
  4. package/package.json +15 -25
  5. package/lib/components/Field/Field.qwik.cjs +0 -14
  6. package/lib/components/Field/Field.qwik.mjs +0 -14
  7. package/lib/components/FieldArray/FieldArray.qwik.cjs +0 -14
  8. package/lib/components/FieldArray/FieldArray.qwik.mjs +0 -14
  9. package/lib/components/Form/Form.qwik.cjs +0 -36
  10. package/lib/components/Form/Form.qwik.mjs +0 -36
  11. package/lib/hooks/useField/useField.qwik.cjs +0 -48
  12. package/lib/hooks/useField/useField.qwik.mjs +0 -48
  13. package/lib/hooks/useFieldArray/useFieldArray.qwik.cjs +0 -18
  14. package/lib/hooks/useFieldArray/useFieldArray.qwik.mjs +0 -18
  15. package/lib/hooks/useForm_/useForm_.qwik.cjs +0 -52
  16. package/lib/hooks/useForm_/useForm_.qwik.mjs +0 -35
  17. package/lib/hooks/usePathSignal/usePathSignal.qwik.cjs +0 -18
  18. package/lib/hooks/usePathSignal/usePathSignal.qwik.mjs +0 -18
  19. package/lib/hooks/useResolvedQrl/useResolvedQrl.qwik.cjs +0 -14
  20. package/lib/hooks/useResolvedQrl/useResolvedQrl.qwik.mjs +0 -14
  21. package/lib/index.qwik.cjs +0 -30
  22. package/lib/index.qwik.mjs +0 -30
  23. package/lib/packages/core/dist/index.qwik.qwik.cjs +0 -401
  24. package/lib/packages/core/dist/index.qwik.qwik.mjs +0 -379
  25. package/lib/packages/methods/dist/index.qwik.qwik.cjs +0 -178
  26. package/lib/packages/methods/dist/index.qwik.qwik.mjs +0 -178
  27. package/lib-types/components/Field/Field.d.ts +0 -16
  28. package/lib-types/components/Field/index.d.ts +0 -1
  29. package/lib-types/components/FieldArray/FieldArray.d.ts +0 -16
  30. package/lib-types/components/FieldArray/index.d.ts +0 -1
  31. package/lib-types/components/Form/Form.d.ts +0 -8
  32. package/lib-types/components/Form/index.d.ts +0 -1
  33. package/lib-types/components/Lifecycle/Lifecycle.d.ts +0 -6
  34. package/lib-types/components/Lifecycle/index.d.ts +0 -1
  35. package/lib-types/components/counter/counter.d.ts +0 -1
  36. package/lib-types/components/index.d.ts +0 -3
  37. package/lib-types/components/logo/logo.d.ts +0 -1
  38. package/lib-types/entry.dev.d.ts +0 -2
  39. package/lib-types/entry.ssr.d.ts +0 -14
  40. package/lib-types/hooks/index.d.ts +0 -3
  41. package/lib-types/hooks/useField/index.d.ts +0 -1
  42. package/lib-types/hooks/useField/useField.d.ts +0 -7
  43. package/lib-types/hooks/useField/useField_2.d.ts +0 -7
  44. package/lib-types/hooks/useFieldArray/index.d.ts +0 -1
  45. package/lib-types/hooks/useFieldArray/useFieldArray.d.ts +0 -7
  46. package/lib-types/hooks/useForm/index.d.ts +0 -1
  47. package/lib-types/hooks/useForm/useForm copy.d.ts +0 -9
  48. package/lib-types/hooks/useForm/useForm.d.ts +0 -5
  49. package/lib-types/hooks/useForm$/index.d.ts +0 -1
  50. package/lib-types/hooks/useForm$/useForm$.d.ts +0 -5
  51. package/lib-types/hooks/useFormStore/index.d.ts +0 -1
  52. package/lib-types/hooks/useFormStore/useFormStore.d.ts +0 -5
  53. package/lib-types/hooks/useLiveSignal copy/index.d.ts +0 -1
  54. package/lib-types/hooks/useLiveSignal copy/useLiveSignal.d.ts +0 -2
  55. package/lib-types/hooks/usePathSignal/index.d.ts +0 -1
  56. package/lib-types/hooks/usePathSignal/usePathSignal.d.ts +0 -3
  57. package/lib-types/hooks/useResolvedQrl/index.d.ts +0 -1
  58. package/lib-types/hooks/useResolvedQrl/useResolvedQrl.d.ts +0 -2
  59. package/lib-types/index.d.ts +0 -4
  60. package/lib-types/root.d.ts +0 -2
  61. package/lib-types/types/field.d.ts +0 -38
  62. package/lib-types/types/form.d.ts +0 -11
  63. package/lib-types/types/index.d.ts +0 -2
  64. package/lib-types/utils/createInternalSignal/createInternalSignal.d.ts +0 -3
  65. package/lib-types/utils/createInternalSignal/index.d.ts +0 -1
  66. package/lib-types/utils/index.d.ts +0 -0
@@ -1,178 +0,0 @@
1
- import { getFieldStore, INTERNAL, walkFieldStore, getFieldInput, batch, createId, copyItemState, initializeFieldStore, resetItemState, validateIfRequired, setInitialFieldInput, validateFormInput, setFieldBool, setFieldInput, swapItemState } from "../../core/dist/index.qwik.qwik.mjs";
2
- import { untrack } from "@qwik.dev/core";
3
- function focus(config) {
4
- getFieldStore(config.form[INTERNAL], config.path).elements[0]?.focus();
5
- }
6
- function getAllErrors(form) {
7
- let allErrors = null;
8
- walkFieldStore(form[INTERNAL], (internalFieldStore) => {
9
- const errors = internalFieldStore.errors.value;
10
- if (errors) if (allErrors) allErrors.push(...errors);
11
- else allErrors = [
12
- ...errors
13
- ];
14
- });
15
- return allErrors;
16
- }
17
- function getErrors(form, config) {
18
- return (config?.path ? getFieldStore(form[INTERNAL], config.path) : form[INTERNAL]).errors.value;
19
- }
20
- function getInput(form, config) {
21
- return getFieldInput(config?.path ? getFieldStore(form[INTERNAL], config.path) : form[INTERNAL]);
22
- }
23
- function insert(form, config) {
24
- const internalFormStore = form[INTERNAL];
25
- const internalArrayStore = getFieldStore(internalFormStore, config.path);
26
- const items = untrack(() => internalArrayStore.items.value);
27
- const insertIndex = config.at === void 0 ? items.length : config.at;
28
- if (insertIndex >= 0 && insertIndex <= items.length) batch(() => {
29
- const newItems = [
30
- ...items
31
- ];
32
- newItems.splice(insertIndex, 0, createId());
33
- internalArrayStore.items.value = newItems;
34
- for (let index = items.length; index > insertIndex; index--) copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
35
- if (!internalArrayStore.children[insertIndex]) {
36
- const path = JSON.parse(internalArrayStore.name);
37
- internalArrayStore.children[insertIndex] = {};
38
- path.push(insertIndex);
39
- initializeFieldStore(internalArrayStore.children[insertIndex], internalArrayStore.schema.item, config.initialInput, path);
40
- } else resetItemState(internalArrayStore.children[insertIndex], config.initialInput);
41
- internalArrayStore.isTouched.value = true;
42
- internalArrayStore.isDirty.value = true;
43
- validateIfRequired(internalFormStore, internalArrayStore, "input");
44
- });
45
- }
46
- function move(form, config) {
47
- const internalFormStore = form[INTERNAL];
48
- const internalArrayStore = getFieldStore(internalFormStore, config.path);
49
- const items = untrack(() => internalArrayStore.items.value);
50
- if (config.from >= 0 && config.from <= items.length - 1 && config.to >= 0 && config.to <= items.length - 1 && config.from !== config.to) batch(() => {
51
- const newItems = [
52
- ...items
53
- ];
54
- newItems.splice(config.to, 0, newItems.splice(config.from, 1)[0]);
55
- internalArrayStore.items.value = newItems;
56
- const tempInternalFieldStore = {};
57
- initializeFieldStore(tempInternalFieldStore, internalArrayStore.schema.item, void 0, []);
58
- copyItemState(internalArrayStore.children[config.from < config.to ? config.from : config.to], tempInternalFieldStore);
59
- if (config.from < config.to) for (let index = config.from; index < config.to; index++) copyItemState(internalArrayStore.children[index + 1], internalArrayStore.children[index]);
60
- else for (let index = config.from; index > config.to; index--) copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
61
- copyItemState(tempInternalFieldStore, internalArrayStore.children[config.from < config.to ? config.to : config.from]);
62
- internalArrayStore.isTouched.value = true;
63
- internalArrayStore.isDirty.value = internalArrayStore.startItems.value.join() !== newItems.join();
64
- validateIfRequired(internalFormStore, internalArrayStore, "input");
65
- });
66
- }
67
- function remove(form, config) {
68
- const internalFormStore = form[INTERNAL];
69
- const internalArrayStore = getFieldStore(internalFormStore, config.path);
70
- const items = untrack(() => internalArrayStore.items.value);
71
- if (config.at >= 0 && config.at <= items.length - 1) batch(() => {
72
- const newItems = [
73
- ...items
74
- ];
75
- newItems.splice(config.at, 1);
76
- internalArrayStore.items.value = newItems;
77
- for (let index = config.at; index < items.length - 1; index++) copyItemState(internalArrayStore.children[index + 1], internalArrayStore.children[index]);
78
- internalArrayStore.isTouched.value = true;
79
- internalArrayStore.isDirty.value = internalArrayStore.startItems.value.join() !== newItems.join();
80
- validateIfRequired(internalFormStore, internalArrayStore, "input");
81
- });
82
- }
83
- function replace(form, config) {
84
- const internalFormStore = form[INTERNAL];
85
- const internalArrayStore = getFieldStore(internalFormStore, config.path);
86
- const items = untrack(() => internalArrayStore.items.value);
87
- if (config.at >= 0 && config.at <= items.length - 1) batch(() => {
88
- const newItems = [
89
- ...items
90
- ];
91
- newItems[config.at] = createId();
92
- internalArrayStore.items.value = newItems;
93
- resetItemState(internalArrayStore.children[config.at], config.initialInput);
94
- internalArrayStore.isTouched.value = true;
95
- internalArrayStore.isDirty.value = true;
96
- validateIfRequired(internalFormStore, internalArrayStore, "input");
97
- });
98
- }
99
- function reset(form, config) {
100
- batch(() => {
101
- untrack(() => {
102
- const internalFormStore = form[INTERNAL];
103
- const internalFieldStore = config?.path ? getFieldStore(internalFormStore, config.path) : internalFormStore;
104
- if (config?.initialInput) setInitialFieldInput(internalFieldStore, config.initialInput);
105
- walkFieldStore(internalFieldStore, (internalFieldStore$1) => {
106
- if (!config?.keepErrors) internalFieldStore$1.errors.value = null;
107
- if (internalFieldStore$1.kind === "array") {
108
- internalFieldStore$1.startItems.value = internalFieldStore$1.initialItems.value;
109
- if (!config?.keepInput || internalFieldStore$1.startItems.value.length === internalFieldStore$1.items.value.length) internalFieldStore$1.items.value = internalFieldStore$1.initialItems.value;
110
- if (!config?.keepTouched) internalFieldStore$1.isTouched.value = false;
111
- internalFieldStore$1.isDirty.value = internalFieldStore$1.startItems.value !== internalFieldStore$1.items.value;
112
- } else if (internalFieldStore$1.kind === "value") {
113
- internalFieldStore$1.startInput.value = internalFieldStore$1.initialInput.value;
114
- if (!config?.keepInput) internalFieldStore$1.input.value = internalFieldStore$1.initialInput.value;
115
- if (!config?.keepTouched) internalFieldStore$1.isTouched.value = false;
116
- internalFieldStore$1.isDirty.value = internalFieldStore$1.startInput.value !== internalFieldStore$1.input.value;
117
- for (const element of internalFieldStore$1.elements) if (element.type === "file") element.value = "";
118
- }
119
- });
120
- if (!config?.path) {
121
- if (!config?.keepSubmitted) internalFormStore.isSubmitted.value = false;
122
- if (internalFormStore.validateOn === "initial") validateFormInput(internalFormStore);
123
- }
124
- });
125
- });
126
- }
127
- function setErrors(form, config) {
128
- (config.path ? getFieldStore(form[INTERNAL], config.path) : form[INTERNAL]).errors.value = config.errors;
129
- }
130
- function setInput(form, config) {
131
- batch(() => {
132
- const internalFormStore = form[INTERNAL];
133
- const internalFieldStore = config.path ? getFieldStore(internalFormStore, config.path) : internalFormStore;
134
- setFieldBool(internalFieldStore, "isTouched", true);
135
- setFieldInput(internalFieldStore, config.input);
136
- validateIfRequired(internalFormStore, internalFieldStore, "input");
137
- });
138
- }
139
- function submit(form) {
140
- form[INTERNAL].element?.requestSubmit();
141
- }
142
- function swap(form, config) {
143
- const internalFormStore = form[INTERNAL];
144
- const internalArrayStore = getFieldStore(internalFormStore, config.path);
145
- const items = untrack(() => internalArrayStore.items.value);
146
- if (config.at >= 0 && config.at <= items.length - 1 && config.and >= 0 && config.and <= items.length - 1 && config.at !== config.and) batch(() => {
147
- const newItems = [
148
- ...items
149
- ];
150
- const tempItemId = newItems[config.at];
151
- newItems[config.at] = newItems[config.and];
152
- newItems[config.and] = tempItemId;
153
- internalArrayStore.items.value = newItems;
154
- swapItemState(internalArrayStore.children[config.at], internalArrayStore.children[config.and]);
155
- internalArrayStore.isTouched.value = true;
156
- internalArrayStore.isDirty.value = internalArrayStore.startItems.value.join() !== newItems.join();
157
- validateIfRequired(internalFormStore, internalArrayStore, "input");
158
- });
159
- }
160
- function validate(form, config) {
161
- return validateFormInput(form[INTERNAL], config);
162
- }
163
- export {
164
- focus,
165
- getAllErrors,
166
- getErrors,
167
- getInput,
168
- insert,
169
- move,
170
- remove,
171
- replace,
172
- reset,
173
- setErrors,
174
- setInput,
175
- submit,
176
- swap,
177
- validate
178
- };
@@ -1,16 +0,0 @@
1
- import { type RequiredPath, type Schema, type ValidPath } from '@formisch/core/qwik';
2
- import { JSXOutput, QRL } from '@qwik.dev/core';
3
- import type * as v from 'valibot';
4
- import type { FieldStore, FormStore } from '../../types/index.ts';
5
- /**
6
- * Properties of the `Field` component.
7
- */
8
- export interface FieldProps<TSchema extends Schema = Schema, TFieldPath extends RequiredPath = RequiredPath> {
9
- readonly of: FormStore<TSchema>;
10
- readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
11
- readonly render$: QRL<(store: FieldStore<TSchema, TFieldPath>) => JSXOutput>;
12
- }
13
- /**
14
- * Headless form field that provides reactive properties and state.
15
- */
16
- export declare const Field: <TSchema extends Schema, TFieldPath extends RequiredPath>(props: import("@qwik.dev/core/internal").PublicProps<FieldProps<TSchema, TFieldPath>>, key: string | null, flags: number, dev?: import("@qwik.dev/core/internal").DevJSX) => JSXOutput;
@@ -1 +0,0 @@
1
- export * from './Field.tsx';
@@ -1,16 +0,0 @@
1
- import { type RequiredPath, type Schema, type ValidArrayPath } from '@formisch/core/qwik';
2
- import { JSXOutput, QRL } from '@qwik.dev/core';
3
- import type * as v from 'valibot';
4
- import type { FieldArrayStore, FormStore } from '../../types/index.ts';
5
- /**
6
- * Properties of the `FieldArray` component.
7
- */
8
- export interface FieldArrayProps<TSchema extends Schema = Schema, TFieldArrayPath extends RequiredPath = RequiredPath> {
9
- readonly of: FormStore<TSchema>;
10
- readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
11
- readonly render$: QRL<(store: FieldArrayStore<TSchema, TFieldArrayPath>) => JSXOutput>;
12
- }
13
- /**
14
- * Headless field array that provides reactive properties and state.
15
- */
16
- export declare const FieldArray: <TSchema extends Schema, TFieldArrayPath extends RequiredPath>(props: import("@qwik.dev/core/internal").PublicProps<FieldArrayProps<TSchema, TFieldArrayPath>>, key: string | null, flags: number, dev?: import("@qwik.dev/core/internal").DevJSX) => JSXOutput;
@@ -1 +0,0 @@
1
- export * from './FieldArray.tsx';
@@ -1,8 +0,0 @@
1
- import { type Schema, type SubmitHandler } from '@formisch/core/qwik';
2
- import { JSXOutput, PropsOf, QRL } from '@qwik.dev/core';
3
- import type { FormStore } from '../../types/index.ts';
4
- export type FormProps<TSchema extends Schema = Schema> = Omit<PropsOf<'form'>, 'onSubmit$'> & {
5
- of: FormStore<TSchema>;
6
- onSubmit$: QRL<SubmitHandler<TSchema>>;
7
- };
8
- export declare const Form: <TSchema extends Schema>(props: import("@qwik.dev/core/internal").PublicProps<FormProps<TSchema>>, key: string | null, flags: number, dev?: import("@qwik.dev/core/internal").DevJSX) => JSXOutput;
@@ -1 +0,0 @@
1
- export * from './Form.tsx';
@@ -1,6 +0,0 @@
1
- import { InternalFieldStore } from '@formisch/core/qwik';
2
- import { ReadonlySignal } from '@qwik.dev/core';
3
- export interface LifecycleProps {
4
- store: ReadonlySignal<InternalFieldStore>;
5
- }
6
- export declare const Lifecycle: import("@qwik.dev/core").Component<LifecycleProps>;
@@ -1 +0,0 @@
1
- export * from './Lifecycle.tsx';
@@ -1 +0,0 @@
1
- export declare const Counter: import("@qwik.dev/core").Component<unknown>;
@@ -1,3 +0,0 @@
1
- export * from './Field/index.ts';
2
- export * from './FieldArray/index.ts';
3
- export * from './Form/index.ts';
@@ -1 +0,0 @@
1
- export declare const Logo: import("@qwik.dev/core").Component<unknown>;
@@ -1,2 +0,0 @@
1
- import { type RenderOptions } from "@qwik.dev/core";
2
- export default function (opts: RenderOptions): Promise<import("@qwik.dev/core/internal").RenderResult>;
@@ -1,14 +0,0 @@
1
- /**
2
- * WHAT IS THIS FILE?
3
- *
4
- * SSR entry point, in all cases the application is rendered outside the browser, this
5
- * entry point will be the common one.
6
- *
7
- * - Server (express, cloudflare...)
8
- * - npm run start
9
- * - npm run preview
10
- * - npm run build
11
- *
12
- */
13
- import { type RenderToStreamOptions } from "@qwik.dev/core/server";
14
- export default function (opts: RenderToStreamOptions): Promise<import("@qwik.dev/core/server").RenderToStreamResult>;
@@ -1,3 +0,0 @@
1
- export * from './useField/index.ts';
2
- export * from './useFieldArray/index.ts';
3
- export * from './useForm$/index.ts';
@@ -1 +0,0 @@
1
- export * from './useField.ts';
@@ -1,7 +0,0 @@
1
- import { type RequiredPath, type Schema, type ValidPath } from '@formisch/core/qwik';
2
- import type * as v from 'valibot';
3
- import type { FieldStore, FormStore } from '../../types/index.ts';
4
- export interface UseFieldConfig<TSchema extends Schema = Schema, TFieldPath extends RequiredPath = RequiredPath> {
5
- readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
6
- }
7
- export declare function useField<TSchema extends Schema, TFieldPath extends RequiredPath>(form: FormStore<TSchema>, config: UseFieldConfig<TSchema, TFieldPath>): FieldStore<TSchema, TFieldPath>;
@@ -1,7 +0,0 @@
1
- import { RequiredPath, type Schema, ValidPath } from '@formisch/core/qwik';
2
- import * as v from 'valibot';
3
- import type { FieldStore, FormStore } from '../../types/index.ts';
4
- export interface UseFieldConfig<TSchema extends Schema = Schema, TFieldPath extends RequiredPath = RequiredPath> {
5
- readonly path: ValidPath<v.InferInput<TSchema>, TFieldPath>;
6
- }
7
- export declare function useField<TSchema extends Schema, TFieldPath extends RequiredPath>(form: FormStore<TSchema>, config: UseFieldConfig<TSchema, TFieldPath>): FieldStore<TSchema, TFieldPath>;
@@ -1 +0,0 @@
1
- export * from './useFieldArray.ts';
@@ -1,7 +0,0 @@
1
- import { type RequiredPath, type Schema, type ValidArrayPath } from '@formisch/core/qwik';
2
- import type * as v from 'valibot';
3
- import type { FieldArrayStore, FormStore } from '../../types/index.ts';
4
- export interface UseFieldArrayConfig<TSchema extends Schema = Schema, TFieldArrayPath extends RequiredPath = RequiredPath> {
5
- readonly path: ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>;
6
- }
7
- export declare function useFieldArray<TSchema extends Schema, TFieldArrayPath extends RequiredPath>(form: FormStore<TSchema>, config: UseFieldArrayConfig<TSchema, TFieldArrayPath>): FieldArrayStore<TSchema, TFieldArrayPath>;
@@ -1 +0,0 @@
1
- export * from './useForm.js';
@@ -1,9 +0,0 @@
1
- import { type Schema } from '@formisch/core/qwik';
2
- import { NoSerialize, QRL } from '@qwik.dev/core';
3
- import type { FormStore } from '../../types/index.js';
4
- interface FormConfig<TSchema extends Schema> {
5
- schema: QRL<TSchema>;
6
- defaultValues?: unknown;
7
- }
8
- export declare function useForm<TSchema extends Schema, TResponseData = NoSerialize<unknown>>(config: FormConfig<TSchema>): FormStore<TSchema, TResponseData>;
9
- export {};
@@ -1,5 +0,0 @@
1
- import { FormConfig, type Schema } from '@formisch/core/qwik';
2
- import { NoSerialize, QRL } from '@qwik.dev/core';
3
- import type { FormStore } from '../../types/index.js';
4
- export declare function useFormQrl<TSchema extends Schema, TResponseData = NoSerialize<unknown>>(config: QRL<FormConfig<TSchema>>): FormStore<TSchema, TResponseData>;
5
- export declare const useForm$: <TSchema extends Schema, TResponseData = NoSerialize<unknown>>(qrl: FormConfig<TSchema>) => FormStore<TSchema, TResponseData>;
@@ -1 +0,0 @@
1
- export * from './useForm$.ts';
@@ -1,5 +0,0 @@
1
- import { type FormConfig, type Schema } from '@formisch/core/qwik';
2
- import { QRL } from '@qwik.dev/core';
3
- import type { FormStore } from '../../types/index.ts';
4
- export declare function useFormQrl<TSchema extends Schema>(configQrl: QRL<FormConfig<TSchema>>): FormStore<TSchema>;
5
- export declare const useForm$: <TSchema extends Schema>(qrl: FormConfig<TSchema>) => FormStore<TSchema>;
@@ -1 +0,0 @@
1
- export * from './useFormStore.js';
@@ -1,5 +0,0 @@
1
- import { type FormConfig, type Schema } from '@formisch/core/qwik';
2
- import { NoSerialize, QRL } from '@qwik.dev/core';
3
- import * as v from 'valibot';
4
- import type { FormStore } from '../../types/index.js';
5
- export declare function useFormStore<TSchema extends Schema, TResponseData = NoSerialize<unknown>>(config: FormConfig<TSchema>, validate: QRL<(input: unknown) => Promise<v.SafeParseResult<TSchema>>>): FormStore<TSchema, TResponseData>;
@@ -1 +0,0 @@
1
- export * from './useLiveSignal.ts';
@@ -1,2 +0,0 @@
1
- import { ReadonlySignal } from '@qwik.dev/core';
2
- export declare function useLiveSignal<T>(value: T): ReadonlySignal<T>;
@@ -1 +0,0 @@
1
- export * from './usePathSignal.ts';
@@ -1,3 +0,0 @@
1
- import type { Path } from '@formisch/core/qwik';
2
- import { type ReadonlySignal } from '@qwik.dev/core';
3
- export declare function usePathSignal<TPath extends Path>(path: TPath): ReadonlySignal<TPath>;
@@ -1 +0,0 @@
1
- export * from './useResolvedQrl.ts';
@@ -1,2 +0,0 @@
1
- import { type QRL } from '@qwik.dev/core';
2
- export declare function useResolvedQrl<T>(qrl: QRL<T>): T;
@@ -1,4 +0,0 @@
1
- export * from '@formisch/methods/qwik';
2
- export * from './components/index.ts';
3
- export * from './hooks/index.ts';
4
- export * from './types/index.ts';
@@ -1,2 +0,0 @@
1
- declare const _default: () => import("@qwik.dev/core").JSXOutput;
2
- export default _default;
@@ -1,38 +0,0 @@
1
- import type { FieldElement, PartialValues, PathValue, RequiredPath, Schema, ValidArrayPath, ValidPath } from '@formisch/core/qwik';
2
- import type { QRL, ReadonlySignal } from '@qwik.dev/core';
3
- import type * as v from 'valibot';
4
- /**
5
- * Value type of the field element props.
6
- */
7
- export interface FieldElementProps {
8
- readonly name: string;
9
- readonly autofocus: boolean;
10
- readonly ref: QRL<(element: FieldElement) => void>;
11
- readonly onFocus$: QRL<(event: FocusEvent, element: FieldElement) => void>;
12
- readonly onInput$: QRL<(event: InputEvent, element: FieldElement) => void>;
13
- readonly onChange$: QRL<(event: Event, element: FieldElement) => void>;
14
- readonly onBlur$: QRL<(event: FocusEvent, element: FieldElement) => void>;
15
- }
16
- /**
17
- * Value type of the field store.
18
- */
19
- export interface FieldStore<TSchema extends Schema = Schema, TFieldPath extends RequiredPath = RequiredPath> {
20
- readonly path: ReadonlySignal<ValidPath<v.InferInput<TSchema>, TFieldPath>>;
21
- readonly input: ReadonlySignal<PartialValues<PathValue<v.InferInput<TSchema>, TFieldPath>>>;
22
- readonly errors: ReadonlySignal<[string, ...string[]] | null>;
23
- readonly isTouched: ReadonlySignal<boolean>;
24
- readonly isDirty: ReadonlySignal<boolean>;
25
- readonly isValid: ReadonlySignal<boolean>;
26
- readonly props: FieldElementProps;
27
- }
28
- /**
29
- * Value type of the field array store.
30
- */
31
- export interface FieldArrayStore<TSchema extends Schema = Schema, TFieldArrayPath extends RequiredPath = RequiredPath> {
32
- readonly path: ReadonlySignal<ValidArrayPath<v.InferInput<TSchema>, TFieldArrayPath>>;
33
- readonly items: ReadonlySignal<string[]>;
34
- readonly errors: ReadonlySignal<[string, ...string[]] | null>;
35
- readonly isTouched: ReadonlySignal<boolean>;
36
- readonly isDirty: ReadonlySignal<boolean>;
37
- readonly isValid: ReadonlySignal<boolean>;
38
- }
@@ -1,11 +0,0 @@
1
- import type { BaseFormStore, Schema } from '@formisch/core/qwik';
2
- import type { ReadonlySignal } from '@qwik.dev/core';
3
- export interface FormStore<TSchema extends Schema = Schema> extends BaseFormStore<TSchema> {
4
- readonly isSubmitting: ReadonlySignal<boolean>;
5
- readonly isSubmitted: ReadonlySignal<boolean>;
6
- readonly isValidating: ReadonlySignal<boolean>;
7
- readonly isTouched: ReadonlySignal<boolean>;
8
- readonly isDirty: ReadonlySignal<boolean>;
9
- readonly isValid: ReadonlySignal<boolean>;
10
- readonly errors: ReadonlySignal<[string, ...string[]] | null>;
11
- }
@@ -1,2 +0,0 @@
1
- export * from './field.ts';
2
- export * from './form.ts';
@@ -1,3 +0,0 @@
1
- import { InternalSignal } from '@formisch/core';
2
- export declare function createInternalSignal<T>(): InternalSignal<T | undefined>;
3
- export declare function createInternalSignal<T>(value: T): InternalSignal<T>;
@@ -1 +0,0 @@
1
- export * from './createInternalSignal.ts';
File without changes