@taiga-ui/core 5.0.0-rc.4 → 5.0.0
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.
- package/components/calendar/calendar-sheet.component.d.ts +1 -9
- package/components/calendar/calendar.component.d.ts +11 -21
- package/components/carousel/carousel.component.d.ts +20 -0
- package/components/carousel/carousel.d.ts +4 -0
- package/components/carousel/carousel.directive.d.ts +11 -0
- package/components/carousel/index.d.ts +3 -0
- package/components/error/error.directive.d.ts +1 -1
- package/components/index.d.ts +1 -0
- package/components/notification/notification.directive.d.ts +1 -2
- package/directives/appearance/appearance.options.d.ts +1 -1
- package/fesm2022/taiga-ui-core-classes.mjs +3 -3
- package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-button.mjs +8 -8
- package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-calendar.mjs +51 -107
- package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-carousel.mjs +100 -0
- package/fesm2022/taiga-ui-core-components-carousel.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-components-cell.mjs +9 -7
- package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-checkbox.mjs +4 -4
- package/fesm2022/taiga-ui-core-components-checkbox.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-data-list.mjs +23 -20
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +10 -10
- package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-expand.mjs +5 -5
- package/fesm2022/taiga-ui-core-components-expand.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-icon.mjs +8 -7
- package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-input.mjs +6 -6
- package/fesm2022/taiga-ui-core-components-input.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-label.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +8 -8
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +4 -4
- package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-notification.mjs +18 -18
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-radio.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-radio.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +4 -4
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs +24 -24
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-slider.mjs +17 -17
- package/fesm2022/taiga-ui-core-components-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-spin-button.mjs +3 -3
- package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-textfield.mjs +57 -29
- package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-title.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-title.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components.mjs +1 -0
- package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +10 -10
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-button-x.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-button-x.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-date-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-date-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-group.mjs +7 -7
- package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs +10 -10
- package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +9 -9
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-number-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-number-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-filter-by-input.mjs +55 -0
- package/fesm2022/taiga-ui-core-pipes-filter-by-input.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes.mjs +1 -0
- package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-alert.mjs +12 -10
- package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-dialog.mjs +16 -15
- package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-dropdown.mjs +236 -223
- package/fesm2022/taiga-ui-core-portals-dropdown.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-hint.mjs +38 -38
- package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-modal.mjs +21 -16
- package/fesm2022/taiga-ui-core-portals-modal.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-popup.mjs +10 -10
- package/fesm2022/taiga-ui-core-portals-popup.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-services.mjs +6 -6
- package/fesm2022/taiga-ui-core-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-tokens.mjs +4 -2
- package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-dom.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
- package/package.json +37 -15
- package/pipes/filter-by-input/filter-by-input.options.d.ts +6 -0
- package/pipes/filter-by-input/filter-by-input.pipe.d.ts +19 -0
- package/pipes/filter-by-input/index.d.ts +2 -0
- package/pipes/index.d.ts +1 -0
- package/portals/dropdown/dropdown-a11y.directive.d.ts +2 -2
- package/portals/dropdown/dropdown-open.directive.d.ts +6 -6
- package/portals/dropdown/dropdown.directive.d.ts +3 -3
- package/portals/dropdown/dropdown.providers.d.ts +2 -1
- package/portals/dropdown/index.d.ts +1 -1
- package/portals/modal/modal.component.d.ts +1 -2
- package/tokens/index.d.ts +1 -0
- package/tokens/textfield.d.ts +2 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, inject, Pipe, input, model, output,
|
|
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.
|
|
69
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.
|
|
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.
|
|
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.
|
|
123
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.
|
|
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.
|
|
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
|
}] });
|
|
@@ -140,14 +140,6 @@ class TuiCalendarSheet {
|
|
|
140
140
|
this.showAdjacent = input(true);
|
|
141
141
|
this.hoveredItem = model(null);
|
|
142
142
|
this.dayClick = output();
|
|
143
|
-
/**
|
|
144
|
-
* @deprecated use static DI options instead
|
|
145
|
-
* ```
|
|
146
|
-
* tuiCalendarSheetOptionsProvider({rangeMode: true})
|
|
147
|
-
* ```
|
|
148
|
-
* TODO(v5): delete it
|
|
149
|
-
*/
|
|
150
|
-
this.single = true;
|
|
151
143
|
this.toMarkers = (day, today, range, markerHandler) => {
|
|
152
144
|
if (today || ['active', 'end', 'start'].includes(range || '')) {
|
|
153
145
|
return null;
|
|
@@ -186,17 +178,10 @@ class TuiCalendarSheet {
|
|
|
186
178
|
return range.from.dayBefore(item) && range.to.dayAfter(item) ? 'middle' : null;
|
|
187
179
|
}
|
|
188
180
|
get computedRangeMode() {
|
|
189
|
-
return
|
|
181
|
+
return this.options.rangeMode;
|
|
190
182
|
}
|
|
191
183
|
get isRangePicking() {
|
|
192
|
-
|
|
193
|
-
return this.computedRangeMode
|
|
194
|
-
? value instanceof TuiDay
|
|
195
|
-
: /**
|
|
196
|
-
* Only for backward compatibility!
|
|
197
|
-
* TODO(v5): replace with `this.options.rangeMode && this.value instanceof TuiDay`
|
|
198
|
-
*/
|
|
199
|
-
value instanceof TuiDayRange && value.isSingleDay;
|
|
184
|
+
return this.options.rangeMode && this.value() instanceof TuiDay;
|
|
200
185
|
}
|
|
201
186
|
itemIsToday(item) {
|
|
202
187
|
return this.today.daySame(item);
|
|
@@ -218,10 +203,10 @@ class TuiCalendarSheet {
|
|
|
218
203
|
}
|
|
219
204
|
this.hoveredItem.set(day);
|
|
220
205
|
}
|
|
221
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
222
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
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 }); }
|
|
223
208
|
}
|
|
224
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
209
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarSheet, decorators: [{
|
|
225
210
|
type: Component,
|
|
226
211
|
args: [{ selector: 'tui-calendar-sheet', imports: [
|
|
227
212
|
AsyncPipe,
|
|
@@ -229,10 +214,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
229
214
|
TuiHovered,
|
|
230
215
|
TuiMapperPipe,
|
|
231
216
|
TuiOrderWeekDaysPipe,
|
|
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{
|
|
233
|
-
}]
|
|
234
|
-
type: Input
|
|
235
|
-
}] } });
|
|
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
|
+
}] });
|
|
236
219
|
|
|
237
220
|
class TuiCalendarSpin {
|
|
238
221
|
constructor() {
|
|
@@ -259,10 +242,10 @@ class TuiCalendarSpin {
|
|
|
259
242
|
}
|
|
260
243
|
this.value.set(value);
|
|
261
244
|
}
|
|
262
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
263
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
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 }); }
|
|
264
247
|
}
|
|
265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
248
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarSpin, decorators: [{
|
|
266
249
|
type: Component,
|
|
267
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"] }]
|
|
268
251
|
}] });
|
|
@@ -344,22 +327,18 @@ class TuiCalendarYear {
|
|
|
344
327
|
itemIsToday(item) {
|
|
345
328
|
return CURRENT_YEAR === item;
|
|
346
329
|
}
|
|
347
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
348
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
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 }); }
|
|
349
332
|
}
|
|
350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
333
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendarYear, decorators: [{
|
|
351
334
|
type: Component,
|
|
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{
|
|
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"] }]
|
|
353
336
|
}] });
|
|
354
337
|
|
|
355
338
|
class TuiCalendar {
|
|
356
339
|
constructor() {
|
|
357
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
358
|
-
this.day = null;
|
|
359
|
-
this.view = 'month';
|
|
360
340
|
this.options = inject(TUI_CALENDAR_SHEET_OPTIONS);
|
|
361
|
-
this.
|
|
362
|
-
this.disabledItemHandler = inject(TUI_ITEMS_HANDLERS).disabledItemHandler();
|
|
341
|
+
this.disabledItemHandler = input(inject(TUI_ITEMS_HANDLERS).disabledItemHandler());
|
|
363
342
|
this.min = input(TUI_FIRST_DAY, {
|
|
364
343
|
transform: (x) => x ?? TUI_FIRST_DAY,
|
|
365
344
|
});
|
|
@@ -368,6 +347,13 @@ class TuiCalendar {
|
|
|
368
347
|
});
|
|
369
348
|
this.minViewedMonth = input(TUI_FIRST_DAY);
|
|
370
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();
|
|
371
357
|
this.computedMinViewedMonth = computed(() => {
|
|
372
358
|
const min = this.min();
|
|
373
359
|
const minViewed = this.minViewedMonth() ?? TUI_FIRST_DAY;
|
|
@@ -378,69 +364,47 @@ class TuiCalendar {
|
|
|
378
364
|
const maxViewed = this.maxViewedMonth() ?? TUI_LAST_DAY;
|
|
379
365
|
return maxViewed.monthSameOrBefore(max) ? maxViewed : max;
|
|
380
366
|
});
|
|
381
|
-
this.
|
|
382
|
-
this.
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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
|
+
});
|
|
389
376
|
this.disabledItemHandlerMapper = (disabledItemHandler, min, max) => (item) => item.dayBefore(min) || item.dayAfter(max) || disabledItemHandler(item);
|
|
390
377
|
}
|
|
391
|
-
set value(value) {
|
|
392
|
-
this.cdr.markForCheck();
|
|
393
|
-
this.day = value;
|
|
394
|
-
if (this.showAdjacent &&
|
|
395
|
-
value instanceof TuiDay &&
|
|
396
|
-
value.daySameOrBefore(TUI_LAST_DISPLAYED_DAY)) {
|
|
397
|
-
this.month = value;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
set initialView(view) {
|
|
401
|
-
this.view = view;
|
|
402
|
-
}
|
|
403
|
-
get value() {
|
|
404
|
-
return this.day;
|
|
405
|
-
}
|
|
406
378
|
onPaginationValueChange(month) {
|
|
407
379
|
this.updateViewedMonth(month);
|
|
408
380
|
}
|
|
409
381
|
onDayClick(day) {
|
|
410
382
|
this.dayClick.emit(day);
|
|
411
|
-
this.
|
|
383
|
+
this.value.set(day);
|
|
412
384
|
}
|
|
413
385
|
onHoveredItemChange(day) {
|
|
414
386
|
this.updateHoveredDay(day);
|
|
415
387
|
}
|
|
416
|
-
get isInYearView() {
|
|
417
|
-
return this.view === 'year';
|
|
418
|
-
}
|
|
419
|
-
onPaginationYearClick() {
|
|
420
|
-
this.view = 'year';
|
|
421
|
-
}
|
|
422
388
|
onPickerYearClick(year) {
|
|
423
|
-
this.view
|
|
424
|
-
this.updateViewedMonth(new TuiMonth(year, this.month.month));
|
|
389
|
+
this.view.set('month');
|
|
390
|
+
this.updateViewedMonth(new TuiMonth(year, this.month().month));
|
|
425
391
|
}
|
|
426
392
|
updateViewedMonth(month) {
|
|
427
|
-
if (this.month.monthSame(month)) {
|
|
393
|
+
if (this.month().monthSame(month)) {
|
|
428
394
|
return;
|
|
429
395
|
}
|
|
430
|
-
this.month
|
|
431
|
-
this.monthChange.emit(month);
|
|
396
|
+
this.month.set(month);
|
|
432
397
|
}
|
|
433
398
|
updateHoveredDay(day) {
|
|
434
|
-
if (tuiNullableSame(this.hoveredItem, day, (a, b) => a.daySame(b))) {
|
|
399
|
+
if (tuiNullableSame(this.hoveredItem(), day, (a, b) => a.daySame(b))) {
|
|
435
400
|
return;
|
|
436
401
|
}
|
|
437
|
-
this.hoveredItem
|
|
438
|
-
this.hoveredItemChange.emit(day);
|
|
402
|
+
this.hoveredItem.set(day);
|
|
439
403
|
}
|
|
440
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
441
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
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 }); }
|
|
442
406
|
}
|
|
443
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TuiCalendar, decorators: [{
|
|
444
408
|
type: Component,
|
|
445
409
|
args: [{ selector: 'tui-calendar', imports: [
|
|
446
410
|
TuiCalendarSheet,
|
|
@@ -448,28 +412,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
448
412
|
TuiCalendarYear,
|
|
449
413
|
TuiMapperPipe,
|
|
450
414
|
TuiScrollbar,
|
|
451
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsAuxiliary(TuiCalendar)], host: { '(pointerdown.prevent.zoneless)': '0' }, template: "@if (
|
|
452
|
-
}]
|
|
453
|
-
type: Input
|
|
454
|
-
}], disabledItemHandler: [{
|
|
455
|
-
type: Input
|
|
456
|
-
}], hoveredItem: [{
|
|
457
|
-
type: Input
|
|
458
|
-
}], showAdjacent: [{
|
|
459
|
-
type: Input
|
|
460
|
-
}], markerHandler: [{
|
|
461
|
-
type: Input
|
|
462
|
-
}], dayClick: [{
|
|
463
|
-
type: Output
|
|
464
|
-
}], monthChange: [{
|
|
465
|
-
type: Output
|
|
466
|
-
}], hoveredItemChange: [{
|
|
467
|
-
type: Output
|
|
468
|
-
}], value: [{
|
|
469
|
-
type: Input
|
|
470
|
-
}], initialView: [{
|
|
471
|
-
type: Input
|
|
472
|
-
}] } });
|
|
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
|
+
}] });
|
|
473
417
|
|
|
474
418
|
/**
|
|
475
419
|
* Generated bundle index. Do not edit.
|