generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(demo): improve documentation page
Number
(add `maskitoCaretGu…
…ard`) (#357)
- Loading branch information
1 parent
ed8221e
commit b95c93e
Showing
5 changed files
with
62 additions
and
43 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
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
14 changes: 12 additions & 2 deletions
14
projects/demo/src/pages/kit/number/examples/3-postfix/mask.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,18 @@ | ||
import {maskitoNumberOptionsGenerator} from '@maskito/kit'; | ||
import type {MaskitoOptions} from '@maskito/core'; | ||
import {maskitoCaretGuard, maskitoNumberOptionsGenerator} from '@maskito/kit'; | ||
|
||
export default maskitoNumberOptionsGenerator({ | ||
const {plugins, ...numberOptions} = maskitoNumberOptionsGenerator({ | ||
postfix: '%', | ||
min: 0, | ||
max: 100, | ||
precision: 2, | ||
}); | ||
|
||
export default { | ||
...numberOptions, | ||
plugins: [ | ||
...plugins, | ||
// Forbids caret to be placed after postfix | ||
maskitoCaretGuard(value => [0, value.length - 1]), | ||
], | ||
} as MaskitoOptions; |
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