@taiga-ui/core 5.0.0-rc.3 → 5.0.0-rc.5

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 (113) hide show
  1. package/components/calendar/calendar-sheet.component.d.ts +8 -23
  2. package/components/calendar/calendar-spin.component.d.ts +5 -8
  3. package/components/calendar/calendar-year.component.d.ts +11 -19
  4. package/components/calendar/calendar.component.d.ts +17 -29
  5. package/components/carousel/carousel.component.d.ts +20 -0
  6. package/components/carousel/carousel.d.ts +4 -0
  7. package/components/carousel/carousel.directive.d.ts +11 -0
  8. package/components/carousel/index.d.ts +3 -0
  9. package/components/data-list/data-list.component.d.ts +1 -0
  10. package/components/error/error.directive.d.ts +1 -1
  11. package/components/index.d.ts +1 -0
  12. package/components/input/input.directive.d.ts +2 -0
  13. package/directives/appearance/appearance.options.d.ts +1 -1
  14. package/fesm2022/taiga-ui-core-classes.mjs +3 -3
  15. package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
  16. package/fesm2022/taiga-ui-core-components-button.mjs +8 -8
  17. package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
  18. package/fesm2022/taiga-ui-core-components-calendar.mjs +123 -269
  19. package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
  20. package/fesm2022/taiga-ui-core-components-carousel.mjs +100 -0
  21. package/fesm2022/taiga-ui-core-components-carousel.mjs.map +1 -0
  22. package/fesm2022/taiga-ui-core-components-cell.mjs +9 -7
  23. package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
  24. package/fesm2022/taiga-ui-core-components-checkbox.mjs +4 -4
  25. package/fesm2022/taiga-ui-core-components-checkbox.mjs.map +1 -1
  26. package/fesm2022/taiga-ui-core-components-data-list.mjs +30 -21
  27. package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
  28. package/fesm2022/taiga-ui-core-components-error.mjs +11 -11
  29. package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
  30. package/fesm2022/taiga-ui-core-components-expand.mjs +5 -5
  31. package/fesm2022/taiga-ui-core-components-expand.mjs.map +1 -1
  32. package/fesm2022/taiga-ui-core-components-icon.mjs +8 -7
  33. package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
  34. package/fesm2022/taiga-ui-core-components-input.mjs +9 -7
  35. package/fesm2022/taiga-ui-core-components-input.mjs.map +1 -1
  36. package/fesm2022/taiga-ui-core-components-label.mjs +7 -7
  37. package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
  38. package/fesm2022/taiga-ui-core-components-link.mjs +8 -8
  39. package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
  40. package/fesm2022/taiga-ui-core-components-loader.mjs +4 -4
  41. package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
  42. package/fesm2022/taiga-ui-core-components-notification.mjs +18 -18
  43. package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
  44. package/fesm2022/taiga-ui-core-components-radio.mjs +7 -7
  45. package/fesm2022/taiga-ui-core-components-radio.mjs.map +1 -1
  46. package/fesm2022/taiga-ui-core-components-root.mjs +4 -4
  47. package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
  48. package/fesm2022/taiga-ui-core-components-scrollbar.mjs +22 -22
  49. package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
  50. package/fesm2022/taiga-ui-core-components-slider.mjs +17 -17
  51. package/fesm2022/taiga-ui-core-components-slider.mjs.map +1 -1
  52. package/fesm2022/taiga-ui-core-components-spin-button.mjs +4 -4
  53. package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
  54. package/fesm2022/taiga-ui-core-components-textfield.mjs +59 -31
  55. package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
  56. package/fesm2022/taiga-ui-core-components-title.mjs +7 -7
  57. package/fesm2022/taiga-ui-core-components-title.mjs.map +1 -1
  58. package/fesm2022/taiga-ui-core-components.mjs +1 -0
  59. package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
  60. package/fesm2022/taiga-ui-core-directives-appearance.mjs +10 -10
  61. package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
  62. package/fesm2022/taiga-ui-core-directives-button-x.mjs +3 -3
  63. package/fesm2022/taiga-ui-core-directives-button-x.mjs.map +1 -1
  64. package/fesm2022/taiga-ui-core-directives-date-format.mjs +3 -3
  65. package/fesm2022/taiga-ui-core-directives-date-format.mjs.map +1 -1
  66. package/fesm2022/taiga-ui-core-directives-group.mjs +7 -7
  67. package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
  68. package/fesm2022/taiga-ui-core-directives-icons.mjs +10 -10
  69. package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
  70. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +9 -9
  71. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
  72. package/fesm2022/taiga-ui-core-directives-number-format.mjs +3 -3
  73. package/fesm2022/taiga-ui-core-directives-number-format.mjs.map +1 -1
  74. package/fesm2022/taiga-ui-core-pipes-filter-by-input.mjs +55 -0
  75. package/fesm2022/taiga-ui-core-pipes-filter-by-input.mjs.map +1 -0
  76. package/fesm2022/taiga-ui-core-pipes-format-number.mjs +3 -3
  77. package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
  78. package/fesm2022/taiga-ui-core-pipes.mjs +1 -0
  79. package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
  80. package/fesm2022/taiga-ui-core-portals-alert.mjs +12 -10
  81. package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -1
  82. package/fesm2022/taiga-ui-core-portals-dialog.mjs +16 -15
  83. package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -1
  84. package/fesm2022/taiga-ui-core-portals-dropdown.mjs +328 -263
  85. package/fesm2022/taiga-ui-core-portals-dropdown.mjs.map +1 -1
  86. package/fesm2022/taiga-ui-core-portals-hint.mjs +39 -39
  87. package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -1
  88. package/fesm2022/taiga-ui-core-portals-modal.mjs +10 -8
  89. package/fesm2022/taiga-ui-core-portals-modal.mjs.map +1 -1
  90. package/fesm2022/taiga-ui-core-portals-popup.mjs +10 -10
  91. package/fesm2022/taiga-ui-core-portals-popup.mjs.map +1 -1
  92. package/fesm2022/taiga-ui-core-services.mjs +6 -6
  93. package/fesm2022/taiga-ui-core-services.mjs.map +1 -1
  94. package/fesm2022/taiga-ui-core-tokens.mjs +4 -2
  95. package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
  96. package/fesm2022/taiga-ui-core-utils-dom.mjs.map +1 -1
  97. package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
  98. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
  99. package/package.json +33 -11
  100. package/pipes/filter-by-input/filter-by-input.options.d.ts +6 -0
  101. package/pipes/filter-by-input/filter-by-input.pipe.d.ts +19 -0
  102. package/pipes/filter-by-input/index.d.ts +2 -0
  103. package/pipes/index.d.ts +1 -0
  104. package/portals/dropdown/dropdown-a11y.directive.d.ts +10 -0
  105. package/portals/dropdown/dropdown-close.directive.d.ts +3 -3
  106. package/portals/dropdown/dropdown-open.directive.d.ts +3 -2
  107. package/portals/dropdown/dropdown-selection.directive.d.ts +1 -0
  108. package/portals/dropdown/dropdown.d.ts +2 -1
  109. package/portals/dropdown/dropdown.directive.d.ts +6 -6
  110. package/portals/dropdown/dropdown.providers.d.ts +2 -1
  111. package/portals/dropdown/index.d.ts +2 -1
  112. package/tokens/index.d.ts +1 -0
  113. package/tokens/textfield.d.ts +2 -0
@@ -1,18 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
- import { signal, inject, Pipe, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, computed, ChangeDetectorRef } from '@angular/core';
2
+ import { signal, inject, Pipe, input, model, output, ChangeDetectionStrategy, Component, computed, linkedSignal, effect } from '@angular/core';
3
3
  import { TuiDayOfWeek, DAYS_IN_WEEK, TuiDay, TuiMonth, TuiDayRange, TUI_FIRST_DAY, TUI_LAST_DAY, MIN_YEAR, MAX_YEAR, TuiYear, TuiMonthRange, TUI_LAST_DISPLAYED_DAY } from '@taiga-ui/cdk/date-time';
4
4
  import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
5
5
  import { tuiNullableSame, tuiIsNumber } from '@taiga-ui/cdk/utils/miscellaneous';
6
6
  import { TuiScrollIntoView, TuiScrollbar } from '@taiga-ui/core/components/scrollbar';
7
7
  import { TUI_ITEMS_HANDLERS } from '@taiga-ui/core/directives/items-handlers';
8
8
  import { TUI_SHORT_WEEK_DAYS, TUI_MONTHS, tuiAsAuxiliary } from '@taiga-ui/core/tokens';
9
- import { map, Subject } from 'rxjs';
10
9
  import { AsyncPipe } from '@angular/common';
11
10
  import { toObservable } from '@angular/core/rxjs-interop';
12
11
  import { TUI_FALSE_HANDLER } from '@taiga-ui/cdk/constants';
13
12
  import { TuiHovered } from '@taiga-ui/cdk/directives/hovered';
14
13
  import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
15
14
  import { tuiInRange } from '@taiga-ui/cdk/utils/math';
15
+ import { map } from 'rxjs';
16
16
  import { TuiLink } from '@taiga-ui/core/components/link';
17
17
  import { TuiSpinButton } from '@taiga-ui/core/components/spin-button';
18
18
 
@@ -65,10 +65,10 @@ class TuiCalendarSheetPipe {
65
65
  this.currentMonth = month;
66
66
  return this.currentSheet;
67
67
  }
68
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarSheetPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
69
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarSheetPipe, isStandalone: true, name: "tuiCalendarSheet" }); }
68
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarSheetPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
69
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarSheetPipe, isStandalone: true, name: "tuiCalendarSheet" }); }
70
70
  }
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarSheetPipe, decorators: [{
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarSheetPipe, decorators: [{
72
72
  type: Pipe,
73
73
  args: [{ name: 'tuiCalendarSheet' }]
74
74
  }] });
