@taiga-ui/core 5.0.0-rc.2 → 5.0.0-rc.4

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 (138) hide show
  1. package/components/calendar/calendar-sheet.component.d.ts +8 -15
  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 +7 -9
  5. package/components/checkbox/checkbox.component.d.ts +10 -0
  6. package/components/checkbox/checkbox.options.d.ts +10 -0
  7. package/components/checkbox/index.d.ts +2 -0
  8. package/components/data-list/data-list.component.d.ts +1 -0
  9. package/components/index.d.ts +3 -0
  10. package/components/input/input.directive.d.ts +2 -0
  11. package/components/loader/loader.component.d.ts +0 -2
  12. package/components/radio/index.d.ts +4 -0
  13. package/components/radio/radio.component.d.ts +18 -0
  14. package/components/radio/radio.d.ts +3 -0
  15. package/components/radio/radio.directive.d.ts +8 -0
  16. package/components/radio/radio.options.d.ts +7 -0
  17. package/components/slider/helpers/key-steps.d.ts +27 -0
  18. package/components/slider/helpers/slider-key-steps.directive.d.ts +32 -0
  19. package/components/slider/helpers/slider-readonly.directive.d.ts +15 -0
  20. package/components/slider/helpers/slider-thumb-label.component.d.ts +13 -0
  21. package/components/slider/index.d.ts +6 -0
  22. package/components/slider/slider.component.d.ts +22 -0
  23. package/components/slider/slider.d.ts +5 -0
  24. package/components/textfield/index.d.ts +0 -1
  25. package/components/textfield/textfield.component.d.ts +1 -0
  26. package/directives/items-handlers/items-handlers.validator.d.ts +1 -0
  27. package/fesm2022/taiga-ui-core-components-button.mjs +2 -2
  28. package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
  29. package/fesm2022/taiga-ui-core-components-calendar.mjs +84 -174
  30. package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
  31. package/fesm2022/taiga-ui-core-components-cell.mjs +2 -2
  32. package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
  33. package/fesm2022/taiga-ui-core-components-checkbox.mjs +37 -0
  34. package/fesm2022/taiga-ui-core-components-checkbox.mjs.map +1 -0
  35. package/fesm2022/taiga-ui-core-components-data-list.mjs +10 -4
  36. package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
  37. package/fesm2022/taiga-ui-core-components-error.mjs +3 -3
  38. package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
  39. package/fesm2022/taiga-ui-core-components-icon.mjs +2 -2
  40. package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
  41. package/fesm2022/taiga-ui-core-components-input.mjs +4 -2
  42. package/fesm2022/taiga-ui-core-components-input.mjs.map +1 -1
  43. package/fesm2022/taiga-ui-core-components-label.mjs +3 -3
  44. package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
  45. package/fesm2022/taiga-ui-core-components-link.mjs +2 -2
  46. package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
  47. package/fesm2022/taiga-ui-core-components-loader.mjs +5 -8
  48. package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
  49. package/fesm2022/taiga-ui-core-components-notification.mjs +2 -2
  50. package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
  51. package/fesm2022/taiga-ui-core-components-radio.mjs +91 -0
  52. package/fesm2022/taiga-ui-core-components-radio.mjs.map +1 -0
  53. package/fesm2022/taiga-ui-core-components-root.mjs +2 -2
  54. package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
  55. package/fesm2022/taiga-ui-core-components-slider.mjs +337 -0
  56. package/fesm2022/taiga-ui-core-components-slider.mjs.map +1 -0
  57. package/fesm2022/taiga-ui-core-components-spin-button.mjs +2 -2
  58. package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
  59. package/fesm2022/taiga-ui-core-components-textfield.mjs +20 -21
  60. package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
  61. package/fesm2022/taiga-ui-core-components-title.mjs +3 -3
  62. package/fesm2022/taiga-ui-core-components-title.mjs.map +1 -1
  63. package/fesm2022/taiga-ui-core-components.mjs +3 -0
  64. package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
  65. package/fesm2022/taiga-ui-core-directives-appearance.mjs +3 -3
  66. package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
  67. package/fesm2022/taiga-ui-core-directives-group.mjs +3 -3
  68. package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
  69. package/fesm2022/taiga-ui-core-directives-icons.mjs +3 -3
  70. package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
  71. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +7 -1
  72. package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
  73. package/fesm2022/taiga-ui-core-portals-alert.mjs +2 -2
  74. package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -1
  75. package/fesm2022/taiga-ui-core-portals-dialog.mjs +2 -2
  76. package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -1
  77. package/fesm2022/taiga-ui-core-portals-dropdown.mjs +167 -115
  78. package/fesm2022/taiga-ui-core-portals-dropdown.mjs.map +1 -1
  79. package/fesm2022/taiga-ui-core-portals-hint.mjs +3 -3
  80. package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -1
  81. package/fesm2022/taiga-ui-core-portals-modal.mjs +2 -2
  82. package/fesm2022/taiga-ui-core-portals-modal.mjs.map +1 -1
  83. package/fesm2022/taiga-ui-core-portals-popup.mjs +2 -2
  84. package/fesm2022/taiga-ui-core-portals-popup.mjs.map +1 -1
  85. package/fesm2022/taiga-ui-core-tokens.mjs +1 -1
  86. package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
  87. package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
  88. package/package.json +32 -20
  89. package/portals/dropdown/dropdown-a11y.directive.d.ts +10 -0
  90. package/portals/dropdown/dropdown-close.directive.d.ts +3 -3
  91. package/portals/dropdown/dropdown-open.directive.d.ts +4 -3
  92. package/portals/dropdown/dropdown-selection.directive.d.ts +1 -0
  93. package/portals/dropdown/dropdown.d.ts +2 -1
  94. package/portals/dropdown/dropdown.directive.d.ts +5 -5
  95. package/portals/dropdown/index.d.ts +1 -0
  96. package/utils/miscellaneous/font-scaling.d.ts +2 -2
  97. package/components/textfield/textfield-icon.d.ts +0 -6
  98. package/styles/components/appearance.less +0 -51
  99. package/styles/components/button.less +0 -134
  100. package/styles/components/group.less +0 -172
  101. package/styles/components/icon.less +0 -83
  102. package/styles/components/icons.less +0 -79
  103. package/styles/components/label.less +0 -51
  104. package/styles/components/link.less +0 -69
  105. package/styles/components/notification.less +0 -184
  106. package/styles/components/textfield.less +0 -358
  107. package/styles/components/title.less +0 -80
  108. package/styles/mixins/appearance.less +0 -56
  109. package/styles/mixins/appearance.scss +0 -57
  110. package/styles/mixins/browsers.less +0 -23
  111. package/styles/mixins/browsers.scss +0 -23
  112. package/styles/mixins/date-picker.less +0 -152
  113. package/styles/mixins/mixins.less +0 -168
  114. package/styles/mixins/mixins.scss +0 -161
  115. package/styles/mixins/picker.less +0 -200
  116. package/styles/mixins/picker.scss +0 -199
  117. package/styles/mixins/slider.less +0 -67
  118. package/styles/mixins/slider.scss +0 -67
  119. package/styles/taiga-ui-fonts.less +0 -4
  120. package/styles/taiga-ui-local.less +0 -7
  121. package/styles/taiga-ui-local.scss +0 -6
  122. package/styles/taiga-ui-theme.less +0 -4
  123. package/styles/theme/appearance/accent.less +0 -14
  124. package/styles/theme/appearance/action.less +0 -38
  125. package/styles/theme/appearance/flat.less +0 -23
  126. package/styles/theme/appearance/floating.less +0 -21
  127. package/styles/theme/appearance/glass.less +0 -30
  128. package/styles/theme/appearance/outline.less +0 -78
  129. package/styles/theme/appearance/primary.less +0 -48
  130. package/styles/theme/appearance/secondary.less +0 -77
  131. package/styles/theme/appearance/status.less +0 -125
  132. package/styles/theme/appearance/table.less +0 -68
  133. package/styles/theme/appearance/textfield.less +0 -80
  134. package/styles/theme/appearance.less +0 -12
  135. package/styles/theme/palette.less +0 -161
  136. package/styles/theme/variables.less +0 -42
  137. package/styles/variables/media.less +0 -23
  138. package/styles/variables/media.scss +0 -23
