@taiga-ui/experimental 5.12.0 → 5.13.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.component.d.ts +9 -4
- package/components/calendar/calendar.options.d.ts +11 -0
- package/components/calendar/index.d.ts +2 -0
- package/components/calendar/week.pipe.d.ts +9 -0
- package/components/date-picker/date-picker.component.d.ts +15 -6
- package/fesm2022/taiga-ui-experimental-components-calendar.mjs +60 -10
- package/fesm2022/taiga-ui-experimental-components-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-experimental-components-data-grid.mjs +2 -2
- package/fesm2022/taiga-ui-experimental-components-data-grid.mjs.map +1 -1
- package/fesm2022/taiga-ui-experimental-components-date-picker.mjs +27 -17
- package/fesm2022/taiga-ui-experimental-components-date-picker.mjs.map +1 -1
- package/fesm2022/taiga-ui-experimental-components-file.mjs +2 -2
- package/package.json +6 -6
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import { TuiDay, TuiDayRange, TuiMonth } from '@taiga-ui/cdk/date-time';
|
|
2
|
-
import { type TuiBooleanHandler } from '@taiga-ui/cdk/types';
|
|
2
|
+
import { type TuiBooleanHandler, type TuiContext } from '@taiga-ui/cdk/types';
|
|
3
|
+
import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
/**
|
|
5
6
|
* @deprecated: work in progress, do not use!
|
|
6
7
|
*/
|
|
7
8
|
export declare class TuiCalendar {
|
|
8
|
-
private readonly options;
|
|
9
9
|
private readonly days;
|
|
10
|
+
private readonly options;
|
|
10
11
|
protected readonly today: TuiDay;
|
|
11
12
|
protected readonly hovered: import("@angular/core").WritableSignal<TuiDay | null>;
|
|
12
|
-
protected readonly dayType: import("@taiga-ui/cdk/types").TuiHandler<TuiDay, string>;
|
|
13
13
|
protected readonly week: import("@angular/core").Signal<string[]>;
|
|
14
14
|
readonly pick: import("@angular/core").OutputEmitterRef<TuiDay>;
|
|
15
15
|
readonly month: import("@angular/core").InputSignal<TuiMonth>;
|
|
16
16
|
readonly value: import("@angular/core").InputSignal<TuiDay | TuiDayRange | readonly TuiDay[] | null>;
|
|
17
|
+
readonly content: import("@angular/core").InputSignal<PolymorpheusContent<TuiContext<TuiDay>>>;
|
|
18
|
+
readonly dayType: import("@angular/core").InputSignal<import("@taiga-ui/cdk/types").TuiHandler<TuiDay, string>>;
|
|
19
|
+
readonly showAdjacent: import("@angular/core").InputSignal<boolean>;
|
|
20
|
+
readonly showWeek: import("@angular/core").InputSignal<boolean>;
|
|
17
21
|
readonly disabledItemHandler: import("@angular/core").InputSignal<TuiBooleanHandler<TuiDay>>;
|
|
18
22
|
protected getRange(day: TuiDay): 'end' | 'middle' | 'single' | 'start' | null;
|
|
23
|
+
protected getType(day: string): string;
|
|
19
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiCalendar, never>;
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TuiCalendar, "tui-calendar[new]", never, { "month": { "alias": "month"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabledItemHandler": { "alias": "disabledItemHandler"; "required": false; "isSignal": true; }; }, { "pick": "pick"; }, never, never, true, never>;
|
|
25
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TuiCalendar, "tui-calendar[new]", never, { "month": { "alias": "month"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "dayType": { "alias": "dayType"; "required": false; "isSignal": true; }; "showAdjacent": { "alias": "showAdjacent"; "required": false; "isSignal": true; }; "showWeek": { "alias": "showWeek"; "required": false; "isSignal": true; }; "disabledItemHandler": { "alias": "disabledItemHandler"; "required": false; "isSignal": true; }; }, { "pick": "pick"; }, never, never, true, never>;
|
|
21
26
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Signal } from '@angular/core';
|
|
2
|
+
import { type TuiDay } from '@taiga-ui/cdk/date-time';
|
|
3
|
+
import { type TuiHandler } from '@taiga-ui/cdk/types';
|
|
4
|
+
export interface TuiCalendarOptions {
|
|
5
|
+
readonly dayType: TuiHandler<TuiDay, string>;
|
|
6
|
+
readonly weekFirstDay: Signal<number>;
|
|
7
|
+
readonly showAdjacent: boolean;
|
|
8
|
+
readonly showWeek: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const TUI_CALENDAR_DEFAULT_OPTIONS: TuiCalendarOptions;
|
|
11
|
+
export declare const TUI_CALENDAR_OPTIONS: import("@angular/core").InjectionToken<TuiCalendarOptions>, tuiCalendarOptionsProvider: (item: Partial<TuiCalendarOptions> | (() => Partial<TuiCalendarOptions>)) => import("@angular/core").FactoryProvider;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PipeTransform } from '@angular/core';
|
|
2
|
+
import { TuiDay } from '@taiga-ui/cdk/date-time';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TuiWeekPipe implements PipeTransform {
|
|
5
|
+
transform(day: TuiDay): number;
|
|
6
|
+
private getWeek;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TuiWeekPipe, never>;
|
|
8
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TuiWeekPipe, "tuiWeek", true>;
|
|
9
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type TuiContext } from '@taiga-ui/cdk/types';
|
|
1
|
+
import { TuiDay, TuiDayRange, TuiMonth } from '@taiga-ui/cdk/date-time';
|
|
2
|
+
import { type TuiBooleanHandler, type TuiContext } from '@taiga-ui/cdk/types';
|
|
3
3
|
import { AbstractTuiCalendar } from '@taiga-ui/core/components/calendar';
|
|
4
4
|
import { TuiCarouselComponent } from '@taiga-ui/core/components/carousel';
|
|
5
5
|
import { type PolymorpheusContent } from '@taiga-ui/polymorpheus';
|
|
@@ -8,29 +8,38 @@ type DatePicker<T> = T extends 'single' ? TuiDay : T extends 'multi' ? readonly
|
|
|
8
8
|
* @deprecated: work in progress, do not use!
|
|
9
9
|
*/
|
|
10
10
|
export declare class TuiDatePicker<T extends 'multi' | 'range' | 'single' = 'single'> extends AbstractTuiCalendar<DatePicker<T>> {
|
|
11
|
+
protected readonly options: import("@taiga-ui/experimental/components/calendar").TuiCalendarOptions;
|
|
11
12
|
protected readonly carousel: import("@angular/core").Signal<TuiCarouselComponent | undefined>;
|
|
12
13
|
protected readonly icons: import("@taiga-ui/core/tokens").TuiCommonIcons;
|
|
13
14
|
protected readonly texts: import("@angular/core").Signal<readonly [previous: string, next: string]>;
|
|
14
15
|
protected readonly i18n: import("@angular/core").Signal<readonly [January: string, February: string, March: string, April: string, May: string, June: string, July: string, August: string, September: string, October: string, November: string, December: string]>;
|
|
15
16
|
protected readonly dropdown: import("@angular/core").ElementRef<Element> | null;
|
|
16
|
-
protected readonly content: import("@angular/core").Signal<PolymorpheusContent<TuiContext<
|
|
17
|
+
protected readonly content: import("@angular/core").Signal<PolymorpheusContent<TuiContext<TuiMonth>>>;
|
|
17
18
|
protected readonly years: import("@angular/core").Signal<number[]>;
|
|
18
|
-
protected readonly
|
|
19
|
+
protected readonly year: import("@angular/core").Signal<TuiMonth[]>;
|
|
20
|
+
protected readonly months: import("@angular/core").Signal<TuiMonth[]>;
|
|
19
21
|
protected readonly button: import("@angular/core").Signal<string>;
|
|
20
22
|
protected readonly yearMin: import("@angular/core").Signal<number>;
|
|
21
23
|
protected readonly yearMax: import("@angular/core").Signal<number>;
|
|
22
24
|
protected readonly disabledDay: import("@angular/core").Signal<(day: TuiDay) => boolean>;
|
|
23
|
-
protected readonly disabledMonth: import("@angular/core").Signal<
|
|
25
|
+
protected readonly disabledMonth: import("@angular/core").Signal<TuiBooleanHandler<TuiMonth>>;
|
|
24
26
|
protected readonly disabledYear: import("@angular/core").Signal<(year: number) => boolean>;
|
|
25
27
|
protected readonly start: import("@angular/core").Signal<boolean>;
|
|
26
28
|
protected readonly end: import("@angular/core").Signal<boolean>;
|
|
29
|
+
protected readonly sync: import("@angular/core").EffectRef;
|
|
27
30
|
readonly view: import("@angular/core").ModelSignal<"day" | "month" | "year">;
|
|
28
31
|
readonly mode: import("@angular/core").InputSignal<T | undefined>;
|
|
32
|
+
readonly contentDay: import("@angular/core").InputSignal<PolymorpheusContent<TuiContext<TuiDay>>>;
|
|
33
|
+
readonly contentMonth: import("@angular/core").InputSignal<PolymorpheusContent<TuiContext<TuiMonth>>>;
|
|
34
|
+
readonly contentYear: import("@angular/core").InputSignal<PolymorpheusContent<TuiContext<number>>>;
|
|
35
|
+
readonly dayType: import("@angular/core").InputSignal<import("@taiga-ui/cdk/types").TuiHandler<TuiDay, string>>;
|
|
36
|
+
readonly showAdjacent: import("@angular/core").InputSignal<boolean>;
|
|
37
|
+
readonly showWeek: import("@angular/core").InputSignal<boolean>;
|
|
29
38
|
protected getMonth(index: number): TuiMonth;
|
|
30
39
|
protected getItems(initial: number): readonly number[];
|
|
31
40
|
protected onSpin(step: number): void;
|
|
32
41
|
protected onYear(year: number): void;
|
|
33
|
-
protected onMonth(
|
|
42
|
+
protected onMonth(month: TuiMonth): void;
|
|
34
43
|
protected onDay(day: TuiDay): void;
|
|
35
44
|
}
|
|
36
45
|
export {};
|
|
@@ -1,29 +1,67 @@
|
|
|
1
1
|
import { coerceArray } from '@angular/cdk/coercion';
|
|
2
|
+
import { UpperCasePipe } from '@angular/common';
|
|
2
3
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
+
import { signal, Pipe, inject, computed, output, input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
5
|
import { TUI_FALSE_HANDLER } from '@taiga-ui/cdk/constants';
|
|
5
|
-
import { TuiDay, TuiMonth, TuiDayRange } from '@taiga-ui/cdk/date-time';
|
|
6
|
+
import { TuiDayOfWeek, TuiDay, TuiMonth, TuiDayRange } from '@taiga-ui/cdk/date-time';
|
|
6
7
|
import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
|
|
7
|
-
import {
|
|
8
|
+
import { TuiCalendarSheetPipe } from '@taiga-ui/core/components/calendar';
|
|
8
9
|
import { TUI_SHORT_WEEK_DAYS } from '@taiga-ui/core/tokens';
|
|
10
|
+
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
11
|
+
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
12
|
+
|
|
13
|
+
const TUI_CALENDAR_DEFAULT_OPTIONS = {
|
|
14
|
+
dayType: (day) => (day.isWeekend ? 'weekend' : 'weekday'),
|
|
15
|
+
weekFirstDay: signal(TuiDayOfWeek.Monday),
|
|
16
|
+
showAdjacent: false,
|
|
17
|
+
showWeek: false,
|
|
18
|
+
};
|
|
19
|
+
const [TUI_CALENDAR_OPTIONS, tuiCalendarOptionsProvider] = tuiCreateOptions(TUI_CALENDAR_DEFAULT_OPTIONS);
|
|
20
|
+
|
|
21
|
+
const ISO_MIN = 4;
|
|
22
|
+
class TuiWeekPipe {
|
|
23
|
+
transform(day) {
|
|
24
|
+
const today = this.getWeek(day);
|
|
25
|
+
const prev = this.getWeek(day.append({ day: -7 }));
|
|
26
|
+
const next = this.getWeek(day.append({ day: 7 }));
|
|
27
|
+
return next === 2 ? 1 : today || prev;
|
|
28
|
+
}
|
|
29
|
+
getWeek(day) {
|
|
30
|
+
const beginning = new TuiDay(day.year, 0, 1);
|
|
31
|
+
const delta = beginning.dayOfWeek();
|
|
32
|
+
const first = ISO_MIN > 7 - delta ? 0 : 1;
|
|
33
|
+
const sunday = day.append({ day: 6 - day.dayOfWeek() });
|
|
34
|
+
const offset = Math.floor(TuiDay.lengthBetween(beginning, sunday) / 7);
|
|
35
|
+
return first + offset;
|
|
36
|
+
}
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiWeekPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
38
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: TuiWeekPipe, isStandalone: true, name: "tuiWeek" }); }
|
|
39
|
+
}
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiWeekPipe, decorators: [{
|
|
41
|
+
type: Pipe,
|
|
42
|
+
args: [{ name: 'tuiWeek' }]
|
|
43
|
+
}] });
|
|
9
44
|
|
|
10
45
|
/**
|
|
11
46
|
* @deprecated: work in progress, do not use!
|
|
12
47
|
*/
|
|
13
48
|
class TuiCalendar {
|
|
14
49
|
constructor() {
|
|
15
|
-
this.options = inject(TUI_CALENDAR_OPTIONS);
|
|
16
50
|
this.days = inject(TUI_SHORT_WEEK_DAYS);
|
|
51
|
+
this.options = inject(TUI_CALENDAR_OPTIONS);
|
|
17
52
|
this.today = TuiDay.currentLocal();
|
|
18
53
|
this.hovered = signal(null);
|
|
19
|
-
this.dayType = inject(TUI_CALENDAR_OPTIONS).dayType;
|
|
20
54
|
this.week = computed((week = convert(this.days())) => [
|
|
21
|
-
...week.slice(this.options.
|
|
22
|
-
...week.slice(0, this.options.
|
|
55
|
+
...week.slice(this.options.weekFirstDay()),
|
|
56
|
+
...week.slice(0, this.options.weekFirstDay()),
|
|
23
57
|
]);
|
|
24
58
|
this.pick = output();
|
|
25
59
|
this.month = input(TuiMonth.currentLocal());
|
|
26
60
|
this.value = input(null);
|
|
61
|
+
this.content = input();
|
|
62
|
+
this.dayType = input(this.options.dayType);
|
|
63
|
+
this.showAdjacent = input(this.options.showAdjacent);
|
|
64
|
+
this.showWeek = input(this.options.showWeek);
|
|
27
65
|
this.disabledItemHandler = input(TUI_FALSE_HANDLER);
|
|
28
66
|
}
|
|
29
67
|
getRange(day) {
|
|
@@ -46,12 +84,24 @@ class TuiCalendar {
|
|
|
46
84
|
}
|
|
47
85
|
return range.dayInRange(day) ? 'middle' : null;
|
|
48
86
|
}
|
|
87
|
+
getType(day) {
|
|
88
|
+
return day === this.days()[5] || day === this.days()[6] ? 'weekend' : '';
|
|
89
|
+
}
|
|
49
90
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
50
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TuiCalendar, isStandalone: true, selector: "tui-calendar[new]", inputs: { month: { classPropertyName: "month", publicName: "month", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabledItemHandler: { classPropertyName: "disabledItemHandler", publicName: "disabledItemHandler", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pick: "pick" }, host: { listeners: { "mouseleave": "hovered.set(null)" } }, ngImport: i0, template: "@for (day of week(); track $index) {\n <span>{{ day }}</span>\n}\n@for (week of month() | tuiCalendarSheet: true; track week) {\n @for (day of week; track day) {\n <button\n tabindex=\"-1\"\n
|
|
91
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TuiCalendar, isStandalone: true, selector: "tui-calendar[new]", inputs: { month: { classPropertyName: "month", publicName: "month", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, dayType: { classPropertyName: "dayType", publicName: "dayType", isSignal: true, isRequired: false, transformFunction: null }, showAdjacent: { classPropertyName: "showAdjacent", publicName: "showAdjacent", isSignal: true, isRequired: false, transformFunction: null }, showWeek: { classPropertyName: "showWeek", publicName: "showWeek", isSignal: true, isRequired: false, transformFunction: null }, disabledItemHandler: { classPropertyName: "disabledItemHandler", publicName: "disabledItemHandler", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pick: "pick" }, host: { listeners: { "mouseleave": "hovered.set(null)" }, properties: { "class._ww": "showWeek()" } }, ngImport: i0, template: "@if (showWeek()) {\n <span>#</span>\n}\n@for (day of week(); track $index) {\n <span [attr.data-type]=\"getType(day)\">{{ day.slice(0, 2) | uppercase }}</span>\n}\n@for (week of month() | tuiCalendarSheet: true; track week) {\n @for (day of week; track day) {\n @if (day.monthSameOrBefore(month()) || showAdjacent()) {\n @if (showWeek() && $first) {\n <button\n disabled\n tabindex=\"-1\"\n type=\"button\"\n class=\"t-day\"\n >\n {{ day | tuiWeek }}\n </button>\n }\n <button\n tabindex=\"-1\"\n type=\"button\"\n class=\"t-day\"\n [attr.data-range]=\"getRange(day)\"\n [attr.data-type]=\"day | tuiMapper: dayType()\"\n [class.t-day_adjacent]=\"day.month !== month().month\"\n [class.t-day_end]=\"$last\"\n [class.t-day_hidden]=\"day.monthBefore(month()) && !showAdjacent()\"\n [class.t-day_start]=\"$first\"\n [class.t-day_today]=\"day.daySame(today)\"\n [disabled]=\"disabledItemHandler()(day)\"\n (click)=\"pick.emit(day)\"\n (mouseenter)=\"hovered.set(day)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || `${day.day}` as text; context: {$implicit: day}\">\n {{ text }}\n </ng-container>\n </button>\n }\n }\n}\n", styles: [":host{display:grid;inline-size:100%;color:var(--tui-text-secondary);font:var(--tui-typography-body-m);grid-template:2rem / repeat(7,1fr);gap:.25rem 0;place-items:center;isolation:isolate}:host._ww{grid-template:2rem / repeat(8,1fr)}.t-day{position:relative;inline-size:100%;min-block-size:var(--tui-height-s);padding:0;border:0;background:transparent;font:inherit;color:var(--tui-text-primary);cursor:pointer;overflow:hidden}.t-day:has([tuiTitle]){min-block-size:var(--tui-height-m)}.t-day:has([tuiTitle]):before{min-inline-size:var(--tui-height-m);border-radius:var(--tui-radius-m)}.t-day:has([tuiTitle]):after{display:none}.t-day ::ng-deep [tuiTitle]{gap:.125rem;text-align:center}.t-day ::ng-deep [tuiTitle] [tuiSubtitle]{color:var(--tui-text-secondary);font:var(--tui-typography-ui-xs)}.t-day ::ng-deep [tuiTitle] [tuiSubtitle]:before{content:\"\\200b\"}.t-day:before{content:\"\";position:absolute;inset:50%;z-index:-1;block-size:100%;min-inline-size:var(--tui-height-s);aspect-ratio:1;border-radius:100%;transform:translate(calc(var(--tui-inline) * -50%),-50%)}.t-day:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-day_adjacent{opacity:var(--tui-disabled-opacity)}.t-day_hidden{visibility:hidden}.t-day_today:after{content:\"\";position:absolute;inset-block-end:.25rem;inset-inline-start:50%;margin-inline-start:-.125rem;inline-size:.25rem;block-size:.25rem;border-radius:100%;background:var(--tui-background-accent-1)}.t-day_start{border-start-start-radius:var(--tui-radius-s);border-end-start-radius:var(--tui-radius-s)}.t-day_end{border-start-end-radius:var(--tui-radius-s);border-end-end-radius:var(--tui-radius-s)}.t-day[data-range=single],.t-day[data-range=start],.t-day[data-range=end]{color:var(--tui-text-primary-on-accent-1)}.t-day[data-range=single] ::ng-deep [tuiSubtitle],.t-day[data-range=start] ::ng-deep [tuiSubtitle],.t-day[data-range=end] ::ng-deep [tuiSubtitle]{color:inherit}.t-day[data-range=single]:before,.t-day[data-range=start]:before,.t-day[data-range=end]:before{background:var(--tui-background-accent-1)}.t-day[data-range=single]:after,.t-day[data-range=start]:after,.t-day[data-range=end]:after{background:currentColor}.t-day[data-range=start]:before{box-shadow:calc(var(--tui-inline) * 11rem) 0 0 10rem var(--tui-background-neutral-1)}.t-day[data-range=end]:before{box-shadow:calc(var(--tui-inline) * -11rem) 0 0 10rem var(--tui-background-neutral-1)}.t-day[data-range=middle]:before{box-shadow:0 0 0 10rem var(--tui-background-neutral-1),inset 0 0 0 10rem var(--tui-background-neutral-1)}@media(hover:hover)and (pointer:fine){.t-day:hover:before{background:var(--tui-background-neutral-1-hover)}.t-day[data-range=single]:hover:before,.t-day[data-range=start]:hover:before,.t-day[data-range=end]:hover:before{background:var(--tui-background-accent-1-hover)}}[data-type~=weekend]{color:var(--tui-text-action)}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "pipe", type: TuiCalendarSheetPipe, name: "tuiCalendarSheet" }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "pipe", type: TuiWeekPipe, name: "tuiWeek" }, { kind: "pipe", type: UpperCasePipe, name: "uppercase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
51
92
|
}
|
|
52
93
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiCalendar, decorators: [{
|
|
53
94
|
type: Component,
|
|
54
|
-
args: [{ selector: 'tui-calendar[new]', imports: [
|
|
95
|
+
args: [{ selector: 'tui-calendar[new]', imports: [
|
|
96
|
+
PolymorpheusOutlet,
|
|
97
|
+
TuiCalendarSheetPipe,
|
|
98
|
+
TuiMapperPipe,
|
|
99
|
+
TuiWeekPipe,
|
|
100
|
+
UpperCasePipe,
|
|
101
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
102
|
+
'[class._ww]': 'showWeek()',
|
|
103
|
+
'(mouseleave)': 'hovered.set(null)',
|
|
104
|
+
}, template: "@if (showWeek()) {\n <span>#</span>\n}\n@for (day of week(); track $index) {\n <span [attr.data-type]=\"getType(day)\">{{ day.slice(0, 2) | uppercase }}</span>\n}\n@for (week of month() | tuiCalendarSheet: true; track week) {\n @for (day of week; track day) {\n @if (day.monthSameOrBefore(month()) || showAdjacent()) {\n @if (showWeek() && $first) {\n <button\n disabled\n tabindex=\"-1\"\n type=\"button\"\n class=\"t-day\"\n >\n {{ day | tuiWeek }}\n </button>\n }\n <button\n tabindex=\"-1\"\n type=\"button\"\n class=\"t-day\"\n [attr.data-range]=\"getRange(day)\"\n [attr.data-type]=\"day | tuiMapper: dayType()\"\n [class.t-day_adjacent]=\"day.month !== month().month\"\n [class.t-day_end]=\"$last\"\n [class.t-day_hidden]=\"day.monthBefore(month()) && !showAdjacent()\"\n [class.t-day_start]=\"$first\"\n [class.t-day_today]=\"day.daySame(today)\"\n [disabled]=\"disabledItemHandler()(day)\"\n (click)=\"pick.emit(day)\"\n (mouseenter)=\"hovered.set(day)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || `${day.day}` as text; context: {$implicit: day}\">\n {{ text }}\n </ng-container>\n </button>\n }\n }\n}\n", styles: [":host{display:grid;inline-size:100%;color:var(--tui-text-secondary);font:var(--tui-typography-body-m);grid-template:2rem / repeat(7,1fr);gap:.25rem 0;place-items:center;isolation:isolate}:host._ww{grid-template:2rem / repeat(8,1fr)}.t-day{position:relative;inline-size:100%;min-block-size:var(--tui-height-s);padding:0;border:0;background:transparent;font:inherit;color:var(--tui-text-primary);cursor:pointer;overflow:hidden}.t-day:has([tuiTitle]){min-block-size:var(--tui-height-m)}.t-day:has([tuiTitle]):before{min-inline-size:var(--tui-height-m);border-radius:var(--tui-radius-m)}.t-day:has([tuiTitle]):after{display:none}.t-day ::ng-deep [tuiTitle]{gap:.125rem;text-align:center}.t-day ::ng-deep [tuiTitle] [tuiSubtitle]{color:var(--tui-text-secondary);font:var(--tui-typography-ui-xs)}.t-day ::ng-deep [tuiTitle] [tuiSubtitle]:before{content:\"\\200b\"}.t-day:before{content:\"\";position:absolute;inset:50%;z-index:-1;block-size:100%;min-inline-size:var(--tui-height-s);aspect-ratio:1;border-radius:100%;transform:translate(calc(var(--tui-inline) * -50%),-50%)}.t-day:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-day_adjacent{opacity:var(--tui-disabled-opacity)}.t-day_hidden{visibility:hidden}.t-day_today:after{content:\"\";position:absolute;inset-block-end:.25rem;inset-inline-start:50%;margin-inline-start:-.125rem;inline-size:.25rem;block-size:.25rem;border-radius:100%;background:var(--tui-background-accent-1)}.t-day_start{border-start-start-radius:var(--tui-radius-s);border-end-start-radius:var(--tui-radius-s)}.t-day_end{border-start-end-radius:var(--tui-radius-s);border-end-end-radius:var(--tui-radius-s)}.t-day[data-range=single],.t-day[data-range=start],.t-day[data-range=end]{color:var(--tui-text-primary-on-accent-1)}.t-day[data-range=single] ::ng-deep [tuiSubtitle],.t-day[data-range=start] ::ng-deep [tuiSubtitle],.t-day[data-range=end] ::ng-deep [tuiSubtitle]{color:inherit}.t-day[data-range=single]:before,.t-day[data-range=start]:before,.t-day[data-range=end]:before{background:var(--tui-background-accent-1)}.t-day[data-range=single]:after,.t-day[data-range=start]:after,.t-day[data-range=end]:after{background:currentColor}.t-day[data-range=start]:before{box-shadow:calc(var(--tui-inline) * 11rem) 0 0 10rem var(--tui-background-neutral-1)}.t-day[data-range=end]:before{box-shadow:calc(var(--tui-inline) * -11rem) 0 0 10rem var(--tui-background-neutral-1)}.t-day[data-range=middle]:before{box-shadow:0 0 0 10rem var(--tui-background-neutral-1),inset 0 0 0 10rem var(--tui-background-neutral-1)}@media(hover:hover)and (pointer:fine){.t-day:hover:before{background:var(--tui-background-neutral-1-hover)}.t-day[data-range=single]:hover:before,.t-day[data-range=start]:hover:before,.t-day[data-range=end]:hover:before{background:var(--tui-background-accent-1-hover)}}[data-type~=weekend]{color:var(--tui-text-action)}\n"] }]
|
|
55
105
|
}] });
|
|
56
106
|
function convert(week) {
|
|
57
107
|
return [week[week.length - 1] || '', ...week.slice(0, week.length - 1)];
|
|
@@ -61,5 +111,5 @@ function convert(week) {
|
|
|
61
111
|
* Generated bundle index. Do not edit.
|
|
62
112
|
*/
|
|
63
113
|
|
|
64
|
-
export { TuiCalendar };
|
|
114
|
+
export { TUI_CALENDAR_DEFAULT_OPTIONS, TUI_CALENDAR_OPTIONS, TuiCalendar, TuiWeekPipe, tuiCalendarOptionsProvider };
|
|
65
115
|
//# sourceMappingURL=taiga-ui-experimental-components-calendar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-experimental-components-calendar.mjs","sources":["../../../projects/experimental/components/calendar/calendar.component.ts","../../../projects/experimental/components/calendar/calendar.component.html","../../../projects/experimental/components/calendar/taiga-ui-experimental-components-calendar.ts"],"sourcesContent":["import {coerceArray} from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {TuiDay, TuiDayRange, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {type TuiBooleanHandler} from '@taiga-ui/cdk/types';\nimport {\n TUI_CALENDAR_OPTIONS,\n TuiCalendarSheetPipe,\n} from '@taiga-ui/core/components/calendar';\nimport {TUI_SHORT_WEEK_DAYS} from '@taiga-ui/core/tokens';\n\n/**\n * @deprecated: work in progress, do not use!\n */\n@Component({\n selector: 'tui-calendar[new]',\n imports: [TuiCalendarSheetPipe, TuiMapperPipe],\n templateUrl: './calendar.component.html',\n styleUrl: './calendar.component.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {'(mouseleave)': 'hovered.set(null)'},\n})\nexport class TuiCalendar {\n private readonly options = inject(TUI_CALENDAR_OPTIONS);\n private readonly days = inject(TUI_SHORT_WEEK_DAYS);\n\n protected readonly today = TuiDay.currentLocal();\n protected readonly hovered = signal<TuiDay | null>(null);\n protected readonly dayType = inject(TUI_CALENDAR_OPTIONS).dayType;\n\n protected readonly week = computed((week = convert(this.days())) => [\n ...week.slice(this.options.weekStart()),\n ...week.slice(0, this.options.weekStart()),\n ]);\n\n public readonly pick = output<TuiDay>();\n public readonly month = input(TuiMonth.currentLocal());\n public readonly value = input<TuiDay | TuiDayRange | readonly TuiDay[] | null>(null);\n\n public readonly disabledItemHandler =\n input<TuiBooleanHandler<TuiDay>>(TUI_FALSE_HANDLER);\n\n protected getRange(day: TuiDay): 'end' | 'middle' | 'single' | 'start' | null {\n const value = this.value() || [];\n\n if (!(value instanceof TuiDayRange)) {\n return coerceArray(value).find((item) => day.daySame(item)) ? 'single' : null;\n }\n\n const hovered = this.hovered();\n\n const range =\n value.from === value.to && hovered\n ? TuiDayRange.sort(hovered, value.to)\n : value;\n\n if (range.isSingleDay && day.daySame(range.from)) {\n return 'single';\n }\n\n if (day.daySame(range.from)) {\n return 'start';\n }\n\n if (day.daySame(range.to)) {\n return 'end';\n }\n\n return range.dayInRange(day) ? 'middle' : null;\n }\n}\n\nfunction convert(week: readonly string[]): readonly string[] {\n return [week[week.length - 1] || '', ...week.slice(0, week.length - 1)];\n}\n","@for (day of week(); track $index) {\n <span>{{ day }}</span>\n}\n@for (week of month() | tuiCalendarSheet: true; track week) {\n @for (day of week; track day) {\n <button\n tabindex=\"-1\"\n type=\"button\"\n class=\"t-day\"\n [attr.data-range]=\"getRange(day)\"\n [attr.data-type]=\"day | tuiMapper: dayType\"\n [class.t-day_adjacent]=\"day.month !== month().month\"\n [class.t-day_end]=\"$last\"\n [class.t-day_start]=\"$first\"\n [class.t-day_today]=\"day.daySame(today)\"\n [disabled]=\"disabledItemHandler()(day)\"\n (click)=\"pick.emit(day)\"\n (mouseenter)=\"hovered.set(day)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n {{ day.day }}\n </button>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAoBA;;AAEG;MASU,WAAW,CAAA;AARxB,IAAA,WAAA,GAAA;AASqB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACtC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAEhC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,YAAY,EAAE;AAC7B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAgB,IAAI,CAAC;AACrC,QAAA,IAA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q1BAwBA,EAAA,MAAA,EAAA,CAAA,ioEAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EDCc,oBAAoB,oDAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAMpC,WAAW,EAAA,UAAA,EAAA,CAAA;kBARvB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,OAAA,EACpB,CAAC,oBAAoB,EAAE,aAAa,CAAC,EAAA,eAAA,EAG7B,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC,EAAC,cAAc,EAAE,mBAAmB,EAAC,EAAA,QAAA,EAAA,q1BAAA,EAAA,MAAA,EAAA,CAAA,ioEAAA,CAAA,EAAA;;AAoD/C,SAAS,OAAO,CAAC,IAAuB,EAAA;IACpC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC3E;;AEnFA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-experimental-components-calendar.mjs","sources":["../../../projects/experimental/components/calendar/calendar.options.ts","../../../projects/experimental/components/calendar/week.pipe.ts","../../../projects/experimental/components/calendar/calendar.component.ts","../../../projects/experimental/components/calendar/calendar.component.html","../../../projects/experimental/components/calendar/taiga-ui-experimental-components-calendar.ts"],"sourcesContent":["import {type Signal, signal} from '@angular/core';\nimport {type TuiDay, TuiDayOfWeek} from '@taiga-ui/cdk/date-time';\nimport {type TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\n\nexport interface TuiCalendarOptions {\n readonly dayType: TuiHandler<TuiDay, string>;\n readonly weekFirstDay: Signal<number>;\n readonly showAdjacent: boolean;\n readonly showWeek: boolean;\n}\n\nexport const TUI_CALENDAR_DEFAULT_OPTIONS: TuiCalendarOptions = {\n dayType: (day) => (day.isWeekend ? 'weekend' : 'weekday'),\n weekFirstDay: signal(TuiDayOfWeek.Monday),\n showAdjacent: false,\n showWeek: false,\n};\n\nexport const [TUI_CALENDAR_OPTIONS, tuiCalendarOptionsProvider] = tuiCreateOptions(\n TUI_CALENDAR_DEFAULT_OPTIONS,\n);\n","import {Pipe, type PipeTransform} from '@angular/core';\nimport {TuiDay} from '@taiga-ui/cdk/date-time';\n\nconst ISO_MIN = 4;\n\n@Pipe({name: 'tuiWeek'})\nexport class TuiWeekPipe implements PipeTransform {\n public transform(day: TuiDay): number {\n const today = this.getWeek(day);\n const prev = this.getWeek(day.append({day: -7}));\n const next = this.getWeek(day.append({day: 7}));\n\n return next === 2 ? 1 : today || prev;\n }\n\n private getWeek(day: TuiDay): number {\n const beginning = new TuiDay(day.year, 0, 1);\n const delta = beginning.dayOfWeek();\n const first = ISO_MIN > 7 - delta ? 0 : 1;\n const sunday = day.append({day: 6 - day.dayOfWeek()});\n const offset = Math.floor(TuiDay.lengthBetween(beginning, sunday) / 7);\n\n return first + offset;\n }\n}\n","import {coerceArray} from '@angular/cdk/coercion';\nimport {UpperCasePipe} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {TuiDay, TuiDayRange, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {type TuiBooleanHandler, type TuiContext} from '@taiga-ui/cdk/types';\nimport {TuiCalendarSheetPipe} from '@taiga-ui/core/components/calendar';\nimport {TUI_SHORT_WEEK_DAYS} from '@taiga-ui/core/tokens';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TUI_CALENDAR_OPTIONS} from './calendar.options';\nimport {TuiWeekPipe} from './week.pipe';\n\n/**\n * @deprecated: work in progress, do not use!\n */\n@Component({\n selector: 'tui-calendar[new]',\n imports: [\n PolymorpheusOutlet,\n TuiCalendarSheetPipe,\n TuiMapperPipe,\n TuiWeekPipe,\n UpperCasePipe,\n ],\n templateUrl: './calendar.component.html',\n styleUrl: './calendar.component.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class._ww]': 'showWeek()',\n '(mouseleave)': 'hovered.set(null)',\n },\n})\nexport class TuiCalendar {\n private readonly days = inject(TUI_SHORT_WEEK_DAYS);\n private readonly options = inject(TUI_CALENDAR_OPTIONS);\n\n protected readonly today = TuiDay.currentLocal();\n protected readonly hovered = signal<TuiDay | null>(null);\n\n protected readonly week = computed((week = convert(this.days())) => [\n ...week.slice(this.options.weekFirstDay()),\n ...week.slice(0, this.options.weekFirstDay()),\n ]);\n\n public readonly pick = output<TuiDay>();\n public readonly month = input(TuiMonth.currentLocal());\n public readonly value = input<TuiDay | TuiDayRange | readonly TuiDay[] | null>(null);\n public readonly content = input<PolymorpheusContent<TuiContext<TuiDay>>>();\n public readonly dayType = input(this.options.dayType);\n public readonly showAdjacent = input(this.options.showAdjacent);\n public readonly showWeek = input(this.options.showWeek);\n\n public readonly disabledItemHandler =\n input<TuiBooleanHandler<TuiDay>>(TUI_FALSE_HANDLER);\n\n protected getRange(day: TuiDay): 'end' | 'middle' | 'single' | 'start' | null {\n const value = this.value() || [];\n\n if (!(value instanceof TuiDayRange)) {\n return coerceArray(value).find((item) => day.daySame(item)) ? 'single' : null;\n }\n\n const hovered = this.hovered();\n\n const range =\n value.from === value.to && hovered\n ? TuiDayRange.sort(hovered, value.to)\n : value;\n\n if (range.isSingleDay && day.daySame(range.from)) {\n return 'single';\n }\n\n if (day.daySame(range.from)) {\n return 'start';\n }\n\n if (day.daySame(range.to)) {\n return 'end';\n }\n\n return range.dayInRange(day) ? 'middle' : null;\n }\n\n protected getType(day: string): string {\n return day === this.days()[5] || day === this.days()[6] ? 'weekend' : '';\n }\n}\n\nfunction convert(week: readonly string[]): readonly string[] {\n return [week[week.length - 1] || '', ...week.slice(0, week.length - 1)];\n}\n","@if (showWeek()) {\n <span>#</span>\n}\n@for (day of week(); track $index) {\n <span [attr.data-type]=\"getType(day)\">{{ day.slice(0, 2) | uppercase }}</span>\n}\n@for (week of month() | tuiCalendarSheet: true; track week) {\n @for (day of week; track day) {\n @if (day.monthSameOrBefore(month()) || showAdjacent()) {\n @if (showWeek() && $first) {\n <button\n disabled\n tabindex=\"-1\"\n type=\"button\"\n class=\"t-day\"\n >\n {{ day | tuiWeek }}\n </button>\n }\n <button\n tabindex=\"-1\"\n type=\"button\"\n class=\"t-day\"\n [attr.data-range]=\"getRange(day)\"\n [attr.data-type]=\"day | tuiMapper: dayType()\"\n [class.t-day_adjacent]=\"day.month !== month().month\"\n [class.t-day_end]=\"$last\"\n [class.t-day_hidden]=\"day.monthBefore(month()) && !showAdjacent()\"\n [class.t-day_start]=\"$first\"\n [class.t-day_today]=\"day.daySame(today)\"\n [disabled]=\"disabledItemHandler()(day)\"\n (click)=\"pick.emit(day)\"\n (mouseenter)=\"hovered.set(day)\"\n (pointerdown.prevent.zoneless)=\"(0)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || `${day.day}` as text; context: {$implicit: day}\">\n {{ text }}\n </ng-container>\n </button>\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAYO,MAAM,4BAA4B,GAAuB;AAC5D,IAAA,OAAO,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AACzD,IAAA,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;AACzC,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,QAAQ,EAAE,KAAK;;AAGZ,MAAM,C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C,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC3E;;AErGA;;AAEG;;;;"}
|
|
@@ -16,11 +16,11 @@ class TuiDataGrid {
|
|
|
16
16
|
this.disabledItemHandler = input(TUI_FALSE_HANDLER);
|
|
17
17
|
}
|
|
18
18
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiDataGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
19
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TuiDataGrid, isStandalone: true, selector: "tui-data-grid", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabledItemHandler: { classPropertyName: "disabledItemHandler", publicName: "disabledItemHandler", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pick: "pick" }, ngImport: i0, template: "@for (item of items(); track item) {\n <button\n type=\"button\"\n class=\"t-item\"\n [class.t-item_active]=\"value().includes(item)\"\n [disabled]=\"disabledItemHandler()(item)\"\n (click)=\"pick.emit(item)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || `${item}` as text; context: {$implicit: item}\">\n {{ text }}\n </ng-container>\n </button>\n}\n", styles: [":host{display:grid;inline-size:100%;grid-template-columns:repeat(3,calc(33% - .625rem));gap:1rem .5rem;place-content:center}.t-item{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;
|
|
19
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TuiDataGrid, isStandalone: true, selector: "tui-data-grid", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabledItemHandler: { classPropertyName: "disabledItemHandler", publicName: "disabledItemHandler", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pick: "pick" }, ngImport: i0, template: "@for (item of items(); track item) {\n <button\n type=\"button\"\n class=\"t-item\"\n [class.t-item_active]=\"value().includes(item)\"\n [disabled]=\"disabledItemHandler()(item)\"\n (click)=\"pick.emit(item)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || `${item}` as text; context: {$implicit: item}\">\n {{ text }}\n </ng-container>\n </button>\n}\n", styles: [":host{display:grid;inline-size:100%;grid-template-columns:repeat(3,calc(33% - .625rem));gap:1rem .5rem;place-content:center}.t-item{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:block;block-size:2.5rem;min-inline-size:0;border-radius:10rem;border:none;background:var(--tui-background-neutral-1);color:var(--tui-text-primary);font:var(--tui-typography-ui-s);white-space:nowrap}.t-item ::ng-deep [tuiTitle]{gap:.125rem;text-align:center}.t-item ::ng-deep [tuiTitle] [tuiSubtitle]{color:var(--tui-text-secondary);font:var(--tui-typography-ui-xs)}.t-item:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-item_active{background:var(--tui-background-accent-2);color:var(--tui-text-primary-on-accent-2)}.t-item_active ::ng-deep [tuiTitle] [tuiSubtitle]{color:inherit}@media(hover:hover)and (pointer:fine){.t-item:hover{background:var(--tui-background-neutral-1-hover);cursor:pointer}.t-item_active:hover{background:var(--tui-background-accent-2-hover)}}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
20
20
|
}
|
|
21
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiDataGrid, decorators: [{
|
|
22
22
|
type: Component,
|
|
23
|
-
args: [{ selector: 'tui-data-grid', imports: [PolymorpheusOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (item of items(); track item) {\n <button\n type=\"button\"\n class=\"t-item\"\n [class.t-item_active]=\"value().includes(item)\"\n [disabled]=\"disabledItemHandler()(item)\"\n (click)=\"pick.emit(item)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || `${item}` as text; context: {$implicit: item}\">\n {{ text }}\n </ng-container>\n </button>\n}\n", styles: [":host{display:grid;inline-size:100%;grid-template-columns:repeat(3,calc(33% - .625rem));gap:1rem .5rem;place-content:center}.t-item{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;
|
|
23
|
+
args: [{ selector: 'tui-data-grid', imports: [PolymorpheusOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (item of items(); track item) {\n <button\n type=\"button\"\n class=\"t-item\"\n [class.t-item_active]=\"value().includes(item)\"\n [disabled]=\"disabledItemHandler()(item)\"\n (click)=\"pick.emit(item)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || `${item}` as text; context: {$implicit: item}\">\n {{ text }}\n </ng-container>\n </button>\n}\n", styles: [":host{display:grid;inline-size:100%;grid-template-columns:repeat(3,calc(33% - .625rem));gap:1rem .5rem;place-content:center}.t-item{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:block;block-size:2.5rem;min-inline-size:0;border-radius:10rem;border:none;background:var(--tui-background-neutral-1);color:var(--tui-text-primary);font:var(--tui-typography-ui-s);white-space:nowrap}.t-item ::ng-deep [tuiTitle]{gap:.125rem;text-align:center}.t-item ::ng-deep [tuiTitle] [tuiSubtitle]{color:var(--tui-text-secondary);font:var(--tui-typography-ui-xs)}.t-item:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}.t-item_active{background:var(--tui-background-accent-2);color:var(--tui-text-primary-on-accent-2)}.t-item_active ::ng-deep [tuiTitle] [tuiSubtitle]{color:inherit}@media(hover:hover)and (pointer:fine){.t-item:hover{background:var(--tui-background-neutral-1-hover);cursor:pointer}.t-item_active:hover{background:var(--tui-background-accent-2-hover)}}\n"] }]
|
|
24
24
|
}] });
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-experimental-components-data-grid.mjs","sources":["../../../projects/experimental/components/data-grid/data-grid.component.ts","../../../projects/experimental/components/data-grid/data-grid.component.html","../../../projects/experimental/components/data-grid/taiga-ui-experimental-components-data-grid.ts"],"sourcesContent":["import {coerceArray} from '@angular/cdk/coercion';\nimport {ChangeDetectionStrategy, Component, input, output} from '@angular/core';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {type TuiBooleanHandler, type TuiContext} from '@taiga-ui/cdk/types';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\n/**\n * @deprecated: work in progress, do not use!\n */\n@Component({\n selector: 'tui-data-grid',\n imports: [PolymorpheusOutlet],\n templateUrl: './data-grid.component.html',\n styleUrl: './data-grid.component.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiDataGrid<T> {\n public readonly pick = output<T>();\n public readonly items = input<readonly T[]>([]);\n public readonly content = input<PolymorpheusContent<TuiContext<T>>>();\n public readonly value = input([], {transform: coerceArray<T>});\n public readonly disabledItemHandler = input<TuiBooleanHandler<T>>(TUI_FALSE_HANDLER);\n}\n","@for (item of items(); track item) {\n <button\n type=\"button\"\n class=\"t-item\"\n [class.t-item_active]=\"value().includes(item)\"\n [disabled]=\"disabledItemHandler()(item)\"\n (click)=\"pick.emit(item)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || `${item}` as text; context: {$implicit: item}\">\n {{ text }}\n </ng-container>\n </button>\n}\n","/**\n * Generated bundle index. Do not edit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AAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChBxB,gbAaA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"taiga-ui-experimental-components-data-grid.mjs","sources":["../../../projects/experimental/components/data-grid/data-grid.component.ts","../../../projects/experimental/components/data-grid/data-grid.component.html","../../../projects/experimental/components/data-grid/taiga-ui-experimental-components-data-grid.ts"],"sourcesContent":["import {coerceArray} from '@angular/cdk/coercion';\nimport {ChangeDetectionStrategy, Component, input, output} from '@angular/core';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {type TuiBooleanHandler, type TuiContext} from '@taiga-ui/cdk/types';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\n/**\n * @deprecated: work in progress, do not use!\n */\n@Component({\n selector: 'tui-data-grid',\n imports: [PolymorpheusOutlet],\n templateUrl: './data-grid.component.html',\n styleUrl: './data-grid.component.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiDataGrid<T> {\n public readonly pick = output<T>();\n public readonly items = input<readonly T[]>([]);\n public readonly content = input<PolymorpheusContent<TuiContext<T>>>();\n public readonly value = input([], {transform: coerceArray<T>});\n public readonly disabledItemHandler = input<TuiBooleanHandler<T>>(TUI_FALSE_HANDLER);\n}\n","@for (item of items(); track item) {\n <button\n type=\"button\"\n class=\"t-item\"\n [class.t-item_active]=\"value().includes(item)\"\n [disabled]=\"disabledItemHandler()(item)\"\n (click)=\"pick.emit(item)\"\n >\n <ng-container *polymorpheusOutlet=\"content() || `${item}` as text; context: {$implicit: item}\">\n {{ text }}\n </ng-container>\n </button>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMA;;AAEG;MAQU,WAAW,CAAA;AAPxB,IAAA,WAAA,GAAA;QAQoB,IAAA,CAAA,IAAI,GAAG,MAAM,EAAK;AAClB,QAAA,IAAA,CA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A,IAAA,EDFc,kBAAkB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,2BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAKnB,WAAW,EAAA,UAAA,EAAA,CAAA;kBAPvB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,WAChB,CAAC,kBAAkB,CAAC,EAAA,eAAA,EAGZ,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,gbAAA,EAAA,MAAA,EAAA,CAAA,shCAAA,CAAA,EAAA;;;AEdnD;;AAEG;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
2
|
import { coerceArray } from '@angular/cdk/coercion';
|
|
3
|
-
import {
|
|
3
|
+
import { inject, viewChild, computed, effect, model, input, Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
|
-
import { TuiDayRange, TuiMonth } from '@taiga-ui/cdk/date-time';
|
|
5
|
+
import { TuiDayRange, TuiMonth, TuiDay } from '@taiga-ui/cdk/date-time';
|
|
6
6
|
import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
|
|
7
7
|
import { tuiProvide } from '@taiga-ui/cdk/utils/di';
|
|
8
8
|
import { tuiArrayToggle } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
@@ -13,12 +13,13 @@ import { TuiLink } from '@taiga-ui/core/components/link';
|
|
|
13
13
|
import { tuiTextfieldOptionsProvider } from '@taiga-ui/core/components/textfield';
|
|
14
14
|
import { TUI_DROPDOWN_HOST } from '@taiga-ui/core/portals/dropdown';
|
|
15
15
|
import { TUI_COMMON_ICONS, TUI_SPIN_TEXTS, TUI_MONTHS, tuiAsAuxiliary } from '@taiga-ui/core/tokens';
|
|
16
|
-
import { TuiCalendar } from '@taiga-ui/experimental/components/calendar';
|
|
16
|
+
import { TUI_CALENDAR_OPTIONS, TuiCalendar } from '@taiga-ui/experimental/components/calendar';
|
|
17
17
|
import { TuiDataGrid } from '@taiga-ui/experimental/components/data-grid';
|
|
18
18
|
import { TuiInputDate } from '@taiga-ui/kit/components/input-date';
|
|
19
19
|
import { TuiInputDateMulti } from '@taiga-ui/kit/components/input-date-multi';
|
|
20
20
|
import { TuiInputDateRange } from '@taiga-ui/kit/components/input-date-range';
|
|
21
21
|
import { TuiChevron } from '@taiga-ui/kit/directives/chevron';
|
|
22
|
+
import { TuiElasticContainer } from '@taiga-ui/layout/components/elastic-container';
|
|
22
23
|
import { TuiSlides } from '@taiga-ui/layout/components/slides';
|
|
23
24
|
|
|
24
25
|
/**
|
|
@@ -27,26 +28,27 @@ import { TuiSlides } from '@taiga-ui/layout/components/slides';
|
|
|
27
28
|
let TuiDatePicker = class TuiDatePicker extends AbstractTuiCalendar {
|
|
28
29
|
constructor() {
|
|
29
30
|
super(...arguments);
|
|
31
|
+
this.options = inject(TUI_CALENDAR_OPTIONS);
|
|
30
32
|
this.carousel = viewChild(TuiCarouselComponent);
|
|
31
33
|
this.icons = inject(TUI_COMMON_ICONS);
|
|
32
34
|
this.texts = inject(TUI_SPIN_TEXTS);
|
|
33
35
|
this.i18n = inject(TUI_MONTHS);
|
|
34
36
|
this.dropdown = inject(TUI_DROPDOWN_HOST, { optional: true });
|
|
35
|
-
this.content = computed(() => (c) => this.i18n()[c.$implicit]);
|
|
37
|
+
this.content = computed(() => (c) => this.i18n()[c.$implicit.month]);
|
|
36
38
|
this.years = computed((value = this.value()) => value instanceof TuiDayRange
|
|
37
39
|
? Array.from({ length: value.to.year - value.from.year + 1 }, (_, index) => value.from.year + index)
|
|
38
40
|
: Array.from(new Set(coerceArray(value ?? []).map(({ year }) => year))));
|
|
39
|
-
this.
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
this.year = computed(() => Array.from({ length: 12 }, (_, index) => new TuiMonth(this.month().year, index)));
|
|
42
|
+
this.months = computed((value = this.value()) => this.year().filter((month) => value instanceof TuiDayRange
|
|
43
|
+
? value.monthInRange(month)
|
|
44
|
+
: coerceArray(value ?? []).some((day) => day.monthSame(month))));
|
|
42
45
|
this.button = computed(() => this.view() === 'day'
|
|
43
46
|
? `${this.i18n()[this.month().month]} ${this.month().formattedYear}`
|
|
44
47
|
: this.month().formattedYear);
|
|
45
48
|
this.yearMin = computed(() => Math.ceil((this.min().year - this.month().year - 5) / 12));
|
|
46
49
|
this.yearMax = computed(() => Math.floor((this.max().year - this.month().year + 6) / 12));
|
|
47
50
|
this.disabledDay = computed(() => (day) => day < this.min() || day > this.max() || this.disabledItemHandler()(day));
|
|
48
|
-
this.disabledMonth = computed(() => (month) => this.
|
|
49
|
-
this.month().year * 12 + month > this.max().year * 12 + this.max().month);
|
|
51
|
+
this.disabledMonth = computed(() => (month) => month.monthBefore(this.min()) || month.monthAfter(this.max()));
|
|
50
52
|
this.disabledYear = computed(() => (year) => year < this.min().year || year > this.max().year);
|
|
51
53
|
this.start = computed((carousel = this.carousel()) => this.view() === 'month'
|
|
52
54
|
? this.month().year === this.min().year
|
|
@@ -54,8 +56,21 @@ let TuiDatePicker = class TuiDatePicker extends AbstractTuiCalendar {
|
|
|
54
56
|
this.end = computed((carousel = this.carousel()) => this.view() === 'month'
|
|
55
57
|
? this.month().year === this.max().year
|
|
56
58
|
: carousel?.index() === carousel?.max());
|
|
59
|
+
this.sync = effect(() => {
|
|
60
|
+
const value = this.value();
|
|
61
|
+
const [day] = value instanceof TuiDayRange ? [value.from] : coerceArray(value);
|
|
62
|
+
if (!day || day.year < 9000) {
|
|
63
|
+
this.month.update(({ month, year }) => (day || new TuiDay(year, month, 1)).dayLimit(this.min(), this.max()));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
57
66
|
this.view = model('day');
|
|
58
67
|
this.mode = input();
|
|
68
|
+
this.contentDay = input();
|
|
69
|
+
this.contentMonth = input();
|
|
70
|
+
this.contentYear = input();
|
|
71
|
+
this.dayType = input(this.options.dayType);
|
|
72
|
+
this.showAdjacent = input(this.options.showAdjacent);
|
|
73
|
+
this.showWeek = input(this.options.showWeek);
|
|
59
74
|
}
|
|
60
75
|
getMonth(index) {
|
|
61
76
|
return new TuiMonth(Math.floor(index / 12), index % 12);
|
|
@@ -73,17 +88,11 @@ let TuiDatePicker = class TuiDatePicker extends AbstractTuiCalendar {
|
|
|
73
88
|
this.month.update(({ month }) => new TuiMonth(year, month));
|
|
74
89
|
this.view.set('month');
|
|
75
90
|
}
|
|
76
|
-
onMonth(
|
|
77
|
-
this.month.
|
|
91
|
+
onMonth(month) {
|
|
92
|
+
this.month.set(month);
|
|
78
93
|
this.view.set('day');
|
|
79
94
|
}
|
|
80
95
|
onDay(day) {
|
|
81
|
-
if (day.monthAfter(this.month())) {
|
|
82
|
-
this.carousel()?.next();
|
|
83
|
-
}
|
|
84
|
-
else if (day.monthBefore(this.month())) {
|
|
85
|
-
this.carousel()?.prev();
|
|
86
|
-
}
|
|
87
96
|
if (this.mode() === 'range') {
|
|
88
97
|
this.value.update((value) => value instanceof TuiDayRange && value.from === value.to
|
|
89
98
|
? TuiDayRange.sort(value.to, day.append({}))
|
|
@@ -109,6 +118,7 @@ TuiDatePicker = __decorate([
|
|
|
109
118
|
TuiCarousel,
|
|
110
119
|
TuiChevron,
|
|
111
120
|
TuiDataGrid,
|
|
121
|
+
TuiElasticContainer,
|
|
112
122
|
TuiInputDate,
|
|
113
123
|
TuiInputDateMulti,
|
|
114
124
|
TuiInputDateRange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-experimental-components-date-picker.mjs","sources":["../../../projects/experimental/components/date-picker/date-picker.component.ts","../../../projects/experimental/components/date-picker/taiga-ui-experimental-components-date-picker.ts"],"sourcesContent":["import {coerceArray} from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {type TuiDay, TuiDayRange, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/di';\nimport {tuiArrayToggle} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiButton, tuiButtonOptionsProvider} from '@taiga-ui/core/components/button';\nimport {AbstractTuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {TuiCarousel, TuiCarouselComponent} from '@taiga-ui/core/components/carousel';\nimport {TuiLink} from '@taiga-ui/core/components/link';\nimport {tuiTextfieldOptionsProvider} from '@taiga-ui/core/components/textfield';\nimport {TUI_DROPDOWN_HOST} from '@taiga-ui/core/portals/dropdown';\nimport {\n TUI_COMMON_ICONS,\n TUI_MONTHS,\n TUI_SPIN_TEXTS,\n tuiAsAuxiliary,\n} from '@taiga-ui/core/tokens';\nimport {TuiCalendar} from '@taiga-ui/experimental/components/calendar';\nimport {TuiDataGrid} from '@taiga-ui/experimental/components/data-grid';\nimport {TuiInputDate} from '@taiga-ui/kit/components/input-date';\nimport {TuiInputDateMulti} from '@taiga-ui/kit/components/input-date-multi';\nimport {TuiInputDateRange} from '@taiga-ui/kit/components/input-date-range';\nimport {TuiChevron} from '@taiga-ui/kit/directives/chevron';\nimport {TuiSlides} from '@taiga-ui/layout/components/slides';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\ntype DatePicker<T> = T extends 'single'\n ? TuiDay\n : T extends 'multi'\n ? readonly TuiDay[]\n : TuiDayRange;\n\n/**\n * @deprecated: work in progress, do not use!\n */\n@Component({\n selector: 'tui-date-picker',\n imports: [\n FormsModule,\n TuiButton,\n TuiCalendar,\n TuiCarousel,\n TuiChevron,\n TuiDataGrid,\n TuiInputDate,\n TuiInputDateMulti,\n TuiInputDateRange,\n TuiLink,\n TuiMapperPipe,\n TuiSlides,\n ],\n templateUrl: './date-picker.component.html',\n styleUrl: './date-picker.component.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsAuxiliary(TuiDatePicker),\n tuiProvide(AbstractTuiCalendar, TuiDatePicker),\n tuiButtonOptionsProvider({size: 'xs', appearance: 'flat'}),\n tuiTextfieldOptionsProvider({size: signal('m'), cleaner: signal(false)}),\n ],\n})\nexport class TuiDatePicker<\n T extends 'multi' | 'range' | 'single' = 'single',\n> extends AbstractTuiCalendar<DatePicker<T>> {\n protected readonly carousel = viewChild(TuiCarouselComponent);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly texts = inject(TUI_SPIN_TEXTS);\n protected readonly i18n = inject(TUI_MONTHS);\n protected readonly dropdown = inject(TUI_DROPDOWN_HOST, {optional: true});\n\n protected readonly content = computed<PolymorpheusContent<TuiContext<number>>>(\n () => (c) => this.i18n()[c.$implicit],\n );\n\n protected readonly years = computed((value = this.value()) =>\n value instanceof TuiDayRange\n ? Array.from(\n {length: value.to.year - value.from.year + 1},\n (_, index) => value.from.year + index,\n )\n : Array.from(new Set(coerceArray<TuiDay>(value ?? []).map(({year}) => year))),\n );\n\n protected readonly months = computed((value = this.value()) =>\n Array.from({length: 12}, (_, index) => index).filter((index) =>\n value instanceof TuiDayRange\n ? value.monthInRange(new TuiMonth(this.month().year, index))\n : coerceArray<TuiDay>(value ?? []).some(\n ({month, year}) => this.month().year === year && index === month,\n ),\n ),\n );\n\n protected readonly button = computed(() =>\n this.view() === 'day'\n ? `${this.i18n()[this.month().month]} ${this.month().formattedYear}`\n : this.month().formattedYear,\n );\n\n protected readonly yearMin = computed(() =>\n Math.ceil((this.min().year - this.month().year - 5) / 12),\n );\n\n protected readonly yearMax = computed(() =>\n Math.floor((this.max().year - this.month().year + 6) / 12),\n );\n\n protected readonly disabledDay = computed(\n () => (day: TuiDay) =>\n day < this.min() || day > this.max() || this.disabledItemHandler()(day),\n );\n\n protected readonly disabledMonth = computed(\n () => (month: number) =>\n this.month().year * 12 + month < this.min().year * 12 + this.min().month ||\n this.month().year * 12 + month > this.max().year * 12 + this.max().month,\n );\n\n protected readonly disabledYear = computed(\n () => (year: number) => year < this.min().year || year > this.max().year,\n );\n\n protected readonly start = computed((carousel = this.carousel()) =>\n this.view() === 'month'\n ? this.month().year === this.min().year\n : carousel?.index() === carousel?.min(),\n );\n\n protected readonly end = computed((carousel = this.carousel()) =>\n this.view() === 'month'\n ? this.month().year === this.max().year\n : carousel?.index() === carousel?.max(),\n );\n\n public readonly view = model<'day' | 'month' | 'year'>('day');\n public readonly mode = input<T>();\n\n protected getMonth(index: number): TuiMonth {\n return new TuiMonth(Math.floor(index / 12), index % 12);\n }\n\n protected getItems(initial: number): readonly number[] {\n return Array.from({length: 12}, (_, index) => initial + index);\n }\n\n protected onSpin(step: number): void {\n this.carousel()?.[step > 0 ? 'next' : 'prev']();\n\n if (this.view() === 'month') {\n this.month.update((month) => month.append({year: step}));\n }\n }\n\n protected onYear(year: number): void {\n this.month.update(({month}) => new TuiMonth(year, month));\n this.view.set('month');\n }\n\n protected onMonth(index: number): void {\n this.month.update(({year}) => new TuiMonth(year, index));\n this.view.set('day');\n }\n\n protected onDay(day: TuiDay): void {\n if (day.monthAfter(this.month())) {\n this.carousel()?.next();\n } else if (day.monthBefore(this.month())) {\n this.carousel()?.prev();\n }\n\n if (this.mode() === 'range') {\n this.value.update((value): any =>\n value instanceof TuiDayRange && value.from === value.to\n ? TuiDayRange.sort(value.to, day.append({}))\n : new TuiDayRange(day, day),\n );\n } else if (this.mode() === 'multi') {\n this.value.update((value): any =>\n Array.isArray(value)\n ? tuiArrayToggle(value, day, (a: TuiDay, b: TuiDay) => a.daySame(b))\n : [day],\n );\n } else {\n this.value.set(day as any);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4CA;;AAEG;AA2BI,IAAM,aAAa,GAAnB,MAAM,aAEX,SAAQ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8BAA8B;AAC3C,QAAA,QAAQ,EAAE,8BAA8B;QACxC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,QAAA,SAAS,EAAE;YACP,cAAc,CAAC,aAAa,CAAC;AAC7B,YAAA,UAAU,CAAC,mBAAmB,EAAE,aAAa,CAAC;YAC9C,wBAAwB,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAC,CAAC;AAC1D,YAAA,2BAA2B,CAAC,EAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAC,CAAC;AAC3E,SAAA;KACJ;AACY,CAAA,EAAA,aAAa,CA6HzB;;ACtMD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-experimental-components-date-picker.mjs","sources":["../../../projects/experimental/components/date-picker/date-picker.component.ts","../../../projects/experimental/components/date-picker/taiga-ui-experimental-components-date-picker.ts"],"sourcesContent":["import {coerceArray} from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TuiDay, TuiDayRange, TuiMonth} from '@taiga-ui/cdk/date-time';\nimport {TuiMapperPipe} from '@taiga-ui/cdk/pipes/mapper';\nimport {type TuiBooleanHandler, type TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/di';\nimport {tuiArrayToggle} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiButton, tuiButtonOptionsProvider} from '@taiga-ui/core/components/button';\nimport {AbstractTuiCalendar} from '@taiga-ui/core/components/calendar';\nimport {TuiCarousel, TuiCarouselComponent} from '@taiga-ui/core/components/carousel';\nimport {TuiLink} from '@taiga-ui/core/components/link';\nimport {tuiTextfieldOptionsProvider} from '@taiga-ui/core/components/textfield';\nimport {TUI_DROPDOWN_HOST} from '@taiga-ui/core/portals/dropdown';\nimport {\n TUI_COMMON_ICONS,\n TUI_MONTHS,\n TUI_SPIN_TEXTS,\n tuiAsAuxiliary,\n} from '@taiga-ui/core/tokens';\nimport {\n TUI_CALENDAR_OPTIONS,\n TuiCalendar,\n} from '@taiga-ui/experimental/components/calendar';\nimport {TuiDataGrid} from '@taiga-ui/experimental/components/data-grid';\nimport {TuiInputDate} from '@taiga-ui/kit/components/input-date';\nimport {TuiInputDateMulti} from '@taiga-ui/kit/components/input-date-multi';\nimport {TuiInputDateRange} from '@taiga-ui/kit/components/input-date-range';\nimport {TuiChevron} from '@taiga-ui/kit/directives/chevron';\nimport {TuiElasticContainer} from '@taiga-ui/layout/components/elastic-container';\nimport {TuiSlides} from '@taiga-ui/layout/components/slides';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\ntype DatePicker<T> = T extends 'single'\n ? TuiDay\n : T extends 'multi'\n ? readonly TuiDay[]\n : TuiDayRange;\n\n/**\n * @deprecated: work in progress, do not use!\n */\n@Component({\n selector: 'tui-date-picker',\n imports: [\n FormsModule,\n TuiButton,\n TuiCalendar,\n TuiCarousel,\n TuiChevron,\n TuiDataGrid,\n TuiElasticContainer,\n TuiInputDate,\n TuiInputDateMulti,\n TuiInputDateRange,\n TuiLink,\n TuiMapperPipe,\n TuiSlides,\n ],\n templateUrl: './date-picker.component.html',\n styleUrl: './date-picker.component.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiAsAuxiliary(TuiDatePicker),\n tuiProvide(AbstractTuiCalendar, TuiDatePicker),\n tuiButtonOptionsProvider({size: 'xs', appearance: 'flat'}),\n tuiTextfieldOptionsProvider({size: signal('m'), cleaner: signal(false)}),\n ],\n})\nexport class TuiDatePicker<\n T extends 'multi' | 'range' | 'single' = 'single',\n> extends AbstractTuiCalendar<DatePicker<T>> {\n protected readonly options = inject(TUI_CALENDAR_OPTIONS);\n protected readonly carousel = viewChild(TuiCarouselComponent);\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly texts = inject(TUI_SPIN_TEXTS);\n protected readonly i18n = inject(TUI_MONTHS);\n protected readonly dropdown = inject(TUI_DROPDOWN_HOST, {optional: true});\n\n protected readonly content = computed<PolymorpheusContent<TuiContext<TuiMonth>>>(\n () => (c) => this.i18n()[c.$implicit.month],\n );\n\n protected readonly years = computed((value = this.value()) =>\n value instanceof TuiDayRange\n ? Array.from(\n {length: value.to.year - value.from.year + 1},\n (_, index) => value.from.year + index,\n )\n : Array.from(new Set(coerceArray<TuiDay>(value ?? []).map(({year}) => year))),\n );\n\n protected readonly year = computed(() =>\n Array.from({length: 12}, (_, index) => new TuiMonth(this.month().year, index)),\n );\n\n protected readonly months = computed((value = this.value()) =>\n this.year().filter((month) =>\n value instanceof TuiDayRange\n ? value.monthInRange(month)\n : coerceArray<TuiDay>(value ?? []).some((day) => day.monthSame(month)),\n ),\n );\n\n protected readonly button = computed(() =>\n this.view() === 'day'\n ? `${this.i18n()[this.month().month]} ${this.month().formattedYear}`\n : this.month().formattedYear,\n );\n\n protected readonly yearMin = computed(() =>\n Math.ceil((this.min().year - this.month().year - 5) / 12),\n );\n\n protected readonly yearMax = computed(() =>\n Math.floor((this.max().year - this.month().year + 6) / 12),\n );\n\n protected readonly disabledDay = computed(\n () => (day: TuiDay) =>\n day < this.min() || day > this.max() || this.disabledItemHandler()(day),\n );\n\n protected readonly disabledMonth = computed<TuiBooleanHandler<TuiMonth>>(\n () => (month) => month.monthBefore(this.min()) || month.monthAfter(this.max()),\n );\n\n protected readonly disabledYear = computed(\n () => (year: number) => year < this.min().year || year > this.max().year,\n );\n\n protected readonly start = computed((carousel = this.carousel()) =>\n this.view() === 'month'\n ? this.month().year === this.min().year\n : carousel?.index() === carousel?.min(),\n );\n\n protected readonly end = computed((carousel = this.carousel()) =>\n this.view() === 'month'\n ? this.month().year === this.max().year\n : carousel?.index() === carousel?.max(),\n );\n\n protected readonly sync = effect(() => {\n const value = this.value();\n const [day] = value instanceof TuiDayRange ? [value.from] : coerceArray(value);\n\n if (!day || day.year < 9000) {\n this.month.update(({month, year}) =>\n (day || new TuiDay(year, month, 1)).dayLimit(this.min(), this.max()),\n );\n }\n });\n\n public readonly view = model<'day' | 'month' | 'year'>('day');\n public readonly mode = input<T>();\n public readonly contentDay = input<PolymorpheusContent<TuiContext<TuiDay>>>();\n public readonly contentMonth = input<PolymorpheusContent<TuiContext<TuiMonth>>>();\n public readonly contentYear = input<PolymorpheusContent<TuiContext<number>>>();\n public readonly dayType = input(this.options.dayType);\n public readonly showAdjacent = input(this.options.showAdjacent);\n public readonly showWeek = input(this.options.showWeek);\n\n protected getMonth(index: number): TuiMonth {\n return new TuiMonth(Math.floor(index / 12), index % 12);\n }\n\n protected getItems(initial: number): readonly number[] {\n return Array.from({length: 12}, (_, index) => initial + index);\n }\n\n protected onSpin(step: number): void {\n this.carousel()?.[step > 0 ? 'next' : 'prev']();\n\n if (this.view() === 'month') {\n this.month.update((month) => month.append({year: step}));\n }\n }\n\n protected onYear(year: number): void {\n this.month.update(({month}) => new TuiMonth(year, month));\n this.view.set('month');\n }\n\n protected onMonth(month: TuiMonth): void {\n this.month.set(month);\n this.view.set('day');\n }\n\n protected onDay(day: TuiDay): void {\n if (this.mode() === 'range') {\n this.value.update((value): any =>\n value instanceof TuiDayRange && value.from === value.to\n ? TuiDayRange.sort(value.to, day.append({}))\n : new TuiDayRange(day, day),\n );\n } else if (this.mode() === 'multi') {\n this.value.update((value): any =>\n Array.isArray(value)\n ? tuiArrayToggle(value, day, (a: TuiDay, b: TuiDay) => a.daySame(b))\n : [day],\n );\n } else {\n this.value.set(day as any);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiDA;;AAEG;AA4BI,IAAM,aAAa,GAAnB,MAAM,aAEX,SAAQ,mBAAkC,CAAA;AAFrC,IAAA,WAAA,GAAA;;AAGgB,QAAA,IAAA,CAAA,OAAO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AO,CAAC,CAAC,CAAC;AACnE,kBAAE,CAAC,GAAG,CAAC,CACd;QACL;aAAO;AACH,YAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAU,CAAC;QAC9B;IACJ;;AAxIS,aAAa,GAAA,UAAA,CAAA;AA3BzB,IAAA,SAAS,CAAC;AACP,QAAA,QAAQ,EAAE,iBAAiB;AAC3B,QAAA,OAAO,EAAE;YACL,WAAW;YACX,SAAS;YACT,WAAW;YACX,WAAW;YACX,UAAU;YACV,WAAW;YACX,mBAAmB;YACnB,YAAY;YACZ,iBAAiB;YACjB,iBAAiB;YACjB,OAAO;YACP,aAAa;YACb,SAAS;AACZ,SAAA;AACD,QAAA,WAAW,EAAE,8BAA8B;AAC3C,QAAA,QAAQ,EAAE,8BAA8B;QACxC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,QAAA,SAAS,EAAE;YACP,cAAc,CAAC,aAAa,CAAC;AAC7B,YAAA,UAAU,CAAC,mBAAmB,EAAE,aAAa,CAAC;YAC9C,wBAAwB,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAC,CAAC;AAC1D,YAAA,2BAA2B,CAAC,EAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAC,CAAC;AAC3E,SAAA;KACJ;AACY,CAAA,EAAA,aAAa,CAyIzB;;ACxND;;AAEG;;;;"}
|
|
@@ -40,7 +40,7 @@ class TuiFile {
|
|
|
40
40
|
<ng-content select="[tuiTitle]" />
|
|
41
41
|
</label>
|
|
42
42
|
<ng-content select="[tuiButtonX]" />
|
|
43
|
-
`, isInline: true, styles: ["[data-tui-version=\"5.
|
|
43
|
+
`, isInline: true, styles: ["[data-tui-version=\"5.13.0\"]{@import \"./file.styles.less\";}\n"], dependencies: [{ kind: "directive", type: TuiAvatar, selector: "[tuiAvatar]", inputs: ["size", "round", "badge"] }, { kind: "directive", type: TuiSlides, selector: "[tuiSlides]", inputs: ["tuiSlides"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
44
44
|
}
|
|
45
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiFile, decorators: [{
|
|
46
46
|
type: Component,
|
|
@@ -65,7 +65,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
65
65
|
], hostDirectives: [{ directive: TuiCell, inputs: ['tuiCell: size'] }], host: {
|
|
66
66
|
tuiFile: '',
|
|
67
67
|
'[attr.data-orientation]': 'orientation()',
|
|
68
|
-
}, styles: ["[data-tui-version=\"5.
|
|
68
|
+
}, styles: ["[data-tui-version=\"5.13.0\"]{@import \"./file.styles.less\";}\n"] }]
|
|
69
69
|
}] });
|
|
70
70
|
|
|
71
71
|
class TuiFilePipe {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/experimental",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.0",
|
|
4
4
|
"description": "A package with Taiga UI experimental components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@angular/common": ">=19.0.0",
|
|
32
32
|
"@angular/core": ">=19.0.0",
|
|
33
|
-
"@taiga-ui/addon-commerce": "5.
|
|
34
|
-
"@taiga-ui/cdk": "5.
|
|
35
|
-
"@taiga-ui/core": "5.
|
|
36
|
-
"@taiga-ui/kit": "5.
|
|
37
|
-
"@taiga-ui/layout": "5.
|
|
33
|
+
"@taiga-ui/addon-commerce": "5.13.0",
|
|
34
|
+
"@taiga-ui/cdk": "5.13.0",
|
|
35
|
+
"@taiga-ui/core": "5.13.0",
|
|
36
|
+
"@taiga-ui/kit": "5.13.0",
|
|
37
|
+
"@taiga-ui/layout": "5.13.0",
|
|
38
38
|
"@taiga-ui/polymorpheus": "^5.0.1",
|
|
39
39
|
"rxjs": ">=7.0.0"
|
|
40
40
|
},
|