@tailng-ui/primitives 0.14.0 → 0.16.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.
Files changed (56) hide show
  1. package/package.json +3 -2
  2. package/src/index.d.ts +1 -0
  3. package/src/index.d.ts.map +1 -1
  4. package/src/index.js +1 -0
  5. package/src/index.js.map +1 -1
  6. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.d.ts +25 -0
  7. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.d.ts.map +1 -0
  8. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.js +105 -0
  9. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.js.map +1 -0
  10. package/src/lib/form/datepicker/datepicker.adapters.d.ts +5 -0
  11. package/src/lib/form/datepicker/datepicker.adapters.d.ts.map +1 -0
  12. package/src/lib/form/datepicker/datepicker.adapters.js +194 -0
  13. package/src/lib/form/datepicker/datepicker.adapters.js.map +1 -0
  14. package/src/lib/form/datepicker/datepicker.state.d.ts +10 -0
  15. package/src/lib/form/datepicker/datepicker.state.d.ts.map +1 -0
  16. package/src/lib/form/datepicker/datepicker.state.js +97 -0
  17. package/src/lib/form/datepicker/datepicker.state.js.map +1 -0
  18. package/src/lib/form/datepicker/datepicker.types.d.ts +269 -0
  19. package/src/lib/form/datepicker/datepicker.types.d.ts.map +1 -0
  20. package/src/lib/form/datepicker/datepicker.types.js +1 -0
  21. package/src/lib/form/datepicker/datepicker.types.js.map +1 -0
  22. package/src/lib/form/datepicker/datepicker.utils.d.ts +75 -0
  23. package/src/lib/form/datepicker/datepicker.utils.d.ts.map +1 -0
  24. package/src/lib/form/datepicker/datepicker.utils.js +238 -0
  25. package/src/lib/form/datepicker/datepicker.utils.js.map +1 -0
  26. package/src/lib/form/datepicker/index.d.ts +3 -0
  27. package/src/lib/form/datepicker/index.d.ts.map +1 -0
  28. package/src/lib/form/datepicker/index.js +3 -0
  29. package/src/lib/form/datepicker/index.js.map +1 -0
  30. package/src/lib/form/datepicker/tng-datepicker.d.ts +5 -0
  31. package/src/lib/form/datepicker/tng-datepicker.d.ts.map +1 -0
  32. package/src/lib/form/datepicker/tng-datepicker.js +1948 -0
  33. package/src/lib/form/datepicker/tng-datepicker.js.map +1 -0
  34. package/src/lib/form/datepicker/tng-datepicker.overlay.d.ts +60 -0
  35. package/src/lib/form/datepicker/tng-datepicker.overlay.d.ts.map +1 -0
  36. package/src/lib/form/datepicker/tng-datepicker.overlay.js +275 -0
  37. package/src/lib/form/datepicker/tng-datepicker.overlay.js.map +1 -0
  38. package/src/lib/form/input/tng-input.d.ts +10 -10
  39. package/src/lib/form/input/tng-input.d.ts.map +1 -1
  40. package/src/lib/form/input/tng-input.js +28 -27
  41. package/src/lib/form/input/tng-input.js.map +1 -1
  42. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.d.ts +32 -0
  43. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.d.ts.map +1 -0
  44. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.js +312 -0
  45. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.js.map +1 -0
  46. package/src/lib/layout/grid/tng-grid.d.ts +144 -2
  47. package/src/lib/layout/grid/tng-grid.d.ts.map +1 -1
  48. package/src/lib/layout/grid/tng-grid.js +669 -2
  49. package/src/lib/layout/grid/tng-grid.js.map +1 -1
  50. package/src/lib/layout/tree/__tests__/tng-tree.test-harness.d.ts.map +1 -1
  51. package/src/lib/layout/tree/__tests__/tng-tree.test-harness.js +0 -1
  52. package/src/lib/layout/tree/__tests__/tng-tree.test-harness.js.map +1 -1
  53. package/src/lib/navigation/tabs/tng-tabs.d.ts +13 -6
  54. package/src/lib/navigation/tabs/tng-tabs.d.ts.map +1 -1
  55. package/src/lib/navigation/tabs/tng-tabs.js +77 -35
  56. package/src/lib/navigation/tabs/tng-tabs.js.map +1 -1
