@taiga-ui/addon-mobile 4.52.0-canary.6ee9658 → 4.52.0-canary.7c53ccc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/components/bottom-sheet/bottom-sheet.component.d.ts +3 -3
  2. package/components/mobile-calendar/calendar-date-stream.d.ts +6 -0
  3. package/components/mobile-calendar/index.d.ts +1 -0
  4. package/components/mobile-calendar/mobile-calendar.component.d.ts +16 -18
  5. package/components/mobile-calendar/mobile-calendar.strategy.d.ts +1 -2
  6. package/components/mobile-calendar-dropdown/mobile-calendar-dropdown.component.d.ts +6 -8
  7. package/components/mobile-calendar-dropdown/mobile-calendar-dropdown.directive.d.ts +6 -6
  8. package/components/pull-to-refresh/pull-to-refresh.component.d.ts +8 -7
  9. package/components/sheet-dialog/sheet-dialog.service.d.ts +1 -1
  10. package/components/swipe-action/swipe-actions-auto-close.directive.d.ts +2 -2
  11. package/components/tab-bar/tab-bar-item.component.d.ts +3 -3
  12. package/components/tab-bar/tab-bar.component.d.ts +4 -7
  13. package/directives/dropdown-mobile/dropdown-mobile.component.d.ts +1 -1
  14. package/directives/dropdown-sheet/dropdown-sheet.component.d.ts +1 -1
  15. package/directives/elastic-sticky/elastic-sticky.directive.d.ts +1 -2
  16. package/directives/responsive-dialog/responsive-dialog.service.d.ts +1 -1
  17. package/directives/ripple/ripple.directive.d.ts +2 -2
  18. package/directives/touchable/touchable.directive.d.ts +5 -5
  19. package/fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs +13 -21
  20. package/fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs.map +1 -1
  21. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs +24 -39
  22. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs.map +1 -1
  23. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs +7 -9
  24. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs.map +1 -1
  25. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs +114 -132
  26. package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs.map +1 -1
  27. package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs +42 -53
  28. package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs.map +1 -1
  29. package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs +14 -14
  30. package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs.map +1 -1
  31. package/fesm2022/taiga-ui-addon-mobile-components-swipe-action.mjs +12 -19
  32. package/fesm2022/taiga-ui-addon-mobile-components-swipe-action.mjs.map +1 -1
  33. package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs +31 -50
  34. package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs.map +1 -1
  35. package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs +8 -8
  36. package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs.map +1 -1
  37. package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-sheet.mjs +9 -9
  38. package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-sheet.mjs.map +1 -1
  39. package/fesm2022/taiga-ui-addon-mobile-directives-elastic-sticky.mjs +11 -14
  40. package/fesm2022/taiga-ui-addon-mobile-directives-elastic-sticky.mjs.map +1 -1
  41. package/fesm2022/taiga-ui-addon-mobile-directives-responsive-dialog.mjs +7 -7
  42. package/fesm2022/taiga-ui-addon-mobile-directives-responsive-dialog.mjs.map +1 -1
  43. package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs +10 -12
  44. package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs.map +1 -1
  45. package/fesm2022/taiga-ui-addon-mobile-directives-touchable.mjs +18 -24
  46. package/fesm2022/taiga-ui-addon-mobile-directives-touchable.mjs.map +1 -1
  47. package/fesm2022/taiga-ui-addon-mobile-services.mjs +34 -5
  48. package/fesm2022/taiga-ui-addon-mobile-services.mjs.map +1 -1
  49. package/package.json +9 -9
  50. package/services/index.d.ts +1 -0
  51. package/services/theme-color.service.d.ts +18 -0
  52. package/styles/android/app-bar.less +5 -1
  53. package/styles/android/switch.less +1 -0
  54. package/styles/common/badge-notification.less +1 -1
  55. package/styles/common/badge.less +2 -2
  56. package/styles/common/block-status.less +1 -1
  57. package/styles/common/button.less +1 -1
  58. package/styles/common/header.less +1 -1
  59. package/styles/common/message.less +1 -1
  60. package/styles/common/segmented.less +1 -1
  61. package/styles/common/title.less +0 -1
  62. package/styles/common/toast.less +1 -1
  63. package/styles/ios/switch.less +50 -1
