@steveesamson/microform 1.0.3 → 1.0.5

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
@@ -26,7 +26,7 @@ Once you've added `microform` to your project, use it as shown below, in your vi
26
26
 
27
27
  ```ts
28
28
  <script>
29
- import { uform } from "@steveesamson/microform";
29
+ import uform from "@steveesamson/microform";
30
30
  // default form data, probably passed as props
31
31
  let defaultData:any = $props();
32
32
 
@@ -400,7 +400,7 @@ Validators could be overriden to provide custom validation and/or messages besid
400
400
  ### Approach 1
401
401
  ```ts
402
402
  <script>
403
- import { type FieldProps, uform } from "@steveesamson/microform";
403
+ import uform, { type FieldProps } from "@steveesamson/microform";
404
404
  // default form data, probably passed as props
405
405
  export let defaultData:any = {};
406
406
 
@@ -449,7 +449,7 @@ Therefore, the following is equivalent to the configuration in `Approach 1`:
449
449
  ### Approach 2
450
450
  ```ts
451
451
  <script>
452
- import { type FieldProps, IS_LEN, uform } from "@steveesamson/microform";
452
+ import uform, { type FieldProps, IS_LEN } from "@steveesamson/microform";
453
453
  // default form data, probably passed as props
454
454
  export let defaultData:any = {};
455
455
 
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./types.js";
2
2
  export { IS_EMAIL, IS_ALPHA, IS_ALPHANUM, IS_INTEGER, IS_IP, IS_LEN, IT_MATCHES as IS_MATCH_FOR, IS_MAX, IS_FILE_SIZE_MB as IS_MAX_FILE_SIZE, IS_MAX_LEN, IS_MIN, IS_MIN_LEN, IS_NUMBER, IS_REQUIRED, IS_URL } from "./form-validators.js";
3
- export { uform } from "./index.svelte.js";
3
+ import microform from "./index.svelte.js";
4
+ export default microform;
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./types.js";
2
2
  export { IS_EMAIL, IS_ALPHA, IS_ALPHANUM, IS_INTEGER, IS_IP, IS_LEN, IT_MATCHES as IS_MATCH_FOR, IS_MAX, IS_FILE_SIZE_MB as IS_MAX_FILE_SIZE, IS_MAX_LEN, IS_MIN, IS_MIN_LEN, IS_NUMBER, IS_REQUIRED, IS_URL } from "./form-validators.js";
3
- export { uform } from "./index.svelte.js";
3
+ import microform from "./index.svelte.js";
4
+ export default microform;
@@ -1,7 +1,7 @@
1
1
  import { writable, derived, get } from 'svelte/store';
2
2
  import { formAction } from './form-action.js';
3
3
  import { bindStateToStore } from "./utils.js";
4
- export const uform = (props) => {
4
+ const microform = (props) => {
5
5
  // form default values
6
6
  const data = props?.data || {};
7
7
  // form values
@@ -77,3 +77,4 @@ export const uform = (props) => {
77
77
  reset,
78
78
  };
79
79
  };
80
+ export default microform;
package/dist/types.d.ts CHANGED
@@ -63,3 +63,4 @@ export type MicroFormReturn = {
63
63
  onsubmit: (handler: FormSubmit) => (e: Event) => Promise<void>;
64
64
  reset: () => void;
65
65
  };
66
+ export type Microform = (props?: MicroFormProps) => MicroFormReturn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steveesamson/microform",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "postbuild": "touch ./docs/.nojekyll",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "exports": {
22
22
  ".": {
23
- "types": "./dist/types.d.ts",
23
+ "types": "./dist/index.d.ts",
24
24
  "svelte": "./dist/index.js"
25
25
  }
26
26
  },
@@ -31,9 +31,6 @@
31
31
  "!dist/**/*.test.*",
32
32
  "!dist/**/*.spec.*"
33
33
  ],
34
- "peerDependencies": {
35
- "svelte": "^5.0.0-next.135"
36
- },
37
34
  "devDependencies": {
38
35
  "@sveltejs/adapter-auto": "^3.0.0",
39
36
  "@sveltejs/adapter-static": "^3.0.1",
@@ -51,14 +48,13 @@
51
48
  "prettier-plugin-svelte": "^3.1.2",
52
49
  "publint": "^0.1.9",
53
50
  "shiki": "^0.14.7",
54
- "svelte": "^5.0.0-next.135",
55
51
  "svelte-check": "^3.6.0",
56
52
  "tslib": "^2.4.1",
57
53
  "typescript": "^5.0.0",
58
54
  "vite": "^5.0.3"
59
55
  },
60
56
  "default": "./dist/index.js",
61
- "types": "./dist/types.d.ts",
57
+ "types": "./dist/index.d.ts",
62
58
  "type": "module",
63
59
  "keywords": [
64
60
  "microform",
@@ -72,5 +68,8 @@
72
68
  "sveltekit",
73
69
  "svelte-kit",
74
70
  "sveltekit-microform"
75
- ]
71
+ ],
72
+ "dependencies": {
73
+ "svelte": "^5.0.0-next.210"
74
+ }
76
75
  }