@@ -0,0 +1,275 @@
1
+ import { DestroyRef, Directive, ElementRef, HostBinding, effect, inject, input, signal, } from '@angular/core';
2
+ import { computeOverlayPosition, } from '@tailng-ui/cdk';
3
+ import * as i0 from "@angular/core";
4
+ const OVERLAY_VIEWPORT_MARGIN = 12;
5
+ const OVERLAY_OFFSET = 9;
6
+ function rectFromClientRect(rect) {
7
+ return {
8
+ height: rect.height,
9
+ left: rect.left,
10
+ top: rect.top,
11
+ width: rect.width,
12
+ };
13
+ }
14
+ function viewportRect(windowRef) {
15
+ return {
16
+ height: windowRef.innerHeight || 768,
17
+ left: 0,
18
+ top: 0,
19
+ width: windowRef.innerWidth || 1024,
20
+ };
21
+ }
22
+ function resolveAnchorElement(anchor) {
23
+ if (anchor instanceof ElementRef) {
24
+ return anchor.nativeElement;
25
+ }
26
+ return anchor instanceof HTMLElement ? anchor : null;
27
+ }
28
+ export class TngDatepickerOverlay {
29
+ elRef = inject((ElementRef));
30
+ destroyRef = inject(DestroyRef);
31
+ ownerDocument = this.elRef.nativeElement.ownerDocument ?? null;
32
+ ownerWindow = this.ownerDocument?.defaultView ?? null;
33
+ renderVersion = signal(0, ...(ngDevMode ? [{ debugName: "renderVersion" }] : []));
34
+ resolvedPlacement = signal('bottom', ...(ngDevMode ? [{ debugName: "resolvedPlacement" }] : []));
35
+ overlayPlaceholder = null;
36
+ overlayOriginalParent = null;
37
+ overlayLayoutFrame = null;
38
+ removeResizeListener = null;
39
+ removeScrollListener = null;
40
+ resizeObserver = null;
41
+ controller = input.required({ ...(ngDevMode ? { debugName: "controller" } : {}), alias: 'tngDatepickerOverlay' });
42
+ anchor = input(undefined, { ...(ngDevMode ? { debugName: "anchor" } : {}), alias: 'tngDatepickerOverlayAnchor' });
43
+ placement = input(undefined, { ...(ngDevMode ? { debugName: "placement" } : {}), alias: 'tngDatepickerOverlayPlacement' });
44
+ offset = input(undefined, { ...(ngDevMode ? { debugName: "offset" } : {}), alias: 'tngDatepickerOverlayOffset' });
45
+ collision = input(undefined, { ...(ngDevMode ? { debugName: "collision" } : {}), alias: 'tngDatepickerOverlayCollision' });
46
+ get hidden() {
47
+ this.renderVersion();
48
+ return this.controller().getOutputs().open ? null : '';
49
+ }
50
+ get display() {
51
+ this.renderVersion();
52
+ return this.controller().getOutputs().open ? null : 'none';
53
+ }
54
+ get dataPlacement() {
55
+ this.renderVersion();
56
+ return this.resolvedPlacement();
57
+ }
58
+ constructor() {
59
+ this.initializeOverlayPortal();
60
+ effect((onCleanup) => {
61
+ const controller = this.controller();
62
+ controller.registerOverlay(this.elRef.nativeElement);
63
+ const unsubscribe = controller.subscribe(() => {
64
+ this.renderVersion.update((value) => value + 1);
65
+ });
66
+ onCleanup(() => {
67
+ unsubscribe();
68
+ controller.registerOverlay(null);
69
+ });
70
+ });
71
+ effect(() => {
72
+ const open = this.controller().getOutputs().open;
73
+ this.renderVersion();
74
+ this.placement();
75
+ this.offset();
76
+ this.collision();
77
+ this.anchor();
78
+ if (open) {
79
+ this.mountToBodyAndPosition();
80
+ return;
81
+ }
82
+ this.restoreToPlaceholder();
83
+ });
84
+ this.destroyRef.onDestroy(() => {
85
+ if (this.overlayLayoutFrame !== null && this.ownerWindow !== null) {
86
+ this.ownerWindow.cancelAnimationFrame(this.overlayLayoutFrame);
87
+ this.overlayLayoutFrame = null;
88
+ }
89
+ this.teardownRepositionListeners();
90
+ this.restoreToPlaceholder(true);
91
+ });
92
+ }
93
+ initializeOverlayPortal() {
94
+ if (this.overlayPlaceholder !== null) {
95
+ return;
96
+ }
97
+ const placeholderDocument = this.ownerDocument ?? document;
98
+ const overlay = this.elRef.nativeElement;
99
+ this.overlayPlaceholder = placeholderDocument.createComment('tng-datepicker-overlay-anchor');
100
+ this.overlayOriginalParent = overlay.parentNode;
101
+ const placeholder = this.overlayPlaceholder;
102
+ if (this.overlayOriginalParent !== null && placeholder !== null) {
103
+ this.overlayOriginalParent.insertBefore(placeholder, overlay);
104
+ }
105
+ }
106
+ findAnchorEl() {
107
+ const explicitAnchor = resolveAnchorElement(this.anchor());
108
+ if (explicitAnchor !== null) {
109
+ return explicitAnchor;
110
+ }
111
+ const scope = this.overlayPlaceholder?.parentNode instanceof HTMLElement
112
+ ? this.overlayPlaceholder.parentNode
113
+ : this.overlayOriginalParent instanceof HTMLElement
114
+ ? this.overlayOriginalParent
115
+ : null;
116
+ return (scope?.querySelector('[data-slot="datepicker-input-shell"]') ??
117
+ scope?.querySelector('[data-slot="datepicker-trigger"]'));
118
+ }
119
+ scheduleReposition() {
120
+ if (!this.controller().getOutputs().open || this.ownerWindow === null) {
121
+ return;
122
+ }
123
+ if (this.overlayLayoutFrame !== null) {
124
+ this.ownerWindow.cancelAnimationFrame(this.overlayLayoutFrame);
125
+ }
126
+ this.overlayLayoutFrame = this.ownerWindow.requestAnimationFrame(() => {
127
+ this.overlayLayoutFrame = null;
128
+ this.positionOverlay();
129
+ });
130
+ }
131
+ positionOverlay() {
132
+ const overlay = this.elRef.nativeElement;
133
+ const anchor = this.findAnchorEl();
134
+ if (anchor === null || this.ownerWindow === null) {
135
+ return;
136
+ }
137
+ const anchorRect = rectFromClientRect(anchor.getBoundingClientRect());
138
+ const viewport = viewportRect(this.ownerWindow);
139
+ const width = Math.max(0, Math.min(anchorRect.width, viewport.width - OVERLAY_VIEWPORT_MARGIN * 2));
140
+ overlay.style.width = `${width}px`;
141
+ overlay.style.maxWidth = `${Math.max(0, viewport.width - OVERLAY_VIEWPORT_MARGIN * 2)}px`;
142
+ overlay.style.maxHeight = '';
143
+ const overlayRect = rectFromClientRect(overlay.getBoundingClientRect());
144
+ const result = computeOverlayPosition({
145
+ anchorRect,
146
+ collision: this.resolveCollision(),
147
+ direction: this.resolveDirection(),
148
+ offset: this.resolveOffset(),
149
+ overlayRect,
150
+ placement: this.resolvePlacement(),
151
+ viewportRect: viewport,
152
+ });
153
+ overlay.style.left = `${result.x}px`;
154
+ overlay.style.top = `${result.y}px`;
155
+ const anchorBottom = anchorRect.top + anchorRect.height;
156
+ const availableHeight = result.side === 'top'
157
+ ? Math.max(0, Math.floor(anchorRect.top - OVERLAY_VIEWPORT_MARGIN - OVERLAY_OFFSET))
158
+ : Math.max(0, Math.floor(viewport.height - anchorBottom - OVERLAY_VIEWPORT_MARGIN - OVERLAY_OFFSET));
159
+ if (availableHeight > 0) {
160
+ overlay.style.maxHeight = `${availableHeight}px`;
161
+ }
162
+ this.resolvedPlacement.set(result.side === 'top' ? 'top' : 'bottom');
163
+ overlay.style.visibility = '';
164
+ }
165
+ setupRepositionListeners() {
166
+ if (this.ownerWindow === null || this.removeResizeListener !== null || this.removeScrollListener !== null) {
167
+ return;
168
+ }
169
+ const schedule = () => {
170
+ this.scheduleReposition();
171
+ };
172
+ this.ownerWindow.addEventListener('resize', schedule);
173
+ this.ownerWindow.addEventListener('scroll', schedule, true);
174
+ this.removeResizeListener = () => this.ownerWindow?.removeEventListener('resize', schedule);
175
+ this.removeScrollListener = () => this.ownerWindow?.removeEventListener('scroll', schedule, true);
176
+ if ('ResizeObserver' in this.ownerWindow) {
177
+ const ResizeObserverCtor = this.ownerWindow.ResizeObserver;
178
+ this.resizeObserver = new ResizeObserverCtor(() => {
179
+ this.scheduleReposition();
180
+ });
181
+ const anchor = this.findAnchorEl();
182
+ if (anchor !== null && this.resizeObserver !== null) {
183
+ this.resizeObserver.observe(anchor);
184
+ }
185
+ this.resizeObserver?.observe(this.elRef.nativeElement);
186
+ }
187
+ }
188
+ teardownRepositionListeners() {
189
+ this.removeResizeListener?.();
190
+ this.removeScrollListener?.();
191
+ this.removeResizeListener = null;
192
+ this.removeScrollListener = null;
193
+ this.resizeObserver?.disconnect();
194
+ this.resizeObserver = null;
195
+ }
196
+ mountToBodyAndPosition() {
197
+ const overlay = this.elRef.nativeElement;
198
+ if (this.ownerDocument === null) {
199
+ return;
200
+ }
201
+ this.setupRepositionListeners();
202
+ if (overlay.parentNode !== this.ownerDocument.body) {
203
+ this.ownerDocument.body.appendChild(overlay);
204
+ }
205
+ overlay.style.position = 'fixed';
206
+ overlay.style.left = '0px';
207
+ overlay.style.top = '0px';
208
+ overlay.style.visibility = 'hidden';
209
+ overlay.style.zIndex = '1000';
210
+ queueMicrotask(() => {
211
+ if (!this.controller().getOutputs().open) {
212
+ return;
213
+ }
214
+ this.positionOverlay();
215
+ });
216
+ }
217
+ restoreToPlaceholder(force = false) {
218
+ const overlay = this.elRef.nativeElement;
219
+ if (!force && overlay.parentNode !== this.ownerDocument?.body) {
220
+ return;
221
+ }
222
+ const placeholder = this.overlayPlaceholder;
223
+ if (placeholder?.parentNode !== null && placeholder !== null) {
224
+ placeholder.parentNode.insertBefore(overlay, placeholder);
225
+ }
226
+ else if (this.overlayOriginalParent !== null) {
227
+ this.overlayOriginalParent.appendChild(overlay);
228
+ }
229
+ this.teardownRepositionListeners();
230
+ this.resolvedPlacement.set(this.resolvePlacement().side === 'top' ? 'top' : 'bottom');
231
+ overlay.style.left = '';
232
+ overlay.style.maxHeight = '';
233
+ overlay.style.maxWidth = '';
234
+ overlay.style.position = '';
235
+ overlay.style.top = '';
236
+ overlay.style.visibility = '';
237
+ overlay.style.width = '';
238
+ overlay.style.zIndex = '';
239
+ }
240
+ resolvePlacement() {
241
+ return this.placement() ?? { align: 'start', side: 'bottom' };
242
+ }
243
+ resolveOffset() {
244
+ return this.offset() ?? { side: OVERLAY_OFFSET };
245
+ }
246
+ resolveCollision() {
247
+ return this.collision() ?? {
248
+ flip: true,
249
+ padding: OVERLAY_VIEWPORT_MARGIN,
250
+ shift: true,
251
+ };
252
+ }
253
+ resolveDirection() {
254
+ return this.controller().getOutputs().getHostAttributes()['dir'] === 'rtl' ? 'rtl' : 'ltr';
255
+ }
256
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDatepickerOverlay, deps: [], target: i0.ɵɵFactoryTarget.Directive });
257
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngDatepickerOverlay, isStandalone: true, selector: "[tngDatepickerOverlay]", inputs: { controller: { classPropertyName: "controller", publicName: "tngDatepickerOverlay", isSignal: true, isRequired: true, transformFunction: null }, anchor: { classPropertyName: "anchor", publicName: "tngDatepickerOverlayAnchor", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "tngDatepickerOverlayPlacement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "tngDatepickerOverlayOffset", isSignal: true, isRequired: false, transformFunction: null }, collision: { classPropertyName: "collision", publicName: "tngDatepickerOverlayCollision", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.hidden": "this.hidden", "style.display": "this.display", "attr.data-placement": "this.dataPlacement" } }, exportAs: ["tngDatepickerOverlay"], ngImport: i0 });
258
+ }
259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngDatepickerOverlay, decorators: [{
260
+ type: Directive,
261
+ args: [{
262
+ selector: '[tngDatepickerOverlay]',
263
+ exportAs: 'tngDatepickerOverlay',
264
+ }]
265
+ }], ctorParameters: () => [], propDecorators: { controller: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDatepickerOverlay", required: true }] }], anchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDatepickerOverlayAnchor", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDatepickerOverlayPlacement", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDatepickerOverlayOffset", required: false }] }], collision: [{ type: i0.Input, args: [{ isSignal: true, alias: "tngDatepickerOverlayCollision", required: false }] }], hidden: [{
266
+ type: HostBinding,
267
+ args: ['attr.hidden']
268
+ }], display: [{
269
+ type: HostBinding,
270
+ args: ['style.display']
271
+ }], dataPlacement: [{
272
+ type: HostBinding,
273
+ args: ['attr.data-placement']
274
+ }] } });
275
+ //# sourceMappingURL=tng-datepicker.overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tng-datepicker.overlay.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/dat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AAO,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAChE,CAAC;IAEO,aAAa;QACnB,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;IACnD,CAAC;IAEO,gBAAgB;QACtB,OAAO,IAAI,CAAC,SAAS,EAAE,IAAI;YACzB,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,uBAAuB;YAChC,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC;IAEO,gBAAgB;QACtB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7F,CAAC;uGA3SU,oBAAoB;2FAApB,oBAAoB;;2FAApB,oBAAoB;kBAJhC,SAAS;mBAAC;oBACT,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE,sBAAsB;iBACjC;;sBAiCE,WAAW;uBAAC,aAAa;;sBAMzB,WAAW;uBAAC,eAAe;;sBAM3B,WAAW;uBAAC,qBAAqB","sourcesContent":["import {\n DestroyRef,\n Directive,\n ElementRef,\n HostBinding,\n effect,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport {\n computeOverlayPosition,\n type TngOverlayCollisionOptions,\n type TngOverlayOffset,\n type TngOverlayPlacement,\n} from '@tailng-ui/cdk';\nimport type {\n TngDatepickerAttributeMap,\n} from './datepicker.types';\n\ntype TngDatepickerOverlayController = Readonly<{\n getOutputs: () => Readonly<{\n getHostAttributes: () => TngDatepickerAttributeMap;\n open: boolean;\n }>;\n registerOverlay: (element: HTMLElement | null) => void;\n subscribe: (listener: (event: unknown) => void) => () => void;\n}>;\n\ntype MaybeRect = Readonly<{\n height: number;\n left: number;\n top: number;\n width: number;\n}>;\n\ntype OverlayAnchorInput =\n | ElementRef<HTMLElement>\n | HTMLElement\n | null\n | undefined;\n\nconst OVERLAY_VIEWPORT_MARGIN = 12;\nconst OVERLAY_OFFSET = 9;\n\nfunction rectFromClientRect(rect: DOMRect | ClientRect): MaybeRect {\n return {\n height: rect.height,\n left: rect.left,\n top: rect.top,\n width: rect.width,\n };\n}\n\nfunction viewportRect(windowRef: Window): MaybeRect {\n return {\n height: windowRef.innerHeight || 768,\n left: 0,\n top: 0,\n width: windowRef.innerWidth || 1024,\n };\n}\n\nfunction resolveAnchorElement(anchor: OverlayAnchorInput): HTMLElement | null {\n if (anchor instanceof ElementRef) {\n return anchor.nativeElement;\n }\n\n return anchor instanceof HTMLElement ? anchor : null;\n}\n\n@Directive({\n selector: '[tngDatepickerOverlay]',\n exportAs: 'tngDatepickerOverlay',\n})\nexport class TngDatepickerOverlay {\n private readonly elRef = inject(ElementRef<HTMLElement>);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly ownerDocument = this.elRef.nativeElement.ownerDocument ?? null;\n private readonly ownerWindow = this.ownerDocument?.defaultView ?? null;\n private readonly renderVersion = signal(0);\n private readonly resolvedPlacement = signal<'bottom' | 'top'>('bottom');\n\n private overlayPlaceholder: Comment | null = null;\n private overlayOriginalParent: Node | null = null;\n private overlayLayoutFrame: number | null = null;\n private removeResizeListener: (() => void) | null = null;\n private removeScrollListener: (() => void) | null = null;\n private resizeObserver: ResizeObserver | null = null;\n\n public readonly controller = input.required<TngDatepickerOverlayController>({\n alias: 'tngDatepickerOverlay',\n });\n public readonly anchor = input<OverlayAnchorInput>(undefined, {\n alias: 'tngDatepickerOverlayAnchor',\n });\n public readonly placement = input<TngOverlayPlacement | undefined>(undefined, {\n alias: 'tngDatepickerOverlayPlacement',\n });\n public readonly offset = input<TngOverlayOffset | undefined>(undefined, {\n alias: 'tngDatepickerOverlayOffset',\n });\n public readonly collision = input<TngOverlayCollisionOptions | undefined>(undefined, {\n alias: 'tngDatepickerOverlayCollision',\n });\n\n @HostBinding('attr.hidden')\n protected get hidden(): '' | null {\n this.renderVersion();\n return this.controller().getOutputs().open ? null : '';\n }\n\n @HostBinding('style.display')\n protected get display(): string | null {\n this.renderVersion();\n return this.controller().getOutputs().open ? null : 'none';\n }\n\n @HostBinding('attr.data-placement')\n protected get dataPlacement(): 'bottom' | 'top' {\n this.renderVersion();\n return this.resolvedPlacement();\n }\n\n public constructor() {\n this.initializeOverlayPortal();\n\n effect((onCleanup) => {\n const controller = this.controller();\n controller.registerOverlay(this.elRef.nativeElement);\n const unsubscribe = controller.subscribe(() => {\n this.renderVersion.update((value) => value + 1);\n });\n\n onCleanup(() => {\n unsubscribe();\n controller.registerOverlay(null);\n });\n });\n\n effect(() => {\n const open = this.controller().getOutputs().open;\n this.renderVersion();\n this.placement();\n this.offset();\n this.collision();\n this.anchor();\n\n if (open) {\n this.mountToBodyAndPosition();\n return;\n }\n\n this.restoreToPlaceholder();\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.overlayLayoutFrame !== null && this.ownerWindow !== null) {\n this.ownerWindow.cancelAnimationFrame(this.overlayLayoutFrame);\n this.overlayLayoutFrame = null;\n }\n\n this.teardownRepositionListeners();\n this.restoreToPlaceholder(true);\n });\n }\n\n private initializeOverlayPortal(): void {\n if (this.overlayPlaceholder !== null) {\n return;\n }\n\n const placeholderDocument = this.ownerDocument ?? document;\n const overlay = this.elRef.nativeElement;\n this.overlayPlaceholder = placeholderDocument.createComment('tng-datepicker-overlay-anchor');\n this.overlayOriginalParent = overlay.parentNode;\n const placeholder = this.overlayPlaceholder;\n if (this.overlayOriginalParent !== null && placeholder !== null) {\n this.overlayOriginalParent.insertBefore(placeholder, overlay);\n }\n }\n\n private findAnchorEl(): HTMLElement | null {\n const explicitAnchor = resolveAnchorElement(this.anchor());\n if (explicitAnchor !== null) {\n return explicitAnchor;\n }\n\n const scope =\n this.overlayPlaceholder?.parentNode instanceof HTMLElement\n ? this.overlayPlaceholder.parentNode\n : this.overlayOriginalParent instanceof HTMLElement\n ? this.overlayOriginalParent\n : null;\n\n return (\n scope?.querySelector('[data-slot=\"datepicker-input-shell\"]') ??\n scope?.querySelector('[data-slot=\"datepicker-trigger\"]')\n ) as HTMLElement | null;\n }\n\n private scheduleReposition(): void {\n if (!this.controller().getOutputs().open || this.ownerWindow === null) {\n return;\n }\n\n if (this.overlayLayoutFrame !== null) {\n this.ownerWindow.cancelAnimationFrame(this.overlayLayoutFrame);\n }\n\n this.overlayLayoutFrame = this.ownerWindow.requestAnimationFrame(() => {\n this.overlayLayoutFrame = null;\n this.positionOverlay();\n });\n }\n\n private positionOverlay(): void {\n const overlay = this.elRef.nativeElement;\n const anchor = this.findAnchorEl();\n if (anchor === null || this.ownerWindow === null) {\n return;\n }\n\n const anchorRect = rectFromClientRect(anchor.getBoundingClientRect());\n const viewport = viewportRect(this.ownerWindow);\n const width = Math.max(\n 0,\n Math.min(anchorRect.width, viewport.width - OVERLAY_VIEWPORT_MARGIN * 2),\n );\n\n overlay.style.width = `${width}px`;\n overlay.style.maxWidth = `${Math.max(0, viewport.width - OVERLAY_VIEWPORT_MARGIN * 2)}px`;\n overlay.style.maxHeight = '';\n\n const overlayRect = rectFromClientRect(overlay.getBoundingClientRect());\n const result = computeOverlayPosition({\n anchorRect,\n collision: this.resolveCollision(),\n direction: this.resolveDirection(),\n offset: this.resolveOffset(),\n overlayRect,\n placement: this.resolvePlacement(),\n viewportRect: viewport,\n });\n\n overlay.style.left = `${result.x}px`;\n overlay.style.top = `${result.y}px`;\n\n const anchorBottom = anchorRect.top + anchorRect.height;\n const availableHeight =\n result.side === 'top'\n ? Math.max(0, Math.floor(anchorRect.top - OVERLAY_VIEWPORT_MARGIN - OVERLAY_OFFSET))\n : Math.max(\n 0,\n Math.floor(viewport.height - anchorBottom - OVERLAY_VIEWPORT_MARGIN - OVERLAY_OFFSET),\n );\n\n if (availableHeight > 0) {\n overlay.style.maxHeight = `${availableHeight}px`;\n }\n\n this.resolvedPlacement.set(result.side === 'top' ? 'top' : 'bottom');\n overlay.style.visibility = '';\n }\n\n private setupRepositionListeners(): void {\n if (this.ownerWindow === null || this.removeResizeListener !== null || this.removeScrollListener !== null) {\n return;\n }\n\n const schedule = (): void => {\n this.scheduleReposition();\n };\n\n this.ownerWindow.addEventListener('resize', schedule);\n this.ownerWindow.addEventListener('scroll', schedule, true);\n this.removeResizeListener = () => this.ownerWindow?.removeEventListener('resize', schedule);\n this.removeScrollListener = () => this.ownerWindow?.removeEventListener('scroll', schedule, true);\n\n if ('ResizeObserver' in this.ownerWindow) {\n const ResizeObserverCtor = this.ownerWindow.ResizeObserver;\n this.resizeObserver = new ResizeObserverCtor(() => {\n this.scheduleReposition();\n });\n\n const anchor = this.findAnchorEl();\n if (anchor !== null && this.resizeObserver !== null) {\n this.resizeObserver.observe(anchor);\n }\n\n this.resizeObserver?.observe(this.elRef.nativeElement);\n }\n }\n\n private teardownRepositionListeners(): void {\n this.removeResizeListener?.();\n this.removeScrollListener?.();\n this.removeResizeListener = null;\n this.removeScrollListener = null;\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n }\n\n private mountToBodyAndPosition(): void {\n const overlay = this.elRef.nativeElement;\n if (this.ownerDocument === null) {\n return;\n }\n\n this.setupRepositionListeners();\n\n if (overlay.parentNode !== this.ownerDocument.body) {\n this.ownerDocument.body.appendChild(overlay);\n }\n\n overlay.style.position = 'fixed';\n overlay.style.left = '0px';\n overlay.style.top = '0px';\n overlay.style.visibility = 'hidden';\n overlay.style.zIndex = '1000';\n\n queueMicrotask(() => {\n if (!this.controller().getOutputs().open) {\n return;\n }\n\n this.positionOverlay();\n });\n }\n\n private restoreToPlaceholder(force = false): void {\n const overlay = this.elRef.nativeElement;\n if (!force && overlay.parentNode !== this.ownerDocument?.body) {\n return;\n }\n\n const placeholder = this.overlayPlaceholder;\n if (placeholder?.parentNode !== null && placeholder !== null) {\n placeholder.parentNode.insertBefore(overlay, placeholder);\n } else if (this.overlayOriginalParent !== null) {\n this.overlayOriginalParent.appendChild(overlay);\n }\n\n this.teardownRepositionListeners();\n this.resolvedPlacement.set(this.resolvePlacement().side === 'top' ? 'top' : 'bottom');\n overlay.style.left = '';\n overlay.style.maxHeight = '';\n overlay.style.maxWidth = '';\n overlay.style.position = '';\n overlay.style.top = '';\n overlay.style.visibility = '';\n overlay.style.width = '';\n overlay.style.zIndex = '';\n }\n\n private resolvePlacement(): TngOverlayPlacement {\n return this.placement() ?? { align: 'start', side: 'bottom' };\n }\n\n private resolveOffset(): TngOverlayOffset {\n return this.offset() ?? { side: OVERLAY_OFFSET };\n }\n\n private resolveCollision(): TngOverlayCollisionOptions {\n return this.collision() ?? {\n flip: true,\n padding: OVERLAY_VIEWPORT_MARGIN,\n shift: true,\n };\n }\n\n private resolveDirection(): 'ltr' | 'rtl' {\n return this.controller().getOutputs().getHostAttributes()['dir'] === 'rtl' ? 'rtl' : 'ltr';\n }\n}\n"]}
@@ -46,18 +46,19 @@ export declare class TngInput {
46
46
  static ɵfac: i0.ɵɵFactoryDeclaration<TngInput, never>;
47
47
  static ɵdir: i0.ɵɵDirectiveDeclaration<TngInput, "input[tngInput], textarea[tngInput]", ["tngInput"], { "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "ariaLabelledby"; "required": false; "isSignal": true; }; "ariaInvalid": { "alias": "ariaInvalid"; "required": false; "isSignal": true; }; "ariaRequired": { "alias": "ariaRequired"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
48
48
  }
49
- export declare class TngInputLeading {
49
+ export declare class TngPrefix {
50
50
  readonly hostElement: any;
51
51
  protected readonly dataSlot: "input-leading";
52
- static ɵfac: i0.ɵɵFactoryDeclaration<TngInputLeading, never>;
53
- static ɵdir: i0.ɵɵDirectiveDeclaration<TngInputLeading, "[tngInputLeading]", ["tngInputLeading"], {}, {}, never, never, true, never>;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<TngPrefix, never>;
53
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TngPrefix, "[tngPrefix], [tngInputLeading]", ["tngPrefix"], {}, {}, never, never, true, never>;
54
54
  }
55
- export declare class TngInputTrailing {
55
+ export declare class TngSuffix {
56
56
  readonly hostElement: any;
57
57
  protected readonly dataSlot: "input-trailing";
58
- static ɵfac: i0.ɵɵFactoryDeclaration<TngInputTrailing, never>;
59
- static ɵdir: i0.ɵɵDirectiveDeclaration<TngInputTrailing, "[tngInputTrailing]", ["tngInputTrailing"], {}, {}, never, never, true, never>;
58
+ static ɵfac: i0.ɵɵFactoryDeclaration<TngSuffix, never>;
59
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TngSuffix, "[tngSuffix], [tngInputTrailing]", ["tngSuffix"], {}, {}, never, never, true, never>;
60
60
  }
61
+ export { TngPrefix as TngInputLeading, TngSuffix as TngInputTrailing };
61
62
  export declare class TngInputGroup implements AfterContentInit, OnDestroy {
62
63
  readonly hasLeading: import("@angular/core").InputSignal<boolean | null>;
63
64
  readonly hasTrailing: import("@angular/core").InputSignal<boolean | null>;
@@ -66,8 +67,8 @@ export declare class TngInputGroup implements AfterContentInit, OnDestroy {
66
67
  readonly readonly: import("@angular/core").InputSignal<boolean | null>;
67
68
  readonly controlCount: import("@angular/core").InputSignal<number | null>;
68
69
  protected controls: QueryList<TngInput>;
69
- protected leadingSlots: QueryList<TngInputLeading>;
70
- protected trailingSlots: QueryList<TngInputTrailing>;
70
+ protected prefixSlots: QueryList<TngPrefix>;
71
+ protected suffixSlots: QueryList<TngSuffix>;
71
72
  private readonly hostElement;
72
73
  private focused;
73
74
  private readonly destroyed$;
@@ -90,7 +91,6 @@ export declare class TngInputGroup implements AfterContentInit, OnDestroy {
90
91
  protected primaryControl(): TngInput | null;
91
92
  protected primaryControlElement(): HTMLInputElement | HTMLTextAreaElement | null;
92
93
  static ɵfac: i0.ɵɵFactoryDeclaration<TngInputGroup, never>;
93
- 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", "leadingSlots", "trailingSlots"], ["[tngInputLeading], [data-tng-input-leading-proxy]", "input[tngInput], textarea[tngInput], [data-tng-input-control-proxy]", "[tngInputTrailing], [data-tng-input-trailing-proxy]"], true, never>;
94
+ 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>;
94
95
  }
95
- export {};
96
96
  //# sourceMappingURL=tng-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tng-input.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/input/tng-input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAOhB,SAAS,EACT,SAAS,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AAuB;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,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,KAAK,EAAE,UAAU,GAAG,IAAI;IAO7C,SAAS,CAAC,cAAc,IAAI,OAAO;IAQnC,SAAS,CAAC,eAAe,IAAI,OAAO;IAQpC,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;yCA7JrE,aAAa;2CAAb,aAAa;CA0KzB"}
@@ -165,38 +165,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
165
165
  type: HostBinding,
166
166
  args: ['attr.required']
167
167
  }] } });
