-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from x0k/structure-change
Implement array and object fields revalidation
- Loading branch information
Showing
35 changed files
with
386 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@sjsf/form": minor | ||
--- | ||
|
||
Implement array and object fields revalidation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"playground": minor | ||
--- | ||
|
||
Allow to customize validation events and modifiers |
26 changes: 26 additions & 0 deletions
26
apps/docs/src/content/docs/api-reference/fields-validation-mode.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: Fields validation mode | ||
sidebar: | ||
order: 11 | ||
--- | ||
|
||
```typescript | ||
type FieldsValidationMode = number; | ||
|
||
/** Validation is triggered on input event */ | ||
export const ON_INPUT = 1; | ||
/** Validation is triggered on change event */ | ||
export const ON_CHANGE = ON_INPUT << 1; | ||
/** Validation is triggered on blur event */ | ||
export const ON_BLUR = ON_CHANGE << 1; | ||
/** Validation is triggered on add/remove item in array */ | ||
export const ON_ARRAY_CHANGE = ON_BLUR << 1; | ||
/** Validation is triggered on add/remove/rename property in object */ | ||
export const ON_OBJECT_CHANGE = ON_ARRAY_CHANGE << 1; | ||
|
||
/** Validation is not triggered before first change event */ | ||
export const AFTER_CHANGED = ON_OBJECT_CHANGE << 1; | ||
/** Validation is not triggered before first blur event */ | ||
export const AFTER_TOUCHED = AFTER_CHANGED << 1; | ||
/** Validation is not triggered before first form submission */ | ||
export const AFTER_SUBMITTED = AFTER_TOUCHED << 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
apps/docs/src/content/docs/api-reference/inputs-validation-mode.mdx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
import { ShadowHost } from "@/components/shadow"; | ||
import Form from "./_fields-validation.svelte"; | ||
--- | ||
|
||
<ShadowHost client:only="svelte"> | ||
<Form client:only="svelte" /> | ||
</ShadowHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.