@steveesamson/microform 0.0.4 → 0.0.6

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/README.md CHANGED
@@ -16,7 +16,7 @@ or
16
16
  yarn add @steveesamson/microform
17
17
  ```
18
18
 
19
- [demo and docs](https://steveesamson.github.io/microform)
19
+ [Demo and Docs](https://steveesamson.github.io/microform)
20
20
 
21
21
  ## Usage
22
22
 
@@ -1,6 +1,4 @@
1
1
  /// <reference types="svelte" />
2
2
  import { type Writable } from "svelte/store";
3
- import type { ActionOptions, FormErrors, FormOptions, FormValues, Params } from "./types.js";
4
- export declare const formAction: (values: FormValues, errors: FormErrors, unfits: Writable<Params>, isdirty: Writable<boolean>, options: FormOptions, validationMap: Params) => (node: HTMLElement, eventProps?: ActionOptions) => {
5
- destroy(): void;
6
- };
3
+ import type { ActionOptions, FormErrors, FormOptions, FormValues, FormReturn, Params } from "./types.js";
4
+ export declare const formAction: (values: FormValues, errors: FormErrors, unfits: Writable<Params>, isdirty: Writable<boolean>, options: FormOptions, validationMap: Params) => (node: HTMLElement, eventProps?: ActionOptions) => FormReturn;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./types.js";
1
2
  import type { UseFormProps, UseFormReturn } from './types.js';
2
3
  declare const useForm: (props?: UseFormProps) => UseFormReturn;
3
4
  export default useForm;
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./types.js";
1
2
  import { writable, derived, get } from 'svelte/store';
2
3
  import { formAction } from './form-action.js';
3
4
  const useForm = (props) => {
@@ -0,0 +1,3 @@
1
+ export type Params = {
2
+ [key: string]: string | number | Array<any> | any;
3
+ };
@@ -0,0 +1 @@
1
+ export {};
package/dist/types.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  /// <reference types="svelte" />
2
2
  import { type Writable, type Readable } from "svelte/store";
3
+ import type { Params } from "./internal.js";
4
+ export type { Params };
3
5
  export type FieldTypes = "Standard" | "Popover" | "Checkable";
4
6
  export type InputTypes = 'text' | 'number' | 'color' | 'time' | 'date' | 'range' | 'email' | 'hidden' | 'password' | 'tel' | 'url';
5
7
  export type FieldType = HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement;
@@ -10,10 +12,10 @@ export interface ValidateArgs {
10
12
  validations: string;
11
13
  node?: HTMLElement;
12
14
  }
13
- export type ValidateEvent = 'input' | 'change' | 'keyup' | 'blur';
14
- export type Params = {
15
- [key: string]: string | number | Array<any> | any;
15
+ export type FormReturn = {
16
+ destroy: () => void;
16
17
  };
18
+ export type ValidateEvent = 'input' | 'change' | 'keyup' | 'blur';
17
19
  export type FormValues = Writable<Params>;
18
20
  export type FormErrors = Writable<Params>;
19
21
  export type Dirty = Writable<boolean>;
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@steveesamson/microform",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
+ "postbuild": "touch ./docs/.nojekyll",
7
+ "prebuild": "rm -fr ./docs & rm -fr ./dist",
6
8
  "build": "vite build && npm run package",
7
9
  "preview": "vite preview",
8
10
  "package": "svelte-kit sync && svelte-package && publint",