168
- export class TngInputLeading {
168
+ export class TngPrefix {
169
169
  hostElement = inject((ElementRef)).nativeElement;
170
170
  dataSlot = 'input-leading';
171
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngInputLeading, deps: [], target: i0.ɵɵFactoryTarget.Directive });
172
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: TngInputLeading, isStandalone: true, selector: "[tngInputLeading]", host: { properties: { "attr.data-slot": "this.dataSlot" } }, exportAs: ["tngInputLeading"], ngImport: i0 });
171
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngPrefix, deps: [], target: i0.ɵɵFactoryTarget.Directive });
172
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: TngPrefix, isStandalone: true, selector: "[tngPrefix], [tngInputLeading]", host: { properties: { "attr.data-slot": "this.dataSlot" } }, exportAs: ["tngPrefix"], ngImport: i0 });
173
173
  }
174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngInputLeading, decorators: [{
174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngPrefix, decorators: [{
175
175
  type: Directive,
176
176
  args: [{
177
- selector: '[tngInputLeading]',
178
- exportAs: 'tngInputLeading',
177
+ selector: '[tngPrefix], [tngInputLeading]',
178
+ exportAs: 'tngPrefix',
179
179
  }]
180
180
  }], propDecorators: { dataSlot: [{
181
181
  type: HostBinding,
182
182
  args: ['attr.data-slot']
183
183
  }] } });