@@ -1,5 +1,5 @@
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, Input, ChangeDetectionStrategy, Component, computed, ChangeDetectorRef, EventEmitter, Output } 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';
@@ -133,12 +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;
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();
142
143
  /**
143
144
  * @deprecated use static DI options instead
144
145
  * ```
@@ -147,8 +148,6 @@ class TuiCalendarSheet {
147
148
  * TODO(v5): delete it
148
149
  */
149
150
  this.single = true;
150
- this.hoveredItemChange = new EventEmitter();
151
- this.dayClick = new EventEmitter();
152
151
  this.toMarkers = (day, today, range, markerHandler) => {
153
152
  if (today || ['active', 'end', 'start'].includes(range || '')) {
154
153
  return null;
@@ -157,28 +156,11 @@ class TuiCalendarSheet {
157
156
  return markers?.length ? markers : null;
158
157
  };
159
158
  }
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
159
  onItemHovered(item) {
178
160
  this.updateHoveredItem(item || null);
179
161
  }
180
162
  getItemRange(item) {
181
- const { value, hoveredItem } = this;
163
+ const value = this.value();
182
164
  if (!value) {
183
165
  return null;
184
166
  }
@@ -191,7 +173,7 @@ class TuiCalendarSheet {
191
173
  if (!(value instanceof TuiDay) && !(value instanceof TuiDayRange)) {
192
174
  return value.find((day) => day.daySame(item)) ? 'active' : null;
193
175
  }
194
- const range = this.getRange(value, hoveredItem);
176
+ const range = this.getRange(value, this.hoveredItem());
195
177
  if (range.isSingleDay && range.from.daySame(item)) {
196
178
  return 'active';
197
179
  }
@@ -207,22 +189,20 @@ class TuiCalendarSheet {
207
189
  return !this.single || this.options.rangeMode;
208
190
  }
209
191
  get isRangePicking() {
192
+ const value = this.value();
210
193
  return this.computedRangeMode
211
- ? this.value instanceof TuiDay
194
+ ? value instanceof TuiDay
212
195
  : /**
213
196
  * Only for backward compatibility!
214
197
  * TODO(v5): replace with `this.options.rangeMode && this.value instanceof TuiDay`
215
198
  */
216
- this.value instanceof TuiDayRange && this.value.isSingleDay;
199
+ value instanceof TuiDayRange && value.isSingleDay;
217
200
  }
218
201
  itemIsToday(item) {
219
202
  return this.today.daySame(item);
220
203
  }
221
204
  itemIsUnavailable(item) {
222
- return !this.month.monthSame(item);
223
- }
224
- onItemClick(item) {
225
- this.dayClick.emit(item);
205
+ return !this.month().monthSame(item);
226
206
  }
227
207
  getRange(value, hoveredItem) {
228
208
  if (value instanceof TuiDay) {
@@ -233,14 +213,13 @@ class TuiCalendarSheet {
233
213
  : value;
234
214
  }
235
215
  updateHoveredItem(day) {
236
- if (tuiNullableSame(this.hoveredItem, day, (a, b) => a.daySame(b))) {
216
+ if (tuiNullableSame(this.hoveredItem(), day, (a, b) => a.daySame(b))) {
237
217
  return;
238
218
  }
239
- this.hoveredItem = day;
240
- this.hoveredItemChange.emit(day);
219
+ this.hoveredItem.set(day);
241
220
  }
242
221
  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 }); }
222
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", 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 }, single: { classPropertyName: "single", publicName: "single", isSignal: false, 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: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-typography-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 }); }
244
223
  }
245
224
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarSheet, decorators: [{
246
225
  type: Component,
@@ -250,72 +229,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
250
229
  TuiHovered,
251
230
  TuiMapperPipe,
252
231
  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: [{
232
+ ], 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: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-typography-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"] }]
233
+ }], propDecorators: { single: [{
261
234
  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
235
  }] } });
273
236
 
274
237
  class TuiCalendarSpin {
275
238
  constructor() {
276
239
  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);
240
+ this.value = model(TuiMonth.currentLocal());
241
+ this.min = input(TUI_FIRST_DAY);
242
+ this.max = input(TUI_LAST_DAY);
243
+ this.yearClick = output();
285
244
  }
286
245
  append(date) {
287
- const value = this.value.append(date);
288
- if (this.min.monthSameOrAfter(value)) {
289
- this.updateValue(this.min);
246
+ const value = this.value().append(date);
247
+ const min = this.min();
248
+ const max = this.max();
249
+ if (min.monthSameOrAfter(value)) {
250
+ this.updateValue(min);
290
251
  }
291
252
  else {
292
- this.updateValue(this.max.monthSameOrBefore(value) ? this.max : value);
253
+ this.updateValue(max.monthSameOrBefore(value) ? max : value);
293
254
  }
294
255
  }
295
256
  updateValue(value) {
296
- if (this.value.monthSame(value)) {
257
+ if (this.value().monthSame(value)) {
297
258
  return;
298
259
  }
299
- this.value = value;
300
- this.valueChange.emit(value);
260
+ this.value.set(value);
301
261
  }
302
262
  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 }); }
