@taiga-ui/addon-mobile 2.83.0 → 2.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/bundles/taiga-ui-addon-mobile-components-tab-bar.umd.js +435 -0
  2. package/bundles/taiga-ui-addon-mobile-components-tab-bar.umd.js.map +1 -0
  3. package/bundles/taiga-ui-addon-mobile-components-tab-bar.umd.min.js +2 -0
  4. package/bundles/taiga-ui-addon-mobile-components-tab-bar.umd.min.js.map +1 -0
  5. package/bundles/taiga-ui-addon-mobile-components.umd.js +12 -4
  6. package/bundles/taiga-ui-addon-mobile-components.umd.js.map +1 -1
  7. package/bundles/taiga-ui-addon-mobile-components.umd.min.js +1 -1
  8. package/components/index.d.ts +1 -0
  9. package/components/tab-bar/index.d.ts +4 -0
  10. package/components/tab-bar/package.json +13 -0
  11. package/components/tab-bar/tab-bar-item.component.d.ts +15 -0
  12. package/components/tab-bar/tab-bar-item.directive.d.ts +6 -0
  13. package/components/tab-bar/tab-bar.component.d.ts +9 -0
  14. package/components/tab-bar/tab-bar.module.d.ts +2 -0
  15. package/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.d.ts +4 -0
  16. package/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.metadata.json +1 -0
  17. package/components/taiga-ui-addon-mobile-components.metadata.json +1 -1
  18. package/esm2015/components/index.js +2 -1
  19. package/esm2015/components/tab-bar/index.js +5 -0
  20. package/esm2015/components/tab-bar/tab-bar-item.component.js +35 -0
  21. package/esm2015/components/tab-bar/tab-bar-item.directive.js +36 -0
  22. package/esm2015/components/tab-bar/tab-bar.component.js +48 -0
  23. package/esm2015/components/tab-bar/tab-bar.module.js +18 -0
  24. package/esm2015/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.js +5 -0
  25. package/esm5/components/index.js +2 -1
  26. package/esm5/components/tab-bar/index.js +5 -0
  27. package/esm5/components/tab-bar/tab-bar-item.component.js +36 -0
  28. package/esm5/components/tab-bar/tab-bar-item.directive.js +38 -0
  29. package/esm5/components/tab-bar/tab-bar.component.js +56 -0
  30. package/esm5/components/tab-bar/tab-bar.module.js +21 -0
  31. package/esm5/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.js +5 -0
  32. package/fesm2015/taiga-ui-addon-mobile-components-tab-bar.js +126 -0
  33. package/fesm2015/taiga-ui-addon-mobile-components-tab-bar.js.map +1 -0
  34. package/fesm2015/taiga-ui-addon-mobile-components.js +1 -0
  35. package/fesm2015/taiga-ui-addon-mobile-components.js.map +1 -1
  36. package/fesm5/taiga-ui-addon-mobile-components-tab-bar.js +140 -0
  37. package/fesm5/taiga-ui-addon-mobile-components-tab-bar.js.map +1 -0
  38. package/fesm5/taiga-ui-addon-mobile-components.js +1 -0
  39. package/fesm5/taiga-ui-addon-mobile-components.js.map +1 -1
  40. package/package.json +4 -4