184
- export class TngInputTrailing {
184
+ export class TngSuffix {
185
185
  hostElement = inject((ElementRef)).nativeElement;
186
186
  dataSlot = 'input-trailing';
187
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngInputTrailing, deps: [], target: i0.ɵɵFactoryTarget.Directive });
188
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: TngInputTrailing, isStandalone: true, selector: "[tngInputTrailing]", host: { properties: { "attr.data-slot": "this.dataSlot" } }, exportAs: ["tngInputTrailing"], ngImport: i0 });
187
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngSuffix, deps: [], target: i0.ɵɵFactoryTarget.Directive });
188
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: TngSuffix, isStandalone: true, selector: "[tngSuffix], [tngInputTrailing]", host: { properties: { "attr.data-slot": "this.dataSlot" } }, exportAs: ["tngSuffix"], ngImport: i0 });
189
189
  }
190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngInputTrailing, decorators: [{
190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngSuffix, decorators: [{
191
191
  type: Directive,
192
192
  args: [{
193
- selector: '[tngInputTrailing]',
194
- exportAs: 'tngInputTrailing',
193
+ selector: '[tngSuffix], [tngInputTrailing]',
194
+ exportAs: 'tngSuffix',
195
195
  }]
196
196
  }], propDecorators: { dataSlot: [{
197
197
  type: HostBinding,
198
198
  args: ['attr.data-slot']
199
199
  }] } });