263
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", 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
264
  }
305
265
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarSpin, decorators: [{
306
266
  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
- }] } });
267
+ 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"] }]
268
+ }] });
319
269
 
320
270
  const LIMIT = 100;
321
271
  const ITEMS_IN_ROW = 4;
@@ -323,35 +273,36 @@ const CURRENT_YEAR = TuiMonth.currentLocal().year;
323
273
  class TuiCalendarYear {
324
274
  constructor() {
325
275
  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);
276
+ this.calculatedMin = computed(() => {
277
+ const initial = this.initialItem() - LIMIT;
278
+ const min = this.min() ?? MIN_YEAR;
279
+ return min > initial ? min : initial;
280
+ });
281
+ this.calculatedMax = computed(() => {
282
+ const initial = this.initialItem() + LIMIT;
283
+ const max = this.max() ?? MAX_YEAR;
284
+ return max < initial ? max + 1 : initial;
285
+ });
286
+ this.isRangePicking = computed((x = this.value()) => this.rangeMode() && (x instanceof TuiDay || x instanceof TuiMonth));
287
+ this.rows = computed(() => Math.ceil((this.calculatedMax() - this.calculatedMin()) / ITEMS_IN_ROW));
288
+ this.rangeMode = input(false);
289
+ this.disabledItemHandler = input(inject(TUI_ITEMS_HANDLERS).disabledItemHandler());
290
+ this.value = input(null);
291
+ this.min = input(MIN_YEAR, {
292
+ transform: (x) => x ?? MIN_YEAR,
293
+ });
294
+ this.max = input(MAX_YEAR, {
295
+ transform: (x) => x ?? MAX_YEAR,
296
+ });
297
+ this.initialItem = input(CURRENT_YEAR, {
298
+ transform: (x) => x ?? CURRENT_YEAR,
299
+ });
300
+ this.yearClick = output();
350
301
  }
