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