@taiga-ui/addon-mobile 4.43.0 → 4.44.0-canary.ef702cb
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.providers.d.ts +2 -1
- package/components/mobile-dialog/mobile-dialog.options.d.ts +2 -1
- package/components/pull-to-refresh/pull-to-refresh.providers.d.ts +4 -3
- package/components/sheet-dialog/sheet-dialog.options.d.ts +2 -1
- package/directives/dropdown-mobile/dropdown-mobile.component.d.ts +1 -1
- package/directives/dropdown-mobile/index.d.ts +0 -1
- package/esm2022/components/mobile-calendar/mobile-calendar.component.mjs +3 -3
- package/esm2022/components/mobile-calendar/mobile-calendar.providers.mjs +3 -4
- package/esm2022/components/mobile-dialog/mobile-dialog.component.mjs +3 -3
- package/esm2022/components/mobile-dialog/mobile-dialog.options.mjs +6 -3
- package/esm2022/components/pull-to-refresh/loader-android/loader-android.component.mjs +3 -3
- package/esm2022/components/pull-to-refresh/loader-ios/loader-ios.component.mjs +3 -3
- package/esm2022/components/pull-to-refresh/pull-to-refresh.providers.mjs +11 -6
- package/esm2022/components/sheet-dialog/sheet-dialog.options.mjs +6 -3
- package/esm2022/components/tab-bar/tab-bar.component.mjs +3 -3
- package/esm2022/directives/dropdown-mobile/dropdown-mobile.component.mjs +4 -6
- package/esm2022/directives/dropdown-mobile/dropdown-mobile.directive.mjs +1 -20
- package/esm2022/directives/dropdown-mobile/index.mjs +1 -2
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs +5 -5
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-dialog.mjs +7 -5
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs +15 -9
- package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs +5 -3
- package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs +2 -2
- package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs +8 -63
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs.map +1 -1
- package/package.json +11 -11
- package/styles/android/checkbox.less +2 -5
- package/styles/common/block-status.less +6 -6
- package/styles/ios/checkbox.less +2 -5
- package/directives/dropdown-mobile/option-mobile/option-mobile.component.d.ts +0 -13
- package/esm2022/directives/dropdown-mobile/option-mobile/option-mobile.component.mjs +0 -42
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { NgForOf, NgIf } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { ElementRef, Component, ChangeDetectionStrategy, ViewChildren, inject, Injectable, Directive } from '@angular/core';
|
|
3
|
+
import { ElementRef, Component, ChangeDetectionStrategy, ViewChildren, InjectionToken, inject, Injectable, Directive } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
|
|
6
6
|
import * as i1 from '@taiga-ui/cdk/directives/animated';
|
|
7
7
|
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
|
|
8
8
|
import { tuiCloseWatcher, tuiZonefull } from '@taiga-ui/cdk/observables';
|
|
9
9
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
10
|
-
import { tuiProvide,
|
|
10
|
+
import { tuiProvide, tuiProvideOptions } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
11
11
|
import { TUI_SCROLL_REF } from '@taiga-ui/core/tokens';
|
|
12
12
|
import { injectContext, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
13
13
|
import { Subject, merge, exhaustMap, isObservable, take, of, filter, startWith, pairwise } from 'rxjs';
|
|
@@ -84,7 +84,9 @@ const TUI_SHEET_DIALOG_DEFAULT_OPTIONS = {
|
|
|
84
84
|
/**
|
|
85
85
|
* Default parameters for mobile dialog component
|
|
86
86
|
*/
|
|
87
|
-
const TUI_SHEET_DIALOG_OPTIONS =
|
|
87
|
+
const TUI_SHEET_DIALOG_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_SHEET_DIALOG_OPTIONS' : '', {
|
|
88
|
+
factory: () => TUI_SHEET_DIALOG_DEFAULT_OPTIONS,
|
|
89
|
+
});
|
|
88
90
|
function tuiSheetDialogOptionsProvider(options) {
|
|
89
91
|
return tuiProvideOptions(TUI_SHEET_DIALOG_OPTIONS, options, TUI_SHEET_DIALOG_DEFAULT_OPTIONS);
|
|
90
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-components-sheet-dialog.mjs","sources":["../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.component.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.template.html","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.options.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.service.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.directive.ts","../../../projects/addon-mobile/components/sheet-dialog/taiga-ui-addon-mobile-components-sheet-dialog.ts"],"sourcesContent":["import {NgForOf, NgIf} from '@angular/common';\nimport type {AfterViewInit, QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {tuiCloseWatcher, tuiZonefull} from '@taiga-ui/cdk/observables';\nimport type {TuiPopover} from '@taiga-ui/cdk/services';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_SCROLL_REF} from '@taiga-ui/core/tokens';\nimport {injectContext, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {exhaustMap, filter, isObservable, merge, of, Subject, take} from 'rxjs';\n\nimport type {TuiSheetDialogOptions} from './sheet-dialog.options';\n\n@Component({\n standalone: true,\n selector: 'tui-sheet-dialog',\n imports: [NgForOf, NgIf, PolymorpheusOutlet],\n templateUrl: './sheet-dialog.template.html',\n styleUrls: ['./sheet-dialog.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)],\n hostDirectives: [TuiAnimated],\n host: {\n '[style.--tui-offset.px]': 'context.offset',\n '[class._closeable]': 'context.closeable',\n '[class._fullscreen]': 'context.fullscreen === true',\n '(document:touchstart.passive.zoneless)': 'onPointerChange(1)',\n '(document:touchend.zoneless)': 'onPointerChange(-1)',\n '(document:touchcancel.zoneless)': 'onPointerChange(-1)',\n '(scroll.zoneless)': 'onPointerChange(0)',\n '(click.self)': 'close$.next()',\n },\n})\nexport class TuiSheetDialogComponent<I> implements AfterViewInit {\n @ViewChildren('stops')\n private readonly stops: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n private readonly el = tuiInjectElement();\n private pointers = 0;\n\n protected readonly context =\n injectContext<TuiPopover<TuiSheetDialogOptions<I>, any>>();\n\n protected readonly close$ = new Subject<void>();\n protected readonly $ = merge(this.close$, tuiCloseWatcher())\n .pipe(\n tuiZonefull(),\n exhaustMap(() => {\n if (isObservable(this.context.closeable)) {\n if (this.el.scrollTop <= 0) {\n this.el.scrollTo({top: this.initial, behavior: 'smooth'});\n }\n\n return this.context.closeable.pipe(take(1));\n }\n\n return of(this.context.closeable);\n }),\n filter(Boolean),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.context.$implicit.complete());\n\n public ngAfterViewInit(): void {\n this.el.scrollTop = this.initial;\n }\n\n protected onPointerChange(delta: number): void {\n this.pointers = Math.max(this.pointers + delta, 0);\n\n if (!this.pointers && this.el.scrollTop <= 0) {\n this.close$.next();\n }\n }\n\n private get initial(): number {\n if (!this.context.closeable) {\n return 0;\n }\n\n return (\n this.stops\n .map((e) => e.nativeElement.offsetTop - this.context.offset)\n .concat(this.el.clientHeight ?? Infinity)[this.context.initial] ?? 0\n );\n }\n}\n","<div class=\"t-stops\">\n <div\n *ngFor=\"let stop of context.stops\"\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n</div>\n<div class=\"t-sheet\">\n <div\n *ngIf=\"context.bar\"\n class=\"t-top\"\n ></div>\n <h2\n *ngIf=\"context.label\"\n class=\"t-heading\"\n [id]=\"context.id\"\n >\n <ng-container *polymorpheusOutlet=\"context.label as label; context: context\">\n {{ label }}\n </ng-container>\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"context.content as text; context: context\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n","import type {Provider} from '@angular/core';\nimport type {TuiPopover} from '@taiga-ui/cdk/services';\nimport {tuiCreateToken, tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport type {Observable} from 'rxjs';\n\nexport interface TuiSheetDialogOptions<I = undefined> {\n readonly closeable: Observable<boolean> | boolean;\n readonly data: I;\n readonly initial: number;\n readonly label: PolymorpheusContent<TuiPopover<TuiSheetDialogOptions<I>, any>>;\n readonly offset: number;\n readonly stops: readonly string[];\n readonly bar: boolean;\n readonly fullscreen: boolean;\n}\n\nexport const TUI_SHEET_DIALOG_DEFAULT_OPTIONS: TuiSheetDialogOptions = {\n label: '',\n stops: [],\n initial: 0,\n offset: 16,\n closeable: true,\n data: undefined,\n bar: true,\n fullscreen: false,\n};\n\n/**\n * Default parameters for mobile dialog component\n */\nexport const TUI_SHEET_DIALOG_OPTIONS = tuiCreateToken(TUI_SHEET_DIALOG_DEFAULT_OPTIONS);\n\nexport function tuiSheetDialogOptionsProvider(\n options: Partial<TuiSheetDialogOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_SHEET_DIALOG_OPTIONS,\n options,\n TUI_SHEET_DIALOG_DEFAULT_OPTIONS,\n );\n}\n","import {inject, Injectable} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiPopoverService, TuiThemeColorService} from '@taiga-ui/cdk/services';\nimport {TUI_DIALOGS} from '@taiga-ui/core/components/dialog';\nimport {pairwise, startWith} from 'rxjs';\n\nimport {TuiSheetDialogComponent} from './sheet-dialog.component';\nimport type {TuiSheetDialogOptions} from './sheet-dialog.options';\nimport {TUI_SHEET_DIALOG_OPTIONS} from './sheet-dialog.options';\n\nconst THEME = '#404040';\n\n@Injectable({\n providedIn: 'root',\n useFactory: () =>\n new TuiSheetDialogService(\n TUI_DIALOGS,\n TuiSheetDialogComponent,\n inject(TUI_SHEET_DIALOG_OPTIONS),\n ),\n})\nexport class TuiSheetDialogService extends TuiPopoverService<TuiSheetDialogOptions<any>> {\n private readonly theme = inject(TuiThemeColorService);\n private initial = this.theme.color;\n\n protected readonly $ = this.items$\n .pipe(startWith([]), pairwise(), takeUntilDestroyed())\n .subscribe(([prev, next]) => {\n if (!prev.length && next.length) {\n this.initial = this.theme.color;\n this.theme.color = THEME;\n }\n\n if (!next.length && prev.length) {\n this.theme.color = this.initial;\n }\n });\n}\n","import {Directive} from '@angular/core';\nimport {TuiPopoverDirective} from '@taiga-ui/cdk/directives/popover';\nimport {tuiAsPopover} from '@taiga-ui/cdk/services';\n\nimport type {TuiSheetDialogOptions} from './sheet-dialog.options';\nimport {TuiSheetDialogService} from './sheet-dialog.service';\n\n@Directive({\n standalone: true,\n selector: 'ng-template[tuiSheetDialog]',\n inputs: ['options: tuiSheetDialogOptions', 'open: tuiSheetDialog'],\n outputs: ['openChange: tuiSheetDialogChange'],\n providers: [tuiAsPopover(TuiSheetDialogService)],\n})\nexport class TuiSheetDialog extends TuiPopoverDirective<TuiSheetDialogOptions> {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqBA,MAoBa,uBAAuB,CAAA;AApBpC,IAAA,WAAA,GAAA;QAsBqB,IAAK,CAAA,KAAA,GAAuC,WAAW,CAAC;QAExD,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE,CAAC;QACjC,IAAQ,CAAA,QAAA,GAAG,CAAC,CAAC;QAEF,IAAO,CAAA,OAAA,GACtB,aAAa,EAA6C,CAAC;AAE5C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,OAAO,EAAQ,CAAC;QAC7B,IAAC,CAAA,CAAA,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC;AACvD,aAAA,IAAI,CACD,WAAW,EAAE,EACb,UAAU,CAAC,MAAK;YACZ,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AACtC,gBAAA,IAAI,IAAI,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC,EAAE;AACxB,oBAAA,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC,CAAC;AAC7D,iBAAA;AAED,gBAAA,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,aAAA;YAED,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SACrC,CAAC,EACF,MAAM,CAAC,OAAO,CAAC,EACf,kBAAkB,EAAE,CACvB;AACA,aAAA,SAAS,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;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A;;4FAEvC,cAAc,EAAA,UAAA,EAAA,CAAA;kBAP1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,6BAA6B;AACvC,oBAAA,MAAM,EAAE,CAAC,gCAAgC,EAAE,sBAAsB,CAAC;oBAClE,OAAO,EAAE,CAAC,kCAAkC,CAAC;AAC7C,oBAAA,SAAS,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;AACnD,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-components-sheet-dialog.mjs","sources":["../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.component.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.template.html","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.options.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.service.ts","../../../projects/addon-mobile/components/sheet-dialog/sheet-dialog.directive.ts","../../../projects/addon-mobile/components/sheet-dialog/taiga-ui-addon-mobile-components-sheet-dialog.ts"],"sourcesContent":["import {NgForOf, NgIf} from '@angular/common';\nimport type {AfterViewInit, QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {tuiCloseWatcher, tuiZonefull} from '@taiga-ui/cdk/observables';\nimport type {TuiPopover} from '@taiga-ui/cdk/services';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_SCROLL_REF} from '@taiga-ui/core/tokens';\nimport {injectContext, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {exhaustMap, filter, isObservable, merge, of, Subject, take} from 'rxjs';\n\nimport type {TuiSheetDialogOptions} from './sheet-dialog.options';\n\n@Component({\n standalone: true,\n selector: 'tui-sheet-dialog',\n imports: [NgForOf, NgIf, PolymorpheusOutlet],\n templateUrl: './sheet-dialog.template.html',\n styleUrls: ['./sheet-dialog.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiProvide(TUI_SCROLL_REF, ElementRef)],\n hostDirectives: [TuiAnimated],\n host: {\n '[style.--tui-offset.px]': 'context.offset',\n '[class._closeable]': 'context.closeable',\n '[class._fullscreen]': 'context.fullscreen === true',\n '(document:touchstart.passive.zoneless)': 'onPointerChange(1)',\n '(document:touchend.zoneless)': 'onPointerChange(-1)',\n '(document:touchcancel.zoneless)': 'onPointerChange(-1)',\n '(scroll.zoneless)': 'onPointerChange(0)',\n '(click.self)': 'close$.next()',\n },\n})\nexport class TuiSheetDialogComponent<I> implements AfterViewInit {\n @ViewChildren('stops')\n private readonly stops: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n private readonly el = tuiInjectElement();\n private pointers = 0;\n\n protected readonly context =\n injectContext<TuiPopover<TuiSheetDialogOptions<I>, any>>();\n\n protected readonly close$ = new Subject<void>();\n protected readonly $ = merge(this.close$, tuiCloseWatcher())\n .pipe(\n tuiZonefull(),\n exhaustMap(() => {\n if (isObservable(this.context.closeable)) {\n if (this.el.scrollTop <= 0) {\n this.el.scrollTo({top: this.initial, behavior: 'smooth'});\n }\n\n return this.context.closeable.pipe(take(1));\n }\n\n return of(this.context.closeable);\n }),\n filter(Boolean),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.context.$implicit.complete());\n\n public ngAfterViewInit(): void {\n this.el.scrollTop = this.initial;\n }\n\n protected onPointerChange(delta: number): void {\n this.pointers = Math.max(this.pointers + delta, 0);\n\n if (!this.pointers && this.el.scrollTop <= 0) {\n this.close$.next();\n }\n }\n\n private get initial(): number {\n if (!this.context.closeable) {\n return 0;\n }\n\n return (\n this.stops\n .map((e) => e.nativeElement.offsetTop - this.context.offset)\n .concat(this.el.clientHeight ?? Infinity)[this.context.initial] ?? 0\n );\n }\n}\n","<div class=\"t-stops\">\n <div\n *ngFor=\"let stop of context.stops\"\n #stops\n class=\"t-stop\"\n [style.margin-top]=\"stop\"\n ></div>\n</div>\n<div class=\"t-sheet\">\n <div\n *ngIf=\"context.bar\"\n class=\"t-top\"\n ></div>\n <h2\n *ngIf=\"context.label\"\n class=\"t-heading\"\n [id]=\"context.id\"\n >\n <ng-container *polymorpheusOutlet=\"context.label as label; context: context\">\n {{ label }}\n </ng-container>\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"context.content as text; context: context\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n","import type {Provider} from '@angular/core';\nimport {InjectionToken} from '@angular/core';\nimport type {TuiPopover} from '@taiga-ui/cdk/services';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport type {Observable} from 'rxjs';\n\nexport interface TuiSheetDialogOptions<I = undefined> {\n readonly closeable: Observable<boolean> | boolean;\n readonly data: I;\n readonly initial: number;\n readonly label: PolymorpheusContent<TuiPopover<TuiSheetDialogOptions<I>, any>>;\n readonly offset: number;\n readonly stops: readonly string[];\n readonly bar: boolean;\n readonly fullscreen: boolean;\n}\n\nexport const TUI_SHEET_DIALOG_DEFAULT_OPTIONS: TuiSheetDialogOptions = {\n label: '',\n stops: [],\n initial: 0,\n offset: 16,\n closeable: true,\n data: undefined,\n bar: true,\n fullscreen: false,\n};\n\n/**\n * Default parameters for mobile dialog component\n */\nexport const TUI_SHEET_DIALOG_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_SHEET_DIALOG_OPTIONS' : '',\n {\n factory: () => TUI_SHEET_DIALOG_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiSheetDialogOptionsProvider(\n options: Partial<TuiSheetDialogOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_SHEET_DIALOG_OPTIONS,\n options,\n TUI_SHEET_DIALOG_DEFAULT_OPTIONS,\n );\n}\n","import {inject, Injectable} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiPopoverService, TuiThemeColorService} from '@taiga-ui/cdk/services';\nimport {TUI_DIALOGS} from '@taiga-ui/core/components/dialog';\nimport {pairwise, startWith} from 'rxjs';\n\nimport {TuiSheetDialogComponent} from './sheet-dialog.component';\nimport type {TuiSheetDialogOptions} from './sheet-dialog.options';\nimport {TUI_SHEET_DIALOG_OPTIONS} from './sheet-dialog.options';\n\nconst THEME = '#404040';\n\n@Injectable({\n providedIn: 'root',\n useFactory: () =>\n new TuiSheetDialogService(\n TUI_DIALOGS,\n TuiSheetDialogComponent,\n inject(TUI_SHEET_DIALOG_OPTIONS),\n ),\n})\nexport class TuiSheetDialogService extends TuiPopoverService<TuiSheetDialogOptions<any>> {\n private readonly theme = inject(TuiThemeColorService);\n private initial = this.theme.color;\n\n protected readonly $ = this.items$\n .pipe(startWith([]), pairwise(), takeUntilDestroyed())\n .subscribe(([prev, next]) => {\n if (!prev.length && next.length) {\n this.initial = this.theme.color;\n this.theme.color = THEME;\n }\n\n if (!next.length && prev.length) {\n this.theme.color = this.initial;\n }\n });\n}\n","import {Directive} from '@angular/core';\nimport {TuiPopoverDirective} from '@taiga-ui/cdk/directives/popover';\nimport {tuiAsPopover} from '@taiga-ui/cdk/services';\n\nimport type {TuiSheetDialogOptions} from './sheet-dialog.options';\nimport {TuiSheetDialogService} from './sheet-dialog.service';\n\n@Directive({\n standalone: true,\n selector: 'ng-template[tuiSheetDialog]',\n inputs: ['options: tuiSheetDialogOptions', 'open: tuiSheetDialog'],\n outputs: ['openChange: tuiSheetDialogChange'],\n providers: [tuiAsPopover(TuiSheetDialogService)],\n})\nexport class TuiSheetDialog extends TuiPopoverDirective<TuiSheetDialogOptions> {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n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BAP1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,6BAA6B;AACvC,oBAAA,MAAM,EAAE,CAAC,gCAAgC,EAAE,sBAAsB,CAAC;oBAClE,OAAO,EAAE,CAAC,kCAAkC,CAAC;AAC7C,oBAAA,SAAS,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;AACnD,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -51,14 +51,14 @@ class TuiTabBarComponent {
|
|
|
51
51
|
this.activeItemIndexChange.emit(index);
|
|
52
52
|
}
|
|
53
53
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTabBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
54
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTabBarComponent, isStandalone: true, selector: "nav[tuiTabBar]", inputs: { quantity: "quantity", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { listeners: { "click": "setActive($event.target)" }, properties: { "style": "style" } }, queries: [{ propertyName: "tabs", predicate: i0.forwardRef(function () { return TuiTabBarItem; }), read: ElementRef }], ngImport: i0, template: "<ng-content />\n<div class=\"t-skeletons\">\n <div\n *tuiRepeatTimes=\"let index of quantity\"\n class=\"t-skeleton\"\n ></div>\n</div>\n", styles: [":host{--tui-active-color: var(--tui-text-action);position:relative;display:flex;font: .625rem/.75rem -apple-system,BlinkMacSystemFont,system-ui,Roboto,Segoe UI,sans-serif;block-size:var(--tui-height-l);color:var(--tui-text-secondary);-webkit-backdrop-filter:blur(.3125rem);backdrop-filter:blur(.3125rem)}:host:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";background:var(--tui-background-base-alt);box-shadow:inset 0 1px var(--tui-border-normal);opacity:.8}[tuiTheme=dark] :host:before{opacity:.7}.t-skeletons{display:none;block-size:100%;inline-size:100%;justify-content:space-around}.t-skeletons:first-child{display:flex}.t-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center;animation:tuiSkeletonVibe ease-in-out 1s infinite alternate}.t-skeleton:before{content:\"\";inline-size:1.375rem;block-size:1.375rem;margin-
|
|
54
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiTabBarComponent, isStandalone: true, selector: "nav[tuiTabBar]", inputs: { quantity: "quantity", activeItemIndex: "activeItemIndex" }, outputs: { activeItemIndexChange: "activeItemIndexChange" }, host: { listeners: { "click": "setActive($event.target)" }, properties: { "style": "style" } }, queries: [{ propertyName: "tabs", predicate: i0.forwardRef(function () { return TuiTabBarItem; }), read: ElementRef }], ngImport: i0, template: "<ng-content />\n<div class=\"t-skeletons\">\n <div\n *tuiRepeatTimes=\"let index of quantity\"\n class=\"t-skeleton\"\n ></div>\n</div>\n", styles: [":host{--tui-active-color: var(--tui-text-action);position:relative;display:flex;font: .625rem/.75rem -apple-system,BlinkMacSystemFont,system-ui,Roboto,Segoe UI,sans-serif;block-size:var(--tui-height-l);color:var(--tui-text-secondary);-webkit-backdrop-filter:blur(.3125rem);backdrop-filter:blur(.3125rem)}:host:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";background:var(--tui-background-base-alt);box-shadow:inset 0 1px var(--tui-border-normal);opacity:.8}[tuiTheme=dark] :host:before{opacity:.7}.t-skeletons{display:none;block-size:100%;inline-size:100%;justify-content:space-around}.t-skeletons:first-child{display:flex}.t-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center;animation:tuiSkeletonVibe ease-in-out 1s infinite alternate}.t-skeleton:before{content:\"\";inline-size:1.375rem;block-size:1.375rem;margin-block-end:.5rem;border-radius:100%;background:var(--tui-background-neutral-2)}.t-skeleton:after{content:\"\";inline-size:2.5rem;block-size:.375rem;border-radius:1rem;background:var(--tui-background-neutral-2)}\n"], dependencies: [{ kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
55
55
|
}
|
|
56
56
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiTabBarComponent, decorators: [{
|
|
57
57
|
type: Component,
|
|
58
58
|
args: [{ standalone: true, selector: 'nav[tuiTabBar]', imports: [TuiRepeatTimes], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
59
59
|
'[style]': 'style',
|
|
60
60
|
'(click)': 'setActive($event.target)',
|
|
61
|
-
}, template: "<ng-content />\n<div class=\"t-skeletons\">\n <div\n *tuiRepeatTimes=\"let index of quantity\"\n class=\"t-skeleton\"\n ></div>\n</div>\n", styles: [":host{--tui-active-color: var(--tui-text-action);position:relative;display:flex;font: .625rem/.75rem -apple-system,BlinkMacSystemFont,system-ui,Roboto,Segoe UI,sans-serif;block-size:var(--tui-height-l);color:var(--tui-text-secondary);-webkit-backdrop-filter:blur(.3125rem);backdrop-filter:blur(.3125rem)}:host:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";background:var(--tui-background-base-alt);box-shadow:inset 0 1px var(--tui-border-normal);opacity:.8}[tuiTheme=dark] :host:before{opacity:.7}.t-skeletons{display:none;block-size:100%;inline-size:100%;justify-content:space-around}.t-skeletons:first-child{display:flex}.t-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center;animation:tuiSkeletonVibe ease-in-out 1s infinite alternate}.t-skeleton:before{content:\"\";inline-size:1.375rem;block-size:1.375rem;margin-
|
|
61
|
+
}, template: "<ng-content />\n<div class=\"t-skeletons\">\n <div\n *tuiRepeatTimes=\"let index of quantity\"\n class=\"t-skeleton\"\n ></div>\n</div>\n", styles: [":host{--tui-active-color: var(--tui-text-action);position:relative;display:flex;font: .625rem/.75rem -apple-system,BlinkMacSystemFont,system-ui,Roboto,Segoe UI,sans-serif;block-size:var(--tui-height-l);color:var(--tui-text-secondary);-webkit-backdrop-filter:blur(.3125rem);backdrop-filter:blur(.3125rem)}:host:before{position:absolute;top:0;left:0;inline-size:100%;block-size:100%;content:\"\";background:var(--tui-background-base-alt);box-shadow:inset 0 1px var(--tui-border-normal);opacity:.8}[tuiTheme=dark] :host:before{opacity:.7}.t-skeletons{display:none;block-size:100%;inline-size:100%;justify-content:space-around}.t-skeletons:first-child{display:flex}.t-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center;animation:tuiSkeletonVibe ease-in-out 1s infinite alternate}.t-skeleton:before{content:\"\";inline-size:1.375rem;block-size:1.375rem;margin-block-end:.5rem;border-radius:100%;background:var(--tui-background-neutral-2)}.t-skeleton:after{content:\"\";inline-size:2.5rem;block-size:.375rem;border-radius:1rem;background:var(--tui-background-neutral-2)}\n"] }]
|
|
62
62
|
}], propDecorators: { tabs: [{
|
|
63
63
|
type: ContentChildren,
|
|
64
64
|
args: [forwardRef(() => TuiTabBarItem), { read: ElementRef }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-components-tab-bar.mjs","sources":["../../../projects/addon-mobile/components/tab-bar/tab-bar-item.component.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar-item.template.html","../../../projects/addon-mobile/components/tab-bar/tab-bar.component.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar.template.html","../../../projects/addon-mobile/components/tab-bar/tab-bar-item.directive.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar.ts","../../../projects/addon-mobile/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.ts"],"sourcesContent":["import {NgIf} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\n\n@Component({\n standalone: true,\n selector: 'button[tuiTabBarItem], a[tuiTabBarItem]',\n imports: [NgIf, TuiAnimated, TuiIcon],\n templateUrl: './tab-bar-item.template.html',\n styleUrls: ['./tab-bar-item.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiTabBarItem {\n @Input()\n public icon = '';\n\n @Input()\n public badge?: number | null = null;\n\n protected format(value: number): string {\n return value > 999 ? '999+' : String(value);\n }\n}\n","<tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n/>\n<span class=\"t-wrapper\">\n <span\n *ngIf=\"badge as value\"\n tuiAnimated\n class=\"t-badge\"\n >\n {{ format(value) }}\n </span>\n</span>\n<span class=\"t-text\">\n <ng-content />\n</span>\n","import type {QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n} from '@angular/core';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiIsElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {TuiTabBarItem} from './tab-bar-item.component';\n\n@Component({\n standalone: true,\n selector: 'nav[tuiTabBar]',\n imports: [TuiRepeatTimes],\n templateUrl: './tab-bar.template.html',\n styleUrls: ['./tab-bar.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style]': 'style',\n '(click)': 'setActive($event.target)',\n },\n})\nexport class TuiTabBarComponent {\n @ContentChildren(forwardRef(() => TuiTabBarItem), {read: ElementRef})\n private readonly tabs: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n @Input()\n public quantity = 4;\n\n @Input()\n public activeItemIndex = NaN;\n\n @Output()\n public readonly activeItemIndexChange = new EventEmitter<number>();\n\n public setActive(tab: EventTarget): void {\n if (tuiIsElement(tab)) {\n this.updateIndex(\n this.tabs.toArray().findIndex(({nativeElement}) => nativeElement === tab),\n );\n }\n }\n\n protected 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","<ng-content />\n<div class=\"t-skeletons\">\n <div\n *tuiRepeatTimes=\"let index of quantity\"\n class=\"t-skeleton\"\n ></div>\n</div>\n","import {Directive, inject} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {RouterLinkActive} from '@angular/router';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport type {Observable} from 'rxjs';\nimport {EMPTY, filter} from 'rxjs';\n\nimport {TuiTabBarComponent} from './tab-bar.component';\n\n@Directive({\n standalone: true,\n selector: '[tuiTabBarItem][routerLinkActive]',\n})\nexport class TuiTabBarItemDirective {\n constructor() {\n const tabs = inject(TuiTabBarComponent);\n const el = tuiInjectElement();\n const link: Observable<boolean> =\n inject(RouterLinkActive, {optional: true})?.isActiveChange || EMPTY;\n\n link.pipe(filter(Boolean), tuiWatch(), takeUntilDestroyed()).subscribe(() =>\n tabs.setActive(el),\n );\n }\n}\n","import {TuiTabBarComponent} from './tab-bar.component';\nimport {TuiTabBarItem} from './tab-bar-item.component';\nimport {TuiTabBarItemDirective} from './tab-bar-item.directive';\n\nexport const TuiTabBar = [\n TuiTabBarComponent,\n TuiTabBarItem,\n TuiTabBarItemDirective,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAKA,MAQa,aAAa,CAAA;AAR1B,IAAA,WAAA,GAAA;QAUW,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;QAGV,IAAK,CAAA,KAAA,GAAmB,IAAI,CAAC;AAKvC,KAAA;AAHa,IAAA,MAAM,CAAC,KAAa,EAAA;AAC1B,QAAA,OAAO,KAAK,GAAG,GAAG,GAAG,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;KAC/C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,CAAA,eAAA,GAAG,GAAG,CAAC;AAGb,QAAA,IAAA,CAAA,qBAAqB,GAAG,IAAI,YAAY,EAAU,CAAC;AAkBtE,KAAA;AAhBU,IAAA,SAAS,CAAC,GAAgB,EAAA;AAC7B,QAAA,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;YACnB,IAAI,CAAC,WAAW,CACZ,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,EAAC,aAAa,EAAC,KAAK,aAAa,KAAK,GAAG,CAAC,CAC5E,CAAC;AACL,SAAA;KACJ;AAED,IAAA,IAAc,KAAK,GAAA;AACf,QAAA,OAAO,aAAa,IAAI,CAAC,eAAe,GAAG,CAAC,2BAA2B,CAAC;KAC3E;AAEO,IAAA,WAAW,CAAC,KAAa,EAAA;AAC7B,QAAA,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;AAC7B,QAAA,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC1C;+GA5BQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,kBAAkB,qWACO,aAAa,CAAA,EAAA,CAAA,EAAA,IAAA,EAAU,UAAU,EC9BvE,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,+JAOA,
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-components-tab-bar.mjs","sources":["../../../projects/addon-mobile/components/tab-bar/tab-bar-item.component.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar-item.template.html","../../../projects/addon-mobile/components/tab-bar/tab-bar.component.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar.template.html","../../../projects/addon-mobile/components/tab-bar/tab-bar-item.directive.ts","../../../projects/addon-mobile/components/tab-bar/tab-bar.ts","../../../projects/addon-mobile/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.ts"],"sourcesContent":["import {NgIf} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, Input} from '@angular/core';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\n\n@Component({\n standalone: true,\n selector: 'button[tuiTabBarItem], a[tuiTabBarItem]',\n imports: [NgIf, TuiAnimated, TuiIcon],\n templateUrl: './tab-bar-item.template.html',\n styleUrls: ['./tab-bar-item.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiTabBarItem {\n @Input()\n public icon = '';\n\n @Input()\n public badge?: number | null = null;\n\n protected format(value: number): string {\n return value > 999 ? '999+' : String(value);\n }\n}\n","<tui-icon\n class=\"t-icon\"\n [icon]=\"icon\"\n/>\n<span class=\"t-wrapper\">\n <span\n *ngIf=\"badge as value\"\n tuiAnimated\n class=\"t-badge\"\n >\n {{ format(value) }}\n </span>\n</span>\n<span class=\"t-text\">\n <ng-content />\n</span>\n","import type {QueryList} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n} from '@angular/core';\nimport {EMPTY_QUERY} from '@taiga-ui/cdk/constants';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiIsElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {TuiTabBarItem} from './tab-bar-item.component';\n\n@Component({\n standalone: true,\n selector: 'nav[tuiTabBar]',\n imports: [TuiRepeatTimes],\n templateUrl: './tab-bar.template.html',\n styleUrls: ['./tab-bar.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style]': 'style',\n '(click)': 'setActive($event.target)',\n },\n})\nexport class TuiTabBarComponent {\n @ContentChildren(forwardRef(() => TuiTabBarItem), {read: ElementRef})\n private readonly tabs: QueryList<ElementRef<HTMLElement>> = EMPTY_QUERY;\n\n @Input()\n public quantity = 4;\n\n @Input()\n public activeItemIndex = NaN;\n\n @Output()\n public readonly activeItemIndexChange = new EventEmitter<number>();\n\n public setActive(tab: EventTarget): void {\n if (tuiIsElement(tab)) {\n this.updateIndex(\n this.tabs.toArray().findIndex(({nativeElement}) => nativeElement === tab),\n );\n }\n }\n\n protected 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","<ng-content />\n<div class=\"t-skeletons\">\n <div\n *tuiRepeatTimes=\"let index of quantity\"\n class=\"t-skeleton\"\n ></div>\n</div>\n","import {Directive, inject} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {RouterLinkActive} from '@angular/router';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport type {Observable} from 'rxjs';\nimport {EMPTY, filter} from 'rxjs';\n\nimport {TuiTabBarComponent} from './tab-bar.component';\n\n@Directive({\n standalone: true,\n selector: '[tuiTabBarItem][routerLinkActive]',\n})\nexport class TuiTabBarItemDirective {\n constructor() {\n const tabs = inject(TuiTabBarComponent);\n const el = tuiInjectElement();\n const link: Observable<boolean> =\n inject(RouterLinkActive, {optional: true})?.isActiveChange || EMPTY;\n\n link.pipe(filter(Boolean), tuiWatch(), takeUntilDestroyed()).subscribe(() =>\n tabs.setActive(el),\n );\n }\n}\n","import {TuiTabBarComponent} from './tab-bar.component';\nimport {TuiTabBarItem} from './tab-bar-item.component';\nimport {TuiTabBarItemDirective} from './tab-bar-item.directive';\n\nexport const TuiTabBar = [\n TuiTabBarComponent,\n TuiTabBarItem,\n TuiTabBarItemDirective,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nex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AC,MACnE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CACrB,CAAC;KACL;+GAVQ,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mCAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAJlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,mCAAmC;AAChD,iBAAA,CAAA;;;ACTY,MAAA,SAAS,GAAG;IACrB,kBAAkB;IAClB,aAAa;IACb,sBAAsB;;;ACP1B;;AAEG;;;;"}
|
|
@@ -1,57 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DOCUMENT, NgIf } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject,
|
|
3
|
+
import { inject, Directive, Input, Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
|
|
4
4
|
import * as i3 from '@ng-web-apis/intersection-observer';
|
|
5
5
|
import { WaIntersectionObserver } from '@ng-web-apis/intersection-observer';
|
|
6
6
|
import { TuiKeyboardService } from '@taiga-ui/addon-mobile/services';
|
|
7
|
-
import * as i1
|
|
7
|
+
import * as i1 from '@taiga-ui/cdk/directives/active-zone';
|
|
8
8
|
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
|
9
9
|
import * as i2 from '@taiga-ui/cdk/directives/animated';
|
|
10
10
|
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
|
|
11
11
|
import { TuiSwipe } from '@taiga-ui/cdk/directives/swipe';
|
|
12
12
|
import { tuiIsHTMLElement, tuiInjectElement, tuiIsElement } from '@taiga-ui/cdk/utils/dom';
|
|
13
13
|
import { tuiGetNativeFocused } from '@taiga-ui/cdk/utils/focus';
|
|
14
|
-
import {
|
|
14
|
+
import { tuiPx } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
15
15
|
import { TUI_DROPDOWN_COMPONENT, TuiDropdownDirective } from '@taiga-ui/core/directives/dropdown';
|
|
16
16
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
17
17
|
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
18
|
-
import { TUI_DATA_LIST_HOST, TuiOptionWithValue, TUI_OPTION_CONTENT } from '@taiga-ui/core/components/data-list';
|
|
19
|
-
import { tuiInjectAuxiliary, TuiTextfieldComponent } from '@taiga-ui/core/components/textfield';
|
|
20
|
-
import { FormsModule } from '@angular/forms';
|
|
21
|
-
import { TuiControl } from '@taiga-ui/cdk/classes';
|
|
22
|
-
import { TUI_ITEMS_HANDLERS } from '@taiga-ui/core/directives/items-handlers';
|
|
23
|
-
import * as i1 from '@taiga-ui/kit/components/radio';
|
|
24
|
-
import { TuiRadio } from '@taiga-ui/kit/components/radio';
|
|
25
|
-
import { TuiSelectDirective } from '@taiga-ui/kit/components/select';
|
|
26
|
-
|
|
27
|
-
class TuiOptionMobile {
|
|
28
|
-
constructor() {
|
|
29
|
-
this.host = inject(TUI_DATA_LIST_HOST);
|
|
30
|
-
this.itemsHandlers = inject(TUI_ITEMS_HANDLERS);
|
|
31
|
-
this.option = inject(TuiOptionWithValue, {
|
|
32
|
-
optional: true,
|
|
33
|
-
});
|
|
34
|
-
this.control = tuiInjectAuxiliary((x) => x instanceof TuiControl);
|
|
35
|
-
this.select = tuiInjectAuxiliary((x) => x instanceof TuiSelectDirective);
|
|
36
|
-
this.selected = computed((controlValue = this.control()?.value(), optionValue = this.option?.value()) => tuiIsPresent(optionValue) &&
|
|
37
|
-
tuiIsPresent(controlValue) &&
|
|
38
|
-
this.itemsHandlers.identityMatcher()(controlValue, optionValue));
|
|
39
|
-
}
|
|
40
|
-
onClick() {
|
|
41
|
-
const value = this.option?.value();
|
|
42
|
-
if (this.host?.handleOption && value !== undefined) {
|
|
43
|
-
this.host.handleOption(value);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiOptionMobile, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
47
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiOptionMobile, isStandalone: true, selector: "ng-component", host: { listeners: { "click": "onClick()" } }, ngImport: i0, template: "<input\n *ngIf=\"select()\"\n tuiRadio\n type=\"radio\"\n class=\"t-checked-indicator\"\n [checked]=\"selected()\"\n/>\n", styles: [".t-checked-indicator{order:1;margin-inline-start:auto;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.TuiRadioComponent, selector: "input[type=\"radio\"][tuiRadio]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
48
|
-
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiOptionMobile, decorators: [{
|
|
50
|
-
type: Component,
|
|
51
|
-
args: [{ standalone: true, imports: [FormsModule, NgIf, TuiRadio], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
52
|
-
'(click)': 'onClick()',
|
|
53
|
-
}, template: "<input\n *ngIf=\"select()\"\n tuiRadio\n type=\"radio\"\n class=\"t-checked-indicator\"\n [checked]=\"selected()\"\n/>\n", styles: [".t-checked-indicator{order:1;margin-inline-start:auto;pointer-events:none}\n"] }]
|
|
54
|
-
}] });
|
|
55
18
|
|
|
56
19
|
class TuiDropdownMobile {
|
|
57
20
|
constructor() {
|
|
@@ -76,14 +39,6 @@ class TuiDropdownMobile {
|
|
|
76
39
|
? TuiDropdownMobileComponent
|
|
77
40
|
: inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
|
|
78
41
|
},
|
|
79
|
-
{
|
|
80
|
-
provide: TUI_OPTION_CONTENT,
|
|
81
|
-
useFactory: () => inject(TUI_IS_MOBILE) &&
|
|
82
|
-
// TODO(v5): remove it after deletion of all legacy controls
|
|
83
|
-
inject(TuiTextfieldComponent, { optional: true })
|
|
84
|
-
? TuiOptionMobile
|
|
85
|
-
: inject(TUI_OPTION_CONTENT, { skipSelf: true, optional: true }),
|
|
86
|
-
},
|
|
87
42
|
], ngImport: i0 }); }
|
|
88
43
|
}
|
|
89
44
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDropdownMobile, decorators: [{
|
|
@@ -98,14 +53,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
98
53
|
? TuiDropdownMobileComponent
|
|
99
54
|
: inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
|
|
100
55
|
},
|
|
101
|
-
{
|
|
102
|
-
provide: TUI_OPTION_CONTENT,
|
|
103
|
-
useFactory: () => inject(TUI_IS_MOBILE) &&
|
|
104
|
-
// TODO(v5): remove it after deletion of all legacy controls
|
|
105
|
-
inject(TuiTextfieldComponent, { optional: true })
|
|
106
|
-
? TuiOptionMobile
|
|
107
|
-
: inject(TUI_OPTION_CONTENT, { skipSelf: true, optional: true }),
|
|
108
|
-
},
|
|
109
56
|
],
|
|
110
57
|
host: {
|
|
111
58
|
'[style.visibility]': '"visible"',
|
|
@@ -126,6 +73,7 @@ class TuiDropdownMobileComponent {
|
|
|
126
73
|
this.observer = new ResizeObserver(() => this.refresh(this.doc.defaultView.visualViewport));
|
|
127
74
|
this.directive = inject(TuiDropdownMobile);
|
|
128
75
|
this.dropdown = inject(TuiDropdownDirective);
|
|
76
|
+
this.close = () => this.dropdown.toggle(false);
|
|
129
77
|
this.observer.observe(this.dropdown.el);
|
|
130
78
|
this.doc.documentElement.style.setProperty('scroll-behavior', 'initial');
|
|
131
79
|
}
|
|
@@ -161,9 +109,6 @@ class TuiDropdownMobileComponent {
|
|
|
161
109
|
this.close();
|
|
162
110
|
}
|
|
163
111
|
}
|
|
164
|
-
close() {
|
|
165
|
-
this.dropdown.toggle(false);
|
|
166
|
-
}
|
|
167
112
|
refresh({ offsetTop, height }) {
|
|
168
113
|
this.doc.body.style.removeProperty('--t-root-top');
|
|
169
114
|
if (!this.focused ||
|
|
@@ -184,7 +129,7 @@ class TuiDropdownMobileComponent {
|
|
|
184
129
|
return this.dropdown.el.contains(tuiGetNativeFocused(this.doc));
|
|
185
130
|
}
|
|
186
131
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDropdownMobileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
187
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiDropdownMobileComponent, isStandalone: true, selector: "tui-dropdown-mobile", host: { listeners: { "document:click.zoneless.capture": "onClick($event)", "window>scroll.zoneless.capture": "refresh($event.currentTarget.visualViewport)", "visualViewport>resize.zoneless": "refresh($event.target)", "visualViewport>scroll.zoneless": "refresh($event.target)" }, properties: { "class._sheet": "directive.tuiDropdownMobile" } }, hostDirectives: [{ directive: i1
|
|
132
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiDropdownMobileComponent, isStandalone: true, selector: "tui-dropdown-mobile", host: { listeners: { "document:click.zoneless.capture": "onClick($event)", "window>scroll.zoneless.capture": "refresh($event.currentTarget.visualViewport)", "visualViewport>resize.zoneless": "refresh($event.target)", "visualViewport>scroll.zoneless": "refresh($event.target)" }, properties: { "class._sheet": "directive.tuiDropdownMobile" } }, hostDirectives: [{ directive: i1.TuiActiveZone }, { directive: i2.TuiAnimated }], ngImport: i0, template: "<div\n *ngIf=\"directive.tuiDropdownMobile\"\n waIntersectionObserver\n waIntersectionThreshold=\"1\"\n class=\"t-filler\"\n (touchstart.prevent)=\"close()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0])\"\n></div>\n<div\n #container\n class=\"t-container\"\n (tuiSwipe)=\"onSwipe($event, container)\"\n>\n <h2\n *ngIf=\"directive.tuiDropdownMobile\"\n class=\"t-heading\"\n >\n {{ directive.tuiDropdownMobile }}\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: {$implicit: close}\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n", styles: ["tui-dropdown-mobile:not(._sheet){scrollbar-width:none;-ms-overflow-style:none;position:fixed;top:0;left:0;inline-size:100%;block-size:100%;transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;visibility:visible!important;transform:translateZ(0);background:var(--tui-background-base);overscroll-behavior:contain;overflow:auto;box-shadow:0 -.5rem .5rem var(--tui-background-base),0 10rem var(--tui-background-base),0 20rem var(--tui-background-base),0 30rem var(--tui-background-base)}tui-dropdown-mobile:not(._sheet)::-webkit-scrollbar,tui-dropdown-mobile:not(._sheet)::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:not(._sheet).tui-enter,tui-dropdown-mobile:not(._sheet).tui-leave{animation-name:tuiFade,tuiSlide}tui-dropdown-mobile:not(._sheet):after{content:\"\";display:block;block-size:1px}tui-dropdown-mobile:not(._sheet)>.t-container{scrollbar-width:none;-ms-overflow-style:none;position:sticky;top:0;block-size:100%;overflow:auto;margin:0 .75rem;touch-action:pan-y!important}tui-dropdown-mobile:not(._sheet)>.t-container::-webkit-scrollbar,tui-dropdown-mobile:not(._sheet)>.t-container::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:not(._sheet) [tuiDropdownButton][tuiDropdownButton]{position:fixed;right:1rem;bottom:1rem;display:inline-flex}tui-dropdown-mobile._sheet{position:fixed;top:0;left:0;bottom:0;right:0;scrollbar-width:none;-ms-overflow-style:none;overflow:auto;background:var(--tui-service-backdrop);box-shadow:0 -80vh 0 5rem var(--tui-service-backdrop);overflow-y:scroll;scroll-snap-type:y mandatory;overscroll-behavior:none}tui-dropdown-mobile._sheet::-webkit-scrollbar,tui-dropdown-mobile._sheet::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile._sheet.tui-enter,tui-dropdown-mobile._sheet.tui-leave{animation-name:tuiFade,tuiSlide}tui-root:has(tui-dialogs>:nth-child(2)) tui-dropdown-mobile._sheet{background:transparent;box-shadow:none}tui-dropdown-mobile._sheet>.t-filler{block-size:100%;scroll-snap-stop:always;scroll-snap-align:start}tui-dropdown-mobile._sheet>.t-container{display:flex;max-block-size:calc(100% - 1rem);flex-direction:column;border-top-left-radius:1rem;border-top-right-radius:1rem;padding:0 .5rem;scroll-snap-stop:always;scroll-snap-align:start;background:var(--tui-background-elevation-1)}tui-dropdown-mobile._sheet>.t-container>.t-heading{position:relative;margin:0;padding:2rem .5rem .75rem;font:var(--tui-font-heading-6)}tui-dropdown-mobile._sheet>.t-container>.t-heading:before{content:\"\";position:absolute;left:50%;top:.75rem;inline-size:2rem;block-size:.25rem;border-radius:1rem;background:var(--tui-background-neutral-2);transform:translate(-50%,-50%)}tui-dropdown-mobile._sheet>.t-container>.t-content{scrollbar-width:none;-ms-overflow-style:none;overflow-y:auto;overflow-x:hidden}tui-dropdown-mobile._sheet>.t-container>.t-content::-webkit-scrollbar,tui-dropdown-mobile._sheet>.t-container>.t-content::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile._sheet tui-data-list [tuiOption]{margin-inline-start:calc(-1 * var(--t-option-padding-inline));margin-inline-end:calc(-1 * var(--t-option-padding-inline))}.t-dropdown-mobile{touch-action:none;visibility:hidden}.t-dropdown-mobile *{touch-action:inherit;visibility:inherit}.t-dropdown-mobile tui-root{visibility:visible}.t-dropdown-mobile tui-root .t-root-content,.t-dropdown-mobile tui-root tui-dialogs{visibility:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiSwipe, selector: "[tuiSwipe]", outputs: ["tuiSwipe"] }, { kind: "directive", type: i3.WaIntersectionObserverDirective, selector: "[waIntersectionObserver]", inputs: ["waIntersectionRootMargin", "waIntersectionThreshold"], exportAs: ["IntersectionObserver"] }, { kind: "directive", type: i3.WaIntersectionObservee, selector: "[waIntersectionObservee]", outputs: ["waIntersectionObservee"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
188
133
|
}
|
|
189
134
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDropdownMobileComponent, decorators: [{
|
|
190
135
|
type: Component,
|
|
@@ -194,12 +139,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
194
139
|
'(window>scroll.zoneless.capture)': 'refresh($event.currentTarget.visualViewport)',
|
|
195
140
|
'(visualViewport>resize.zoneless)': 'refresh($event.target)',
|
|
196
141
|
'(visualViewport>scroll.zoneless)': 'refresh($event.target)',
|
|
197
|
-
}, template: "<div\n *ngIf=\"directive.tuiDropdownMobile\"\n waIntersectionObserver\n waIntersectionThreshold=\"1\"\n class=\"t-filler\"\n (touchstart.prevent)=\"close()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0])\"\n></div>\n<div\n #container\n class=\"t-container\"\n (tuiSwipe)=\"onSwipe($event, container)\"\n>\n <h2\n *ngIf=\"directive.tuiDropdownMobile\"\n class=\"t-heading\"\n >\n {{ directive.tuiDropdownMobile }}\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown.
|
|
142
|
+
}, template: "<div\n *ngIf=\"directive.tuiDropdownMobile\"\n waIntersectionObserver\n waIntersectionThreshold=\"1\"\n class=\"t-filler\"\n (touchstart.prevent)=\"close()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0])\"\n></div>\n<div\n #container\n class=\"t-container\"\n (tuiSwipe)=\"onSwipe($event, container)\"\n>\n <h2\n *ngIf=\"directive.tuiDropdownMobile\"\n class=\"t-heading\"\n >\n {{ directive.tuiDropdownMobile }}\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: {$implicit: close}\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n", styles: ["tui-dropdown-mobile:not(._sheet){scrollbar-width:none;-ms-overflow-style:none;position:fixed;top:0;left:0;inline-size:100%;block-size:100%;transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;visibility:visible!important;transform:translateZ(0);background:var(--tui-background-base);overscroll-behavior:contain;overflow:auto;box-shadow:0 -.5rem .5rem var(--tui-background-base),0 10rem var(--tui-background-base),0 20rem var(--tui-background-base),0 30rem var(--tui-background-base)}tui-dropdown-mobile:not(._sheet)::-webkit-scrollbar,tui-dropdown-mobile:not(._sheet)::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:not(._sheet).tui-enter,tui-dropdown-mobile:not(._sheet).tui-leave{animation-name:tuiFade,tuiSlide}tui-dropdown-mobile:not(._sheet):after{content:\"\";display:block;block-size:1px}tui-dropdown-mobile:not(._sheet)>.t-container{scrollbar-width:none;-ms-overflow-style:none;position:sticky;top:0;block-size:100%;overflow:auto;margin:0 .75rem;touch-action:pan-y!important}tui-dropdown-mobile:not(._sheet)>.t-container::-webkit-scrollbar,tui-dropdown-mobile:not(._sheet)>.t-container::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile:not(._sheet) [tuiDropdownButton][tuiDropdownButton]{position:fixed;right:1rem;bottom:1rem;display:inline-flex}tui-dropdown-mobile._sheet{position:fixed;top:0;left:0;bottom:0;right:0;scrollbar-width:none;-ms-overflow-style:none;overflow:auto;background:var(--tui-service-backdrop);box-shadow:0 -80vh 0 5rem var(--tui-service-backdrop);overflow-y:scroll;scroll-snap-type:y mandatory;overscroll-behavior:none}tui-dropdown-mobile._sheet::-webkit-scrollbar,tui-dropdown-mobile._sheet::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile._sheet.tui-enter,tui-dropdown-mobile._sheet.tui-leave{animation-name:tuiFade,tuiSlide}tui-root:has(tui-dialogs>:nth-child(2)) tui-dropdown-mobile._sheet{background:transparent;box-shadow:none}tui-dropdown-mobile._sheet>.t-filler{block-size:100%;scroll-snap-stop:always;scroll-snap-align:start}tui-dropdown-mobile._sheet>.t-container{display:flex;max-block-size:calc(100% - 1rem);flex-direction:column;border-top-left-radius:1rem;border-top-right-radius:1rem;padding:0 .5rem;scroll-snap-stop:always;scroll-snap-align:start;background:var(--tui-background-elevation-1)}tui-dropdown-mobile._sheet>.t-container>.t-heading{position:relative;margin:0;padding:2rem .5rem .75rem;font:var(--tui-font-heading-6)}tui-dropdown-mobile._sheet>.t-container>.t-heading:before{content:\"\";position:absolute;left:50%;top:.75rem;inline-size:2rem;block-size:.25rem;border-radius:1rem;background:var(--tui-background-neutral-2);transform:translate(-50%,-50%)}tui-dropdown-mobile._sheet>.t-container>.t-content{scrollbar-width:none;-ms-overflow-style:none;overflow-y:auto;overflow-x:hidden}tui-dropdown-mobile._sheet>.t-container>.t-content::-webkit-scrollbar,tui-dropdown-mobile._sheet>.t-container>.t-content::-webkit-scrollbar-thumb{display:none}tui-dropdown-mobile._sheet tui-data-list [tuiOption]{margin-inline-start:calc(-1 * var(--t-option-padding-inline));margin-inline-end:calc(-1 * var(--t-option-padding-inline))}.t-dropdown-mobile{touch-action:none;visibility:hidden}.t-dropdown-mobile *{touch-action:inherit;visibility:inherit}.t-dropdown-mobile tui-root{visibility:visible}.t-dropdown-mobile tui-root .t-root-content,.t-dropdown-mobile tui-root tui-dialogs{visibility:hidden}\n"] }]
|
|
198
143
|
}], ctorParameters: function () { return []; } });
|
|
199
144
|
|
|
200
145
|
/**
|
|
201
146
|
* Generated bundle index. Do not edit.
|
|
202
147
|
*/
|
|
203
148
|
|
|
204
|
-
export { TuiDropdownMobile, TuiDropdownMobileComponent
|
|
149
|
+
export { TuiDropdownMobile, TuiDropdownMobileComponent };
|
|
205
150
|
//# sourceMappingURL=taiga-ui-addon-mobile-directives-dropdown-mobile.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-directives-dropdown-mobile.mjs","sources":["../../../projects/addon-mobile/directives/dropdown-mobile/option-mobile/option-mobile.component.ts","../../../projects/addon-mobile/directives/dropdown-mobile/option-mobile/option-mobile.template.html","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.directive.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.component.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.template.html","../../../projects/addon-mobile/directives/dropdown-mobile/taiga-ui-addon-mobile-directives-dropdown-mobile.ts"],"sourcesContent":["import {NgIf} from '@angular/common';\nimport {ChangeDetectionStrategy, Component, computed, inject} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {tuiIsPresent} from '@taiga-ui/cdk/utils/miscellaneous';\nimport type {TuiDataListHost} from '@taiga-ui/core/components/data-list';\nimport {\n TUI_DATA_LIST_HOST,\n TuiOptionWithValue,\n} from '@taiga-ui/core/components/data-list';\nimport {tuiInjectAuxiliary} from '@taiga-ui/core/components/textfield';\nimport type {TuiItemsHandlers} from '@taiga-ui/core/directives/items-handlers';\nimport {TUI_ITEMS_HANDLERS} from '@taiga-ui/core/directives/items-handlers';\nimport {TuiRadio} from '@taiga-ui/kit/components/radio';\nimport {TuiSelectDirective} from '@taiga-ui/kit/components/select';\n\n@Component({\n standalone: true,\n imports: [FormsModule, NgIf, TuiRadio],\n templateUrl: './option-mobile.template.html',\n styleUrls: ['./option-mobile.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(click)': 'onClick()',\n },\n})\nexport class TuiOptionMobile<T> {\n private readonly host = inject<TuiDataListHost<T>>(TUI_DATA_LIST_HOST);\n private readonly itemsHandlers: TuiItemsHandlers<T> = inject(TUI_ITEMS_HANDLERS);\n private readonly option = inject<TuiOptionWithValue<T>>(TuiOptionWithValue, {\n optional: true,\n });\n\n private readonly control = tuiInjectAuxiliary<TuiControl<T>>(\n (x) => x instanceof TuiControl,\n );\n\n protected readonly select = tuiInjectAuxiliary<TuiControl<T>>(\n (x) => x instanceof TuiSelectDirective,\n );\n\n protected readonly selected = computed(\n (controlValue = this.control()?.value(), optionValue = this.option?.value()) =>\n tuiIsPresent(optionValue) &&\n tuiIsPresent(controlValue) &&\n this.itemsHandlers.identityMatcher()(controlValue, optionValue),\n );\n\n protected onClick(): void {\n const value = this.option?.value();\n\n if (this.host?.handleOption && value !== undefined) {\n this.host.handleOption(value);\n }\n }\n}\n","<input\n *ngIf=\"select()\"\n tuiRadio\n type=\"radio\"\n class=\"t-checked-indicator\"\n [checked]=\"selected()\"\n/>\n","import {Directive, inject, Input} from '@angular/core';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {TUI_OPTION_CONTENT} from '@taiga-ui/core/components/data-list';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {TUI_DROPDOWN_COMPONENT} from '@taiga-ui/core/directives/dropdown';\n\nimport {TuiDropdownMobileComponent} from './dropdown-mobile.component';\nimport {TuiOptionMobile} from './option-mobile/option-mobile.component';\n\n@Directive({\n standalone: true,\n selector: '[tuiDropdownMobile]',\n providers: [\n {\n provide: TUI_DROPDOWN_COMPONENT,\n useFactory: () =>\n inject(TUI_IS_MOBILE)\n ? TuiDropdownMobileComponent\n : inject(TUI_DROPDOWN_COMPONENT, {skipSelf: true}),\n },\n {\n provide: TUI_OPTION_CONTENT,\n useFactory: () =>\n inject(TUI_IS_MOBILE) &&\n // TODO(v5): remove it after deletion of all legacy controls\n inject(TuiTextfieldComponent, {optional: true})\n ? TuiOptionMobile\n : inject(TUI_OPTION_CONTENT, {skipSelf: true, optional: true}),\n },\n ],\n host: {\n '[style.visibility]': '\"visible\"',\n '(mousedown)': 'onMouseDown($event)',\n },\n})\nexport class TuiDropdownMobile {\n private readonly isMobile = inject(TUI_IS_MOBILE);\n\n @Input()\n public tuiDropdownMobile = '';\n\n protected onMouseDown(event: MouseEvent): void {\n if (\n !this.isMobile ||\n !tuiIsHTMLElement(event.target) ||\n !event.target.matches('input,textarea') ||\n this.tuiDropdownMobile\n ) {\n return;\n }\n\n event.preventDefault();\n event.target.focus({preventScroll: true});\n }\n}\n","import {DOCUMENT, NgIf} from '@angular/common';\nimport type {AfterViewInit, OnDestroy} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport {WaIntersectionObserver} from '@ng-web-apis/intersection-observer';\nimport {TuiKeyboardService} from '@taiga-ui/addon-mobile/services';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport type {TuiSwipeEvent} from '@taiga-ui/cdk/directives/swipe';\nimport {TuiSwipe} from '@taiga-ui/cdk/directives/swipe';\nimport {tuiInjectElement, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiGetNativeFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TuiDropdownMobile} from './dropdown-mobile.directive';\n\nconst GAP = 16;\n\n@Component({\n standalone: true,\n selector: 'tui-dropdown-mobile',\n imports: [NgIf, PolymorpheusOutlet, TuiSwipe, WaIntersectionObserver],\n templateUrl: './dropdown-mobile.template.html',\n styleUrls: ['./dropdown-mobile.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiActiveZone, TuiAnimated],\n host: {\n '[class._sheet]': 'directive.tuiDropdownMobile',\n '(document:click.zoneless.capture)': 'onClick($event)',\n '(window>scroll.zoneless.capture)':\n 'refresh($event.currentTarget.visualViewport)',\n '(visualViewport>resize.zoneless)': 'refresh($event.target)',\n '(visualViewport>scroll.zoneless)': 'refresh($event.target)',\n },\n})\nexport class TuiDropdownMobileComponent implements OnDestroy, AfterViewInit {\n private readonly el = tuiInjectElement();\n private readonly keyboard = inject(TuiKeyboardService);\n private readonly doc = inject(DOCUMENT);\n private readonly scrollTop = this.doc.documentElement.scrollTop;\n private readonly observer = new ResizeObserver(() =>\n this.refresh(this.doc.defaultView!.visualViewport!),\n );\n\n protected readonly directive = inject(TuiDropdownMobile);\n protected readonly dropdown = inject(TuiDropdownDirective);\n\n constructor() {\n this.observer.observe(this.dropdown.el);\n this.doc.documentElement.style.setProperty('scroll-behavior', 'initial');\n }\n\n public ngAfterViewInit(): void {\n this.el.scrollTop = this.directive.tuiDropdownMobile ? this.el.clientHeight : 0;\n }\n\n public ngOnDestroy(): void {\n this.observer.disconnect();\n this.doc.body.classList.remove('t-dropdown-mobile');\n this.doc.body.style.removeProperty('--t-root-top');\n this.doc.documentElement.scrollTop = this.scrollTop;\n this.doc.documentElement.style.removeProperty('scroll-behavior');\n\n if (this.focused) {\n this.keyboard.hide();\n }\n }\n\n protected onClick(event: MouseEvent): void {\n if (\n tuiIsElement(event.target) &&\n !this.el.contains(event.target) &&\n (!this.dropdown.el.contains(event.target) ||\n event.target.matches('input,textarea'))\n ) {\n event.stopPropagation();\n }\n }\n\n protected onSwipe({direction}: TuiSwipeEvent, el: HTMLElement): void {\n if (\n direction === 'bottom' &&\n el.getBoundingClientRect().bottom > Number(this.doc.defaultView?.innerHeight)\n ) {\n this.close();\n }\n }\n\n protected onIntersection({isIntersecting}: IntersectionObserverEntry): void {\n if (isIntersecting) {\n this.close();\n }\n }\n\n protected close(): void {\n this.dropdown.toggle(false);\n }\n\n protected refresh({offsetTop, height}: VisualViewport): void {\n this.doc.body.style.removeProperty('--t-root-top');\n\n if (\n !this.focused ||\n this.directive.tuiDropdownMobile ||\n !this.doc.documentElement.style.getPropertyValue('scroll-behavior')\n ) {\n return;\n }\n\n this.doc.documentElement.scrollTop = 0;\n\n const rect = this.dropdown.el.getBoundingClientRect();\n const topMargin = `var(--tui-dropdown-mobile-offset, ${tuiPx(GAP)})`;\n const offset = `(${topMargin} + ${tuiPx(rect.height + GAP)})`;\n\n this.el.style.setProperty('top', `calc(${tuiPx(offsetTop)} + ${offset})`);\n this.el.style.setProperty('height', `calc(${tuiPx(height)} - ${offset})`);\n this.doc.body.classList.add('t-dropdown-mobile');\n this.doc.body.style.setProperty(\n '--t-root-top',\n `calc(${tuiPx(offsetTop - rect.top)} + ${topMargin})`,\n );\n }\n\n private get focused(): boolean {\n return this.dropdown.el.contains(tuiGetNativeFocused(this.doc));\n }\n}\n","<div\n *ngIf=\"directive.tuiDropdownMobile\"\n waIntersectionObserver\n waIntersectionThreshold=\"1\"\n class=\"t-filler\"\n (touchstart.prevent)=\"close()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0])\"\n></div>\n<div\n #container\n class=\"t-container\"\n (tuiSwipe)=\"onSwipe($event, container)\"\n>\n <h2\n *ngIf=\"directive.tuiDropdownMobile\"\n class=\"t-heading\"\n >\n {{ directive.tuiDropdownMobile }}\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown.content as text\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MA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BAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAC/B,cAAA,EAAA,CAAC,aAAa,EAAE,WAAW,CAAC,EACtC,IAAA,EAAA;AACF,wBAAA,gBAAgB,EAAE,6BAA6B;AAC/C,wBAAA,mCAAmC,EAAE,iBAAiB;AACtD,wBAAA,kCAAkC,EAC9B,8CAA8C;AAClD,wBAAA,kCAAkC,EAAE,wBAAwB;AAC5D,wBAAA,kCAAkC,EAAE,wBAAwB;AAC/D,qBAAA,EAAA,QAAA,EAAA,oqBAAA,EAAA,MAAA,EAAA,CAAA,21GAAA,CAAA,EAAA,CAAA;;;AExCL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-directives-dropdown-mobile.mjs","sources":["../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.directive.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.component.ts","../../../projects/addon-mobile/directives/dropdown-mobile/dropdown-mobile.template.html","../../../projects/addon-mobile/directives/dropdown-mobile/taiga-ui-addon-mobile-directives-dropdown-mobile.ts"],"sourcesContent":["import {Directive, inject, Input} from '@angular/core';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {TUI_DROPDOWN_COMPONENT} from '@taiga-ui/core/directives/dropdown';\n\nimport {TuiDropdownMobileComponent} from './dropdown-mobile.component';\n\n@Directive({\n standalone: true,\n selector: '[tuiDropdownMobile]',\n providers: [\n {\n provide: TUI_DROPDOWN_COMPONENT,\n useFactory: () =>\n inject(TUI_IS_MOBILE)\n ? TuiDropdownMobileComponent\n : inject(TUI_DROPDOWN_COMPONENT, {skipSelf: true}),\n },\n ],\n host: {\n '[style.visibility]': '\"visible\"',\n '(mousedown)': 'onMouseDown($event)',\n },\n})\nexport class TuiDropdownMobile {\n private readonly isMobile = inject(TUI_IS_MOBILE);\n\n @Input()\n public tuiDropdownMobile = '';\n\n protected onMouseDown(event: MouseEvent): void {\n if (\n !this.isMobile ||\n !tuiIsHTMLElement(event.target) ||\n !event.target.matches('input,textarea') ||\n this.tuiDropdownMobile\n ) {\n return;\n }\n\n event.preventDefault();\n event.target.focus({preventScroll: true});\n }\n}\n","import {DOCUMENT, NgIf} from '@angular/common';\nimport type {AfterViewInit, OnDestroy} from '@angular/core';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport {WaIntersectionObserver} from '@ng-web-apis/intersection-observer';\nimport {TuiKeyboardService} from '@taiga-ui/addon-mobile/services';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport type {TuiSwipeEvent} from '@taiga-ui/cdk/directives/swipe';\nimport {TuiSwipe} from '@taiga-ui/cdk/directives/swipe';\nimport {tuiInjectElement, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiGetNativeFocused} from '@taiga-ui/cdk/utils/focus';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TuiDropdownMobile} from './dropdown-mobile.directive';\n\nconst GAP = 16;\n\n@Component({\n standalone: true,\n selector: 'tui-dropdown-mobile',\n imports: [NgIf, PolymorpheusOutlet, TuiSwipe, WaIntersectionObserver],\n templateUrl: './dropdown-mobile.template.html',\n styleUrls: ['./dropdown-mobile.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiActiveZone, TuiAnimated],\n host: {\n '[class._sheet]': 'directive.tuiDropdownMobile',\n '(document:click.zoneless.capture)': 'onClick($event)',\n '(window>scroll.zoneless.capture)':\n 'refresh($event.currentTarget.visualViewport)',\n '(visualViewport>resize.zoneless)': 'refresh($event.target)',\n '(visualViewport>scroll.zoneless)': 'refresh($event.target)',\n },\n})\nexport class TuiDropdownMobileComponent implements OnDestroy, AfterViewInit {\n private readonly el = tuiInjectElement();\n private readonly keyboard = inject(TuiKeyboardService);\n private readonly doc = inject(DOCUMENT);\n private readonly scrollTop = this.doc.documentElement.scrollTop;\n private readonly observer = new ResizeObserver(() =>\n this.refresh(this.doc.defaultView!.visualViewport!),\n );\n\n protected readonly directive = inject(TuiDropdownMobile);\n protected readonly dropdown = inject(TuiDropdownDirective);\n\n constructor() {\n this.observer.observe(this.dropdown.el);\n this.doc.documentElement.style.setProperty('scroll-behavior', 'initial');\n }\n\n public ngAfterViewInit(): void {\n this.el.scrollTop = this.directive.tuiDropdownMobile ? this.el.clientHeight : 0;\n }\n\n public ngOnDestroy(): void {\n this.observer.disconnect();\n this.doc.body.classList.remove('t-dropdown-mobile');\n this.doc.body.style.removeProperty('--t-root-top');\n this.doc.documentElement.scrollTop = this.scrollTop;\n this.doc.documentElement.style.removeProperty('scroll-behavior');\n\n if (this.focused) {\n this.keyboard.hide();\n }\n }\n\n protected readonly close = (): void => this.dropdown.toggle(false);\n\n protected onClick(event: MouseEvent): void {\n if (\n tuiIsElement(event.target) &&\n !this.el.contains(event.target) &&\n (!this.dropdown.el.contains(event.target) ||\n event.target.matches('input,textarea'))\n ) {\n event.stopPropagation();\n }\n }\n\n protected onSwipe({direction}: TuiSwipeEvent, el: HTMLElement): void {\n if (\n direction === 'bottom' &&\n el.getBoundingClientRect().bottom > Number(this.doc.defaultView?.innerHeight)\n ) {\n this.close();\n }\n }\n\n protected onIntersection({isIntersecting}: IntersectionObserverEntry): void {\n if (isIntersecting) {\n this.close();\n }\n }\n\n protected refresh({offsetTop, height}: VisualViewport): void {\n this.doc.body.style.removeProperty('--t-root-top');\n\n if (\n !this.focused ||\n this.directive.tuiDropdownMobile ||\n !this.doc.documentElement.style.getPropertyValue('scroll-behavior')\n ) {\n return;\n }\n\n this.doc.documentElement.scrollTop = 0;\n\n const rect = this.dropdown.el.getBoundingClientRect();\n const topMargin = `var(--tui-dropdown-mobile-offset, ${tuiPx(GAP)})`;\n const offset = `(${topMargin} + ${tuiPx(rect.height + GAP)})`;\n\n this.el.style.setProperty('top', `calc(${tuiPx(offsetTop)} + ${offset})`);\n this.el.style.setProperty('height', `calc(${tuiPx(height)} - ${offset})`);\n this.doc.body.classList.add('t-dropdown-mobile');\n this.doc.body.style.setProperty(\n '--t-root-top',\n `calc(${tuiPx(offsetTop - rect.top)} + ${topMargin})`,\n );\n }\n\n private get focused(): boolean {\n return this.dropdown.el.contains(tuiGetNativeFocused(this.doc));\n }\n}\n","<div\n *ngIf=\"directive.tuiDropdownMobile\"\n waIntersectionObserver\n waIntersectionThreshold=\"1\"\n class=\"t-filler\"\n (touchstart.prevent)=\"close()\"\n (waIntersectionObservee)=\"$event[0] && onIntersection($event[0])\"\n></div>\n<div\n #container\n class=\"t-container\"\n (tuiSwipe)=\"onSwipe($event, container)\"\n>\n <h2\n *ngIf=\"directive.tuiDropdownMobile\"\n class=\"t-heading\"\n >\n {{ directive.tuiDropdownMobile }}\n </h2>\n <div class=\"t-content\">\n <ng-container *polymorpheusOutlet=\"dropdown._content() as text; context: {$implicit: close}\">\n {{ text }}\n </ng-container>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAOA,MAiBa,iBAAiB,CAAA;AAjB9B,IAAA,WAAA,GAAA;AAkBqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QAG3C,IAAiB,CAAA,iBAAA,GAAG,EAAE,CAAC;AAejC,KAAA;AAba,IAAA,WAAW,CAAC,KAAiB,EAAA;QACnC,IACI,CAAC,IAAI,CAAC,QAAQ;AACd,YAAA,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC;AAC/B,YAAA,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,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AA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,sBAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,OAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;4FAenC,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAlBtC,SAAS;iCACM,IAAI,EAAA,QAAA,EACN,qBAAqB,EAAA,OAAA,EACtB,CAAC,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,sBAAsB,CAAC,EAAA,aAAA,EAGtD,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAC/B,cAAA,EAAA,CAAC,aAAa,EAAE,WAAW,CAAC,EACtC,IAAA,EAAA;AACF,wBAAA,gBAAgB,EAAE,6BAA6B;AAC/C,wBAAA,mCAAmC,EAAE,iBAAiB;AACtD,wBAAA,kCAAkC,EAC9B,8CAA8C;AAClD,wBAAA,kCAAkC,EAAE,wBAAwB;AAC5D,wBAAA,kCAAkC,EAAE,wBAAwB;AAC/D,qBAAA,EAAA,QAAA,EAAA,osBAAA,EAAA,MAAA,EAAA,CAAA,w2GAAA,CAAA,EAAA,CAAA;;;AExCL;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/addon-mobile",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.44.0-canary.ef702cb",
|
|
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",
|
|
@@ -39,6 +39,12 @@
|
|
|
39
39
|
"esm": "./esm2022/services/taiga-ui-addon-mobile-services.mjs",
|
|
40
40
|
"default": "./fesm2022/taiga-ui-addon-mobile-services.mjs"
|
|
41
41
|
},
|
|
42
|
+
"./components/bottom-sheet": {
|
|
43
|
+
"types": "./components/bottom-sheet/index.d.ts",
|
|
44
|
+
"esm2022": "./esm2022/components/bottom-sheet/taiga-ui-addon-mobile-components-bottom-sheet.mjs",
|
|
45
|
+
"esm": "./esm2022/components/bottom-sheet/taiga-ui-addon-mobile-components-bottom-sheet.mjs",
|
|
46
|
+
"default": "./fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs"
|
|
47
|
+
},
|
|
42
48
|
"./components/mobile-calendar": {
|
|
43
49
|
"types": "./components/mobile-calendar/index.d.ts",
|
|
44
50
|
"esm2022": "./esm2022/components/mobile-calendar/taiga-ui-addon-mobile-components-mobile-calendar.mjs",
|
|
@@ -51,12 +57,6 @@
|
|
|
51
57
|
"esm": "./esm2022/components/mobile-calendar-dropdown/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs",
|
|
52
58
|
"default": "./fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs"
|
|
53
59
|
},
|
|
54
|
-
"./components/bottom-sheet": {
|
|
55
|
-
"types": "./components/bottom-sheet/index.d.ts",
|
|
56
|
-
"esm2022": "./esm2022/components/bottom-sheet/taiga-ui-addon-mobile-components-bottom-sheet.mjs",
|
|
57
|
-
"esm": "./esm2022/components/bottom-sheet/taiga-ui-addon-mobile-components-bottom-sheet.mjs",
|
|
58
|
-
"default": "./fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs"
|
|
59
|
-
},
|
|
60
60
|
"./components/mobile-calendar-sheet": {
|
|
61
61
|
"types": "./components/mobile-calendar-sheet/index.d.ts",
|
|
62
62
|
"esm2022": "./esm2022/components/mobile-calendar-sheet/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs",
|
|
@@ -135,10 +135,10 @@
|
|
|
135
135
|
"@angular/common": ">=16.0.0",
|
|
136
136
|
"@angular/core": ">=16.0.0",
|
|
137
137
|
"@ng-web-apis/common": "^4.12.0",
|
|
138
|
-
"@taiga-ui/cdk": "^4.
|
|
139
|
-
"@taiga-ui/core": "^4.
|
|
140
|
-
"@taiga-ui/kit": "^4.
|
|
141
|
-
"@taiga-ui/layout": "^4.
|
|
138
|
+
"@taiga-ui/cdk": "^4.44.0",
|
|
139
|
+
"@taiga-ui/core": "^4.44.0",
|
|
140
|
+
"@taiga-ui/kit": "^4.44.0",
|
|
141
|
+
"@taiga-ui/layout": "^4.44.0",
|
|
142
142
|
"@taiga-ui/polymorpheus": "^4.9.0",
|
|
143
143
|
"rxjs": ">=7.0.0"
|
|
144
144
|
},
|
|
@@ -30,6 +30,8 @@ input[tuiCheckbox] {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&::before {
|
|
33
|
+
inline-size: 1rem;
|
|
34
|
+
block-size: 1rem;
|
|
33
35
|
mask-image: url('data:image/svg+xml,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 13L1 8.19231L2.4 6.84615L6 10.3077L13.6 3L15 4.34615L6 13Z" fill="black"/></svg>');
|
|
34
36
|
transition:
|
|
35
37
|
clip-path var(--tui-duration) ease-in-out,
|
|
@@ -44,9 +46,4 @@ input[tuiCheckbox] {
|
|
|
44
46
|
&:invalid {
|
|
45
47
|
outline-color: var(--tui-status-negative-pale-hover);
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
&[data-size='s']::before {
|
|
49
|
-
inline-size: 1rem;
|
|
50
|
-
block-size: 1rem;
|
|
51
|
-
}
|
|
52
49
|
}
|
|
@@ -2,19 +2,19 @@ tui-block-status {
|
|
|
2
2
|
padding: 2rem;
|
|
3
3
|
|
|
4
4
|
.t-block-image:not(:empty) {
|
|
5
|
-
margin-
|
|
5
|
+
margin-block-end: 1.5rem;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.t-block-actions:not(:empty) {
|
|
9
|
-
margin-
|
|
9
|
+
margin-block-start: 1.5rem;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
&._card {
|
|
13
13
|
padding: 1.25rem;
|
|
14
14
|
|
|
15
15
|
& .t-block-image {
|
|
16
|
-
margin-
|
|
17
|
-
margin-
|
|
16
|
+
margin-block-start: 0.75rem;
|
|
17
|
+
margin-block-end: 1rem;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -27,7 +27,7 @@ tui-block-status {
|
|
|
27
27
|
font: var(--tui-font-heading-5);
|
|
28
28
|
|
|
29
29
|
& ~ .t-block-text:not(:empty) {
|
|
30
|
-
margin-
|
|
30
|
+
margin-block-start: 0.5rem;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -38,6 +38,6 @@ tui-block-status {
|
|
|
38
38
|
|
|
39
39
|
a:not(:last-child),
|
|
40
40
|
button:not(:last-child) {
|
|
41
|
-
margin-
|
|
41
|
+
margin-block-end: 0.5rem;
|
|
42
42
|
}
|
|
43
43
|
}
|
package/styles/ios/checkbox.less
CHANGED
|
@@ -35,6 +35,8 @@ input[tuiRadio] {
|
|
|
35
35
|
--t-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" preserveAspectRatio="xMidYMid meet" height="100%" width="100%"><path d="M12.3368 4.33683C12.7859 3.88772 13.5141 3.88772 13.9632 4.33683C14.4123 4.78593 14.4123 5.51407 13.9632 5.96317L6.96317 12.9632C6.51407 13.4123 5.78593 13.4123 5.33683 12.9632L2.33683 9.96317C1.88772 9.51407 1.88772 8.78593 2.33683 8.33683C2.78593 7.88772 3.51407 7.88772 3.96317 8.33683L6.15 10.5237L12.3368 4.33683Z" fill="black"/></svg>');
|
|
36
36
|
|
|
37
37
|
display: none;
|
|
38
|
+
inline-size: 1rem;
|
|
39
|
+
block-size: 1rem;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
&:not([tuiRadio]):indeterminate::before {
|
|
@@ -44,9 +46,4 @@ input[tuiRadio] {
|
|
|
44
46
|
&:invalid {
|
|
45
47
|
outline-color: var(--tui-status-negative-pale-hover);
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
&[data-size='s']::before {
|
|
49
|
-
inline-size: 1rem;
|
|
50
|
-
block-size: 1rem;
|
|
51
|
-
}
|
|
52
49
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { TuiControl } from '@taiga-ui/cdk/classes';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TuiOptionMobile<T> {
|
|
4
|
-
private readonly host;
|
|
5
|
-
private readonly itemsHandlers;
|
|
6
|
-
private readonly option;
|
|
7
|
-
private readonly control;
|
|
8
|
-
protected readonly select: import("@angular/core").Signal<TuiControl<T> | null>;
|
|
9
|
-
protected readonly selected: import("@angular/core").Signal<boolean>;
|
|
10
|
-
protected onClick(): void;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiOptionMobile<any>, never>;
|
|
12
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TuiOptionMobile<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
13
|
-
}
|