-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed placeholder application * Reorganized exports * Fixed undefined helper message * requireTouched true as default * Fixed imports * Fixed demo * Removed requirement of type Record * Added defaultState and errorState custom configurations * Removed unused imports * Updated demo
- Loading branch information
1 parent
d73f6ba
commit 0a23c16
Showing
16 changed files
with
66 additions
and
369 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
projects/signal-forms/src/lib/helpers/is-signal-form-valid.helper.ts
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
2 changes: 1 addition & 1 deletion
2
projects/signal-forms/src/lib/helpers/reset-signal-form.helper.ts
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
6 changes: 4 additions & 2 deletions
6
projects/signal-forms/src/lib/helpers/run-validators.helper.ts
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
2 changes: 1 addition & 1 deletion
2
projects/signal-forms/src/lib/helpers/signal-form-value.helper.ts
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
1 change: 0 additions & 1 deletion
1
projects/signal-forms/src/lib/interfaces/base-type.interface.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
projects/signal-forms/src/lib/interfaces/signal-forms-definition.interface.ts
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { BaseType } from "./base-type.interface" | ||
import { ValidatorFunction } from "./validator-function.interface" | ||
|
||
export type SignalFormDefinition<T extends BaseType> = { | ||
export type SignalFormDefinition<T> = { | ||
[K in keyof T]: { | ||
initialValue: T[K], | ||
validators?: Array<(value: T[K]) => Error | null> | ||
validators?: Array<ValidatorFunction<T[K]>> | ||
} | ||
} |
4 changes: 3 additions & 1 deletion
4
projects/signal-forms/src/lib/interfaces/signal-forms-options.interface.ts
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export type SignalFormOptions = { | ||
requireTouched: boolean | ||
requireTouched: boolean, | ||
defaultState: string, | ||
errorState: string | ||
} |
6 changes: 3 additions & 3 deletions
6
projects/signal-forms/src/lib/interfaces/signal-forms.interface.ts
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,4 @@ | ||
export type State = { | ||
state: string, | ||
message: string | null | ||
} |
1 change: 1 addition & 0 deletions
1
projects/signal-forms/src/lib/interfaces/validator-function.interface.ts
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 @@ | ||
export type ValidatorFunction<T> = (value: T) => Error | null |
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.