@taiga-ui/core 4.52.0-canary.6c67ccf → 4.52.0-canary.9fae831
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/button/button.options.d.ts +1 -1
- package/components/dialog/active-zone-adapter.directive.d.ts +11 -0
- package/components/error/error.component.d.ts +5 -7
- package/components/error/error.d.ts +4 -0
- package/components/error/error.directive.d.ts +19 -0
- package/components/error/error.pipe.d.ts +10 -0
- package/components/error/index.d.ts +3 -0
- package/components/icon/icon.component.d.ts +1 -1
- package/components/notification/notification.options.d.ts +1 -1
- package/components/root/root.component.d.ts +5 -6
- package/components/scrollbar/scrollbar.options.d.ts +1 -1
- package/components/textfield/textfield-icon.d.ts +3 -3
- package/directives/appearance/appearance.directive.d.ts +5 -13
- package/directives/icons/icons.bindings.d.ts +5 -0
- package/directives/icons/icons.directive.d.ts +6 -14
- package/directives/icons/index.d.ts +1 -0
- package/fesm2022/taiga-ui-core-components-button.mjs +2 -2
- package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-data-list.mjs +6 -6
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-dialog.mjs +36 -2
- package/fesm2022/taiga-ui-core-components-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +106 -22
- package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-fullscreen.mjs +13 -2
- package/fesm2022/taiga-ui-core-components-fullscreen.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-icon.mjs +2 -2
- package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-notification.mjs +3 -2
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +19 -36
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-textfield.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +15 -49
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-hint.mjs +2 -2
- package/fesm2022/taiga-ui-core-directives-hint.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs +26 -33
- package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes.mjs +0 -1
- package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-tokens.mjs +7 -2
- package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +49 -3
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
- package/package.json +1 -5
- package/pipes/index.d.ts +0 -1
- package/styles/components/button.less +0 -2
- package/styles/components/icons.less +4 -4
- package/styles/mixins/mixins.less +0 -1
- package/styles/mixins/mixins.scss +0 -1
- package/tokens/index.d.ts +1 -0
- package/tokens/validation-errors.d.ts +4 -0
- package/utils/miscellaneous/index.d.ts +1 -0
- package/utils/miscellaneous/provide-taiga.d.ts +13 -0
- package/fesm2022/taiga-ui-core-pipes-fallback-src.mjs +0 -29
- package/fesm2022/taiga-ui-core-pipes-fallback-src.mjs.map +0 -1
- package/pipes/fallback-src/fallback-src.pipe.d.ts +0 -9
- package/pipes/fallback-src/index.d.ts +0 -1
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { tuiProvide, tuiWithStyles, tuiIsString, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, ChangeDetectionStrategy, ViewEncapsulation, Component,
|
|
4
|
-
import { TUI_ALLOW_SIGNAL_WRITES } from '@taiga-ui/cdk/constants';
|
|
3
|
+
import { InjectionToken, ChangeDetectionStrategy, ViewEncapsulation, Component, computed, input, inject, Directive } from '@angular/core';
|
|
5
4
|
import * as i1 from '@taiga-ui/cdk/directives/transitioned';
|
|
6
5
|
import { TuiTransitioned } from '@taiga-ui/cdk/directives/transitioned';
|
|
7
|
-
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
8
6
|
|
|
9
7
|
const TUI_APPEARANCE_DEFAULT_OPTIONS = {
|
|
10
8
|
appearance: '',
|
|
@@ -28,39 +26,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
28
26
|
}] });
|
|
29
27
|
class TuiAppearance {
|
|
30
28
|
constructor() {
|
|
31
|
-
this.cdr = inject(ChangeDetectorRef, { skipSelf: true });
|
|
32
|
-
this.el = tuiInjectElement();
|
|
33
29
|
this.nothing = tuiWithStyles(TuiAppearanceStyles);
|
|
34
|
-
this.modes = computed((mode = this.
|
|
35
|
-
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.mode = signal(null);
|
|
40
|
-
// TODO: Remove when Angular is updated
|
|
41
|
-
this.update = effect(() => {
|
|
42
|
-
this.mode();
|
|
43
|
-
this.state();
|
|
44
|
-
this.focus();
|
|
45
|
-
if (this.el.matches('tui-textfield[multi]')) {
|
|
46
|
-
this.cdr.detectChanges();
|
|
47
|
-
}
|
|
48
|
-
}, TUI_ALLOW_SIGNAL_WRITES);
|
|
49
|
-
}
|
|
50
|
-
set tuiAppearance(appearance) {
|
|
51
|
-
this.appearance.set(appearance);
|
|
52
|
-
}
|
|
53
|
-
set tuiAppearanceState(state) {
|
|
54
|
-
this.state.set(state);
|
|
55
|
-
}
|
|
56
|
-
set tuiAppearanceFocus(focus) {
|
|
57
|
-
this.focus.set(focus);
|
|
58
|
-
}
|
|
59
|
-
set tuiAppearanceMode(mode) {
|
|
60
|
-
this.mode.set(mode);
|
|
30
|
+
this.modes = computed((mode = this.tuiAppearanceMode()) => !mode || tuiIsString(mode) ? mode : mode.join(' '));
|
|
31
|
+
this.tuiAppearance = input(inject(TUI_APPEARANCE_OPTIONS).appearance);
|
|
32
|
+
this.tuiAppearanceState = input(null);
|
|
33
|
+
this.tuiAppearanceFocus = input(null);
|
|
34
|
+
this.tuiAppearanceMode = input(null);
|
|
61
35
|
}
|
|
62
36
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAppearance, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
63
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
37
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiAppearance, isStandalone: true, selector: "[tuiAppearance]", inputs: { tuiAppearance: { classPropertyName: "tuiAppearance", publicName: "tuiAppearance", isSignal: true, isRequired: false, transformFunction: null }, tuiAppearanceState: { classPropertyName: "tuiAppearanceState", publicName: "tuiAppearanceState", isSignal: true, isRequired: false, transformFunction: null }, tuiAppearanceFocus: { classPropertyName: "tuiAppearanceFocus", publicName: "tuiAppearanceFocus", isSignal: true, isRequired: false, transformFunction: null }, tuiAppearanceMode: { classPropertyName: "tuiAppearanceMode", publicName: "tuiAppearanceMode", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tuiAppearance": "" }, properties: { "attr.data-appearance": "tuiAppearance()", "attr.data-state": "tuiAppearanceState()", "attr.data-focus": "tuiAppearanceFocus()", "attr.data-mode": "modes()" } }, hostDirectives: [{ directive: i1.TuiTransitioned }], ngImport: i0 }); }
|
|
64
38
|
}
|
|
65
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiAppearance, decorators: [{
|
|
66
40
|
type: Directive,
|
|
@@ -70,33 +44,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
70
44
|
hostDirectives: [TuiTransitioned],
|
|
71
45
|
host: {
|
|
72
46
|
tuiAppearance: '',
|
|
73
|
-
'[attr.data-appearance]': '
|
|
74
|
-
'[attr.data-state]': '
|
|
75
|
-
'[attr.data-focus]': '
|
|
47
|
+
'[attr.data-appearance]': 'tuiAppearance()',
|
|
48
|
+
'[attr.data-state]': 'tuiAppearanceState()',
|
|
49
|
+
'[attr.data-focus]': 'tuiAppearanceFocus()',
|
|
76
50
|
'[attr.data-mode]': 'modes()',
|
|
77
51
|
},
|
|
78
52
|
}]
|
|
79
|
-
}]
|
|
80
|
-
type: Input
|
|
81
|
-
}], tuiAppearanceState: [{
|
|
82
|
-
type: Input
|
|
83
|
-
}], tuiAppearanceFocus: [{
|
|
84
|
-
type: Input
|
|
85
|
-
}], tuiAppearanceMode: [{
|
|
86
|
-
type: Input
|
|
87
|
-
}] } });
|
|
53
|
+
}] });
|
|
88
54
|
|
|
89
55
|
function tuiAppearance(value, options) {
|
|
90
|
-
return tuiDirectiveBinding(TuiAppearance, '
|
|
56
|
+
return tuiDirectiveBinding(TuiAppearance, 'tuiAppearance', value, options);
|
|
91
57
|
}
|
|
92
58
|
function tuiAppearanceState(value, options) {
|
|
93
|
-
return tuiDirectiveBinding(TuiAppearance, '
|
|
59
|
+
return tuiDirectiveBinding(TuiAppearance, 'tuiAppearanceState', value, options);
|
|
94
60
|
}
|
|
95
61
|
function tuiAppearanceFocus(value, options) {
|
|
96
|
-
return tuiDirectiveBinding(TuiAppearance, '
|
|
62
|
+
return tuiDirectiveBinding(TuiAppearance, 'tuiAppearanceFocus', value, options);
|
|
97
63
|
}
|
|
98
64
|
function tuiAppearanceMode(value, options) {
|
|
99
|
-
return tuiDirectiveBinding(TuiAppearance, '
|
|
65
|
+
return tuiDirectiveBinding(TuiAppearance, 'tuiAppearanceMode', value, options);
|
|
100
66
|
}
|
|
101
67
|
|
|
102
68
|
class TuiWithAppearance {
|
|
@@ -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 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 {TuiTransitioned} from '@taiga-ui/cdk/directives/transitioned';\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 hostDirectives: [TuiTransitioned],\n host: {\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 @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;;AAGL,MAAA,sBAAsB,GAAG,IAAI,cAAc,CACpD,SAAS,GAAG,wBAAwB,GAAG,EAAE,EACzC;AACI,IAAA,OAAO,EAAE,MAAM,8BAA8B;AAChD,CAAA;AAGC,SAAU,4BAA4B,CACxC,KAA0C,EAAA;AAE1C,IAAA,OAAO,UAAU,CAAC,sBAAsB,EAAE,KAAK,CAAC;AACpD;;AClCA,MAUM,mBAAmB,CAAA;+GAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mBAAmB,oHARX,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,+gCAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FAQV,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAVxB,SAAS;iCACM,IAAI,EAAA,QAAA,EACN,EAAE,EA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AAA,EAAA,CAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAd7B,SAAS;AAAC,YAAA,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;;;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 ChangeDetectionStrategy,\n Component,\n computed,\n Directive,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiTransitioned} from '@taiga-ui/cdk/directives/transitioned';\nimport {tuiIsString, tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiInteractiveState} from '@taiga-ui/core/types';\n\nimport {TUI_APPEARANCE_OPTIONS} 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 hostDirectives: [TuiTransitioned],\n host: {\n tuiAppearance: '',\n '[attr.data-appearance]': 'tuiAppearance()',\n '[attr.data-state]': 'tuiAppearanceState()',\n '[attr.data-focus]': 'tuiAppearanceFocus()',\n '[attr.data-mode]': 'modes()',\n },\n})\nexport class TuiAppearance {\n protected readonly nothing = tuiWithStyles(TuiAppearanceStyles);\n protected readonly modes = computed((mode = this.tuiAppearanceMode()) =>\n !mode || tuiIsString(mode) ? mode : mode.join(' '),\n );\n\n public readonly tuiAppearance = input(inject(TUI_APPEARANCE_OPTIONS).appearance);\n public readonly tuiAppearanceState = input<TuiInteractiveState | null>(null);\n public readonly tuiAppearanceFocus = input<boolean | null>(null);\n public readonly tuiAppearanceMode = input<string | readonly string[] | null>(null);\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, 'tuiAppearance', 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, 'tuiAppearanceState', 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, 'tuiAppearanceFocus', 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, 'tuiAppearanceMode', 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;;AAGL,MAAA,sBAAsB,GAAG,IAAI,cAAc,CACpD,SAAS,GAAG,wBAAwB,GAAG,EAAE,EACzC;AACI,IAAA,OAAO,EAAE,MAAM,8BAA8B;AAChD,CAAA;AAGC,SAAU,4BAA4B,CACxC,KAA0C,EAAA;AAE1C,IAAA,OAAO,UAAU,CAAC,sBAAsB,EAAE,KAAK,CAAC;AACpD;;ACvCA,MAUM,mBAAmB,CAAA;+GAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mBAAmB,oHARX,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,+gCAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FAQV,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAVxB,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,gBAAgB;AAC1B,qBAAA,EAAA,MAAA,EAAA,CAAA,+gCAAA,CAAA,EAAA;;MAgBQ,aAAa,CAAA;AAZ1B,IAAA,WAAA,GAAA;AAauB,Q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CAAC;AACnF;AAOgB,SAAA,iBAAiB,CAC7B,KAAoB,EACpB,OAAuB,EAAA;IAEvB,OAAO,mBAAmB,CAAC,aAAa,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC;AAClF;;MCvCa,iBAAiB,CAAA;+GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAA,aAAA,EAAA,MAAA,EAAA,CAAA,eAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,mBAAA,EAAA,mBAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAd7B,SAAS;AAAC,YAAA,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;;;ACjBD;;AAEG;;;;"}
|
|
@@ -25,7 +25,7 @@ import { TUI_IS_TOUCH, TUI_RANGE } from '@taiga-ui/cdk/tokens';
|
|
|
25
25
|
import { shouldCall } from '@taiga-ui/event-plugins';
|
|
26
26
|
import * as i1$1 from '@taiga-ui/cdk/directives/obscured';
|
|
27
27
|
import { TuiObscured } from '@taiga-ui/cdk/directives/obscured';
|
|
28
|
-
import { tuiIsNativeKeyboardFocusable, tuiGetClosestFocusable,
|
|
28
|
+
import { tuiIsNativeKeyboardFocusable, tuiGetClosestFocusable, tuiIsFocusedIn, tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
|
|
29
29
|
import { tuiIsEditingKey, tuiOverrideOptions as tuiOverrideOptions$1 } from '@taiga-ui/core/utils/miscellaneous';
|
|
30
30
|
|
|
31
31
|
class TuiDropdownDriver extends BehaviorSubject {
|
|
@@ -540,7 +540,7 @@ class TuiDropdownOpen {
|
|
|
540
540
|
return tuiIsElementEditable(this.host);
|
|
541
541
|
}
|
|
542
542
|
get focused() {
|
|
543
|
-
return
|
|
543
|
+
return tuiIsFocusedIn(this.host) || tuiIsFocusedIn(this.dropdown());
|
|
544
544
|
}
|
|
545
545
|
update(open) {
|
|
546
546
|
if (open && !this.tuiDropdownEnabled) {
|
|
@@ -863,7 +863,7 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
863
863
|
return this.el.querySelector('tui-textfield .t-ghost') || this.el;
|
|
864
864
|
}
|
|
865
865
|
getRange() {
|
|
866
|
-
const active =
|
|
866
|
+
const active = tuiGetFocused(this.doc);
|
|
867
867
|
const selection = this.doc.getSelection();
|
|
868
868
|
const range = active && tuiIsTextfield(active) && this.el.contains(active)
|
|
869
869
|
? this.veryVerySadInputFix(active)
|