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.
feat: add multi-line support + documentation example
- Loading branch information
1 parent
8473813
commit 52e2172
Showing
7 changed files
with
88 additions
and
10 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
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
35 changes: 35 additions & 0 deletions
35
projects/demo/src/pages/recipes/content-editable/examples/2-multi-line/component.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,35 @@ | ||
import {ChangeDetectionStrategy, Component} from '@angular/core'; | ||
import {MaskitoDirective} from '@maskito/angular'; | ||
|
||
import mask from './mask'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'content-editable-doc-example-2', | ||
imports: [MaskitoDirective], | ||
template: ` | ||
<i>Enter message:</i> | ||
<p | ||
contenteditable="true" | ||
[innerHTML]="initialText" | ||
[maskito]="mask" | ||
></p> | ||
`, | ||
styles: [ | ||
` | ||
[contenteditable] { | ||
white-space: pre; | ||
border: 3px dashed lightgray; | ||
max-width: 30rem; | ||
padding: 1rem; | ||
} | ||
`, | ||
], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class ContentEditableDocExample2 { | ||
protected readonly mask = mask; | ||
protected initialText = `Hello, world! | ||
How are you today? | ||
Do not forget to read description of this example!`; | ||
} |
5 changes: 5 additions & 0 deletions
5
projects/demo/src/pages/recipes/content-editable/examples/2-multi-line/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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type {MaskitoOptions} from '@maskito/core'; | ||
|
||
export default { | ||
mask: /^[a-z\s.,/!?]+$/i, | ||
} 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