@@ -0,0 +1,126 @@
1
+ import { __decorate, __param } from 'tslib';
2
+ import { Inject, Input, Component, ChangeDetectionStrategy, EventEmitter, ContentChildren, forwardRef, ElementRef, Output, HostListener, HostBinding, Self, ChangeDetectorRef, Directive, NgModule } from '@angular/core';
3
+ import { EMPTY_QUERY, tuiIsElement, tuiWatch, TuiDestroyService } from '@taiga-ui/cdk';
4
+ import { TUI_ANIMATION_OPTIONS, tuiScaleIn, TuiRouterLinkActiveService, TuiSvgModule } from '@taiga-ui/core';
5
+ import { CommonModule } from '@angular/common';
6
+ import { Observable } from 'rxjs';
7
+ import { filter, takeUntil } from 'rxjs/operators';
8
+
9
+ let TuiTabBarItemComponent = class TuiTabBarItemComponent {
10
+ constructor(animationOptions) {
11
+ this.animationOptions = animationOptions;
12
+ this.icon = '';
13
+ this.badge = null;
14
+ this.animation = Object.assign({ value: '' }, this.animationOptions);
15
+ }
16
+ format(value) {
17
+ return value > 999 ? '999+' : String(value);
18
+ }
19
+ };
20
+ TuiTabBarItemComponent.ctorParameters = () => [
21
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_ANIMATION_OPTIONS,] }] }
22
+ ];
23
+ __decorate([
24
+ Input()
25
+ ], TuiTabBarItemComponent.prototype, "icon", void 0);
26
+ __decorate([
27
+ Input()
28
+ ], TuiTabBarItemComponent.prototype, "badge", void 0);
29
+ TuiTabBarItemComponent = __decorate([
30
+ Component({
31
+ selector: 'button[tuiTabBarItem], a[tuiTabBarItem]',
32
+ template: "<tui-svg\n class=\"t-icon\"\n [src]=\"icon\"\n></tui-svg>\n<span class=\"t-wrapper\">\n <span\n *ngIf=\"badge as value\"\n class=\"t-badge\"\n [@tuiScaleIn]=\"animation\"\n >\n {{ format(value) }}\n </span>\n</span>\n<span class=\"t-text\">\n <ng-content></ng-content>\n</span>\n",
33
+ changeDetection: ChangeDetectionStrategy.OnPush,
34
+ animations: [tuiScaleIn],
35
+ styles: [":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;transition-property:color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:relative;display:flex;flex:1 0;font:inherit;flex-direction:column;align-items:center;overflow:hidden;text-decoration:none}:host:nth-child(1){color:var(--tui-tab-1,inherit)}:host:nth-child(2){color:var(--tui-tab-2,inherit)}:host:nth-child(3){color:var(--tui-tab-3,inherit)}:host:nth-child(4){color:var(--tui-tab-4,inherit)}:host:nth-child(5){color:var(--tui-tab-5,inherit)}:host:nth-child(6){color:var(--tui-tab-6,inherit)}:host:nth-child(7){color:var(--tui-tab-7,inherit)}:host:nth-child(8){color:var(--tui-tab-8,inherit)}:host:nth-child(9){color:var(--tui-tab-9,inherit)}:host:nth-child(10){color:var(--tui-tab-10,inherit)}.t-icon{width:1.75rem;height:1.75rem;margin:.375rem 0 .125rem;pointer-events:none}.t-wrapper{position:absolute;top:.125rem;left:1rem;display:flex;width:100%;justify-content:center;pointer-events:none}.t-badge{display:flex;height:1.125rem;min-width:1.125rem;align-items:center;padding:0 .25rem;border-radius:1rem;font-size:.8125rem;box-sizing:border-box;color:var(--tui-base-01);background:var(--tui-error-fill)}.t-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;pointer-events:none}"]
36
+ }),
37
+ __param(0, Inject(TUI_ANIMATION_OPTIONS))
38
+ ], TuiTabBarItemComponent);
39
+
40
+ let TuiTabBarComponent = class TuiTabBarComponent {
41
+ constructor() {
42
+ this.tabs = EMPTY_QUERY;
43
+ this.activeItemIndex = NaN;
44
+ this.activeItemIndexChange = new EventEmitter();
45
+ }
46
+ setActive(tab) {
47
+ if (tuiIsElement(tab)) {
48
+ this.updateIndex(this.tabs.toArray().findIndex(({ nativeElement }) => nativeElement === tab));
49
+ }
50
+ }
51
+ get style() {
52
+ return `--tui-tab-${this.activeItemIndex + 1}: var(--tui-active-color)`;
53
+ }
54
+ updateIndex(index) {
55
+ this.activeItemIndex = index;
56
+ this.activeItemIndexChange.emit(index);
57
+ }
58
+ };
59
+ __decorate([
60
+ ContentChildren(forwardRef(() => TuiTabBarItemComponent), { read: ElementRef })
61
+ ], TuiTabBarComponent.prototype, "tabs", void 0);
62
+ __decorate([
63
+ Input()
64
+ ], TuiTabBarComponent.prototype, "activeItemIndex", void 0);
65
+ __decorate([
66
+ Output()
67
+ ], TuiTabBarComponent.prototype, "activeItemIndexChange", void 0);
68
+ __decorate([
69
+ HostListener('click', ['$event.target'])
70
+ ], TuiTabBarComponent.prototype, "setActive", null);
71
+ __decorate([
72
+ HostBinding('style')
73
+ ], TuiTabBarComponent.prototype, "style", null);
74
+ TuiTabBarComponent = __decorate([
75
+ Component({
76
+ selector: 'nav[tuiTabBar]',
77
+ template: '<ng-content></ng-content>',
78
+ changeDetection: ChangeDetectionStrategy.OnPush,
79
+ styles: [":host{--tui-active-color:var(--tui-primary);position:relative;display:flex;align-items:flex-start;font:.625rem/.75rem -apple-system,BlinkMacSystemFont,system-ui,Roboto,'Segoe UI',sans-serif;height:var(--tui-height-l);color:var(--tui-text-03);-webkit-backdrop-filter:blur(.25rem);backdrop-filter:blur(.25rem)}:host:before{position:absolute;top:0;left:0;width:100%;height:100%;content:'';background:var(--tui-elevation-01);box-shadow:inset 0 1px var(--tui-base-04);opacity:.9}"]
80
+ })
81
+ ], TuiTabBarComponent);
82
+
83
+ let TuiTabBarItemDirective = class TuiTabBarItemDirective {
84
+ constructor(destroy$, active$, tabs, { nativeElement }, changeDetectorRef) {
85
+ active$
86
+ .pipe(filter(Boolean), tuiWatch(changeDetectorRef), takeUntil(destroy$))
87
+ .subscribe(() => {
88
+ tabs.setActive(nativeElement);
89
+ });
90
+ }
91
+ };
92
+ TuiTabBarItemDirective.ctorParameters = () => [
93
+ { type: Observable, decorators: [{ type: Self }, { type: Inject, args: [TuiDestroyService,] }] },
94
+ { type: Observable, decorators: [{ type: Inject, args: [TuiRouterLinkActiveService,] }] },
95
+ { type: TuiTabBarComponent, decorators: [{ type: Inject, args: [TuiTabBarComponent,] }] },
96
+ { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
97
+ { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] }
98
+ ];
99
+ TuiTabBarItemDirective = __decorate([
100
+ Directive({
101
+ selector: '[tuiTabBarItem][routerLinkActive]',
102
+ providers: [TuiRouterLinkActiveService, TuiDestroyService],
103
+ }),
104
+ __param(0, Self()), __param(0, Inject(TuiDestroyService)),
105
+ __param(1, Inject(TuiRouterLinkActiveService)),
106
+ __param(2, Inject(TuiTabBarComponent)),
107
+ __param(3, Inject(ElementRef)),
108
+ __param(4, Inject(ChangeDetectorRef))
109
+ ], TuiTabBarItemDirective);
110
+
111
+ let TuiTabBarModule = class TuiTabBarModule {
112
+ };
113
+ TuiTabBarModule = __decorate([
114
+ NgModule({
115
+ imports: [CommonModule, TuiSvgModule],
116
+ declarations: [TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective],
117
+ exports: [TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective],
118
+ })
119
+ ], TuiTabBarModule);
120
+
121
+ /**
122
+ * Generated bundle index. Do not edit.
123
+ */
124
+
125
+ export { TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective, TuiTabBarModule };
126
+ //# sourceMappingURL=taiga-ui-addon-mobile-components-tab-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taiga-ui-addon-mobile-components-tab-bar.js","sources":["ng://@taiga-ui/addon-mobile/components/tab-bar/tab-bar-item.component.ts","ng://@taiga-ui/addon-mobile/components/tab-bar/tab-bar.component.ts","ng://@taiga-ui/addon-mobile/components/tab-bar/tab-bar-item.directive.ts","ng://@taiga-ui/addon-mobile/components/tab-bar/tab-bar.module.ts","ng://@taiga-ui/addon-mobile/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core';\nimport {TUI_ANIMATION_OPTIONS, tuiScaleIn} from '@taiga-ui/core';\n\n@Component({\n selector: 'button[tuiTabBarItem], a[tuiTabBarItem]',\n templateUrl: './tab-bar-item.template.html',\n styleUrls: ['./tab-bar-item.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiScaleIn],\n})\nexport class TuiTabBarItemComponent {\n @Input()\n icon = '';\n\n @Input()\n badge?: number | null = null;\n\n readonly animation = {value: '', ...this.animationOptions} as const;\n\n constructor(\n @Inject(TUI_ANIMATION_OPTIONS)\n private readonly animationOptions: AnimationOptions,\n ) {}\n\n format(value: number): string {\n return value > 999 ? '999+' : String(value);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n HostListener,\n Input,\n Output,\n QueryList,\n} from '@angular/core';\nimport {EMPTY_QUERY, tuiIsElement} from '@taiga-ui/cdk';\n\nimport {TuiTabBarItemComponent} from './tab-bar-item.component';\n\n@Component({\n selector: 'nav[tuiTabBar]',\n template: '<ng-content></ng-content>',\n styleUrls: ['./tab-bar.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiTabBarComponent {\n @ContentChildren(forwardRef(() => TuiTabBarItemComponent), {read: ElementRef})\n private readonly tabs: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n @Input()\n activeItemIndex = NaN;\n\n @Output()\n readonly activeItemIndexChange = new EventEmitter<number>();\n\n @HostListener('click', ['$event.target'])\n setActive(tab: EventTarget): void {\n if (tuiIsElement(tab)) {\n this.updateIndex(\n this.tabs.toArray().findIndex(({nativeElement}) => nativeElement === tab),\n );\n }\n }\n\n @HostBinding('style')\n get style(): string {\n return `--tui-tab-${this.activeItemIndex + 1}: var(--tui-active-color)`;\n }\n\n private updateIndex(index: number): void {\n this.activeItemIndex = index;\n this.activeItemIndexChange.emit(index);\n }\n}\n","import {ChangeDetectorRef, Directive, ElementRef, Inject, Self} from '@angular/core';\nimport {TuiDestroyService, tuiWatch} from '@taiga-ui/cdk';\nimport {TuiRouterLinkActiveService} from '@taiga-ui/core';\nimport {Observable} from 'rxjs';\nimport {filter, takeUntil} from 'rxjs/operators';\n\nimport {TuiTabBarComponent} from './tab-bar.component';\n\n@Directive({\n selector: '[tuiTabBarItem][routerLinkActive]',\n providers: [TuiRouterLinkActiveService, TuiDestroyService],\n})\nexport class TuiTabBarItemDirective {\n constructor(\n @Self() @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n @Inject(TuiRouterLinkActiveService) active$: Observable<boolean>,\n @Inject(TuiTabBarComponent) tabs: TuiTabBarComponent,\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n ) {\n active$\n .pipe(filter(Boolean), tuiWatch(changeDetectorRef), takeUntil(destroy$))\n .subscribe(() => {\n tabs.setActive(nativeElement);\n });\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core';\n\nimport {TuiTabBarComponent} from './tab-bar.component';\nimport {TuiTabBarItemComponent} from './tab-bar-item.component';\nimport {TuiTabBarItemDirective} from './tab-bar-item.directive';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule],\n declarations: [TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective],\n exports: [TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective],\n})\nexport class TuiTabBarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;IAWa,sBAAsB,GAAnC,MAAa,sBAAsB;IAS/B,YAEqB,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;QATvD,SAAI,GAAG,EAAE,CAAC;QAGV,UAAK,GAAmB,IAAI,CAAC;QAEpB,cAAS,GAAG,gBAAC,KAAK,EAAE,EAAE,IAAK,IAAI,CAAC,gBAAgB,CAAU,CAAC;KAKhE;IAEJ,MAAM,CAAC,KAAa;QAChB,OAAO,KAAK,GAAG,GAAG,GAAG,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;KAC/C;EACJ;;4CAPQ,MAAM,SAAC,qBAAqB;;AARjC;IADC,KAAK,EAAE;oDACE;AAGV;IADC,KAAK,EAAE;qDACqB;AALpB,sBAAsB;IAPlC,SAAS,CAAC;QACP,QAAQ,EAAE,yCAAyC;QACnD,iVAA2C;QAE3C,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,UAAU,EAAE,CAAC,UAAU,CAAC;;KAC3B,CAAC;IAWO,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;GAVzB,sBAAsB,CAiBlC;;ICLY,kBAAkB,GAA/B,MAAa,kBAAkB;IAA/B;QAEqB,SAAI,GAAuC,WAAW,CAAC;QAGxE,oBAAe,GAAG,GAAG,CAAC;QAGb,0BAAqB,GAAG,IAAI,YAAY,EAAU,CAAC;KAoB/D;IAjBG,SAAS,CAAC,GAAgB;QACtB,IAAI,YAAY,CA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YAAI,MAAM,SAAC,iBAAiB;YACY,UAAU,uBAAtD,MAAM,SAAC,0BAA0B;YACA,kBAAkB,uBAAnD,MAAM,SAAC,kBAAkB;YACW,UAAU,uBAA9C,MAAM,SAAC,UAAU;YAC4B,iBAAiB,uBAA9D,MAAM,SAAC,iBAAiB;;AANpB,sBAAsB;IAJlC,SAAS,CAAC;QACP,QAAQ,EAAE,mCAAmC;QAC7C,SAAS,EAAE,CAAC,0BAA0B,EAAE,iBAAiB,CAAC;KAC7D,CAAC;IAGO,WAAA,IAAI,EAAE,CAAA,EAAE,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,0BAA0B,CAAC,CAAA;IAClC,WAAA,MAAM,CAAC,kBAAkB,CAAC,CAAA;IAC1B,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;GANrB,sBAAsB,CAclC;;ICbY,eAAe,GAA5B,MAAa,eAAe;EAAG;AAAlB,eAAe;IAL3B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACrC,YAAY,EAAE,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;QAClF,OAAO,EAAE,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;KAChF,CAAC;GACW,eAAe,CAAG;;ACb/B;;;;;;"}
@@ -3,6 +3,7 @@ export * from '@taiga-ui/addon-mobile/components/mobile-calendar-dialog';
3
3
  export * from '@taiga-ui/addon-mobile/components/mobile-dialog';
