@taiga-ui/kit 4.52.0-canary.763e67d → 4.52.0-canary.7c53ccc
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/avatar/avatar-labeled.component.d.ts +1 -1
- package/components/badged-content/badged-content.directive.d.ts +1 -2
- package/components/breadcrumbs/breadcrumbs.component.d.ts +2 -2
- package/components/calendar-range/calendar-range.component.d.ts +0 -1
- package/components/carousel/carousel-autoscroll.directive.d.ts +1 -2
- package/components/carousel/carousel-scroll.directive.d.ts +1 -1
- package/components/carousel/carousel.component.d.ts +5 -8
- package/components/carousel/carousel.directive.d.ts +2 -1
- package/components/copy/copy.component.d.ts +0 -1
- package/components/files/file/file.component.d.ts +4 -16
- package/components/files/files/files.component.d.ts +1 -3
- package/components/files/input-files/input-files.component.d.ts +2 -2
- package/components/files/input-files/input-files.content.d.ts +7 -8
- package/components/files/input-files/input-files.directive.d.ts +1 -2
- package/components/filter/filter.component.d.ts +6 -7
- package/components/fullscreen/fullscreen.component.d.ts +2 -2
- package/components/input-color/input-color.component.d.ts +5 -9
- package/components/input-date/input-date.component.d.ts +2 -2
- package/components/input-date/input-date.directive.d.ts +12 -11
- package/components/input-date-multi/input-date-multi.directive.d.ts +1 -1
- package/components/input-date-range/input-date-range.directive.d.ts +5 -3
- package/components/input-date-time/input-date-time.directive.d.ts +9 -9
- package/components/input-inline/input-inline.component.d.ts +3 -2
- package/components/input-month/input-month.component.d.ts +3 -5
- package/components/input-number/input-number.directive.d.ts +4 -6
- package/components/input-number/input-number.options.d.ts +2 -3
- package/components/input-number/step/input-number-step.component.d.ts +3 -3
- package/components/input-phone/input-phone.directive.d.ts +6 -8
- package/components/input-phone-international/input-phone-international.component.d.ts +8 -10
- package/components/input-phone-international/input-phone-international.options.d.ts +1 -0
- package/components/input-pin/input-pin.component.d.ts +3 -4
- package/components/input-range/input-range.component.d.ts +21 -51
- package/components/input-time/input-time.directive.d.ts +1 -1
- package/components/input-year/input-year.directive.d.ts +4 -6
- package/components/items-with-more/items-with-more.component.d.ts +6 -6
- package/components/items-with-more/items-with-more.directive.d.ts +6 -6
- package/components/multi-select/multi-select-native/multi-select-native.component.d.ts +5 -4
- package/components/pager/pager.component.d.ts +12 -12
- package/components/preview/pagination/preview-pagination.component.d.ts +4 -9
- package/components/preview/preview.component.d.ts +5 -5
- package/components/preview/zoom/preview-zoom.component.d.ts +8 -16
- package/components/progress/progress-circle/progress-circle.component.d.ts +7 -11
- package/components/push/push.component.d.ts +6 -7
- package/components/radio-list/radio-list.component.d.ts +9 -9
- package/components/range/range.component.d.ts +3 -4
- package/components/slider/helpers/slider-key-steps.directive.d.ts +6 -5
- package/components/slider/helpers/slider-readonly.directive.d.ts +2 -4
- package/components/slider/helpers/slider-thumb-label.component.d.ts +2 -4
- package/components/slider/slider.component.d.ts +4 -7
- package/components/stepper/step.component.d.ts +9 -2
- package/components/stepper/stepper.component.d.ts +1 -3
- package/components/tabs/tabs-horizontal.directive.d.ts +3 -4
- package/components/tabs/tabs-vertical.directive.d.ts +2 -2
- package/components/tabs/tabs-with-more.component.d.ts +12 -16
- package/components/tabs/tabs.directive.d.ts +5 -7
- package/components/textarea/textarea.component.d.ts +7 -8
- package/components/tiles/tile.component.d.ts +7 -10
- package/components/tiles/tile.service.d.ts +1 -1
- package/components/tiles/tiles.component.d.ts +4 -7
- package/components/tree/components/tree/tree.component.d.ts +7 -7
- package/components/tree/components/tree-item/tree-item.component.d.ts +1 -1
- package/components/tree/directives/tree-children.directive.d.ts +2 -2
- package/components/tree/directives/tree-controller.directive.d.ts +4 -5
- package/components/tree/directives/tree-item-controller.directive.d.ts +2 -2
- package/components/tree/directives/tree-node.directive.d.ts +5 -4
- package/directives/appearance-proxy/appearance-proxy.directive.d.ts +10 -0
- package/directives/appearance-proxy/index.d.ts +1 -0
- package/directives/highlight/highlight.directive.d.ts +6 -5
- package/directives/index.d.ts +1 -0
- package/directives/present/present.directive.d.ts +2 -3
- package/fesm2022/taiga-ui-kit-components-accordion.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-action-bar.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-avatar.mjs +9 -19
- package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge-notification.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-badge.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-badged-content.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-block.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs +6 -11
- package/fesm2022/taiga-ui-kit-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-button-loading.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-calendar-month.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +2 -10
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-carousel.mjs +31 -52
- package/fesm2022/taiga-ui-kit-components-carousel.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-chip.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-comment.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-confirm.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-copy.mjs +3 -8
- package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-data-list-wrapper.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-drawer.mjs +3 -13
- package/fesm2022/taiga-ui-kit-components-drawer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs +72 -154
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-filter.mjs +13 -12
- package/fesm2022/taiga-ui-kit-components-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-fullscreen.mjs +5 -6
- package/fesm2022/taiga-ui-kit-components-fullscreen.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs +1 -10
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-color.mjs +5 -17
- package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +9 -3
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +10 -29
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +14 -24
- package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs +8 -10
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +8 -24
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +21 -27
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +28 -44
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs +10 -25
- package/fesm2022/taiga-ui-kit-components-input-phone.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +7 -14
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-range.mjs +34 -59
- package/fesm2022/taiga-ui-kit-components-input-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs +5 -19
- package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-items-with-more.mjs +39 -59
- package/fesm2022/taiga-ui-kit-components-items-with-more.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-message.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs +14 -19
- package/fesm2022/taiga-ui-kit-components-multi-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-notification-middle.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-pager.mjs +27 -39
- package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pagination.mjs +10 -14
- package/fesm2022/taiga-ui-kit-components-pagination.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pin.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-preview.mjs +39 -119
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs +17 -32
- package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pulse.mjs +1 -3
- package/fesm2022/taiga-ui-kit-components-pulse.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-push.mjs +9 -21
- package/fesm2022/taiga-ui-kit-components-push.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs +19 -31
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-range.mjs +14 -24
- package/fesm2022/taiga-ui-kit-components-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-segmented.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-slider.mjs +37 -55
- package/fesm2022/taiga-ui-kit-components-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-stepper.mjs +32 -25
- package/fesm2022/taiga-ui-kit-components-stepper.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-switch.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tabs.mjs +56 -111
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +13 -25
- package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tiles.mjs +26 -58
- package/fesm2022/taiga-ui-kit-components-tiles.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-toast.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tree.mjs +41 -72
- package/fesm2022/taiga-ui-kit-components-tree.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs +27 -0
- package/fesm2022/taiga-ui-kit-directives-appearance-proxy.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-connected.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-highlight.mjs +17 -13
- package/fesm2022/taiga-ui-kit-directives-highlight.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-present.mjs +7 -10
- package/fesm2022/taiga-ui-kit-directives-present.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-unmask-handler.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives.mjs +1 -0
- package/fesm2022/taiga-ui-kit-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-pipes-flag.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-tokens.mjs +2 -26
- package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
- package/package.json +26 -22
- package/pipes/flag/flag.pipe.d.ts +1 -2
- package/styles/components/avatar.less +14 -14
- package/styles/components/badge.less +3 -3
- package/styles/components/block.less +4 -4
- package/styles/components/chip.less +3 -3
- package/styles/components/comment.less +1 -1
- package/styles/components/message.less +1 -1
- package/styles/components/pin.less +3 -3
- package/styles/components/switch.less +1 -0
- package/styles/components/toast.less +1 -1
- package/tokens/index.d.ts +0 -1
- package/utils/maskito.binding.d.ts +1 -1
- package/tokens/calendar-date-stream.d.ts +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-stepper.mjs","sources":["../../../projects/kit/components/stepper/stepper.component.ts","../../../projects/kit/components/stepper/step.component.ts","../../../projects/kit/components/stepper/step.template.html","../../../projects/kit/components/stepper/stepper.ts","../../../projects/kit/components/stepper/taiga-ui-kit-components-stepper.ts"],"sourcesContent":["import {AsyncPipe} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n contentChildren,\n ElementRef,\n forwardRef,\n inject,\n input,\n model,\n type OnChanges,\n} from '@angular/core';\nimport {takeUntilDestroyed, toObservable} from '@angular/core/rxjs-interop';\nimport {ResizeObserverService} from '@ng-web-apis/resize-observer';\nimport {tuiInjectElement, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiMoveFocus} from '@taiga-ui/cdk/utils/focus';\nimport {type TuiOrientation} from '@taiga-ui/core/types';\nimport {delay} from 'rxjs';\n\nimport {TuiStep} from './step.component';\n\n@Component({\n selector: 'tui-stepper, nav[tuiStepper]',\n imports: [AsyncPipe],\n template: `\n @if (changes$ | async) {}\n <ng-content />\n `,\n styleUrl: './stepper.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [ResizeObserverService],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '(keydown.arrowRight)': 'onHorizontal($event, 1)',\n '(keydown.arrowLeft)': 'onHorizontal($event, -1)',\n '(keydown.arrowDown)': 'onVertical($event, 1)',\n '(keydown.arrowUp)': 'onVertical($event, -1)',\n },\n})\nexport class TuiStepperComponent implements OnChanges {\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly el = tuiInjectElement();\n private readonly steps = contentChildren(\n forwardRef(() => TuiStep),\n {read: ElementRef},\n );\n\n // Delay is required to trigger change detection after steps are rendered,\n // so they can update their \"active\" status\n protected readonly changes$ = toObservable(this.steps).pipe(delay(0));\n protected readonly $ = inject(ResizeObserverService, {self: true})\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.scrollIntoView(this.activeItemIndex()));\n\n public readonly orientation = input<TuiOrientation>('horizontal');\n public readonly activeItemIndex = model(0);\n\n public ngOnChanges(): void {\n this.scrollIntoView(this.activeItemIndex());\n }\n\n public indexOf(step: HTMLElement): number {\n const index = this.steps().findIndex(({nativeElement}) => nativeElement === step);\n\n return index < 0 ? NaN : index;\n }\n\n public isActive(index: number): boolean {\n return index === this.activeItemIndex();\n }\n\n public activate(index: number): void {\n if (this.activeItemIndex() === index) {\n return;\n }\n\n this.activeItemIndex.set(index);\n this.cdr.markForCheck();\n this.scrollIntoView(index);\n }\n\n protected onHorizontal(event: Event, step: number): void {\n if (this.orientation() !== 'horizontal' || !event.target) {\n return;\n }\n\n event.preventDefault();\n this.moveFocus(event.target, step);\n }\n\n protected onVertical(event: Event, step: number): void {\n if (this.orientation() !== 'vertical' || !event.target) {\n return;\n }\n\n event.preventDefault();\n this.moveFocus(event.target, step);\n }\n\n private moveFocus(current: EventTarget, step: number): void {\n if (!tuiIsElement(current)) {\n return;\n }\n\n const stepElements = this.steps().map(({nativeElement}) => nativeElement);\n const index = stepElements.findIndex((element) => element === current);\n\n tuiMoveFocus(index, stepElements, step);\n }\n\n private scrollIntoView(index: number): void {\n const step = this.steps()[index]?.nativeElement;\n\n if (!step) {\n return;\n }\n\n const {clientHeight, clientWidth, offsetTop, offsetLeft} = this.el;\n const {\n offsetHeight,\n offsetWidth,\n offsetTop: stepOffsetTop,\n offsetLeft: stepOffsetLeft,\n } = step;\n const top = stepOffsetTop - offsetTop - clientHeight / 2 + offsetHeight / 2;\n const left = stepOffsetLeft - offsetLeft - clientWidth / 2 + offsetWidth / 2;\n\n this.el.scrollTo?.({left: Math.max(0, left), top: Math.max(0, top)});\n }\n}\n","import {ChangeDetectionStrategy, Component, inject, input} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {RouterLinkActive} from '@angular/router';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {EMPTY, filter} from 'rxjs';\n\nimport {TuiStepperComponent} from './stepper.component';\n\n@Component({\n selector:\n 'button[tuiStep], a[tuiStep]:not([routerLink]), a[tuiStep][routerLink][routerLinkActive]',\n imports: [TuiIcon],\n templateUrl: './step.template.html',\n styleUrl: './step.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n type: 'button',\n '[attr.data-state]': 'stepState()',\n '[class._vertical]': 'stepper.orientation() === \"vertical\"',\n '[class._active]': 'isActive',\n '[tabIndex]': 'isActive ? 0 : -1',\n '(click)': 'activate()',\n },\n})\nexport class TuiStep {\n private readonly el = tuiInjectElement();\n\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly stepper = inject(TuiStepperComponent);\n protected readonly $ = (\n inject(RouterLinkActive, {optional: true})?.isActiveChange.asObservable() ?? EMPTY\n )\n .pipe(filter(Boolean), takeUntilDestroyed())\n .subscribe(() => this.activate());\n\n public readonly stepState = input<'error' | 'normal' | 'pass'>('normal');\n public readonly icon = input('');\n\n protected get isActive(): boolean {\n return this.stepper.isActive(this.index);\n }\n\n protected get index(): number {\n return this.stepper.indexOf(this.el);\n }\n\n protected activate(): void {\n this.stepper.activate(this.index);\n }\n}\n","@if (icon()) {\n <tui-icon\n class=\"t-marker t-marker_custom\"\n [icon]=\"icon()\"\n />\n}\n<tui-icon\n class=\"t-marker t-marker_error\"\n [icon]=\"icons.error\"\n/>\n<tui-icon\n class=\"t-marker t-marker_pass\"\n [icon]=\"icons.check\"\n/>\n<div class=\"t-marker t-marker_index\"></div>\n<ng-content />\n","import {TuiStep} from './step.component';\nimport {TuiStepperComponent} from './stepper.component';\n\nexport const TuiStepper = [TuiStepperComponent, TuiStep] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAwCa,mBAAmB,CAAA;AAlBhC,IAAA,WAAA,GAAA;AAmBqB,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAC/B,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;AACvB,QAAA,IAAA,CAAA,KAAK,GAAG,eAAe,CACpC,UAAU,CAAC,MAAM,OAAO,CAAC,EACzB,EAAC,IAAI,EAAE,UAAU,EAAC,CACrB;;;AAIkB,QAAA,IAAA,CAAA,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClD,IAAC,CAAA,CAAA,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC;aAC5D,IAAI,CAAC,kBAAkB,EAAE;AACzB,aAAA,SAAS,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;AAEjD,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAiB,YAAY,CAAC;AACjD,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC;AA0E7C;IAxEU,WAAW,GAAA;QACd,IAAI,CAAC,cAAc,CAAC,I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,YAAY,EAAE,mBAAmB;AACjC,wBAAA,SAAS,EAAE,YAAY;AAC1B,qBAAA,EAAA,QAAA,EAAA,qVAAA,EAAA,MAAA,EAAA,CAAA,wuEAAA,CAAA,EAAA;;;MErBQ,UAAU,GAAG,CAAC,mBAAmB,EAAE,OAAO;;ACHvD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-stepper.mjs","sources":["../../../projects/kit/components/stepper/stepper.component.ts","../../../projects/kit/components/stepper/step.component.ts","../../../projects/kit/components/stepper/step.template.html","../../../projects/kit/components/stepper/stepper.ts","../../../projects/kit/components/stepper/taiga-ui-kit-components-stepper.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n ElementRef,\n forwardRef,\n inject,\n input,\n model,\n type OnChanges,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ResizeObserverService} from '@ng-web-apis/resize-observer';\nimport {tuiInjectElement, tuiIsElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiMoveFocus} from '@taiga-ui/cdk/utils/focus';\nimport {type TuiOrientation} from '@taiga-ui/core/types';\n\nimport {TuiStep} from './step.component';\n\n@Component({\n selector: 'tui-stepper, nav[tuiStepper]',\n template: `\n <ng-content />\n `,\n styleUrl: './stepper.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [ResizeObserverService],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '(keydown.arrowRight)': 'onHorizontal($event, 1)',\n '(keydown.arrowLeft)': 'onHorizontal($event, -1)',\n '(keydown.arrowDown)': 'onVertical($event, 1)',\n '(keydown.arrowUp)': 'onVertical($event, -1)',\n },\n})\nexport class TuiStepperComponent implements OnChanges {\n private readonly el = tuiInjectElement();\n private readonly steps = contentChildren(\n forwardRef(() => TuiStep),\n {read: ElementRef},\n );\n\n protected readonly $ = inject(ResizeObserverService, {self: true})\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.scrollIntoView(this.activeItemIndex()));\n\n public readonly orientation = input<TuiOrientation>('horizontal');\n public readonly activeItemIndex = model(0);\n\n public ngOnChanges(): void {\n this.scrollIntoView(this.activeItemIndex());\n }\n\n public indexOf(step: HTMLElement): number {\n const index = this.steps().findIndex(({nativeElement}) => nativeElement === step);\n\n return index < 0 ? NaN : index;\n }\n\n public isActive(index: number): boolean {\n return index === this.activeItemIndex();\n }\n\n public activate(index: number): void {\n if (this.activeItemIndex() === index) {\n return;\n }\n\n this.activeItemIndex.set(index);\n this.scrollIntoView(index);\n }\n\n protected onHorizontal(event: Event, step: number): void {\n if (this.orientation() !== 'horizontal' || !event.target) {\n return;\n }\n\n event.preventDefault();\n this.moveFocus(event.target, step);\n }\n\n protected onVertical(event: Event, step: number): void {\n if (this.orientation() !== 'vertical' || !event.target) {\n return;\n }\n\n event.preventDefault();\n this.moveFocus(event.target, step);\n }\n\n private moveFocus(current: EventTarget, step: number): void {\n if (!tuiIsElement(current)) {\n return;\n }\n\n const stepElements = this.steps().map(({nativeElement}) => nativeElement);\n const index = stepElements.findIndex((element) => element === current);\n\n tuiMoveFocus(index, stepElements, step);\n }\n\n private scrollIntoView(index: number): void {\n const step = this.steps()[index]?.nativeElement;\n\n if (!step) {\n return;\n }\n\n const {clientHeight, clientWidth, offsetTop, offsetLeft} = this.el;\n const {\n offsetHeight,\n offsetWidth,\n offsetTop: stepOffsetTop,\n offsetLeft: stepOffsetLeft,\n } = step;\n const top = stepOffsetTop - offsetTop - clientHeight / 2 + offsetHeight / 2;\n const left = stepOffsetLeft - offsetLeft - clientWidth / 2 + offsetWidth / 2;\n\n this.el.scrollTo?.({left: Math.max(0, left), top: Math.max(0, top)});\n }\n}\n","import {ChangeDetectionStrategy, Component, computed, inject, input} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {RouterLinkActive} from '@angular/router';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/di';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TuiCell} from '@taiga-ui/core/components/cell';\nimport {tuiAppearance, TuiWithAppearance} from '@taiga-ui/core/directives/appearance';\nimport {TUI_COMMON_ICONS} from '@taiga-ui/core/tokens';\nimport {TuiAvatar} from '@taiga-ui/kit/components/avatar';\nimport {EMPTY, filter} from 'rxjs';\n\nimport {TuiStepperComponent} from './stepper.component';\n\n@Component({\n selector:\n 'button[tuiStep], a[tuiStep]:not([routerLink]), a[tuiStep][routerLink][routerLinkActive]',\n imports: [TuiAvatar],\n templateUrl: './step.template.html',\n styleUrl: './step.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiCell, TuiWithAppearance],\n host: {\n type: 'button',\n '[tabIndex]': 'isActive() ? 0 : -1',\n '[class._active]': 'isActive()',\n '[class._vertical]': 'stepper.orientation() === \"vertical\"',\n '(click)': 'activate()',\n },\n})\nexport class TuiStep {\n private readonly el = tuiInjectElement();\n protected readonly icons = inject(TUI_COMMON_ICONS);\n protected readonly appearance = tuiAppearance(\n computed(() => (this.isActive() ? 'none' : 'action')),\n );\n\n protected readonly size = tuiDirectiveBinding(TuiCell, 'size', 'm');\n\n protected readonly stepper = inject(TuiStepperComponent);\n protected readonly $ = (\n inject(RouterLinkActive, {optional: true})?.isActiveChange.asObservable() ?? EMPTY\n )\n .pipe(filter(Boolean), takeUntilDestroyed())\n .subscribe(() => this.activate());\n\n public readonly stepState = input<'error' | 'normal' | 'pass'>('normal');\n public readonly icon = input('');\n\n protected readonly isActive = computed(\n () => this.stepper.activeItemIndex() === this.index,\n );\n\n protected avatarAppearance = computed(() => {\n if (this.isActive()) {\n return 'primary';\n }\n\n return this.stepState() === 'error' ? 'negative' : 'secondary';\n });\n\n protected readonly avatarContent = computed(() =>\n this.isActive() || (this.stepState() === 'normal' && !this.icon())\n ? `${this.index + 1}`\n : this.avatarIcon(),\n );\n\n protected readonly avatarIcon = computed(\n () =>\n this.icon() ||\n (this.stepState() === 'error' ? this.icons.error : this.icons.check),\n );\n\n protected get index(): number {\n return this.stepper.indexOf(this.el);\n }\n\n protected activate(): void {\n this.stepper.activate(this.index);\n }\n}\n","<div\n [appearance]=\"avatarAppearance()\"\n [tuiAvatar]=\"avatarContent()\"\n></div>\n<ng-content />\n","import {TuiStep} from './step.component';\nimport {TuiStepperComponent} from './stepper.component';\n\nexport const TuiStepper = [TuiStepperComponent, TuiStep] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAmCa,mBAAmB,CAAA;AAhBhC,IAAA,WAAA,GAAA;QAiBqB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;AACvB,QAAA,IAAA,CAAA,KAAK,GAAG,eAAe,CACpC,UAAU,CAAC,MAAM,OAAO,CAAC,EACzB,EAAC,IAAI,EAAE,UAAU,EAAC,CACrB;QAEkB,IAAC,CAAA,CAAA,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC;aAC5D,IAAI,CAAC,kBAAkB,EAAE;AACzB,aAAA,SAAS,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;AAEjD,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAiB,YAAY,CAAC;AACjD,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC;AAyE7C;IAvEU,WAAW,GAAA;QACd,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;;AAGxC,IAAA,OAAO,CAAC,IAAiB,EAAA;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC,EAAC,aAAa,EAAC,KAAK,aAAa,KAAK,IAAI,CAAC;QAEjF,OAAO,KAAK,GAAG,CAAC,GAAG,GAAG,GAAG,KAAK;;AAG3B,IAAA,QAAQ,CAAC,KAAa,EAAA;AACzB,QAAA,OAAO,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A,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDWc,SAAS,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAaV,OAAO,EAAA,UAAA,EAAA,CAAA;kBAhBnB,SAAS;AAEF,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yFAAyF,EACpF,OAAA,EAAA,CAAC,SAAS,CAAC,mBAGH,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/B,CAAC,OAAO,EAAE,iBAAiB,CAAC,EACtC,IAAA,EAAA;AACF,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,YAAY,EAAE,qBAAqB;AACnC,wBAAA,iBAAiB,EAAE,YAAY;AAC/B,wBAAA,mBAAmB,EAAE,sCAAsC;AAC3D,wBAAA,SAAS,EAAE,YAAY;AAC1B,qBAAA,EAAA,QAAA,EAAA,+GAAA,EAAA,MAAA,EAAA,CAAA,gZAAA,CAAA,EAAA;;;MExBQ,UAAU,GAAG,CAAC,mBAAmB,EAAE,OAAO;;ACHvD;;AAEG;;;;"}
|
|
@@ -20,7 +20,7 @@ class TuiSwitch extends TuiRadioComponent {
|
|
|
20
20
|
this.showIcons = input(this.options.showIcons);
|
|
21
21
|
}
|
|
22
22
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSwitch, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
23
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.17", type: TuiSwitch, isStandalone: true, selector: "input[type=\"checkbox\"][tuiSwitch]", inputs: { showIcons: { classPropertyName: "showIcons", publicName: "showIcons", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "switch": "", "role": "switch" }, properties: { "class._native": "native" } }, providers: [tuiProvide(TUI_RADIO_OPTIONS, TUI_SWITCH_OPTIONS)], usesInheritance: true, hostDirectives: [{ directive: i1.TuiIcons }], ngImport: i0, template: '', isInline: true, styles: ["[tuiSwitch]{transition-property:background,box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;inline-size:3rem;block-size:1.5rem;border-radius:2rem;overflow:hidden;cursor:pointer;margin:0;flex-shrink:0;color:#fff!important}[tuiSwitch][data-size=s]{block-size:1rem;inline-size:2rem}[tuiSwitch][data-size=s]:before{inline-size:1rem;transform:translate(-1rem);font-size:.75rem}[tuiSwitch][data-size=s]:after{inline-size:1rem;box-shadow:-2.625rem 0 0 .5rem var(--tui-background-base);outline-width:.167rem;transform:scale(.375)}[tuiSwitch][data-size=s]:checked:after{transform:scale(.375) translate(2.625rem)}[tuiSwitch]:checked:before{transform:none}[tuiSwitch]:checked:after{transform:scale(.33333) translate(4.5rem)}[tuiSwitch]:disabled._readonly._readonly{opacity:1}[tuiSwitch]:before,[tuiSwitch]:after{position:absolute;block-size:100%;inline-size:1.5rem;transition-property:transform}[tuiSwitch]:before{left:.125rem;font-size:1rem;transform:translate(-1.5rem)}[tuiSwitch]:after{right:0;display:block;border-radius:100%;background:none;transform:scale(.33333);box-shadow:-4.5rem 0 0 .75rem var(--tui-background-base);outline:.375rem solid var(--tui-background-neutral-2-pressed)}[tuiSwitch]:not([data-icon-start]):after{outline-offset:20rem}[tuiSwitch]:invalid:not([data-mode]),[tuiSwitch][data-mode~=invalid]{color:#fff}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
23
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.17", type: TuiSwitch, isStandalone: true, selector: "input[type=\"checkbox\"][tuiSwitch]", inputs: { showIcons: { classPropertyName: "showIcons", publicName: "showIcons", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "switch": "", "role": "switch" }, properties: { "class._native": "native" } }, providers: [tuiProvide(TUI_RADIO_OPTIONS, TUI_SWITCH_OPTIONS)], usesInheritance: true, hostDirectives: [{ directive: i1.TuiIcons }], ngImport: i0, template: '', isInline: true, styles: ["[tuiSwitch]{transition-property:background,box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:inline-block;inline-size:3rem;block-size:1.5rem;border-radius:2rem;overflow:hidden;cursor:pointer;margin:0;flex-shrink:0;color:#fff!important}[tuiSwitch][data-size=s]{block-size:1rem;inline-size:2rem}[tuiSwitch][data-size=s]:before{inline-size:1rem;transform:translate(-1rem);font-size:.75rem}[tuiSwitch][data-size=s]:after{inline-size:1rem;box-shadow:-2.625rem 0 0 .5rem var(--tui-background-base);outline-width:.167rem;transform:scale(.375)}[tuiSwitch][data-size=s]:checked:after{transform:scale(.375) translate(2.625rem)}[tuiSwitch]:checked:before{transform:none}[tuiSwitch]:checked:after{transform:scale(.33333) translate(4.5rem)}[tuiSwitch]:disabled._readonly._readonly{opacity:1}[tuiSwitch]:before,[tuiSwitch]:after{position:absolute;block-size:100%;inline-size:1.5rem;transition-property:transform}[tuiSwitch]:before{left:.125rem;font-size:1rem;transform:translate(-1.5rem)}[tuiSwitch]:after{right:0;display:block;border-radius:100%;background:none;transform:scale(.33333);box-shadow:-4.5rem 0 0 .75rem var(--tui-background-base);outline:.375rem solid var(--tui-background-neutral-2-pressed)}[tuiSwitch]:not([data-icon-start]):after{outline-offset:20rem}[tuiSwitch]:invalid:not([data-mode]),[tuiSwitch][data-mode~=invalid]{color:#fff}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
24
24
|
}
|
|
25
25
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiSwitch, decorators: [{
|
|
26
26
|
type: Component,
|
|
@@ -28,7 +28,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
28
28
|
switch: '',
|
|
29
29
|
role: 'switch',
|
|
30
30
|
'[class._native]': 'native',
|
|
31
|
-
}, styles: ["[tuiSwitch]{transition-property:background,box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;inline-size:3rem;block-size:1.5rem;border-radius:2rem;overflow:hidden;cursor:pointer;margin:0;flex-shrink:0;color:#fff!important}[tuiSwitch][data-size=s]{block-size:1rem;inline-size:2rem}[tuiSwitch][data-size=s]:before{inline-size:1rem;transform:translate(-1rem);font-size:.75rem}[tuiSwitch][data-size=s]:after{inline-size:1rem;box-shadow:-2.625rem 0 0 .5rem var(--tui-background-base);outline-width:.167rem;transform:scale(.375)}[tuiSwitch][data-size=s]:checked:after{transform:scale(.375) translate(2.625rem)}[tuiSwitch]:checked:before{transform:none}[tuiSwitch]:checked:after{transform:scale(.33333) translate(4.5rem)}[tuiSwitch]:disabled._readonly._readonly{opacity:1}[tuiSwitch]:before,[tuiSwitch]:after{position:absolute;block-size:100%;inline-size:1.5rem;transition-property:transform}[tuiSwitch]:before{left:.125rem;font-size:1rem;transform:translate(-1.5rem)}[tuiSwitch]:after{right:0;display:block;border-radius:100%;background:none;transform:scale(.33333);box-shadow:-4.5rem 0 0 .75rem var(--tui-background-base);outline:.375rem solid var(--tui-background-neutral-2-pressed)}[tuiSwitch]:not([data-icon-start]):after{outline-offset:20rem}[tuiSwitch]:invalid:not([data-mode]),[tuiSwitch][data-mode~=invalid]{color:#fff}\n"] }]
|
|
31
|
+
}, styles: ["[tuiSwitch]{transition-property:background,box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:inline-block;inline-size:3rem;block-size:1.5rem;border-radius:2rem;overflow:hidden;cursor:pointer;margin:0;flex-shrink:0;color:#fff!important}[tuiSwitch][data-size=s]{block-size:1rem;inline-size:2rem}[tuiSwitch][data-size=s]:before{inline-size:1rem;transform:translate(-1rem);font-size:.75rem}[tuiSwitch][data-size=s]:after{inline-size:1rem;box-shadow:-2.625rem 0 0 .5rem var(--tui-background-base);outline-width:.167rem;transform:scale(.375)}[tuiSwitch][data-size=s]:checked:after{transform:scale(.375) translate(2.625rem)}[tuiSwitch]:checked:before{transform:none}[tuiSwitch]:checked:after{transform:scale(.33333) translate(4.5rem)}[tuiSwitch]:disabled._readonly._readonly{opacity:1}[tuiSwitch]:before,[tuiSwitch]:after{position:absolute;block-size:100%;inline-size:1.5rem;transition-property:transform}[tuiSwitch]:before{left:.125rem;font-size:1rem;transform:translate(-1.5rem)}[tuiSwitch]:after{right:0;display:block;border-radius:100%;background:none;transform:scale(.33333);box-shadow:-4.5rem 0 0 .75rem var(--tui-background-base);outline:.375rem solid var(--tui-background-neutral-2-pressed)}[tuiSwitch]:not([data-icon-start]):after{outline-offset:20rem}[tuiSwitch]:invalid:not([data-mode]),[tuiSwitch][data-mode~=invalid]{color:#fff}\n"] }]
|
|
32
32
|
}] });
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-switch.mjs","sources":["../../../projects/kit/components/switch/switch.options.ts","../../../projects/kit/components/switch/switch.component.ts","../../../projects/kit/components/switch/taiga-ui-kit-components-switch.ts"],"sourcesContent":["import {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\nimport {type TuiRadioOptions} from '@taiga-ui/kit/components/radio';\n\nexport interface TuiSwitchOptions extends TuiRadioOptions {\n readonly showIcons: boolean;\n readonly icon: TuiStringHandler<TuiSizeS>;\n}\n\nexport const [TUI_SWITCH_OPTIONS, tuiSwitchOptionsProvider] =\n tuiCreateOptions<TuiSwitchOptions>({\n showIcons: true,\n size: 'm',\n icon: () => '@tui.check',\n appearance: ({checked}) => (checked ? 'primary' : 'secondary'),\n });\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/di';\nimport {TuiIcons, tuiIconStart} from '@taiga-ui/core/directives/icons';\nimport {TUI_RADIO_OPTIONS, TuiRadioComponent} from '@taiga-ui/kit/components/radio';\n\nimport {TUI_SWITCH_OPTIONS, type TuiSwitchOptions} from './switch.options';\n\n@Component({\n selector: 'input[type=\"checkbox\"][tuiSwitch]',\n template: '',\n styles: '@import \"@taiga-ui/kit/styles/components/switch.less\";',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiProvide(TUI_RADIO_OPTIONS, TUI_SWITCH_OPTIONS)],\n hostDirectives: [TuiIcons],\n host: {\n switch: '',\n role: 'switch',\n '[class._native]': 'native',\n },\n})\nexport class TuiSwitch extends TuiRadioComponent<TuiSwitchOptions> {\n protected readonly native = 'switch' in this.el;\n protected readonly icon = tuiIconStart(\n computed(() => (this.showIcons() ? this.options.icon(this.size()) : '')),\n );\n\n public readonly showIcons = input(this.options.showIcons);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAUa,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,GACvD,gBAAgB,CAAmB;AAC/B,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,IAAI,EAAE,MAAM,YAAY;AACxB,IAAA,UAAU,EAAE,CAAC,EAAC,OAAO,EAAC,MAAM,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AACjE,CAAA;;ACWC,MAAO,SAAU,SAAQ,iBAAmC,CAAA;AAdlE,IAAA,WAAA,GAAA;;AAeuB,QAAA,IAAA,CAAA,MAAM,GAAG,QAAQ,IAAI,IAAI,CAAC,EAAE;AAC5B,QAAA,IAAA,CAAA,IAAI,GAAG,YAAY,CAClC,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAC3E;QAEe,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;AAC5D;+GAPY,SAAS,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qCAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,SAAA,EARP,CAAC,UAAU,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,EAAA,eAAA,EAAA,IAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAJpD,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-switch.mjs","sources":["../../../projects/kit/components/switch/switch.options.ts","../../../projects/kit/components/switch/switch.component.ts","../../../projects/kit/components/switch/taiga-ui-kit-components-switch.ts"],"sourcesContent":["import {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\nimport {type TuiRadioOptions} from '@taiga-ui/kit/components/radio';\n\nexport interface TuiSwitchOptions extends TuiRadioOptions {\n readonly showIcons: boolean;\n readonly icon: TuiStringHandler<TuiSizeS>;\n}\n\nexport const [TUI_SWITCH_OPTIONS, tuiSwitchOptionsProvider] =\n tuiCreateOptions<TuiSwitchOptions>({\n showIcons: true,\n size: 'm',\n icon: () => '@tui.check',\n appearance: ({checked}) => (checked ? 'primary' : 'secondary'),\n });\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/di';\nimport {TuiIcons, tuiIconStart} from '@taiga-ui/core/directives/icons';\nimport {TUI_RADIO_OPTIONS, TuiRadioComponent} from '@taiga-ui/kit/components/radio';\n\nimport {TUI_SWITCH_OPTIONS, type TuiSwitchOptions} from './switch.options';\n\n@Component({\n selector: 'input[type=\"checkbox\"][tuiSwitch]',\n template: '',\n styles: '@import \"@taiga-ui/kit/styles/components/switch.less\";',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiProvide(TUI_RADIO_OPTIONS, TUI_SWITCH_OPTIONS)],\n hostDirectives: [TuiIcons],\n host: {\n switch: '',\n role: 'switch',\n '[class._native]': 'native',\n },\n})\nexport class TuiSwitch extends TuiRadioComponent<TuiSwitchOptions> {\n protected readonly native = 'switch' in this.el;\n protected readonly icon = tuiIconStart(\n computed(() => (this.showIcons() ? this.options.icon(this.size()) : '')),\n );\n\n public readonly showIcons = input(this.options.showIcons);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAUa,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,GACvD,gBAAgB,CAAmB;AAC/B,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,IAAI,EAAE,MAAM,YAAY;AACxB,IAAA,UAAU,EAAE,CAAC,EAAC,OAAO,EAAC,MAAM,O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AA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FAYH,SAAS,EAAA,UAAA,EAAA,CAAA;kBAdrB,SAAS;+BACI,mCAAmC,EAAA,QAAA,EACnC,EAAE,EAEG,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,SAAA,EACpC,CAAC,UAAU,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,EAC9C,cAAA,EAAA,CAAC,QAAQ,CAAC,EACpB,IAAA,EAAA;AACF,wBAAA,MAAM,EAAE,EAAE;AACV,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,iBAAiB,EAAE,QAAQ;AAC9B,qBAAA,EAAA,MAAA,EAAA,CAAA,+2CAAA,CAAA,EAAA;;;ACzBL;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Directive, ChangeDetectionStrategy, ViewEncapsulation, Component, INJECTOR,
|
|
2
|
+
import { inject, Directive, ChangeDetectionStrategy, ViewEncapsulation, Component, INJECTOR, input, model, afterNextRender, InjectionToken, ElementRef, ChangeDetectorRef, viewChild, contentChildren, TemplateRef, effect } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { RouterLinkActive } from '@angular/router';
|
|
5
5
|
import { MutationObserverService, WA_MUTATION_OBSERVER_INIT } from '@ng-web-apis/mutation-observer';
|
|
@@ -13,8 +13,7 @@ import { TuiItem } from '@taiga-ui/cdk/directives/item';
|
|
|
13
13
|
import { tuiWithStyles, tuiPx, tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
14
14
|
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
15
15
|
import { __decorate } from 'tslib';
|
|
16
|
-
import {
|
|
17
|
-
import { DOCUMENT, AsyncPipe, NgTemplateOutlet } from '@angular/common';
|
|
16
|
+
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
18
17
|
import { tuiClamp, tuiToInt } from '@taiga-ui/cdk/utils/math';
|
|
19
18
|
import * as i1$1 from '@taiga-ui/core/portals/dropdown';
|
|
20
19
|
import { tuiDropdownOptionsProvider, TuiDropdown } from '@taiga-ui/core/portals/dropdown';
|
|
@@ -68,26 +67,25 @@ const [TUI_TABS_OPTIONS, tuiTabsOptionsProvider] = tuiCreateOptions(TUI_TABS_DEF
|
|
|
68
67
|
|
|
69
68
|
class Styles {
|
|
70
69
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: Styles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
71
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: Styles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-tabs" }, ngImport: i0, template: '', isInline: true, styles: ["[tuiTab]{transition-property:color,box-shadow,opacity,background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;position:relative;display:flex;flex-shrink:0;box-sizing:border-box;justify-content:space-between;line-height:1.5rem;align-items:center;white-space:nowrap;cursor:pointer;outline:none;color:inherit;margin-inline-start:var(--tui-tab-margin, 24px)}[tuiTab]:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}[tuiTab]._active{color:var(--tui-text-primary);box-shadow:none}[tuiTab]:focus-visible{outline:.125rem solid var(--tui-border-focus);outline-offset:-.125rem}tui-tabs._underline [tuiTab]:hover:not(._active),[tuiTabs]._underline [tuiTab]:hover:not(._active){box-shadow:inset 0 -.125rem var(--tui-border-normal)}tui-tabs>[tuiTab]:first-child,[tuiTabs]>[tuiTab]:first-child,tui-tabs>:not(.t-overflown)>[tuiTab]:first-child{margin-inline-start:0}tui-tabs>[tuiTab]~:not(.t-overflown)>[tuiTab]:first-child{margin-inline-start:var(--tui-tab-margin, 24px)}[tuiTab][tuiIcons]:before{font-size:1rem;margin-inline-end:.5rem}[tuiTab][tuiIcons]:after{font-size:1rem;margin-inline-start:.5rem}[tuiTab]:empty:after,[tuiTab]:empty:before{margin:.5rem}@media (hover: hover) and (pointer: fine){[tuiTab]:hover{color:var(--tui-text-primary)}}[tuiTabs],tui-tabs{scrollbar-width:none;-ms-overflow-style:none;position:relative;display:flex;font:var(--tui-font-
|
|
70
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: Styles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-tabs" }, ngImport: i0, template: '', isInline: true, styles: ["[tuiTab]{transition-property:color,box-shadow,opacity,background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;position:relative;display:flex;flex-shrink:0;box-sizing:border-box;justify-content:space-between;line-height:1.5rem;align-items:center;white-space:nowrap;cursor:pointer;outline:none;color:inherit;margin-inline-start:var(--tui-tab-margin, 24px)}[tuiTab]:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}[tuiTab]._active{color:var(--tui-text-primary);box-shadow:none}[tuiTab]:focus-visible{outline:.125rem solid var(--tui-border-focus);outline-offset:-.125rem}tui-tabs._underline [tuiTab]:hover:not(._active),[tuiTabs]._underline [tuiTab]:hover:not(._active){box-shadow:inset 0 -.125rem var(--tui-border-normal)}tui-tabs>[tuiTab]:first-child,[tuiTabs]>[tuiTab]:first-child,tui-tabs>:not(.t-overflown)>[tuiTab]:first-child{margin-inline-start:0}tui-tabs>[tuiTab]~:not(.t-overflown)>[tuiTab]:first-child{margin-inline-start:var(--tui-tab-margin, 24px)}[tuiTab][tuiIcons]:before{font-size:1rem;margin-inline-end:.5rem}[tuiTab][tuiIcons]:after{font-size:1rem;margin-inline-start:.5rem}[tuiTab]:empty:after,[tuiTab]:empty:before{margin:.5rem}@media (hover: hover) and (pointer: fine){[tuiTab]:hover{color:var(--tui-text-primary)}}[tuiTabs],tui-tabs{scrollbar-width:none;-ms-overflow-style:none;position:relative;display:flex;font:var(--tui-font-body-m);color:var(--tui-text-secondary);box-shadow:inset 0 -1px var(--tui-border-normal);overflow:auto;isolation:isolate}[tuiTabs]::-webkit-scrollbar,tui-tabs::-webkit-scrollbar,[tuiTabs]::-webkit-scrollbar-thumb,tui-tabs::-webkit-scrollbar-thumb{display:none}[tuiTabs][data-size=m],tui-tabs[data-size=m]{font:var(--tui-font-body-s);--tui-tab-margin: 16px}[tuiTabs][data-size=l]:not([data-vertical]),tui-tabs[data-size=l]:not([data-vertical]){block-size:var(--tui-height-l)}[tuiTabs][data-size=m]:not([data-vertical]),tui-tabs[data-size=m]:not([data-vertical]){block-size:var(--tui-height-m)}[tuiTabs]:before,tui-tabs:before{transition-property:width,left;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;left:var(--t-left);bottom:0;block-size:.125rem;inline-size:var(--t-width);background:var(--t-color);animation:tuiPresent 1ms}[tuiTabs]._underline:before,tui-tabs._underline:before{content:\"\"}tui-tabs[data-vertical],[tuiTabs][data-vertical]{flex-direction:column;box-shadow:inset -1px 0 var(--tui-border-normal)}tui-tabs[data-vertical] [tuiTab],[tuiTabs][data-vertical] [tuiTab]{min-block-size:2.75rem;block-size:auto;white-space:normal;margin:0;text-align:start;padding:.25rem 1.25rem .25rem 0}tui-tabs[data-vertical] [tuiTab]:after,[tuiTabs][data-vertical] [tuiTab]:after{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:0;right:0;display:block;block-size:100%;inline-size:.125rem;background:var(--tui-background-accent-1);transform:scaleX(0);transform-origin:right;margin:0}tui-tabs[data-vertical] [tuiTab]:hover,[tuiTabs][data-vertical] [tuiTab]:hover{box-shadow:inset -.125rem 0 var(--tui-border-normal)}tui-tabs[data-vertical] [tuiTab]._active:after,[tuiTabs][data-vertical] [tuiTab]._active:after{transform:none}tui-tabs[data-vertical][data-size=m] [tuiTab],[tuiTabs][data-vertical][data-size=m] [tuiTab]{min-block-size:2.25rem;font:var(--tui-font-body-s)}tui-tabs[data-vertical][data-vertical=right],[tuiTabs][data-vertical][data-vertical=right]{box-shadow:inset 1px 0 var(--tui-border-normal)}tui-tabs[data-vertical][data-vertical=right] [tuiTab],[tuiTabs][data-vertical][data-vertical=right] [tuiTab]{text-align:end;padding:.25rem 0 .25rem 1.25rem}tui-tabs[data-vertical][data-vertical=right] [tuiTab]:after,[tuiTabs][data-vertical][data-vertical=right] [tuiTab]:after{right:auto;left:0;transform-origin:left}tui-tabs[data-vertical][data-vertical=right] [tuiTab]:hover,[tuiTabs][data-vertical][data-vertical=right] [tuiTab]:hover{box-shadow:inset .125rem 0 var(--tui-border-normal)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
72
71
|
}
|
|
73
72
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: Styles, decorators: [{
|
|
74
73
|
type: Component,
|
|
75
|
-
args: [{ template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'tui-tabs' }, styles: ["[tuiTab]{transition-property:color,box-shadow,opacity,background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;position:relative;display:flex;flex-shrink:0;box-sizing:border-box;justify-content:space-between;line-height:1.5rem;align-items:center;white-space:nowrap;cursor:pointer;outline:none;color:inherit;margin-inline-start:var(--tui-tab-margin, 24px)}[tuiTab]:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}[tuiTab]._active{color:var(--tui-text-primary);box-shadow:none}[tuiTab]:focus-visible{outline:.125rem solid var(--tui-border-focus);outline-offset:-.125rem}tui-tabs._underline [tuiTab]:hover:not(._active),[tuiTabs]._underline [tuiTab]:hover:not(._active){box-shadow:inset 0 -.125rem var(--tui-border-normal)}tui-tabs>[tuiTab]:first-child,[tuiTabs]>[tuiTab]:first-child,tui-tabs>:not(.t-overflown)>[tuiTab]:first-child{margin-inline-start:0}tui-tabs>[tuiTab]~:not(.t-overflown)>[tuiTab]:first-child{margin-inline-start:var(--tui-tab-margin, 24px)}[tuiTab][tuiIcons]:before{font-size:1rem;margin-inline-end:.5rem}[tuiTab][tuiIcons]:after{font-size:1rem;margin-inline-start:.5rem}[tuiTab]:empty:after,[tuiTab]:empty:before{margin:.5rem}@media (hover: hover) and (pointer: fine){[tuiTab]:hover{color:var(--tui-text-primary)}}[tuiTabs],tui-tabs{scrollbar-width:none;-ms-overflow-style:none;position:relative;display:flex;font:var(--tui-font-
|
|
74
|
+
args: [{ template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'tui-tabs' }, styles: ["[tuiTab]{transition-property:color,box-shadow,opacity,background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-appearance:none;appearance:none;padding:0;border:0;background:none;font:inherit;line-height:inherit;text-decoration:none;position:relative;display:flex;flex-shrink:0;box-sizing:border-box;justify-content:space-between;line-height:1.5rem;align-items:center;white-space:nowrap;cursor:pointer;outline:none;color:inherit;margin-inline-start:var(--tui-tab-margin, 24px)}[tuiTab]:disabled{opacity:var(--tui-disabled-opacity);pointer-events:none}[tuiTab]._active{color:var(--tui-text-primary);box-shadow:none}[tuiTab]:focus-visible{outline:.125rem solid var(--tui-border-focus);outline-offset:-.125rem}tui-tabs._underline [tuiTab]:hover:not(._active),[tuiTabs]._underline [tuiTab]:hover:not(._active){box-shadow:inset 0 -.125rem var(--tui-border-normal)}tui-tabs>[tuiTab]:first-child,[tuiTabs]>[tuiTab]:first-child,tui-tabs>:not(.t-overflown)>[tuiTab]:first-child{margin-inline-start:0}tui-tabs>[tuiTab]~:not(.t-overflown)>[tuiTab]:first-child{margin-inline-start:var(--tui-tab-margin, 24px)}[tuiTab][tuiIcons]:before{font-size:1rem;margin-inline-end:.5rem}[tuiTab][tuiIcons]:after{font-size:1rem;margin-inline-start:.5rem}[tuiTab]:empty:after,[tuiTab]:empty:before{margin:.5rem}@media (hover: hover) and (pointer: fine){[tuiTab]:hover{color:var(--tui-text-primary)}}[tuiTabs],tui-tabs{scrollbar-width:none;-ms-overflow-style:none;position:relative;display:flex;font:var(--tui-font-body-m);color:var(--tui-text-secondary);box-shadow:inset 0 -1px var(--tui-border-normal);overflow:auto;isolation:isolate}[tuiTabs]::-webkit-scrollbar,tui-tabs::-webkit-scrollbar,[tuiTabs]::-webkit-scrollbar-thumb,tui-tabs::-webkit-scrollbar-thumb{display:none}[tuiTabs][data-size=m],tui-tabs[data-size=m]{font:var(--tui-font-body-s);--tui-tab-margin: 16px}[tuiTabs][data-size=l]:not([data-vertical]),tui-tabs[data-size=l]:not([data-vertical]){block-size:var(--tui-height-l)}[tuiTabs][data-size=m]:not([data-vertical]),tui-tabs[data-size=m]:not([data-vertical]){block-size:var(--tui-height-m)}[tuiTabs]:before,tui-tabs:before{transition-property:width,left;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;left:var(--t-left);bottom:0;block-size:.125rem;inline-size:var(--t-width);background:var(--t-color);animation:tuiPresent 1ms}[tuiTabs]._underline:before,tui-tabs._underline:before{content:\"\"}tui-tabs[data-vertical],[tuiTabs][data-vertical]{flex-direction:column;box-shadow:inset -1px 0 var(--tui-border-normal)}tui-tabs[data-vertical] [tuiTab],[tuiTabs][data-vertical] [tuiTab]{min-block-size:2.75rem;block-size:auto;white-space:normal;margin:0;text-align:start;padding:.25rem 1.25rem .25rem 0}tui-tabs[data-vertical] [tuiTab]:after,[tuiTabs][data-vertical] [tuiTab]:after{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:absolute;top:0;right:0;display:block;block-size:100%;inline-size:.125rem;background:var(--tui-background-accent-1);transform:scaleX(0);transform-origin:right;margin:0}tui-tabs[data-vertical] [tuiTab]:hover,[tuiTabs][data-vertical] [tuiTab]:hover{box-shadow:inset -.125rem 0 var(--tui-border-normal)}tui-tabs[data-vertical] [tuiTab]._active:after,[tuiTabs][data-vertical] [tuiTab]._active:after{transform:none}tui-tabs[data-vertical][data-size=m] [tuiTab],[tuiTabs][data-vertical][data-size=m] [tuiTab]{min-block-size:2.25rem;font:var(--tui-font-body-s)}tui-tabs[data-vertical][data-vertical=right],[tuiTabs][data-vertical][data-vertical=right]{box-shadow:inset 1px 0 var(--tui-border-normal)}tui-tabs[data-vertical][data-vertical=right] [tuiTab],[tuiTabs][data-vertical][data-vertical=right] [tuiTab]{text-align:end;padding:.25rem 0 .25rem 1.25rem}tui-tabs[data-vertical][data-vertical=right] [tuiTab]:after,[tuiTabs][data-vertical][data-vertical=right] [tuiTab]:after{right:auto;left:0;transform-origin:left}tui-tabs[data-vertical][data-vertical=right] [tuiTab]:hover,[tuiTabs][data-vertical][data-vertical=right] [tuiTab]:hover{box-shadow:inset .125rem 0 var(--tui-border-normal)}\n"] }]
|
|
76
75
|
}] });
|
|
77
76
|
class TuiTabsDirective {
|
|
78
77
|
constructor() {
|
|
79
78
|
this.el = tuiInjectElement();
|
|
80
79
|
this.injector = inject(INJECTOR);
|
|
81
80
|
this.nothing = tuiWithStyles(Styles);
|
|
82
|
-
this.size = inject(TUI_TABS_OPTIONS).size;
|
|
83
|
-
this.activeItemIndex = 0;
|
|
84
|
-
this.activeItemIndexChange = new EventEmitter();
|
|
81
|
+
this.size = input(inject(TUI_TABS_OPTIONS).size);
|
|
82
|
+
this.activeItemIndex = model(0);
|
|
85
83
|
}
|
|
86
84
|
get tabs() {
|
|
87
85
|
return Array.from(this.el.querySelectorAll('[tuiTab]'));
|
|
88
86
|
}
|
|
89
87
|
get activeElement() {
|
|
90
|
-
return this.tabs[this.activeItemIndex] || null;
|
|
88
|
+
return this.tabs[this.activeItemIndex()] || null;
|
|
91
89
|
}
|
|
92
90
|
moveFocus(current, step) {
|
|
93
91
|
const { tabs } = this;
|
|
@@ -98,14 +96,8 @@ class TuiTabsDirective {
|
|
|
98
96
|
this.markTabAsActive();
|
|
99
97
|
}, { injector: this.injector });
|
|
100
98
|
}
|
|
101
|
-
onActivate(
|
|
102
|
-
|
|
103
|
-
event.stopPropagation();
|
|
104
|
-
if (index === this.activeItemIndex) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
this.activeItemIndexChange.emit(index);
|
|
108
|
-
this.activeItemIndex = index;
|
|
99
|
+
onActivate(element) {
|
|
100
|
+
this.activeItemIndex.set(this.tabs.findIndex((tab) => tab === element));
|
|
109
101
|
}
|
|
110
102
|
markTabAsActive() {
|
|
111
103
|
const { tabs, activeElement } = this;
|
|
@@ -116,37 +108,30 @@ class TuiTabsDirective {
|
|
|
116
108
|
});
|
|
117
109
|
}
|
|
118
110
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
119
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
111
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiTabsDirective, isStandalone: true, inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, activeItemIndex: { classPropertyName: "activeItemIndex", publicName: "activeItemIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeItemIndex: "activeItemIndexChange" }, host: { listeners: { "tui-tab-activate.stop": "onActivate($event.target)" }, properties: { "attr.data-size": "size()" } }, ngImport: i0 }); }
|
|
120
112
|
}
|
|
121
113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabsDirective, decorators: [{
|
|
122
114
|
type: Directive,
|
|
123
115
|
args: [{
|
|
124
116
|
host: {
|
|
125
|
-
'[attr.data-size]': 'size',
|
|
126
|
-
[`(${TUI_TAB_ACTIVATE})`]: 'onActivate($event
|
|
117
|
+
'[attr.data-size]': 'size()',
|
|
118
|
+
[`(${TUI_TAB_ACTIVATE}.stop)`]: 'onActivate($event.target)',
|
|
127
119
|
},
|
|
128
120
|
}]
|
|
129
|
-
}]
|
|
130
|
-
type: Input
|
|
131
|
-
}], activeItemIndex: [{
|
|
132
|
-
type: Input
|
|
133
|
-
}], activeItemIndexChange: [{
|
|
134
|
-
type: Output
|
|
135
|
-
}] } });
|
|
121
|
+
}] });
|
|
136
122
|
|
|
137
123
|
class TuiTabsHorizontal {
|
|
138
124
|
constructor() {
|
|
139
125
|
this.el = tuiInjectElement();
|
|
140
126
|
this.options = inject(TUI_TABS_OPTIONS);
|
|
141
127
|
this.tabs = inject(TuiTabsDirective);
|
|
142
|
-
this.children = EMPTY_QUERY;
|
|
143
128
|
this.sub = inject(MutationObserverService, { self: true })
|
|
144
129
|
.pipe(tuiZonefree(), takeUntilDestroyed())
|
|
145
130
|
.subscribe(() => this.refresh());
|
|
146
|
-
this.underline = this.options.underline;
|
|
131
|
+
this.underline = input(this.options.underline);
|
|
147
132
|
}
|
|
148
133
|
ngAfterViewChecked() {
|
|
149
|
-
this.scrollTo(this.tabs.activeItemIndex);
|
|
134
|
+
this.scrollTo(this.tabs.activeItemIndex());
|
|
150
135
|
this.refresh();
|
|
151
136
|
}
|
|
152
137
|
onKeyDownArrow(current, step) {
|
|
@@ -175,7 +160,7 @@ class TuiTabsHorizontal {
|
|
|
175
160
|
}
|
|
176
161
|
}
|
|
177
162
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabsHorizontal, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
178
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
163
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiTabsHorizontal, isStandalone: true, selector: "tui-tabs:not([vertical]), nav[tuiTabs]:not([vertical])", inputs: { underline: { classPropertyName: "underline", publicName: "underline", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "animationend": "refresh()", "keydown.arrowRight.prevent": "onKeyDownArrow($event.target, 1)", "keydown.arrowLeft.prevent": "onKeyDownArrow($event.target, -1)" }, properties: { "class._underline": "underline()", "style.--t-color": "underline() === true ? 'var(--tui-background-accent-1)' : underline()" } }, providers: [
|
|
179
164
|
MutationObserverService,
|
|
180
165
|
{
|
|
181
166
|
provide: WA_MUTATION_OBSERVER_INIT,
|
|
@@ -185,7 +170,7 @@ class TuiTabsHorizontal {
|
|
|
185
170
|
subtree: true,
|
|
186
171
|
},
|
|
187
172
|
},
|
|
188
|
-
],
|
|
173
|
+
], hostDirectives: [{ directive: TuiTabsDirective, inputs: ["activeItemIndex", "activeItemIndex", "size", "size"], outputs: ["activeItemIndexChange", "activeItemIndexChange"] }], ngImport: i0 }); }
|
|
189
174
|
}
|
|
190
175
|
__decorate([
|
|
191
176
|
tuiPure
|
|
@@ -213,30 +198,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
213
198
|
},
|
|
214
199
|
],
|
|
215
200
|
host: {
|
|
216
|
-
'[class._underline]': 'underline',
|
|
217
|
-
'[style.--t-color]': "underline === true ? 'var(--tui-background-accent-1)' : underline",
|
|
201
|
+
'[class._underline]': 'underline()',
|
|
202
|
+
'[style.--t-color]': "underline() === true ? 'var(--tui-background-accent-1)' : underline()",
|
|
218
203
|
'(animationend)': 'refresh()',
|
|
219
204
|
'(keydown.arrowRight.prevent)': 'onKeyDownArrow($event.target, 1)',
|
|
220
205
|
'(keydown.arrowLeft.prevent)': 'onKeyDownArrow($event.target, -1)',
|
|
221
206
|
},
|
|
222
207
|
}]
|
|
223
|
-
}], propDecorators: {
|
|
224
|
-
type: ContentChildren,
|
|
225
|
-
args: [forwardRef(() => TuiTab)]
|
|
226
|
-
}], underline: [{
|
|
227
|
-
type: Input
|
|
228
|
-
}], scrollTo: [] } });
|
|
208
|
+
}], propDecorators: { scrollTo: [] } });
|
|
229
209
|
|
|
230
210
|
class TuiTabsVertical {
|
|
231
211
|
constructor() {
|
|
232
212
|
this.tabs = inject(TuiTabsDirective);
|
|
233
|
-
this.vertical = 'left';
|
|
213
|
+
this.vertical = input('left');
|
|
234
214
|
}
|
|
235
215
|
onKeyDownArrow(current, step) {
|
|
236
216
|
this.tabs.moveFocus(current, step);
|
|
237
217
|
}
|
|
238
218
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabsVertical, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
239
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
219
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiTabsVertical, isStandalone: true, selector: "tui-tabs[vertical], nav[tuiTabs][vertical]", inputs: { vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.arrowDown.prevent": "onKeyDownArrow($event.target, 1)", "keydown.arrowUp.prevent": "onKeyDownArrow($event.target, -1)" }, properties: { "attr.data-vertical": "vertical()" } }, hostDirectives: [{ directive: TuiTabsDirective, inputs: ["activeItemIndex", "activeItemIndex", "size", "size"], outputs: ["activeItemIndexChange", "activeItemIndexChange"] }], ngImport: i0 }); }
|
|
240
220
|
}
|
|
241
221
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabsVertical, decorators: [{
|
|
242
222
|
type: Directive,
|
|
@@ -250,14 +230,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
250
230
|
},
|
|
251
231
|
],
|
|
252
232
|
host: {
|
|
253
|
-
'[attr.data-vertical]': 'vertical',
|
|
233
|
+
'[attr.data-vertical]': 'vertical()',
|
|
254
234
|
'(keydown.arrowDown.prevent)': 'onKeyDownArrow($event.target, 1)',
|
|
255
235
|
'(keydown.arrowUp.prevent)': 'onKeyDownArrow($event.target, -1)',
|
|
256
236
|
},
|
|
257
237
|
}]
|
|
258
|
-
}]
|
|
259
|
-
type: Input
|
|
260
|
-
}] } });
|
|
238
|
+
}] });
|
|
261
239
|
|
|
262
240
|
const TUI_TABS_REFRESH = new InjectionToken(ngDevMode ? 'TUI_TABS_REFRESH' : '');
|
|
263
241
|
const TUI_TABS_PROVIDERS = [
|
|
@@ -289,32 +267,35 @@ const TUI_TABS_PROVIDERS = [
|
|
|
289
267
|
|
|
290
268
|
class TuiTabsWithMore {
|
|
291
269
|
constructor() {
|
|
270
|
+
this.moreButton = viewChild(TuiTab, { read: ElementRef });
|
|
271
|
+
this.dir = viewChild(TuiTabsHorizontal, { read: ElementRef });
|
|
292
272
|
this.options = inject(TUI_TABS_OPTIONS);
|
|
293
273
|
this.refresh$ = inject(TUI_TABS_REFRESH);
|
|
294
274
|
this.el = tuiInjectElement();
|
|
295
275
|
this.cdr = inject(ChangeDetectorRef);
|
|
296
276
|
this.maxIndex = Infinity;
|
|
297
|
-
this.items =
|
|
277
|
+
this.items = contentChildren(TuiItem, { read: TemplateRef });
|
|
298
278
|
this.moreWord = inject(TUI_MORE_WORD);
|
|
299
279
|
this.open = false;
|
|
300
|
-
this.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
this.activeItemIndex = 0;
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
this.
|
|
308
|
-
this.
|
|
280
|
+
this.sync = effect(() => {
|
|
281
|
+
this.activeItemIndex();
|
|
282
|
+
this.maxIndex = this.getMaxIndex();
|
|
283
|
+
});
|
|
284
|
+
this.activeItemIndex = model(0);
|
|
285
|
+
this.size = input(this.options.size);
|
|
286
|
+
this.underline = input(this.options.underline);
|
|
287
|
+
this.itemsLimit = input(this.options.itemsLimit);
|
|
288
|
+
this.moreContent = input();
|
|
289
|
+
this.dropdownContent = input();
|
|
309
290
|
}
|
|
310
291
|
get lastVisibleIndex() {
|
|
311
|
-
if (this.itemsLimit + 1 >= this.items.length) {
|
|
292
|
+
if (this.itemsLimit() + 1 >= this.items().length) {
|
|
312
293
|
return this.maxIndex;
|
|
313
294
|
}
|
|
314
|
-
const offset = this.itemsLimit - 1 > this.activeItemIndex || !this.options.exposeActive
|
|
295
|
+
const offset = this.itemsLimit() - 1 > this.activeItemIndex() || !this.options.exposeActive
|
|
315
296
|
? 1
|
|
316
297
|
: 2;
|
|
317
|
-
return Math.min(this.itemsLimit - offset, this.maxIndex);
|
|
298
|
+
return Math.min(this.itemsLimit() - offset, this.maxIndex);
|
|
318
299
|
}
|
|
319
300
|
ngAfterViewInit() {
|
|
320
301
|
this.refresh$
|
|
@@ -333,31 +314,28 @@ class TuiTabsWithMore {
|
|
|
333
314
|
}
|
|
334
315
|
get activeElement() {
|
|
335
316
|
const { tabs } = this;
|
|
336
|
-
const safeActiveIndex = tuiClamp(this.activeItemIndex || 0, 0, tabs.length - 2);
|
|
317
|
+
const safeActiveIndex = tuiClamp(this.activeItemIndex() || 0, 0, tabs.length - 2);
|
|
337
318
|
return this.options.exposeActive || this.lastVisibleIndex >= safeActiveIndex
|
|
338
319
|
? tabs[safeActiveIndex] || null
|
|
339
|
-
: this.moreButton?.nativeElement || null;
|
|
320
|
+
: this.moreButton()?.nativeElement || null;
|
|
340
321
|
}
|
|
341
322
|
get isMoreAlone() {
|
|
342
323
|
return this.lastVisibleIndex < 0 && !this.options.exposeActive;
|
|
343
324
|
}
|
|
344
325
|
get isMoreVisible() {
|
|
345
|
-
return this.lastVisibleIndex < this.items.length - 1;
|
|
326
|
+
return this.lastVisibleIndex < this.items().length - 1;
|
|
346
327
|
}
|
|
347
328
|
get isMoreFocusable() {
|
|
348
|
-
return
|
|
329
|
+
return tuiIsFocused(this.moreButton()?.nativeElement);
|
|
349
330
|
}
|
|
350
331
|
get isMoreActive() {
|
|
351
332
|
return (this.open ||
|
|
352
|
-
(!this.options.exposeActive && this.lastVisibleIndex < this.activeItemIndex));
|
|
353
|
-
}
|
|
354
|
-
onActiveItemIndexChange(activeItemIndex) {
|
|
355
|
-
this.updateActiveItemIndex(activeItemIndex);
|
|
333
|
+
(!this.options.exposeActive && this.lastVisibleIndex < this.activeItemIndex()));
|
|
356
334
|
}
|
|
357
335
|
onClick(index) {
|
|
358
336
|
this.open = false;
|
|
359
337
|
this.focusMore();
|
|
360
|
-
this.
|
|
338
|
+
this.activeItemIndex.set(index);
|
|
361
339
|
}
|
|
362
340
|
onArrowRight(event) {
|
|
363
341
|
if (tuiIsElement(event.target) && tuiIsFocused(event.target)) {
|
|
@@ -383,7 +361,7 @@ class TuiTabsWithMore {
|
|
|
383
361
|
}
|
|
384
362
|
}
|
|
385
363
|
isOverflown(index) {
|
|
386
|
-
return index !== this.activeItemIndex || !this.options.exposeActive;
|
|
364
|
+
return index !== this.activeItemIndex() || !this.options.exposeActive;
|
|
387
365
|
}
|
|
388
366
|
shouldShow(index) {
|
|
389
367
|
return index > this.lastVisibleIndex && this.isOverflown(index);
|
|
@@ -391,12 +369,10 @@ class TuiTabsWithMore {
|
|
|
391
369
|
// TODO drop comment after fix issue: https://github.com/typescript-eslint/typescript-eslint/issues/11771
|
|
392
370
|
// eslint-disable-next-line @typescript-eslint/no-unused-private-class-members
|
|
393
371
|
get margin() {
|
|
394
|
-
return this.size === 'l' ? 24 : 16;
|
|
372
|
+
return this.size() === 'l' ? 24 : 16;
|
|
395
373
|
}
|
|
396
374
|
focusMore() {
|
|
397
|
-
|
|
398
|
-
this.moreButton.nativeElement.focus();
|
|
399
|
-
}
|
|
375
|
+
this.moreButton()?.nativeElement.focus();
|
|
400
376
|
}
|
|
401
377
|
getMaxIndex() {
|
|
402
378
|
const { tabs, activeItemIndex, margin } = this;
|
|
@@ -405,7 +381,7 @@ class TuiTabsWithMore {
|
|
|
405
381
|
}
|
|
406
382
|
const { exposeActive, minMoreWidth } = this.options;
|
|
407
383
|
const { clientWidth } = this.el;
|
|
408
|
-
const active = tabs[activeItemIndex];
|
|
384
|
+
const active = tabs[activeItemIndex()];
|
|
409
385
|
const activeWidth = active?.scrollWidth ?? 0;
|
|
410
386
|
const moreWidth = Math.max(tabs[tabs.length - 1]?.scrollWidth ?? 0, minMoreWidth);
|
|
411
387
|
let maxIndex = tabs.length - 2;
|
|
@@ -418,7 +394,7 @@ class TuiTabsWithMore {
|
|
|
418
394
|
while (maxIndex) {
|
|
419
395
|
total -= (tabs[maxIndex]?.scrollWidth ?? 0) + margin;
|
|
420
396
|
maxIndex--;
|
|
421
|
-
const activeDisplaced = exposeActive && activeItemIndex > maxIndex;
|
|
397
|
+
const activeDisplaced = exposeActive && activeItemIndex() > maxIndex;
|
|
422
398
|
const activeOffset = activeDisplaced ? activeWidth + margin : 0;
|
|
423
399
|
const currentWidth = total + activeOffset + moreWidth + margin;
|
|
424
400
|
// Needed for different rounding of visible and hidden elements scrollWidth
|
|
@@ -429,56 +405,25 @@ class TuiTabsWithMore {
|
|
|
429
405
|
}
|
|
430
406
|
return -1;
|
|
431
407
|
}
|
|
432
|
-
updateActiveItemIndex(activeItemIndex) {
|
|
433
|
-
this.itemIndex = activeItemIndex;
|
|
434
|
-
this.activeItemIndexChange.emit(activeItemIndex);
|
|
435
|
-
}
|
|
436
408
|
refresh() {
|
|
437
409
|
const { offsetLeft = 0, offsetWidth = 0 } = this.activeElement || {};
|
|
438
|
-
this.dir?.nativeElement.style.setProperty('--t-left', tuiPx(offsetLeft));
|
|
439
|
-
this.dir?.nativeElement.style.setProperty('--t-width', tuiPx(offsetWidth));
|
|
410
|
+
this.dir()?.nativeElement.style.setProperty('--t-left', tuiPx(offsetLeft));
|
|
411
|
+
this.dir()?.nativeElement.style.setProperty('--t-width', tuiPx(offsetWidth));
|
|
440
412
|
}
|
|
441
413
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabsWithMore, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
442
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiTabsWithMore, isStandalone: true, selector: "tui-tabs-with-more, nav[tuiTabsWithMore]", inputs: { size: "size",
|
|
414
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiTabsWithMore, isStandalone: true, selector: "tui-tabs-with-more, nav[tuiTabsWithMore]", inputs: { activeItemIndex: { classPropertyName: "activeItemIndex", publicName: "activeItemIndex", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, underline: { classPropertyName: "underline", publicName: "underline", isSignal: true, isRequired: false, transformFunction: null }, itemsLimit: { classPropertyName: "itemsLimit", publicName: "itemsLimit", isSignal: true, isRequired: false, transformFunction: null }, moreContent: { classPropertyName: "moreContent", publicName: "moreContent", isSignal: true, isRequired: false, transformFunction: null }, dropdownContent: { classPropertyName: "dropdownContent", publicName: "dropdownContent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeItemIndex: "activeItemIndexChange" }, host: { properties: { "attr.data-size": "size()" } }, providers: TUI_TABS_PROVIDERS, queries: [{ propertyName: "items", predicate: TuiItem, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "moreButton", first: true, predicate: TuiTab, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "dir", first: true, predicate: TuiTabsHorizontal, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<tui-tabs\n class=\"t-tabs\"\n [size]=\"size()\"\n [underline]=\"underline()\"\n [(activeItemIndex)]=\"activeItemIndex\"\n (keydown.arrowRight)=\"onArrowRight($event)\"\n>\n @for (item of items(); track item) {\n @if ($index <= lastVisibleIndex) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n } @else {\n <div\n class=\"t-flex\"\n [class.t-overflown]=\"isOverflown($index)\"\n >\n <ng-container [ngTemplateOutlet]=\"item\" />\n </div>\n }\n }\n</tui-tabs>\n\n@if (moreContent()) {\n <button\n tuiTab\n type=\"button\"\n class=\"t-more\"\n [class._active]=\"isMoreActive\"\n [class.t-no-margin]=\"isMoreAlone\"\n [class.t-overflown]=\"!isMoreVisible\"\n [tabIndex]=\"isMoreFocusable ? 0 : -1\"\n [tuiDropdown]=\"dropdownContent() || dropdown\"\n [(tuiDropdownOpen)]=\"open\"\n (keydown.arrowLeft.prevent)=\"onArrowLeft()\"\n >\n <ng-container *polymorpheusOutlet=\"moreContent() as text\">\n {{ text }}\n </ng-container>\n </button>\n} @else {\n <button\n tuiChevron\n tuiTab\n type=\"button\"\n class=\"t-more\"\n [class._active]=\"isMoreActive\"\n [class.t-no-margin]=\"isMoreAlone\"\n [class.t-overflown]=\"!isMoreVisible\"\n [tabIndex]=\"isMoreFocusable ? 0 : -1\"\n [tuiDropdown]=\"dropdownContent() || dropdown\"\n [(tuiDropdownOpen)]=\"open\"\n (keydown.arrowLeft.prevent)=\"onArrowLeft()\"\n >\n {{ moreWord() }}\n </button>\n}\n<ng-template #dropdown>\n <div\n #element\n class=\"t-dropdown\"\n [attr.data-size]=\"size()\"\n (keydown.arrowDown.prevent)=\"onWrapperArrow($event, element, false)\"\n (keydown.arrowUp.prevent)=\"onWrapperArrow($event, element, true)\"\n >\n @for (item of items(); track item) {\n <div\n class=\"t-dropdown-item\"\n (tui-tab-activate)=\"onClick($index)\"\n >\n @if (shouldShow($index)) {\n <ng-container *polymorpheusOutlet=\"item\" />\n }\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;font:var(--tui-font-body-m);box-sizing:border-box;color:var(--tui-text-secondary);box-shadow:inset 0 -1px var(--tui-border-normal);overflow:hidden}:host[data-size=m]{font:var(--tui-font-body-s)}.t-tabs{block-size:inherit;font:inherit;overflow:visible;box-shadow:none;color:inherit}.t-flex{display:flex}.t-overflown{margin:0;inline-size:0;max-inline-size:0;overflow:hidden;visibility:hidden}.t-icon{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-inline-end:-.25rem;vertical-align:bottom}.t-icon_rotated{transform:rotate(180deg)}.t-dropdown{padding:.25rem 0}.t-dropdown ::ng-deep *[tuiTab]{inline-size:calc(100% - .75rem);block-size:2.75rem;justify-content:flex-start;margin:.125rem .375rem;padding:0 .625rem;line-height:1.5rem;border-radius:var(--tui-radius-s);font:var(--tui-font-body-m);color:var(--tui-text-primary)}.t-dropdown ::ng-deep *[tuiTab]:before{display:none}.t-dropdown ::ng-deep *[tuiTab]:hover,.t-dropdown ::ng-deep *[tuiTab]:focus,.t-dropdown ::ng-deep *[tuiTab]._active{box-shadow:none;outline:none;background:var(--tui-background-neutral-1)}.t-dropdown[data-size=m] ::ng-deep *[tuiTab]{block-size:2.25rem;font:var(--tui-font-body-s)}.t-dropdown-item{display:flex;flex-direction:column}.t-no-margin{margin-inline-start:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i1$1.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container):not(ng-template)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { kind: "directive", type: i1$1.TuiDropdownOpen, selector: "[tuiDropdown][tuiDropdownAuto],[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]", inputs: ["tuiDropdownEnabled", "tuiDropdownOpen"], outputs: ["tuiDropdownOpenChange"] }, { kind: "directive", type: TuiTab, selector: "a[tuiTab]:not([routerLink]), a[tuiTab][routerLink][routerLinkActive], button[tuiTab]" }, { kind: "directive", type: TuiTabsHorizontal, selector: "tui-tabs:not([vertical]), nav[tuiTabs]:not([vertical])", inputs: ["underline"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
443
415
|
}
|
|
444
416
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTabsWithMore, decorators: [{
|
|
445
417
|
type: Component,
|
|
446
418
|
args: [{ selector: 'tui-tabs-with-more, nav[tuiTabsWithMore]', imports: [
|
|
447
|
-
AsyncPipe,
|
|
448
419
|
NgTemplateOutlet,
|
|
449
420
|
PolymorpheusOutlet,
|
|
450
421
|
TuiChevron,
|
|
451
422
|
TuiDropdown,
|
|
452
423
|
TuiTab,
|
|
453
424
|
TuiTabsHorizontal,
|
|
454
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, providers: TUI_TABS_PROVIDERS, host: {
|
|
455
|
-
|
|
456
|
-
}, template: "@if (items.changes | async) {}\n<tui-tabs\n class=\"t-tabs\"\n [activeItemIndex]=\"activeItemIndex\"\n [size]=\"size\"\n [underline]=\"underline\"\n (activeItemIndexChange)=\"onActiveItemIndexChange($event)\"\n (keydown.arrowRight)=\"onArrowRight($event)\"\n>\n @for (item of items; track item) {\n @if ($index <= lastVisibleIndex) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n } @else {\n <div\n class=\"t-flex\"\n [class.t-overflown]=\"isOverflown($index)\"\n >\n <ng-container [ngTemplateOutlet]=\"item\" />\n </div>\n }\n }\n</tui-tabs>\n\n@if (moreContent) {\n <button\n tuiTab\n type=\"button\"\n class=\"t-more\"\n [class._active]=\"isMoreActive\"\n [class.t-no-margin]=\"isMoreAlone\"\n [class.t-overflown]=\"!isMoreVisible\"\n [tabIndex]=\"isMoreFocusable ? 0 : -1\"\n [tuiDropdown]=\"dropdownContent || dropdown\"\n [(tuiDropdownOpen)]=\"open\"\n (keydown.arrowLeft.prevent)=\"onArrowLeft()\"\n >\n <ng-container *polymorpheusOutlet=\"moreContent as text\">\n {{ text }}\n </ng-container>\n </button>\n} @else {\n <button\n tuiChevron\n tuiTab\n type=\"button\"\n class=\"t-more\"\n [class._active]=\"isMoreActive\"\n [class.t-no-margin]=\"isMoreAlone\"\n [class.t-overflown]=\"!isMoreVisible\"\n [tabIndex]=\"isMoreFocusable ? 0 : -1\"\n [tuiDropdown]=\"dropdownContent || dropdown\"\n [(tuiDropdownOpen)]=\"open\"\n (keydown.arrowLeft.prevent)=\"onArrowLeft()\"\n >\n {{ moreWord() }}\n </button>\n}\n<ng-template #dropdown>\n <div\n #element\n class=\"t-dropdown\"\n [attr.data-size]=\"size\"\n (keydown.arrowDown.prevent)=\"onWrapperArrow($event, element, false)\"\n (keydown.arrowUp.prevent)=\"onWrapperArrow($event, element, true)\"\n >\n @for (item of items; track item) {\n <div\n class=\"t-dropdown-item\"\n (tui-tab-activate)=\"onClick($index)\"\n >\n @if (shouldShow($index)) {\n <ng-container *polymorpheusOutlet=\"item\" />\n }\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;font:var(--tui-font-text-m);box-sizing:border-box;color:var(--tui-text-secondary);box-shadow:inset 0 -1px var(--tui-border-normal);overflow:hidden}:host[data-size=m]{font:var(--tui-font-text-s)}.t-tabs{block-size:inherit;font:inherit;overflow:visible;box-shadow:none;color:inherit}.t-flex{display:flex}.t-overflown{margin:0;inline-size:0;max-inline-size:0;overflow:hidden;visibility:hidden}.t-icon{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-inline-end:-.25rem;vertical-align:bottom}.t-icon_rotated{transform:rotate(180deg)}.t-dropdown{padding:.25rem 0}.t-dropdown ::ng-deep *[tuiTab]{inline-size:calc(100% - .75rem);block-size:2.75rem;justify-content:flex-start;margin:.125rem .375rem;padding:0 .625rem;line-height:1.5rem;border-radius:var(--tui-radius-s);font:var(--tui-font-text-m);color:var(--tui-text-primary)}.t-dropdown ::ng-deep *[tuiTab]:before{display:none}.t-dropdown ::ng-deep *[tuiTab]:hover,.t-dropdown ::ng-deep *[tuiTab]:focus,.t-dropdown ::ng-deep *[tuiTab]._active{box-shadow:none;outline:none;background:var(--tui-background-neutral-1)}.t-dropdown[data-size=m] ::ng-deep *[tuiTab]{block-size:2.25rem;font:var(--tui-font-text-s)}.t-dropdown-item{display:flex;flex-direction:column}.t-no-margin{margin-inline-start:0}\n"] }]
|
|
457
|
-
}], propDecorators: { moreButton: [{
|
|
458
|
-
type: ViewChild,
|
|
459
|
-
args: [TuiTab, { read: ElementRef }]
|
|
460
|
-
}], dir: [{
|
|
461
|
-
type: ViewChild,
|
|
462
|
-
args: [TuiTabsHorizontal, { read: ElementRef }]
|
|
463
|
-
}], items: [{
|
|
464
|
-
type: ContentChildren,
|
|
465
|
-
args: [TuiItem, { read: TemplateRef }]
|
|
466
|
-
}], size: [{
|
|
467
|
-
type: Input
|
|
468
|
-
}], moreContent: [{
|
|
469
|
-
type: Input
|
|
470
|
-
}], dropdownContent: [{
|
|
471
|
-
type: Input
|
|
472
|
-
}], underline: [{
|
|
473
|
-
type: Input
|
|
474
|
-
}], itemsLimit: [{
|
|
475
|
-
type: Input
|
|
476
|
-
}], activeItemIndexChange: [{
|
|
477
|
-
type: Output
|
|
478
|
-
}], itemIndex: [{
|
|
479
|
-
type: Input,
|
|
480
|
-
args: ['activeItemIndex']
|
|
481
|
-
}] } });
|
|
425
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: TUI_TABS_PROVIDERS, host: { '[attr.data-size]': 'size()' }, template: "<tui-tabs\n class=\"t-tabs\"\n [size]=\"size()\"\n [underline]=\"underline()\"\n [(activeItemIndex)]=\"activeItemIndex\"\n (keydown.arrowRight)=\"onArrowRight($event)\"\n>\n @for (item of items(); track item) {\n @if ($index <= lastVisibleIndex) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n } @else {\n <div\n class=\"t-flex\"\n [class.t-overflown]=\"isOverflown($index)\"\n >\n <ng-container [ngTemplateOutlet]=\"item\" />\n </div>\n }\n }\n</tui-tabs>\n\n@if (moreContent()) {\n <button\n tuiTab\n type=\"button\"\n class=\"t-more\"\n [class._active]=\"isMoreActive\"\n [class.t-no-margin]=\"isMoreAlone\"\n [class.t-overflown]=\"!isMoreVisible\"\n [tabIndex]=\"isMoreFocusable ? 0 : -1\"\n [tuiDropdown]=\"dropdownContent() || dropdown\"\n [(tuiDropdownOpen)]=\"open\"\n (keydown.arrowLeft.prevent)=\"onArrowLeft()\"\n >\n <ng-container *polymorpheusOutlet=\"moreContent() as text\">\n {{ text }}\n </ng-container>\n </button>\n} @else {\n <button\n tuiChevron\n tuiTab\n type=\"button\"\n class=\"t-more\"\n [class._active]=\"isMoreActive\"\n [class.t-no-margin]=\"isMoreAlone\"\n [class.t-overflown]=\"!isMoreVisible\"\n [tabIndex]=\"isMoreFocusable ? 0 : -1\"\n [tuiDropdown]=\"dropdownContent() || dropdown\"\n [(tuiDropdownOpen)]=\"open\"\n (keydown.arrowLeft.prevent)=\"onArrowLeft()\"\n >\n {{ moreWord() }}\n </button>\n}\n<ng-template #dropdown>\n <div\n #element\n class=\"t-dropdown\"\n [attr.data-size]=\"size()\"\n (keydown.arrowDown.prevent)=\"onWrapperArrow($event, element, false)\"\n (keydown.arrowUp.prevent)=\"onWrapperArrow($event, element, true)\"\n >\n @for (item of items(); track item) {\n <div\n class=\"t-dropdown-item\"\n (tui-tab-activate)=\"onClick($index)\"\n >\n @if (shouldShow($index)) {\n <ng-container *polymorpheusOutlet=\"item\" />\n }\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;font:var(--tui-font-body-m);box-sizing:border-box;color:var(--tui-text-secondary);box-shadow:inset 0 -1px var(--tui-border-normal);overflow:hidden}:host[data-size=m]{font:var(--tui-font-body-s)}.t-tabs{block-size:inherit;font:inherit;overflow:visible;box-shadow:none;color:inherit}.t-flex{display:flex}.t-overflown{margin:0;inline-size:0;max-inline-size:0;overflow:hidden;visibility:hidden}.t-icon{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-inline-end:-.25rem;vertical-align:bottom}.t-icon_rotated{transform:rotate(180deg)}.t-dropdown{padding:.25rem 0}.t-dropdown ::ng-deep *[tuiTab]{inline-size:calc(100% - .75rem);block-size:2.75rem;justify-content:flex-start;margin:.125rem .375rem;padding:0 .625rem;line-height:1.5rem;border-radius:var(--tui-radius-s);font:var(--tui-font-body-m);color:var(--tui-text-primary)}.t-dropdown ::ng-deep *[tuiTab]:before{display:none}.t-dropdown ::ng-deep *[tuiTab]:hover,.t-dropdown ::ng-deep *[tuiTab]:focus,.t-dropdown ::ng-deep *[tuiTab]._active{box-shadow:none;outline:none;background:var(--tui-background-neutral-1)}.t-dropdown[data-size=m] ::ng-deep *[tuiTab]{block-size:2.25rem;font:var(--tui-font-body-s)}.t-dropdown-item{display:flex;flex-direction:column}.t-no-margin{margin-inline-start:0}\n"] }]
|
|
426
|
+
}] });
|
|
482
427
|
|
|
483
428
|
const TuiTabs = [
|
|
484
429
|
TuiItem,
|