351
302
  isDisabled(item) {
352
303
  return ((this.max() && this.max() < item) ||
353
304
  (this.min() && this.min() > item) ||
354
- this.disabledItemHandler(item));
305
+ this.disabledItemHandler()(item));
355
306
  }
356
307
  getItemRange(item) {
357
308
  const value = this.value();
@@ -384,53 +335,22 @@ class TuiCalendarYear {
384
335
  onItemHovered(hovered, item) {
385
336
  this.hoveredItem.set(hovered ? item : null);
386
337
  }
387
- get rows() {
388
- return Math.ceil((this.calculatedMax - this.calculatedMin) / ITEMS_IN_ROW);
389
- }
390
338
  scrollItemIntoView(item) {
391
339
  return this.initialItem() === item;
392
340
  }
393
341
  getItem(rowIndex, colIndex) {
394
- return rowIndex * ITEMS_IN_ROW + colIndex + this.calculatedMin;
342
+ return rowIndex * ITEMS_IN_ROW + colIndex + this.calculatedMin();
395
343
  }
396
344
  itemIsToday(item) {
397
345
  return CURRENT_YEAR === item;
398
346
  }
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
347
  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 }); }
348
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", 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: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 }); }
411
349
  }
412
350
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendarYear, decorators: [{
413
351
  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
- }] } });
352
+ 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: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"] }]
353
+ }] });
434
354
 