200
+ export { TngPrefix as TngInputLeading, TngSuffix as TngInputTrailing };
200
201
  export class TngInputGroup {
201
202
  hasLeading = input(null, ...(ngDevMode ? [{ debugName: "hasLeading" }] : []));
202
203
  hasTrailing = input(null, ...(ngDevMode ? [{ debugName: "hasTrailing" }] : []));
@@ -205,8 +206,8 @@ export class TngInputGroup {
205
206
  readonly = input(null, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
206
207
  controlCount = input(null, ...(ngDevMode ? [{ debugName: "controlCount" }] : []));
207
208
  controls;
208
- leadingSlots;
209
- trailingSlots;
209
+ prefixSlots;
210
+ suffixSlots;
210
211
  hostElement = inject((ElementRef)).nativeElement;
211
212
  focused = false;
212
213
  destroyed$ = new Subject();
@@ -290,17 +291,17 @@ export class TngInputGroup {
290
291
  this.focused = false;
291
292
  }
292
293
  hasLeadingSlot() {
293
- const proxy = this.hostElement.querySelector('[data-tng-input-leading-proxy]');
294
+ const proxy = this.hostElement.querySelector('[data-tng-input-prefix-proxy]');
294
295
  if (proxy instanceof HTMLElement)
295
296
  return hasProjectedContent(proxy);
296
- const slots = this.leadingSlots?.toArray() ?? [];
297
+ const slots = this.prefixSlots?.toArray() ?? [];
297
298
  return slots.some((slot) => hasProjectedContent(slot.hostElement));
298
299
  }
299
300
  hasTrailingSlot() {
300
- const proxy = this.hostElement.querySelector('[data-tng-input-trailing-proxy]');
301
+ const proxy = this.hostElement.querySelector('[data-tng-input-suffix-proxy]');
301
302
  if (proxy instanceof HTMLElement)
302
303
  return hasProjectedContent(proxy);
303
- const slots = this.trailingSlots?.toArray() ?? [];
304
+ const slots = this.suffixSlots?.toArray() ?? [];
304
305
  return slots.some((slot) => hasProjectedContent(slot.hostElement));
305
306
  }
306
307
  effectiveHasLeading() {
@@ -328,10 +329,10 @@ export class TngInputGroup {
328
329
  return null;
329
330
  }
330
331
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngInputGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
331
- 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: "leadingSlots", predicate: TngInputLeading, descendants: true }, { propertyName: "trailingSlots", predicate: TngInputTrailing, descendants: true }], exportAs: ["tngInputGroup"], ngImport: i0, template: `
332
+ 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: `
332
333
  @if (hasLeadingSlot()) {
333
334
  <span class="tng-input-group-leading" data-slot="input-group-leading">
334
- <ng-content select="[tngInputLeading], [data-tng-input-leading-proxy]"></ng-content>
335
+ <ng-content select="[tngPrefix], [tngInputLeading], [data-tng-input-prefix-proxy]"></ng-content>
335
336
  </span>
336
337
  }
337
338
 
@@ -341,7 +342,7 @@ export class TngInputGroup {
341
342
 
342
343
  @if (hasTrailingSlot()) {
343
344
  <span class="tng-input-group-trailing" data-slot="input-group-trailing">
344
- <ng-content select="[tngInputTrailing], [data-tng-input-trailing-proxy]"></ng-content>
345
+ <ng-content select="[tngSuffix], [tngInputTrailing], [data-tng-input-suffix-proxy]"></ng-content>
345
346
  </span>
346
347
  }
347
348
  `, isInline: true });
@@ -354,7 +355,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
354
355
  template: `
355
356
  @if (hasLeadingSlot()) {
356
357
  <span class="tng-input-group-leading" data-slot="input-group-leading">
357
- <ng-content select="[tngInputLeading], [data-tng-input-leading-proxy]"></ng-content>
358
+ <ng-content select="[tngPrefix], [tngInputLeading], [data-tng-input-prefix-proxy]"></ng-content>
358
359
  </span>
359
360
  }
360
361
 
@@ -364,7 +365,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
364
365
 
365
366
  @if (hasTrailingSlot()) {
366
367
  <span class="tng-input-group-trailing" data-slot="input-group-trailing">
367
- <ng-content select="[tngInputTrailing], [data-tng-input-trailing-proxy]"></ng-content>
368
+ <ng-content select="[tngSuffix], [tngInputTrailing], [data-tng-input-suffix-proxy]"></ng-content>
368
369
  </span>
369
370
  }
370
371
  `,
@@ -372,12 +373,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
372
373
  }], 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: [{
373
374
  type: ContentChildren,
374
375
  args: [TngInput, { descendants: true }]
375
- }], leadingSlots: [{
376
+ }], prefixSlots: [{
376
377
  type: ContentChildren,
377
- args: [TngInputLeading, { descendants: true }]
378
- }], trailingSlots: [{
378
+ args: [TngPrefix, { descendants: true }]
379
+ }], suffixSlots: [{
379
380
  type: ContentChildren,
380
- args: [TngInputTrailing, { descendants: true }]
381
+ args: [TngSuffix, { descendants: true }]
381
382
  }], dataSlot: [{
382
383
  type: HostBinding,
383
384
  args: ['attr.data-slot']