4
4
  export * from '@taiga-ui/addon-mobile/components/pull-to-refresh';
5
5
  export * from '@taiga-ui/addon-mobile/components/sheet';
6
+ export * from '@taiga-ui/addon-mobile/components/tab-bar';
6
7
  export * from '@taiga-ui/addon-mobile/components/theme-android';
7
8
  export * from '@taiga-ui/addon-mobile/components/theme-ios';
8
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-mobile-components.js","sources":["ng://@taiga-ui/addon-mobile/components/taiga-ui-addon-mobile-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;;"}
1
+ {"version":3,"file":"taiga-ui-addon-mobile-components.js","sources":["ng://@taiga-ui/addon-mobile/components/taiga-ui-addon-mobile-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;"}
@@ -0,0 +1,140 @@
1
+ import { __assign, __decorate, __param } from 'tslib';
2
+ import { Inject, Input, Component, ChangeDetectionStrategy, EventEmitter, ContentChildren, forwardRef, ElementRef, Output, HostListener, HostBinding, Self, ChangeDetectorRef, Directive, NgModule } from '@angular/core';
3
+ import { EMPTY_QUERY, tuiIsElement, tuiWatch, TuiDestroyService } from '@taiga-ui/cdk';
4
+ import { TUI_ANIMATION_OPTIONS, tuiScaleIn, TuiRouterLinkActiveService, TuiSvgModule } from '@taiga-ui/core';
5
+ import { CommonModule } from '@angular/common';
6
+ import { Observable } from 'rxjs';
7
+ import { filter, takeUntil } from 'rxjs/operators';
8
+
9
+ var TuiTabBarItemComponent = /** @class */ (function () {
10
+ function TuiTabBarItemComponent(animationOptions) {
11
+ this.animationOptions = animationOptions;
12
+ this.icon = '';
13
+ this.badge = null;
14
+ this.animation = __assign({ value: '' }, this.animationOptions);
15
+ }
16
+ TuiTabBarItemComponent.prototype.format = function (value) {
17
+ return value > 999 ? '999+' : String(value);
18
+ };
19
+ TuiTabBarItemComponent.ctorParameters = function () { return [
20
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_ANIMATION_OPTIONS,] }] }
21
+ ]; };
22
+ __decorate([
23
+ Input()
24
+ ], TuiTabBarItemComponent.prototype, "icon", void 0);
25
+ __decorate([
26
+ Input()
27
+ ], TuiTabBarItemComponent.prototype, "badge", void 0);
28
+ TuiTabBarItemComponent = __decorate([
29
+ Component({
30
+ selector: 'button[tuiTabBarItem], a[tuiTabBarItem]',
31
+ template: "<tui-svg\n class=\"t-icon\"\n [src]=\"icon\"\n></tui-svg>\n<span class=\"t-wrapper\">\n <span\n *ngIf=\"badge as value\"\n class=\"t-badge\"\n [@tuiScaleIn]=\"animation\"\n >\n {{ format(value) }}\n </span>\n</span>\n<span class=\"t-text\">\n <ng-content></ng-content>\n</span>\n",
32
+ changeDetection: ChangeDetectionStrategy.OnPush,
33
+ animations: [tuiScaleIn],
34
+ styles: [":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:0 0;font-size:inherit;line-height:inherit;transition-property:color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:relative;display:flex;flex:1 0;font:inherit;flex-direction:column;align-items:center;overflow:hidden;text-decoration:none}:host:nth-child(1){color:var(--tui-tab-1,inherit)}:host:nth-child(2){color:var(--tui-tab-2,inherit)}:host:nth-child(3){color:var(--tui-tab-3,inherit)}:host:nth-child(4){color:var(--tui-tab-4,inherit)}:host:nth-child(5){color:var(--tui-tab-5,inherit)}:host:nth-child(6){color:var(--tui-tab-6,inherit)}:host:nth-child(7){color:var(--tui-tab-7,inherit)}:host:nth-child(8){color:var(--tui-tab-8,inherit)}:host:nth-child(9){color:var(--tui-tab-9,inherit)}:host:nth-child(10){color:var(--tui-tab-10,inherit)}.t-icon{width:1.75rem;height:1.75rem;margin:.375rem 0 .125rem;pointer-events:none}.t-wrapper{position:absolute;top:.125rem;left:1rem;display:flex;width:100%;justify-content:center;pointer-events:none}.t-badge{display:flex;height:1.125rem;min-width:1.125rem;align-items:center;padding:0 .25rem;border-radius:1rem;font-size:.8125rem;box-sizing:border-box;color:var(--tui-base-01);background:var(--tui-error-fill)}.t-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;pointer-events:none}"]
35
+ }),
36
+ __param(0, Inject(TUI_ANIMATION_OPTIONS))
37
+ ], TuiTabBarItemComponent);
38
+ return TuiTabBarItemComponent;
39
+ }());
40
+
41
+ var TuiTabBarComponent = /** @class */ (function () {
42
+ function TuiTabBarComponent() {
43
+ this.tabs = EMPTY_QUERY;
44
+ this.activeItemIndex = NaN;
45
+ this.activeItemIndexChange = new EventEmitter();
46
+ }
47
+ TuiTabBarComponent.prototype.setActive = function (tab) {
48
+ if (tuiIsElement(tab)) {
49
+ this.updateIndex(this.tabs.toArray().findIndex(function (_a) {
50
+ var nativeElement = _a.nativeElement;
51
+ return nativeElement === tab;
52
+ }));
53
+ }
54
+ };
55
+ Object.defineProperty(TuiTabBarComponent.prototype, "style", {
56
+ get: function () {
57
+ return "--tui-tab-" + (this.activeItemIndex + 1) + ": var(--tui-active-color)";
58
+ },
59
+ enumerable: true,
60
+ configurable: true
61
+ });
62
+ TuiTabBarComponent.prototype.updateIndex = function (index) {
63
+ this.activeItemIndex = index;
64
+ this.activeItemIndexChange.emit(index);
65
+ };
66
+ __decorate([
67
+ ContentChildren(forwardRef(function () { return TuiTabBarItemComponent; }), { read: ElementRef })
68
+ ], TuiTabBarComponent.prototype, "tabs", void 0);
69
+ __decorate([
70
+ Input()
71
+ ], TuiTabBarComponent.prototype, "activeItemIndex", void 0);
72
+ __decorate([
73
+ Output()
74
+ ], TuiTabBarComponent.prototype, "activeItemIndexChange", void 0);
75
+ __decorate([
76
+ HostListener('click', ['$event.target'])
77
+ ], TuiTabBarComponent.prototype, "setActive", null);
78
+ __decorate([
79
+ HostBinding('style')
80
+ ], TuiTabBarComponent.prototype, "style", null);
81
+ TuiTabBarComponent = __decorate([
82
+ Component({
83
+ selector: 'nav[tuiTabBar]',
84
+ template: '<ng-content></ng-content>',
85
+ changeDetection: ChangeDetectionStrategy.OnPush,
86
+ styles: [":host{--tui-active-color:var(--tui-primary);position:relative;display:flex;align-items:flex-start;font:.625rem/.75rem -apple-system,BlinkMacSystemFont,system-ui,Roboto,'Segoe UI',sans-serif;height:var(--tui-height-l);color:var(--tui-text-03);-webkit-backdrop-filter:blur(.25rem);backdrop-filter:blur(.25rem)}:host:before{position:absolute;top:0;left:0;width:100%;height:100%;content:'';background:var(--tui-elevation-01);box-shadow:inset 0 1px var(--tui-base-04);opacity:.9}"]
87
+ })
88
+ ], TuiTabBarComponent);
89
+ return TuiTabBarComponent;
90
+ }());
91
+
92
+ var TuiTabBarItemDirective = /** @class */ (function () {
93
+ function TuiTabBarItemDirective(destroy$, active$, tabs, _a, changeDetectorRef) {
94
+ var nativeElement = _a.nativeElement;
95
+ active$
96
+ .pipe(filter(Boolean), tuiWatch(changeDetectorRef), takeUntil(destroy$))
97
+ .subscribe(function () {
98
+ tabs.setActive(nativeElement);
99
+ });
100
+ }
101
+ TuiTabBarItemDirective.ctorParameters = function () { return [
102
+ { type: Observable, decorators: [{ type: Self }, { type: Inject, args: [TuiDestroyService,] }] },
103
+ { type: Observable, decorators: [{ type: Inject, args: [TuiRouterLinkActiveService,] }] },
104
+ { type: TuiTabBarComponent, decorators: [{ type: Inject, args: [TuiTabBarComponent,] }] },
105
+ { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
106
+ { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] }
107
+ ]; };
108
+ TuiTabBarItemDirective = __decorate([
109
+ Directive({
110
+ selector: '[tuiTabBarItem][routerLinkActive]',
111
+ providers: [TuiRouterLinkActiveService, TuiDestroyService],
112
+ }),
113
+ __param(0, Self()), __param(0, Inject(TuiDestroyService)),
114
+ __param(1, Inject(TuiRouterLinkActiveService)),
115
+ __param(2, Inject(TuiTabBarComponent)),
116
+ __param(3, Inject(ElementRef)),
117
+ __param(4, Inject(ChangeDetectorRef))
118
+ ], TuiTabBarItemDirective);
119
+ return TuiTabBarItemDirective;
120
+ }());
121
+
122
+ var TuiTabBarModule = /** @class */ (function () {
123
+ function TuiTabBarModule() {
124
+ }
125
+ TuiTabBarModule = __decorate([
126
+ NgModule({
127
+ imports: [CommonModule, TuiSvgModule],
128
+ declarations: [TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective],
129
+ exports: [TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective],
130
+ })
131
+ ], TuiTabBarModule);
132
+ return TuiTabBarModule;
133
+ }());
134
+
135
+ /**
136
+ * Generated bundle index. Do not edit.
137
+ */
138
+
139
+ export { TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective, TuiTabBarModule };
140
+ //# sourceMappingURL=taiga-ui-addon-mobile-components-tab-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taiga-ui-addon-mobile-components-tab-bar.js","sources":["ng://@taiga-ui/addon-mobile/components/tab-bar/tab-bar-item.component.ts","ng://@taiga-ui/addon-mobile/components/tab-bar/tab-bar.component.ts","ng://@taiga-ui/addon-mobile/components/tab-bar/tab-bar-item.directive.ts","ng://@taiga-ui/addon-mobile/components/tab-bar/tab-bar.module.ts","ng://@taiga-ui/addon-mobile/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core';\nimport {TUI_ANIMATION_OPTIONS, tuiScaleIn} from '@taiga-ui/core';\n\n@Component({\n selector: 'button[tuiTabBarItem], a[tuiTabBarItem]',\n templateUrl: './tab-bar-item.template.html',\n styleUrls: ['./tab-bar-item.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiScaleIn],\n})\nexport class TuiTabBarItemComponent {\n @Input()\n icon = '';\n\n @Input()\n badge?: number | null = null;\n\n readonly animation = {value: '', ...this.animationOptions} as const;\n\n constructor(\n @Inject(TUI_ANIMATION_OPTIONS)\n private readonly animationOptions: AnimationOptions,\n ) {}\n\n format(value: number): string {\n return value > 999 ? '999+' : String(value);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n HostListener,\n Input,\n Output,\n QueryList,\n} from '@angular/core';\nimport {EMPTY_QUERY, tuiIsElement} from '@taiga-ui/cdk';\n\nimport {TuiTabBarItemComponent} from './tab-bar-item.component';\n\n@Component({\n selector: 'nav[tuiTabBar]',\n template: '<ng-content></ng-content>',\n styleUrls: ['./tab-bar.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiTabBarComponent {\n @ContentChildren(forwardRef(() => TuiTabBarItemComponent), {read: ElementRef})\n private readonly tabs: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n @Input()\n activeItemIndex = NaN;\n\n @Output()\n readonly activeItemIndexChange = new EventEmitter<number>();\n\n @HostListener('click', ['$event.target'])\n setActive(tab: EventTarget): void {\n if (tuiIsElement(tab)) {\n this.updateIndex(\n this.tabs.toArray().findIndex(({nativeElement}) => nativeElement === tab),\n );\n }\n }\n\n @HostBinding('style')\n get style(): string {\n return `--tui-tab-${this.activeItemIndex + 1}: var(--tui-active-color)`;\n }\n\n private updateIndex(index: number): void {\n this.activeItemIndex = index;\n this.activeItemIndexChange.emit(index);\n }\n}\n","import {ChangeDetectorRef, Directive, ElementRef, Inject, Self} from '@angular/core';\nimport {TuiDestroyService, tuiWatch} from '@taiga-ui/cdk';\nimport {TuiRouterLinkActiveService} from '@taiga-ui/core';\nimport {Observable} from 'rxjs';\nimport {filter, takeUntil} from 'rxjs/operators';\n\nimport {TuiTabBarComponent} from './tab-bar.component';\n\n@Directive({\n selector: '[tuiTabBarItem][routerLinkActive]',\n providers: [TuiRouterLinkActiveService, TuiDestroyService],\n})\nexport class TuiTabBarItemDirective {\n constructor(\n @Self() @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n @Inject(TuiRouterLinkActiveService) active$: Observable<boolean>,\n @Inject(TuiTabBarComponent) tabs: TuiTabBarComponent,\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n ) {\n active$\n .pipe(filter(Boolean), tuiWatch(changeDetectorRef), takeUntil(destroy$))\n .subscribe(() => {\n tabs.setActive(nativeElement);\n });\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core';\n\nimport {TuiTabBarComponent} from './tab-bar.component';\nimport {TuiTabBarItemComponent} from './tab-bar-item.component';\nimport {TuiTabBarItemDirective} from './tab-bar-item.directive';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule],\n declarations: [TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective],\n exports: [TuiTabBarComponent, TuiTabBarItemComponent, TuiTabBarItemDirective],\n})\nexport class TuiTabBarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAoBI,gCAEqB,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;QATvD,SAAI,GAAG,EAAE,CAAC;QAGV,UAAK,GAAmB,IAAI,CAAC;QAEpB,cAAS,GAAG,WAAC,KAAK,EAAE,EAAE,IAAK,IAAI,CAAC,gBAAgB,CAAU,CAAC;KAKhE;IAEJ,uCAAM,GAAN,UAAO,KAAa;QAChB,OAAO,KAAK,GAAG,GAAG,GAAG,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;KAC/C;;gDANI,MAAM,SAAC,qBAAqB;;IARjC;QADC,KAAK,EAAE;wDACE;IAGV;QADC,KAAK,EAAE;yDACqB;IALpB,sBAAsB;QAPlC,SAAS,CAAC;YACP,QAAQ,EAAE,yCAAyC;YACnD,iVAA2C;YAE3C,eAAe,EAAE,uBAAuB,CAAC,MAAM;YAC/C,UAAU,EAAE,CAAC,UAAU,CAAC;;SAC3B,CAAC;QAWO,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;OAVzB,sBAAsB,CAiBlC;IAAD,6BAAC;CAjBD;;;ICYA;QAEqB,SAAI,GAAuC,WAAW,CAAC;QAGxE,oBAAe,GAAG,GAAG,CAAC;QAGb,0BA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AAC,CAAC;aACvE,SAAS,CAAC;YACP,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;SACjC,CAAC,CAAC;KACV;;gBAXgD,UAAU,uBAAtD,IAAI,YAAI,MAAM,SAAC,iBAAiB;gBACY,UAAU,uBAAtD,MAAM,SAAC,0BAA0B;gBACA,kBAAkB,uBAAnD,MAAM,SAAC,kBAAkB;gBACW,UAAU,uBAA9C,MAAM,SAAC,UAAU;gBAC4B,iBAAiB,uBAA9D,MAAM,SAAC,iBAAiB;;IANpB,sBAAsB;QAJlC,SAAS,CAAC;YACP,QAAQ,EAAE,mCAAmC;YAC7C,SAAS,EAAE,CAAC,0BAA0B,EAAE,iBAAiB,CAAC;SAC7D,CAAC;QAGO,WAAA,IAAI,EAAE,CAAA,EAAE,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACjC,WAAA,MAAM,CAAC,0BAA0B,CAAC,CAAA;QAClC,WAAA,MAAM,CAAC,kBAAkB,CAAC,CAAA;QAC1B,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;QAClB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;OANrB,sBAAsB,CAclC;IAAD,6BAAC;CAdD;;;ICCA;KAA+B;IAAlB,eAAe;QAL3B,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;YACrC,YAAY,EAAE,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;YAClF,OAAO,EAAE,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;SAChF,CAAC;OACW,eAAe,CAAG;IAAD,sBAAC;CAA/B;;ACbA;;;;;;"}
@@ -3,6 +3,7 @@ export * from '@taiga-ui/addon-mobile/components/mobile-calendar-dialog';
3
3
  export * from '@taiga-ui/addon-mobile/components/mobile-dialog';
