@tailng-ui/primitives 0.18.0 → 0.20.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailng-ui/primitives",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  }
17
17
  },
18
18
  "dependencies": {
19
- "@tailng-ui/cdk": "^0.15.0"
19
+ "@tailng-ui/cdk": "^0.16.0"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@angular/core": "^21.1.0",
@@ -1,12 +1,12 @@
1
1
  import * as i0 from "@angular/core";
2
2
  export declare class TngPrefix {
3
- readonly hostElement: any;
3
+ readonly hostElement: HTMLElement;
4
4
  protected readonly dataSlot: "input-leading";
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<TngPrefix, never>;
6
6
  static ɵdir: i0.ɵɵDirectiveDeclaration<TngPrefix, "[tngPrefix], [tngInputLeading]", ["tngPrefix"], {}, {}, never, never, true, never>;
7
7
  }
8
8
  export declare class TngSuffix {
9
- readonly hostElement: any;
9
+ readonly hostElement: HTMLElement;
10
10
  protected readonly dataSlot: "input-trailing";
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<TngSuffix, never>;
12
12
  static ɵdir: i0.ɵɵDirectiveDeclaration<TngSuffix, "[tngSuffix], [tngInputTrailing]", ["tngSuffix"], {}, {}, never, never, true, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"tng-adornment.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/input/tng-adornment.ts"],"names":[],"mappings":";AAEA,qBAIa,SAAS;IACpB,QAAQ,CAAC,WAAW,MAAiD;IAGrE,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,eAAe,CAAU;yCAJ5C,SAAS;2CAAT,SAAS;CAKrB;AAED,qBAIa,SAAS;IACpB,QAAQ,CAAC,WAAW,MAAiD;IAGrE,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,gBAAgB,CAAU;yCAJ7C,SAAS;2CAAT,SAAS;CAKrB"}
