@taiga-ui/kit 4.53.0 → 4.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/avatar/avatar.options.d.ts +1 -3
- package/components/index.d.ts +1 -0
- package/components/line-clamp/line-clamp.component.d.ts +6 -10
- package/components/pager/pager.component.d.ts +1 -1
- package/components/toast/index.d.ts +1 -0
- package/components/toast/toast.directive.d.ts +7 -0
- package/esm2022/components/avatar/avatar.options.mjs +3 -9
- package/esm2022/components/checkbox/checkbox.component.mjs +2 -2
- package/esm2022/components/confirm/confirm.component.mjs +3 -3
- package/esm2022/components/index.mjs +2 -1
- package/esm2022/components/input-chip/input-chip.directive.mjs +11 -6
- package/esm2022/components/input-number/input-number.directive.mjs +3 -3
- package/esm2022/components/like/like.component.mjs +2 -2
- package/esm2022/components/line-clamp/line-clamp.component.mjs +22 -27
- package/esm2022/components/pager/pager.component.mjs +4 -4
- package/esm2022/components/radio/radio.component.mjs +2 -2
- package/esm2022/components/switch/switch.component.mjs +2 -2
- package/esm2022/components/toast/index.mjs +2 -0
- package/esm2022/components/toast/taiga-ui-kit-components-toast.mjs +5 -0
- package/esm2022/components/toast/toast.directive.mjs +68 -0
- package/fesm2022/taiga-ui-kit-components-avatar.mjs +4 -8
- package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-checkbox.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-checkbox.mjs.map +1 -1
- 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-input-chip.mjs +10 -5
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-like.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-like.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +21 -27
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pager.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-pager.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-radio.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-toast.mjs +74 -0
- package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -0
- package/fesm2022/taiga-ui-kit-components.mjs +1 -0
- package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
- package/package.json +10 -4
- package/styles/components/checkbox.less +1 -0
- package/styles/components/like.less +1 -1
- package/styles/components/radio.less +1 -1
- package/styles/components/switch.less +1 -3
- package/styles/components/toast.less +33 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-line-clamp.mjs","sources":["../../../projects/kit/components/line-clamp/line-clamp.options.ts","../../../projects/kit/components/line-clamp/line-clamp-box.component.ts","../../../projects/kit/components/line-clamp/line-clamp-position.directive.ts","../../../projects/kit/components/line-clamp/line-clamp.component.ts","../../../projects/kit/components/line-clamp/line-clamp.template.html","../../../projects/kit/components/line-clamp/taiga-ui-kit-components-line-clamp.ts"],"sourcesContent":["import {InjectionToken, type Provider} from '@angular/core';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport interface TuiLineClampOptions {\n readonly showHint: boolean;\n}\n\nexport const TUI_LINE_CLAMP_DEFAULT_OPTIONS: TuiLineClampOptions = {\n showHint: true,\n};\n\n/**\n * Default parameters for LineClamp component\n */\nexport const TUI_LINE_CLAMP_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_LINE_CLAMP_OPTIONS' : '',\n {\n factory: () => TUI_LINE_CLAMP_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiLineClampOptionsProvider(\n options: Partial<TuiLineClampOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_LINE_CLAMP_OPTIONS,\n options,\n TUI_LINE_CLAMP_DEFAULT_OPTIONS,\n );\n}\n","import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {TUI_HINT_PROVIDERS, TuiHintBaseComponent} from '@taiga-ui/core/directives/hint';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\n@Component({\n standalone: true,\n selector: 'tui-line-clamp-box',\n imports: [PolymorpheusOutlet],\n template: `\n <ng-container *polymorpheusOutlet=\"content() as text\">{{ text }}</ng-container>\n `,\n styleUrls: ['./line-clamp-box.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: TUI_HINT_PROVIDERS,\n hostDirectives: [TuiAnimated],\n host: {\n '[style.min-width.px]': 'width',\n },\n})\nexport class TuiLineClampBox extends TuiHintBaseComponent {\n protected get width(): number {\n return this.accessor.getClientRect().width;\n }\n}\n","import {Directive, inject} from '@angular/core';\nimport {\n tuiAsPositionAccessor,\n TuiPositionAccessor,\n type TuiRectAccessor,\n} from '@taiga-ui/core/classes';\nimport {TuiHintDirective} from '@taiga-ui/core/directives/hint';\nimport {type TuiPoint} from '@taiga-ui/core/types';\n\n@Directive({\n standalone: true,\n selector: '[tuiLineClampPosition]',\n providers: [tuiAsPositionAccessor(TuiLineClampPositionDirective)],\n})\nexport class TuiLineClampPositionDirective extends TuiPositionAccessor {\n private readonly accessor = inject<TuiRectAccessor>(TuiHintDirective);\n public readonly type = 'hint';\n\n public getPosition(): TuiPoint {\n const {top, left} = this.accessor.getClientRect();\n\n return [top, left];\n }\n}\n","import {\n type AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n type DoCheck,\n ElementRef,\n inject,\n Input,\n Output,\n signal,\n ViewChild,\n} from '@angular/core';\nimport {takeUntilDestroyed, toSignal} from '@angular/core/rxjs-interop';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement, tuiIsCurrentTarget} from '@taiga-ui/cdk/utils/dom';\nimport {\n TUI_HINT_COMPONENT,\n TuiHint,\n TuiHintDirective,\n} from '@taiga-ui/core/directives/hint';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {\n BehaviorSubject,\n debounceTime,\n distinctUntilChanged,\n filter,\n map,\n type Observable,\n of,\n pairwise,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport {TUI_LINE_CLAMP_OPTIONS} from './line-clamp.options';\nimport {TuiLineClampBox} from './line-clamp-box.component';\nimport {TuiLineClampPositionDirective} from './line-clamp-position.directive';\n\n@Component({\n standalone: true,\n selector: 'tui-line-clamp',\n imports: [PolymorpheusOutlet, TuiHint, TuiLineClampPositionDirective],\n templateUrl: './line-clamp.template.html',\n styleUrls: ['./line-clamp.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_HINT_COMPONENT,\n useValue: TuiLineClampBox,\n },\n ],\n host: {\n '[style.height.px]': 'height()',\n '[style.max-height.px]': 'maxHeight()',\n '[class._initialized]': 'initialized()',\n '(transitionend)': 'updateView()',\n '(mouseenter)': 'updateView()',\n '(resize)': 'updateView()',\n },\n})\nexport class TuiLineClamp implements DoCheck, AfterViewInit {\n @ViewChild(TuiHintDirective, {read: ElementRef})\n private readonly outlet?: ElementRef<HTMLElement>;\n\n private readonly options = inject(TUI_LINE_CLAMP_OPTIONS);\n private readonly el = tuiInjectElement();\n private readonly cd = inject(ChangeDetectorRef);\n private readonly linesLimit$ = new BehaviorSubject(1);\n private readonly isOverflown$ = new Subject<boolean>();\n protected initialized = signal(false);\n protected maxHeight = signal(0);\n protected height = signal(0);\n\n protected lineClamp = toSignal(\n this.linesLimit$.pipe(\n startWith(1),\n pairwise(),\n switchMap(([prev, next]) =>\n next >= prev\n ? of(next)\n : tuiTypedFromEvent(this.el, 'transitionend').pipe(\n filter(tuiIsCurrentTarget),\n map(() => next),\n ),\n ),\n takeUntilDestroyed(),\n ),\n {initialValue: 0},\n );\n\n @Input()\n public lineHeight = 24;\n\n @Input()\n public content: PolymorpheusContent;\n\n @Output()\n public readonly overflownChange: Observable<boolean> = this.isOverflown$.pipe(\n debounceTime(0),\n distinctUntilChanged(),\n );\n\n @Input()\n public set linesLimit(linesLimit: number) {\n this.linesLimit$.next(linesLimit);\n }\n\n public ngDoCheck(): void {\n this.update();\n this.isOverflown$.next(this.overflown);\n }\n\n public ngAfterViewInit(): void {\n this.initialized.set(true);\n }\n\n protected get overflown(): boolean {\n if (!this.outlet) {\n return false;\n }\n\n const {scrollHeight, scrollWidth} = this.outlet.nativeElement;\n const {clientWidth} = this.el;\n\n return scrollHeight > this.maxHeight() || scrollWidth > clientWidth;\n }\n\n protected get computedContent(): PolymorpheusContent {\n return this.options.showHint && this.overflown ? this.content : '';\n }\n\n protected updateView(): void {\n this.cd.detectChanges();\n }\n\n private update(): void {\n if (this.outlet) {\n this.height.set(this.outlet.nativeElement.scrollHeight);\n }\n\n this.maxHeight.set(this.lineHeight * this.linesLimit$.value);\n }\n}\n","<div\n tuiLineClampPosition\n class=\"t-wrapper\"\n [style.-webkit-line-clamp]=\"lineClamp()\"\n [style.word-break]=\"lineClamp() > 1 ? 'break-word' : 'break-all'\"\n [tuiHint]=\"computedContent\"\n>\n <ng-container *polymorpheusOutlet=\"content as text\">{{ text }}</ng-container>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAOa,MAAA,8BAA8B,GAAwB;AAC/D,IAAA,QAAQ,EAAE,IAAI;EAChB;AAEF;;AAEG;AACU,MAAA,sBAAsB,GAAG,IAAI,cAAc,CACpD,SAAS,GAAG,wBAA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EAAA,CAAA,EAAA,UAAA,EAAA,IAAI,EACN,QAAA,EAAA,gBAAgB,EACjB,OAAA,EAAA,CAAC,kBAAkB,EAAE,OAAO,EAAE,6BAA6B,CAAC,EAAA,eAAA,EAGpD,uBAAuB,CAAC,MAAM,EACpC,SAAA,EAAA;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,QAAQ,EAAE,eAAe;AAC5B,yBAAA;qBACJ,EACK,IAAA,EAAA;AACF,wBAAA,mBAAmB,EAAE,UAAU;AAC/B,wBAAA,uBAAuB,EAAE,aAAa;AACtC,wBAAA,sBAAsB,EAAE,eAAe;AACvC,wBAAA,iBAAiB,EAAE,cAAc;AACjC,wBAAA,cAAc,EAAE,cAAc;AAC9B,wBAAA,UAAU,EAAE,cAAc;AAC7B,qBAAA,EAAA,QAAA,EAAA,uTAAA,EAAA,MAAA,EAAA,CAAA,oSAAA,CAAA,EAAA,CAAA;8BAIgB,MAAM,EAAA,CAAA;sBADtB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,gBAAgB,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAA;gBA8BxC,UAAU,EAAA,CAAA;sBADhB,KAAK;gBAIC,OAAO,EAAA,CAAA;sBADb,KAAK;gBAIU,eAAe,EAAA,CAAA;sBAD9B,MAAM;gBAOI,UAAU,EAAA,CAAA;sBADpB,KAAK;;;AExGV;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-line-clamp.mjs","sources":["../../../projects/kit/components/line-clamp/line-clamp.options.ts","../../../projects/kit/components/line-clamp/line-clamp-box.component.ts","../../../projects/kit/components/line-clamp/line-clamp-position.directive.ts","../../../projects/kit/components/line-clamp/line-clamp.component.ts","../../../projects/kit/components/line-clamp/line-clamp.template.html","../../../projects/kit/components/line-clamp/taiga-ui-kit-components-line-clamp.ts"],"sourcesContent":["import {InjectionToken, type Provider} from '@angular/core';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\n\nexport interface TuiLineClampOptions {\n readonly showHint: boolean;\n}\n\nexport const TUI_LINE_CLAMP_DEFAULT_OPTIONS: TuiLineClampOptions = {\n showHint: true,\n};\n\n/**\n * Default parameters for LineClamp component\n */\nexport const TUI_LINE_CLAMP_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_LINE_CLAMP_OPTIONS' : '',\n {\n factory: () => TUI_LINE_CLAMP_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiLineClampOptionsProvider(\n options: Partial<TuiLineClampOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_LINE_CLAMP_OPTIONS,\n options,\n TUI_LINE_CLAMP_DEFAULT_OPTIONS,\n );\n}\n","import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {TuiAnimated} from '@taiga-ui/cdk/directives/animated';\nimport {TUI_HINT_PROVIDERS, TuiHintBaseComponent} from '@taiga-ui/core/directives/hint';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\n@Component({\n standalone: true,\n selector: 'tui-line-clamp-box',\n imports: [PolymorpheusOutlet],\n template: `\n <ng-container *polymorpheusOutlet=\"content() as text\">{{ text }}</ng-container>\n `,\n styleUrls: ['./line-clamp-box.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: TUI_HINT_PROVIDERS,\n hostDirectives: [TuiAnimated],\n host: {\n '[style.min-width.px]': 'width',\n },\n})\nexport class TuiLineClampBox extends TuiHintBaseComponent {\n protected get width(): number {\n return this.accessor.getClientRect().width;\n }\n}\n","import {Directive, inject} from '@angular/core';\nimport {\n tuiAsPositionAccessor,\n TuiPositionAccessor,\n type TuiRectAccessor,\n} from '@taiga-ui/core/classes';\nimport {TuiHintDirective} from '@taiga-ui/core/directives/hint';\nimport {type TuiPoint} from '@taiga-ui/core/types';\n\n@Directive({\n standalone: true,\n selector: '[tuiLineClampPosition]',\n providers: [tuiAsPositionAccessor(TuiLineClampPositionDirective)],\n})\nexport class TuiLineClampPositionDirective extends TuiPositionAccessor {\n private readonly accessor = inject<TuiRectAccessor>(TuiHintDirective);\n public readonly type = 'hint';\n\n public getPosition(): TuiPoint {\n const {top, left} = this.accessor.getClientRect();\n\n return [top, left];\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n type DoCheck,\n ElementRef,\n inject,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport {takeUntilDestroyed, toSignal} from '@angular/core/rxjs-interop';\nimport {TuiTransitioned} from '@taiga-ui/cdk/directives/transitioned';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement, tuiIsCurrentTarget} from '@taiga-ui/cdk/utils/dom';\nimport {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {\n TUI_HINT_COMPONENT,\n TuiHint,\n TuiHintDirective,\n} from '@taiga-ui/core/directives/hint';\nimport {type PolymorpheusContent, PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\nimport {\n BehaviorSubject,\n debounceTime,\n distinctUntilChanged,\n filter,\n map,\n type Observable,\n of,\n pairwise,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport {TUI_LINE_CLAMP_OPTIONS} from './line-clamp.options';\nimport {TuiLineClampBox} from './line-clamp-box.component';\nimport {TuiLineClampPositionDirective} from './line-clamp-position.directive';\n\n@Component({\n standalone: true,\n selector: 'tui-line-clamp',\n imports: [PolymorpheusOutlet, TuiHint, TuiLineClampPositionDirective],\n templateUrl: './line-clamp.template.html',\n styleUrls: ['./line-clamp.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_HINT_COMPONENT,\n useValue: TuiLineClampBox,\n },\n ],\n hostDirectives: [TuiTransitioned],\n host: {\n '(transitionend)': 'update()',\n '(mouseenter)': 'update()',\n '(resize)': 'update()',\n },\n})\nexport class TuiLineClamp implements DoCheck {\n @ViewChild(TuiHintDirective, {read: ElementRef})\n private readonly outlet?: ElementRef<HTMLElement>;\n\n private readonly options = inject(TUI_LINE_CLAMP_OPTIONS);\n private readonly el = tuiInjectElement();\n private readonly linesLimit$ = new BehaviorSubject(1);\n private readonly isOverflown$ = new Subject<boolean>();\n\n protected lineClamp = toSignal(\n this.linesLimit$.pipe(\n startWith(1),\n pairwise(),\n switchMap(([prev, next]) =>\n next >= prev\n ? of(next)\n : tuiTypedFromEvent(this.el, 'transitionend').pipe(\n filter(tuiIsCurrentTarget),\n map(() => next),\n ),\n ),\n takeUntilDestroyed(),\n ),\n {initialValue: 0},\n );\n\n @Input()\n public lineHeight = 24;\n\n @Input()\n public content: PolymorpheusContent;\n\n @Output()\n public readonly overflownChange: Observable<boolean> = this.isOverflown$.pipe(\n debounceTime(0),\n distinctUntilChanged(),\n );\n\n @Input()\n public set linesLimit(linesLimit: number) {\n this.linesLimit$.next(linesLimit);\n }\n\n public ngDoCheck(): void {\n this.update();\n this.isOverflown$.next(this.overflown);\n }\n\n protected get overflown(): boolean {\n if (!this.outlet) {\n return false;\n }\n\n const {scrollHeight, scrollWidth} = this.outlet.nativeElement;\n const {clientWidth} = this.el;\n\n return scrollHeight > this.maxHeight || scrollWidth > clientWidth;\n }\n\n protected get computedContent(): PolymorpheusContent {\n return this.options.showHint && this.overflown ? this.content : '';\n }\n\n protected update(): void {\n if (!this.outlet) {\n return;\n }\n\n this.el.style.height = tuiPx(this.outlet.nativeElement.scrollHeight);\n this.el.style.maxHeight = tuiPx(this.maxHeight);\n this.el.classList.toggle('_overflown', this.overflown);\n }\n\n private get maxHeight(): number {\n return this.lineHeight * this.linesLimit$.value;\n }\n}\n","<div\n tuiLineClampPosition\n class=\"t-wrapper\"\n [style.-webkit-line-clamp]=\"lineClamp()\"\n [style.word-break]=\"lineClamp() > 1 ? 'break-word' : 'break-all'\"\n [tuiHint]=\"computedContent\"\n>\n <ng-container *polymorpheusOutlet=\"content as text\">{{ text }}</ng-container>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;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AA,CAAC,kBAAkB,EAAE,OAAO,EAAE,6BAA6B,CAAC,EAAA,eAAA,EAGpD,uBAAuB,CAAC,MAAM,EACpC,SAAA,EAAA;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,QAAQ,EAAE,eAAe;AAC5B,yBAAA;qBACJ,EACe,cAAA,EAAA,CAAC,eAAe,CAAC,EAC3B,IAAA,EAAA;AACF,wBAAA,iBAAiB,EAAE,UAAU;AAC7B,wBAAA,cAAc,EAAE,UAAU;AAC1B,wBAAA,UAAU,EAAE,UAAU;AACzB,qBAAA,EAAA,QAAA,EAAA,uTAAA,EAAA,MAAA,EAAA,CAAA,6SAAA,CAAA,EAAA,CAAA;8BAIgB,MAAM,EAAA,CAAA;sBADtB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,gBAAgB,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAA;gBA0BxC,UAAU,EAAA,CAAA;sBADhB,KAAK;gBAIC,OAAO,EAAA,CAAA;sBADb,KAAK;gBAIU,eAAe,EAAA,CAAA;sBAD9B,MAAM;gBAOI,UAAU,EAAA,CAAA;sBADpB,KAAK;;;AEjGV;;AAEG;;;;"}
|
|
@@ -13,7 +13,7 @@ class TuiPager {
|
|
|
13
13
|
this.start = 0;
|
|
14
14
|
this.end = 0;
|
|
15
15
|
this.left = signal(0);
|
|
16
|
-
this.maxWidth = toSignal(inject(MutationObserverService, { self: true }).pipe(delay(0), map(() => this.visibleWidth), tuiWatch(), takeUntilDestroyed()));
|
|
16
|
+
this.maxWidth = toSignal(inject(MutationObserverService, { self: true }).pipe(delay(0), map(() => this.visibleWidth), tuiWatch(), takeUntilDestroyed()), { initialValue: 0 });
|
|
17
17
|
this.max = 6;
|
|
18
18
|
this.count = this.max;
|
|
19
19
|
this.size = 'm';
|
|
@@ -60,7 +60,7 @@ class TuiPager {
|
|
|
60
60
|
subtree: true,
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
|
-
], viewQueries: [{ propertyName: "items", predicate: ["item"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"t-items\"\n [style.transform]=\"'translateX(calc(var(--tui-inline) * ' + left() + 'px))'\"\n>\n <div\n *tuiRepeatTimes=\"let i of count\"\n #item\n class=\"t-item\"\n [attr.data-index]=\"i\"\n [class._active]=\"i === index\"\n [class._last]=\"i === count - 1\"\n [class._post-active]=\"i === index + 1\"\n [class._pre-active]=\"i === index - 1\"\n [class._pre-last]=\"i === count - 2\"\n [class._visible]=\"i >= start && i <= end\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent || null; context: {$implicit: i}\" />\n </div>\n</div>\n", styles: [":host{
|
|
63
|
+
], viewQueries: [{ propertyName: "items", predicate: ["item"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"t-items\"\n [style.transform]=\"'translateX(calc(var(--tui-inline) * ' + left() + 'px))'\"\n>\n <div\n *tuiRepeatTimes=\"let i of count\"\n #item\n class=\"t-item\"\n [attr.data-index]=\"i\"\n [class._active]=\"i === index\"\n [class._last]=\"i === count - 1\"\n [class._post-active]=\"i === index + 1\"\n [class._pre-active]=\"i === index - 1\"\n [class._pre-last]=\"i === count - 2\"\n [class._visible]=\"i >= start && i <= end\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent || null; context: {$implicit: i}\" />\n </div>\n</div>\n", styles: [":host{display:flex;align-items:center;overflow:hidden}:host[data-size=m]{--t-size: .5rem;--t-small-dot: scale(.75);--t-super-small-dot: scale(.5);--t-icon-size: 1rem;min-block-size:1.25rem}:host-context(tui-root._mobile) :host[data-size=m]{--t-icon-size: .875rem}:host[data-size=s]{--t-size: .375rem;--t-small-dot: scale(.666);--t-super-small-dot: scale(.333);--t-icon-size: .75rem;min-block-size:1rem}:host-context(tui-root._mobile) :host[data-size=s]{--t-icon-size: .6875rem}.t-items{display:flex;gap:var(--t-gap);transition:transform var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}.t-item{display:flex;align-self:center;align-items:center;justify-content:center;color:var(--tui-background-neutral-2)}.t-item._active{color:var(--tui-background-accent-1)}.t-item:empty:before{content:\"\";display:flex;min-inline-size:var(--t-size);min-block-size:var(--t-size);border-radius:100%;background:currentColor;transition:inherit}.t-item:empty:not(._visible):before,.t-item:empty:not(._visible)+.t-item:not(._active):not(._pre-active):empty:before,.t-item:empty:not(._last):not(._post-active):not(._active):nth-last-child(1 of._visible):before{transform:var(--t-super-small-dot)!important}.t-item:empty:not(._last)._post-active:nth-last-child(1 of._visible):before,.t-item:empty:not(._visible)+.t-item._pre-active:empty:before,.t-item:empty:not(._visible)+.t-item:empty+.t-item:not(._active):empty:before,.t-item:empty:not(._pre-last):nth-last-child(2 of._visible):not(._active):before{transform:var(--t-small-dot)}.t-item:empty+.t-item:not(:empty)._pre-last{transform:scale(.64)}.t-item:empty+.t-item:not(:empty)._pre-last:nth-last-child(2 of._visible){transform:scale(1)}.t-item::ng-deep>tui-icon{inline-size:var(--t-icon-size);block-size:var(--t-icon-size)}.t-item,.t-item::ng-deep>tui-icon{transition:all var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
64
64
|
}
|
|
65
65
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPager, decorators: [{
|
|
66
66
|
type: Component,
|
|
@@ -79,7 +79,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
79
79
|
'[attr.data-size]': 'size',
|
|
80
80
|
'[style.--t-gap.px]': 'gap',
|
|
81
81
|
'[style.max-width.px]': 'maxWidth()',
|
|
82
|
-
}, template: "<div\n class=\"t-items\"\n [style.transform]=\"'translateX(calc(var(--tui-inline) * ' + left() + 'px))'\"\n>\n <div\n *tuiRepeatTimes=\"let i of count\"\n #item\n class=\"t-item\"\n [attr.data-index]=\"i\"\n [class._active]=\"i === index\"\n [class._last]=\"i === count - 1\"\n [class._post-active]=\"i === index + 1\"\n [class._pre-active]=\"i === index - 1\"\n [class._pre-last]=\"i === count - 2\"\n [class._visible]=\"i >= start && i <= end\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent || null; context: {$implicit: i}\" />\n </div>\n</div>\n", styles: [":host{
|
|
82
|
+
}, template: "<div\n class=\"t-items\"\n [style.transform]=\"'translateX(calc(var(--tui-inline) * ' + left() + 'px))'\"\n>\n <div\n *tuiRepeatTimes=\"let i of count\"\n #item\n class=\"t-item\"\n [attr.data-index]=\"i\"\n [class._active]=\"i === index\"\n [class._last]=\"i === count - 1\"\n [class._post-active]=\"i === index + 1\"\n [class._pre-active]=\"i === index - 1\"\n [class._pre-last]=\"i === count - 2\"\n [class._visible]=\"i >= start && i <= end\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent || null; context: {$implicit: i}\" />\n </div>\n</div>\n", styles: [":host{display:flex;align-items:center;overflow:hidden}:host[data-size=m]{--t-size: .5rem;--t-small-dot: scale(.75);--t-super-small-dot: scale(.5);--t-icon-size: 1rem;min-block-size:1.25rem}:host-context(tui-root._mobile) :host[data-size=m]{--t-icon-size: .875rem}:host[data-size=s]{--t-size: .375rem;--t-small-dot: scale(.666);--t-super-small-dot: scale(.333);--t-icon-size: .75rem;min-block-size:1rem}:host-context(tui-root._mobile) :host[data-size=s]{--t-icon-size: .6875rem}.t-items{display:flex;gap:var(--t-gap);transition:transform var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}.t-item{display:flex;align-self:center;align-items:center;justify-content:center;color:var(--tui-background-neutral-2)}.t-item._active{color:var(--tui-background-accent-1)}.t-item:empty:before{content:\"\";display:flex;min-inline-size:var(--t-size);min-block-size:var(--t-size);border-radius:100%;background:currentColor;transition:inherit}.t-item:empty:not(._visible):before,.t-item:empty:not(._visible)+.t-item:not(._active):not(._pre-active):empty:before,.t-item:empty:not(._last):not(._post-active):not(._active):nth-last-child(1 of._visible):before{transform:var(--t-super-small-dot)!important}.t-item:empty:not(._last)._post-active:nth-last-child(1 of._visible):before,.t-item:empty:not(._visible)+.t-item._pre-active:empty:before,.t-item:empty:not(._visible)+.t-item:empty+.t-item:not(._active):empty:before,.t-item:empty:not(._pre-last):nth-last-child(2 of._visible):not(._active):before{transform:var(--t-small-dot)}.t-item:empty+.t-item:not(:empty)._pre-last{transform:scale(.64)}.t-item:empty+.t-item:not(:empty)._pre-last:nth-last-child(2 of._visible){transform:scale(1)}.t-item::ng-deep>tui-icon{inline-size:var(--t-icon-size);block-size:var(--t-icon-size)}.t-item,.t-item::ng-deep>tui-icon{transition:all var(--tui-duration-fast, .15s) var(--tui-curve-productive-standard, cubic-bezier(.2, 0, .4, .9))}\n"] }]
|
|
83
83
|
}], propDecorators: { items: [{
|
|
84
84
|
type: ViewChildren,
|
|
85
85
|
args: ['item']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-pager.mjs","sources":["../../../projects/kit/components/pager/pager.component.ts","../../../projects/kit/components/pager/pager.component.html","../../../projects/kit/components/pager/taiga-ui-kit-components-pager.ts"],"sourcesContent":["import {NgTemplateOutlet} from '@angular/common';\nimport {\n type AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n inject,\n Input,\n type OnChanges,\n type QueryList,\n signal,\n type TemplateRef,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed, toSignal} from '@angular/core/rxjs-interop';\nimport {FormsModule} from '@angular/forms';\nimport {\n MutationObserverService,\n WA_MUTATION_OBSERVER_INIT,\n} from '@ng-web-apis/mutation-observer';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\nimport {delay, map} from 'rxjs';\n\n@Component({\n standalone: true,\n selector: 'tui-pager',\n imports: [FormsModule, NgTemplateOutlet, TuiRepeatTimes],\n templateUrl: './pager.component.html',\n styleUrls: ['./pager.styles.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n MutationObserverService,\n {\n provide: WA_MUTATION_OBSERVER_INIT,\n useValue: {\n attributeOldValue: true,\n characterData: true,\n childList: true,\n subtree: true,\n },\n },\n ],\n host: {\n '[attr.data-size]': 'size',\n '[style.--t-gap.px]': 'gap',\n '[style.max-width.px]': 'maxWidth()',\n },\n})\nexport class TuiPager implements OnChanges, AfterViewInit {\n @ViewChildren('item')\n protected items?: QueryList<ElementRef<HTMLElement>>;\n\n protected start = 0;\n protected end = 0;\n protected left = signal(0);\n protected readonly maxWidth = toSignal(\n inject(MutationObserverService, {self: true}).pipe(\n delay(0),\n map(() => this.visibleWidth),\n tuiWatch(),\n takeUntilDestroyed(),\n ),\n );\n\n @Input()\n public max = 6;\n\n @Input()\n public count = this.max;\n\n @Input()\n public size: TuiSizeS = 'm';\n\n @Input()\n public valueContent?: TemplateRef<unknown>;\n\n @Input()\n public index = 0;\n\n public ngOnChanges(): void {\n this.move();\n }\n\n public ngAfterViewInit(): void {\n this.move();\n }\n\n protected get gap(): number {\n return this.size === 'm' ? 9 : 7;\n }\n\n private get visibleRange(): [start: number, end: number] {\n const max = this.max > this.count ? this.count : this.max;\n\n const start = Math.min(\n Math.max(this.index - Math.floor(max / 2), 0),\n this.count - max,\n );\n\n return [start, start + (max - 1)];\n }\n\n private get visibleWidth(): number {\n return (\n (this.items?.map((item) => item.nativeElement.offsetWidth ?? 0) ?? [])\n .slice(this.start, this.end + 1)\n .reduce((sum, item) => sum + item + this.gap, 0) - this.gap\n );\n }\n\n private move(): void {\n const [start, end] = this.visibleRange;\n\n this.start = start;\n this.end = end;\n\n let left = this.start * this.gap;\n\n for (let i = 0; i < this.start; i++) {\n left += this.items?.get(i)?.nativeElement.offsetWidth ?? 0;\n }\n\n this.left.set(-1 * left);\n }\n}\n","<div\n class=\"t-items\"\n [style.transform]=\"'translateX(calc(var(--tui-inline) * ' + left() + 'px))'\"\n>\n <div\n *tuiRepeatTimes=\"let i of count\"\n #item\n class=\"t-item\"\n [attr.data-index]=\"i\"\n [class._active]=\"i === index\"\n [class._last]=\"i === count - 1\"\n [class._post-active]=\"i === index + 1\"\n [class._pre-active]=\"i === index - 1\"\n [class._pre-last]=\"i === count - 2\"\n [class._visible]=\"i >= start && i <= end\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent || null; context: {$implicit: i}\" />\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,MAyBa,QAAQ,CAAA;AAzBrB,IAAA,WAAA,GAAA;QA6Bc,IAAK,CAAA,KAAA,GAAG,CAAC,CAAC;QACV,IAAG,CAAA,GAAA,GAAG,CAAC,CAAC;AACR,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-pager.mjs","sources":["../../../projects/kit/components/pager/pager.component.ts","../../../projects/kit/components/pager/pager.component.html","../../../projects/kit/components/pager/taiga-ui-kit-components-pager.ts"],"sourcesContent":["import {NgTemplateOutlet} from '@angular/common';\nimport {\n type AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n inject,\n Input,\n type OnChanges,\n type QueryList,\n signal,\n type TemplateRef,\n ViewChildren,\n} from '@angular/core';\nimport {takeUntilDestroyed, toSignal} from '@angular/core/rxjs-interop';\nimport {FormsModule} from '@angular/forms';\nimport {\n MutationObserverService,\n WA_MUTATION_OBSERVER_INIT,\n} from '@ng-web-apis/mutation-observer';\nimport {TuiRepeatTimes} from '@taiga-ui/cdk/directives/repeat-times';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\nimport {delay, map} from 'rxjs';\n\n@Component({\n standalone: true,\n selector: 'tui-pager',\n imports: [FormsModule, NgTemplateOutlet, TuiRepeatTimes],\n templateUrl: './pager.component.html',\n styleUrls: ['./pager.styles.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n MutationObserverService,\n {\n provide: WA_MUTATION_OBSERVER_INIT,\n useValue: {\n attributeOldValue: true,\n characterData: true,\n childList: true,\n subtree: true,\n },\n },\n ],\n host: {\n '[attr.data-size]': 'size',\n '[style.--t-gap.px]': 'gap',\n '[style.max-width.px]': 'maxWidth()',\n },\n})\nexport class TuiPager implements OnChanges, AfterViewInit {\n @ViewChildren('item')\n protected items?: QueryList<ElementRef<HTMLElement>>;\n\n protected start = 0;\n protected end = 0;\n protected left = signal(0);\n protected readonly maxWidth = toSignal(\n inject(MutationObserverService, {self: true}).pipe(\n delay(0),\n map(() => this.visibleWidth),\n tuiWatch(),\n takeUntilDestroyed(),\n ),\n {initialValue: 0},\n );\n\n @Input()\n public max = 6;\n\n @Input()\n public count = this.max;\n\n @Input()\n public size: TuiSizeS = 'm';\n\n @Input()\n public valueContent?: TemplateRef<unknown>;\n\n @Input()\n public index = 0;\n\n public ngOnChanges(): void {\n this.move();\n }\n\n public ngAfterViewInit(): void {\n this.move();\n }\n\n protected get gap(): number {\n return this.size === 'm' ? 9 : 7;\n }\n\n private get visibleRange(): [start: number, end: number] {\n const max = this.max > this.count ? this.count : this.max;\n\n const start = Math.min(\n Math.max(this.index - Math.floor(max / 2), 0),\n this.count - max,\n );\n\n return [start, start + (max - 1)];\n }\n\n private get visibleWidth(): number {\n return (\n (this.items?.map((item) => item.nativeElement.offsetWidth ?? 0) ?? [])\n .slice(this.start, this.end + 1)\n .reduce((sum, item) => sum + item + this.gap, 0) - this.gap\n );\n }\n\n private move(): void {\n const [start, end] = this.visibleRange;\n\n this.start = start;\n this.end = end;\n\n let left = this.start * this.gap;\n\n for (let i = 0; i < this.start; i++) {\n left += this.items?.get(i)?.nativeElement.offsetWidth ?? 0;\n }\n\n this.left.set(-1 * left);\n }\n}\n","<div\n class=\"t-items\"\n [style.transform]=\"'translateX(calc(var(--tui-inline) * ' + left() + 'px))'\"\n>\n <div\n *tuiRepeatTimes=\"let i of count\"\n #item\n class=\"t-item\"\n [attr.data-index]=\"i\"\n [class._active]=\"i === index\"\n [class._last]=\"i === count - 1\"\n [class._post-active]=\"i === index + 1\"\n [class._pre-active]=\"i === index - 1\"\n [class._pre-last]=\"i === count - 2\"\n [class._visible]=\"i >= start && i <= end\"\n >\n <ng-container *ngTemplateOutlet=\"valueContent || null; context: {$implicit: i}\" />\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,MAyBa,QAAQ,CAAA;AAzBrB,IAAA,WAAA,GAAA;QA6Bc,IAAK,CAAA,KAAA,GAAG,CAAC,CAAC;QACV,IAAG,CAAA,GAAA,GAAG,CAAC,CAAC;AACR,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACR,IAAQ,CAAA,QAAA,GAAG,QAAQ,CAClC,MAAM,CAAC,uBAAuB,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,IAAI,CAC9C,KAAK,CAAC,CAAC,CAAC,EACR,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,EAC5B,QAAQ,EAAE,EACV,kBAAkB,EAAE,CACvB,EACD,EAAC,YAAY,EAAE,CAAC,EAAC,CACpB,CAAC;QAGK,IAAG,CAAA,GAAA,GAAG,CAAC,CAAC;AAGR,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC;QAGjB,IAAI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AAsB,EAAE,YAAY;AACvC,qBAAA,EAAA,QAAA,EAAA,0oBAAA,EAAA,MAAA,EAAA,CAAA,k6DAAA,CAAA,EAAA,CAAA;8BAIS,KAAK,EAAA,CAAA;sBADd,YAAY;uBAAC,MAAM,CAAA;gBAiBb,GAAG,EAAA,CAAA;sBADT,KAAK;gBAIC,KAAK,EAAA,CAAA;sBADX,KAAK;gBAIC,IAAI,EAAA,CAAA;sBADV,KAAK;gBAIC,YAAY,EAAA,CAAA;sBADlB,KAAK;gBAIC,KAAK,EAAA,CAAA;sBADX,KAAK;;;AE/EV;;AAEG;;;;"}
|
|
@@ -43,7 +43,7 @@ class TuiRadioComponent {
|
|
|
43
43
|
: this.options.appearance(this.el);
|
|
44
44
|
}
|
|
45
45
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
46
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRadioComponent, isStandalone: true, selector: "input[type=\"radio\"][tuiRadio]", inputs: { size: "size" }, host: { properties: { "disabled": "!control || control.disabled", "attr.data-size": "size", "class._readonly": "!control" } }, hostDirectives: [{ directive: i1.TuiAppearance, inputs: ["tuiAppearanceState", "tuiAppearanceState", "tuiAppearanceFocus", "tuiAppearanceFocus", "tuiAppearanceMode", "tuiAppearanceMode"] }, { directive: i2.TuiNativeValidator }], ngImport: i0, template: '', isInline: true, styles: ["[tuiRadio]{--t-size: 1.5rem;transition-property:background,box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;inline-size:var(--t-size);block-size:var(--t-size);cursor:pointer;margin:0;flex-shrink:0;border-radius:100%;color:var(--tui-text-primary-on-accent-1)}[tuiRadio]:disabled._readonly{opacity:1}[tuiRadio]:before{position:absolute;top:0;left:0;bottom:0;right:0;
|
|
46
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRadioComponent, isStandalone: true, selector: "input[type=\"radio\"][tuiRadio]", inputs: { size: "size" }, host: { properties: { "disabled": "!control || control.disabled", "attr.data-size": "size", "class._readonly": "!control" } }, hostDirectives: [{ directive: i1.TuiAppearance, inputs: ["tuiAppearanceState", "tuiAppearanceState", "tuiAppearanceFocus", "tuiAppearanceFocus", "tuiAppearanceMode", "tuiAppearanceMode"] }, { directive: i2.TuiNativeValidator }], ngImport: i0, template: '', isInline: true, styles: ["[tuiRadio]{--t-size: 1.5rem;transition-property:background,box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;inline-size:var(--t-size);block-size:var(--t-size);cursor:pointer;margin:0;flex-shrink:0;border-radius:100%;color:var(--tui-text-primary-on-accent-1)}[tuiRadio]:disabled._readonly{opacity:1}[tuiRadio]:before{position:absolute;top:0;left:0;bottom:0;right:0;content:\"\";margin:auto;border-radius:100%;background:currentColor;transform:scale(0);transition-property:transform}[tuiRadio]:checked:before{transform:scale(.5)}[tuiRadio][data-size=s]{--t-size: 1rem}[tuiRadio]:invalid:not([data-mode]),[tuiRadio][data-mode~=invalid]{color:#fff}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
47
47
|
}
|
|
48
48
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRadioComponent, decorators: [{
|
|
49
49
|
type: Component,
|
|
@@ -57,7 +57,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
57
57
|
'[disabled]': '!control || control.disabled',
|
|
58
58
|
'[attr.data-size]': 'size',
|
|
59
59
|
'[class._readonly]': '!control',
|
|
60
|
-
}, styles: ["[tuiRadio]{--t-size: 1.5rem;transition-property:background,box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;inline-size:var(--t-size);block-size:var(--t-size);cursor:pointer;margin:0;flex-shrink:0;border-radius:100%;color:var(--tui-text-primary-on-accent-1)}[tuiRadio]:disabled._readonly{opacity:1}[tuiRadio]:before{position:absolute;top:0;left:0;bottom:0;right:0;
|
|
60
|
+
}, styles: ["[tuiRadio]{--t-size: 1.5rem;transition-property:background,box-shadow;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;inline-size:var(--t-size);block-size:var(--t-size);cursor:pointer;margin:0;flex-shrink:0;border-radius:100%;color:var(--tui-text-primary-on-accent-1)}[tuiRadio]:disabled._readonly{opacity:1}[tuiRadio]:before{position:absolute;top:0;left:0;bottom:0;right:0;content:\"\";margin:auto;border-radius:100%;background:currentColor;transform:scale(0);transition-property:transform}[tuiRadio]:checked:before{transform:scale(.5)}[tuiRadio][data-size=s]{--t-size: 1rem}[tuiRadio]:invalid:not([data-mode]),[tuiRadio][data-mode~=invalid]{color:#fff}\n"] }]
|
|
61
61
|
}], propDecorators: { size: [{
|
|
62
62
|
type: Input
|
|
63
63
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-radio.mjs","sources":["../../../projects/kit/components/radio/radio.options.ts","../../../projects/kit/components/radio/radio.component.ts","../../../projects/kit/components/radio/radio.directive.ts","../../../projects/kit/components/radio/radio.ts","../../../projects/kit/components/radio/taiga-ui-kit-components-radio.ts"],"sourcesContent":["import {InjectionToken, type Provider} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiRadioOptions {\n readonly appearance: TuiStringHandler<HTMLInputElement> | string;\n readonly size: TuiSizeS;\n}\n\nexport const TUI_RADIO_DEFAULT_OPTIONS: TuiRadioOptions = {\n size: 'm',\n appearance: ({checked}) => (checked ? 'primary' : 'outline-grayscale'),\n};\n\nexport const TUI_RADIO_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_RADIO_OPTIONS' : '',\n {\n factory: () => TUI_RADIO_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiRadioOptionsProvider(options: Partial<TuiRadioOptions>): Provider {\n return tuiProvideOptions(TUI_RADIO_OPTIONS, options, TUI_RADIO_DEFAULT_OPTIONS);\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n type DoCheck,\n inject,\n Input,\n type OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {NgControl} from '@angular/forms';\nimport {TuiNativeValidator} from '@taiga-ui/cdk/directives/native-validator';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiAppearance} from '@taiga-ui/core/directives/appearance';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\n\nimport {TUI_RADIO_OPTIONS} from './radio.options';\n\n@Component({\n standalone: true,\n selector: 'input[type=\"radio\"][tuiRadio]',\n template: '',\n styles: ['@import \"@taiga-ui/kit/styles/components/radio.less\";'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: TuiAppearance,\n inputs: ['tuiAppearanceState', 'tuiAppearanceFocus', 'tuiAppearanceMode'],\n },\n TuiNativeValidator,\n ],\n host: {\n '[disabled]': '!control || control.disabled',\n '[attr.data-size]': 'size',\n '[class._readonly]': '!control',\n },\n})\nexport class TuiRadioComponent implements DoCheck, OnInit {\n private readonly appearance = inject(TuiAppearance);\n private readonly destroyRef = inject(DestroyRef);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly options = inject(TUI_RADIO_OPTIONS);\n private readonly el = tuiInjectElement<HTMLInputElement>();\n\n protected readonly control = inject(NgControl, {self: true, optional: true});\n\n @Input()\n public size: TuiSizeS = this.options.size;\n\n public ngOnInit(): void {\n this.control?.valueChanges\n ?.pipe(tuiWatch(this.cdr), takeUntilDestroyed(this.destroyRef))\n .subscribe();\n }\n\n public ngDoCheck(): void {\n this.appearance.tuiAppearance = tuiIsString(this.options.appearance)\n ? this.options.appearance\n : this.options.appearance(this.el);\n }\n}\n","import {Directive, inject, Input} from '@angular/core';\nimport {RadioControlValueAccessor} from '@angular/forms';\nimport {TUI_DEFAULT_IDENTITY_MATCHER} from '@taiga-ui/cdk/constants';\nimport {type TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\n@Directive({\n standalone: true,\n selector: 'input[type=\"radio\"][tuiRadio][identityMatcher]',\n})\nexport class TuiRadioDirective<T> {\n @Input()\n public identityMatcher: TuiIdentityMatcher<T> = TUI_DEFAULT_IDENTITY_MATCHER;\n\n constructor() {\n const accessor = inject(RadioControlValueAccessor);\n const writeValue = accessor.writeValue.bind(accessor);\n\n accessor.writeValue = (value: T) => {\n if (this.identityMatcher(value, accessor.value)) {\n writeValue(accessor.value);\n } else {\n writeValue(value);\n }\n };\n }\n}\n","import {TuiRadioComponent} from './radio.component';\nimport {TuiRadioDirective} from './radio.directive';\n\nexport const TuiRadio = [TuiRadioComponent, TuiRadioDirective] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAUa,MAAA,yBAAyB,GAAoB;AACtD,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,UAAU,EAAE,CAAC,EAAC,OAAO,EAAC,MAAM,OAAO,GAAG,SAAS,GAAG,mBAAmB,CAAC;EACxE;AAEW,MAAA,iBAAiB,GAAG,IAAI,cAAc,CAC/C,SAAS,GAAG,mBAAmB,GAAG,EAAE,EACpC;AACI,IAAA,OAAO,EAAE,MAAM,yBAAyB;AAC3C,CAAA,EACH;AAEI,SAAU,uBAAuB,CAAC,OAAiC,EAAA;IACrE,OAAO,iBAAiB,CAAC,iBAAiB,EAAE,OA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AAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,ydAjBhB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-radio.mjs","sources":["../../../projects/kit/components/radio/radio.options.ts","../../../projects/kit/components/radio/radio.component.ts","../../../projects/kit/components/radio/radio.directive.ts","../../../projects/kit/components/radio/radio.ts","../../../projects/kit/components/radio/taiga-ui-kit-components-radio.ts"],"sourcesContent":["import {InjectionToken, type Provider} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiRadioOptions {\n readonly appearance: TuiStringHandler<HTMLInputElement> | string;\n readonly size: TuiSizeS;\n}\n\nexport const TUI_RADIO_DEFAULT_OPTIONS: TuiRadioOptions = {\n size: 'm',\n appearance: ({checked}) => (checked ? 'primary' : 'outline-grayscale'),\n};\n\nexport const TUI_RADIO_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_RADIO_OPTIONS' : '',\n {\n factory: () => TUI_RADIO_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiRadioOptionsProvider(options: Partial<TuiRadioOptions>): Provider {\n return tuiProvideOptions(TUI_RADIO_OPTIONS, options, TUI_RADIO_DEFAULT_OPTIONS);\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n type DoCheck,\n inject,\n Input,\n type OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {NgControl} from '@angular/forms';\nimport {TuiNativeValidator} from '@taiga-ui/cdk/directives/native-validator';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiAppearance} from '@taiga-ui/core/directives/appearance';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\n\nimport {TUI_RADIO_OPTIONS} from './radio.options';\n\n@Component({\n standalone: true,\n selector: 'input[type=\"radio\"][tuiRadio]',\n template: '',\n styles: ['@import \"@taiga-ui/kit/styles/components/radio.less\";'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: TuiAppearance,\n inputs: ['tuiAppearanceState', 'tuiAppearanceFocus', 'tuiAppearanceMode'],\n },\n TuiNativeValidator,\n ],\n host: {\n '[disabled]': '!control || control.disabled',\n '[attr.data-size]': 'size',\n '[class._readonly]': '!control',\n },\n})\nexport class TuiRadioComponent implements DoCheck, OnInit {\n private readonly appearance = inject(TuiAppearance);\n private readonly destroyRef = inject(DestroyRef);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly options = inject(TUI_RADIO_OPTIONS);\n private readonly el = tuiInjectElement<HTMLInputElement>();\n\n protected readonly control = inject(NgControl, {self: true, optional: true});\n\n @Input()\n public size: TuiSizeS = this.options.size;\n\n public ngOnInit(): void {\n this.control?.valueChanges\n ?.pipe(tuiWatch(this.cdr), takeUntilDestroyed(this.destroyRef))\n .subscribe();\n }\n\n public ngDoCheck(): void {\n this.appearance.tuiAppearance = tuiIsString(this.options.appearance)\n ? this.options.appearance\n : this.options.appearance(this.el);\n }\n}\n","import {Directive, inject, Input} from '@angular/core';\nimport {RadioControlValueAccessor} from '@angular/forms';\nimport {TUI_DEFAULT_IDENTITY_MATCHER} from '@taiga-ui/cdk/constants';\nimport {type TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\n@Directive({\n standalone: true,\n selector: 'input[type=\"radio\"][tuiRadio][identityMatcher]',\n})\nexport class TuiRadioDirective<T> {\n @Input()\n public identityMatcher: TuiIdentityMatcher<T> = TUI_DEFAULT_IDENTITY_MATCHER;\n\n constructor() {\n const accessor = inject(RadioControlValueAccessor);\n const writeValue = accessor.writeValue.bind(accessor);\n\n accessor.writeValue = (value: T) => {\n if (this.identityMatcher(value, accessor.value)) {\n writeValue(accessor.value);\n } else {\n writeValue(value);\n }\n };\n }\n}\n","import {TuiRadioComponent} from './radio.component';\nimport {TuiRadioDirective} from './radio.directive';\n\nexport const TuiRadio = [TuiRadioComponent, TuiRadioDirective] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAUa,MAAA,yBAAyB,GAAoB;AACtD,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,UAAU,EAAE,CAAC,EAAC,OAAO,EAAC,MAAM,OAAO,GAAG,SAAS,GAAG,mBAAmB,CAAC;EACxE;AAEW,MAAA,iBAAiB,GAAG,IAAI,cAAc,CAC/C,SAAS,GAAG,mBAAmB,GAAG,EAAE,EACpC;AACI,IAAA,OAAO,EAAE,MAAM,yBAAyB;AAC3C,CAAA,EACH;AAEI,SAAU,uBAAuB,CAAC,OAAiC,EAAA;IACrE,OAAO,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,EAAE,yBAAyB,CAAC,CAAC;AACpF;;ACFA,MAoBa,iBAAiB,CAAA;AApB9B,IAAA,WAAA,GAAA;AAqBqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AACnC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;QACpC,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAoB,CAAC;AAExC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EA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,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,gDAAgD;AAC7D,iBAAA,CAAA;0EAGU,eAAe,EAAA,CAAA;sBADrB,KAAK;;;MCPG,QAAQ,GAAG,CAAC,iBAAiB,EAAE,iBAAiB;;ACH7D;;AAEG;;;;"}
|
|
@@ -50,7 +50,7 @@ class TuiSwitch {
|
|
|
50
50
|
return this.showIcons && icon ? `url(${resolver(icon)})` : null;
|
|
51
51
|
}
|
|
52
52
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSwitch, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
53
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiSwitch, isStandalone: true, selector: "input[type=\"checkbox\"][tuiSwitch]", inputs: { size: "size", showIcons: "showIcons" }, host: { attributes: { "role": "switch" }, properties: { "disabled": "!control || control.disabled", "attr.data-size": "size", "class._readonly": "!control", "style.--t-checked-icon": "icon" } }, hostDirectives: [{ directive: i1.TuiAppearance, inputs: ["tuiAppearanceState", "tuiAppearanceState", "tuiAppearanceFocus", "tuiAppearanceFocus", "tuiAppearanceMode", "tuiAppearanceMode"] }, { directive: i2.TuiNativeValidator }], 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
|
|
53
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiSwitch, isStandalone: true, selector: "input[type=\"checkbox\"][tuiSwitch]", inputs: { size: "size", showIcons: "showIcons" }, host: { attributes: { "role": "switch" }, properties: { "disabled": "!control || control.disabled", "attr.data-size": "size", "class._readonly": "!control", "style.--t-checked-icon": "icon" } }, hostDirectives: [{ directive: i1.TuiAppearance, inputs: ["tuiAppearanceState", "tuiAppearanceState", "tuiAppearanceFocus", "tuiAppearanceFocus", "tuiAppearanceMode", "tuiAppearanceMode"] }, { directive: i2.TuiNativeValidator }], 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}[tuiSwitch][data-size=s]{block-size:1rem;inline-size:2rem}[tuiSwitch][data-size=s]:before{inline-size:1.125rem;transform:translate(-1rem);-webkit-mask-size:.75rem;mask-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{opacity:1}[tuiSwitch]:before,[tuiSwitch]:after{content:\"\";position:absolute;block-size:100%;inline-size:1.5rem;transition-property:transform}[tuiSwitch]:before{display:var(--t-checked-icon, none);background:currentColor;-webkit-mask:var(--t-checked-icon) no-repeat center;mask:var(--t-checked-icon) no-repeat center;-webkit-mask-size:1rem;mask-size:1rem;inline-size:1.375rem;transform:translate(-1.5rem)}[tuiSwitch]:after{right:0;border-radius:100%;transform:scale(.33333);box-shadow:-4.5rem 0 0 .75rem var(--tui-background-base);outline:.375rem solid var(--tui-background-neutral-2-pressed);outline-offset:var(--t-checked-icon, 20rem)}[tuiSwitch]:invalid:not([data-mode]),[tuiSwitch][data-mode~=invalid]{color:#fff}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
54
54
|
}
|
|
55
55
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiSwitch, decorators: [{
|
|
56
56
|
type: Component,
|
|
@@ -66,7 +66,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
66
66
|
'[attr.data-size]': 'size',
|
|
67
67
|
'[class._readonly]': '!control',
|
|
68
68
|
'[style.--t-checked-icon]': 'icon',
|
|
69
|
-
}, 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
|
|
69
|
+
}, 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}[tuiSwitch][data-size=s]{block-size:1rem;inline-size:2rem}[tuiSwitch][data-size=s]:before{inline-size:1.125rem;transform:translate(-1rem);-webkit-mask-size:.75rem;mask-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{opacity:1}[tuiSwitch]:before,[tuiSwitch]:after{content:\"\";position:absolute;block-size:100%;inline-size:1.5rem;transition-property:transform}[tuiSwitch]:before{display:var(--t-checked-icon, none);background:currentColor;-webkit-mask:var(--t-checked-icon) no-repeat center;mask:var(--t-checked-icon) no-repeat center;-webkit-mask-size:1rem;mask-size:1rem;inline-size:1.375rem;transform:translate(-1.5rem)}[tuiSwitch]:after{right:0;border-radius:100%;transform:scale(.33333);box-shadow:-4.5rem 0 0 .75rem var(--tui-background-base);outline:.375rem solid var(--tui-background-neutral-2-pressed);outline-offset:var(--t-checked-icon, 20rem)}[tuiSwitch]:invalid:not([data-mode]),[tuiSwitch][data-mode~=invalid]{color:#fff}\n"] }]
|
|
70
70
|
}], propDecorators: { size: [{
|
|
71
71
|
type: Input
|
|
72
72
|
}], showIcons: [{
|
|
@@ -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 {InjectionToken, type Provider} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiSwitchOptions {\n readonly showIcons: boolean;\n readonly size: TuiSizeS;\n readonly icon: TuiStringHandler<TuiSizeS> | string;\n readonly appearance: TuiStringHandler<HTMLInputElement>;\n}\n\nexport const TUI_SWITCH_DEFAULT_OPTIONS: TuiSwitchOptions = {\n showIcons: true,\n size: 'm',\n icon: '@tui.check',\n appearance: (el) => (el.checked ? 'primary' : 'secondary'),\n};\n\nexport const TUI_SWITCH_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_SWITCH_OPTIONS' : '',\n {\n factory: () => TUI_SWITCH_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiSwitchOptionsProvider(options: Partial<TuiSwitchOptions>): Provider {\n return tuiProvideOptions(TUI_SWITCH_OPTIONS, options, TUI_SWITCH_DEFAULT_OPTIONS);\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n type DoCheck,\n inject,\n Input,\n type OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {NgControl} from '@angular/forms';\nimport {TuiNativeValidator} from '@taiga-ui/cdk/directives/native-validator';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiAppearance} from '@taiga-ui/core/directives/appearance';\nimport {tuiInjectIconResolver} from '@taiga-ui/core/tokens';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\n\nimport {TUI_SWITCH_OPTIONS} from './switch.options';\n\n@Component({\n standalone: true,\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 hostDirectives: [\n {\n directive: TuiAppearance,\n inputs: ['tuiAppearanceState', 'tuiAppearanceFocus', 'tuiAppearanceMode'],\n },\n TuiNativeValidator,\n ],\n host: {\n role: 'switch',\n '[disabled]': '!control || control.disabled',\n '[attr.data-size]': 'size',\n '[class._readonly]': '!control',\n '[style.--t-checked-icon]': 'icon',\n },\n})\nexport class TuiSwitch implements DoCheck, OnInit {\n private readonly appearance = inject(TuiAppearance);\n private readonly resolver = tuiInjectIconResolver();\n private readonly destroyRef = inject(DestroyRef);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly options = inject(TUI_SWITCH_OPTIONS);\n private readonly el = tuiInjectElement<HTMLInputElement>();\n\n protected readonly control = inject(NgControl, {self: true, optional: true});\n\n @Input()\n public size: TuiSizeS = this.options.size;\n\n @Input()\n public showIcons = this.options.showIcons;\n\n public ngOnInit(): void {\n this.control?.valueChanges\n ?.pipe(tuiWatch(this.cdr), takeUntilDestroyed(this.destroyRef))\n .subscribe();\n }\n\n public ngDoCheck(): void {\n this.appearance.tuiAppearance = this.options.appearance(this.el);\n }\n\n protected get icon(): string | null {\n const {options, resolver, size} = this;\n const icon = tuiIsString(options.icon) ? options.icon : options.icon(size);\n\n return this.showIcons && icon ? `url(${resolver(icon)})` : null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAYa,MAAA,0BAA0B,GAAqB;AACxD,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;EAC5D;AAEW,MAAA,kBAAkB,GAAG,IAAI,cAAc,CAChD,SAAS,GAAG,oBAAoB,GAAG,EAAE,EACrC;AACI,IAAA,OAAO,EAAE,MAAM,0BAA0B;AAC5C,CAAA,EACH;AAEI,SAAU,wBAAwB,CAAC,OAAkC,EAAA;IACvE,OAAO,iBAAiB,CAAC,kBAAkB,EAAE,OAAO,EAAE,0BAA0B,CAAC,CAAC;AACtF;;ACLA,MAsBa,SAAS,CAAA;AAtBtB,IAAA,WAAA,GAAA;AAuBqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QACnC,IAAQ,CAAA,QAAA,GAAG,qBAAqB,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACrC,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAoB,CAAC;AAExC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;AAGtE,QAAA,IAAA,CAAA,IAAI,GAAa,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;AAGnC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;AAkB7C,KAAA;IAhBU,QAAQ,GAAA;QACX,IAAI,CAAC,OAAO,EAAE,YAAY;AACtB,cAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9D,aAAA,SAAS,EAAE,CAAC;KACpB;IAEM,SAAS,GAAA;AACZ,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACpE;AAED,IAAA,IAAc,IAAI,GAAA;QACd,MAAM,EAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC;QACvC,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE3E,QAAA,OAAO,IAAI,CAAC,SAAS,IAAI,IAAI,GAAG,CAAA,IAAA,EAAO,QAAQ,CAAC,IAAI,CAAC,CAAA,CAAA,CAAG,GAAG,IAAI,CAAC;KACnE;+GA/BQ,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,SAAS,yjBAnBR,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 {InjectionToken, type Provider} from '@angular/core';\nimport {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiSwitchOptions {\n readonly showIcons: boolean;\n readonly size: TuiSizeS;\n readonly icon: TuiStringHandler<TuiSizeS> | string;\n readonly appearance: TuiStringHandler<HTMLInputElement>;\n}\n\nexport const TUI_SWITCH_DEFAULT_OPTIONS: TuiSwitchOptions = {\n showIcons: true,\n size: 'm',\n icon: '@tui.check',\n appearance: (el) => (el.checked ? 'primary' : 'secondary'),\n};\n\nexport const TUI_SWITCH_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_SWITCH_OPTIONS' : '',\n {\n factory: () => TUI_SWITCH_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiSwitchOptionsProvider(options: Partial<TuiSwitchOptions>): Provider {\n return tuiProvideOptions(TUI_SWITCH_OPTIONS, options, TUI_SWITCH_DEFAULT_OPTIONS);\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n type DoCheck,\n inject,\n Input,\n type OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {NgControl} from '@angular/forms';\nimport {TuiNativeValidator} from '@taiga-ui/cdk/directives/native-validator';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiAppearance} from '@taiga-ui/core/directives/appearance';\nimport {tuiInjectIconResolver} from '@taiga-ui/core/tokens';\nimport {type TuiSizeS} from '@taiga-ui/core/types';\n\nimport {TUI_SWITCH_OPTIONS} from './switch.options';\n\n@Component({\n standalone: true,\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 hostDirectives: [\n {\n directive: TuiAppearance,\n inputs: ['tuiAppearanceState', 'tuiAppearanceFocus', 'tuiAppearanceMode'],\n },\n TuiNativeValidator,\n ],\n host: {\n role: 'switch',\n '[disabled]': '!control || control.disabled',\n '[attr.data-size]': 'size',\n '[class._readonly]': '!control',\n '[style.--t-checked-icon]': 'icon',\n },\n})\nexport class TuiSwitch implements DoCheck, OnInit {\n private readonly appearance = inject(TuiAppearance);\n private readonly resolver = tuiInjectIconResolver();\n private readonly destroyRef = inject(DestroyRef);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly options = inject(TUI_SWITCH_OPTIONS);\n private readonly el = tuiInjectElement<HTMLInputElement>();\n\n protected readonly control = inject(NgControl, {self: true, optional: true});\n\n @Input()\n public size: TuiSizeS = this.options.size;\n\n @Input()\n public showIcons = this.options.showIcons;\n\n public ngOnInit(): void {\n this.control?.valueChanges\n ?.pipe(tuiWatch(this.cdr), takeUntilDestroyed(this.destroyRef))\n .subscribe();\n }\n\n public ngDoCheck(): void {\n this.appearance.tuiAppearance = this.options.appearance(this.el);\n }\n\n protected get icon(): string | null {\n const {options, resolver, size} = this;\n const icon = tuiIsString(options.icon) ? options.icon : options.icon(size);\n\n return this.showIcons && icon ? `url(${resolver(icon)})` : null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAYa,MAAA,0BAA0B,GAAqB;AACxD,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;EAC5D;AAEW,MAAA,kBAAkB,GAAG,IAAI,cAAc,C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AAmB,CAAC;AAC5E,yBAAA;wBACD,kBAAkB;qBACrB,EACK,IAAA,EAAA;AACF,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,YAAY,EAAE,8BAA8B;AAC5C,wBAAA,kBAAkB,EAAE,MAAM;AAC1B,wBAAA,mBAAmB,EAAE,UAAU;AAC/B,wBAAA,0BAA0B,EAAE,MAAM;AACrC,qBAAA,EAAA,MAAA,EAAA,CAAA,g/CAAA,CAAA,EAAA,CAAA;8BAaM,IAAI,EAAA,CAAA;sBADV,KAAK;gBAIC,SAAS,EAAA,CAAA;sBADf,KAAK;;;AC1DV;;AAEG;;;;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ViewEncapsulation, ChangeDetectionStrategy, inject, ElementRef, Directive } from '@angular/core';
|
|
3
|
+
import { TUI_PLATFORM } from '@taiga-ui/cdk/tokens';
|
|
4
|
+
import { tuiWithStyles } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
5
|
+
import { tuiButtonOptionsProvider } from '@taiga-ui/core/components';
|
|
6
|
+
import * as i1 from '@taiga-ui/core/directives/icons';
|
|
7
|
+
import { TuiWithIcons } from '@taiga-ui/core/directives/icons';
|
|
8
|
+
import { TUI_ICON_END, TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
|
|
9
|
+
import { tuiAvatarOptionsProvider } from '@taiga-ui/kit/components/avatar';
|
|
10
|
+
import { tuiBadgeOptionsProvider } from '@taiga-ui/kit/components/badge';
|
|
11
|
+
|
|
12
|
+
class TuiToastStyles {
|
|
13
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiToastStyles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiToastStyles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-toast" }, ngImport: i0, template: '', isInline: true, styles: ["[tuiToast]{display:flex;box-sizing:border-box;gap:.75rem;background:var(--tui-background-elevation-3);min-block-size:3.5rem;border-radius:1rem;padding:.75rem 1rem;box-shadow:var(--tui-shadow-medium);align-items:center;justify-content:center;inline-size:-webkit-max-content;inline-size:max-content;font:var(--tui-font-text-ui-s);max-inline-size:25rem;border:inherit}[tuiToast]>*,[tuiToast]:after,[tuiToast]:before{max-inline-size:50%;margin:0 -.25rem}[tuiToast]:after{font-size:1rem;color:var(--tui-text-tertiary)}[tuiToast] tui-avatar{margin-inline-end:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
15
|
+
}
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiToastStyles, decorators: [{
|
|
17
|
+
type: Component,
|
|
18
|
+
args: [{ standalone: true, template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
19
|
+
class: 'tui-toast',
|
|
20
|
+
}, styles: ["[tuiToast]{display:flex;box-sizing:border-box;gap:.75rem;background:var(--tui-background-elevation-3);min-block-size:3.5rem;border-radius:1rem;padding:.75rem 1rem;box-shadow:var(--tui-shadow-medium);align-items:center;justify-content:center;inline-size:-webkit-max-content;inline-size:max-content;font:var(--tui-font-text-ui-s);max-inline-size:25rem;border:inherit}[tuiToast]>*,[tuiToast]:after,[tuiToast]:before{max-inline-size:50%;margin:0 -.25rem}[tuiToast]:after{font-size:1rem;color:var(--tui-text-tertiary)}[tuiToast] tui-avatar{margin-inline-end:0}\n"] }]
|
|
21
|
+
}] });
|
|
22
|
+
class TuiToast {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.nothing = tuiWithStyles(TuiToastStyles);
|
|
25
|
+
}
|
|
26
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiToast, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
27
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiToast, isStandalone: true, selector: "[tuiToast]", providers: [
|
|
28
|
+
tuiBadgeOptionsProvider({ size: 'l' }),
|
|
29
|
+
tuiAvatarOptionsProvider(() => ({
|
|
30
|
+
size: inject(TUI_PLATFORM) === 'web' ? 's' : 'm',
|
|
31
|
+
})),
|
|
32
|
+
tuiButtonOptionsProvider(() => ({
|
|
33
|
+
size: 's',
|
|
34
|
+
appearance: inject(TUI_PLATFORM) === 'web' ? 'secondary-grayscale' : 'secondary',
|
|
35
|
+
})),
|
|
36
|
+
{
|
|
37
|
+
provide: TUI_ICON_END,
|
|
38
|
+
useFactory: () => inject(ElementRef).nativeElement?.matches('a, button')
|
|
39
|
+
? inject(TUI_COMMON_ICONS).more
|
|
40
|
+
: '',
|
|
41
|
+
},
|
|
42
|
+
], hostDirectives: [{ directive: i1.TuiWithIcons }], ngImport: i0 }); }
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiToast, decorators: [{
|
|
45
|
+
type: Directive,
|
|
46
|
+
args: [{
|
|
47
|
+
standalone: true,
|
|
48
|
+
selector: '[tuiToast]',
|
|
49
|
+
providers: [
|
|
50
|
+
tuiBadgeOptionsProvider({ size: 'l' }),
|
|
51
|
+
tuiAvatarOptionsProvider(() => ({
|
|
52
|
+
size: inject(TUI_PLATFORM) === 'web' ? 's' : 'm',
|
|
53
|
+
})),
|
|
54
|
+
tuiButtonOptionsProvider(() => ({
|
|
55
|
+
size: 's',
|
|
56
|
+
appearance: inject(TUI_PLATFORM) === 'web' ? 'secondary-grayscale' : 'secondary',
|
|
57
|
+
})),
|
|
58
|
+
{
|
|
59
|
+
provide: TUI_ICON_END,
|
|
60
|
+
useFactory: () => inject(ElementRef).nativeElement?.matches('a, button')
|
|
61
|
+
? inject(TUI_COMMON_ICONS).more
|
|
62
|
+
: '',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
hostDirectives: [TuiWithIcons],
|
|
66
|
+
}]
|
|
67
|
+
}] });
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Generated bundle index. Do not edit.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
export { TuiToast };
|
|
74
|
+
//# sourceMappingURL=taiga-ui-kit-components-toast.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-toast.mjs","sources":["../../../projects/kit/components/toast/toast.directive.ts","../../../projects/kit/components/toast/taiga-ui-kit-components-toast.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n ElementRef,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_PLATFORM} from '@taiga-ui/cdk/tokens';\nimport {tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {tuiButtonOptionsProvider} from '@taiga-ui/core/components';\nimport {TuiWithIcons} from '@taiga-ui/core/directives/icons';\nimport {TUI_COMMON_ICONS, TUI_ICON_END} from '@taiga-ui/core/tokens';\nimport {tuiAvatarOptionsProvider} from '@taiga-ui/kit/components/avatar';\nimport {tuiBadgeOptionsProvider} from '@taiga-ui/kit/components/badge';\n\n@Component({\n standalone: true,\n template: '',\n styles: ['@import \"@taiga-ui/kit/styles/components/toast.less\";'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tui-toast',\n },\n})\nclass TuiToastStyles {}\n\n@Directive({\n standalone: true,\n selector: '[tuiToast]',\n providers: [\n tuiBadgeOptionsProvider({size: 'l'}),\n tuiAvatarOptionsProvider(() => ({\n size: inject(TUI_PLATFORM) === 'web' ? 's' : 'm',\n })),\n tuiButtonOptionsProvider(() => ({\n size: 's',\n appearance:\n inject(TUI_PLATFORM) === 'web' ? 'secondary-grayscale' : 'secondary',\n })),\n {\n provide: TUI_ICON_END,\n useFactory: () =>\n inject(ElementRef).nativeElement?.matches('a, button')\n ? inject(TUI_COMMON_ICONS).more\n : '',\n },\n ],\n hostDirectives: [TuiWithIcons],\n})\nexport class TuiToast {\n protected readonly nothing = tuiWithStyles(TuiToastStyles);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAgBA,MAUM,cAAc,CAAA;+GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAd,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,cAAc,+GARN,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,+iBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;4FAQV,cAAc,EAAA,UAAA,EAAA,CAAA;kBAVnB,SAAS;iCACM,IAAI,EAAA,QAAA,EACN,EAAE,EAAA,aAAA,EAEG,iBAAiB,CAAC,IAAI,EACpB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACzC,IAAA,EAAA;AACF,wBAAA,KAAK,EAAE,WAAW;AACrB,qBAAA,EAAA,MAAA,EAAA,CAAA,+iBAAA,CAAA,EAAA,CAAA;;AAIL,MAuBa,QAAQ,CAAA;AAvBrB,IAAA,WAAA,GAAA;AAwBuB,QAAA,IAAA,CAAA,OAAO,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC;AAC9D,KAAA;+GAFY,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,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AAA,wBAAwB,CAAC,OAAO;AAC5B,4BAAA,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,KAAK,KAAK,GAAG,GAAG,GAAG,GAAG;AACnD,yBAAA,CAAC,CAAC;AACH,wBAAA,wBAAwB,CAAC,OAAO;AAC5B,4BAAA,IAAI,EAAE,GAAG;AACT,4BAAA,UAAU,EACN,MAAM,CAAC,YAAY,CAAC,KAAK,KAAK,GAAG,qBAAqB,GAAG,WAAW;AAC3E,yBAAA,CAAC,CAAC;AACH,wBAAA;AACI,4BAAA,OAAO,EAAE,YAAY;AACrB,4BAAA,UAAU,EAAE,MACR,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC;AAClD,kCAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI;AAC/B,kCAAE,EAAE;AACf,yBAAA;AACJ,qBAAA;oBACD,cAAc,EAAE,CAAC,YAAY,CAAC;AACjC,iBAAA,CAAA;;;AClDD;;AAEG;;;;"}
|
|
@@ -69,6 +69,7 @@ export * from '@taiga-ui/kit/components/switch';
|
|
|
69
69
|
export * from '@taiga-ui/kit/components/tabs';
|
|
70
70
|
export * from '@taiga-ui/kit/components/textarea';
|
|
71
71
|
export * from '@taiga-ui/kit/components/tiles';
|
|
72
|
+
export * from '@taiga-ui/kit/components/toast';
|
|
72
73
|
export * from '@taiga-ui/kit/components/tree';
|
|
73
74
|
|
|
74
75
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components.mjs","sources":["../../../projects/kit/components/taiga-ui-kit-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components.mjs","sources":["../../../projects/kit/components/taiga-ui-kit-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/kit",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.55.0",
|
|
4
4
|
"description": "Taiga UI Angular main components kit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -479,6 +479,12 @@
|
|
|
479
479
|
"esm": "./esm2022/components/tiles/taiga-ui-kit-components-tiles.mjs",
|
|
480
480
|
"default": "./fesm2022/taiga-ui-kit-components-tiles.mjs"
|
|
481
481
|
},
|
|
482
|
+
"./components/toast": {
|
|
483
|
+
"types": "./components/toast/index.d.ts",
|
|
484
|
+
"esm2022": "./esm2022/components/toast/taiga-ui-kit-components-toast.mjs",
|
|
485
|
+
"esm": "./esm2022/components/toast/taiga-ui-kit-components-toast.mjs",
|
|
486
|
+
"default": "./fesm2022/taiga-ui-kit-components-toast.mjs"
|
|
487
|
+
},
|
|
482
488
|
"./components/tree": {
|
|
483
489
|
"types": "./components/tree/index.d.ts",
|
|
484
490
|
"esm2022": "./esm2022/components/tree/taiga-ui-kit-components-tree.mjs",
|
|
@@ -667,9 +673,9 @@
|
|
|
667
673
|
"@ng-web-apis/intersection-observer": "^4.12.0",
|
|
668
674
|
"@ng-web-apis/mutation-observer": "^4.12.0",
|
|
669
675
|
"@ng-web-apis/resize-observer": "^4.12.0",
|
|
670
|
-
"@taiga-ui/cdk": "^4.
|
|
671
|
-
"@taiga-ui/core": "^4.
|
|
672
|
-
"@taiga-ui/i18n": "^4.
|
|
676
|
+
"@taiga-ui/cdk": "^4.55.0",
|
|
677
|
+
"@taiga-ui/core": "^4.55.0",
|
|
678
|
+
"@taiga-ui/i18n": "^4.55.0",
|
|
673
679
|
"@taiga-ui/polymorpheus": "^4.9.0",
|
|
674
680
|
"rxjs": ">=7.0.0"
|
|
675
681
|
},
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
&::before,
|
|
37
37
|
&::after {
|
|
38
38
|
.fullsize();
|
|
39
|
-
.transition(~'transform, opacity');
|
|
40
39
|
|
|
41
40
|
content: '';
|
|
42
41
|
background: currentColor;
|
|
43
42
|
mask: var(--t-unchecked-icon) no-repeat center/contain;
|
|
43
|
+
transition-property: transform, opacity;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
&::after {
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
|
|
36
36
|
&::before {
|
|
37
37
|
.fullsize(absolute, inset);
|
|
38
|
-
.transition(transform);
|
|
39
38
|
|
|
40
39
|
content: '';
|
|
41
40
|
margin: auto;
|
|
42
41
|
border-radius: 100%;
|
|
43
42
|
background: currentColor;
|
|
44
43
|
transform: scale(0);
|
|
44
|
+
transition-property: transform;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&:checked::before {
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
cursor: pointer;
|
|
30
30
|
margin: 0;
|
|
31
31
|
flex-shrink: 0;
|
|
32
|
-
color: #fff !important;
|
|
33
32
|
|
|
34
33
|
&[data-size='s'] {
|
|
35
34
|
block-size: 1rem;
|
|
@@ -69,12 +68,11 @@
|
|
|
69
68
|
|
|
70
69
|
&::before,
|
|
71
70
|
&::after {
|
|
72
|
-
.transition(transform);
|
|
73
|
-
|
|
74
71
|
content: '';
|
|
75
72
|
position: absolute;
|
|
76
73
|
block-size: 100%;
|
|
77
74
|
inline-size: 1.5rem;
|
|
75
|
+
transition-property: transform;
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
&::before {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[tuiToast] {
|
|
2
|
+
display: flex;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
gap: 0.75rem;
|
|
5
|
+
background: var(--tui-background-elevation-3);
|
|
6
|
+
min-block-size: 3.5rem;
|
|
7
|
+
border-radius: 1rem;
|
|
8
|
+
padding: 0.75rem 1rem;
|
|
9
|
+
box-shadow: var(--tui-shadow-medium);
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
inline-size: max-content;
|
|
13
|
+
font: var(--tui-font-text-ui-s);
|
|
14
|
+
max-inline-size: 25rem;
|
|
15
|
+
border: inherit;
|
|
16
|
+
|
|
17
|
+
> *,
|
|
18
|
+
&::after,
|
|
19
|
+
&::before {
|
|
20
|
+
max-inline-size: 50%;
|
|
21
|
+
margin: 0 -0.25rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&::after {
|
|
25
|
+
font-size: 1rem;
|
|
26
|
+
color: var(--tui-text-tertiary);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// TODO: replace tui-avatar to tuiAvatar in v5
|
|
30
|
+
tui-avatar {
|
|
31
|
+
margin-inline-end: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|