4
4
  export * from '@taiga-ui/addon-mobile/components/pull-to-refresh';
5
5
  export * from '@taiga-ui/addon-mobile/components/sheet';
6
+ export * from '@taiga-ui/addon-mobile/components/tab-bar';
6
7
  export * from '@taiga-ui/addon-mobile/components/theme-android';
7
8
  export * from '@taiga-ui/addon-mobile/components/theme-ios';
8
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-mobile-components.js","sources":["ng://@taiga-ui/addon-mobile/components/taiga-ui-addon-mobile-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;;"}
1
+ {"version":3,"file":"taiga-ui-addon-mobile-components.js","sources":["ng://@taiga-ui/addon-mobile/components/taiga-ui-addon-mobile-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/addon-mobile",
3
- "version": "2.83.0",
3
+ "version": "2.84.0",
4
4
  "description": "Extension package for Taiga UI that adds support for mobile specific behaviors such as custom data pickers, dropdowns, etc.",
5
5
  "keywords": [
6
6
  "angular",
@@ -15,9 +15,9 @@
15
15
  "@angular/common": ">=9.0.0",
16
16
  "@angular/core": ">=9.0.0",
17
17
  "@ng-web-apis/common": ">=1.12.1 < 2",
18
- "@taiga-ui/cdk": ">=2.83.0",
19
- "@taiga-ui/core": ">=2.83.0",
20
- "@taiga-ui/kit": ">=2.83.0",
18
+ "@taiga-ui/cdk": ">=2.84.0",
19
+ "@taiga-ui/core": ">=2.84.0",
20
+ "@taiga-ui/kit": ">=2.84.0",
21
21
  "@tinkoff/ng-polymorpheus": ">=3.1.12 < 4",
22
22
  "rxjs": ">=6.0.0"
23
23
  },