1
+ {"version":3,"file":"tng-adornment.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/input/tng-adornment.ts"],"names":[],"mappings":";AAEA,qBAIa,SAAS;IACpB,SAAgB,WAAW,EAAE,WAAW,CAAgE;IAGxG,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,eAAe,CAAU;yCAJ5C,SAAS;2CAAT,SAAS;CAKrB;AAED,qBAIa,SAAS;IACpB,SAAgB,WAAW,EAAE,WAAW,CAAgE;IAGxG,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,gBAAgB,CAAU;yCAJ7C,SAAS;2CAAT,SAAS;CAKrB"}
@@ -1,4 +1,4 @@
1
- import { Directive, ElementRef, HostBinding, inject } from "@angular/core";
1
+ import { Directive, ElementRef, HostBinding, inject } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export class TngPrefix {
4
4
  hostElement = inject((ElementRef)).nativeElement;
@@ -1 +1 @@
1
- {"version":3,"file":"tng-adornment.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/input/tng-adornment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAM3E,MAAM,OAAO,SAAS;IACX,WAAW,GAAG,MAAM,CAAC,CAAA,UAAuB,CAAA,CAAC,CAAC,aAAa,CAAC;IAGlD,QAAQ,GAAG,eAAwB,CAAC;uGAJ5C,SAAS;2FAAT,SAAS;;2FAAT,SAAS;kBAJrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,gCAAgC;oBAC1C,QAAQ,EAAE,WAAW;iBACtB;;sBAIE,WAAW;uBAAC,gBAAgB;;AAQ/B,MAAM,OAAO,SAAS;IACX,WAAW,GAAG,MAAM,CAAC,CAAA,UAAuB,CAAA,CAAC,CAAC,aAAa,CAAC;IAGlD,QAAQ,GAAG,gBAAyB,CAAC;uGAJ7C,SAAS;2FAAT,SAAS;;2FAAT,SAAS;kBAJrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,iCAAiC;oBAC3C,QAAQ,EAAE,WAAW;iBACtB;;sBAIE,WAAW;uBAAC,gBAAgB","sourcesContent":["import { Directive, ElementRef, HostBinding, inject } from \"@angular/core\";\n\n@Directive({\n selector: '[tngPrefix], [tngInputLeading]',\n exportAs: 'tngPrefix',\n})\nexport class TngPrefix {\n readonly hostElement = inject(ElementRef<HTMLElement>).nativeElement;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-leading' as const;\n}\n\n@Directive({\n selector: '[tngSuffix], [tngInputTrailing]',\n exportAs: 'tngSuffix',\n})\nexport class TngSuffix {\n readonly hostElement = inject(ElementRef<HTMLElement>).nativeElement;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-trailing' as const;\n}\n\n"]}
1
+ {"version":3,"file":"tng-adornment.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/input/tng-adornment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAM3E,MAAM,OAAO,SAAS;IACJ,WAAW,GAAgB,MAAM,CAAC,CAAA,UAAuB,CAAA,CAAC,CAAC,aAA4B,CAAC;IAGrF,QAAQ,GAAG,eAAwB,CAAC;uGAJ5C,SAAS;2FAAT,SAAS;;2FAAT,SAAS;kBAJrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,gCAAgC;oBAC1C,QAAQ,EAAE,WAAW;iBACtB;;sBAIE,WAAW;uBAAC,gBAAgB;;AAQ/B,MAAM,OAAO,SAAS;IACJ,WAAW,GAAgB,MAAM,CAAC,CAAA,UAAuB,CAAA,CAAC,CAAC,aAA4B,CAAC;IAGrF,QAAQ,GAAG,gBAAyB,CAAC;uGAJ7C,SAAS;2FAAT,SAAS;;2FAAT,SAAS;kBAJrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,iCAAiC;oBAC3C,QAAQ,EAAE,WAAW;iBACtB;;sBAIE,WAAW;uBAAC,gBAAgB","sourcesContent":["import { Directive, ElementRef, HostBinding, inject } from '@angular/core';\n\n@Directive({\n selector: '[tngPrefix], [tngInputLeading]',\n exportAs: 'tngPrefix',\n})\nexport class TngPrefix {\n public readonly hostElement: HTMLElement = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-leading' as const;\n}\n\n@Directive({\n selector: '[tngSuffix], [tngInputTrailing]',\n exportAs: 'tngSuffix',\n})\nexport class TngSuffix {\n public readonly hostElement: HTMLElement = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-trailing' as const;\n}\n"]}
@@ -1,7 +1,6 @@
1
- import type { OnDestroy, AfterContentInit, QueryList } from "@angular/core";
2
- import { TngPrefix } from "./tng-adornment";
3
- import { TngSuffix } from "./tng-adornment";
4
- import { TngInput } from "./tng-input";
1
+ import type { AfterContentInit, OnDestroy, QueryList } from '@angular/core';
2
+ import { TngPrefix, TngSuffix } from './tng-adornment';
3
+ import { TngInput } from './tng-input';
5
4
  import * as i0 from "@angular/core";
6
5
  export declare class TngInputGroup implements AfterContentInit, OnDestroy {
7
6
  readonly hasLeading: import("@angular/core").InputSignal<boolean | null>;
@@ -27,7 +26,7 @@ export declare class TngInputGroup implements AfterContentInit, OnDestroy {
27
26
  protected get dataReadonly(): '' | null;
28
27
  protected get dataFocused(): '' | null;
29
28
  protected onFocusIn(): void;
30
- protected onFocusOut(event: FocusEvent): void;
29
+ protected onFocusOut(nextTarget: Readonly<EventTarget> | null): void;
31
30
  protected hasLeadingSlot(): boolean;
32
31
  protected hasTrailingSlot(): boolean;
33
32
  protected effectiveHasLeading(): boolean;
@@ -35,6 +34,6 @@ export declare class TngInputGroup implements AfterContentInit, OnDestroy {
35
34
  protected primaryControl(): TngInput | null;
36
35
  protected primaryControlElement(): HTMLInputElement | HTMLTextAreaElement | null;
37
36
  static ɵfac: i0.ɵɵFactoryDeclaration<TngInputGroup, never>;
38
- static ɵcmp: i0.ɵɵComponentDeclaration<TngInputGroup, "tng-input-group, [tngInputGroup]", ["tngInputGroup"], { "hasLeading": { "alias": "hasLeading"; "required": false; "isSignal": true; }; "hasTrailing": { "alias": "hasTrailing"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "controlCount": { "alias": "controlCount"; "required": false; "isSignal": true; }; }, {}, ["controls", "prefixSlots", "suffixSlots"], ["[tngPrefix], [tngInputLeading], [data-tng-input-prefix-proxy]", "input[tngInput], textarea[tngInput], [data-tng-input-control-proxy]", "[tngSuffix], [tngInputTrailing], [data-tng-input-suffix-proxy]"], true, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<TngInputGroup, "tng-input-group, [tngInputGroup]", ["tngInputGroup"], { "hasLeading": { "alias": "hasLeading"; "required": false; "isSignal": true; }; "hasTrailing": { "alias": "hasTrailing"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "controlCount": { "alias": "controlCount"; "required": false; "isSignal": true; }; }, {}, ["controls", "prefixSlots", "suffixSlots"], ["[tngPrefix], [tngInputLeading], [data-tng-input-prefix-proxy]", "input[tngInput], textarea[tngInput], textarea[tngTextarea], [data-tng-input-control-proxy]", "[tngSuffix], [tngInputTrailing], [data-tng-input-suffix-proxy]"], true, never>;
39
38
  }
40
39
  //# sourceMappingURL=tng-input-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tng-input-group.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/input/tng-input-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK5E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;;AAgBvC,qBAqBa,aAAc,YAAW,gBAAgB,EAAE,SAAS;IAC/D,SAAgB,UAAU,sDAA+B;IACzD,SAAgB,WAAW,sDAA+B;IAC1D,SAAgB,QAAQ,sDAA+B;IACvD,SAAgB,OAAO,sDAA+B;IACtD,SAAgB,QAAQ,sDAA+B;IACvD,SAAgB,YAAY,qDAA8B;IAG1D,SAAS,CAAC,QAAQ,EAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IAGzC,SAAS,CAAC,WAAW,EAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IAG7C,SAAS,CAAC,WAAW,EAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiD;IAE7E,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;IAElD,OAAO,CAAC,qBAAqB;IAiBtB,kBAAkB,IAAI,IAAI;IAQ1B,WAAW,IAAI,IAAI;IAM1B,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAU;IAGrD,SAAS,KAAK,cAAc,IAAI,EAAE,GAAG,IAAI,CAExC;IAGD,SAAS,KAAK,eAAe,IAAI,EAAE,GAAG,IAAI,CAEzC;IAGD,SAAS,KAAK,YAAY,IAAI,EAAE,GAAG,IAAI,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;IAG7C,SAAS,CAAC,WAAW,EAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6E;IACzG,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;IAElD,OAAO,CAAC,qBAAqB;IAmBtB,kBAAkB,IAAI,IAAI;IAM1B,WAAW,IAAI,IAAI;IAM1B,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAU;IAGrD,SAAS,KAAK,cAAc,IAAI,EAAE,GAAG,IAAI,CAExC;IAGD,SAAS,KAAK,eAAe,IAAI,EAAE,GAAG,IAAI,CAEzC;IAGD,SAAS,KAAK,YAAY,IAAI,EAAE,GAAG,IAAI,CAUtC;IAGD,SAAS,KAAK,WAAW,IAAI,EAAE,GAAG,IAAI,CAWrC;IAGD,SAAS,KAAK,YAAY,IAAI,EAAE,GAAG,IAAI,CAUtC;IAGD,SAAS,KAAK,WAAW,IAAI,EAAE,GAAG,IAAI,CAErC;IAGD,SAAS,CAAC,SAAS,IAAI,IAAI;IAK3B,SAAS,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,IAAI;IAMpE,SAAS,CAAC,cAAc,IAAI,OAAO;IAoBnC,SAAS,CAAC,eAAe,IAAI,OAAO;IAoBpC,SAAS,CAAC,mBAAmB,IAAI,OAAO;IAMxC,SAAS,CAAC,oBAAoB,IAAI,OAAO;IAMzC,SAAS,CAAC,cAAc,IAAI,QAAQ,GAAG,IAAI;IAK3C,SAAS,CAAC,qBAAqB,IAAI,gBAAgB,GAAG,mBAAmB,GAAG,IAAI;yCAlLrE,aAAa;2CAAb,aAAa;CA6LzB"}
@@ -1,21 +1,10 @@
1
- import { Component, ContentChildren, ElementRef, HostBinding, HostListener, inject } from "@angular/core";
2
- import { isDevMode } from "@angular/core";
3
- import { input } from "@angular/core";
4
- import { Subject, takeUntil } from "rxjs";
5
- import { TngPrefix } from "./tng-adornment";
6
- import { TngSuffix } from "./tng-adornment";
7
- import { TngInput } from "./tng-input";
1
+ import { Component, ContentChildren, ElementRef, HostBinding, HostListener, inject, input, isDevMode, } from '@angular/core';
2
+ import { Subject, takeUntil } from 'rxjs';
3
+ import { TngPrefix, TngSuffix } from './tng-adornment';
4
+ import { TngInput } from './tng-input';
8
5
  import * as i0 from "@angular/core";
9
- function hasProjectedContent(element) {
10
- return Array.from(element.childNodes).some((node) => {
11
- if (node.nodeType === Node.ELEMENT_NODE) {
12
- return true;
13
- }
14
- if (node.nodeType === Node.TEXT_NODE) {
15
- return (node.textContent ?? '').trim().length > 0;
16
- }
17
- return false;
18
- });
6
+ function containsProjectedContent(childElementCount, textContent) {
7
+ return childElementCount > 0 || (textContent ?? '').trim().length > 0;
19
8
  }
20
9
  export class TngInputGroup {
21
10
  hasLeading = input(null, ...(ngDevMode ? [{ debugName: "hasLeading" }] : []));
@@ -36,17 +25,15 @@ export class TngInputGroup {
36
25
  if (!this.controls)
37
26
  return;
38
27
  const queriedCount = this.controls.length;
39
- const domCount = this.hostElement.querySelectorAll('[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput]').length;
28
+ const domCount = this.hostElement.querySelectorAll('[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput], textarea[tngTextarea]').length;
40
29
  const count = this.controlCount() ?? (queriedCount > 0 ? queriedCount : domCount);
41
30
  if (count !== 1) {
42
- console.warn(`[tngInputGroup] Expected exactly 1 control (input/textarea with tngInput), but found ${count}.`, this.hostElement);
31
+ globalThis.console.warn(`[tngInputGroup] Expected exactly 1 control (input/textarea with tngInput or textarea with tngTextarea), but found ${count}.`, this.hostElement);
43
32
  }
44
33
  }
45
34
  ngAfterContentInit() {
46
35
  queueMicrotask(() => this.validateSingleControl());
47
- this.controls.changes
48
- .pipe(takeUntil(this.destroyed$))
49
- .subscribe(() => this.validateSingleControl());
36
+ this.controls.changes.pipe(takeUntil(this.destroyed$)).subscribe(() => this.validateSingleControl());
50
37
  }
51
38
  ngOnDestroy() {
52
39
  this.destroyed$.next();
@@ -103,25 +90,40 @@ export class TngInputGroup {
103
90
  onFocusIn() {
104
91
  this.focused = true;
105
92
  }
106
- onFocusOut(event) {
107
- const nextTarget = event.relatedTarget;
93
+ onFocusOut(nextTarget) {
108
94
  if (nextTarget instanceof Node && this.hostElement.contains(nextTarget))
109
95
  return;
110
96
  this.focused = false;
111
97
  }
112
98
  hasLeadingSlot() {
113
99
  const proxy = this.hostElement.querySelector('[data-tng-input-prefix-proxy]');
114
- if (proxy instanceof HTMLElement)
115
- return hasProjectedContent(proxy);
100
+ if (proxy instanceof HTMLElement &&
101
+ containsProjectedContent(proxy.childElementCount, proxy.textContent)) {
102
+ return true;
103
+ }
116
104
  const slots = this.prefixSlots?.toArray() ?? [];
117
- return slots.some((slot) => hasProjectedContent(slot.hostElement));
105
+ for (const slot of slots) {
106
+ const hostElement = slot.hostElement;
107
+ if (containsProjectedContent(hostElement.childElementCount, hostElement.textContent)) {
108
+ return true;
109
+ }
110
+ }
111
+ return false;
118
112
  }
119
113
  hasTrailingSlot() {
120
114
  const proxy = this.hostElement.querySelector('[data-tng-input-suffix-proxy]');
121
- if (proxy instanceof HTMLElement)
122
- return hasProjectedContent(proxy);
115
+ if (proxy instanceof HTMLElement &&
116
+ containsProjectedContent(proxy.childElementCount, proxy.textContent)) {
117
+ return true;
118
+ }
123
119
  const slots = this.suffixSlots?.toArray() ?? [];
124
- return slots.some((slot) => hasProjectedContent(slot.hostElement));
120
+ for (const slot of slots) {
121
+ const hostElement = slot.hostElement;
122
+ if (containsProjectedContent(hostElement.childElementCount, hostElement.textContent)) {
123
+ return true;
124
+ }
125
+ }
126
+ return false;
125
127
  }
126
128
  effectiveHasLeading() {
127
129
  const override = this.hasLeading();
@@ -140,15 +142,14 @@ export class TngInputGroup {
140
142
  return controls[0] ?? null;
141
143
  }
142
144
  primaryControlElement() {
143
- const element = this.hostElement.querySelector('[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput]');
144
- if (element instanceof HTMLInputElement ||
145
- element instanceof HTMLTextAreaElement) {
145
+ const element = this.hostElement.querySelector('[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput], textarea[tngTextarea]');
146
+ if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {
146
147
  return element;
147
148
  }
148
149
  return null;
149
150
  }
150
151
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngInputGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
151
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TngInputGroup, isStandalone: true, selector: "tng-input-group, [tngInputGroup]", inputs: { hasLeading: { classPropertyName: "hasLeading", publicName: "hasLeading", isSignal: true, isRequired: false, transformFunction: null }, hasTrailing: { classPropertyName: "hasTrailing", publicName: "hasTrailing", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, controlCount: { classPropertyName: "controlCount", publicName: "controlCount", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusin": "onFocusIn()", "focusout": "onFocusOut($event)" }, properties: { "attr.data-slot": "this.dataSlot", "attr.data-has-leading": "this.dataHasLeading", "attr.data-has-trailing": "this.dataHasTrailing", "attr.data-disabled": "this.dataDisabled", "attr.data-invalid": "this.dataInvalid", "attr.data-readonly": "this.dataReadonly", "attr.data-focused": "this.dataFocused" } }, queries: [{ propertyName: "controls", predicate: TngInput, descendants: true }, { propertyName: "prefixSlots", predicate: TngPrefix, descendants: true }, { propertyName: "suffixSlots", predicate: TngSuffix, descendants: true }], exportAs: ["tngInputGroup"], ngImport: i0, template: `
152
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TngInputGroup, isStandalone: true, selector: "tng-input-group, [tngInputGroup]", inputs: { hasLeading: { classPropertyName: "hasLeading", publicName: "hasLeading", isSignal: true, isRequired: false, transformFunction: null }, hasTrailing: { classPropertyName: "hasTrailing", publicName: "hasTrailing", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, controlCount: { classPropertyName: "controlCount", publicName: "controlCount", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusin": "onFocusIn()", "focusout": "onFocusOut($event.relatedTarget)" }, properties: { "attr.data-slot": "this.dataSlot", "attr.data-has-leading": "this.dataHasLeading", "attr.data-has-trailing": "this.dataHasTrailing", "attr.data-disabled": "this.dataDisabled", "attr.data-invalid": "this.dataInvalid", "attr.data-readonly": "this.dataReadonly", "attr.data-focused": "this.dataFocused" } }, queries: [{ propertyName: "controls", predicate: TngInput, descendants: true }, { propertyName: "prefixSlots", predicate: TngPrefix, descendants: true }, { propertyName: "suffixSlots", predicate: TngSuffix, descendants: true }], exportAs: ["tngInputGroup"], ngImport: i0, template: `
152
153
  @if (hasLeadingSlot()) {
153
154
  <span class="tng-input-group-leading" data-slot="input-group-leading">
154
155
  <ng-content select="[tngPrefix], [tngInputLeading], [data-tng-input-prefix-proxy]"></ng-content>
@@ -156,7 +157,7 @@ export class TngInputGroup {
156
157
  }
157
158
 
158
159
  <span class="tng-input-group-control" data-slot="input-group-control">
159
- <ng-content select="input[tngInput], textarea[tngInput], [data-tng-input-control-proxy]"></ng-content>
160
+ <ng-content select="input[tngInput], textarea[tngInput], textarea[tngTextarea], [data-tng-input-control-proxy]"></ng-content>
160
161
  </span>
161
162
 
162
163
  @if (hasTrailingSlot()) {
@@ -164,14 +165,11 @@ export class TngInputGroup {
164
165
  <ng-content select="[tngSuffix], [tngInputTrailing], [data-tng-input-suffix-proxy]"></ng-content>
165
166
  </span>
166
167
  }
167
- `, isInline: true });
168
+ `, isInline: true, styles: ["\n :host {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n .tng-input-group-leading,\n .tng-input-group-trailing {\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n min-width: 0;\n }\n\n .tng-input-group-control {\n flex: 1 1 auto;\n display: flex;\n align-items: center;\n min-width: 0;\n }\n "] });
168
169
  }
169
170
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngInputGroup, decorators: [{
170
171
  type: Component,
171
- args: [{
172
- selector: 'tng-input-group, [tngInputGroup]',
173
- exportAs: 'tngInputGroup',
174
- template: `
172
+ args: [{ selector: 'tng-input-group, [tngInputGroup]', exportAs: 'tngInputGroup', template: `
175
173
  @if (hasLeadingSlot()) {
176
174
  <span class="tng-input-group-leading" data-slot="input-group-leading">
177
175
  <ng-content select="[tngPrefix], [tngInputLeading], [data-tng-input-prefix-proxy]"></ng-content>
@@ -179,7 +177,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
179
177
  }
180
178
 
181
179
  <span class="tng-input-group-control" data-slot="input-group-control">
182
- <ng-content select="input[tngInput], textarea[tngInput], [data-tng-input-control-proxy]"></ng-content>
180
+ <ng-content select="input[tngInput], textarea[tngInput], textarea[tngTextarea], [data-tng-input-control-proxy]"></ng-content>
183
181
  </span>
184
182
 
185
183
  @if (hasTrailingSlot()) {
@@ -187,8 +185,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
187
185
  <ng-content select="[tngSuffix], [tngInputTrailing], [data-tng-input-suffix-proxy]"></ng-content>
188
186
  </span>
189
187
  }
190
- `,
191
- }]
188
+ `, styles: ["\n :host {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n .tng-input-group-leading,\n .tng-input-group-trailing {\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n min-width: 0;\n }\n\n .tng-input-group-control {\n flex: 1 1 auto;\n display: flex;\n align-items: center;\n min-width: 0;\n }\n "] }]
192
189
  }], propDecorators: { hasLeading: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasLeading", required: false }] }], hasTrailing: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasTrailing", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], controlCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlCount", required: false }] }], controls: [{
193
190
  type: ContentChildren,
194
191
  args: [TngInput, { descendants: true }]
@@ -224,6 +221,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
224
221
  args: ['focusin']
225
222
  }], onFocusOut: [{
226
223
  type: HostListener,
227
- args: ['focusout', ['$event']]
224
+ args: ['focusout', ['$event.relatedTarget']]
228
225
  }] } });
229
226
  //# sourceMappingURL=tng-input-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tng-input-group.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/input/tng-input-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OA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;QAED,OAAO,IAAI,CAAC;IACd,CAAC;uGAzKU,aAAa;2FAAb,aAAa,izCAQP,QAAQ,iEAGR,SAAS,iEAGT,SAAS,6EAhChB;;;;;;;;;;;;;;;;GAgBT;;2FAEU,aAAa;kBArBzB,SAAS;mBAAC;oBACT,QAAQ,EAAE,kCAAkC;oBAC5C,QAAQ,EAAE,eAAe;oBACzB,QAAQ,EAAE;;;;;;;;;;;;;;;;GAgBT;iBACF;;sBASE,eAAe;uBAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;sBAG/C,eAAe;uBAAC,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;sBAGhD,eAAe;uBAAC,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;sBAuChD,WAAW;uBAAC,gBAAgB;;sBAG5B,WAAW;uBAAC,uBAAuB;;sBAKnC,WAAW;uBAAC,wBAAwB;;sBAKpC,WAAW;uBAAC,oBAAoB;;sBAahC,WAAW;uBAAC,mBAAmB;;sBAc/B,WAAW;uBAAC,oBAAoB;;sBAahC,WAAW;uBAAC,mBAAmB;;sBAK/B,YAAY;uBAAC,SAAS;;sBAKtB,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import type { OnDestroy, AfterContentInit, QueryList } from \"@angular/core\";\nimport { Component, ContentChildren, ElementRef, HostBinding, HostListener, inject } from \"@angular/core\";\nimport { isDevMode } from \"@angular/core\";\nimport { input } from \"@angular/core\";\nimport { Subject, takeUntil } from \"rxjs\";\nimport { TngPrefix } from \"./tng-adornment\";\nimport { TngSuffix } from \"./tng-adornment\";\nimport { TngInput } from \"./tng-input\";\n\nfunction hasProjectedContent(element: HTMLElement): boolean {\n return Array.from(element.childNodes).some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent ?? '').trim().length > 0;\n }\n\n return false;\n });\n}\n\n@Component({\n selector: 'tng-input-group, [tngInputGroup]',\n exportAs: 'tngInputGroup',\n template: `\n @if (hasLeadingSlot()) {\n <span class=\"tng-input-group-leading\" data-slot=\"input-group-leading\">\n <ng-content select=\"[tngPrefix], [tngInputLeading], [data-tng-input-prefix-proxy]\"></ng-content>\n </span>\n }\n\n <span class=\"tng-input-group-control\" data-slot=\"input-group-control\">\n <ng-content select=\"input[tngInput], textarea[tngInput], [data-tng-input-control-proxy]\"></ng-content>\n </span>\n\n @if (hasTrailingSlot()) {\n <span class=\"tng-input-group-trailing\" data-slot=\"input-group-trailing\">\n <ng-content select=\"[tngSuffix], [tngInputTrailing], [data-tng-input-suffix-proxy]\"></ng-content>\n </span>\n }\n `,\n})\nexport class TngInputGroup implements AfterContentInit, OnDestroy {\n public readonly hasLeading = input<boolean | null>(null);\n public readonly hasTrailing = input<boolean | null>(null);\n public readonly disabled = input<boolean | null>(null);\n public readonly invalid = input<boolean | null>(null);\n public readonly readonly = input<boolean | null>(null);\n public readonly controlCount = input<number | null>(null);\n\n @ContentChildren(TngInput, { descendants: true })\n protected controls!: QueryList<TngInput>;\n\n @ContentChildren(TngPrefix, { descendants: true })\n protected prefixSlots!: QueryList<TngPrefix>;\n\n @ContentChildren(TngSuffix, { descendants: true })\n protected suffixSlots!: QueryList<TngSuffix>;\n\n private readonly hostElement = inject(ElementRef<HTMLElement>).nativeElement;\n\n private focused = false;\n\n private readonly destroyed$ = new Subject<void>();\n\n private validateSingleControl(): void {\n if (!isDevMode()) return;\n if (!this.controls) return;\n\n const queriedCount = this.controls.length;\n const domCount = this.hostElement.querySelectorAll(\n '[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput]',\n ).length;\n const count = this.controlCount() ?? (queriedCount > 0 ? queriedCount : domCount);\n if (count !== 1) {\n console.warn(\n `[tngInputGroup] Expected exactly 1 control (input/textarea with tngInput), but found ${count}.`,\n this.hostElement,\n );\n }\n }\n\n public ngAfterContentInit(): void {\n queueMicrotask(() => this.validateSingleControl());\n\n this.controls.changes\n .pipe(takeUntil(this.destroyed$))\n .subscribe(() => this.validateSingleControl());\n }\n\n public ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n }\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-group' as const;\n\n @HostBinding('attr.data-has-leading')\n protected get dataHasLeading(): '' | null {\n return this.effectiveHasLeading() ? '' : null;\n }\n\n @HostBinding('attr.data-has-trailing')\n protected get dataHasTrailing(): '' | null {\n return this.effectiveHasTrailing() ? '' : null;\n }\n\n @HostBinding('attr.data-disabled')\n protected get dataDisabled(): '' | null {\n const override = this.disabled();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.disabled() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n return element.hasAttribute('disabled') ? '' : null;\n }\n\n @HostBinding('attr.data-invalid')\n protected get dataInvalid(): '' | null {\n const override = this.invalid();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.isInvalid() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n if (element.getAttribute('aria-invalid') === 'true') return '';\n return element.matches(':invalid') ? '' : null;\n }\n\n @HostBinding('attr.data-readonly')\n protected get dataReadonly(): '' | null {\n const override = this.readonly();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.readonly() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n return element.hasAttribute('readonly') ? '' : null;\n }\n\n @HostBinding('attr.data-focused')\n protected get dataFocused(): '' | null {\n return this.focused ? '' : null;\n }\n\n @HostListener('focusin')\n protected onFocusIn(): void {\n this.focused = true;\n }\n\n @HostListener('focusout', ['$event'])\n protected onFocusOut(event: FocusEvent): void {\n const nextTarget = event.relatedTarget;\n if (nextTarget instanceof Node && this.hostElement.contains(nextTarget)) return;\n\n this.focused = false;\n }\n\n protected hasLeadingSlot(): boolean {\n const proxy = this.hostElement.querySelector('[data-tng-input-prefix-proxy]');\n if (proxy instanceof HTMLElement) return hasProjectedContent(proxy);\n\n const slots = this.prefixSlots?.toArray() ?? [];\n return slots.some((slot) => hasProjectedContent(slot.hostElement));\n }\n\n protected hasTrailingSlot(): boolean {\n const proxy = this.hostElement.querySelector('[data-tng-input-suffix-proxy]');\n if (proxy instanceof HTMLElement) return hasProjectedContent(proxy);\n\n const slots = this.suffixSlots?.toArray() ?? [];\n return slots.some((slot) => hasProjectedContent(slot.hostElement));\n }\n\n protected effectiveHasLeading(): boolean {\n const override = this.hasLeading();\n if (override !== null) return override;\n return this.hasLeadingSlot();\n }\n\n protected effectiveHasTrailing(): boolean {\n const override = this.hasTrailing();\n if (override !== null) return override;\n return this.hasTrailingSlot();\n }\n\n protected primaryControl(): TngInput | null {\n const controls = this.controls?.toArray() ?? [];\n return controls[0] ?? null;\n }\n\n protected primaryControlElement(): HTMLInputElement | HTMLTextAreaElement | null {\n const element = this.hostElement.querySelector(\n '[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput]',\n );\n if (\n element instanceof HTMLInputElement ||\n element instanceof HTMLTextAreaElement\n ) {\n return element;\n }\n\n return null;\n }\n}"]}
1
+ {"version":3,"file":"tng-input-group.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/input/tng-input-group.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,eAAe,EACf,UAAU,EACV,WAAW,EACX,YAAY,EACZ,MAAM,EACN,KAAK,EACL,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;;AAEvC,SAAS,wBAAwB,CAAC,iBAAyB,EAAE,WAA0B;IACrF,OAAO,iBAAiB,GAAG,C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e,YACf;;;;;;;;;;;;;;;;GAgBT;;sBAkCA,eAAe;uBAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;sBAG/C,eAAe;uBAAC,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;sBAGhD,eAAe;uBAAC,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;sBAqChD,WAAW;uBAAC,gBAAgB;;sBAG5B,WAAW;uBAAC,uBAAuB;;sBAKnC,WAAW;uBAAC,wBAAwB;;sBAKpC,WAAW;uBAAC,oBAAoB;;sBAahC,WAAW;uBAAC,mBAAmB;;sBAc/B,WAAW;uBAAC,oBAAoB;;sBAahC,WAAW;uBAAC,mBAAmB;;sBAK/B,YAAY;uBAAC,SAAS;;sBAKtB,YAAY;uBAAC,UAAU,EAAE,CAAC,sBAAsB,CAAC","sourcesContent":["import type { AfterContentInit, OnDestroy, QueryList } from '@angular/core';\nimport {\n Component,\n ContentChildren,\n ElementRef,\n HostBinding,\n HostListener,\n inject,\n input,\n isDevMode,\n} from '@angular/core';\nimport { Subject, takeUntil } from 'rxjs';\n\nimport { TngPrefix, TngSuffix } from './tng-adornment';\nimport { TngInput } from './tng-input';\n\nfunction containsProjectedContent(childElementCount: number, textContent: string | null): boolean {\n return childElementCount > 0 || (textContent ?? '').trim().length > 0;\n}\n\n@Component({\n selector: 'tng-input-group, [tngInputGroup]',\n exportAs: 'tngInputGroup',\n template: `\n @if (hasLeadingSlot()) {\n <span class=\"tng-input-group-leading\" data-slot=\"input-group-leading\">\n <ng-content select=\"[tngPrefix], [tngInputLeading], [data-tng-input-prefix-proxy]\"></ng-content>\n </span>\n }\n\n <span class=\"tng-input-group-control\" data-slot=\"input-group-control\">\n <ng-content select=\"input[tngInput], textarea[tngInput], textarea[tngTextarea], [data-tng-input-control-proxy]\"></ng-content>\n </span>\n\n @if (hasTrailingSlot()) {\n <span class=\"tng-input-group-trailing\" data-slot=\"input-group-trailing\">\n <ng-content select=\"[tngSuffix], [tngInputTrailing], [data-tng-input-suffix-proxy]\"></ng-content>\n </span>\n }\n `,\n styles: [\n `\n :host {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n .tng-input-group-leading,\n .tng-input-group-trailing {\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n min-width: 0;\n }\n\n .tng-input-group-control {\n flex: 1 1 auto;\n display: flex;\n align-items: center;\n min-width: 0;\n }\n `,\n ],\n})\nexport class TngInputGroup implements AfterContentInit, OnDestroy {\n public readonly hasLeading = input<boolean | null>(null);\n public readonly hasTrailing = input<boolean | null>(null);\n public readonly disabled = input<boolean | null>(null);\n public readonly invalid = input<boolean | null>(null);\n public readonly readonly = input<boolean | null>(null);\n public readonly controlCount = input<number | null>(null);\n\n @ContentChildren(TngInput, { descendants: true })\n protected controls!: QueryList<TngInput>;\n\n @ContentChildren(TngPrefix, { descendants: true })\n protected prefixSlots!: QueryList<TngPrefix>;\n\n @ContentChildren(TngSuffix, { descendants: true })\n protected suffixSlots!: QueryList<TngSuffix>;\n\n private readonly hostElement: HTMLElement = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n private focused = false;\n private readonly destroyed$ = new Subject<void>();\n\n private validateSingleControl(): void {\n if (!isDevMode()) return;\n if (!this.controls) return;\n\n const queriedCount = this.controls.length;\n const domCount = this.hostElement.querySelectorAll(\n '[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput], textarea[tngTextarea]',\n ).length;\n\n const count = this.controlCount() ?? (queriedCount > 0 ? queriedCount : domCount);\n\n if (count !== 1) {\n globalThis.console.warn(\n `[tngInputGroup] Expected exactly 1 control (input/textarea with tngInput or textarea with tngTextarea), but found ${count}.`,\n this.hostElement,\n );\n }\n }\n\n public ngAfterContentInit(): void {\n queueMicrotask(() => this.validateSingleControl());\n\n this.controls.changes.pipe(takeUntil(this.destroyed$)).subscribe(() => this.validateSingleControl());\n }\n\n public ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n }\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-group' as const;\n\n @HostBinding('attr.data-has-leading')\n protected get dataHasLeading(): '' | null {\n return this.effectiveHasLeading() ? '' : null;\n }\n\n @HostBinding('attr.data-has-trailing')\n protected get dataHasTrailing(): '' | null {\n return this.effectiveHasTrailing() ? '' : null;\n }\n\n @HostBinding('attr.data-disabled')\n protected get dataDisabled(): '' | null {\n const override = this.disabled();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.disabled() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n return element.hasAttribute('disabled') ? '' : null;\n }\n\n @HostBinding('attr.data-invalid')\n protected get dataInvalid(): '' | null {\n const override = this.invalid();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.isInvalid() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n if (element.getAttribute('aria-invalid') === 'true') return '';\n return element.matches(':invalid') ? '' : null;\n }\n\n @HostBinding('attr.data-readonly')\n protected get dataReadonly(): '' | null {\n const override = this.readonly();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.readonly() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n return element.hasAttribute('readonly') ? '' : null;\n }\n\n @HostBinding('attr.data-focused')\n protected get dataFocused(): '' | null {\n return this.focused ? '' : null;\n }\n\n @HostListener('focusin')\n protected onFocusIn(): void {\n this.focused = true;\n }\n\n @HostListener('focusout', ['$event.relatedTarget'])\n protected onFocusOut(nextTarget: Readonly<EventTarget> | null): void {\n if (nextTarget instanceof Node && this.hostElement.contains(nextTarget)) return;\n\n this.focused = false;\n }\n\n protected hasLeadingSlot(): boolean {\n const proxy = this.hostElement.querySelector('[data-tng-input-prefix-proxy]');\n if (\n proxy instanceof HTMLElement &&\n containsProjectedContent(proxy.childElementCount, proxy.textContent)\n ) {\n return true;\n }\n\n const slots = this.prefixSlots?.toArray() ?? [];\n for (const slot of slots) {\n const hostElement = slot.hostElement;\n if (containsProjectedContent(hostElement.childElementCount, hostElement.textContent)) {\n return true;\n }\n }\n\n return false;\n }\n\n protected hasTrailingSlot(): boolean {\n const proxy = this.hostElement.querySelector('[data-tng-input-suffix-proxy]');\n if (\n proxy instanceof HTMLElement &&\n containsProjectedContent(proxy.childElementCount, proxy.textContent)\n ) {\n return true;\n }\n\n const slots = this.suffixSlots?.toArray() ?? [];\n for (const slot of slots) {\n const hostElement = slot.hostElement;\n if (containsProjectedContent(hostElement.childElementCount, hostElement.textContent)) {\n return true;\n }\n }\n\n return false;\n }\n\n protected effectiveHasLeading(): boolean {\n const override = this.hasLeading();\n if (override !== null) return override;\n return this.hasLeadingSlot();\n }\n\n protected effectiveHasTrailing(): boolean {\n const override = this.hasTrailing();\n if (override !== null) return override;\n return this.hasTrailingSlot();\n }\n\n protected primaryControl(): TngInput | null {\n const controls = this.controls?.toArray() ?? [];\n return controls[0] ?? null;\n }\n\n protected primaryControlElement(): HTMLInputElement | HTMLTextAreaElement | null {\n const element = this.hostElement.querySelector(\n '[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput], textarea[tngTextarea]',\n );\n\n if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {\n return element;\n }\n\n return null;\n }\n}\n"]}