@@ -119,10 +119,10 @@ class TuiOrderWeekDaysPipe {
119
119
  ...weekDays.slice(0, this.options.weekStart()),
120
120
  ]));
121
121
  }
122
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiOrderWeekDaysPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
123
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.18", ngImport: i0, type: TuiOrderWeekDaysPipe, isStandalone: true, name: "tuiOrderWeekDays" }); }
122
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiOrderWeekDaysPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
123
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: TuiOrderWeekDaysPipe, isStandalone: true, name: "tuiOrderWeekDays" }); }
124
124
  }
125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiOrderWeekDaysPipe, decorators: [{
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiOrderWeekDaysPipe, decorators: [{
126
126
  type: Pipe,
127
127
  args: [{ name: 'tuiOrderWeekDays' }]
128
128
  }] });
@@ -133,22 +133,13 @@ class TuiCalendarSheet {
133
133
  this.today = TuiDay.currentLocal();
134
134
  this.unorderedWeekDays$ = toObservable(inject(TUI_SHORT_WEEK_DAYS));
135
135
  this.dayType = inject(TUI_CALENDAR_OPTIONS).dayType;
136
- this.month = TuiMonth.currentLocal();
137
- this.disabledItemHandler = TUI_FALSE_HANDLER;
138
- this.markerHandler = null;
139
- this.value = null;
140
- this.hoveredItem = null;
141
- this.showAdjacent = true;
142
- /**
143
- * @deprecated use static DI options instead
144
- * ```
145
- * tuiCalendarSheetOptionsProvider({rangeMode: true})
146
- * ```
147
- * TODO(v5): delete it
148
- */
149
- this.single = true;
150
- this.hoveredItemChange = new EventEmitter();
151
- this.dayClick = new EventEmitter();
136
+ this.month = input(TuiMonth.currentLocal());
137
+ this.disabledItemHandler = input(TUI_FALSE_HANDLER);
138
+ this.markerHandler = input(null);
139
+ this.value = input(null);
140
+ this.showAdjacent = input(true);
141
+ this.hoveredItem = model(null);
142
+ this.dayClick = output();
152
143
  this.toMarkers = (day, today, range, markerHandler) => {
153
144
  if (today || ['active', 'end', 'start'].includes(range || '')) {
154
145
  return null;
@@ -157,28 +148,11 @@ class TuiCalendarSheet {
157
148
  return markers?.length ? markers : null;
158
149
  };
159
150
  }
160
- /**
161
- * @deprecated TODO(v5): delete it. It is used nowhere except unit tests
162
- */
163
- itemIsInterval(day) {
164
- const { value, hoveredItem } = this;
165
- if (!(value instanceof TuiDayRange)) {
166
- return false;
167
- }
168
- if (!value.isSingleDay) {
169
- return value.from.daySameOrBefore(day) && value.to.dayAfter(day);
170
- }
171
- if (hoveredItem === null) {
172
- return false;
173
- }
174
- const range = TuiDayRange.sort(value.from, hoveredItem);
175
- return range.from.daySameOrBefore(day) && range.to.dayAfter(day);
176
- }
177
151
  onItemHovered(item) {
178
152
  this.updateHoveredItem(item || null);
179
153
  }
180
154
  getItemRange(item) {
181
- const { value, hoveredItem } = this;
155
+ const value = this.value();
182
156
  if (!value) {
183
157
  return null;
184
158
  }
@@ -191,7 +165,7 @@ class TuiCalendarSheet {
191
165
  if (!(value instanceof TuiDay) && !(value instanceof TuiDayRange)) {
192
166
  return value.find((day) => day.daySame(item)) ? 'active' : null;
193
167
  }
194
- const range = this.getRange(value, hoveredItem);
168
+ const range = this.getRange(value, this.hoveredItem());
195
169
  if (range.isSingleDay && range.from.daySame(item)) {
196
170
  return 'active';
197
171
  }
@@ -204,25 +178,16 @@ class TuiCalendarSheet {
204
178
  return range.from.dayBefore(item) && range.to.dayAfter(item) ? 'middle' : null;
205
179
  }
206
180
  get computedRangeMode() {
207
- return !this.single || this.options.rangeMode;
181
+ return this.options.rangeMode;
208
182
  }
209
183
  get isRangePicking() {
210
- return this.computedRangeMode
211
- ? this.value instanceof TuiDay
212
- : /**
213
- * Only for backward compatibility!
214
- * TODO(v5): replace with `this.options.rangeMode && this.value instanceof TuiDay`
215
- */
216
- this.value instanceof TuiDayRange && this.value.isSingleDay;
184
+ return this.options.rangeMode && this.value() instanceof TuiDay;
217
185
  }
218
186
  itemIsToday(item) {
219
187
  return this.today.daySame(item);
220
188
  }
221
189
  itemIsUnavailable(item) {
222
- return !this.month.monthSame(item);
223
- }
224
- onItemClick(item) {
225
- this.dayClick.emit(item);
190
+ return !this.month().monthSame(item);
226
191
  }
227
192
  getRange(value, hoveredItem) {
228
193
  if (value instanceof TuiDay) {
@@ -233,16 +198,15 @@ class TuiCalendarSheet {
233
198
  : value;
234
199
  }
235
200
  updateHoveredItem(day) {
236
- if (tuiNullableSame(this.hoveredItem, day, (a, b) => a.daySame(b))) {
201
+ if (tuiNullableSame(this.hoveredItem(), day, (a, b) => a.daySame(b))) {
237
202
  return;
238
203
  }
239
- this.hoveredItem = day;
240
- this.hoveredItemChange.emit(day);
204
+ this.hoveredItem.set(day);
241
205
  }
242
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarSheet, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
243
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: TuiCalendarSheet, isStandalone: true, selector: "tui-calendar-sheet", inputs: { month: "month", disabledItemHandler: "disabledItemHandler", markerHandler: "markerHandler", value: "value", hoveredItem: "hoveredItem", showAdjacent: "showAdjacent", single: "single" }, outputs: { hoveredItemChange: "hoveredItemChange", dayClick: "dayClick" }, host: { properties: { "class._picking": "isRangePicking" } }, ngImport: i0, template: "<div class=\"t-row t-row_weekday\">\n @for (day of unorderedWeekDays$ | tuiOrderWeekDays | async; track day) {\n <div\n class=\"t-cell\"\n [textContent]=\"day\"\n ></div>\n }\n</div>\n@let sheet = month | tuiCalendarSheet: true;\n<div>\n @for (_ of '-'.repeat(sheet.length); track $index) {\n @let rowIndex = $index;\n <div\n automation-id=\"tui-calendar-sheet__row\"\n class=\"t-row\"\n >\n @for (_ of '-'.repeat(sheet[rowIndex]?.length ?? 0); track $index) {\n @let item = sheet[rowIndex]?.[$index];\n @if (item && (!itemIsUnavailable(item) || showAdjacent)) {\n <div\n automation-id=\"tui-calendar-sheet__cell\"\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [attr.data-type]=\"item | tuiMapper: dayType\"\n [class.t-cell_disabled]=\"disabledItemHandler(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n [class.t-cell_unavailable]=\"itemIsUnavailable(item)\"\n (click)=\"onItemClick(item)\"\n (tuiHoveredChange)=\"onItemHovered($event && item)\"\n >\n {{ item.day }}\n @if (\n item | tuiMapper: toMarkers : itemIsToday(item) : getItemRange(item) : markerHandler;\n as markers\n ) {\n <div class=\"t-dots\">\n <div\n class=\"t-dot\"\n [style.background]=\"markers?.[0]\"\n ></div>\n @if (markers.length > 1) {\n <div\n class=\"t-dot\"\n [style.background]=\"markers?.[1] || ''\"\n ></div>\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n</div>\n", styles: [".t-row{display:flex;justify-content:flex-start;font:var(--tui-font-body-m)}.t-row:last-child{justify-content:flex-start}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;line-height:2rem;isolation:isolate;cursor:pointer;overflow:hidden;border:.125rem solid transparent;box-sizing:border-box;mask:linear-gradient(transparent calc(50% - 1rem),#000 calc(50% - 1rem),#000 calc(50% + 1rem),transparent calc(50% + 1rem))}.t-cell:first-child{border-inline-start-color:transparent!important}.t-cell:last-child{border-inline-end-color:transparent!important}.t-cell:before,.t-cell:after{position:absolute;inset:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-cell:after{mask:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 32\"><path d=\"M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z\"></path></svg>') right / .75rem 100% no-repeat,linear-gradient(#000,#000) left / calc(100% - .7rem) 100% no-repeat}.t-cell[data-range]:before{background:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]:not(:first-child):before{border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=middle]:not(:last-child):before{border-top-right-radius:0;border-bottom-right-radius:0}.t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:not(:last-child):before{right:-1rem}.t-cell[data-range=start]:after{background:var(--tui-background-accent-1)}.t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{left:-1rem}.t-cell[data-range=end]:after{background:var(--tui-background-accent-1);transform:scaleX(-1)}.t-cell[data-range=active]{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range=active]:after{background:var(--tui-background-accent-1);mask:none}.t-cell_disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-cell_today{text-decoration:underline;text-underline-offset:.25rem}@media (hover: hover) and (pointer: fine){.t-cell:hover:not([data-range=start]):not([data-range=end]):before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:hover:after,.t-cell[data-range=end]:hover:after,.t-cell[data-range=active]:hover:after{background:var(--tui-background-accent-1-hover)}}.t-cell{inline-size:calc(100% / 7)}[data-type=weekday]{color:var(--tui-text-primary)}[data-type=weekend]{color:var(--tui-text-negative)}.t-row{justify-content:flex-start}.t-row:first-child{justify-content:flex-end}.t-row_weekday{font:var(--tui-font-body-s);color:var(--tui-text-secondary);pointer-events:none}.t-cell_unavailable{opacity:var(--tui-disabled-opacity)}.t-dots{position:absolute;bottom:0;display:flex;justify-content:center;margin-block-start:-.5rem;padding-block-end:.25rem}.t-dot{display:inline-block;inline-size:.25rem;block-size:.25rem;border-radius:100%;margin:0 .0625rem}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiCalendarSheetPipe, name: "tuiCalendarSheet" }, { kind: "directive", type: TuiHovered, selector: "[tuiHoveredChange]", outputs: ["tuiHoveredChange"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "pipe", type: TuiOrderWeekDaysPipe, name: "tuiOrderWeekDays" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
206
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarSheet, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
207
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: TuiCalendarSheet, isStandalone: true, selector: "tui-calendar-sheet", inputs: { month: { classPropertyName: "month", publicName: "month", isSignal: true, isRequired: false, transformFunction: null }, disabledItemHandler: { classPropertyName: "disabledItemHandler", publicName: "disabledItemHandler", isSignal: true, isRequired: false, transformFunction: null }, markerHandler: { classPropertyName: "markerHandler", publicName: "markerHandler", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, showAdjacent: { classPropertyName: "showAdjacent", publicName: "showAdjacent", isSignal: true, isRequired: false, transformFunction: null }, hoveredItem: { classPropertyName: "hoveredItem", publicName: "hoveredItem", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hoveredItem: "hoveredItemChange", dayClick: "dayClick" }, host: { properties: { "class._picking": "isRangePicking" } }, ngImport: i0, template: "<div class=\"t-row t-row_weekday\">\n @for (day of unorderedWeekDays$ | tuiOrderWeekDays | async; track day) {\n <div\n class=\"t-cell\"\n [textContent]=\"day\"\n ></div>\n }\n</div>\n@let sheet = month() | tuiCalendarSheet: true;\n<div>\n @for (_ of '-'.repeat(sheet.length); track $index) {\n @let rowIndex = $index;\n <div\n automation-id=\"tui-calendar-sheet__row\"\n class=\"t-row\"\n >\n @for (_ of '-'.repeat(sheet[rowIndex]?.length ?? 0); track $index) {\n @let item = sheet[rowIndex]?.[$index];\n @if (item && (!itemIsUnavailable(item) || showAdjacent())) {\n <div\n automation-id=\"tui-calendar-sheet__cell\"\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [attr.data-type]=\"item | tuiMapper: dayType\"\n [class.t-cell_disabled]=\"disabledItemHandler()(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n [class.t-cell_unavailable]=\"itemIsUnavailable(item)\"\n (click)=\"dayClick.emit(item)\"\n (tuiHoveredChange)=\"onItemHovered($event && item)\"\n >\n {{ item.day }}\n @if (\n item | tuiMapper: toMarkers : itemIsToday(item) : getItemRange(item) : markerHandler();\n as markers\n ) {\n <div class=\"t-dots\">\n <div\n class=\"t-dot\"\n [style.background]=\"markers?.[0]\"\n ></div>\n @if (markers.length > 1) {\n <div\n class=\"t-dot\"\n [style.background]=\"markers?.[1] || ''\"\n ></div>\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n</div>\n", styles: [".t-row{display:flex;justify-content:flex-start;font:var(--tui-typography-body-m)}.t-row:last-child{justify-content:flex-start}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;line-height:2rem;isolation:isolate;cursor:pointer;overflow:hidden;border:.125rem solid transparent;box-sizing:border-box;mask:linear-gradient(transparent calc(50% - 1rem),#000 calc(50% - 1rem),#000 calc(50% + 1rem),transparent calc(50% + 1rem))}.t-cell:first-child{border-inline-start-color:transparent!important}.t-cell:last-child{border-inline-end-color:transparent!important}.t-cell:before,.t-cell:after{position:absolute;inset-block-start:0;inset-inline-start:0;inset-block-end:0;inset-inline-end:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-cell:after{mask:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 32\"><path d=\"M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z\"></path></svg>') right / .75rem 100% no-repeat,linear-gradient(#000,#000) left / calc(100% - .7rem) 100% no-repeat}.t-cell[data-range]:before{background:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]:not(:first-child):before{border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=middle]:not(:last-child):before{border-top-right-radius:0;border-bottom-right-radius:0}.t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:not(:last-child):before{inset-inline-end:-1rem}.t-cell[data-range=start]:after{background:var(--tui-background-accent-1)}.t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{inset-inline-start:-1rem}.t-cell[data-range=end]:after{background:var(--tui-background-accent-1);transform:scaleX(-1)}.t-cell[data-range=active]{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range=active]:after{background:var(--tui-background-accent-1);mask:none}.t-cell_disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-cell_today{text-decoration:underline;text-underline-offset:.25rem}@media (hover: hover) and (pointer: fine){.t-cell:hover:not([data-range=start]):not([data-range=end]):before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:hover:after,.t-cell[data-range=end]:hover:after,.t-cell[data-range=active]:hover:after{background:var(--tui-background-accent-1-hover)}}.t-cell{inline-size:calc(100% / 7)}[data-type=weekday]{color:var(--tui-text-primary)}[data-type=weekend]{color:var(--tui-text-negative)}.t-row{justify-content:flex-start}.t-row:first-child{justify-content:flex-end}.t-row_weekday{font:var(--tui-typography-body-s);color:var(--tui-text-secondary);pointer-events:none}.t-cell_unavailable{opacity:var(--tui-disabled-opacity)}.t-dots{position:absolute;display:flex;inset-block-end:0;justify-content:center;margin-block-start:-.5rem;padding-block-end:.25rem}.t-dot{display:inline-block;inline-size:.25rem;block-size:.25rem;border-radius:100%;margin:0 .0625rem}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiCalendarSheetPipe, name: "tuiCalendarSheet" }, { kind: "directive", type: TuiHovered, selector: "[tuiHoveredChange]", outputs: ["tuiHoveredChange"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "pipe", type: TuiOrderWeekDaysPipe, name: "tuiOrderWeekDays" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
244
208
  }
245
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarSheet, decorators: [{
209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarSheet, decorators: [{
246
210
  type: Component,
247
211
  args: [{ selector: 'tui-calendar-sheet', imports: [
248
212
  AsyncPipe,
@@ -250,72 +214,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
250
214
  TuiHovered,
251
215
  TuiMapperPipe,
252
216
  TuiOrderWeekDaysPipe,
253
- ], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class._picking]': 'isRangePicking' }, template: "<div class=\"t-row t-row_weekday\">\n @for (day of unorderedWeekDays$ | tuiOrderWeekDays | async; track day) {\n <div\n class=\"t-cell\"\n [textContent]=\"day\"\n ></div>\n }\n</div>\n@let sheet = month | tuiCalendarSheet: true;\n<div>\n @for (_ of '-'.repeat(sheet.length); track $index) {\n @let rowIndex = $index;\n <div\n automation-id=\"tui-calendar-sheet__row\"\n class=\"t-row\"\n >\n @for (_ of '-'.repeat(sheet[rowIndex]?.length ?? 0); track $index) {\n @let item = sheet[rowIndex]?.[$index];\n @if (item && (!itemIsUnavailable(item) || showAdjacent)) {\n <div\n automation-id=\"tui-calendar-sheet__cell\"\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [attr.data-type]=\"item | tuiMapper: dayType\"\n [class.t-cell_disabled]=\"disabledItemHandler(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n [class.t-cell_unavailable]=\"itemIsUnavailable(item)\"\n (click)=\"onItemClick(item)\"\n (tuiHoveredChange)=\"onItemHovered($event && item)\"\n >\n {{ item.day }}\n @if (\n item | tuiMapper: toMarkers : itemIsToday(item) : getItemRange(item) : markerHandler;\n as markers\n ) {\n <div class=\"t-dots\">\n <div\n class=\"t-dot\"\n [style.background]=\"markers?.[0]\"\n ></div>\n @if (markers.length > 1) {\n <div\n class=\"t-dot\"\n [style.background]=\"markers?.[1] || ''\"\n ></div>\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n</div>\n", styles: [".t-row{display:flex;justify-content:flex-start;font:var(--tui-font-body-m)}.t-row:last-child{justify-content:flex-start}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;line-height:2rem;isolation:isolate;cursor:pointer;overflow:hidden;border:.125rem solid transparent;box-sizing:border-box;mask:linear-gradient(transparent calc(50% - 1rem),#000 calc(50% - 1rem),#000 calc(50% + 1rem),transparent calc(50% + 1rem))}.t-cell:first-child{border-inline-start-color:transparent!important}.t-cell:last-child{border-inline-end-color:transparent!important}.t-cell:before,.t-cell:after{position:absolute;inset:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-cell:after{mask:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 32\"><path d=\"M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z\"></path></svg>') right / .75rem 100% no-repeat,linear-gradient(#000,#000) left / calc(100% - .7rem) 100% no-repeat}.t-cell[data-range]:before{background:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]:not(:first-child):before{border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=middle]:not(:last-child):before{border-top-right-radius:0;border-bottom-right-radius:0}.t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:not(:last-child):before{right:-1rem}.t-cell[data-range=start]:after{background:var(--tui-background-accent-1)}.t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{left:-1rem}.t-cell[data-range=end]:after{background:var(--tui-background-accent-1);transform:scaleX(-1)}.t-cell[data-range=active]{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range=active]:after{background:var(--tui-background-accent-1);mask:none}.t-cell_disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-cell_today{text-decoration:underline;text-underline-offset:.25rem}@media (hover: hover) and (pointer: fine){.t-cell:hover:not([data-range=start]):not([data-range=end]):before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:hover:after,.t-cell[data-range=end]:hover:after,.t-cell[data-range=active]:hover:after{background:var(--tui-background-accent-1-hover)}}.t-cell{inline-size:calc(100% / 7)}[data-type=weekday]{color:var(--tui-text-primary)}[data-type=weekend]{color:var(--tui-text-negative)}.t-row{justify-content:flex-start}.t-row:first-child{justify-content:flex-end}.t-row_weekday{font:var(--tui-font-body-s);color:var(--tui-text-secondary);pointer-events:none}.t-cell_unavailable{opacity:var(--tui-disabled-opacity)}.t-dots{position:absolute;bottom:0;display:flex;justify-content:center;margin-block-start:-.5rem;padding-block-end:.25rem}.t-dot{display:inline-block;inline-size:.25rem;block-size:.25rem;border-radius:100%;margin:0 .0625rem}\n"] }]
254
- }], propDecorators: { month: [{
255
- type: Input
256
- }], disabledItemHandler: [{
257
- type: Input
258
- }], markerHandler: [{
259
- type: Input
260
- }], value: [{
261
- type: Input
262
- }], hoveredItem: [{
263
- type: Input
264
- }], showAdjacent: [{
265
- type: Input
266
- }], single: [{
267
- type: Input
268
- }], hoveredItemChange: [{
269
- type: Output
270
- }], dayClick: [{
271
- type: Output
272
- }] } });
217
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class._picking]': 'isRangePicking' }, template: "<div class=\"t-row t-row_weekday\">\n @for (day of unorderedWeekDays$ | tuiOrderWeekDays | async; track day) {\n <div\n class=\"t-cell\"\n [textContent]=\"day\"\n ></div>\n }\n</div>\n@let sheet = month() | tuiCalendarSheet: true;\n<div>\n @for (_ of '-'.repeat(sheet.length); track $index) {\n @let rowIndex = $index;\n <div\n automation-id=\"tui-calendar-sheet__row\"\n class=\"t-row\"\n >\n @for (_ of '-'.repeat(sheet[rowIndex]?.length ?? 0); track $index) {\n @let item = sheet[rowIndex]?.[$index];\n @if (item && (!itemIsUnavailable(item) || showAdjacent())) {\n <div\n automation-id=\"tui-calendar-sheet__cell\"\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [attr.data-type]=\"item | tuiMapper: dayType\"\n [class.t-cell_disabled]=\"disabledItemHandler()(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n [class.t-cell_unavailable]=\"itemIsUnavailable(item)\"\n (click)=\"dayClick.emit(item)\"\n (tuiHoveredChange)=\"onItemHovered($event && item)\"\n >\n {{ item.day }}\n @if (\n item | tuiMapper: toMarkers : itemIsToday(item) : getItemRange(item) : markerHandler();\n as markers\n ) {\n <div class=\"t-dots\">\n <div\n class=\"t-dot\"\n [style.background]=\"markers?.[0]\"\n ></div>\n @if (markers.length > 1) {\n <div\n class=\"t-dot\"\n [style.background]=\"markers?.[1] || ''\"\n ></div>\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n</div>\n", styles: [".t-row{display:flex;justify-content:flex-start;font:var(--tui-typography-body-m)}.t-row:last-child{justify-content:flex-start}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;line-height:2rem;isolation:isolate;cursor:pointer;overflow:hidden;border:.125rem solid transparent;box-sizing:border-box;mask:linear-gradient(transparent calc(50% - 1rem),#000 calc(50% - 1rem),#000 calc(50% + 1rem),transparent calc(50% + 1rem))}.t-cell:first-child{border-inline-start-color:transparent!important}.t-cell:last-child{border-inline-end-color:transparent!important}.t-cell:before,.t-cell:after{position:absolute;inset-block-start:0;inset-inline-start:0;inset-block-end:0;inset-inline-end:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-cell:after{mask:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 32\"><path d=\"M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z\"></path></svg>') right / .75rem 100% no-repeat,linear-gradient(#000,#000) left / calc(100% - .7rem) 100% no-repeat}.t-cell[data-range]:before{background:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]:not(:first-child):before{border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=middle]:not(:last-child):before{border-top-right-radius:0;border-bottom-right-radius:0}.t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:not(:last-child):before{inset-inline-end:-1rem}.t-cell[data-range=start]:after{background:var(--tui-background-accent-1)}.t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{inset-inline-start:-1rem}.t-cell[data-range=end]:after{background:var(--tui-background-accent-1);transform:scaleX(-1)}.t-cell[data-range=active]{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range=active]:after{background:var(--tui-background-accent-1);mask:none}.t-cell_disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-cell_today{text-decoration:underline;text-underline-offset:.25rem}@media (hover: hover) and (pointer: fine){.t-cell:hover:not([data-range=start]):not([data-range=end]):before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:hover:after,.t-cell[data-range=end]:hover:after,.t-cell[data-range=active]:hover:after{background:var(--tui-background-accent-1-hover)}}.t-cell{inline-size:calc(100% / 7)}[data-type=weekday]{color:var(--tui-text-primary)}[data-type=weekend]{color:var(--tui-text-negative)}.t-row{justify-content:flex-start}.t-row:first-child{justify-content:flex-end}.t-row_weekday{font:var(--tui-typography-body-s);color:var(--tui-text-secondary);pointer-events:none}.t-cell_unavailable{opacity:var(--tui-disabled-opacity)}.t-dots{position:absolute;display:flex;inset-block-end:0;justify-content:center;margin-block-start:-.5rem;padding-block-end:.25rem}.t-dot{display:inline-block;inline-size:.25rem;block-size:.25rem;border-radius:100%;margin:0 .0625rem}\n"] }]
218
+ }] });
273
219
 
274
220
  class TuiCalendarSpin {
275
221
  constructor() {
276
222
  this.months = inject(TUI_MONTHS);
277
- this.value = TuiMonth.currentLocal();
278
- this.min = TUI_FIRST_DAY;
279
- this.max = TUI_LAST_DAY;
280
- this.valueChange = new EventEmitter();
281
- this.yearClick = new EventEmitter();
282
- }
283
- onYearClick() {
284
- this.yearClick.next(this.value);
223
+ this.value = model(TuiMonth.currentLocal());
224
+ this.min = input(TUI_FIRST_DAY);
225
+ this.max = input(TUI_LAST_DAY);
226
+ this.yearClick = output();
285
227
  }
286
228
  append(date) {
287
- const value = this.value.append(date);
288
- if (this.min.monthSameOrAfter(value)) {
289
- this.updateValue(this.min);
229
+ const value = this.value().append(date);
230
+ const min = this.min();
231
+ const max = this.max();
232
+ if (min.monthSameOrAfter(value)) {
233
+ this.updateValue(min);
290
234
  }
291
235
  else {
292
- this.updateValue(this.max.monthSameOrBefore(value) ? this.max : value);
236
+ this.updateValue(max.monthSameOrBefore(value) ? max : value);
293
237
  }
294
238
  }
295
239
  updateValue(value) {
296
- if (this.value.monthSame(value)) {
240
+ if (this.value().monthSame(value)) {
297
241
  return;
298
242
  }
299
- this.value = value;
300
- this.valueChange.emit(value);
243
+ this.value.set(value);
301
244
  }
302
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarSpin, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
303
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: TuiCalendarSpin, isStandalone: true, selector: "tui-calendar-spin", inputs: { value: "value", min: "min", max: "max" }, outputs: { valueChange: "valueChange", yearClick: "yearClick" }, ngImport: i0, template: "<tui-spin-button\n [focusable]=\"false\"\n [leftDisabled]=\"value.monthSameOrBefore(min)\"\n [rightDisabled]=\"value.monthSameOrAfter(max)\"\n (leftClick)=\"append({month: -1})\"\n (rightClick)=\"append({month: 1})\"\n>\n {{ months()[value.month] }}\n @if (min.year === max.year) {\n {{ value.formattedYear }}\n } @else {\n <button\n tabIndex=\"-1\"\n tuiLink\n type=\"button\"\n (click)=\"onYearClick()\"\n >\n {{ value.formattedYear }}\n </button>\n }\n</tui-spin-button>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: TuiSpinButton, selector: "tui-spin-button", inputs: ["focusable", "disabled", "leftDisabled", "rightDisabled"], outputs: ["leftClick", "rightClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
245
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarSpin, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
246
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: TuiCalendarSpin, isStandalone: true, selector: "tui-calendar-spin", inputs: { value: { classPropertyName: "value", publicName: "value", 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 } }, outputs: { value: "valueChange", yearClick: "yearClick" }, ngImport: i0, template: "<tui-spin-button\n [focusable]=\"false\"\n [leftDisabled]=\"value().monthSameOrBefore(min())\"\n [rightDisabled]=\"value().monthSameOrAfter(max())\"\n (leftClick)=\"append({month: -1})\"\n (rightClick)=\"append({month: 1})\"\n>\n {{ months()[value().month] }}\n @if (min().year === max().year) {\n {{ value().formattedYear }}\n } @else {\n <button\n tabIndex=\"-1\"\n tuiLink\n type=\"button\"\n (click)=\"yearClick.emit(value())\"\n >\n {{ value().formattedYear }}\n </button>\n }\n</tui-spin-button>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: TuiSpinButton, selector: "tui-spin-button", inputs: ["focusable", "disabled", "leftDisabled", "rightDisabled"], outputs: ["leftClick", "rightClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
304
247
  }
305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarSpin, decorators: [{
248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarSpin, decorators: [{
306
249
  type: Component,
307
- args: [{ selector: 'tui-calendar-spin', imports: [TuiLink, TuiSpinButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "<tui-spin-button\n [focusable]=\"false\"\n [leftDisabled]=\"value.monthSameOrBefore(min)\"\n [rightDisabled]=\"value.monthSameOrAfter(max)\"\n (leftClick)=\"append({month: -1})\"\n (rightClick)=\"append({month: 1})\"\n>\n {{ months()[value.month] }}\n @if (min.year === max.year) {\n {{ value.formattedYear }}\n } @else {\n <button\n tabIndex=\"-1\"\n tuiLink\n type=\"button\"\n (click)=\"onYearClick()\"\n >\n {{ value.formattedYear }}\n </button>\n }\n</tui-spin-button>\n", styles: [":host{display:block}\n"] }]
308
- }], propDecorators: { value: [{
309
- type: Input
310
- }], min: [{
311
- type: Input
312
- }], max: [{
313
- type: Input
314
- }], valueChange: [{
315
- type: Output
316
- }], yearClick: [{
317
- type: Output
318
- }] } });
250
+ args: [{ selector: 'tui-calendar-spin', imports: [TuiLink, TuiSpinButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "<tui-spin-button\n [focusable]=\"false\"\n [leftDisabled]=\"value().monthSameOrBefore(min())\"\n [rightDisabled]=\"value().monthSameOrAfter(max())\"\n (leftClick)=\"append({month: -1})\"\n (rightClick)=\"append({month: 1})\"\n>\n {{ months()[value().month] }}\n @if (min().year === max().year) {\n {{ value().formattedYear }}\n } @else {\n <button\n tabIndex=\"-1\"\n tuiLink\n type=\"button\"\n (click)=\"yearClick.emit(value())\"\n >\n {{ value().formattedYear }}\n </button>\n }\n</tui-spin-button>\n", styles: [":host{display:block}\n"] }]
251
+ }] });
319
252
 
320
253
  const LIMIT = 100;
321
254
  const ITEMS_IN_ROW = 4;
@@ -323,35 +256,36 @@ const CURRENT_YEAR = TuiMonth.currentLocal().year;
323
256
  class TuiCalendarYear {
324
257
  constructor() {
325
258
  this.hoveredItem = signal(null);
326
- this.isRangePicking = computed((x = this.value()) => this.rangeMode && (x instanceof TuiDay || x instanceof TuiMonth));
327
- this.rangeMode = false;
328
- this.disabledItemHandler = inject(TUI_ITEMS_HANDLERS).disabledItemHandler();
329
- this.yearClick = new EventEmitter();
330
- this.initialItem = signal(CURRENT_YEAR);
331
- this.min = signal(MIN_YEAR);
332
- this.max = signal(MAX_YEAR);
333
- this.value = signal(null);
334
- }
335
- // TODO(v5): use signal inputs
336
- set initialItemSetter(x) {
337
- this.initialItem.set(x ?? CURRENT_YEAR);
338
- }
339
- // TODO(v5): use signal inputs
340
- set minSetter(x) {
341
- this.min.set(x);
342
- }
343
- // TODO(v5): use signal inputs
344
- set maxSetter(x) {
345
- this.max.set(x);
346
- }
347
- // TODO(v5): use signal inputs
348
- set valueSetter(x) {
349
- this.value.set(x);
259
+ this.calculatedMin = computed(() => {
260
+ const initial = this.initialItem() - LIMIT;
261
+ const min = this.min() ?? MIN_YEAR;
262
+ return min > initial ? min : initial;
263
+ });
264
+ this.calculatedMax = computed(() => {
265
+ const initial = this.initialItem() + LIMIT;
266
+ const max = this.max() ?? MAX_YEAR;
267
+ return max < initial ? max + 1 : initial;
268
+ });
269
+ this.isRangePicking = computed((x = this.value()) => this.rangeMode() && (x instanceof TuiDay || x instanceof TuiMonth));
270
+ this.rows = computed(() => Math.ceil((this.calculatedMax() - this.calculatedMin()) / ITEMS_IN_ROW));
271
+ this.rangeMode = input(false);
272
+ this.disabledItemHandler = input(inject(TUI_ITEMS_HANDLERS).disabledItemHandler());
273
+ this.value = input(null);
274
+ this.min = input(MIN_YEAR, {
275
+ transform: (x) => x ?? MIN_YEAR,
276
+ });
277
+ this.max = input(MAX_YEAR, {
278
+ transform: (x) => x ?? MAX_YEAR,
279
+ });
280
+ this.initialItem = input(CURRENT_YEAR, {
281
+ transform: (x) => x ?? CURRENT_YEAR,
282
+ });
283
+ this.yearClick = output();
350
284
  }
351
285
  isDisabled(item) {
352
286
  return ((this.max() && this.max() < item) ||
353
287
  (this.min() && this.min() > item) ||
354
- this.disabledItemHandler(item));
288
+ this.disabledItemHandler()(item));
355
289
  }
356
290
  getItemRange(item) {
357
291
  const value = this.value();
@@ -384,145 +318,93 @@ class TuiCalendarYear {
384
318
  onItemHovered(hovered, item) {
385
319
  this.hoveredItem.set(hovered ? item : null);
386
320
  }
387
- get rows() {
388
- return Math.ceil((this.calculatedMax - this.calculatedMin) / ITEMS_IN_ROW);
389
- }
390
321
  scrollItemIntoView(item) {
391
322
  return this.initialItem() === item;
392
323
  }
393
324
  getItem(rowIndex, colIndex) {
394
- return rowIndex * ITEMS_IN_ROW + colIndex + this.calculatedMin;
325
+ return rowIndex * ITEMS_IN_ROW + colIndex + this.calculatedMin();
395
326
  }
396
327
  itemIsToday(item) {
397
328
  return CURRENT_YEAR === item;
398
329
  }
399
- get calculatedMin() {
400
- const initial = this.initialItem() - LIMIT;
401
- const min = this.min() ?? MIN_YEAR;
402
- return min > initial ? min : initial;
403
- }
404
- get calculatedMax() {
405
- const initial = this.initialItem() + LIMIT;
406
- const max = this.max() ?? MAX_YEAR;
407
- return max < initial ? max + 1 : initial;
408
- }
409
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarYear, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
410
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: TuiCalendarYear, isStandalone: true, selector: "tui-calendar-year", inputs: { rangeMode: "rangeMode", disabledItemHandler: "disabledItemHandler", initialItemSetter: ["initialItem", "initialItemSetter", (x) => x ?? CURRENT_YEAR], minSetter: ["min", "minSetter", (x) => x ?? MIN_YEAR], maxSetter: ["max", "maxSetter", (x) => x ?? MAX_YEAR], valueSetter: ["value", "valueSetter"] }, outputs: { yearClick: "yearClick" }, host: { properties: { "class._picking": "isRangePicking()" } }, providers: [tuiAsAuxiliary(TuiCalendarYear)], ngImport: i0, template: "@for (_ of '-'.repeat(rows); track $index) {\n @let rowIndex = $index;\n <div\n automation-id=\"tui-calendar-year__row\"\n class=\"t-row\"\n >\n @for (_ of '-'.repeat(4); track $index) {\n @let item = getItem(rowIndex, $index);\n <div\n automation-id=\"tui-calendar-year__cell\"\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [class.t-cell_disabled]=\"isDisabled(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n [tuiScrollIntoView]=\"scrollItemIntoView(item)\"\n (click)=\"yearClick.emit(item)\"\n (tuiHoveredChange)=\"onItemHovered($event, item)\"\n >\n {{ item }}\n </div>\n }\n </div>\n}\n", styles: [".t-row{display:flex;justify-content:flex-start;font:var(--tui-font-body-m)}.t-row:first-child{justify-content:flex-end}.t-row:last-child{justify-content:flex-start}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;line-height:2rem;isolation:isolate;cursor:pointer;overflow:hidden;border:.125rem solid transparent;box-sizing:border-box;mask:linear-gradient(transparent calc(50% - 1rem),#000 calc(50% - 1rem),#000 calc(50% + 1rem),transparent calc(50% + 1rem))}.t-cell:first-child{border-inline-start-color:transparent!important}.t-cell:last-child{border-inline-end-color:transparent!important}.t-cell:before,.t-cell:after{position:absolute;inset:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-cell:after{mask:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 32\"><path d=\"M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z\"></path></svg>') right / .75rem 100% no-repeat,linear-gradient(#000,#000) left / calc(100% - .7rem) 100% no-repeat}.t-cell[data-range]:before{background:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]:not(:first-child):before{border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=middle]:not(:last-child):before{border-top-right-radius:0;border-bottom-right-radius:0}.t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:not(:last-child):before{right:-1rem}.t-cell[data-range=start]:after{background:var(--tui-background-accent-1)}.t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{left:-1rem}.t-cell[data-range=end]:after{background:var(--tui-background-accent-1);transform:scaleX(-1)}.t-cell[data-range=active]{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range=active]:after{background:var(--tui-background-accent-1);mask:none}.t-cell_disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-cell_today{text-decoration:underline;text-underline-offset:.25rem}@media (hover: hover) and (pointer: fine){.t-cell:hover:not([data-range=start]):not([data-range=end]):before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:hover:after,.t-cell[data-range=end]:hover:after,.t-cell[data-range=active]:hover:after{background:var(--tui-background-accent-1-hover)}}:host{display:block;padding-inline-end:1rem;inline-size:15.75rem;padding:0 1.125rem}.t-cell{flex:1;border-block-start-width:.5rem;border-block-end-width:.5rem}\n"], dependencies: [{ kind: "directive", type: TuiHovered, selector: "[tuiHoveredChange]", outputs: ["tuiHoveredChange"] }, { kind: "directive", type: TuiScrollIntoView, selector: "[tuiScrollIntoView]", inputs: ["tuiScrollIntoView"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
330
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarYear, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
331
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: TuiCalendarYear, isStandalone: true, selector: "tui-calendar-year", inputs: { rangeMode: { classPropertyName: "rangeMode", publicName: "rangeMode", 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 }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, initialItem: { classPropertyName: "initialItem", publicName: "initialItem", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { yearClick: "yearClick" }, host: { properties: { "class._picking": "isRangePicking()" } }, providers: [tuiAsAuxiliary(TuiCalendarYear)], ngImport: i0, template: "@for (_ of '-'.repeat(rows()); track $index) {\n @let rowIndex = $index;\n <div\n automation-id=\"tui-calendar-year__row\"\n class=\"t-row\"\n >\n @for (_ of '-'.repeat(4); track $index) {\n @let item = getItem(rowIndex, $index);\n <div\n automation-id=\"tui-calendar-year__cell\"\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [class.t-cell_disabled]=\"isDisabled(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n [tuiScrollIntoView]=\"scrollItemIntoView(item)\"\n (click)=\"yearClick.emit(item)\"\n (tuiHoveredChange)=\"onItemHovered($event, item)\"\n >\n {{ item }}\n </div>\n }\n </div>\n}\n", styles: [".t-row{display:flex;justify-content:flex-start;font:var(--tui-typography-body-m)}.t-row:first-child{justify-content:flex-end}.t-row:last-child{justify-content:flex-start}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;line-height:2rem;isolation:isolate;cursor:pointer;overflow:hidden;border:.125rem solid transparent;box-sizing:border-box;mask:linear-gradient(transparent calc(50% - 1rem),#000 calc(50% - 1rem),#000 calc(50% + 1rem),transparent calc(50% + 1rem))}.t-cell:first-child{border-inline-start-color:transparent!important}.t-cell:last-child{border-inline-end-color:transparent!important}.t-cell:before,.t-cell:after{position:absolute;inset-block-start:0;inset-inline-start:0;inset-block-end:0;inset-inline-end:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-cell:after{mask:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 32\"><path d=\"M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z\"></path></svg>') right / .75rem 100% no-repeat,linear-gradient(#000,#000) left / calc(100% - .7rem) 100% no-repeat}.t-cell[data-range]:before{background:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]:not(:first-child):before{border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=middle]:not(:last-child):before{border-top-right-radius:0;border-bottom-right-radius:0}.t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:not(:last-child):before{inset-inline-end:-1rem}.t-cell[data-range=start]:after{background:var(--tui-background-accent-1)}.t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{inset-inline-start:-1rem}.t-cell[data-range=end]:after{background:var(--tui-background-accent-1);transform:scaleX(-1)}.t-cell[data-range=active]{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range=active]:after{background:var(--tui-background-accent-1);mask:none}.t-cell_disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-cell_today{text-decoration:underline;text-underline-offset:.25rem}@media (hover: hover) and (pointer: fine){.t-cell:hover:not([data-range=start]):not([data-range=end]):before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:hover:after,.t-cell[data-range=end]:hover:after,.t-cell[data-range=active]:hover:after{background:var(--tui-background-accent-1-hover)}}:host{display:block;padding-inline-end:1rem;inline-size:15.75rem;padding:0 1.125rem}.t-cell{flex:1;border-block-start-width:.5rem;border-block-end-width:.5rem}\n"], dependencies: [{ kind: "directive", type: TuiHovered, selector: "[tuiHoveredChange]", outputs: ["tuiHoveredChange"] }, { kind: "directive", type: TuiScrollIntoView, selector: "[tuiScrollIntoView]", inputs: ["tuiScrollIntoView"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
411
332
  }
412
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarYear, decorators: [{
333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarYear, decorators: [{
413
334
  type: Component,
414
- args: [{ selector: 'tui-calendar-year', imports: [TuiHovered, TuiScrollIntoView], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsAuxiliary(TuiCalendarYear)], host: { '[class._picking]': 'isRangePicking()' }, template: "@for (_ of '-'.repeat(rows); track $index) {\n @let rowIndex = $index;\n <div\n automation-id=\"tui-calendar-year__row\"\n class=\"t-row\"\n >\n @for (_ of '-'.repeat(4); track $index) {\n @let item = getItem(rowIndex, $index);\n <div\n automation-id=\"tui-calendar-year__cell\"\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [class.t-cell_disabled]=\"isDisabled(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n [tuiScrollIntoView]=\"scrollItemIntoView(item)\"\n (click)=\"yearClick.emit(item)\"\n (tuiHoveredChange)=\"onItemHovered($event, item)\"\n >\n {{ item }}\n </div>\n }\n </div>\n}\n", styles: [".t-row{display:flex;justify-content:flex-start;font:var(--tui-font-body-m)}.t-row:first-child{justify-content:flex-end}.t-row:last-child{justify-content:flex-start}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;line-height:2rem;isolation:isolate;cursor:pointer;overflow:hidden;border:.125rem solid transparent;box-sizing:border-box;mask:linear-gradient(transparent calc(50% - 1rem),#000 calc(50% - 1rem),#000 calc(50% + 1rem),transparent calc(50% + 1rem))}.t-cell:first-child{border-inline-start-color:transparent!important}.t-cell:last-child{border-inline-end-color:transparent!important}.t-cell:before,.t-cell:after{position:absolute;inset:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-cell:after{mask:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 32\"><path d=\"M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z\"></path></svg>') right / .75rem 100% no-repeat,linear-gradient(#000,#000) left / calc(100% - .7rem) 100% no-repeat}.t-cell[data-range]:before{background:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]:not(:first-child):before{border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=middle]:not(:last-child):before{border-top-right-radius:0;border-bottom-right-radius:0}.t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:not(:last-child):before{right:-1rem}.t-cell[data-range=start]:after{background:var(--tui-background-accent-1)}.t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{left:-1rem}.t-cell[data-range=end]:after{background:var(--tui-background-accent-1);transform:scaleX(-1)}.t-cell[data-range=active]{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range=active]:after{background:var(--tui-background-accent-1);mask:none}.t-cell_disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-cell_today{text-decoration:underline;text-underline-offset:.25rem}@media (hover: hover) and (pointer: fine){.t-cell:hover:not([data-range=start]):not([data-range=end]):before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:hover:after,.t-cell[data-range=end]:hover:after,.t-cell[data-range=active]:hover:after{background:var(--tui-background-accent-1-hover)}}:host{display:block;padding-inline-end:1rem;inline-size:15.75rem;padding:0 1.125rem}.t-cell{flex:1;border-block-start-width:.5rem;border-block-end-width:.5rem}\n"] }]
415
- }], propDecorators: { rangeMode: [{
416
- type: Input
417
- }], disabledItemHandler: [{
418
- type: Input
419
- }], yearClick: [{
420
- type: Output
421
- }], initialItemSetter: [{
422
- type: Input,
423
- args: [{ alias: 'initialItem', transform: (x) => x ?? CURRENT_YEAR }]
424
- }], minSetter: [{
425
- type: Input,
426
- args: [{ alias: 'min', transform: (x) => x ?? MIN_YEAR }]
427
- }], maxSetter: [{
428
- type: Input,
429
- args: [{ alias: 'max', transform: (x) => x ?? MAX_YEAR }]
430
- }], valueSetter: [{
431
- type: Input,
432
- args: ['value']
433
- }] } });
335
+ args: [{ selector: 'tui-calendar-year', imports: [TuiHovered, TuiScrollIntoView], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsAuxiliary(TuiCalendarYear)], host: { '[class._picking]': 'isRangePicking()' }, template: "@for (_ of '-'.repeat(rows()); track $index) {\n @let rowIndex = $index;\n <div\n automation-id=\"tui-calendar-year__row\"\n class=\"t-row\"\n >\n @for (_ of '-'.repeat(4); track $index) {\n @let item = getItem(rowIndex, $index);\n <div\n automation-id=\"tui-calendar-year__cell\"\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [class.t-cell_disabled]=\"isDisabled(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n [tuiScrollIntoView]=\"scrollItemIntoView(item)\"\n (click)=\"yearClick.emit(item)\"\n (tuiHoveredChange)=\"onItemHovered($event, item)\"\n >\n {{ item }}\n </div>\n }\n </div>\n}\n", styles: [".t-row{display:flex;justify-content:flex-start;font:var(--tui-typography-body-m)}.t-row:first-child{justify-content:flex-end}.t-row:last-child{justify-content:flex-start}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;line-height:2rem;isolation:isolate;cursor:pointer;overflow:hidden;border:.125rem solid transparent;box-sizing:border-box;mask:linear-gradient(transparent calc(50% - 1rem),#000 calc(50% - 1rem),#000 calc(50% + 1rem),transparent calc(50% + 1rem))}.t-cell:first-child{border-inline-start-color:transparent!important}.t-cell:last-child{border-inline-end-color:transparent!important}.t-cell:before,.t-cell:after{position:absolute;inset-block-start:0;inset-inline-start:0;inset-block-end:0;inset-inline-end:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-cell:after{mask:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 32\"><path d=\"M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z\"></path></svg>') right / .75rem 100% no-repeat,linear-gradient(#000,#000) left / calc(100% - .7rem) 100% no-repeat}.t-cell[data-range]:before{background:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1)}:host._picking .t-cell[data-range=middle]{border-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=middle]:not(:first-child):before{border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=middle]:not(:last-child):before{border-top-right-radius:0;border-bottom-right-radius:0}.t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=start]{border-inline-end-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:not(:last-child):before{inset-inline-end:-1rem}.t-cell[data-range=start]:after{background:var(--tui-background-accent-1)}.t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1);color:var(--tui-text-primary-on-accent-1)}:host._picking .t-cell[data-range=end]{border-inline-start-color:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{inset-inline-start:-1rem}.t-cell[data-range=end]:after{background:var(--tui-background-accent-1);transform:scaleX(-1)}.t-cell[data-range=active]{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range=active]:after{background:var(--tui-background-accent-1);mask:none}.t-cell_disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-cell_today{text-decoration:underline;text-underline-offset:.25rem}@media (hover: hover) and (pointer: fine){.t-cell:hover:not([data-range=start]):not([data-range=end]):before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=start]:hover:after,.t-cell[data-range=end]:hover:after,.t-cell[data-range=active]:hover:after{background:var(--tui-background-accent-1-hover)}}:host{display:block;padding-inline-end:1rem;inline-size:15.75rem;padding:0 1.125rem}.t-cell{flex:1;border-block-start-width:.5rem;border-block-end-width:.5rem}\n"] }]
336
+ }] });
434
337
 
435
338
  class TuiCalendar {
436
339
  constructor() {
437
- this.cdr = inject(ChangeDetectorRef);
438
- this.day = null;
439
- this.view = 'month';
440
340
  this.options = inject(TUI_CALENDAR_SHEET_OPTIONS);
441
- this.month = TuiMonth.currentLocal();
442
- this.disabledItemHandler = inject(TUI_ITEMS_HANDLERS).disabledItemHandler();
443
- this.min = TUI_FIRST_DAY;
444
- this.max = TUI_LAST_DAY;
445
- this.minViewedMonth = TUI_FIRST_DAY;
446
- this.maxViewedMonth = TUI_LAST_DAY;
447
- this.hoveredItem = null;
448
- this.showAdjacent = true;
449
- this.markerHandler = null;
450
- this.dayClick = new EventEmitter();
451
- this.monthChange = new EventEmitter();
452
- this.hoveredItemChange = new EventEmitter();
453
- /** @deprecated for private use only until Calendars are refactored */
454
- this.valueChange = new Subject();
341
+ this.disabledItemHandler = input(inject(TUI_ITEMS_HANDLERS).disabledItemHandler());
342
+ this.min = input(TUI_FIRST_DAY, {
343
+ transform: (x) => x ?? TUI_FIRST_DAY,
344
+ });
345
+ this.max = input(TUI_LAST_DAY, {
346
+ transform: (x) => x ?? TUI_LAST_DAY,
347
+ });
348
+ this.minViewedMonth = input(TUI_FIRST_DAY);
349
+ this.maxViewedMonth = input(TUI_LAST_DAY);
350
+ this.showAdjacent = input(true);
351
+ this.markerHandler = input(null);
352
+ this.initialView = input('month');
353
+ this.month = model(TuiMonth.currentLocal());
354
+ this.hoveredItem = model(null);
355
+ this.value = model(null);
356
+ this.dayClick = output();
357
+ this.computedMinViewedMonth = computed(() => {
358
+ const min = this.min();
359
+ const minViewed = this.minViewedMonth() ?? TUI_FIRST_DAY;
360
+ return minViewed.monthSameOrAfter(min) ? minViewed : min;
361
+ });
362
+ this.computedMaxViewedMonth = computed(() => {
363
+ const max = this.max();
364
+ const maxViewed = this.maxViewedMonth() ?? TUI_LAST_DAY;
365
+ return maxViewed.monthSameOrBefore(max) ? maxViewed : max;
366
+ });
367
+ this.view = linkedSignal(() => this.initialView());
368
+ this.syncMonthFromValue = effect(() => {
369
+ const value = this.value();
370
+ if (this.showAdjacent() &&
371
+ value instanceof TuiDay &&
372
+ value.daySameOrBefore(TUI_LAST_DISPLAYED_DAY)) {
373
+ this.month.set(value);
374
+ }
375
+ });
455
376
  this.disabledItemHandlerMapper = (disabledItemHandler, min, max) => (item) => item.dayBefore(min) || item.dayAfter(max) || disabledItemHandler(item);
456
377
  }
457
- set value(value) {
458
- this.cdr.markForCheck();
459
- this.day = value;
460
- if (this.showAdjacent &&
461
- value instanceof TuiDay &&
462
- value.daySameOrBefore(TUI_LAST_DISPLAYED_DAY)) {
463
- this.month = value;
464
- }
465
- }
466
- set initialView(view) {
467
- this.view = view;
468
- }
469
- get value() {
470
- return this.day;
471
- }
472
378
  onPaginationValueChange(month) {
473
379
  this.updateViewedMonth(month);
474
380
  }
475
381
  onDayClick(day) {
476
382
  this.dayClick.emit(day);
477
- this.valueChange.next(day);
383
+ this.value.set(day);
478
384
  }
479
385
  onHoveredItemChange(day) {
480
386
  this.updateHoveredDay(day);
481
387
  }
482
- get computedMin() {
483
- return this.min ?? TUI_FIRST_DAY;
484
- }
485
- get computedMax() {
486
- return this.max ?? TUI_LAST_DAY;
487
- }
488
- get computedMinViewedMonth() {
489
- const min = this.computedMin;
490
- const minViewed = this.minViewedMonth ?? TUI_FIRST_DAY;
491
- return minViewed.monthSameOrAfter(min) ? minViewed : min;
492
- }
493
- get computedMaxViewedMonth() {
494
- const max = this.computedMax;
495
- const maxViewed = this.maxViewedMonth ?? TUI_LAST_DAY;
496
- return maxViewed.monthSameOrBefore(max) ? maxViewed : max;
497
- }
498
- get isInYearView() {
499
- return this.view === 'year';
500
- }
501
- onPaginationYearClick() {
502
- this.view = 'year';
503
- }
504
388
  onPickerYearClick(year) {
505
- this.view = 'month';
506
- this.updateViewedMonth(new TuiMonth(year, this.month.month));
389
+ this.view.set('month');
390
+ this.updateViewedMonth(new TuiMonth(year, this.month().month));
507
391
  }
508
392
  updateViewedMonth(month) {
509
- if (this.month.monthSame(month)) {
393
+ if (this.month().monthSame(month)) {
510
394
  return;
511
395
  }
512
- this.month = month;
513
- this.monthChange.emit(month);
396
+ this.month.set(month);
514
397
  }
515
398
  updateHoveredDay(day) {
516
- if (tuiNullableSame(this.hoveredItem, day, (a, b) => a.daySame(b))) {
399
+ if (tuiNullableSame(this.hoveredItem(), day, (a, b) => a.daySame(b))) {
517
400
  return;
518
401
  }
519
- this.hoveredItem = day;
520
- this.hoveredItemChange.emit(day);
402
+ this.hoveredItem.set(day);
521
403
  }
522
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
523
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: TuiCalendar, isStandalone: true, selector: "tui-calendar", inputs: { month: "month", disabledItemHandler: "disabledItemHandler", min: "min", max: "max", minViewedMonth: "minViewedMonth", maxViewedMonth: "maxViewedMonth", hoveredItem: "hoveredItem", showAdjacent: "showAdjacent", markerHandler: "markerHandler", value: "value", initialView: "initialView" }, outputs: { dayClick: "dayClick", monthChange: "monthChange", hoveredItemChange: "hoveredItemChange" }, host: { listeners: { "pointerdown.prevent.zoneless": "0" } }, providers: [tuiAsAuxiliary(TuiCalendar)], ngImport: i0, template: "@if (isInYearView) {\n <tui-scrollbar\n automation-id=\"tui-calendar__scrollbar\"\n class=\"t-scrollbar\"\n >\n <tui-calendar-year\n automation-id=\"tui-calendar__year\"\n [initialItem]=\"month.year\"\n [max]=\"computedMax.year\"\n [min]=\"computedMin.year\"\n [rangeMode]=\"options.rangeMode\"\n [value]=\"value\"\n (yearClick)=\"onPickerYearClick($event)\"\n />\n </tui-scrollbar>\n} @else {\n <tui-calendar-spin\n automation-id=\"tui-calendar__pagination\"\n class=\"t-pagination\"\n [max]=\"computedMaxViewedMonth\"\n [min]=\"computedMinViewedMonth\"\n [value]=\"month\"\n (valueChange)=\"onPaginationValueChange($event)\"\n (yearClick)=\"onPaginationYearClick()\"\n />\n <tui-calendar-sheet\n automation-id=\"tui-calendar__calendar\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper : computedMin : computedMax\"\n [hoveredItem]=\"hoveredItem\"\n [markerHandler]=\"markerHandler\"\n [month]=\"month\"\n [showAdjacent]=\"showAdjacent\"\n [value]=\"value\"\n (dayClick)=\"onDayClick($event)\"\n (hoveredItemChange)=\"onHoveredItemChange($event)\"\n />\n}\n", styles: [":host{display:block;min-block-size:20.25rem;inline-size:18rem;padding:1rem 1.125rem;box-sizing:border-box;flex-shrink:0}:host-context(tui-sheet-dialog){inline-size:100%}tui-calendar-year{padding:0}.t-scrollbar{block-size:18.25rem;inline-size:calc(100% + 1rem)}.t-pagination{margin-block-end:1rem}\n"], dependencies: [{ kind: "component", type: TuiCalendarSheet, selector: "tui-calendar-sheet", inputs: ["month", "disabledItemHandler", "markerHandler", "value", "hoveredItem", "showAdjacent", "single"], outputs: ["hoveredItemChange", "dayClick"] }, { kind: "component", type: TuiCalendarSpin, selector: "tui-calendar-spin", inputs: ["value", "min", "max"], outputs: ["valueChange", "yearClick"] }, { kind: "component", type: TuiCalendarYear, selector: "tui-calendar-year", inputs: ["rangeMode", "disabledItemHandler", "initialItem", "min", "max", "value"], outputs: ["yearClick"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "component", type: TuiScrollbar, selector: "tui-scrollbar" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
404
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
405
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: TuiCalendar, isStandalone: true, selector: "tui-calendar", inputs: { disabledItemHandler: { classPropertyName: "disabledItemHandler", publicName: "disabledItemHandler", 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 }, minViewedMonth: { classPropertyName: "minViewedMonth", publicName: "minViewedMonth", isSignal: true, isRequired: false, transformFunction: null }, maxViewedMonth: { classPropertyName: "maxViewedMonth", publicName: "maxViewedMonth", isSignal: true, isRequired: false, transformFunction: null }, showAdjacent: { classPropertyName: "showAdjacent", publicName: "showAdjacent", isSignal: true, isRequired: false, transformFunction: null }, markerHandler: { classPropertyName: "markerHandler", publicName: "markerHandler", isSignal: true, isRequired: false, transformFunction: null }, initialView: { classPropertyName: "initialView", publicName: "initialView", isSignal: true, isRequired: false, transformFunction: null }, month: { classPropertyName: "month", publicName: "month", isSignal: true, isRequired: false, transformFunction: null }, hoveredItem: { classPropertyName: "hoveredItem", publicName: "hoveredItem", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { month: "monthChange", hoveredItem: "hoveredItemChange", value: "valueChange", dayClick: "dayClick" }, host: { listeners: { "pointerdown.prevent.zoneless": "0" } }, providers: [tuiAsAuxiliary(TuiCalendar)], ngImport: i0, template: "@if (view() === 'year') {\n <tui-scrollbar\n automation-id=\"tui-calendar__scrollbar\"\n class=\"t-scrollbar\"\n >\n <tui-calendar-year\n automation-id=\"tui-calendar__year\"\n [initialItem]=\"month().year\"\n [max]=\"max().year\"\n [min]=\"min().year\"\n [rangeMode]=\"options.rangeMode\"\n [value]=\"value()\"\n (yearClick)=\"onPickerYearClick($event)\"\n />\n </tui-scrollbar>\n} @else {\n <tui-calendar-spin\n automation-id=\"tui-calendar__pagination\"\n class=\"t-pagination\"\n [max]=\"computedMaxViewedMonth()\"\n [min]=\"computedMinViewedMonth()\"\n [value]=\"month()\"\n (valueChange)=\"onPaginationValueChange($event)\"\n (yearClick)=\"view.set('year')\"\n />\n <tui-calendar-sheet\n automation-id=\"tui-calendar__calendar\"\n [disabledItemHandler]=\"disabledItemHandler() | tuiMapper: disabledItemHandlerMapper : min() : max()\"\n [hoveredItem]=\"hoveredItem()\"\n [markerHandler]=\"markerHandler()\"\n [month]=\"month()\"\n [showAdjacent]=\"showAdjacent()\"\n [value]=\"value()\"\n (dayClick)=\"onDayClick($event)\"\n (hoveredItemChange)=\"onHoveredItemChange($event)\"\n />\n}\n", styles: [":host{display:block;min-block-size:20.25rem;inline-size:18rem;padding:1rem 1.125rem;box-sizing:border-box;flex-shrink:0}:host-context(tui-sheet-dialog){inline-size:100%}tui-calendar-year{padding:0}.t-scrollbar{block-size:18.25rem;inline-size:calc(100% + 1rem)}.t-pagination{margin-block-end:1rem}\n"], dependencies: [{ kind: "component", type: TuiCalendarSheet, selector: "tui-calendar-sheet", inputs: ["month", "disabledItemHandler", "markerHandler", "value", "showAdjacent", "hoveredItem"], outputs: ["hoveredItemChange", "dayClick"] }, { kind: "component", type: TuiCalendarSpin, selector: "tui-calendar-spin", inputs: ["value", "min", "max"], outputs: ["valueChange", "yearClick"] }, { kind: "component", type: TuiCalendarYear, selector: "tui-calendar-year", inputs: ["rangeMode", "disabledItemHandler", "value", "min", "max", "initialItem"], outputs: ["yearClick"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "component", type: TuiScrollbar, selector: "tui-scrollbar" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
524
406
  }
525
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendar, decorators: [{
407
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendar, decorators: [{
526
408
  type: Component,
527
409
  args: [{ selector: 'tui-calendar', imports: [
528
410
  TuiCalendarSheet,
@@ -530,36 +412,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
530
412
  TuiCalendarYear,
531
413
  TuiMapperPipe,
532
414
  TuiScrollbar,
533
- ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsAuxiliary(TuiCalendar)], host: { '(pointerdown.prevent.zoneless)': '0' }, template: "@if (isInYearView) {\n <tui-scrollbar\n automation-id=\"tui-calendar__scrollbar\"\n class=\"t-scrollbar\"\n >\n <tui-calendar-year\n automation-id=\"tui-calendar__year\"\n [initialItem]=\"month.year\"\n [max]=\"computedMax.year\"\n [min]=\"computedMin.year\"\n [rangeMode]=\"options.rangeMode\"\n [value]=\"value\"\n (yearClick)=\"onPickerYearClick($event)\"\n />\n </tui-scrollbar>\n} @else {\n <tui-calendar-spin\n automation-id=\"tui-calendar__pagination\"\n class=\"t-pagination\"\n [max]=\"computedMaxViewedMonth\"\n [min]=\"computedMinViewedMonth\"\n [value]=\"month\"\n (valueChange)=\"onPaginationValueChange($event)\"\n (yearClick)=\"onPaginationYearClick()\"\n />\n <tui-calendar-sheet\n automation-id=\"tui-calendar__calendar\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper : computedMin : computedMax\"\n [hoveredItem]=\"hoveredItem\"\n [markerHandler]=\"markerHandler\"\n [month]=\"month\"\n [showAdjacent]=\"showAdjacent\"\n [value]=\"value\"\n (dayClick)=\"onDayClick($event)\"\n (hoveredItemChange)=\"onHoveredItemChange($event)\"\n />\n}\n", styles: [":host{display:block;min-block-size:20.25rem;inline-size:18rem;padding:1rem 1.125rem;box-sizing:border-box;flex-shrink:0}:host-context(tui-sheet-dialog){inline-size:100%}tui-calendar-year{padding:0}.t-scrollbar{block-size:18.25rem;inline-size:calc(100% + 1rem)}.t-pagination{margin-block-end:1rem}\n"] }]
534
- }], propDecorators: { month: [{
535
- type: Input
536
- }], disabledItemHandler: [{
537
- type: Input
538
- }], min: [{
539
- type: Input
540
- }], max: [{
541
- type: Input
542
- }], minViewedMonth: [{
543
- type: Input
544
- }], maxViewedMonth: [{
545
- type: Input
546
- }], hoveredItem: [{
547
- type: Input
548
- }], showAdjacent: [{
549
- type: Input
550
- }], markerHandler: [{
551
- type: Input
552
- }], dayClick: [{
553
- type: Output
554
- }], monthChange: [{
555
- type: Output
556
- }], hoveredItemChange: [{
557
- type: Output
558
- }], value: [{
559
- type: Input
560
- }], initialView: [{
561
- type: Input
562
- }] } });
415
+ ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsAuxiliary(TuiCalendar)], host: { '(pointerdown.prevent.zoneless)': '0' }, template: "@if (view() === 'year') {\n <tui-scrollbar\n automation-id=\"tui-calendar__scrollbar\"\n class=\"t-scrollbar\"\n >\n <tui-calendar-year\n automation-id=\"tui-calendar__year\"\n [initialItem]=\"month().year\"\n [max]=\"max().year\"\n [min]=\"min().year\"\n [rangeMode]=\"options.rangeMode\"\n [value]=\"value()\"\n (yearClick)=\"onPickerYearClick($event)\"\n />\n </tui-scrollbar>\n} @else {\n <tui-calendar-spin\n automation-id=\"tui-calendar__pagination\"\n class=\"t-pagination\"\n [max]=\"computedMaxViewedMonth()\"\n [min]=\"computedMinViewedMonth()\"\n [value]=\"month()\"\n (valueChange)=\"onPaginationValueChange($event)\"\n (yearClick)=\"view.set('year')\"\n />\n <tui-calendar-sheet\n automation-id=\"tui-calendar__calendar\"\n [disabledItemHandler]=\"disabledItemHandler() | tuiMapper: disabledItemHandlerMapper : min() : max()\"\n [hoveredItem]=\"hoveredItem()\"\n [markerHandler]=\"markerHandler()\"\n [month]=\"month()\"\n [showAdjacent]=\"showAdjacent()\"\n [value]=\"value()\"\n (dayClick)=\"onDayClick($event)\"\n (hoveredItemChange)=\"onHoveredItemChange($event)\"\n />\n}\n", styles: [":host{display:block;min-block-size:20.25rem;inline-size:18rem;padding:1rem 1.125rem;box-sizing:border-box;flex-shrink:0}:host-context(tui-sheet-dialog){inline-size:100%}tui-calendar-year{padding:0}.t-scrollbar{block-size:18.25rem;inline-size:calc(100% + 1rem)}.t-pagination{margin-block-end:1rem}\n"] }]
416
+ }] });
563
417
 
564
418
  /**
565
419
  * Generated bundle index. Do not edit.