Skip to content

Releases: svecosystem/formsnap

v0.1.0

10 Sep 02:38
1ca44e7
Compare
Choose a tag to compare

Minor Changes

  • 83dcbbd: - Add getForm helper
    • Fix bug which was creating large .d.ts files and crashing editors

v0.0.9

05 Sep 05:22
dfe95a9
Compare
Choose a tag to compare

Patch Changes

  • 709b7ab: - Add method="POST" by default to <Form.Root />

v0.0.8

04 Sep 22:08
4cb327a
Compare
Choose a tag to compare

Patch Changes

  • 48eea47: - add formStore to <Form.Root /> slot props

v0.0.7

04 Sep 20:02
64038d4
Compare
Choose a tag to compare

Patch Changes

v0.0.6

04 Sep 16:21
508aea3
Compare
Choose a tag to compare

Patch Changes

  • bfa0520: Add tag prop to Validation & Description

v0.0.5

04 Sep 15:59
6335b97
Compare
Choose a tag to compare

Patch Changes

  • 2a857e1: Fix: <Form.Root /> slot prop types

v0.0.4

04 Sep 02:17
fa0a415
Compare
Choose a tag to compare

Patch Changes

v0.0.3

04 Sep 01:14
7c1a058
Compare
Choose a tag to compare

Patch Changes

  • 0801f7d: Add the handlers object containing the event handler helpers as well as the setValue helper function to the getFormField return object.

  • 748f8e8: #### Add a getFormField helper function

    The getFormField helper function must be called upon component initialization and provides some useful stores, actions, etc. when composing your own forms.
    For example, if I wanted to create a reusable Form.Label with conditional styles applied to it depending on the error state of the field, I could do something like this:

    <!-- CustomLabel.svelte -->
    <script lang="ts">
    	import { Form, getFormField } from "formsnap";
    	const { errors } = getFormField();
    </script>
    
    <Form.Label class={$errors ? "text-red-500" : "text-gray-800"}>
    	<slot />
    </Form.Label>

    It returns the following type:

    export type FormFieldContext = {
    	name: string;
    	ids: {
    		input: string;
    		description: string;
    		validation: string;
    	};
    	errors: Writable<string[] | undefined>;
    	value: Writable<unknown>;
    	hasDescription: Writable<boolean>;
    	hasValidation: Writable<boolean>;
    	attrStore: AttrStore;
    	actions: ActionsObject;
    };

v0.0.2

03 Sep 22:37
deb0aa9
Compare
Choose a tag to compare

Patch Changes

  • 8596892: Exposes the following additional values from superforms as slot props via the <Form.Root/> component.

    • allErrors
    • delayed
    • errors
    • submitting
    • tainted
    • timeout
    • validate
    • posted
    • fields
    • message
    • options
    • formId
    • restore
    • capture
    • constraints

v0.0.1

03 Sep 18:38
c2acc51
Compare
Choose a tag to compare

Patch Changes