@stacksjs/composables 0.70.351 → 0.70.353
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 +4 -0
- package/dist/useForm.d.ts +29 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -355,6 +355,10 @@ For casual chit-chat with others using this package:
|
|
|
355
355
|
|
|
356
356
|
[Join the Stacks Discord Server](https://stacksjs.com/discord)
|
|
357
357
|
|
|
358
|
+
To hear when 1.0 lands, leave your email at [stacksjs.com](https://stacksjs.com). The site is in
|
|
359
|
+
its pre-launch state, so that signup is currently the shortest path to being told when
|
|
360
|
+
something changes.
|
|
361
|
+
|
|
358
362
|
## Postcardware
|
|
359
363
|
|
|
360
364
|
“Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.
|
package/dist/useForm.d.ts
CHANGED
|
@@ -30,6 +30,35 @@ export declare function useForm<TValues extends Record<string, unknown>>(opts: U
|
|
|
30
30
|
* `<SubmitButton>` / `<ErrorMessage>` companion components, field
|
|
31
31
|
* arrays, server-error auto-surfacing on 422, and progressive HTML
|
|
32
32
|
* fallback are scoped to Phases 2-5 of the issue.
|
|
33
|
+
*
|
|
34
|
+
* ---
|
|
35
|
+
*
|
|
36
|
+
* THERE IS A SECOND `useForm`, in stx
|
|
37
|
+
* (packages/stx/src/composables/use-form.ts, called `defineForm` before
|
|
38
|
+
* stacksjs/stx#1843). It is not this one, and the two are not interchangeable —
|
|
39
|
+
* they were written independently because neither side could find the other's,
|
|
40
|
+
* which is stx#1843's adoption problem happening to the framework itself.
|
|
41
|
+
*
|
|
42
|
+
* this one stx
|
|
43
|
+
* useForm({ initialValues, useForm(schema, initialValues)
|
|
44
|
+
* onSubmit })
|
|
45
|
+
* form.values.value.email form.values.email
|
|
46
|
+
* form.field('email') form.getFieldState('email')
|
|
47
|
+
* schema.string().email() v.required().email() (stx's own builder)
|
|
48
|
+
* validate() -> { valid, errors } validate() -> Promise<string[]>
|
|
49
|
+
* has: isSubmitting, isValid, has: validating, validateField
|
|
50
|
+
* isDirty, setErrors (422),
|
|
51
|
+
* clearErrors,
|
|
52
|
+
* submitButtonProps,
|
|
53
|
+
* firstErrorField,
|
|
54
|
+
* aria inputProps
|
|
55
|
+
*
|
|
56
|
+
* stx's is the one that reaches a `<script client>` block via the demand
|
|
57
|
+
* bundler; this one is delivered through the browser vendors re-export.
|
|
58
|
+
*
|
|
59
|
+
* Before adding a feature here, check whether it exists there — and say so in
|
|
60
|
+
* the PR either way. Unifying them is a breaking change to one side's public
|
|
61
|
+
* API, not a re-export, so it needs a deliberate decision rather than drift.
|
|
33
62
|
*/
|
|
34
63
|
/** Minimal Validator surface this composable depends on. */
|
|
35
64
|
export declare interface FormValidator {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/composables",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.70.
|
|
5
|
+
"version": "0.70.353",
|
|
6
6
|
"description": "Stacks composables powered by stx reactivity.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@stacksjs/stx": "^0.2.148",
|
|
55
|
-
"@stacksjs/datetime": "0.70.
|
|
55
|
+
"@stacksjs/datetime": "0.70.353"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"better-dx": "^0.2.17"
|