@@ -1,27 +1,41 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Optional, Self, inject, viewChild, DestroyRef, NgZone, computed, input, output, model, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { NgControl } from '@angular/forms';
4
+ import { tuiControlValue, tuiWatch, tuiZonefreeScheduler, tuiZonefree, tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
5
+ import { of, map, Subject, distinctUntilChanged, EMPTY, timer, identity, delay, take, windowToggle, mergeMap, filter, switchMap, race, debounceTime, takeUntil } from 'rxjs';
1
6
  import { VIRTUAL_SCROLL_STRATEGY, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
2
7
  import { DOCUMENT, AsyncPipe } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { inject, InjectionToken, Optional, DestroyRef, NgZone, EventEmitter, Input, Output, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
5
8
  import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
6
9
  import { TuiMobileCalendarSheet } from '@taiga-ui/addon-mobile/components/mobile-calendar-sheet';
7
- import { TuiRipple, TuiTouchable } from '@taiga-ui/addon-mobile/directives';
10
+ import { TuiRipple } from '@taiga-ui/addon-mobile/directives/ripple';
11
+ import { TuiTouchable } from '@taiga-ui/addon-mobile/directives/touchable';
8
12
  import { TUI_FALSE_HANDLER } from '@taiga-ui/cdk/constants';
9
- import { MONTHS_IN_YEAR, TuiDay, TuiMonth, TUI_FIRST_DAY, TUI_LAST_DAY, TuiDayRange } from '@taiga-ui/cdk/date-time';
10
- import { tuiWatch, tuiZonefreeScheduler, tuiZonefree, tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
13
+ import { MONTHS_IN_YEAR, TuiDay, TuiDayRange, TuiMonth, TUI_FIRST_DAY, TUI_LAST_DAY } from '@taiga-ui/cdk/date-time';
11
14
  import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
12
15
  import { TUI_IS_IOS, TUI_IS_E2E } from '@taiga-ui/cdk/tokens';
13
16
  import { TuiButton } from '@taiga-ui/core/components/button';
14
- import { TUI_CALENDAR_SHEET_OPTIONS } from '@taiga-ui/core/components/calendar';
17
+ import { TUI_CALENDAR_SHEET_OPTIONS, TuiOrderWeekDaysPipe } from '@taiga-ui/core/components/calendar';
15
18
  import { TuiLink } from '@taiga-ui/core/components/link';
16
- import { TuiMonthPipe } from '@taiga-ui/core/pipes/month';
17
- import { TuiOrderWeekDaysPipe } from '@taiga-ui/core/pipes/order-week-days';
18
- import { TUI_ANIMATIONS_SPEED, TUI_COMMON_ICONS, TUI_CLOSE_WORD, TUI_SHORT_WEEK_DAYS } from '@taiga-ui/core/tokens';
19
+ import { TUI_ANIMATIONS_SPEED, TUI_COMMON_ICONS, TUI_CLOSE_WORD, TUI_MONTHS, TUI_SHORT_WEEK_DAYS } from '@taiga-ui/core/tokens';
19
20
  import { tuiGetDuration } from '@taiga-ui/core/utils/miscellaneous';
20
- import { TUI_CALENDAR_DATE_STREAM, TUI_CANCEL_WORD, TUI_DONE_WORD, TUI_CHOOSE_DAY_OR_RANGE_TEXTS } from '@taiga-ui/kit/tokens';
21
- import { tuiToggleDay } from '@taiga-ui/kit/utils';
22
- import { Subject, distinctUntilChanged, EMPTY, BehaviorSubject, skip, map, timer, identity, delay, take, windowToggle, mergeMap, filter, switchMap, race, debounceTime, takeUntil } from 'rxjs';
23
- import { __decorate } from 'tslib';
24
- import { tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
21
+ import { TUI_CANCEL_WORD, TUI_DONE_WORD, TUI_CHOOSE_DAY_OR_RANGE_TEXTS } from '@taiga-ui/kit/tokens';
22
+
23
+ const TUI_CALENDAR_DATE_STREAM = new InjectionToken(ngDevMode ? 'TUI_CALENDAR_DATE_STREAM' : '');
24
+ function tuiDateStreamWithTransformer(transformer) {
25
+ return {
26
+ provide: TUI_CALENDAR_DATE_STREAM,
27
+ deps: [
28
+ [new Optional(), new Self(), NgControl],
29
+ [new Optional(), transformer],
30
+ ],
31
+ useFactory: tuiControlValueFactory,
32
+ };
33
+ }
34
+ function tuiControlValueFactory(control, transformer) {
35
+ return control
36
+ ? tuiControlValue(control).pipe(map((value) => transformer ? transformer?.fromControlValue(value) : value))
37
+ : of(null);
38
+ }
25
39
 
26
40
  function getCycle(options) {
27
41
  return Array.from({ length: options.yearCycle }, (_, i) => Array.from({ length: MONTHS_IN_YEAR }, (_, month) => options.label +
@@ -79,9 +93,7 @@ class TuiMobileCalendarStrategy {
79
93
  this.destroy$ = new Subject();
80
94
  this.index$ = new Subject();
81
95
  this.viewport = null;
82
- }
83
- get scrolledIndexChange() {
84
- return this.index$.pipe(distinctUntilChanged());
96
+ this.scrolledIndexChange = this.index$.pipe(distinctUntilChanged());
85
97
  }
86
98
  attach(viewport) {
87
99
  const cycle = this.isIOS ? IOS_CYCLE_HEIGHT : ANDROID_CYCLE_HEIGHT;
@@ -162,9 +174,6 @@ class TuiMobileCalendarStrategy {
162
174
  this.index$.next(firstVisibleIndex);
163
175
  }
164
176
  }
165
- __decorate([
166
- tuiPure
167
- ], TuiMobileCalendarStrategy.prototype, "scrolledIndexChange", null);
168
177
 
169
178
  /**
170
179
  * Stream for updating value
@@ -184,7 +193,8 @@ const TUI_MOBILE_CALENDAR_PROVIDERS = [
184
193
 
185
194
  class TuiMobileCalendar {
186
195
  constructor() {
187
- this.value$ = new BehaviorSubject(null);
196
+ this.yearsScroll = viewChild('yearsScroll');
197
+ this.monthsScroll = viewChild('monthsScroll');
188
198
  this.today = TuiDay.currentLocal();
189
199
  this.activeYear = 0;
190
200
  this.activeMonth = 0;
@@ -192,6 +202,32 @@ class TuiMobileCalendar {
192
202
  this.doc = inject(DOCUMENT);
193
203
  this.speed = inject(TUI_ANIMATIONS_SPEED);
194
204
  this.ngZone = inject(NgZone);
205
+ this.getYearsViewportSize = computed(() => this.yearsScroll()?.getViewportSize() || 0);
206
+ this.initialYear = computed((value = this.value()) => {
207
+ if (!value) {
208
+ return this.today.year;
209
+ }
210
+ if (value instanceof TuiDay) {
211
+ return value.year;
212
+ }
213
+ if (!(value instanceof TuiDayRange)) {
214
+ return value?.[0]?.year ?? this.today.year;
215
+ }
216
+ return value.to.year;
217
+ });
218
+ this.initialMonth = computed((value = this.value()) => {
219
+ if (!value) {
220
+ return this.today.month + (this.today.year - STARTING_YEAR) * MONTHS_IN_YEAR;
221
+ }
222
+ if (value instanceof TuiDay) {
223
+ return value.month + (value.year - STARTING_YEAR) * MONTHS_IN_YEAR;
224
+ }
225
+ if (!(value instanceof TuiDayRange)) {
226
+ return ((value?.[0]?.month ?? this.today.month) +
227
+ ((value?.[0]?.year ?? this.today.year) - STARTING_YEAR) * MONTHS_IN_YEAR);
228
+ }
229
+ return value.to.month + (value.to.year - STARTING_YEAR) * MONTHS_IN_YEAR;
230
+ });
195
231
  this.initialized = false;
196
232
  this.isIOS = inject(TUI_IS_IOS);
197
233
  this.isE2E = inject(TUI_IS_E2E);
@@ -199,6 +235,7 @@ class TuiMobileCalendar {
199
235
  this.closeWord = inject(TUI_CLOSE_WORD);
200
236
  this.cancelWord = inject(TUI_CANCEL_WORD);
201
237
  this.doneWord = inject(TUI_DONE_WORD);
238
+ this.monthNames = inject(TUI_MONTHS);
202
239
  this.unorderedWeekDays$ = toObservable(inject(TUI_SHORT_WEEK_DAYS));
203
240
  this.chooseDayOrRangeTexts = inject(TUI_CHOOSE_DAY_OR_RANGE_TEXTS, {
204
241
  optional: true,
@@ -212,34 +249,26 @@ class TuiMobileCalendar {
212
249
  * ```
213
250
  * TODO(v5): delete it
214
251
  */
215
- this.single = !inject(TUI_CALENDAR_SHEET_OPTIONS).rangeMode;
216
- this.multi = false;
217
- this.min = TUI_FIRST_DAY;
218
- this.max = TUI_LAST_DAY;
219
- this.disabledItemHandler = TUI_FALSE_HANDLER;
220
- this.cancel = new EventEmitter();
221
- this.confirm = new EventEmitter();
222
- this.valueChange = this.value$.pipe(skip(1), distinctUntilChanged((a, b) => a?.toString() === b?.toString()), map((x) => (!this.single && x instanceof TuiDay ? new TuiDayRange(x, x) : x)));
252
+ this.single = input(!inject(TUI_CALENDAR_SHEET_OPTIONS).rangeMode);
253
+ this.multi = input(false);
254
+ this.min = input(TUI_FIRST_DAY);
255
+ this.max = input(TUI_LAST_DAY);
256
+ this.disabledItemHandler = input(TUI_FALSE_HANDLER);
257
+ this.cancel = output();
258
+ this.confirm = output();
259
+ this.value = model(null);
223
260
  this.disabledItemHandlerMapper = (disabledItemHandler, min, max) => (item) => item.dayBefore(min) ||
224
261
  (max !== null && item.dayAfter(max)) ||
225
262
  disabledItemHandler(item);
226
263
  inject(TUI_VALUE_STREAM)
227
264
  .pipe(takeUntilDestroyed())
228
265
  .subscribe((value) => {
229
- this.value = value;
266
+ this.value.set(value);
230
267
  });
231
268
  }
232
- set value(value) {
233
- if (value !== undefined) {
234
- this.value$.next(value);
235
- }
236
- }
237
- get value() {
238
- return this.value$.value;
239
- }
240
269
  ngAfterViewInit() {
241
- this.activeYear = this.initialYear;
242
- this.activeMonth = this.initialMonth;
270
+ this.activeYear = this.initialYear();
271
+ this.activeMonth = this.initialMonth();
243
272
  // Virtual scroll has not yet rendered items even in ngAfterViewInit
244
273
  this.waitScrolledChange();
245
274
  }
@@ -261,28 +290,30 @@ class TuiMobileCalendar {
261
290
  this.cancel.emit();
262
291
  }
263
292
  onConfirm() {
264
- if (this.value) {
265
- this.confirm.emit(this.value);
293
+ const value = this.value();
294
+ if (value) {
295
+ this.confirm.emit(value);
266
296
  }
267
297
  else {
268
298
  this.cancel.emit();
269
299
  }
270
300
  }
271
301
  onDayClick(day) {
272
- if (this.single) {
273
- this.value = day;
302
+ const value = this.value();
303
+ if (this.single()) {
304
+ this.value.set(day);
274
305
  }
275
- else if (this.isMultiValue(this.value)) {
276
- this.value = tuiToggleDay(this.value, day);
306
+ else if (this.isMultiValue(value)) {
307
+ this.value.set(toggleDay(value, day));
277
308
  }
278
- else if (this.value instanceof TuiDay) {
279
- this.value = TuiDayRange.sort(this.value, day);
309
+ else if (value instanceof TuiDay) {
310
+ this.value.set(TuiDayRange.sort(value, day));
280
311
  }
281
- else if (this.value instanceof TuiDayRange) {
282
- this.value = day;
312
+ else if (value instanceof TuiDayRange) {
313
+ this.value.set(day);
283
314
  }
284
- else if (!this.value) {
285
- this.value = day;
315
+ else if (!value) {
316
+ this.value.set(day);
286
317
  }
287
318
  }
288
319
  getState(index) {
@@ -307,49 +338,20 @@ class TuiMobileCalendar {
307
338
  this.activeYear = activeYear;
308
339
  this.scrollToActiveYear();
309
340
  }
310
- get initialYear() {
311
- if (!this.value) {
312
- return this.today.year;
313
- }
314
- if (this.value instanceof TuiDay) {
315
- return this.value.year;
316
- }
317
- if (!(this.value instanceof TuiDayRange)) {
318
- return this.value?.[0]?.year ?? this.today.year;
319
- }
320
- return this.value.to.year;
321
- }
322
- get initialMonth() {
323
- if (!this.value) {
324
- return this.today.month + (this.today.year - STARTING_YEAR) * MONTHS_IN_YEAR;
325
- }
326
- if (this.value instanceof TuiDay) {
327
- return this.value.month + (this.value.year - STARTING_YEAR) * MONTHS_IN_YEAR;
328
- }
329
- if (!(this.value instanceof TuiDayRange)) {
330
- return ((this.value?.[0]?.month ?? this.today.month) +
331
- ((this.value?.[0]?.year ?? this.today.year) - STARTING_YEAR) *
332
- MONTHS_IN_YEAR);
333
- }
334
- return (this.value.to.month + (this.value.to.year - STARTING_YEAR) * MONTHS_IN_YEAR);
335
- }
336
341
  isMultiValue(day) {
337
- return !(day instanceof TuiDay) && !(day instanceof TuiDayRange) && this.multi;
338
- }
339
- getYearsViewportSize() {
340
- return this.yearsScrollRef?.getViewportSize() || 0;
342
+ return !(day instanceof TuiDay) && !(day instanceof TuiDayRange) && this.multi();
341
343
  }
342
344
  updateViewportDimension() {
343
- this.yearsScrollRef?.checkViewportSize();
344
- this.monthsScrollRef?.checkViewportSize();
345
+ this.yearsScroll()?.checkViewportSize();
346
+ this.monthsScroll()?.checkViewportSize();
345
347
  }
346
348
  lateInit() {
347
349
  return this.getYearsViewportSize() > 0 ? identity : delay(200);
348
350
  }
349
351
  waitScrolledChange() {
350
352
  this.updateViewportDimension();
351
- this.monthsScrollRef?.scrolledIndexChange
352
- .pipe(delay(tuiGetDuration(this.speed)), this.lateInit(), take(1), takeUntilDestroyed(this.destroyRef))
353
+ this.monthsScroll()
354
+ ?.scrolledIndexChange.pipe(delay(tuiGetDuration(this.speed)), this.lateInit(), take(1), takeUntilDestroyed(this.destroyRef))
353
355
  .subscribe(() => {
354
356
  this.initialized = true;
355
357
  this.updateViewportDimension();
@@ -360,21 +362,21 @@ class TuiMobileCalendar {
360
362
  });
361
363
  }
362
364
  initYearScroll() {
363
- const { yearsScrollRef } = this;
364
- if (!yearsScrollRef) {
365
+ const yearsScroll = this.yearsScroll();
366
+ if (!yearsScroll) {
365
367
  return;
366
368
  }
367
- const touchstart$ = tuiTypedFromEvent(yearsScrollRef.elementRef.nativeElement, 'touchstart', { passive: true });
368
- const touchend$ = tuiTypedFromEvent(yearsScrollRef.elementRef.nativeElement, 'touchend', { passive: true });
369
- const click$ = tuiTypedFromEvent(yearsScrollRef.elementRef.nativeElement, 'click');
369
+ const touchstart$ = tuiTypedFromEvent(yearsScroll.elementRef.nativeElement, 'touchstart', { passive: true });
370
+ const touchend$ = tuiTypedFromEvent(yearsScroll.elementRef.nativeElement, 'touchend', { passive: true });
371
+ const click$ = tuiTypedFromEvent(yearsScroll.elementRef.nativeElement, 'click');
370
372
  // Refresh activeYear
371
- yearsScrollRef
373
+ yearsScroll
372
374
  .elementScrolled()
373
375
  .pipe(
374
376
  // Ignore smooth scroll resulting from click on the exact year
375
377
  windowToggle(touchstart$, () => click$), mergeMap((x) => x),
376
378
  // Delay is required to run months scroll in the next frame to prevent flicker
377
- delay(0), map(() => Math.round(yearsScrollRef.measureScrollOffset() / this.yearWidth) +
379
+ delay(0), map(() => Math.round(yearsScroll.measureScrollOffset() / this.yearWidth) +
378
380
  Math.floor(YEARS_IN_ROW / 2) +
379
381
  STARTING_YEAR), filter((activeYear) => activeYear !== this.activeYear), takeUntilDestroyed(this.destroyRef))
380
382
  .subscribe((activeYear) => {
@@ -384,26 +386,26 @@ class TuiMobileCalendar {
384
386
  });
385
387
  // Smooth scroll to activeYear after scrolling is done
386
388
  touchstart$
387
- .pipe(switchMap(() => touchend$), switchMap(() => race(yearsScrollRef.elementScrolled(), timer(SCROLL_DEBOUNCE_TIME, tuiZonefreeScheduler(this.ngZone))).pipe(debounceTime(SCROLL_DEBOUNCE_TIME * 2, tuiZonefreeScheduler(this.ngZone)), take(1), takeUntil(touchstart$))), takeUntilDestroyed(this.destroyRef))
389
+ .pipe(switchMap(() => touchend$), switchMap(() => race(yearsScroll.elementScrolled(), timer(SCROLL_DEBOUNCE_TIME, tuiZonefreeScheduler(this.ngZone))).pipe(debounceTime(SCROLL_DEBOUNCE_TIME * 2, tuiZonefreeScheduler(this.ngZone)), take(1), takeUntil(touchstart$))), takeUntilDestroyed(this.destroyRef))
388
390
  .subscribe(() => this.scrollToActiveYear('smooth'));
389
391
  }
390
392
  initMonthScroll() {
391
- const { monthsScrollRef } = this;
392
- if (!monthsScrollRef) {
393
+ const monthsScroll = this.monthsScroll();
394
+ if (!monthsScroll) {
393
395
  return;
394
396
  }
395
- const touchstart$ = tuiTypedFromEvent(monthsScrollRef.elementRef.nativeElement, 'touchstart', { passive: true });
396
- const touchend$ = tuiTypedFromEvent(monthsScrollRef.elementRef.nativeElement, 'touchend', { passive: true });
397
+ const touchstart$ = tuiTypedFromEvent(monthsScroll.elementRef.nativeElement, 'touchstart', { passive: true });
398
+ const touchend$ = tuiTypedFromEvent(monthsScroll.elementRef.nativeElement, 'touchend', { passive: true });
397
399
  // Smooth scroll to the closest month after scrolling is done
398
400
  touchstart$
399
- .pipe(switchMap(() => touchend$), switchMap(() => race(monthsScrollRef.elementScrolled(), timer(SCROLL_DEBOUNCE_TIME, tuiZonefreeScheduler(this.ngZone))).pipe(debounceTime(SCROLL_DEBOUNCE_TIME * 2, tuiZonefreeScheduler(this.ngZone)), take(1), takeUntil(touchstart$))), takeUntilDestroyed(this.destroyRef))
401
+ .pipe(switchMap(() => touchend$), switchMap(() => race(monthsScroll.elementScrolled(), timer(SCROLL_DEBOUNCE_TIME, tuiZonefreeScheduler(this.ngZone))).pipe(debounceTime(SCROLL_DEBOUNCE_TIME * 2, tuiZonefreeScheduler(this.ngZone)), take(1), takeUntil(touchstart$))), takeUntilDestroyed(this.destroyRef))
400
402
  .subscribe(() => this.scrollToActiveMonth('smooth'));
401
403
  }
402
404
  scrollToActiveYear(behavior = 'auto') {
403
- this.yearsScrollRef?.scrollToIndex(Math.max(this.activeYear - STARTING_YEAR - 2, 0), this.isE2E ? 'auto' : behavior);
405
+ this.yearsScroll()?.scrollToIndex(Math.max(this.activeYear - STARTING_YEAR - 2, 0), this.isE2E ? 'auto' : behavior);
404
406
  }
405
407
  scrollToActiveMonth(behavior = 'auto') {
406
- this.monthsScrollRef?.scrollToIndex(this.activeMonth, this.isE2E ? 'auto' : behavior);
408
+ this.monthsScroll()?.scrollToIndex(this.activeMonth, this.isE2E ? 'auto' : behavior);
407
409
  }
408
410
  isYearActive(index) {
409
411
  return index === this.activeYear;
@@ -414,10 +416,10 @@ class TuiMobileCalendar {
414
416
  getMonthOffset(year) {
415
417
  return (year - this.activeYear) * MONTHS_IN_YEAR;
416
418
  }
417
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMobileCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
418
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TuiMobileCalendar, isStandalone: true, selector: "tui-mobile-calendar", inputs: { single: "single", multi: "multi", min: "min", max: "max", disabledItemHandler: "disabledItemHandler", value: "value" }, outputs: { cancel: "cancel", confirm: "confirm", valueChange: "valueChange" }, host: { listeners: { "mousedown.prevent": "0" }, properties: { "class._ios": "isIOS", "class._initialized": "initialized" } }, providers: TUI_MOBILE_CALENDAR_PROVIDERS, viewQueries: [{ propertyName: "yearsScrollRef", first: true, predicate: ["yearsScrollRef"], descendants: true }, { propertyName: "monthsScrollRef", first: true, predicate: ["monthsScrollRef"], descendants: true }], ngImport: i0, template: "@if (chooseDayOrRangeTexts?.(); as texts) {\n <header class=\"t-header\">\n <button\n appearance=\"\"\n automation-id=\"tui-mobile-calendar__cancel\"\n tuiIconButton\n tuiRipple\n type=\"button\"\n class=\"t-close\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"onClose()\"\n >\n {{ closeWord() }}\n </button>\n <button\n tuiLink\n tuiTouchable=\"opacity\"\n type=\"button\"\n class=\"t-link t-link_close\"\n (click)=\"onClose()\"\n >\n {{ cancelWord() }}\n </button>\n <h2\n automation-id=\"tui-mobile-calendar__label\"\n class=\"t-label\"\n >\n {{ single ? texts[0] : multi ? texts[2] : texts[1] }}\n </h2>\n <button\n automation-id=\"tui-mobile-calendar__confirm\"\n tuiLink\n tuiTouchable=\"opacity\"\n type=\"button\"\n class=\"t-link\"\n (click)=\"onConfirm()\"\n >\n {{ doneWord() }}\n </button>\n </header>\n}\n<cdk-virtual-scroll-viewport\n #yearsScrollRef\n orientation=\"horizontal\"\n class=\"t-years\"\n [itemSize]=\"yearWidth\"\n>\n <div class=\"t-years-wrapper\">\n <button\n *cdkVirtualFor=\"let index of years\"\n type=\"button\"\n class=\"t-year\"\n [attr.data-state]=\"getState(index)\"\n (click)=\"setYear(index)\"\n >\n {{ index }}\n </button>\n </div>\n</cdk-virtual-scroll-viewport>\n<div class=\"t-week\">\n @for (day of unorderedWeekDays$ | tuiOrderWeekDays | async; track day) {\n <div class=\"t-day\">\n {{ day }}\n </div>\n }\n</div>\n<cdk-virtual-scroll-viewport\n #monthsScrollRef\n itemSize=\"354\"\n maxBufferPx=\"5000\"\n minBufferPx=\"0\"\n class=\"t-months\"\n (scrolledIndexChange)=\"onMonthChange($event)\"\n>\n <section\n *cdkVirtualFor=\"let month of months; templateCacheSize: 10\"\n class=\"t-month-wrapper\"\n >\n <h2 class=\"t-month\">{{ month | tuiMonth | async }}</h2>\n <tui-mobile-calendar-sheet\n class=\"t-calendar\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper : min : max\"\n [month]=\"month\"\n [single]=\"single\"\n [value]=\"value\"\n (dayClick)=\"onDayClick($event)\"\n />\n </section>\n</cdk-virtual-scroll-viewport>\n", styles: [":host{display:block;block-size:100%;color:var(--tui-text-primary);overscroll-behavior:none;-webkit-tap-highlight-color:transparent}:host ::ng-deep .t-cell:before,:host ::ng-deep .t-cell:after{transform:translateZ(1px)}.t-header{position:relative;display:flex;align-items:center;block-size:3.5rem;padding:0 1rem;border-block-end:.5px solid var(--tui-border-normal)}:host._ios .t-header{block-size:2.75rem;border-block-end:none}.t-close{inline-size:1.5rem;block-size:1.5rem;margin-inline-end:2rem}:host._ios .t-close{display:none}.t-link{margin-inline-start:auto;flex-shrink:0;font-size:.875rem;line-height:1rem;font-weight:500;text-transform:uppercase;color:var(--tui-text-action)}.t-link_close{display:none}:host._ios .t-link{min-inline-size:3.75rem;text-align:end;font-size:.9375rem;line-height:1.125rem;font-weight:400;letter-spacing:.018125rem;text-transform:none}:host._ios .t-link_close{display:block;margin:0 auto 0 0;text-align:start}.t-label{flex-grow:1;margin:0;font-size:1.25rem;line-height:3.5rem;font-weight:500;letter-spacing:-.0125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-label+.t-link{padding-inline-start:1rem}:host._ios .t-label{font-size:1.0625rem;font-weight:600;letter-spacing:-.025625rem;text-align:center}.t-years{scrollbar-width:none;-ms-overflow-style:none;block-size:4.0625rem;background-color:var(--tui-background-base);box-shadow:0 .5px var(--tui-border-normal)}.t-years::-webkit-scrollbar,.t-years::-webkit-scrollbar-thumb{display:none}:host._ios .t-years{background-color:transparent}.t-years-wrapper{display:flex;block-size:4.0625rem}.t-year{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;outline:none;inline-size:20vw;flex-shrink:0;font-size:.9375rem;font-weight:700;letter-spacing:.015625rem;cursor:pointer;opacity:.1;transform:scale(.73);transition:color,opacity,transform .2s}.t-year[data-state=adjacent]{transform:scale(.86);opacity:.3}.t-year[data-state=active]{color:var(--tui-text-action);opacity:1;transform:scale(1)}.t-week{display:flex;align-items:center;block-size:1.875rem;inline-size:20.75rem;max-inline-size:100%;margin:0 auto;font-size:.75rem}:host._ios .t-week{inline-size:22.625rem;font-size:.6875rem;font-weight:500;color:var(--tui-text-secondary)}.t-day{flex:1;text-align:center}.t-months{scrollbar-width:none;-ms-overflow-style:none;block-size:calc(100% - 9.5rem);box-shadow:0 -1px var(--tui-border-normal);overflow-x:hidden}.t-months::-webkit-scrollbar,.t-months::-webkit-scrollbar-thumb{display:none}:host._ios .t-months{block-size:calc(100% - 8.75rem)}.t-month-wrapper{display:flex;margin:.625rem 0 -.625rem;block-size:22.125rem;flex-direction:column}.t-month{block-size:2.75rem;inline-size:100%;line-height:2.75rem;padding-inline-start:1rem;font-size:.875rem;font-weight:500;text-transform:uppercase;margin:0 0 1.25rem;box-sizing:border-box;border-block-end:.5px solid var(--tui-border-normal)}:host._ios .t-month{block-size:3.125rem;margin:0;border-block-end:none;text-transform:none;font-size:1.375rem;line-height:3.125rem;letter-spacing:.02rem;font-weight:700}.t-calendar{margin:0 auto;transition:opacity .2s}.t-week,.t-years,.t-months{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:0}:host(._initialized) .t-week,:host(._initialized) .t-years,:host(._initialized) .t-months{opacity:1}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "component", type: TuiMobileCalendarSheet, selector: "tui-mobile-calendar-sheet" }, { kind: "pipe", type: TuiMonthPipe, name: "tuiMonth" }, { kind: "pipe", type: TuiOrderWeekDaysPipe, name: "tuiOrderWeekDays" }, { kind: "directive", type: TuiRipple, selector: "[tuiRipple]", inputs: ["tuiRipple"] }, { kind: "directive", type: TuiTouchable, selector: "[tuiTouchable]", inputs: ["tuiTouchable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
419
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiMobileCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
420
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiMobileCalendar, isStandalone: true, selector: "tui-mobile-calendar", inputs: { single: { classPropertyName: "single", publicName: "single", isSignal: true, isRequired: false, transformFunction: null }, multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabledItemHandler: { classPropertyName: "disabledItemHandler", publicName: "disabledItemHandler", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cancel: "cancel", confirm: "confirm", value: "valueChange" }, host: { listeners: { "mousedown.prevent": "0" }, properties: { "class._ios": "isIOS", "class._initialized": "initialized" } }, providers: TUI_MOBILE_CALENDAR_PROVIDERS, viewQueries: [{ propertyName: "yearsScroll", first: true, predicate: ["yearsScroll"], descendants: true, isSignal: true }, { propertyName: "monthsScroll", first: true, predicate: ["monthsScroll"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (chooseDayOrRangeTexts?.(); as texts) {\n <header class=\"t-header\">\n <button\n appearance=\"\"\n automation-id=\"tui-mobile-calendar__cancel\"\n tuiIconButton\n tuiRipple\n type=\"button\"\n class=\"t-close\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"onClose()\"\n >\n {{ closeWord() }}\n </button>\n <button\n tuiLink\n tuiTouchable=\"opacity\"\n type=\"button\"\n class=\"t-link t-link_close\"\n (click)=\"onClose()\"\n >\n {{ cancelWord() }}\n </button>\n <h2\n automation-id=\"tui-mobile-calendar__label\"\n class=\"t-label\"\n >\n {{ single() ? texts[0] : multi() ? texts[2] : texts[1] }}\n </h2>\n <button\n automation-id=\"tui-mobile-calendar__confirm\"\n tuiLink\n tuiTouchable=\"opacity\"\n type=\"button\"\n class=\"t-link\"\n (click)=\"onConfirm()\"\n >\n {{ doneWord() }}\n </button>\n </header>\n}\n<cdk-virtual-scroll-viewport\n #yearsScroll\n orientation=\"horizontal\"\n class=\"t-years\"\n [itemSize]=\"yearWidth\"\n>\n <div class=\"t-years-wrapper\">\n <button\n *cdkVirtualFor=\"let index of years\"\n type=\"button\"\n class=\"t-year\"\n [attr.data-state]=\"getState(index)\"\n (click)=\"setYear(index)\"\n >\n {{ index }}\n </button>\n </div>\n</cdk-virtual-scroll-viewport>\n<div class=\"t-week\">\n @for (day of unorderedWeekDays$ | tuiOrderWeekDays | async; track day) {\n <div class=\"t-day\">\n {{ day }}\n </div>\n }\n</div>\n<cdk-virtual-scroll-viewport\n #monthsScroll\n itemSize=\"354\"\n maxBufferPx=\"5000\"\n minBufferPx=\"0\"\n class=\"t-months\"\n (scrolledIndexChange)=\"onMonthChange($event)\"\n>\n <section\n *cdkVirtualFor=\"let month of months; templateCacheSize: 10\"\n class=\"t-month-wrapper\"\n >\n <h2 class=\"t-month\">{{ monthNames()[month.month] }}</h2>\n <tui-mobile-calendar-sheet\n class=\"t-calendar\"\n [disabledItemHandler]=\"disabledItemHandler() | tuiMapper: disabledItemHandlerMapper : min() : max()\"\n [month]=\"month\"\n [single]=\"single()\"\n [value]=\"value()\"\n (dayClick)=\"onDayClick($event)\"\n />\n </section>\n</cdk-virtual-scroll-viewport>\n", styles: [":host{display:block;block-size:100%;color:var(--tui-text-primary);overscroll-behavior:none;-webkit-tap-highlight-color:transparent}:host ::ng-deep .t-cell:before,:host ::ng-deep .t-cell:after{transform:translateZ(1px)}.t-header{position:relative;display:flex;align-items:center;block-size:3.5rem;padding:0 1rem;border-block-end:.5px solid var(--tui-border-normal)}:host._ios .t-header{block-size:2.75rem;border-block-end:none}.t-close{inline-size:1.5rem;block-size:1.5rem;margin-inline-end:2rem}:host._ios .t-close{display:none}.t-link{margin-inline-start:auto;flex-shrink:0;font-size:.875rem;line-height:1rem;font-weight:500;text-transform:uppercase;color:var(--tui-text-action)}.t-link_close{display:none}:host._ios .t-link{min-inline-size:3.75rem;text-align:end;font-size:.9375rem;line-height:1.125rem;font-weight:400;letter-spacing:.018125rem;text-transform:none}:host._ios .t-link_close{display:block;margin:0 auto 0 0;text-align:start}.t-label{flex-grow:1;margin:0;font-size:1.25rem;line-height:3.5rem;font-weight:500;letter-spacing:-.0125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-label+.t-link{padding-inline-start:1rem}:host._ios .t-label{font-size:1.0625rem;font-weight:600;letter-spacing:-.025625rem;text-align:center}.t-years{scrollbar-width:none;-ms-overflow-style:none;block-size:4.0625rem;background-color:var(--tui-background-base);box-shadow:0 .5px var(--tui-border-normal)}.t-years::-webkit-scrollbar,.t-years::-webkit-scrollbar-thumb{display:none}:host._ios .t-years{background-color:transparent}.t-years-wrapper{display:flex;block-size:4.0625rem}.t-year{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;outline:none;inline-size:20vw;flex-shrink:0;font-size:.9375rem;font-weight:700;letter-spacing:.015625rem;cursor:pointer;opacity:.1;transform:scale(.73);transition:color,opacity,transform .2s}.t-year[data-state=adjacent]{transform:scale(.86);opacity:.3}.t-year[data-state=active]{color:var(--tui-text-action);opacity:1;transform:scale(1)}.t-week{display:flex;align-items:center;block-size:1.875rem;inline-size:20.75rem;max-inline-size:100%;margin:0 auto;font-size:.75rem}:host._ios .t-week{inline-size:22.625rem;font-size:.6875rem;font-weight:500;color:var(--tui-text-secondary)}.t-day{flex:1;text-align:center}.t-months{scrollbar-width:none;-ms-overflow-style:none;block-size:calc(100% - 9.5rem);box-shadow:0 -1px var(--tui-border-normal);overflow-x:hidden}.t-months::-webkit-scrollbar,.t-months::-webkit-scrollbar-thumb{display:none}:host._ios .t-months{block-size:calc(100% - 8.75rem)}.t-month-wrapper{display:flex;margin:.625rem 0 -.625rem;block-size:22.125rem;flex-direction:column}.t-month{block-size:2.75rem;inline-size:100%;line-height:2.75rem;padding-inline-start:1rem;font-size:.875rem;font-weight:500;text-transform:uppercase;margin:0 0 1.25rem;box-sizing:border-box;border-block-end:.5px solid var(--tui-border-normal)}:host._ios .t-month{block-size:3.125rem;margin:0;border-block-end:none;text-transform:none;font-size:1.375rem;line-height:3.125rem;letter-spacing:.02rem;font-weight:700}.t-calendar{margin:0 auto;transition:opacity .2s}.t-week,.t-years,.t-months{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:0}:host(._initialized) .t-week,:host(._initialized) .t-years,:host(._initialized) .t-months{opacity:1}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "component", type: TuiMobileCalendarSheet, selector: "tui-mobile-calendar-sheet" }, { kind: "pipe", type: TuiOrderWeekDaysPipe, name: "tuiOrderWeekDays" }, { kind: "directive", type: TuiRipple, selector: "[tuiRipple]", inputs: ["tuiRipple"] }, { kind: "directive", type: TuiTouchable, selector: "[tuiTouchable]", inputs: ["tuiTouchable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
419
421
  }
420
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMobileCalendar, decorators: [{
422
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiMobileCalendar, decorators: [{
421
423
  type: Component,
422
424
  args: [{ selector: 'tui-mobile-calendar', imports: [
423
425
  AsyncPipe,
@@ -428,7 +430,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
428
430
  TuiLink,
429
431
  TuiMapperPipe,
430
432
  TuiMobileCalendarSheet,
431
- TuiMonthPipe,
432
433
  TuiOrderWeekDaysPipe,
433
434
  TuiRipple,
434
435
  TuiTouchable,
@@ -436,36 +437,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
436
437
  '[class._ios]': 'isIOS',
437
438
  '[class._initialized]': 'initialized',
438
439
  '(mousedown.prevent)': '0',
439
- }, template: "@if (chooseDayOrRangeTexts?.(); as texts) {\n <header class=\"t-header\">\n <button\n appearance=\"\"\n automation-id=\"tui-mobile-calendar__cancel\"\n tuiIconButton\n tuiRipple\n type=\"button\"\n class=\"t-close\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"onClose()\"\n >\n {{ closeWord() }}\n </button>\n <button\n tuiLink\n tuiTouchable=\"opacity\"\n type=\"button\"\n class=\"t-link t-link_close\"\n (click)=\"onClose()\"\n >\n {{ cancelWord() }}\n </button>\n <h2\n automation-id=\"tui-mobile-calendar__label\"\n class=\"t-label\"\n >\n {{ single ? texts[0] : multi ? texts[2] : texts[1] }}\n </h2>\n <button\n automation-id=\"tui-mobile-calendar__confirm\"\n tuiLink\n tuiTouchable=\"opacity\"\n type=\"button\"\n class=\"t-link\"\n (click)=\"onConfirm()\"\n >\n {{ doneWord() }}\n </button>\n </header>\n}\n<cdk-virtual-scroll-viewport\n #yearsScrollRef\n orientation=\"horizontal\"\n class=\"t-years\"\n [itemSize]=\"yearWidth\"\n>\n <div class=\"t-years-wrapper\">\n <button\n *cdkVirtualFor=\"let index of years\"\n type=\"button\"\n class=\"t-year\"\n [attr.data-state]=\"getState(index)\"\n (click)=\"setYear(index)\"\n >\n {{ index }}\n </button>\n </div>\n</cdk-virtual-scroll-viewport>\n<div class=\"t-week\">\n @for (day of unorderedWeekDays$ | tuiOrderWeekDays | async; track day) {\n <div class=\"t-day\">\n {{ day }}\n </div>\n }\n</div>\n<cdk-virtual-scroll-viewport\n #monthsScrollRef\n itemSize=\"354\"\n maxBufferPx=\"5000\"\n minBufferPx=\"0\"\n class=\"t-months\"\n (scrolledIndexChange)=\"onMonthChange($event)\"\n>\n <section\n *cdkVirtualFor=\"let month of months; templateCacheSize: 10\"\n class=\"t-month-wrapper\"\n >\n <h2 class=\"t-month\">{{ month | tuiMonth | async }}</h2>\n <tui-mobile-calendar-sheet\n class=\"t-calendar\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper : min : max\"\n [month]=\"month\"\n [single]=\"single\"\n [value]=\"value\"\n (dayClick)=\"onDayClick($event)\"\n />\n </section>\n</cdk-virtual-scroll-viewport>\n", styles: [":host{display:block;block-size:100%;color:var(--tui-text-primary);overscroll-behavior:none;-webkit-tap-highlight-color:transparent}:host ::ng-deep .t-cell:before,:host ::ng-deep .t-cell:after{transform:translateZ(1px)}.t-header{position:relative;display:flex;align-items:center;block-size:3.5rem;padding:0 1rem;border-block-end:.5px solid var(--tui-border-normal)}:host._ios .t-header{block-size:2.75rem;border-block-end:none}.t-close{inline-size:1.5rem;block-size:1.5rem;margin-inline-end:2rem}:host._ios .t-close{display:none}.t-link{margin-inline-start:auto;flex-shrink:0;font-size:.875rem;line-height:1rem;font-weight:500;text-transform:uppercase;color:var(--tui-text-action)}.t-link_close{display:none}:host._ios .t-link{min-inline-size:3.75rem;text-align:end;font-size:.9375rem;line-height:1.125rem;font-weight:400;letter-spacing:.018125rem;text-transform:none}:host._ios .t-link_close{display:block;margin:0 auto 0 0;text-align:start}.t-label{flex-grow:1;margin:0;font-size:1.25rem;line-height:3.5rem;font-weight:500;letter-spacing:-.0125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-label+.t-link{padding-inline-start:1rem}:host._ios .t-label{font-size:1.0625rem;font-weight:600;letter-spacing:-.025625rem;text-align:center}.t-years{scrollbar-width:none;-ms-overflow-style:none;block-size:4.0625rem;background-color:var(--tui-background-base);box-shadow:0 .5px var(--tui-border-normal)}.t-years::-webkit-scrollbar,.t-years::-webkit-scrollbar-thumb{display:none}:host._ios .t-years{background-color:transparent}.t-years-wrapper{display:flex;block-size:4.0625rem}.t-year{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;outline:none;inline-size:20vw;flex-shrink:0;font-size:.9375rem;font-weight:700;letter-spacing:.015625rem;cursor:pointer;opacity:.1;transform:scale(.73);transition:color,opacity,transform .2s}.t-year[data-state=adjacent]{transform:scale(.86);opacity:.3}.t-year[data-state=active]{color:var(--tui-text-action);opacity:1;transform:scale(1)}.t-week{display:flex;align-items:center;block-size:1.875rem;inline-size:20.75rem;max-inline-size:100%;margin:0 auto;font-size:.75rem}:host._ios .t-week{inline-size:22.625rem;font-size:.6875rem;font-weight:500;color:var(--tui-text-secondary)}.t-day{flex:1;text-align:center}.t-months{scrollbar-width:none;-ms-overflow-style:none;block-size:calc(100% - 9.5rem);box-shadow:0 -1px var(--tui-border-normal);overflow-x:hidden}.t-months::-webkit-scrollbar,.t-months::-webkit-scrollbar-thumb{display:none}:host._ios .t-months{block-size:calc(100% - 8.75rem)}.t-month-wrapper{display:flex;margin:.625rem 0 -.625rem;block-size:22.125rem;flex-direction:column}.t-month{block-size:2.75rem;inline-size:100%;line-height:2.75rem;padding-inline-start:1rem;font-size:.875rem;font-weight:500;text-transform:uppercase;margin:0 0 1.25rem;box-sizing:border-box;border-block-end:.5px solid var(--tui-border-normal)}:host._ios .t-month{block-size:3.125rem;margin:0;border-block-end:none;text-transform:none;font-size:1.375rem;line-height:3.125rem;letter-spacing:.02rem;font-weight:700}.t-calendar{margin:0 auto;transition:opacity .2s}.t-week,.t-years,.t-months{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:0}:host(._initialized) .t-week,:host(._initialized) .t-years,:host(._initialized) .t-months{opacity:1}\n"] }]
440
- }], ctorParameters: () => [], propDecorators: { yearsScrollRef: [{
441
- type: ViewChild,
442
- args: ['yearsScrollRef']
443
- }], monthsScrollRef: [{
444
- type: ViewChild,
445
- args: ['monthsScrollRef']
446
- }], single: [{
447
- type: Input
448
- }], multi: [{
449
- type: Input
450
- }], min: [{
451
- type: Input
452
- }], max: [{
453
- type: Input
454
- }], disabledItemHandler: [{
455
- type: Input
456
- }], cancel: [{
457
- type: Output
458
- }], confirm: [{
459
- type: Output
460
- }], valueChange: [{
461
- type: Output
462
- }], value: [{
463
- type: Input
464
- }] } });
440
+ }, template: "@if (chooseDayOrRangeTexts?.(); as texts) {\n <header class=\"t-header\">\n <button\n appearance=\"\"\n automation-id=\"tui-mobile-calendar__cancel\"\n tuiIconButton\n tuiRipple\n type=\"button\"\n class=\"t-close\"\n [iconStart]=\"icons.close\"\n [style.border-radius.%]=\"100\"\n (click)=\"onClose()\"\n >\n {{ closeWord() }}\n </button>\n <button\n tuiLink\n tuiTouchable=\"opacity\"\n type=\"button\"\n class=\"t-link t-link_close\"\n (click)=\"onClose()\"\n >\n {{ cancelWord() }}\n </button>\n <h2\n automation-id=\"tui-mobile-calendar__label\"\n class=\"t-label\"\n >\n {{ single() ? texts[0] : multi() ? texts[2] : texts[1] }}\n </h2>\n <button\n automation-id=\"tui-mobile-calendar__confirm\"\n tuiLink\n tuiTouchable=\"opacity\"\n type=\"button\"\n class=\"t-link\"\n (click)=\"onConfirm()\"\n >\n {{ doneWord() }}\n </button>\n </header>\n}\n<cdk-virtual-scroll-viewport\n #yearsScroll\n orientation=\"horizontal\"\n class=\"t-years\"\n [itemSize]=\"yearWidth\"\n>\n <div class=\"t-years-wrapper\">\n <button\n *cdkVirtualFor=\"let index of years\"\n type=\"button\"\n class=\"t-year\"\n [attr.data-state]=\"getState(index)\"\n (click)=\"setYear(index)\"\n >\n {{ index }}\n </button>\n </div>\n</cdk-virtual-scroll-viewport>\n<div class=\"t-week\">\n @for (day of unorderedWeekDays$ | tuiOrderWeekDays | async; track day) {\n <div class=\"t-day\">\n {{ day }}\n </div>\n }\n</div>\n<cdk-virtual-scroll-viewport\n #monthsScroll\n itemSize=\"354\"\n maxBufferPx=\"5000\"\n minBufferPx=\"0\"\n class=\"t-months\"\n (scrolledIndexChange)=\"onMonthChange($event)\"\n>\n <section\n *cdkVirtualFor=\"let month of months; templateCacheSize: 10\"\n class=\"t-month-wrapper\"\n >\n <h2 class=\"t-month\">{{ monthNames()[month.month] }}</h2>\n <tui-mobile-calendar-sheet\n class=\"t-calendar\"\n [disabledItemHandler]=\"disabledItemHandler() | tuiMapper: disabledItemHandlerMapper : min() : max()\"\n [month]=\"month\"\n [single]=\"single()\"\n [value]=\"value()\"\n (dayClick)=\"onDayClick($event)\"\n />\n </section>\n</cdk-virtual-scroll-viewport>\n", styles: [":host{display:block;block-size:100%;color:var(--tui-text-primary);overscroll-behavior:none;-webkit-tap-highlight-color:transparent}:host ::ng-deep .t-cell:before,:host ::ng-deep .t-cell:after{transform:translateZ(1px)}.t-header{position:relative;display:flex;align-items:center;block-size:3.5rem;padding:0 1rem;border-block-end:.5px solid var(--tui-border-normal)}:host._ios .t-header{block-size:2.75rem;border-block-end:none}.t-close{inline-size:1.5rem;block-size:1.5rem;margin-inline-end:2rem}:host._ios .t-close{display:none}.t-link{margin-inline-start:auto;flex-shrink:0;font-size:.875rem;line-height:1rem;font-weight:500;text-transform:uppercase;color:var(--tui-text-action)}.t-link_close{display:none}:host._ios .t-link{min-inline-size:3.75rem;text-align:end;font-size:.9375rem;line-height:1.125rem;font-weight:400;letter-spacing:.018125rem;text-transform:none}:host._ios .t-link_close{display:block;margin:0 auto 0 0;text-align:start}.t-label{flex-grow:1;margin:0;font-size:1.25rem;line-height:3.5rem;font-weight:500;letter-spacing:-.0125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-label+.t-link{padding-inline-start:1rem}:host._ios .t-label{font-size:1.0625rem;font-weight:600;letter-spacing:-.025625rem;text-align:center}.t-years{scrollbar-width:none;-ms-overflow-style:none;block-size:4.0625rem;background-color:var(--tui-background-base);box-shadow:0 .5px var(--tui-border-normal)}.t-years::-webkit-scrollbar,.t-years::-webkit-scrollbar-thumb{display:none}:host._ios .t-years{background-color:transparent}.t-years-wrapper{display:flex;block-size:4.0625rem}.t-year{-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;outline:none;inline-size:20vw;flex-shrink:0;font-size:.9375rem;font-weight:700;letter-spacing:.015625rem;cursor:pointer;opacity:.1;transform:scale(.73);transition:color,opacity,transform .2s}.t-year[data-state=adjacent]{transform:scale(.86);opacity:.3}.t-year[data-state=active]{color:var(--tui-text-action);opacity:1;transform:scale(1)}.t-week{display:flex;align-items:center;block-size:1.875rem;inline-size:20.75rem;max-inline-size:100%;margin:0 auto;font-size:.75rem}:host._ios .t-week{inline-size:22.625rem;font-size:.6875rem;font-weight:500;color:var(--tui-text-secondary)}.t-day{flex:1;text-align:center}.t-months{scrollbar-width:none;-ms-overflow-style:none;block-size:calc(100% - 9.5rem);box-shadow:0 -1px var(--tui-border-normal);overflow-x:hidden}.t-months::-webkit-scrollbar,.t-months::-webkit-scrollbar-thumb{display:none}:host._ios .t-months{block-size:calc(100% - 8.75rem)}.t-month-wrapper{display:flex;margin:.625rem 0 -.625rem;block-size:22.125rem;flex-direction:column}.t-month{block-size:2.75rem;inline-size:100%;line-height:2.75rem;padding-inline-start:1rem;font-size:.875rem;font-weight:500;text-transform:uppercase;margin:0 0 1.25rem;box-sizing:border-box;border-block-end:.5px solid var(--tui-border-normal)}:host._ios .t-month{block-size:3.125rem;margin:0;border-block-end:none;text-transform:none;font-size:1.375rem;line-height:3.125rem;letter-spacing:.02rem;font-weight:700}.t-calendar{margin:0 auto;transition:opacity .2s}.t-week,.t-years,.t-months{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:0}:host(._initialized) .t-week,:host(._initialized) .t-years,:host(._initialized) .t-months{opacity:1}\n"] }]
441
+ }], ctorParameters: () => [] });
442
+ function toggleDay(days, day) {
443
+ return ((days?.find((item) => item.daySame(day))
444
+ ? days.filter((item) => !item.daySame(day))
445
+ : days?.concat(day)) || []);
446
+ }
465
447
 
466
448
  /**
467
449
  * Generated bundle index. Do not edit.
468
450
  */
469
451
 
470
- export { ANDROID_CYCLE, ANDROID_LABEL, ANDROID_WEEK, BUFFER, IOS_CYCLE, IOS_LABEL, IOS_WEEK, RANGE, SCROLL_DEBOUNCE_TIME, STARTING_YEAR, TUI_MOBILE_CALENDAR_PROVIDERS, TUI_VALUE_STREAM, TuiMobileCalendar, TuiMobileCalendarStrategy, YEARLY_CYCLE, YEARS_IN_ROW };
452
+ export { ANDROID_CYCLE, ANDROID_LABEL, ANDROID_WEEK, BUFFER, IOS_CYCLE, IOS_LABEL, IOS_WEEK, RANGE, SCROLL_DEBOUNCE_TIME, STARTING_YEAR, TUI_CALENDAR_DATE_STREAM, TUI_MOBILE_CALENDAR_PROVIDERS, TUI_VALUE_STREAM, TuiMobileCalendar, TuiMobileCalendarStrategy, YEARLY_CYCLE, YEARS_IN_ROW, tuiDateStreamWithTransformer };
471
453
  //# sourceMappingURL=taiga-ui-addon-mobile-components-mobile-calendar.mjs.map