@taiga-ui/core 4.49.0-canary.5696ef0 → 4.49.0-canary.b853f27
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/directives/appearance/appearance.directive.d.ts +1 -1
- package/esm2022/components/root/root.component.mjs +1 -1
- package/esm2022/directives/appearance/appearance.directive.mjs +6 -6
- package/fesm2022/taiga-ui-core-components-root.mjs +1 -1
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +6 -6
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/theme/appearance/outline.less +4 -2
- package/styles/theme/appearance/primary.less +2 -1
- package/styles/theme/appearance/secondary.less +4 -2
|
@@ -6,11 +6,11 @@ export declare class TuiAppearance {
|
|
|
6
6
|
private readonly el;
|
|
7
7
|
protected readonly nothing: undefined;
|
|
8
8
|
protected readonly modes: import("@angular/core").Signal<string | null>;
|
|
9
|
-
protected readonly update: import("@angular/core").EffectRef;
|
|
10
9
|
readonly appearance: import("@angular/core").WritableSignal<"accent" | "action-destructive" | "action-grayscale" | "action" | "flat-destructive" | "flat-grayscale" | "flat" | "floating" | "glass" | "icon" | "info" | "negative" | "neutral" | "outline-destructive" | "outline-grayscale" | "outline" | "positive" | "primary-destructive" | "primary-grayscale" | "primary" | "secondary-destructive" | "secondary-grayscale" | "secondary" | "textfield" | "warning" | (Record<never, never> & string)>;
|
|
11
10
|
readonly state: import("@angular/core").WritableSignal<TuiInteractiveState | null>;
|
|
12
11
|
readonly focus: import("@angular/core").WritableSignal<boolean | null>;
|
|
13
12
|
readonly mode: import("@angular/core").WritableSignal<string | readonly string[] | null>;
|
|
13
|
+
readonly update: import("@angular/core").EffectRef;
|
|
14
14
|
constructor();
|
|
15
15
|
set tuiAppearance(appearance: TuiAppearanceOptions['appearance']);
|
|
16
16
|
set tuiAppearanceState(state: TuiInteractiveState | null);
|
|
@@ -59,7 +59,7 @@ class TuiRoot {
|
|
|
59
59
|
: !this.isChildRoot;
|
|
60
60
|
}
|
|
61
61
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRoot, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
62
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRoot, isStandalone: true, selector: "tui-root", host: { attributes: { "data-tui-version": "4.49.0-canary.
|
|
62
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRoot, isStandalone: true, selector: "tui-root", host: { attributes: { "data-tui-version": "4.49.0-canary.b853f27" }, listeners: { "touchstart.passive.zoneless": "0", "document:fullscreenchange": "top.set(isTopLayer)" }, properties: { "style.--tui-duration.ms": "duration", "style.--tui-scroll-behavior": "reducedMotion ? \"auto\" : \"smooth\"", "class._mobile": "isMobileRes()" } }, hostDirectives: [{ directive: i1.TuiPlatform }, { directive: i2.TuiVisualViewport }, { directive: i3.TuiFontSize }], ngImport: i0, template: "<div class=\"t-root-content\">\n <ng-content />\n</div>\n<ng-container *ngIf=\"top()\">\n <tui-scroll-controls\n *ngIf=\"scrollbars\"\n class=\"t-root-scrollbar\"\n />\n <tui-popups />\n <ng-content select=\"tuiOverContent\" />\n <tui-dialogs />\n <ng-content select=\"tuiOverDialogs\" />\n <tui-alerts />\n <ng-content select=\"tuiOverAlerts\" />\n <tui-dropdowns />\n <ng-content select=\"tuiOverDropdowns\" />\n <tui-hints />\n <ng-content select=\"tuiOverHints\" />\n</ng-container>\n", styles: ["@keyframes tuiSkeletonVibe{to{opacity:.5}}@keyframes tuiPresent{to{content:\"\"}}@keyframes tuiFade{0%{opacity:0}}@keyframes tuiSlide{0%{transform:var(--tui-from, translateY(100%))}}@keyframes tuiScale{0%{transform:scale(0)}}@keyframes tuiCollapse{0%{grid-template-rows:0fr}to{grid-template-rows:1fr}}.tui-enter,.tui-leave{animation-duration:var(--tui-duration);animation-timing-function:ease-in-out;pointer-events:none}.tui-leave{animation-direction:reverse}\n", ".tui-zero-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.tui-zero-scrollbar::-webkit-scrollbar,.tui-zero-scrollbar::-webkit-scrollbar-thumb{display:none}body,input{margin:0}tui-root{position:relative;display:block;font:var(--tui-font-text-s);color:var(--tui-text-primary);flex:1;border-image:conic-gradient(var(--tui-background-base) 0 0) fill 0/0/0 0 100vh 0;-webkit-tap-highlight-color:transparent}:root{--tui-inline-start: left;--tui-inline-end: right;--tui-inline: 1}[dir=rtl]{--tui-inline-start: right;--tui-inline-end: left;--tui-inline: -1}tui-root>.t-root-scrollbar{position:fixed;top:0;left:0;bottom:0;right:0;z-index:0;display:none;margin:0}[data-tui-theme] tui-root>.t-root-scrollbar{display:block}.t-root-content{position:relative;top:var(--t-root-top);block-size:100%;isolation:isolate}.t-root-content>*{--t-root-top: 0}[tuiDropdownButton][tuiDropdownButton]{display:none}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TuiAlerts, selector: "tui-alerts" }, { kind: "component", type: TuiDialogs, selector: "tui-dialogs" }, { kind: "component", type: TuiDropdowns, selector: "tui-dropdowns" }, { kind: "component", type: TuiHints, selector: "tui-hints" }, { kind: "component", type: TuiPopups, selector: "tui-popups" }, { kind: "component", type: TuiScrollControls, selector: "tui-scroll-controls" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
|
|
63
63
|
}
|
|
64
64
|
export { TuiRoot };
|
|
65
65
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRoot, decorators: [{
|
|
@@ -20,6 +20,11 @@ class TuiAppearance {
|
|
|
20
20
|
this.el = tuiInjectElement();
|
|
21
21
|
this.nothing = tuiWithStyles(TuiAppearanceStyles);
|
|
22
22
|
this.modes = computed((mode = this.mode()) => !mode || tuiIsString(mode) ? mode : mode.join(' '));
|
|
23
|
+
// TODO: refactor to signal inputs after Angular update
|
|
24
|
+
this.appearance = signal(inject(TUI_APPEARANCE_OPTIONS).appearance);
|
|
25
|
+
this.state = signal(null);
|
|
26
|
+
this.focus = signal(null);
|
|
27
|
+
this.mode = signal(null);
|
|
23
28
|
// TODO: Remove when Angular is updated
|
|
24
29
|
this.update = effect(() => {
|
|
25
30
|
this.mode();
|
|
@@ -29,11 +34,6 @@ class TuiAppearance {
|
|
|
29
34
|
this.cdr.detectChanges();
|
|
30
35
|
}
|
|
31
36
|
}, TUI_ALLOW_SIGNAL_WRITES);
|
|
32
|
-
// TODO: refactor to signal inputs after Angular update
|
|
33
|
-
this.appearance = signal(inject(TUI_APPEARANCE_OPTIONS).appearance);
|
|
34
|
-
this.state = signal(null);
|
|
35
|
-
this.focus = signal(null);
|
|
36
|
-
this.mode = signal(null);
|
|
37
37
|
afterNextRender(() => {
|
|
38
38
|
this.el.classList.toggle('tui-appearance-initializing',
|
|
39
39
|
// Triggering reflow so there's no transition
|
|
@@ -79,4 +79,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
79
79
|
}], tuiAppearanceMode: [{
|
|
80
80
|
type: Input
|
|
81
81
|
}] } });
|
|
82
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
82
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwZWFyYW5jZS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb3JlL2RpcmVjdGl2ZXMvYXBwZWFyYW5jZS9hcHBlYXJhbmNlLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0gsZUFBZSxFQUNmLHVCQUF1QixFQUN2QixpQkF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G4gICAgfVxuXG4gICAgQElucHV0KClcbiAgICBwdWJsaWMgc2V0IHR1aUFwcGVhcmFuY2UoYXBwZWFyYW5jZTogVHVpQXBwZWFyYW5jZU9wdGlvbnNbJ2FwcGVhcmFuY2UnXSkge1xuICAgICAgICB0aGlzLmFwcGVhcmFuY2Uuc2V0KGFwcGVhcmFuY2UpO1xuICAgIH1cblxuICAgIEBJbnB1dCgpXG4gICAgcHVibGljIHNldCB0dWlBcHBlYXJhbmNlU3RhdGUoc3RhdGU6IFR1aUludGVyYWN0aXZlU3RhdGUgfCBudWxsKSB7XG4gICAgICAgIHRoaXMuc3RhdGUuc2V0KHN0YXRlKTtcbiAgICB9XG5cbiAgICBASW5wdXQoKVxuICAgIHB1YmxpYyBzZXQgdHVpQXBwZWFyYW5jZUZvY3VzKGZvY3VzOiBib29sZWFuIHwgbnVsbCkge1xuICAgICAgICB0aGlzLmZvY3VzLnNldChmb2N1cyk7XG4gICAgfVxuXG4gICAgQElucHV0KClcbiAgICBwdWJsaWMgc2V0IHR1aUFwcGVhcmFuY2VNb2RlKG1vZGU6IHN0cmluZyB8IHJlYWRvbmx5IHN0cmluZ1tdIHwgbnVsbCkge1xuICAgICAgICB0aGlzLm1vZGUuc2V0KG1vZGUpO1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -60,7 +60,7 @@ class TuiRoot {
|
|
|
60
60
|
: !this.isChildRoot;
|
|
61
61
|
}
|
|
62
62
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRoot, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
63
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRoot, isStandalone: true, selector: "tui-root", host: { attributes: { "data-tui-version": "4.49.0-canary.
|
|
63
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRoot, isStandalone: true, selector: "tui-root", host: { attributes: { "data-tui-version": "4.49.0-canary.b853f27" }, listeners: { "touchstart.passive.zoneless": "0", "document:fullscreenchange": "top.set(isTopLayer)" }, properties: { "style.--tui-duration.ms": "duration", "style.--tui-scroll-behavior": "reducedMotion ? \"auto\" : \"smooth\"", "class._mobile": "isMobileRes()" } }, hostDirectives: [{ directive: i1.TuiPlatform }, { directive: i2.TuiVisualViewport }, { directive: i3.TuiFontSize }], ngImport: i0, template: "<div class=\"t-root-content\">\n <ng-content />\n</div>\n<ng-container *ngIf=\"top()\">\n <tui-scroll-controls\n *ngIf=\"scrollbars\"\n class=\"t-root-scrollbar\"\n />\n <tui-popups />\n <ng-content select=\"tuiOverContent\" />\n <tui-dialogs />\n <ng-content select=\"tuiOverDialogs\" />\n <tui-alerts />\n <ng-content select=\"tuiOverAlerts\" />\n <tui-dropdowns />\n <ng-content select=\"tuiOverDropdowns\" />\n <tui-hints />\n <ng-content select=\"tuiOverHints\" />\n</ng-container>\n", styles: ["@keyframes tuiSkeletonVibe{to{opacity:.5}}@keyframes tuiPresent{to{content:\"\"}}@keyframes tuiFade{0%{opacity:0}}@keyframes tuiSlide{0%{transform:var(--tui-from, translateY(100%))}}@keyframes tuiScale{0%{transform:scale(0)}}@keyframes tuiCollapse{0%{grid-template-rows:0fr}to{grid-template-rows:1fr}}.tui-enter,.tui-leave{animation-duration:var(--tui-duration);animation-timing-function:ease-in-out;pointer-events:none}.tui-leave{animation-direction:reverse}\n", ".tui-zero-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.tui-zero-scrollbar::-webkit-scrollbar,.tui-zero-scrollbar::-webkit-scrollbar-thumb{display:none}body,input{margin:0}tui-root{position:relative;display:block;font:var(--tui-font-text-s);color:var(--tui-text-primary);flex:1;border-image:conic-gradient(var(--tui-background-base) 0 0) fill 0/0/0 0 100vh 0;-webkit-tap-highlight-color:transparent}:root{--tui-inline-start: left;--tui-inline-end: right;--tui-inline: 1}[dir=rtl]{--tui-inline-start: right;--tui-inline-end: left;--tui-inline: -1}tui-root>.t-root-scrollbar{position:fixed;top:0;left:0;bottom:0;right:0;z-index:0;display:none;margin:0}[data-tui-theme] tui-root>.t-root-scrollbar{display:block}.t-root-content{position:relative;top:var(--t-root-top);block-size:100%;isolation:isolate}.t-root-content>*{--t-root-top: 0}[tuiDropdownButton][tuiDropdownButton]{display:none}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TuiAlerts, selector: "tui-alerts" }, { kind: "component", type: TuiDialogs, selector: "tui-dialogs" }, { kind: "component", type: TuiDropdowns, selector: "tui-dropdowns" }, { kind: "component", type: TuiHints, selector: "tui-hints" }, { kind: "component", type: TuiPopups, selector: "tui-popups" }, { kind: "component", type: TuiScrollControls, selector: "tui-scroll-controls" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
|
|
64
64
|
}
|
|
65
65
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRoot, decorators: [{
|
|
66
66
|
type: Component,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tuiProvide, tuiWithStyles, tuiIsString, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, Component, ViewEncapsulation, ChangeDetectionStrategy, inject, ChangeDetectorRef, computed,
|
|
3
|
+
import { InjectionToken, Component, ViewEncapsulation, ChangeDetectionStrategy, inject, ChangeDetectorRef, computed, signal, effect, afterNextRender, Directive, Input } from '@angular/core';
|
|
4
4
|
import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
|
|
5
5
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
6
6
|
|
|
@@ -30,6 +30,11 @@ class TuiAppearance {
|
|
|
30
30
|
this.el = tuiInjectElement();
|
|
31
31
|
this.nothing = tuiWithStyles(TuiAppearanceStyles);
|
|
32
32
|
this.modes = computed((mode = this.mode()) => !mode || tuiIsString(mode) ? mode : mode.join(' '));
|
|
33
|
+
// TODO: refactor to signal inputs after Angular update
|
|
34
|
+
this.appearance = signal(inject(TUI_APPEARANCE_OPTIONS).appearance);
|
|
35
|
+
this.state = signal(null);
|
|
36
|
+
this.focus = signal(null);
|
|
37
|
+
this.mode = signal(null);
|
|
33
38
|
// TODO: Remove when Angular is updated
|
|
34
39
|
this.update = effect(() => {
|
|
35
40
|
this.mode();
|
|
@@ -39,11 +44,6 @@ class TuiAppearance {
|
|
|
39
44
|
this.cdr.detectChanges();
|
|
40
45
|
}
|
|
41
46
|
}, TUI_ALLOW_SIGNAL_WRITES);
|
|
42
|
-
// TODO: refactor to signal inputs after Angular update
|
|
43
|
-
this.appearance = signal(inject(TUI_APPEARANCE_OPTIONS).appearance);
|
|
44
|
-
this.state = signal(null);
|
|
45
|
-
this.focus = signal(null);
|
|
46
|
-
this.mode = signal(null);
|
|
47
47
|
afterNextRender(() => {
|
|
48
48
|
this.el.classList.toggle('tui-appearance-initializing',
|
|
49
49
|
// Triggering reflow so there's no transition
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-directives-appearance.mjs","sources":["../../../projects/core/directives/appearance/appearance.options.ts","../../../projects/core/directives/appearance/appearance.directive.ts","../../../projects/core/directives/appearance/appearance.bindings.ts","../../../projects/core/directives/appearance/with-appearance.ts","../../../projects/core/directives/appearance/taiga-ui-core-directives-appearance.ts"],"sourcesContent":["import {type ExistingProvider, InjectionToken, type ProviderToken} from '@angular/core';\nimport {type TuiLooseUnion} from '@taiga-ui/cdk/types';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\n\n/**\n * Bundled appearances for autocomplete purposes, not exported on purpose\n */\ntype Appearance = TuiLooseUnion<\n | 'accent'\n | 'action-destructive'\n | 'action-grayscale'\n | 'action'\n | 'flat-destructive'\n | 'flat-grayscale'\n | 'flat'\n | 'floating'\n | 'glass'\n | 'icon'\n | 'info'\n | 'negative'\n | 'neutral'\n | 'outline-destructive'\n | 'outline-grayscale'\n | 'outline'\n | 'positive'\n | 'primary-destructive'\n | 'primary-grayscale'\n | 'primary'\n | 'secondary-destructive'\n | 'secondary-grayscale'\n | 'secondary'\n | 'textfield'\n | 'warning'\n>;\n\nexport interface TuiAppearanceOptions {\n readonly appearance: Appearance;\n}\n\nexport const TUI_APPEARANCE_DEFAULT_OPTIONS: TuiAppearanceOptions = {\n appearance: '',\n};\n\nexport const TUI_APPEARANCE_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_APPEARANCE_OPTIONS' : '',\n {\n factory: () => TUI_APPEARANCE_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiAppearanceOptionsProvider(\n token: ProviderToken<TuiAppearanceOptions>,\n): ExistingProvider {\n return tuiProvide(TUI_APPEARANCE_OPTIONS, token);\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n Directive,\n effect,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsString, tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiInteractiveState} from '@taiga-ui/core/types';\n\nimport {TUI_APPEARANCE_OPTIONS, type TuiAppearanceOptions} from './appearance.options';\n\n@Component({\n standalone: true,\n template: '',\n styles: ['@import \"@taiga-ui/core/styles/components/appearance.less\";'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tui-appearance',\n },\n})\nclass TuiAppearanceStyles {}\n\n@Directive({\n standalone: true,\n selector: '[tuiAppearance]',\n host: {\n class: 'tui-appearance-initializing',\n tuiAppearance: '',\n '[attr.data-appearance]': 'appearance()',\n '[attr.data-state]': 'state()',\n '[attr.data-focus]': 'focus()',\n '[attr.data-mode]': 'modes()',\n },\n})\nexport class TuiAppearance {\n private readonly cdr = inject(ChangeDetectorRef, {skipSelf: true});\n private readonly el = tuiInjectElement();\n\n protected readonly nothing = tuiWithStyles(TuiAppearanceStyles);\n protected readonly modes = computed((mode = this.mode()) =>\n !mode || tuiIsString(mode) ? mode : mode.join(' '),\n );\n\n // TODO: Remove when Angular is updated\n protected readonly update = effect(() => {\n this.mode();\n this.state();\n this.focus();\n\n if (this.el.matches('tui-textfield[multi]')) {\n this.cdr.detectChanges();\n }\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n // TODO: refactor to signal inputs after Angular update\n public readonly appearance = signal(inject(TUI_APPEARANCE_OPTIONS).appearance);\n public readonly state = signal<TuiInteractiveState | null>(null);\n public readonly focus = signal<boolean | null>(null);\n public readonly mode = signal<string | readonly string[] | null>(null);\n\n constructor() {\n afterNextRender(() => {\n this.el.classList.toggle(\n 'tui-appearance-initializing',\n // Triggering reflow so there's no transition\n !!this.el.offsetWidth && false,\n );\n });\n }\n\n @Input()\n public set tuiAppearance(appearance: TuiAppearanceOptions['appearance']) {\n this.appearance.set(appearance);\n }\n\n @Input()\n public set tuiAppearanceState(state: TuiInteractiveState | null) {\n this.state.set(state);\n }\n\n @Input()\n public set tuiAppearanceFocus(focus: boolean | null) {\n this.focus.set(focus);\n }\n\n @Input()\n public set tuiAppearanceMode(mode: string | readonly string[] | null) {\n this.mode.set(mode);\n }\n}\n","import {type InjectOptions, type Signal, type WritableSignal} from '@angular/core';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiInteractiveState} from '@taiga-ui/core/types';\n\nimport {TuiAppearance} from './appearance.directive';\n\ntype A = string;\n\ntype S = TuiInteractiveState | null;\n\ntype F = boolean | null;\n\ntype M = string | readonly string[] | null;\n\nexport function tuiAppearance(\n value: A | WritableSignal<A>,\n options?: InjectOptions,\n): WritableSignal<A>;\nexport function tuiAppearance(value: Signal<A>, options?: InjectOptions): Signal<A>;\nexport function tuiAppearance(value: A | Signal<A>, options?: InjectOptions): Signal<A> {\n return tuiDirectiveBinding(TuiAppearance, 'appearance', value, options);\n}\n\nexport function tuiAppearanceState(\n value: S | WritableSignal<S>,\n options?: InjectOptions,\n): WritableSignal<S>;\nexport function tuiAppearanceState(value: Signal<S>, options?: InjectOptions): Signal<S>;\nexport function tuiAppearanceState(\n value: S | Signal<S>,\n options?: InjectOptions,\n): Signal<S> {\n return tuiDirectiveBinding(TuiAppearance, 'state', value, options);\n}\n\nexport function tuiAppearanceFocus(\n value: F | WritableSignal<F>,\n options?: InjectOptions,\n): WritableSignal<F>;\nexport function tuiAppearanceFocus(value: Signal<F>, options?: InjectOptions): Signal<F>;\nexport function tuiAppearanceFocus(\n value: F | Signal<F>,\n options?: InjectOptions,\n): Signal<F> {\n return tuiDirectiveBinding(TuiAppearance, 'focus', value, options);\n}\n\nexport function tuiAppearanceMode(\n value: M | WritableSignal<M>,\n options?: InjectOptions,\n): WritableSignal<M>;\nexport function tuiAppearanceMode(value: Signal<M>, options?: InjectOptions): Signal<M>;\nexport function tuiAppearanceMode(\n value: M | Signal<M>,\n options?: InjectOptions,\n): Signal<M> {\n return tuiDirectiveBinding(TuiAppearance, 'mode', value, options);\n}\n","import {Directive} from '@angular/core';\n\nimport {TuiAppearance} from './appearance.directive';\n\n@Directive({\n standalone: true,\n hostDirectives: [\n {\n directive: TuiAppearance,\n inputs: [\n 'tuiAppearance: appearance',\n 'tuiAppearanceState',\n 'tuiAppearanceFocus',\n 'tuiAppearanceMode',\n ],\n },\n ],\n})\nexport class TuiWithAppearance {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.TuiAppearance"],"mappings":";;;;;;AAuCa,MAAA,8BAA8B,GAAyB;AAChE,IAAA,UAAU,EAAE,EAAE;EAChB;AAEW,MAAA,sBAAsB,GAAG,IAAI,cAAc,CACpD,SA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A,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,cAAc,EAAE;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,aAAa;AACxB,4BAAA,MAAM,EAAE;gCACJ,2BAA2B;gCAC3B,oBAAoB;gCACpB,oBAAoB;gCACpB,mBAAmB;AACtB,6BAAA;AACJ,yBAAA;AACJ,qBAAA;AACJ,iBAAA,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-directives-appearance.mjs","sources":["../../../projects/core/directives/appearance/appearance.options.ts","../../../projects/core/directives/appearance/appearance.directive.ts","../../../projects/core/directives/appearance/appearance.bindings.ts","../../../projects/core/directives/appearance/with-appearance.ts","../../../projects/core/directives/appearance/taiga-ui-core-directives-appearance.ts"],"sourcesContent":["import {type ExistingProvider, InjectionToken, type ProviderToken} from '@angular/core';\nimport {type TuiLooseUnion} from '@taiga-ui/cdk/types';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';\n\n/**\n * Bundled appearances for autocomplete purposes, not exported on purpose\n */\ntype Appearance = TuiLooseUnion<\n | 'accent'\n | 'action-destructive'\n | 'action-grayscale'\n | 'action'\n | 'flat-destructive'\n | 'flat-grayscale'\n | 'flat'\n | 'floating'\n | 'glass'\n | 'icon'\n | 'info'\n | 'negative'\n | 'neutral'\n | 'outline-destructive'\n | 'outline-grayscale'\n | 'outline'\n | 'positive'\n | 'primary-destructive'\n | 'primary-grayscale'\n | 'primary'\n | 'secondary-destructive'\n | 'secondary-grayscale'\n | 'secondary'\n | 'textfield'\n | 'warning'\n>;\n\nexport interface TuiAppearanceOptions {\n readonly appearance: Appearance;\n}\n\nexport const TUI_APPEARANCE_DEFAULT_OPTIONS: TuiAppearanceOptions = {\n appearance: '',\n};\n\nexport const TUI_APPEARANCE_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_APPEARANCE_OPTIONS' : '',\n {\n factory: () => TUI_APPEARANCE_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiAppearanceOptionsProvider(\n token: ProviderToken<TuiAppearanceOptions>,\n): ExistingProvider {\n return tuiProvide(TUI_APPEARANCE_OPTIONS, token);\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n computed,\n Directive,\n effect,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_ALLOW_SIGNAL_WRITES} from '@taiga-ui/cdk/constants';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsString, tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiInteractiveState} from '@taiga-ui/core/types';\n\nimport {TUI_APPEARANCE_OPTIONS, type TuiAppearanceOptions} from './appearance.options';\n\n@Component({\n standalone: true,\n template: '',\n styles: ['@import \"@taiga-ui/core/styles/components/appearance.less\";'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tui-appearance',\n },\n})\nclass TuiAppearanceStyles {}\n\n@Directive({\n standalone: true,\n selector: '[tuiAppearance]',\n host: {\n class: 'tui-appearance-initializing',\n tuiAppearance: '',\n '[attr.data-appearance]': 'appearance()',\n '[attr.data-state]': 'state()',\n '[attr.data-focus]': 'focus()',\n '[attr.data-mode]': 'modes()',\n },\n})\nexport class TuiAppearance {\n private readonly cdr = inject(ChangeDetectorRef, {skipSelf: true});\n private readonly el = tuiInjectElement();\n\n protected readonly nothing = tuiWithStyles(TuiAppearanceStyles);\n protected readonly modes = computed((mode = this.mode()) =>\n !mode || tuiIsString(mode) ? mode : mode.join(' '),\n );\n\n // TODO: refactor to signal inputs after Angular update\n public readonly appearance = signal(inject(TUI_APPEARANCE_OPTIONS).appearance);\n public readonly state = signal<TuiInteractiveState | null>(null);\n public readonly focus = signal<boolean | null>(null);\n public readonly mode = signal<string | readonly string[] | null>(null);\n\n // TODO: Remove when Angular is updated\n public readonly update = effect(() => {\n this.mode();\n this.state();\n this.focus();\n\n if (this.el.matches('tui-textfield[multi]')) {\n this.cdr.detectChanges();\n }\n }, TUI_ALLOW_SIGNAL_WRITES);\n\n constructor() {\n afterNextRender(() => {\n this.el.classList.toggle(\n 'tui-appearance-initializing',\n // Triggering reflow so there's no transition\n !!this.el.offsetWidth && false,\n );\n });\n }\n\n @Input()\n public set tuiAppearance(appearance: TuiAppearanceOptions['appearance']) {\n this.appearance.set(appearance);\n }\n\n @Input()\n public set tuiAppearanceState(state: TuiInteractiveState | null) {\n this.state.set(state);\n }\n\n @Input()\n public set tuiAppearanceFocus(focus: boolean | null) {\n this.focus.set(focus);\n }\n\n @Input()\n public set tuiAppearanceMode(mode: string | readonly string[] | null) {\n this.mode.set(mode);\n }\n}\n","import {type InjectOptions, type Signal, type WritableSignal} from '@angular/core';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiInteractiveState} from '@taiga-ui/core/types';\n\nimport {TuiAppearance} from './appearance.directive';\n\ntype A = string;\n\ntype S = TuiInteractiveState | null;\n\ntype F = boolean | null;\n\ntype M = string | readonly string[] | null;\n\nexport function tuiAppearance(\n value: A | WritableSignal<A>,\n options?: InjectOptions,\n): WritableSignal<A>;\nexport function tuiAppearance(value: Signal<A>, options?: InjectOptions): Signal<A>;\nexport function tuiAppearance(value: A | Signal<A>, options?: InjectOptions): Signal<A> {\n return tuiDirectiveBinding(TuiAppearance, 'appearance', value, options);\n}\n\nexport function tuiAppearanceState(\n value: S | WritableSignal<S>,\n options?: InjectOptions,\n): WritableSignal<S>;\nexport function tuiAppearanceState(value: Signal<S>, options?: InjectOptions): Signal<S>;\nexport function tuiAppearanceState(\n value: S | Signal<S>,\n options?: InjectOptions,\n): Signal<S> {\n return tuiDirectiveBinding(TuiAppearance, 'state', value, options);\n}\n\nexport function tuiAppearanceFocus(\n value: F | WritableSignal<F>,\n options?: InjectOptions,\n): WritableSignal<F>;\nexport function tuiAppearanceFocus(value: Signal<F>, options?: InjectOptions): Signal<F>;\nexport function tuiAppearanceFocus(\n value: F | Signal<F>,\n options?: InjectOptions,\n): Signal<F> {\n return tuiDirectiveBinding(TuiAppearance, 'focus', value, options);\n}\n\nexport function tuiAppearanceMode(\n value: M | WritableSignal<M>,\n options?: InjectOptions,\n): WritableSignal<M>;\nexport function tuiAppearanceMode(value: Signal<M>, options?: InjectOptions): Signal<M>;\nexport function tuiAppearanceMode(\n value: M | Signal<M>,\n options?: InjectOptions,\n): Signal<M> {\n return tuiDirectiveBinding(TuiAppearance, 'mode', value, options);\n}\n","import {Directive} from '@angular/core';\n\nimport {TuiAppearance} from './appearance.directive';\n\n@Directive({\n standalone: true,\n hostDirectives: [\n {\n directive: TuiAppearance,\n inputs: [\n 'tuiAppearance: appearance',\n 'tuiAppearanceState',\n 'tuiAppearanceFocus',\n 'tuiAppearanceMode',\n ],\n },\n ],\n})\nexport class TuiWithAppearance {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.TuiAppearance"],"mappings":";;;;;;AAuCa,MAAA,8BAA8B,GAAyB;AAChE,IAAA,UAAU,EAAE,EAAE;EAChB;AAEW,MAAA,sBAAsB,GAAG,IAAI,cAAc,CACpD,SAAS,GAAG,wBAAwB,GAAG,EAAE,EACzC;AACI,IAAA,OAAO,EAAE,MAAM,8BAA8B;AAChD,CAAA,EACH;AAEI,SAAU,4BAA4B,CACxC,KAA0C,EAAA;AAE1C,IAAA,OAAO,UAAU,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AACrD;;AClCA,MAUM,mBAAmB,CAAA;+GAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA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([data-mode]) {
|
|
30
31
|
box-shadow: inset 0 0 0 1px var(--tui-status-negative-pale-hover);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
&:checked:invalid:not([data-mode]),
|
|
34
|
-
&[data-mode~='checked'][data-mode~='invalid']
|
|
35
|
+
&[data-mode~='checked'][data-mode~='invalid'],
|
|
36
|
+
&:checked.tui-invalid:not([data-mode]) {
|
|
35
37
|
box-shadow: inset 0 0 0 2px var(--tui-status-negative);
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
&:invalid:not([data-mode]),
|
|
34
|
-
&[data-mode~='invalid']
|
|
34
|
+
&[data-mode~='invalid'],
|
|
35
|
+
&.tui-invalid:not([data-mode]) {
|
|
35
36
|
background: var(--tui-status-negative);
|
|
36
37
|
color: #fff;
|
|
37
38
|
|
|
@@ -48,7 +49,8 @@
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
&:invalid:not([data-mode]),
|
|
51
|
-
&[data-mode~='invalid']
|
|
52
|
+
&[data-mode~='invalid'],
|
|
53
|
+
&.tui-invalid:not([data-mode]) {
|
|
52
54
|
color: var(--tui-text-negative);
|
|
53
55
|
background: var(--tui-status-negative-pale);
|
|
54
56
|
|