-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(kit): new `tuiCreateDateMask` (with localization support) * feat(kit): `InputDate` add full support of `TUI_DATE_FORMAT` * chore(kit): `InputDate` add unit tests of `TUI_DATE_FORMAT` integration * feat(cdk): new token `TUI_DATE_SEPARATOR` + integration with `InputDate` * chore(kit): add `Tui-` prefix for interfaces * chore(kit): `InputDate` add unit tests of `TUI_DATE_SEPARATOR` integration * chore(kit): `tuiCreateDateMask` unit tests * chore(kit): rm extra TODO notes * chore(kit): refactor `tuiCreateDateMask`
- Loading branch information
1 parent
79cee45
commit 52d6472
Showing
17 changed files
with
500 additions
and
134 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,8 @@ | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
export const TUI_DATE_SEPARATOR = new InjectionToken<string>( | ||
'Date separator for Taiga UI components', | ||
{ | ||
factory: () => '.', | ||
}, | ||
); |
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
18 changes: 18 additions & 0 deletions
18
projects/demo/src/modules/components/input-date/examples/4/index.html
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,18 @@ | ||
<h3 i18n>DI-tokens for date format localization:</h3> | ||
|
||
<dl i18n> | ||
<dt><code>TUI_DATE_FORMAT</code></dt> | ||
<dd> | ||
active date format ( | ||
<code>'DMY' | 'MDY' | 'YMD'</code> | ||
) | ||
</dd> | ||
<dt><code>TUI_DATE_SEPARATOR</code></dt> | ||
<dd>single-character date's separator (dot, slash etc.)</dd> | ||
</dl> | ||
|
||
<br /> | ||
|
||
<tui-input-date class="input" [formControl]="control"> | ||
Choose a date | ||
</tui-input-date> |
13 changes: 13 additions & 0 deletions
13
projects/demo/src/modules/components/input-date/examples/4/index.less
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,13 @@ | ||
@import 'taiga-ui-local'; | ||
|
||
dd { | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.input { | ||
width: 50%; | ||
|
||
@media @mobile { | ||
width: 100%; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
projects/demo/src/modules/components/input-date/examples/4/index.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,20 @@ | ||
import {Component} from '@angular/core'; | ||
import {FormControl} from '@angular/forms'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
import {TUI_DATE_FORMAT, TUI_DATE_SEPARATOR, TuiDay} from '@taiga-ui/cdk'; | ||
|
||
@Component({ | ||
selector: 'tui-input-date-example-4', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
providers: [ | ||
{provide: TUI_DATE_FORMAT, useValue: 'YMD'}, | ||
{provide: TUI_DATE_SEPARATOR, useValue: '/'}, | ||
], | ||
changeDetection, | ||
encapsulation, | ||
}) | ||
export class TuiInputDateExample4 { | ||
readonly control = new FormControl(new TuiDay(2017, 0, 15)); | ||
} |
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.