@steveesamson/microform 0.0.7 → 0.0.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.
- package/dist/form-action.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/types.d.ts +4 -6
- package/package.json +4 -2
package/dist/form-action.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="svelte" />
|
|
2
2
|
import { type Writable } from "svelte/store";
|
|
3
|
-
import type {
|
|
4
|
-
export declare const formAction: (values: FormValues, errors: FormErrors, unfits: Writable<Params>, isdirty: Writable<boolean>, options: FormOptions, validationMap: Params) =>
|
|
3
|
+
import type { FormErrors, FormOptions, FormValues, Params, FormAction } from "./types.js";
|
|
4
|
+
export declare const formAction: (values: FormValues, errors: FormErrors, unfits: Writable<Params>, isdirty: Writable<boolean>, options: FormOptions, validationMap: Params) => FormAction;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
|
-
import type {
|
|
3
|
-
declare const useForm: (props?:
|
|
2
|
+
import type { MicroFormProps, MicroFormReturn } from './types.js';
|
|
3
|
+
declare const useForm: (props?: MicroFormProps) => MicroFormReturn;
|
|
4
4
|
export default useForm;
|
package/dist/types.d.ts
CHANGED
|
@@ -26,9 +26,7 @@ export type ActionOptions = {
|
|
|
26
26
|
node?: HTMLElement;
|
|
27
27
|
html?: boolean;
|
|
28
28
|
};
|
|
29
|
-
export type FormAction = (node: HTMLElement, eventProps?: ActionOptions) =>
|
|
30
|
-
destroy: () => void;
|
|
31
|
-
};
|
|
29
|
+
export type FormAction = (node: HTMLElement, eventProps?: ActionOptions) => FormReturn;
|
|
32
30
|
export type FormSubmitEvent = SubmitEvent & {
|
|
33
31
|
currentTarget: EventTarget & HTMLFormElement;
|
|
34
32
|
};
|
|
@@ -36,15 +34,15 @@ export type FormSubmit = (_data: Params) => void;
|
|
|
36
34
|
export type FormOptions = {
|
|
37
35
|
validateEvent: ValidateEvent;
|
|
38
36
|
};
|
|
39
|
-
export type
|
|
37
|
+
export type MicroFormProps = {
|
|
40
38
|
data?: Params;
|
|
41
39
|
options?: FormOptions;
|
|
42
40
|
};
|
|
43
41
|
export type FormSanity = Readable<boolean>;
|
|
44
|
-
export type
|
|
42
|
+
export type MicroFormReturn = {
|
|
45
43
|
values: FormValues;
|
|
46
44
|
errors: FormErrors;
|
|
47
|
-
form: (node: HTMLElement, eventProps?: ActionOptions) =>
|
|
45
|
+
form: (node: HTMLElement, eventProps?: ActionOptions) => FormReturn;
|
|
48
46
|
valid: FormSanity;
|
|
49
47
|
submit: (formNode: HTMLFormElement, handler: FormSubmit) => void;
|
|
50
48
|
onsubmit: (handler: FormSubmit) => (e: Event) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steveesamson/microform",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"postbuild": "touch ./docs/.nojekyll",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
|
-
"svelte": "./dist/index.js"
|
|
24
|
+
"svelte": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
"author": "Steve S. Samson <stevee.samson@gmail.com> (http://github.com/steveesamson)",
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"typescript": "^5.0.0",
|
|
58
59
|
"vite": "^5.0.3"
|
|
59
60
|
},
|
|
61
|
+
"default": "./dist/index.js",
|
|
60
62
|
"svelte": "./dist/index.js",
|
|
61
63
|
"types": "./dist/index.d.ts",
|
|
62
64
|
"type": "module",
|