435
355
  class TuiCalendar {
436
356
  constructor() {
@@ -440,10 +360,24 @@ class TuiCalendar {
440
360
  this.options = inject(TUI_CALENDAR_SHEET_OPTIONS);
441
361
  this.month = TuiMonth.currentLocal();
442
362
  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;
363
+ this.min = input(TUI_FIRST_DAY, {
364
+ transform: (x) => x ?? TUI_FIRST_DAY,
365
+ });
366
+ this.max = input(TUI_LAST_DAY, {
367
+ transform: (x) => x ?? TUI_LAST_DAY,
368
+ });
369
+ this.minViewedMonth = input(TUI_FIRST_DAY);
370
+ this.maxViewedMonth = input(TUI_LAST_DAY);
371
+ this.computedMinViewedMonth = computed(() => {
372
+ const min = this.min();
373
+ const minViewed = this.minViewedMonth() ?? TUI_FIRST_DAY;
374
+ return minViewed.monthSameOrAfter(min) ? minViewed : min;
375
+ });
376
+ this.computedMaxViewedMonth = computed(() => {
377
+ const max = this.max();
378
+ const maxViewed = this.maxViewedMonth() ?? TUI_LAST_DAY;
379
+ return maxViewed.monthSameOrBefore(max) ? maxViewed : max;
380
+ });
447
381
  this.hoveredItem = null;
448
382
  this.showAdjacent = true;
449
383
  this.markerHandler = null;
@@ -479,22 +413,6 @@ class TuiCalendar {
479
413
  onHoveredItemChange(day) {
480
414
  this.updateHoveredDay(day);
481
415
  }
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
416
  get isInYearView() {
499
417
  return this.view === 'year';
500
418
  }
@@ -520,7 +438,7 @@ class TuiCalendar {
520
438
  this.hoveredItemChange.emit(day);
521
439
  }
522
440
  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 }); }
441
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: TuiCalendar, isStandalone: true, selector: "tui-calendar", inputs: { month: { classPropertyName: "month", publicName: "month", isSignal: false, isRequired: false, transformFunction: null }, disabledItemHandler: { classPropertyName: "disabledItemHandler", publicName: "disabledItemHandler", isSignal: false, 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 }, hoveredItem: { classPropertyName: "hoveredItem", publicName: "hoveredItem", isSignal: false, isRequired: false, transformFunction: null }, showAdjacent: { classPropertyName: "showAdjacent", publicName: "showAdjacent", isSignal: false, isRequired: false, transformFunction: null }, markerHandler: { classPropertyName: "markerHandler", publicName: "markerHandler", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, initialView: { classPropertyName: "initialView", publicName: "initialView", isSignal: false, isRequired: false, transformFunction: null } }, 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]=\"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)=\"onPaginationYearClick()\"\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", "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", "value", "min", "max", "initialItem"], outputs: ["yearClick"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "component", type: TuiScrollbar, selector: "tui-scrollbar" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
524
442
  }
525
443
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TuiCalendar, decorators: [{
526
444
  type: Component,
@@ -530,19 +448,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
530
448
  TuiCalendarYear,
531
449
  TuiMapperPipe,
532
450
  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"] }]
451
+ ], 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]=\"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)=\"onPaginationYearClick()\"\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"] }]
534
452
  }], propDecorators: { month: [{
535
453
  type: Input
536
454
  }], disabledItemHandler: [{
537
455
  type: Input
538
- }], min: [{
539
- type: Input
540
- }], max: [{
541
- type: Input
542
- }], minViewedMonth: [{
543
- type: Input
544
- }], maxViewedMonth: [{
545
- type: Input
546
456
  }], hoveredItem: [{
547
457
  type: Input
548
458
  }], showAdjacent: [{