@taiga-ui/addon-mobile 4.4.1 → 4.5.0-canary.49229f4
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/mobile-calendar/mobile-calendar.component.d.ts +2 -2
- package/directives/dropdown-mobile/dropdown-mobile.component.d.ts +1 -1
- package/directives/ripple/ripple.directive.d.ts +3 -4
- package/esm2022/components/mobile-calendar/mobile-calendar.component.mjs +15 -15
- package/esm2022/components/mobile-calendar/mobile-calendar.strategy.mjs +4 -4
- package/esm2022/components/mobile-calendar-dropdown/mobile-calendar-dropdown.component.mjs +5 -5
- package/esm2022/components/mobile-calendar-sheet/mobile-calendar-sheet.component.mjs +5 -4
- package/esm2022/components/mobile-dialog/mobile-dialog.component.mjs +6 -6
- package/esm2022/components/pull-to-refresh/loader-android/loader-android.component.mjs +5 -5
- package/esm2022/components/pull-to-refresh/loader-ios/loader-ios.component.mjs +5 -5
- package/esm2022/components/pull-to-refresh/pull-to-refresh.component.mjs +3 -3
- package/esm2022/components/pull-to-refresh/pull-to-refresh.service.mjs +3 -3
- package/esm2022/components/sheet-dialog/sheet-dialog.component.mjs +9 -8
- package/esm2022/components/swipe-action/swipe-actions.component.mjs +3 -3
- package/esm2022/components/tab-bar/tab-bar-item.component.mjs +3 -3
- package/esm2022/components/tab-bar/tab-bar.component.mjs +3 -3
- package/esm2022/directives/dropdown-mobile/dropdown-mobile.component.mjs +6 -6
- package/esm2022/directives/ripple/ripple.directive.mjs +8 -16
- package/esm2022/directives/sidebar/sidebar.component.mjs +4 -4
- package/esm2022/directives/touchable/touchable.directive.mjs +4 -5
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs +4 -4
- 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 +4 -3
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs +18 -18
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-dialog.mjs +6 -6
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs +11 -11
- package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs +9 -8
- package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-swipe-action.mjs +2 -2
- package/fesm2022/taiga-ui-addon-mobile-components-swipe-action.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs +4 -4
- package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs +5 -5
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs +7 -15
- package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-sidebar.mjs +3 -3
- package/fesm2022/taiga-ui-addon-mobile-directives-sidebar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-touchable.mjs +3 -4
- package/fesm2022/taiga-ui-addon-mobile-directives-touchable.mjs.map +1 -1
- package/package.json +134 -134
- package/styles/android/app-bar.less +3 -3
- package/styles/android/radio.less +2 -0
- package/styles/android/switch.less +11 -9
- package/styles/common/block-status.less +2 -4
- package/styles/common/button.less +1 -1
- package/styles/common/segmented.less +13 -0
- package/styles/ios/search.less +49 -0
- package/styles/ios/switch.less +9 -7
- package/styles/taiga-ui-mobile.less +10 -2
|
@@ -29,14 +29,14 @@ class TuiSidebarComponent {
|
|
|
29
29
|
return this.directive.autoWidth;
|
|
30
30
|
}
|
|
31
31
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
32
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiSidebarComponent, isStandalone: true, selector: "aside[tuiSidebar]", host: { properties: { "class": "\"t-\" + direction", "@tuiSlideIn": "animation" } }, ngImport: i0, template: "<div\n tuiActiveZone\n class=\"t-wrapper\"\n [class.t-wrapper_auto-width]=\"autoWidth\"\n>\n <ng-container *polymorpheusOutlet=\"content as text\">\n {{ text }}\n </ng-container>\n</div>\n", styles: [":host{position:fixed;top:0;left:0;
|
|
32
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiSidebarComponent, isStandalone: true, selector: "aside[tuiSidebar]", host: { properties: { "class": "\"t-\" + direction", "@tuiSlideIn": "animation" } }, ngImport: i0, template: "<div\n tuiActiveZone\n class=\"t-wrapper\"\n [class.t-wrapper_auto-width]=\"autoWidth\"\n>\n <ng-container *polymorpheusOutlet=\"content as text\">\n {{ text }}\n </ng-container>\n</div>\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;display:flex}:host:before,:host:after{position:absolute;top:0;left:0;inline-size:100%;content:\"\";block-size:100%;background:#00000061;animation:tuiFadeIn var(--tui-duration)}:host:before{left:-100%;inline-size:200%}:host:after{left:100%}:host.ng-animating:before,:host.ng-animating:after{opacity:0;transition:opacity var(--tui-duration)}:host.t-right{justify-content:flex-end}:host.t-left{justify-content:flex-start}.t-wrapper{position:relative;display:flex;flex-direction:column;background:var(--tui-background-base);box-shadow:0 10rem var(--tui-background-base);inline-size:17.25rem}.t-wrapper_auto-width{inline-size:auto}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiActiveZone, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }], animations: [tuiSlideIn], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
33
33
|
}
|
|
34
34
|
export { TuiSidebarComponent };
|
|
35
35
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSidebarComponent, decorators: [{
|
|
36
36
|
type: Component,
|
|
37
|
-
args: [{ standalone: true, selector: 'aside[tuiSidebar]', imports: [
|
|
37
|
+
args: [{ standalone: true, selector: 'aside[tuiSidebar]', imports: [PolymorpheusOutlet, TuiActiveZone], changeDetection: ChangeDetectionStrategy.OnPush, animations: [tuiSlideIn], host: {
|
|
38
38
|
'[class]': '"t-" + direction',
|
|
39
39
|
'[@tuiSlideIn]': 'animation',
|
|
40
|
-
}, template: "<div\n tuiActiveZone\n class=\"t-wrapper\"\n [class.t-wrapper_auto-width]=\"autoWidth\"\n>\n <ng-container *polymorpheusOutlet=\"content as text\">\n {{ text }}\n </ng-container>\n</div>\n", styles: [":host{position:fixed;top:0;left:0;
|
|
40
|
+
}, template: "<div\n tuiActiveZone\n class=\"t-wrapper\"\n [class.t-wrapper_auto-width]=\"autoWidth\"\n>\n <ng-container *polymorpheusOutlet=\"content as text\">\n {{ text }}\n </ng-container>\n</div>\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;display:flex}:host:before,:host:after{position:absolute;top:0;left:0;inline-size:100%;content:\"\";block-size:100%;background:#00000061;animation:tuiFadeIn var(--tui-duration)}:host:before{left:-100%;inline-size:200%}:host:after{left:100%}:host.ng-animating:before,:host.ng-animating:after{opacity:0;transition:opacity var(--tui-duration)}:host.t-right{justify-content:flex-end}:host.t-left{justify-content:flex-start}.t-wrapper{position:relative;display:flex;flex-direction:column;background:var(--tui-background-base);box-shadow:0 10rem var(--tui-background-base);inline-size:17.25rem}.t-wrapper_auto-width{inline-size:auto}\n"] }]
|
|
41
41
|
}] });
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lkZWJhci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hZGRvbi1tb2JpbGUvZGlyZWN0aXZlcy9zaWRlYmFyL3NpZGViYXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYWRkb24tbW9iaWxlL2RpcmVjdGl2ZXMvc2lkZWJhci9zaWRlYmFyLnRlbXBsYXRlLmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFDLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekUsT0FBTyxFQUFDLGFBQWEsRUFBQyxNQUFNLHNDQUFzQyxDQUFDO0FBQ25FLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSwyQkFBMkIsQ0FBQztBQUNyRCxPQUFPLEVBQUMsb0JBQW9CLEVBQUMsTUFBTSx1QkFBdUIsQ0FBQztBQUUzRCxPQUFPLEVBQUMscUJBQXFCLEVBQUMsTUFBTSxvQ0FBb0MsQ0FBQztBQUV6RSxPQUFPLEVBQUMsa0JBQWtCLEVBQUMsTUFBTSx3QkFBd0IsQ0FBQztBQUUxRCxPQUFPLEVBQUMsbUJBQW1CLEVBQUMsTUFBTSxxQkFBcUIsQ0FBQzs7QUFFeEQsTUFhYSxtQkFBbUI7SUFiaEM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gICAgICAgIHRoaXMuZGlyZWN0aXZlLmNoZWNrKCk7XG4gICAgfVxuXG4gICAgcHJvdGVjdGVkIGdldCBhbmltYXRpb24oKTogQW5pbWF0aW9uT3B0aW9ucyB7XG4gICAgICAgIHJldHVybiB0aGlzLmRpcmVjdGlvbiA9PT0gJ2xlZnQnID8gdGhpcy5sZWZ0IDogdGhpcy5yaWdodDtcbiAgICB9XG5cbiAgICBwcm90ZWN0ZWQgZ2V0IGRpcmVjdGlvbigpOiBUdWlIb3Jpem9udGFsRGlyZWN0aW9uIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGlyZWN0aXZlLmRpcmVjdGlvbjtcbiAgICB9XG5cbiAgICBwcm90ZWN0ZWQgZ2V0IGNvbnRlbnQoKTogUG9seW1vcnBoZXVzQ29udGVudCB7XG4gICAgICAgIHJldHVybiB0aGlzLmRpcmVjdGl2ZS5jb250ZW50O1xuICAgIH1cblxuICAgIHByb3RlY3RlZCBnZXQgYXV0b1dpZHRoKCk6IGJvb2xlYW4ge1xuICAgICAgICByZXR1cm4gdGhpcy5kaXJlY3RpdmUuYXV0b1dpZHRoO1xuICAgIH1cbn1cbiIsIjxkaXZcbiAgICB0dWlBY3RpdmVab25lXG4gICAgY2xhc3M9XCJ0LXdyYXBwZXJcIlxuICAgIFtjbGFzcy50LXdyYXBwZXJfYXV0by13aWR0aF09XCJhdXRvV2lkdGhcIlxuPlxuICAgIDxuZy1jb250YWluZXIgKnBvbHltb3JwaGV1c091dGxldD1cImNvbnRlbnQgYXMgdGV4dFwiPlxuICAgICAgICB7eyB0ZXh0IH19XG4gICAgPC9uZy1jb250YWluZXI+XG48L2Rpdj5cbiJdfQ==
|
|
@@ -12,8 +12,7 @@ const STYLE = {
|
|
|
12
12
|
};
|
|
13
13
|
export function tuiFindTouchIndex(touches, id) {
|
|
14
14
|
for (let i = 0; i < touches.length; i++) {
|
|
15
|
-
|
|
16
|
-
if (identifier === id) {
|
|
15
|
+
if (touches[i]?.identifier === id) {
|
|
17
16
|
return i;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
@@ -28,7 +27,7 @@ class TuiTouchable {
|
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
29
|
tuiTypedFromEvent(this.el, 'touchstart', { passive: true })
|
|
31
|
-
.pipe(tap(() => this.onTouchStart()), map(({ touches }) => touches[touches.length - 1]
|
|
30
|
+
.pipe(tap(() => this.onTouchStart()), map(({ touches }) => touches[touches.length - 1]?.identifier), switchMap((identifier) => race(tuiTypedFromEvent(this.el, 'touchmove', { passive: true }).pipe(filter(({ touches }) => this.hasTouchLeft(this.el, touches, identifier ?? 0))), tuiTypedFromEvent(this.el, 'touchend')).pipe(take(1))), takeUntilDestroyed())
|
|
32
31
|
.subscribe(() => {
|
|
33
32
|
this.el.style.removeProperty('transform');
|
|
34
33
|
this.el.style.removeProperty('opacity');
|
|
@@ -44,7 +43,7 @@ class TuiTouchable {
|
|
|
44
43
|
if (!ownerDocument || id === -1) {
|
|
45
44
|
return true;
|
|
46
45
|
}
|
|
47
|
-
const { clientX, clientY } = touches[id];
|
|
46
|
+
const { clientX = 0, clientY = 0 } = touches[id] ?? {};
|
|
48
47
|
return !element.contains(ownerDocument.elementFromPoint(clientX, clientY));
|
|
49
48
|
}
|
|
50
49
|
onTouchStart() {
|
|
@@ -69,4 +68,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
69
68
|
}], ctorParameters: function () { return []; }, propDecorators: { tuiTouchable: [{
|
|
70
69
|
type: Input
|
|
71
70
|
}] } });
|
|
72
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
71
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG91Y2hhYmxlLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2FkZG9uLW1vYmlsZS9kaXJlY3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KCkpLFxuICAgICAgICAgICAgICAgIG1hcCgoe3RvdWNoZXN9KSA9PiB0b3VjaGVzW3RvdWNoZXMubGVuZ3RoIC0gMV0/LmlkZW50aWZpZXIpLFxuICAgICAgICAgICAgICAgIHN3aXRjaE1hcCgoaWRlbnRpZmllcikgPT5cbiAgICAgICAgICAgICAgICAgICAgcmFjZShcbiAgICAgICAgICAgICAgICAgICAgICAgIHR1aVR5cGVkRnJvbUV2ZW50KHRoaXMuZWwsICd0b3VjaG1vdmUnLCB7cGFzc2l2ZTogdHJ1ZX0pLnBpcGUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyKCh7dG91Y2hlc30pID0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaGFzVG91Y2hMZWZ0KHRoaXMuZWwsIHRvdWNoZXMsIGlkZW50aWZpZXIgPz8gMCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgICAgICB0dWlUeXBlZEZyb21FdmVudCh0aGlzLmVsLCAndG91Y2hlbmQnKSxcbiAgICAgICAgICAgICAgICAgICAgKS5waXBlKHRha2UoMSkpLFxuICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgdGFrZVVudGlsRGVzdHJveWVkKCksXG4gICAgICAgICAgICApXG4gICAgICAgICAgICAuc3Vic2NyaWJlKCgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmVsLnN0eWxlLnJlbW92ZVByb3BlcnR5KCd0cmFuc2Zvcm0nKTtcbiAgICAgICAgICAgICAgICB0aGlzLmVsLnN0eWxlLnJlbW92ZVByb3BlcnR5KCdvcGFjaXR5Jyk7XG4gICAgICAgICAgICAgICAgdGhpcy5lbC5zdHlsZS5yZW1vdmVQcm9wZXJ0eSgnYmFja2dyb3VuZCcpO1xuICAgICAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgcHJvdGVjdGV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B0aGlzLmVsLnN0eWxlLnNldFByb3BlcnR5KHRoaXMuc3R5bGUsIFNUWUxFW3RoaXMuc3R5bGVdKTtcbiAgICB9XG59XG4iXX0=
|
|
@@ -13,14 +13,14 @@ import { TUI_ANIMATIONS_SPEED } from '@taiga-ui/core/tokens';
|
|
|
13
13
|
import { tuiGetDuration } from '@taiga-ui/core/utils/miscellaneous';
|
|
14
14
|
import { TUI_DAY_CAPS_MAPPER } from '@taiga-ui/kit/components/calendar-range';
|
|
15
15
|
import { TUI_MOBILE_CALENDAR } from '@taiga-ui/kit/tokens';
|
|
16
|
-
import {
|
|
16
|
+
import { injectContext } from '@taiga-ui/polymorpheus';
|
|
17
17
|
|
|
18
18
|
class TuiMobileCalendarDropdown {
|
|
19
19
|
constructor() {
|
|
20
20
|
// TODO: Rework to use TuiDropdownOpenDirective so the focus returns to the field on closing
|
|
21
21
|
this.dropdown = inject(TuiDropdownDirective, { optional: true });
|
|
22
22
|
this.keyboard = inject(TuiKeyboardService);
|
|
23
|
-
this.context =
|
|
23
|
+
this.context = injectContext({ optional: true });
|
|
24
24
|
this.observer = this.context?.$implicit;
|
|
25
25
|
this.data = this.context?.data || {};
|
|
26
26
|
this.animation = {
|
|
@@ -66,14 +66,14 @@ class TuiMobileCalendarDropdown {
|
|
|
66
66
|
return !!this.dropdown?.el.closest(selector);
|
|
67
67
|
}
|
|
68
68
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiMobileCalendarDropdown, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
69
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiMobileCalendarDropdown, isStandalone: true, selector: "tui-mobile-calendar-dropdown", host: { properties: { "@tuiSlideInTop": "animation", "@tuiFadeIn": "animation" } }, hostDirectives: [{ directive: i1.TuiActiveZone }], ngImport: i0, template: "<tui-mobile-calendar\n [disabledItemHandler]=\"disabledItemHandler\"\n [max]=\"max\"\n [min]=\"min\"\n [multi]=\"multi\"\n [single]=\"single\"\n (cancel)=\"close()\"\n (confirm)=\"confirm($event)\"\n/>\n", styles: [":host{position:fixed;top:0;left:0;
|
|
69
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiMobileCalendarDropdown, isStandalone: true, selector: "tui-mobile-calendar-dropdown", host: { properties: { "@tuiSlideInTop": "animation", "@tuiFadeIn": "animation" } }, hostDirectives: [{ directive: i1.TuiActiveZone }], ngImport: i0, template: "<tui-mobile-calendar\n [disabledItemHandler]=\"disabledItemHandler\"\n [max]=\"max\"\n [min]=\"min\"\n [multi]=\"multi\"\n [single]=\"single\"\n (cancel)=\"close()\"\n (confirm)=\"confirm($event)\"\n/>\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;background:var(--tui-background-elevation-1);box-shadow:0 10rem var(--tui-background-elevation-1),0 -90vh 1rem 2rem var(--tui-service-backdrop)}\n"], dependencies: [{ kind: "component", type: TuiMobileCalendar, selector: "tui-mobile-calendar", inputs: ["single", "multi", "min", "max", "disabledItemHandler", "value"], outputs: ["cancel", "confirm", "valueChange"] }], animations: [tuiSlideInTop, tuiFadeIn], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
70
70
|
}
|
|
71
71
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiMobileCalendarDropdown, decorators: [{
|
|
72
72
|
type: Component,
|
|
73
73
|
args: [{ standalone: true, selector: 'tui-mobile-calendar-dropdown', imports: [TuiMobileCalendar], changeDetection: ChangeDetectionStrategy.OnPush, animations: [tuiSlideInTop, tuiFadeIn], hostDirectives: [TuiActiveZone], host: {
|
|
74
74
|
'[@tuiSlideInTop]': 'animation',
|
|
75
75
|
'[@tuiFadeIn]': 'animation',
|
|
76
|
-
}, template: "<tui-mobile-calendar\n [disabledItemHandler]=\"disabledItemHandler\"\n [max]=\"max\"\n [min]=\"min\"\n [multi]=\"multi\"\n [single]=\"single\"\n (cancel)=\"close()\"\n (confirm)=\"confirm($event)\"\n/>\n", styles: [":host{position:fixed;top:0;left:0;
|
|
76
|
+
}, template: "<tui-mobile-calendar\n [disabledItemHandler]=\"disabledItemHandler\"\n [max]=\"max\"\n [min]=\"min\"\n [multi]=\"multi\"\n [single]=\"single\"\n (cancel)=\"close()\"\n (confirm)=\"confirm($event)\"\n/>\n", styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;background:var(--tui-background-elevation-1);box-shadow:0 10rem var(--tui-background-elevation-1),0 -90vh 1rem 2rem var(--tui-service-backdrop)}\n"] }]
|
|
77
77
|
}], ctorParameters: function () { return []; } });
|
|
78
78
|
function tuiProvideMobileCalendar() {
|
|
79
79
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs","sources":["../../../projects/addon-mobile/components/mobile-calendar-dropdown/mobile-calendar-dropdown.component.ts","../../../projects/addon-mobile/components/mobile-calendar-dropdown/mobile-calendar-dropdown.template.html","../../../projects/addon-mobile/components/mobile-calendar-dropdown/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.ts"],"sourcesContent":["import type {ValueProvider} from '@angular/core';\nimport {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {TuiMobileCalendar} from '@taiga-ui/addon-mobile/components/mobile-calendar';\nimport {TuiKeyboardService} from '@taiga-ui/addon-mobile/services';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport type {TuiDay} from '@taiga-ui/cdk/date-time';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY} from '@taiga-ui/cdk/date-time';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport type {TuiBooleanHandler} from '@taiga-ui/cdk/types';\nimport {tuiFadeIn, tuiSlideInTop} from '@taiga-ui/core/animations';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens';\nimport {tuiGetDuration} from '@taiga-ui/core/utils/miscellaneous';\nimport {TUI_DAY_CAPS_MAPPER} from '@taiga-ui/kit/components/calendar-range';\nimport {TUI_MOBILE_CALENDAR} from '@taiga-ui/kit/tokens';\nimport {
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs","sources":["../../../projects/addon-mobile/components/mobile-calendar-dropdown/mobile-calendar-dropdown.component.ts","../../../projects/addon-mobile/components/mobile-calendar-dropdown/mobile-calendar-dropdown.template.html","../../../projects/addon-mobile/components/mobile-calendar-dropdown/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.ts"],"sourcesContent":["import type {ValueProvider} from '@angular/core';\nimport {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {TuiMobileCalendar} from '@taiga-ui/addon-mobile/components/mobile-calendar';\nimport {TuiKeyboardService} from '@taiga-ui/addon-mobile/services';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport type {TuiDay} from '@taiga-ui/cdk/date-time';\nimport {TUI_FIRST_DAY, TUI_LAST_DAY} from '@taiga-ui/cdk/date-time';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport type {TuiBooleanHandler} from '@taiga-ui/cdk/types';\nimport {tuiFadeIn, tuiSlideInTop} from '@taiga-ui/core/animations';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens';\nimport {tuiGetDuration} from '@taiga-ui/core/utils/miscellaneous';\nimport {TUI_DAY_CAPS_MAPPER} from '@taiga-ui/kit/components/calendar-range';\nimport {TUI_MOBILE_CALENDAR} from '@taiga-ui/kit/tokens';\nimport {injectContext} from '@taiga-ui/polymorpheus';\nimport type {Observer} from 'rxjs';\n\nexport interface TuiMobileCalendarData {\n disabledItemHandler?: TuiBooleanHandler<TuiDay>;\n max?: TuiDay | null;\n min?: TuiDay | null;\n multi?: boolean;\n single?: boolean;\n}\n\n@Component({\n standalone: true,\n selector: 'tui-mobile-calendar-dropdown',\n imports: [TuiMobileCalendar],\n templateUrl: './mobile-calendar-dropdown.template.html',\n styleUrls: ['./mobile-calendar-dropdown.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiSlideInTop, tuiFadeIn],\n hostDirectives: [TuiActiveZone],\n host: {\n '[@tuiSlideInTop]': 'animation',\n '[@tuiFadeIn]': 'animation',\n },\n})\nexport class TuiMobileCalendarDropdown {\n // TODO: Rework to use TuiDropdownOpenDirective so the focus returns to the field on closing\n private readonly dropdown = inject(TuiDropdownDirective, {optional: true});\n private readonly keyboard = inject(TuiKeyboardService);\n private readonly context = injectContext<Record<string, any>>({optional: true});\n private readonly observer?: Observer<any> = this.context?.$implicit;\n private readonly data: TuiMobileCalendarData = this.context?.data || {};\n\n protected readonly animation = {\n value: '',\n params: {\n start: '100vh',\n duration: tuiGetDuration(inject(TUI_ANIMATIONS_SPEED)),\n },\n };\n\n // TODO: Refactor to proper Date, DateMulti and DateRange components after they are added to kit\n protected readonly control: any = inject(TuiControl, {optional: true});\n protected readonly range = this.is('tui-input-date-range');\n protected readonly multi = this.data.multi || this.is('tui-input-date[multiple]');\n protected readonly single =\n this.data.single || this.is('tui-input-date:not([multiple])');\n\n protected readonly min =\n this.data.min ||\n (this.range\n ? TUI_DAY_CAPS_MAPPER(\n this.control.min,\n this.control.value,\n this.control.maxLength,\n true,\n )\n : this.control?.min) ||\n TUI_FIRST_DAY;\n\n protected readonly max =\n this.data.max ||\n (this.range\n ? TUI_DAY_CAPS_MAPPER(\n this.control.max,\n this.control.value,\n this.control.maxLength,\n false,\n )\n : this.control?.max) ||\n TUI_LAST_DAY;\n\n protected readonly disabledItemHandler =\n this.data.disabledItemHandler ||\n this.control?.disabledItemHandler ||\n TUI_FALSE_HANDLER;\n\n constructor() {\n this.keyboard.hide();\n }\n\n protected close(): void {\n this.dropdown?.toggle(false);\n this.observer?.complete();\n this.keyboard.show();\n }\n\n protected confirm(value: any): void {\n if (this.control) {\n this.control.value = value;\n }\n\n this.observer?.next(value);\n this.close();\n }\n\n private is(selector: string): boolean {\n return !!this.dropdown?.el.closest(selector);\n }\n}\n\nexport function tuiProvideMobileCalendar(): ValueProvider {\n return {\n provide: TUI_MOBILE_CALENDAR,\n useValue: TuiMobileCalendarDropdown,\n };\n}\n","<tui-mobile-calendar\n [disabledItemHandler]=\"disabledItemHandler\"\n [max]=\"max\"\n [min]=\"min\"\n [multi]=\"multi\"\n [single]=\"single\"\n (cancel)=\"close()\"\n (confirm)=\"confirm($event)\"\n/>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA2BA,MAca,yBAAyB,CAAA;AAoDlC,IAAA,WAAA,GAAA;;QAlDiB,IAAQ,CAAA,QAAA,GAAG,MAAM,CAAC,oBAAoB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;AAC1D,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACtC,IAAO,CAAA,OAAA,GAAG,aAAa,CAAsB,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;AAC/D,QAAA,IAAA,CAAA,QAAQ,GAAmB,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC;QACnD,IAAI,CAAA,IAAA,GAA0B,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC;AAErD,QAAA,IAAA,CAAA,SAAS,GAAG;AAC3B,YAAA,KAAK,EAAE,EAAE;AACT,YAAA,MAAM,EAAE;AACJ,gBAAA,KAAK,EAAE,OAAO;AACd,gBAAA,QAAQ,EAAE,cAAc,CAAC,MAA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MAAA,EAAA,CAAA,CAAA,EAAA;;4FAO7B,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAdrC,SAAS;iCACM,IAAI,EAAA,QAAA,EACN,8BAA8B,EAC/B,OAAA,EAAA,CAAC,iBAAiB,CAAC,EAAA,eAAA,EAGX,uBAAuB,CAAC,MAAM,cACnC,CAAC,aAAa,EAAE,SAAS,CAAC,kBACtB,CAAC,aAAa,CAAC,EACzB,IAAA,EAAA;AACF,wBAAA,kBAAkB,EAAE,WAAW;AAC/B,wBAAA,cAAc,EAAE,WAAW;AAC9B,qBAAA,EAAA,QAAA,EAAA,kOAAA,EAAA,MAAA,EAAA,CAAA,uNAAA,CAAA,EAAA,CAAA;;SA8EW,wBAAwB,GAAA;IACpC,OAAO;AACH,QAAA,OAAO,EAAE,mBAAmB;AAC5B,QAAA,QAAQ,EAAE,yBAAyB;KACtC,CAAC;AACN;;AE1HA;;AAEG;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NgIf } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
3
|
import { inject, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
4
|
import { TuiRipple } from '@taiga-ui/addon-mobile/directives';
|
|
@@ -13,13 +14,13 @@ class TuiMobileCalendarSheet extends TuiCalendarSheet {
|
|
|
13
14
|
this.isIOS = inject(TUI_IS_IOS);
|
|
14
15
|
}
|
|
15
16
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiMobileCalendarSheet, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
16
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiMobileCalendarSheet, isStandalone: true, selector: "tui-mobile-calendar-sheet", host: { properties: { "class._ios": "isIOS" } }, usesInheritance: true, ngImport: i0, template: "<ng-container *tuiLet=\"month | tuiCalendarSheet as sheet\">\n <div\n *tuiRepeatTimes=\"let rowIndex of sheet.length\"\n automation-id=\"tui-primitive-calendar-mobile__row\"\n class=\"t-row\"\n >\n <
|
|
17
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiMobileCalendarSheet, isStandalone: true, selector: "tui-mobile-calendar-sheet", host: { properties: { "class._ios": "isIOS" } }, usesInheritance: true, ngImport: i0, template: "<ng-container *tuiLet=\"month | tuiCalendarSheet as sheet\">\n <div\n *tuiRepeatTimes=\"let rowIndex of sheet.length\"\n automation-id=\"tui-primitive-calendar-mobile__row\"\n class=\"t-row\"\n >\n <ng-container *tuiRepeatTimes=\"let colIndex of sheet[rowIndex]?.length ?? 0\">\n <div\n *ngIf=\"sheet[rowIndex]?.[colIndex] as item\"\n automation-id=\"tui-primitive-calendar-mobile__cell\"\n tuiRipple\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [class.t-cell_disabled]=\"disabledItemHandler(item)\"\n [class.t-cell_interval]=\"itemIsInterval(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n (click)=\"onItemClick(item)\"\n >\n {{ item.day }}\n </div>\n </ng-container>\n </div>\n</ng-container>\n", styles: [":host{display:block;font:var(--tui-font-text-m)}.t-row{position:relative;display:flex;justify-content:space-between;block-size:2.25rem;isolation:isolate}.t-item{position:relative;flex:1;line-height:2rem;border-radius:var(--tui-radius-m)}.t-item:before,.t-item:after{position:absolute;top:0;left:0;bottom:0;right:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-item:after{border-radius:.5rem}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;inline-size:2.75rem;text-align:center;outline:none;cursor:pointer;background-clip:content-box;box-sizing:border-box;border:.125rem solid transparent}.t-cell:before{content:\"\";position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;border-radius:var(--tui-radius-m)}.t-cell_today:after{position:absolute;left:50%;transform:translate(-50%);content:\"\";bottom:.3125rem;block-size:.125rem;inline-size:.75rem;border-radius:.375rem;background:var(--tui-text-primary)}.t-cell_interval:before{background:var(--tui-background-base-alt)}:host._single .t-cell_interval:before{background:var(--tui-background-neutral-1-hover)}.t-cell_interval:not(:last-child):before{right:-.1875rem;border-start-end-radius:0;border-end-end-radius:0}.t-cell_interval:not([data-range=start]):not(:first-child):before{border-start-start-radius:0;border-end-start-radius:0}.t-cell_interval:last-child:first-child:before{right:0}.t-cell_interval:first-child>.t-item{border-start-start-radius:var(--tui-radius-m);border-end-start-radius:var(--tui-radius-m)}.t-cell_interval:last-child>.t-item{border-start-end-radius:var(--tui-radius-m);border-end-end-radius:var(--tui-radius-m)}.t-cell_interval>.t-item{border-radius:0}.t-cell[data-range]:after{background:var(--tui-text-primary-on-accent-1)}.t-cell[data-range]>.t-item{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range]>.t-item:before,.t-cell[data-range]>.t-item:after{background:var(--tui-background-accent-1)}.t-cell[data-range]:hover>.t-item:before,.t-cell[data-range]:hover>.t-item:after{background:var(--tui-background-accent-1-hover)}.t-cell[data-range]:active>.t-item:before,.t-cell[data-range]:active>.t-item:after{background:var(--tui-background-accent-1-pressed)}.t-cell[data-range=end]:before{background:var(--tui-background-base-alt)}:host._single .t-cell[data-range=end]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{border-start-start-radius:0;border-end-start-radius:0}.t-cell[data-range=end]>.t-item:before{left:.625rem;border-start-start-radius:0;border-end-start-radius:0}.t-cell[data-range=end]>.t-item:after{left:-2rem;right:100%;transform:translate(1.6rem) scaleY(.83) scaleX(.5) rotate(45deg)}.t-cell[data-range=start]>.t-item:before{right:.625rem;border-start-end-radius:0;border-end-end-radius:0}.t-cell[data-range=start]>.t-item:after{left:100%;right:-2rem;transform:translate(-1.6rem) scaleY(.83) scaleX(.5) rotate(45deg)}.t-cell[data-range=single]>.t-item:after{display:none}.t-cell_disabled{pointer-events:none}.t-cell_disabled>.t-item{opacity:.36}.t-cell:hover:not([data-range])>.t-item{background:var(--tui-background-neutral-1-hover)}.t-cell:active:not([data-range])>.t-item{background:var(--tui-background-neutral-1-pressed)}:host{inline-size:20.75rem;max-inline-size:100vw}:host._ios{inline-size:22.625rem}.t-row{block-size:3rem;justify-content:flex-start}.t-row:first-child{justify-content:flex-end}:host._ios .t-row{block-size:3.125rem}.t-cell{block-size:2.75rem;border-radius:100%;overflow:hidden;margin-right:.25rem}.t-cell:last-child,:host._ios .t-cell:last-child{margin-right:0}.t-cell:before{right:-100vw}.t-cell:first-child:before{left:-100vw}.t-cell_today:after{block-size:.375rem;inline-size:.375rem;background-color:var(--tui-text-action)}.t-cell_interval:before{background-color:var(--tui-background-base-alt)}.t-cell_interval:last-child:first-child:before{right:-100vw}.t-cell_disabled{opacity:var(--tui-disabled-opacity)}.t-cell[data-range=single],.t-cell[data-range=start],.t-cell[data-range=end]{border-radius:100%;background-color:var(--tui-text-action);color:var(--tui-text-primary-on-accent-2);font-weight:500}.t-cell[data-range=single]:after,.t-cell[data-range=start]:after,.t-cell[data-range=end]:after{background-color:var(--tui-background-base)}:host._ios .t-cell[data-range=single],:host._ios .t-cell[data-range=start],:host._ios .t-cell[data-range=end]{font-weight:600}.t-cell[data-range=start]:before{left:50%;border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=end]:not(:first-child):before{left:50%;background:var(--tui-background-base);border-radius:0}.t-cell[data-range=end]:first-child:before{right:50%;background-color:var(--tui-background-base-alt)}:host._ios .t-cell{margin-right:.5625rem}:host._ios .t-cell:before{border-radius:.5rem}@media screen and (max-width: 22.4375rem){.t-cell,:host._ios .t-cell{margin-right:.125rem}.t-cell:last-child,:host._ios .t-cell:last-child{margin-right:0}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: TuiCalendarSheetPipe, name: "tuiCalendarSheet" }, { kind: "directive", type: TuiLet, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }, { kind: "directive", type: TuiRipple, selector: "[tuiRipple]", inputs: ["tuiRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
17
18
|
}
|
|
18
19
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiMobileCalendarSheet, decorators: [{
|
|
19
20
|
type: Component,
|
|
20
|
-
args: [{ standalone: true, selector: 'tui-mobile-calendar-sheet', imports: [
|
|
21
|
+
args: [{ standalone: true, selector: 'tui-mobile-calendar-sheet', imports: [NgIf, TuiCalendarSheetPipe, TuiLet, TuiRepeatTimes, TuiRipple], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
21
22
|
'[class._ios]': 'isIOS',
|
|
22
|
-
}, template: "<ng-container *tuiLet=\"month | tuiCalendarSheet as sheet\">\n <div\n *tuiRepeatTimes=\"let rowIndex of sheet.length\"\n automation-id=\"tui-primitive-calendar-mobile__row\"\n class=\"t-row\"\n >\n <
|
|
23
|
+
}, template: "<ng-container *tuiLet=\"month | tuiCalendarSheet as sheet\">\n <div\n *tuiRepeatTimes=\"let rowIndex of sheet.length\"\n automation-id=\"tui-primitive-calendar-mobile__row\"\n class=\"t-row\"\n >\n <ng-container *tuiRepeatTimes=\"let colIndex of sheet[rowIndex]?.length ?? 0\">\n <div\n *ngIf=\"sheet[rowIndex]?.[colIndex] as item\"\n automation-id=\"tui-primitive-calendar-mobile__cell\"\n tuiRipple\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [class.t-cell_disabled]=\"disabledItemHandler(item)\"\n [class.t-cell_interval]=\"itemIsInterval(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n (click)=\"onItemClick(item)\"\n >\n {{ item.day }}\n </div>\n </ng-container>\n </div>\n</ng-container>\n", styles: [":host{display:block;font:var(--tui-font-text-m)}.t-row{position:relative;display:flex;justify-content:space-between;block-size:2.25rem;isolation:isolate}.t-item{position:relative;flex:1;line-height:2rem;border-radius:var(--tui-radius-m)}.t-item:before,.t-item:after{position:absolute;top:0;left:0;bottom:0;right:0;content:\"\";z-index:-1;border-radius:var(--tui-radius-m)}.t-item:after{border-radius:.5rem}.t-cell{position:relative;display:flex;align-items:center;justify-content:center;inline-size:2.75rem;text-align:center;outline:none;cursor:pointer;background-clip:content-box;box-sizing:border-box;border:.125rem solid transparent}.t-cell:before{content:\"\";position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;border-radius:var(--tui-radius-m)}.t-cell_today:after{position:absolute;left:50%;transform:translate(-50%);content:\"\";bottom:.3125rem;block-size:.125rem;inline-size:.75rem;border-radius:.375rem;background:var(--tui-text-primary)}.t-cell_interval:before{background:var(--tui-background-base-alt)}:host._single .t-cell_interval:before{background:var(--tui-background-neutral-1-hover)}.t-cell_interval:not(:last-child):before{right:-.1875rem;border-start-end-radius:0;border-end-end-radius:0}.t-cell_interval:not([data-range=start]):not(:first-child):before{border-start-start-radius:0;border-end-start-radius:0}.t-cell_interval:last-child:first-child:before{right:0}.t-cell_interval:first-child>.t-item{border-start-start-radius:var(--tui-radius-m);border-end-start-radius:var(--tui-radius-m)}.t-cell_interval:last-child>.t-item{border-start-end-radius:var(--tui-radius-m);border-end-end-radius:var(--tui-radius-m)}.t-cell_interval>.t-item{border-radius:0}.t-cell[data-range]:after{background:var(--tui-text-primary-on-accent-1)}.t-cell[data-range]>.t-item{color:var(--tui-text-primary-on-accent-1)}.t-cell[data-range]>.t-item:before,.t-cell[data-range]>.t-item:after{background:var(--tui-background-accent-1)}.t-cell[data-range]:hover>.t-item:before,.t-cell[data-range]:hover>.t-item:after{background:var(--tui-background-accent-1-hover)}.t-cell[data-range]:active>.t-item:before,.t-cell[data-range]:active>.t-item:after{background:var(--tui-background-accent-1-pressed)}.t-cell[data-range=end]:before{background:var(--tui-background-base-alt)}:host._single .t-cell[data-range=end]:before{background:var(--tui-background-neutral-1-hover)}.t-cell[data-range=end]:not(:first-child):before{border-start-start-radius:0;border-end-start-radius:0}.t-cell[data-range=end]>.t-item:before{left:.625rem;border-start-start-radius:0;border-end-start-radius:0}.t-cell[data-range=end]>.t-item:after{left:-2rem;right:100%;transform:translate(1.6rem) scaleY(.83) scaleX(.5) rotate(45deg)}.t-cell[data-range=start]>.t-item:before{right:.625rem;border-start-end-radius:0;border-end-end-radius:0}.t-cell[data-range=start]>.t-item:after{left:100%;right:-2rem;transform:translate(-1.6rem) scaleY(.83) scaleX(.5) rotate(45deg)}.t-cell[data-range=single]>.t-item:after{display:none}.t-cell_disabled{pointer-events:none}.t-cell_disabled>.t-item{opacity:.36}.t-cell:hover:not([data-range])>.t-item{background:var(--tui-background-neutral-1-hover)}.t-cell:active:not([data-range])>.t-item{background:var(--tui-background-neutral-1-pressed)}:host{inline-size:20.75rem;max-inline-size:100vw}:host._ios{inline-size:22.625rem}.t-row{block-size:3rem;justify-content:flex-start}.t-row:first-child{justify-content:flex-end}:host._ios .t-row{block-size:3.125rem}.t-cell{block-size:2.75rem;border-radius:100%;overflow:hidden;margin-right:.25rem}.t-cell:last-child,:host._ios .t-cell:last-child{margin-right:0}.t-cell:before{right:-100vw}.t-cell:first-child:before{left:-100vw}.t-cell_today:after{block-size:.375rem;inline-size:.375rem;background-color:var(--tui-text-action)}.t-cell_interval:before{background-color:var(--tui-background-base-alt)}.t-cell_interval:last-child:first-child:before{right:-100vw}.t-cell_disabled{opacity:var(--tui-disabled-opacity)}.t-cell[data-range=single],.t-cell[data-range=start],.t-cell[data-range=end]{border-radius:100%;background-color:var(--tui-text-action);color:var(--tui-text-primary-on-accent-2);font-weight:500}.t-cell[data-range=single]:after,.t-cell[data-range=start]:after,.t-cell[data-range=end]:after{background-color:var(--tui-background-base)}:host._ios .t-cell[data-range=single],:host._ios .t-cell[data-range=start],:host._ios .t-cell[data-range=end]{font-weight:600}.t-cell[data-range=start]:before{left:50%;border-top-left-radius:0;border-bottom-left-radius:0}.t-cell[data-range=end]:not(:first-child):before{left:50%;background:var(--tui-background-base);border-radius:0}.t-cell[data-range=end]:first-child:before{right:50%;background-color:var(--tui-background-base-alt)}:host._ios .t-cell{margin-right:.5625rem}:host._ios .t-cell:before{border-radius:.5rem}@media screen and (max-width: 22.4375rem){.t-cell,:host._ios .t-cell{margin-right:.125rem}.t-cell:last-child,:host._ios .t-cell:last-child{margin-right:0}}\n"] }]
|
|
23
24
|
}] });
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs","sources":["../../../projects/addon-mobile/components/mobile-calendar-sheet/mobile-calendar-sheet.component.ts","../../../projects/addon-mobile/components/mobile-calendar-sheet/mobile-calendar-sheet.template.html","../../../projects/addon-mobile/components/mobile-calendar-sheet/taiga-ui-addon-mobile-components-mobile-calendar-sheet.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {TuiRipple} from '@taiga-ui/addon-mobile/directives';\nimport {TuiLet} from '@taiga-ui/cdk/directives/let';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {TuiCalendarSheet} from '@taiga-ui/core/components/calendar';\nimport {TuiCalendarSheetPipe} from '@taiga-ui/core/pipes/calendar-sheet';\n\n@Component({\n standalone: true,\n selector: 'tui-mobile-calendar-sheet',\n imports: [
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs","sources":["../../../projects/addon-mobile/components/mobile-calendar-sheet/mobile-calendar-sheet.component.ts","../../../projects/addon-mobile/components/mobile-calendar-sheet/mobile-calendar-sheet.template.html","../../../projects/addon-mobile/components/mobile-calendar-sheet/taiga-ui-addon-mobile-components-mobile-calendar-sheet.ts"],"sourcesContent":["import {NgIf} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, inject} from '@angular/core';\nimport {TuiRipple} from '@taiga-ui/addon-mobile/directives';\nimport {TuiLet} from '@taiga-ui/cdk/directives/let';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {TuiCalendarSheet} from '@taiga-ui/core/components/calendar';\nimport {TuiCalendarSheetPipe} from '@taiga-ui/core/pipes/calendar-sheet';\n\n@Component({\n standalone: true,\n selector: 'tui-mobile-calendar-sheet',\n imports: [NgIf, TuiCalendarSheetPipe, TuiLet, TuiRepeatTimes, TuiRipple],\n templateUrl: './mobile-calendar-sheet.template.html',\n styleUrls: ['./mobile-calendar-sheet.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class._ios]': 'isIOS',\n },\n})\nexport class TuiMobileCalendarSheet extends TuiCalendarSheet {\n protected readonly isIOS = inject(TUI_IS_IOS);\n}\n","<ng-container *tuiLet=\"month | tuiCalendarSheet as sheet\">\n <div\n *tuiRepeatTimes=\"let rowIndex of sheet.length\"\n automation-id=\"tui-primitive-calendar-mobile__row\"\n class=\"t-row\"\n >\n <ng-container *tuiRepeatTimes=\"let colIndex of sheet[rowIndex]?.length ?? 0\">\n <div\n *ngIf=\"sheet[rowIndex]?.[colIndex] as item\"\n automation-id=\"tui-primitive-calendar-mobile__cell\"\n tuiRipple\n class=\"t-cell\"\n [attr.data-range]=\"getItemRange(item)\"\n [class.t-cell_disabled]=\"disabledItemHandler(item)\"\n [class.t-cell_interval]=\"itemIsInterval(item)\"\n [class.t-cell_today]=\"itemIsToday(item)\"\n (click)=\"onItemClick(item)\"\n >\n {{ item.day }}\n </div>\n </ng-container>\n </div>\n</ng-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AASA,MAWa,sBAAuB,SAAQ,gBAAgB,CAAA;AAX5D,IAAA,WAAA,GAAA;;AAYuB,QAAA,IAAA,CAAA,KAAK,G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AAA,OAAA,EAC5B,CAAC,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,CAAC,mBAGvD,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,cAAc,EAAE,OAAO;AAC1B,qBAAA,EAAA,QAAA,EAAA,u7BAAA,EAAA,MAAA,EAAA,CAAA,k2JAAA,CAAA,EAAA,CAAA;;;AElBL;;AAEG;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VIRTUAL_SCROLL_STRATEGY, CdkFixedSizeVirtualScroll,
|
|
1
|
+
import { VIRTUAL_SCROLL_STRATEGY, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
2
2
|
import { DOCUMENT, AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { InjectionToken, Optional, ChangeDetectorRef, inject, DestroyRef, NgZone, EventEmitter, Component, ChangeDetectionStrategy, ViewChild, Input, Output } from '@angular/core';
|
|
@@ -7,7 +7,7 @@ import { TuiMobileCalendarSheet } from '@taiga-ui/addon-mobile/components/mobile
|
|
|
7
7
|
import { TuiRipple, TuiTouchable } from '@taiga-ui/addon-mobile/directives';
|
|
8
8
|
import { TUI_FALSE_HANDLER } from '@taiga-ui/cdk/constants';
|
|
9
9
|
import { MONTHS_IN_YEAR, TuiDay, TuiMonth, TUI_FIRST_DAY, TUI_LAST_DAY, TuiDayRange } from '@taiga-ui/cdk/date-time';
|
|
10
|
-
import { tuiWatch, tuiZonefree, tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
|
|
10
|
+
import { tuiWatch, tuiZonefreeScheduler, tuiZonefree, tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
|
|
11
11
|
import { TuiMapperPipe } from '@taiga-ui/cdk/pipes/mapper';
|
|
12
12
|
import { TUI_IS_IOS, TUI_IS_E2E } from '@taiga-ui/cdk/tokens';
|
|
13
13
|
import { TuiButton } from '@taiga-ui/core/components/button';
|
|
@@ -131,9 +131,9 @@ class TuiMobileCalendarStrategy {
|
|
|
131
131
|
const years = ((offset - remainder) / cycleHeight) * YEARLY_CYCLE;
|
|
132
132
|
let accumulator = 0;
|
|
133
133
|
for (let year = 0; year < cycle.length; year++) {
|
|
134
|
-
for (let month = 0; month < cycle[year]
|
|
135
|
-
accumulator += cycle[year][month];
|
|
136
|
-
if (accumulator - cycle[year][month] / 2 > remainder) {
|
|
134
|
+
for (let month = 0; month < (cycle[year]?.length ?? 0); month++) {
|
|
135
|
+
accumulator += cycle[year]?.[month] ?? 0;
|
|
136
|
+
if (accumulator - (cycle[year]?.[month] ?? 0) / 2 > remainder) {
|
|
137
137
|
return Math.max((years + year) * MONTHS_IN_YEAR + month, 0);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
@@ -249,7 +249,7 @@ class TuiMobileCalendar {
|
|
|
249
249
|
this.activeMonth += this.getMonthOffset(year);
|
|
250
250
|
this.activeYear = year;
|
|
251
251
|
this.scrollToActiveYear('smooth');
|
|
252
|
-
timer(0)
|
|
252
|
+
timer(0, tuiZonefreeScheduler(this.ngZone))
|
|
253
253
|
.pipe(tuiZonefree(this.ngZone), takeUntilDestroyed(this.destroyRef))
|
|
254
254
|
.subscribe(() => this.scrollToActiveMonth());
|
|
255
255
|
}
|
|
@@ -392,7 +392,7 @@ class TuiMobileCalendar {
|
|
|
392
392
|
});
|
|
393
393
|
// Smooth scroll to activeYear after scrolling is done
|
|
394
394
|
touchstart$
|
|
395
|
-
.pipe(switchMap(() => touchend$), switchMap(() => race(yearsScrollRef.elementScrolled(), timer(SCROLL_DEBOUNCE_TIME)).pipe(debounceTime(SCROLL_DEBOUNCE_TIME * 2), take(1), takeUntil(touchstart$))), takeUntilDestroyed(this.destroyRef))
|
|
395
|
+
.pipe(switchMap(() => touchend$), switchMap(() => race(yearsScrollRef.elementScrolled(), timer(SCROLL_DEBOUNCE_TIME, tuiZonefreeScheduler(this.ngZone))).pipe(debounceTime(SCROLL_DEBOUNCE_TIME * 2, tuiZonefreeScheduler(this.ngZone)), take(1), takeUntil(touchstart$))), takeUntilDestroyed(this.destroyRef))
|
|
396
396
|
.subscribe(() => this.scrollToActiveYear('smooth'));
|
|
397
397
|
}
|
|
398
398
|
initMonthScroll() {
|
|
@@ -404,7 +404,7 @@ class TuiMobileCalendar {
|
|
|
404
404
|
const touchend$ = tuiTypedFromEvent(monthsScrollRef.elementRef.nativeElement, 'touchend', { passive: true });
|
|
405
405
|
// Smooth scroll to the closest month after scrolling is done
|
|
406
406
|
touchstart$
|
|
407
|
-
.pipe(switchMap(() => touchend$), switchMap(() => race(monthsScrollRef.elementScrolled(), timer(SCROLL_DEBOUNCE_TIME)).pipe(debounceTime(SCROLL_DEBOUNCE_TIME * 2), take(1), takeUntil(touchstart$))), takeUntilDestroyed(this.destroyRef))
|
|
407
|
+
.pipe(switchMap(() => touchend$), switchMap(() => race(monthsScrollRef.elementScrolled(), timer(SCROLL_DEBOUNCE_TIME, tuiZonefreeScheduler(this.ngZone))).pipe(debounceTime(SCROLL_DEBOUNCE_TIME * 2), take(1), takeUntil(touchstart$))), takeUntilDestroyed(this.destroyRef))
|
|
408
408
|
.subscribe(() => this.scrollToActiveMonth('smooth'));
|
|
409
409
|
}
|
|
410
410
|
scrollToActiveYear(behavior = 'auto') {
|
|
@@ -423,29 +423,29 @@ class TuiMobileCalendar {
|
|
|
423
423
|
return (year - this.activeYear) * MONTHS_IN_YEAR;
|
|
424
424
|
}
|
|
425
425
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiMobileCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
426
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiMobileCalendar, isStandalone: true, selector: "tui-mobile-calendar", inputs: { single: "single", multi: "multi", min: "min", max: "max", disabledItemHandler: "disabledItemHandler", value: "value" }, outputs: { cancel: "cancel", confirm: "confirm", valueChange: "valueChange" }, host: { properties: { "class._ios": "isIOS", "class._initialized": "initialized" } }, providers: TUI_MOBILE_CALENDAR_PROVIDERS, viewQueries: [{ propertyName: "yearsScrollRef", first: true, predicate: ["yearsScrollRef"], descendants: true }, { propertyName: "monthsScrollRef", first: true, predicate: ["monthsScrollRef"], descendants: true }], ngImport: i0, template: "<header\n *ngIf=\"chooseDayOrRangeTexts$ | async as texts\"\n class=\"t-header\"\n>\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$ | async }}\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$ | async }}\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$ | async }}\n </button>\n</header>\n<cdk-virtual-scroll-viewport\n #yearsScrollRef\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 <div\n *ngFor=\"let day of unorderedWeekDays$ | tuiOrderWeekDays | async\"\n class=\"t-day\"\n >\n {{ day }}\n </div>\n</div>\n<cdk-virtual-scroll-viewport\n #monthsScrollRef\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\">{{ month | tuiMonth | async }}</h2>\n <tui-mobile-calendar-sheet\n class=\"t-calendar\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper : min : max\"\n [month]=\"month\"\n [value]=\"value\"\n (dayClick)=\"onDayClick($event)\"\n />\n </section>\n</cdk-virtual-scroll-viewport>\n", styles: [":host{display:block;
|
|
426
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiMobileCalendar, isStandalone: true, selector: "tui-mobile-calendar", inputs: { single: "single", multi: "multi", min: "min", max: "max", disabledItemHandler: "disabledItemHandler", value: "value" }, outputs: { cancel: "cancel", confirm: "confirm", valueChange: "valueChange" }, host: { properties: { "class._ios": "isIOS", "class._initialized": "initialized" } }, providers: TUI_MOBILE_CALENDAR_PROVIDERS, viewQueries: [{ propertyName: "yearsScrollRef", first: true, predicate: ["yearsScrollRef"], descendants: true }, { propertyName: "monthsScrollRef", first: true, predicate: ["monthsScrollRef"], descendants: true }], ngImport: i0, template: "<header\n *ngIf=\"chooseDayOrRangeTexts$ | async as texts\"\n class=\"t-header\"\n>\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$ | async }}\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$ | async }}\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$ | async }}\n </button>\n</header>\n<cdk-virtual-scroll-viewport\n #yearsScrollRef\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 <div\n *ngFor=\"let day of unorderedWeekDays$ | tuiOrderWeekDays | async\"\n class=\"t-day\"\n >\n {{ day }}\n </div>\n</div>\n<cdk-virtual-scroll-viewport\n #monthsScrollRef\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\">{{ month | tuiMonth | async }}</h2>\n <tui-mobile-calendar-sheet\n class=\"t-calendar\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper : min : max\"\n [month]=\"month\"\n [value]=\"value\"\n (dayClick)=\"onDayClick($event)\"\n />\n </section>\n</cdk-virtual-scroll-viewport>\n", styles: [":host{display:block;block-size:100%;font-family:-apple-system,BlinkMacSystemFont,Roboto,sans-serif;color:var(--tui-text-primary);-webkit-tap-highlight-color:transparent}.t-header{position:relative;display:flex;align-items:center;block-size:3.5rem;padding:0 1rem;border-bottom:.5px solid var(--tui-border-normal)}:host._ios .t-header{block-size:2.75rem;border-bottom:none}.t-close{inline-size:1.5rem;block-size:1.5rem;margin-right:2rem}:host._ios .t-close{display:none}.t-link{margin-left: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-left: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-size: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{margin:.625rem 0 -.625rem}.t-month{block-size:2.75rem;line-height:2.75rem;padding-left:1rem;font-size:.875rem;font-weight:500;text-transform:uppercase;margin:0 0 1.25rem;box-sizing:border-box;border-bottom:.5px solid var(--tui-border-normal)}:host._ios .t-month{block-size:3.125rem;margin:0;border-bottom:none;text-transform:none;font-size:1.375rem;line-height:3.125rem;letter-spacing:.02rem;font-weight:700}.t-calendar{margin:0 auto;font-family:inherit;font-size:1.125rem;transition:opacity .2s}:host._ios .t-calendar{font-size:1.0625rem}.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: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }, { kind: "component", type: TuiMobileCalendarSheet, selector: "tui-mobile-calendar-sheet" }, { kind: "pipe", type: TuiMonthPipe, name: "tuiMonth" }, { 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 }); }
|
|
427
427
|
}
|
|
428
428
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiMobileCalendar, decorators: [{
|
|
429
429
|
type: Component,
|
|
430
430
|
args: [{ standalone: true, selector: 'tui-mobile-calendar', imports: [
|
|
431
|
-
TuiButton,
|
|
432
431
|
AsyncPipe,
|
|
433
|
-
TuiRipple,
|
|
434
|
-
TuiLink,
|
|
435
|
-
TuiTouchable,
|
|
436
432
|
CdkFixedSizeVirtualScroll,
|
|
437
|
-
CdkVirtualScrollViewport,
|
|
438
433
|
CdkVirtualForOf,
|
|
439
|
-
|
|
440
|
-
TuiMobileCalendarSheet,
|
|
441
|
-
TuiMonthPipe,
|
|
434
|
+
CdkVirtualScrollViewport,
|
|
442
435
|
NgForOf,
|
|
443
436
|
NgIf,
|
|
437
|
+
TuiButton,
|
|
438
|
+
TuiLink,
|
|
444
439
|
TuiMapperPipe,
|
|
440
|
+
TuiMobileCalendarSheet,
|
|
441
|
+
TuiMonthPipe,
|
|
442
|
+
TuiOrderWeekDaysPipe,
|
|
443
|
+
TuiRipple,
|
|
444
|
+
TuiTouchable,
|
|
445
445
|
], changeDetection: ChangeDetectionStrategy.OnPush, providers: TUI_MOBILE_CALENDAR_PROVIDERS, host: {
|
|
446
446
|
'[class._ios]': 'isIOS',
|
|
447
447
|
'[class._initialized]': 'initialized',
|
|
448
|
-
}, template: "<header\n *ngIf=\"chooseDayOrRangeTexts$ | async as texts\"\n class=\"t-header\"\n>\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$ | async }}\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$ | async }}\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$ | async }}\n </button>\n</header>\n<cdk-virtual-scroll-viewport\n #yearsScrollRef\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 <div\n *ngFor=\"let day of unorderedWeekDays$ | tuiOrderWeekDays | async\"\n class=\"t-day\"\n >\n {{ day }}\n </div>\n</div>\n<cdk-virtual-scroll-viewport\n #monthsScrollRef\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\">{{ month | tuiMonth | async }}</h2>\n <tui-mobile-calendar-sheet\n class=\"t-calendar\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper : min : max\"\n [month]=\"month\"\n [value]=\"value\"\n (dayClick)=\"onDayClick($event)\"\n />\n </section>\n</cdk-virtual-scroll-viewport>\n", styles: [":host{display:block;
|
|
448
|
+
}, template: "<header\n *ngIf=\"chooseDayOrRangeTexts$ | async as texts\"\n class=\"t-header\"\n>\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$ | async }}\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$ | async }}\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$ | async }}\n </button>\n</header>\n<cdk-virtual-scroll-viewport\n #yearsScrollRef\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 <div\n *ngFor=\"let day of unorderedWeekDays$ | tuiOrderWeekDays | async\"\n class=\"t-day\"\n >\n {{ day }}\n </div>\n</div>\n<cdk-virtual-scroll-viewport\n #monthsScrollRef\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\">{{ month | tuiMonth | async }}</h2>\n <tui-mobile-calendar-sheet\n class=\"t-calendar\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper : min : max\"\n [month]=\"month\"\n [value]=\"value\"\n (dayClick)=\"onDayClick($event)\"\n />\n </section>\n</cdk-virtual-scroll-viewport>\n", styles: [":host{display:block;block-size:100%;font-family:-apple-system,BlinkMacSystemFont,Roboto,sans-serif;color:var(--tui-text-primary);-webkit-tap-highlight-color:transparent}.t-header{position:relative;display:flex;align-items:center;block-size:3.5rem;padding:0 1rem;border-bottom:.5px solid var(--tui-border-normal)}:host._ios .t-header{block-size:2.75rem;border-bottom:none}.t-close{inline-size:1.5rem;block-size:1.5rem;margin-right:2rem}:host._ios .t-close{display:none}.t-link{margin-left: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-left: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-size: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{margin:.625rem 0 -.625rem}.t-month{block-size:2.75rem;line-height:2.75rem;padding-left:1rem;font-size:.875rem;font-weight:500;text-transform:uppercase;margin:0 0 1.25rem;box-sizing:border-box;border-bottom:.5px solid var(--tui-border-normal)}:host._ios .t-month{block-size:3.125rem;margin:0;border-bottom:none;text-transform:none;font-size:1.375rem;line-height:3.125rem;letter-spacing:.02rem;font-weight:700}.t-calendar{margin:0 auto;font-family:inherit;font-size:1.125rem;transition:opacity .2s}:host._ios .t-calendar{font-size:1.0625rem}.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"] }]
|
|
449
449
|
}], ctorParameters: function () { return []; }, propDecorators: { yearsScrollRef: [{
|
|
450
450
|
type: ViewChild,
|
|
451
451
|
args: ['yearsScrollRef']
|