diff --git a/apps/demo/src/app/home/home.component.html b/apps/demo/src/app/home/home.component.html index b1d13779..61db98fe 100644 --- a/apps/demo/src/app/home/home.component.html +++ b/apps/demo/src/app/home/home.component.html @@ -102,6 +102,25 @@

+
+ + + {{ date$ | async }} + +
+ (null); + + private readonly dialog$: Observable = this.dialogs.open( + new PolymorpheusComponent( + TuiMobileCalendarDropdown, + Injector.create({ + providers: [ + { + provide: TUI_CALENDAR_DATE_STREAM, + useValue: tuiControlValue(this.control), + }, + ], + parent: this.injector, + }), + ), + { + size: 'fullscreen', + closeable: false, + data: { + single: true, + min: TuiDay.currentLocal(), + }, + }, + ); protected readonly builtInTools = [TuiEditorTool.Undo, TuiEditorTool.Img]; protected readonly labels = ['New', 'Read', 'Archived', 'Junk']; @@ -70,6 +110,17 @@ export default class HomeComponent { protected slider = 80; protected editor = ''; + protected readonly date$ = combineLatest([ + tuiControlValue(this.control), + this.months$, + ]).pipe( + map(([value, months]) => + !value + ? 'Choose a date' + : `${months[value.month]} ${value.day}, ${value.year}`, + ), + ); + protected questions = [ { question: 'Accordion 1', @@ -85,6 +136,10 @@ export default class HomeComponent { }, ]; + protected get empty(): boolean { + return !this.control.value; + } + protected onDay(date: TuiDay): void { this.date = date; } @@ -107,4 +162,8 @@ export default class HomeComponent { protected purify(value: string): string { return this.dompurifySanitizer.sanitize(SecurityContext.HTML, value); } + + protected onClick(): void { + this.dialog$.subscribe((value) => this.control.setValue(value)); + } } diff --git a/nx.json b/nx.json index 4a6d784c..28777b93 100644 --- a/nx.json +++ b/nx.json @@ -30,6 +30,5 @@ "!{projectRoot}/jest.config.[jt]s" ] }, - "defaultBase": "main", - "useLegacyCache": true + "defaultBase": "main" } diff --git a/package-lock.json b/package-lock.json index 809a85bd..7ae55800 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14434,16 +14434,16 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", - "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.5", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4" + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -15695,14 +15695,14 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.14.tgz", + "integrity": "sha512-lQUsHzcTb7rH57dajbOuZEuMDXjs9f04ZloER4QOpjpKcaw4f98BRUrs8aiO9Z4G7i7B0Xhgarg6SCgYcYi8Nw==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -16039,9 +16039,9 @@ } }, "node_modules/jiti": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.1.tgz", - "integrity": "sha512-yPBThwecp1wS9DmoA4x4KR2h3QoslacnDR8ypuFM962kI4/456Iy1oHx2RAgh4jfZNdn0bctsdadceiBUgpU1g==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", + "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", "dev": true, "license": "MIT", "peer": true, @@ -16319,9 +16319,9 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.11.16", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.11.16.tgz", - "integrity": "sha512-Noyazmt0yOvnG0OeRY45Cd1ur8G7Z0HWVkuCuKe+yysGNxPQwBAODBQQ40j0AIagi9ZWurfmmZWNlpg4h4W+XQ==", + "version": "1.11.17", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.11.17.tgz", + "integrity": "sha512-Jr6v8thd5qRlOlc6CslSTzGzzQW03uiscab7KHQZX1Dfo4R6n6FDhZ0Hri6/X7edLIDv9gl4VMZXhxTjLnl0VQ==", "dev": true, "license": "MIT", "peer": true @@ -22791,18 +22791,18 @@ } }, "node_modules/typed-array-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", - "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4"