-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(kit): new version of
InputNumber
(#10031)
- Loading branch information
1 parent
99cb0bc
commit a1b748c
Showing
42 changed files
with
1,704 additions
and
600 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 |
---|---|---|
@@ -1,4 +1,16 @@ | ||
import type {FactoryProvider, ProviderToken} from '@angular/core'; | ||
import {inject} from '@angular/core'; | ||
|
||
export abstract class TuiValueTransformer<From, To = unknown> { | ||
public abstract toControlValue(componentValue: From): To; | ||
public abstract fromControlValue(controlValue: To): From; | ||
} | ||
|
||
export function tuiValueTransformerFrom< | ||
T extends {valueTransformer: TuiValueTransformer<unknown>}, | ||
>(token: ProviderToken<T>): FactoryProvider { | ||
return { | ||
provide: TuiValueTransformer, | ||
useFactory: () => inject(token).valueTransformer, | ||
}; | ||
} |
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.