@tailng-ui/primitives 0.51.0 → 0.52.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 (29) hide show
  1. package/package.json +2 -2
  2. package/src/lib/form/_shared/select/tng-select.overlay.shared.d.ts +6 -0
  3. package/src/lib/form/_shared/select/tng-select.overlay.shared.d.ts.map +1 -1
  4. package/src/lib/form/_shared/select/tng-select.overlay.shared.js +65 -11
  5. package/src/lib/form/_shared/select/tng-select.overlay.shared.js.map +1 -1
  6. package/src/lib/form/autocomplete/tng-autocomplete.overlay.d.ts +6 -1
  7. package/src/lib/form/autocomplete/tng-autocomplete.overlay.d.ts.map +1 -1
  8. package/src/lib/form/autocomplete/tng-autocomplete.overlay.js +59 -3
  9. package/src/lib/form/autocomplete/tng-autocomplete.overlay.js.map +1 -1
  10. package/src/lib/form/datepicker/tng-datepicker.overlay.d.ts +11 -0
  11. package/src/lib/form/datepicker/tng-datepicker.overlay.d.ts.map +1 -1
  12. package/src/lib/form/datepicker/tng-datepicker.overlay.js +73 -3
  13. package/src/lib/form/datepicker/tng-datepicker.overlay.js.map +1 -1
  14. package/src/lib/form/index.d.ts +1 -0
  15. package/src/lib/form/index.d.ts.map +1 -1
  16. package/src/lib/form/index.js +1 -0
  17. package/src/lib/form/index.js.map +1 -1
  18. package/src/lib/form/input/tng-adornment.d.ts +6 -6
  19. package/src/lib/form/input/tng-adornment.d.ts.map +1 -1
  20. package/src/lib/form/input/tng-adornment.js +12 -12
  21. package/src/lib/form/input/tng-adornment.js.map +1 -1
  22. package/src/lib/form/input/tng-input-group.d.ts +4 -4
  23. package/src/lib/form/input/tng-input-group.d.ts.map +1 -1
  24. package/src/lib/form/input/tng-input-group.js +8 -8
  25. package/src/lib/form/input/tng-input-group.js.map +1 -1
  26. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.d.ts +5 -0
  27. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.d.ts.map +1 -1
  28. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.js +51 -4
  29. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailng-ui/primitives",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@angular/core": "^21.1.0",
20
- "@tailng-ui/cdk": "^0.37.0",
20
+ "@tailng-ui/cdk": "^0.38.0",
21
21
  "tslib": "^2.3.0"
22
22
  },
23
23
  "sideEffects": false
@@ -31,6 +31,12 @@ export declare class TngSelectOverlay {
31
31
  private setupRepositionListeners;
32
32
  private teardownRepositionListeners;
33
33
  private findTriggerEl;
34
+ /**
35
+ * Anchor for overlay positioning, width, and dismiss boundary.
36
+ * Prefer the enclosing form-field (so the overlay aligns with the visible
37
+ * field frame), else the select trigger itself.
38
+ */
39
+ private findAnchorEl;
34
40
  private syncPortalledThemeVars;
35
41
  private applyPortalledStacking;
36
42
  private clearPortalledThemeVars;
@@ -1 +1 @@
1
- {"version":3,"file":"tng-select.overlay.shared.d.ts","sourceRoot":"","sources":["../../../../../../../../../libs/tailng-ui/primitives/src/lib/form/_shared/select/tng-select.overlay.shared.ts"],"names":[],"mappings":";AAkHA,qBAIa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6C;IAClE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+C;IACrE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAC1D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAExB;IAEH,OAAO,CAAC,qBAAqB,CAA4B;IACzD,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,cAAc,CAA+B;IAErD,SAAgB,SAAS;;;oBAAqD;IAC9E,SAAgB,MAAM;;;oBAAkD;IACxE,SAAgB,SAAS;;;;oBAA4D;IAGrF,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,gBAAgB,CAAU;IAGxD,SAAS,KAAK,MAAM,IAAI,EAAE,GAAG,IAAI,CAEhC;IAED,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,wBAAwB,CAA6B;;IAsB7D,OAAO,CAAC,UAAU;IAuBlB,OAAO,CAAC,wBAAwB;IAsBhC,OAAO,CAAC,2BAA2B;IAOnC,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,sBAAsB;IAqB9B,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,sBAAsB;IAiD9B,OAAO,CAAC,oBAAoB;IAuC5B,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,mBAAmB;yCArQhB,gBAAgB;2CAAhB,gBAAgB;CAkR5B"}
1
+ {"version":3,"file":"tng-select.overlay.shared.d.ts","sourceRoot":"","sources":["../../../../../../../../../libs/tailng-ui/primitives/src/lib/form/_shared/select/tng-select.overlay.shared.ts"],"names":[],"mappings":";AA4JA,qBAIa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6C;IAClE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+C;IACrE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAC1D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAExB;IAEH,OAAO,CAAC,qBAAqB,CAA4B;IACzD,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,cAAc,CAA+B;IAErD,SAAgB,SAAS;;;oBAAqD;IAC9E,SAAgB,MAAM;;;oBAAkD;IACxE,SAAgB,SAAS;;;;oBAA4D;IAGrF,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,gBAAgB,CAAU;IAGxD,SAAS,KAAK,MAAM,IAAI,EAAE,GAAG,IAAI,CAEhC;IAED,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,wBAAwB,CAA6B;;IAsB7D,OAAO,CAAC,UAAU;IAuBlB,OAAO,CAAC,wBAAwB;IAsBhC,OAAO,CAAC,2BAA2B;IAOnC,OAAO,CAAC,aAAa;IAKrB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,sBAAsB;IAqB9B,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,sBAAsB;IAoD9B,OAAO,CAAC,oBAAoB;IAwC5B,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,mBAAmB;yCAlRhB,gBAAgB;2CAAhB,gBAAgB;CA+R5B"}
@@ -80,6 +80,48 @@ function isInside(target, container) {
80
80
  function resolveOverlayOwnerId(host) {
81
81
  return host.closest(`[${TNG_OVERLAY_LAYER_ID_ATTR}]`)?.getAttribute(TNG_OVERLAY_LAYER_ID_ATTR) ?? null;
82
82
  }
83
+ /**
84
+ * When the overlay's host element lives inside a `tng-form-field`, the form-field
85
+ * is the visible frame the consumer sees, so the overlay should align with it
86
+ * (width + left/right edges). For the `left` label layout the form-field's root
87
+ * spans the label column too, so anchor on the inner control-row instead.
88
+ */
89
+ function findFormFieldAnchor(host) {
90
+ const formField = host.closest('[data-slot="form-field"]');
91
+ if (!formField)
92
+ return null;
93
+ if (formField.getAttribute('data-label-position') === 'left') {
94
+ const row = formField.querySelector('.tng-form-field__control-row');
95
+ return row ?? formField;
96
+ }
97
+ return formField;
98
+ }
99
+ /**
100
+ * Rect to use for overlay positioning. When the anchor is a form-field root, the
101
+ * horizontal extent is taken from the form-field (so the overlay spans the field
102
+ * frame) but the vertical extent is taken from the inner fieldset (the input row)
103
+ * so the overlay opens directly under the input rather than below the messages
104
+ * region beneath the frame.
105
+ */
106
+ function anchorRectFor(anchorEl) {
107
+ const widthRect = anchorEl.getBoundingClientRect();
108
+ if (!anchorEl.matches('[data-slot="form-field"]')) {
109
+ return rectFromClientRect(widthRect);
110
+ }
111
+ const labelPosition = anchorEl.getAttribute('data-label-position');
112
+ const fieldset = anchorEl.querySelector('[data-slot="form-field-control-row"]');
113
+ const innerRow = anchorEl.querySelector('.tng-form-field__control-row');
114
+ const positionEl = labelPosition === 'outline' ? (fieldset ?? innerRow) : (innerRow ?? fieldset);
115
+ if (!positionEl)
116
+ return rectFromClientRect(widthRect);
117
+ const positionRect = positionEl.getBoundingClientRect();
118
+ return {
119
+ left: widthRect.left,
120
+ width: widthRect.width,
121
+ top: positionRect.top,
122
+ height: positionRect.height,
123
+ };
124
+ }
83
125
  export class TngSelectOverlay {
84
126
  host = inject(TNG_SELECT_HOST);
85
127
  elRef = inject(ElementRef);
@@ -124,10 +166,10 @@ export class TngSelectOverlay {
124
166
  if (!this.host.open())
125
167
  return;
126
168
  const panel = this.elRef.nativeElement;
127
- const trigger = this.findTriggerEl();
128
- if (!trigger)
169
+ const anchorEl = this.findAnchorEl();
170
+ if (!anchorEl)
129
171
  return;
130
- const anchor = rectFromClientRect(trigger.getBoundingClientRect());
172
+ const anchor = anchorRectFor(anchorEl);
131
173
  const overlay = rectFromClientRect(panel.getBoundingClientRect());
132
174
  const viewport = viewportRect();
133
175
  const result = computeOverlayPosition({
@@ -156,9 +198,9 @@ export class TngSelectOverlay {
156
198
  this.removeResizeListener = () => window.removeEventListener('resize', onResize);
157
199
  if ('ResizeObserver' in window) {
158
200
  this.resizeObserver = new ResizeObserver(() => schedule());
159
- const trigger = this.findTriggerEl();
160
- if (trigger)
161
- this.resizeObserver.observe(trigger);
201
+ const anchorEl = this.findAnchorEl();
202
+ if (anchorEl)
203
+ this.resizeObserver.observe(anchorEl);
162
204
  this.resizeObserver.observe(this.elRef.nativeElement);
163
205
  }
164
206
  }
@@ -172,6 +214,14 @@ export class TngSelectOverlay {
172
214
  const root = this.host.hostElement;
173
215
  return root.querySelector('[data-slot="select-trigger"]');
174
216
  }
217
+ /**
218
+ * Anchor for overlay positioning, width, and dismiss boundary.
219
+ * Prefer the enclosing form-field (so the overlay aligns with the visible
220
+ * field frame), else the select trigger itself.
221
+ */
222
+ findAnchorEl() {
223
+ return findFormFieldAnchor(this.host.hostElement) ?? this.findTriggerEl();
224
+ }
175
225
  syncPortalledThemeVars() {
176
226
  const panel = this.elRef.nativeElement;
177
227
  const hostStyles = getComputedStyle(this.host.hostElement);
@@ -223,14 +273,17 @@ export class TngSelectOverlay {
223
273
  queueMicrotask(() => {
224
274
  if (!this.host.open())
225
275
  return;
226
- const trigger = this.findTriggerEl();
227
- if (!trigger)
276
+ const anchorEl = this.findAnchorEl();
277
+ if (!anchorEl)
228
278
  return;
229
- const anchor = rectFromClientRect(trigger.getBoundingClientRect());
279
+ const anchor = anchorRectFor(anchorEl);
230
280
  const viewportWidth = viewportRect().width;
231
281
  const inlineSize = Math.max(0, Math.min(anchor.width, viewportWidth - 16));
232
282
  panel.style.width = `${inlineSize}px`;
233
283
  panel.style.minWidth = `${inlineSize}px`;
284
+ if (findFormFieldAnchor(this.host.hostElement)) {
285
+ panel.style.maxWidth = 'none';
286
+ }
234
287
  const overlay = rectFromClientRect(panel.getBoundingClientRect());
235
288
  const viewport = viewportRect();
236
289
  const result = computeOverlayPosition({
@@ -275,6 +328,7 @@ export class TngSelectOverlay {
275
328
  panel.style.zIndex = '';
276
329
  panel.style.width = '';
277
330
  panel.style.minWidth = '';
331
+ panel.style.maxWidth = '';
278
332
  panel.removeAttribute(TNG_OVERLAY_OWNER_ID_ATTR);
279
333
  this.clearPortalledThemeVars();
280
334
  this.teardownOutsidePointer();
@@ -286,10 +340,10 @@ export class TngSelectOverlay {
286
340
  if (!this.host.open())
287
341
  return;
288
342
  const panel = this.elRef.nativeElement;
289
- const trigger = this.findTriggerEl();
343
+ const anchorEl = this.findAnchorEl();
290
344
  if (isInside(ev.target, panel))
291
345
  return;
292
- if (trigger && isInside(ev.target, trigger))
346
+ if (anchorEl && isInside(ev.target, anchorEl))
293
347
  return;
294
348
  if (this.host.multiple() &&
295
349
  ev.target &&
@@ -1 +1 @@
1
- {"version":3,"file":"tng-select.overlay.shared.js","sourceRoot":"","sources":["../../../../../../../../../libs/tailng-ui/primitives/src/lib/form/_shared/select/tng-select.overlay.shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;;AAS7D,MAAM,2BAA2B,GAAG;IAClC,qBAAqB;IACrB,4BAA4B;IAC5B,iCAAiC;IACjC,yBAAyB;IACzB,yBAAyB;IACzB,0BAA0B;IAC1B,wBAAwB;IACxB,2BAA2B;IAC3B,uCAAuC;IACvC,8BAA8B;IAC9B,6BAA6B;IAC7B,6BAA6B;IAC7B,gCAAgC;IAChC,wBAAwB;IACxB,8BAA8B;IAC9B,iBAAiB;IACjB,6BAA6B;IAC7B,yBAAyB;IACzB,iCAAiC;IACjC,0BAA0B;IAC1B,gCAAgC;IAChC,wBAAwB;IACxB,wBAAwB;IACxB,4BAA4B;IAC5B,+BAA+B;IAC/B,mCAAmC;IACnC,iCAAiC;IACjC,qCAAqC;IACrC,iCAAiC;IACjC,wCAAwC;IACxC,4CAA4C;IAC5C,4CAA4C;IAC5C,sCAAsC;IACtC,iCAAiC;IACjC,8BAA8B;IAC9B,gCAAgC;IAChC,0BAA0B;IAC1B,qCAAqC;IACrC,qBAAqB;IACrB,4BAA4B;IAC5B,2BAA2B;I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AAO,EAAE,KAAK,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;uGAjRU,gBAAgB;2FAAhB,gBAAgB;;2FAAhB,gBAAgB;kBAJ5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,QAAQ,EAAE,kBAAkB;iBAC7B;;sBAkBE,WAAW;uBAAC,gBAAgB;;sBAG5B,WAAW;uBAAC,aAAa","sourcesContent":["import {\n DestroyRef,\n Directive,\n ElementRef,\n HostBinding,\n inject,\n input,\n effect,\n} from '@angular/core';\nimport type {\n TngOverlayCollisionOptions,\n TngOverlayOffset,\n TngOverlayPlacement,\n} from '@tailng-ui/cdk';\nimport {\n computeOverlayPosition,\n createTngIdFactory,\n getGlobalScrollLockManager,\n} from '@tailng-ui/cdk';\n\nimport type { TngSelectHostApi } from './tng-select.host-api';\nimport { TNG_SELECT_HOST } from './tng-select.tokens.shared';\n\ntype MaybeRect = Readonly<{\n left: number;\n top: number;\n width: number;\n height: number;\n}>;\n\nconst PORTALLED_SELECT_THEME_VARS = [\n '--tng-select-radius',\n '--tng-select-trigger-width',\n '--tng-select-trigger-min-height',\n '--tng-select-trigger-py',\n '--tng-select-trigger-px',\n '--tng-select-trigger-gap',\n '--tng-select-icon-size',\n '--tng-select-icon-opacity',\n '--tng-select-icon-margin-inline-start',\n '--tng-select-overlay-padding',\n '--tng-select-overlay-radius',\n '--tng-select-overlay-shadow',\n '--tng-select-overlay-max-width',\n '--tng-select-z-overlay',\n '--tng-select-overlay-z-index',\n '--tng-z-overlay',\n '--tng-select-overlay-border',\n '--tng-select-overlay-bg',\n '--tng-select-overlay-max-height',\n '--tng-select-listbox-gap',\n '--tng-select-option-min-height',\n '--tng-select-option-py',\n '--tng-select-option-px',\n '--tng-select-option-radius',\n '--tng-select-option-bg-active',\n '--tng-select-option-border-active',\n '--tng-select-option-bg-selected',\n '--tng-select-option-border-selected',\n '--tng-select-option-fg-selected',\n '--tng-select-option-bg-selected-active',\n '--tng-select-option-border-selected-active',\n '--tng-select-option-shadow-selected-active',\n '--tng-select-option-disabled-opacity',\n '--tng-select-option-font-weight',\n '--tng-select-value-font-size',\n '--tng-select-value-font-weight',\n '--tng-select-value-color',\n '--tng-select-icon-margin-inline-end',\n '--tng-select-border',\n '--tng-select-border-strong',\n '--tng-select-border-hover',\n '--tng-select-bg',\n '--tng-select-surface',\n '--tng-select-fg',\n '--tng-select-muted',\n '--tng-select-brand',\n '--tng-select-danger',\n '--tng-select-focus-ring',\n '--tng-select-ease',\n '--tng-select-shadow',\n '--tng-select-shadow-focus',\n '--tng-semantic-background-base',\n '--tng-semantic-background-surface',\n '--tng-semantic-border-subtle',\n '--tng-semantic-border-strong',\n '--tng-semantic-foreground-primary',\n '--tng-semantic-foreground-secondary',\n '--tng-semantic-foreground-muted',\n '--tng-semantic-accent-brand',\n '--tng-semantic-accent-danger',\n '--tng-semantic-focus-ring',\n] as const;\n\nconst TNG_OVERLAY_LAYER_ID_ATTR = 'data-tng-overlay-layer-id';\nconst TNG_OVERLAY_OWNER_ID_ATTR = 'data-tng-overlay-owner-id';\nconst createSelectOverlayLockId = createTngIdFactory('tng-select-overlay-lock');\n\nfunction rectFromClientRect(r: DOMRect | ClientRect): MaybeRect {\n return { left: r.left, top: r.top, width: r.width, height: r.height };\n}\n\nfunction viewportRect(): MaybeRect {\n return { left: 0, top: 0, width: window.innerWidth || 1024, height: window.innerHeight || 768 };\n}\n\nfunction isInside(target: EventTarget | null, container: HTMLElement): boolean {\n return !!target && target instanceof Node && container.contains(target);\n}\n\nfunction resolveOverlayOwnerId(host: HTMLElement): string | null {\n return host.closest<HTMLElement>(`[${TNG_OVERLAY_LAYER_ID_ATTR}]`)?.getAttribute(TNG_OVERLAY_LAYER_ID_ATTR) ?? null;\n}\n\n@Directive({\n selector: '[tngSelectOverlay]',\n exportAs: 'tngSelectOverlay',\n})\nexport class TngSelectOverlay {\n private readonly host = inject<TngSelectHostApi>(TNG_SELECT_HOST);\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly instanceId = createSelectOverlayLockId();\n private readonly scrollLock = getGlobalScrollLockManager({\n documentRef: this.elRef.nativeElement.ownerDocument,\n });\n\n private lastFocusedBeforeOpen: HTMLElement | null = null;\n private removeResizeListener: (() => void) | null = null;\n private resizeObserver: ResizeObserver | null = null;\n\n public readonly placement = input<TngOverlayPlacement | undefined>(undefined);\n public readonly offset = input<TngOverlayOffset | undefined>(undefined);\n public readonly collision = input<TngOverlayCollisionOptions | undefined>(undefined);\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'select-overlay' as const;\n\n @HostBinding('attr.hidden')\n protected get hidden(): '' | null {\n return this.host.open() ? null : '';\n }\n\n private placeholder: Comment | null = null;\n private originalParent: Node | null = null;\n private removeDocPointerListener: (() => void) | null = null;\n\n public constructor() {\n this.placeholder = document.createComment('tng-select-overlay-anchor');\n const hostEl = this.elRef.nativeElement;\n this.originalParent = hostEl.parentNode;\n this.originalParent?.insertBefore(this.placeholder, hostEl);\n\n effect(() => {\n const open = this.host.open();\n if (open) this.mountToBodyAndPosition();\n else this.restoreToPlaceholder();\n });\n\n this.destroyRef.onDestroy(() => {\n this.teardownOutsidePointer();\n this.restoreToPlaceholder(true);\n this.placeholder = null;\n this.originalParent = null;\n });\n }\n\n private reposition(): void {\n if (!this.host.open()) return;\n const panel = this.elRef.nativeElement;\n const trigger = this.findTriggerEl();\n if (!trigger) return;\n\n const anchor = rectFromClientRect(trigger.getBoundingClientRect());\n const overlay = rectFromClientRect(panel.getBoundingClientRect());\n const viewport = viewportRect();\n\n const result = computeOverlayPosition({\n anchorRect: anchor,\n overlayRect: overlay,\n viewportRect: viewport,\n placement: this.placement(),\n offset: this.offset(),\n collision: this.collision(),\n });\n\n panel.style.left = `${result.x}px`;\n panel.style.top = `${result.y}px`;\n }\n\n private setupRepositionListeners(): void {\n let rafId: number | null = null;\n const schedule = (): void => {\n if (rafId !== null) return;\n rafId = requestAnimationFrame(() => {\n rafId = null;\n this.reposition();\n });\n };\n\n const onResize = (): void => schedule();\n window.addEventListener('resize', onResize);\n this.removeResizeListener = (): void => window.removeEventListener('resize', onResize);\n\n if ('ResizeObserver' in window) {\n this.resizeObserver = new ResizeObserver(() => schedule());\n const trigger = this.findTriggerEl();\n if (trigger) this.resizeObserver.observe(trigger);\n this.resizeObserver.observe(this.elRef.nativeElement);\n }\n }\n\n private teardownRepositionListeners(): void {\n this.removeResizeListener?.();\n this.removeResizeListener = null;\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n }\n\n private findTriggerEl(): HTMLElement | null {\n const root = this.host.hostElement;\n return root.querySelector('[data-slot=\"select-trigger\"]') as HTMLElement | null;\n }\n\n private syncPortalledThemeVars(): void {\n const panel = this.elRef.nativeElement;\n const hostStyles = getComputedStyle(this.host.hostElement);\n\n for (const cssVar of PORTALLED_SELECT_THEME_VARS) {\n const value = hostStyles.getPropertyValue(cssVar).trim();\n if (value) {\n panel.style.setProperty(cssVar, value);\n } else {\n panel.style.removeProperty(cssVar);\n }\n }\n\n const colorScheme = hostStyles.colorScheme?.trim();\n if (colorScheme && colorScheme !== 'normal') {\n panel.style.colorScheme = colorScheme;\n } else {\n panel.style.removeProperty('color-scheme');\n }\n }\n\n private applyPortalledStacking(): void {\n this.elRef.nativeElement.style.zIndex =\n 'var(--tng-select-z-overlay, var(--tng-select-overlay-z-index, var(--tng-z-overlay, 2)))';\n }\n\n private clearPortalledThemeVars(): void {\n const panel = this.elRef.nativeElement;\n\n for (const cssVar of PORTALLED_SELECT_THEME_VARS) {\n panel.style.removeProperty(cssVar);\n }\n\n panel.style.removeProperty('color-scheme');\n }\n\n private mountToBodyAndPosition(): void {\n this.lastFocusedBeforeOpen = document.activeElement as HTMLElement | null;\n this.scrollLock.acquire(this.instanceId);\n this.setupRepositionListeners();\n const panel = this.elRef.nativeElement;\n const ownerId = resolveOverlayOwnerId(this.host.hostElement);\n if (ownerId !== null) {\n panel.setAttribute(TNG_OVERLAY_OWNER_ID_ATTR, ownerId);\n }\n\n if (panel.parentNode !== document.body) {\n document.body.appendChild(panel);\n }\n\n panel.style.position = 'fixed';\n panel.style.left = '0px';\n panel.style.top = '0px';\n this.syncPortalledThemeVars();\n this.applyPortalledStacking();\n\n queueMicrotask(() => {\n if (!this.host.open()) return;\n const trigger = this.findTriggerEl();\n if (!trigger) return;\n\n const anchor = rectFromClientRect(trigger.getBoundingClientRect());\n const viewportWidth = viewportRect().width;\n const inlineSize = Math.max(0, Math.min(anchor.width, viewportWidth - 16));\n panel.style.width = `${inlineSize}px`;\n panel.style.minWidth = `${inlineSize}px`;\n\n const overlay = rectFromClientRect(panel.getBoundingClientRect());\n const viewport = viewportRect();\n const result = computeOverlayPosition({\n anchorRect: anchor,\n overlayRect: overlay,\n viewportRect: viewport,\n placement: this.placement(),\n offset: this.offset(),\n collision: this.collision(),\n });\n\n panel.style.left = `${result.x}px`;\n panel.style.top = `${result.y}px`;\n });\n\n this.setupOutsidePointer();\n }\n\n private restoreToPlaceholder(force = false): void {\n const panel = this.elRef.nativeElement;\n if (!force && panel.parentNode !== document.body) {\n this.teardownOutsidePointer();\n return;\n }\n\n if (this.placeholder?.parentNode) {\n this.placeholder.parentNode.insertBefore(panel, this.placeholder);\n } else if (this.originalParent) {\n this.originalParent.appendChild(panel);\n }\n\n this.teardownRepositionListeners();\n this.scrollLock.release(this.instanceId);\n\n if (\n this.lastFocusedBeforeOpen &&\n document.contains(this.lastFocusedBeforeOpen)\n ) {\n const active = document.activeElement as HTMLElement | null;\n const panelEl = this.elRef.nativeElement;\n if (!active || panelEl.contains(active)) {\n this.lastFocusedBeforeOpen.focus();\n }\n }\n\n this.restoreFocusOnClose();\n panel.style.position = '';\n panel.style.left = '';\n panel.style.top = '';\n panel.style.zIndex = '';\n panel.style.width = '';\n panel.style.minWidth = '';\n panel.removeAttribute(TNG_OVERLAY_OWNER_ID_ATTR);\n this.clearPortalledThemeVars();\n this.teardownOutsidePointer();\n }\n\n private setupOutsidePointer(): void {\n if (this.removeDocPointerListener) return;\n\n const onPointerDown = (ev: PointerEvent): void => {\n if (!this.host.open()) return;\n const panel = this.elRef.nativeElement;\n const trigger = this.findTriggerEl();\n if (isInside(ev.target, panel)) return;\n if (trigger && isInside(ev.target, trigger)) return;\n if (\n this.host.multiple() &&\n ev.target &&\n (ev.target as Element).closest?.(\n '[data-slot=\"select-option\"], [data-slot=\"multi-select-option\"]'\n )\n )\n return;\n this.host.close();\n };\n\n document.addEventListener('pointerdown', onPointerDown, true);\n this.removeDocPointerListener = (): void => {\n document.removeEventListener('pointerdown', onPointerDown, true);\n };\n }\n\n private teardownOutsidePointer(): void {\n this.removeDocPointerListener?.();\n this.removeDocPointerListener = null;\n }\n\n private restoreFocusOnClose(): void {\n const panel = this.elRef.nativeElement;\n const active = document.activeElement as HTMLElement | null;\n if (active && panel.contains(active)) {\n const trigger = this.findTriggerEl();\n trigger?.focus();\n return;\n }\n if (document.activeElement === document.body) {\n const trigger = this.findTriggerEl();\n trigger?.focus();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"tng-select.overlay.shared.js","sourceRoot":"","sources":["../../../../../../../../../libs/tailng-ui/primitives/src/lib/form/_shared/select/tng-select.overlay.shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;;AAS7D,MAAM,2BAA2B,GAAG;IAClC,qBAAqB;IACrB,4BAA4B;IAC5B,iCAAiC;IACjC,yBAAyB;IACzB,yBAAyB;IACzB,0BAA0B;IAC1B,wBAAwB;IACxB,2BAA2B;IAC3B,uCAAuC;IACvC,8BAA8B;IAC9B,6BAA6B;IAC7B,6BAA6B;IAC7B,gC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CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,aAAa,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;QAC9D,IAAI,CAAC,wBAAwB,GAAG,GAAS,EAAE;YACzC,QAAQ,CAAC,mBAAmB,CAAC,aAAa,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;QACnE,CAAC,CAAC;IACJ,CAAC;IAEO,sBAAsB;QAC5B,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC;IACvC,CAAC;IAEO,mBAAmB;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;QACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAmC,CAAC;QAC5D,IAAI,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YACrC,OAAO,EAAE,KAAK,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QACD,IAAI,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YACrC,OAAO,EAAE,KAAK,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;uGA9RU,gBAAgB;2FAAhB,gBAAgB;;2FAAhB,gBAAgB;kBAJ5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,QAAQ,EAAE,kBAAkB;iBAC7B;;sBAkBE,WAAW;uBAAC,gBAAgB;;sBAG5B,WAAW;uBAAC,aAAa","sourcesContent":["import {\n DestroyRef,\n Directive,\n ElementRef,\n HostBinding,\n inject,\n input,\n effect,\n} from '@angular/core';\nimport type {\n TngOverlayCollisionOptions,\n TngOverlayOffset,\n TngOverlayPlacement,\n} from '@tailng-ui/cdk';\nimport {\n computeOverlayPosition,\n createTngIdFactory,\n getGlobalScrollLockManager,\n} from '@tailng-ui/cdk';\n\nimport type { TngSelectHostApi } from './tng-select.host-api';\nimport { TNG_SELECT_HOST } from './tng-select.tokens.shared';\n\ntype MaybeRect = Readonly<{\n left: number;\n top: number;\n width: number;\n height: number;\n}>;\n\nconst PORTALLED_SELECT_THEME_VARS = [\n '--tng-select-radius',\n '--tng-select-trigger-width',\n '--tng-select-trigger-min-height',\n '--tng-select-trigger-py',\n '--tng-select-trigger-px',\n '--tng-select-trigger-gap',\n '--tng-select-icon-size',\n '--tng-select-icon-opacity',\n '--tng-select-icon-margin-inline-start',\n '--tng-select-overlay-padding',\n '--tng-select-overlay-radius',\n '--tng-select-overlay-shadow',\n '--tng-select-overlay-max-width',\n '--tng-select-z-overlay',\n '--tng-select-overlay-z-index',\n '--tng-z-overlay',\n '--tng-select-overlay-border',\n '--tng-select-overlay-bg',\n '--tng-select-overlay-max-height',\n '--tng-select-listbox-gap',\n '--tng-select-option-min-height',\n '--tng-select-option-py',\n '--tng-select-option-px',\n '--tng-select-option-radius',\n '--tng-select-option-bg-active',\n '--tng-select-option-border-active',\n '--tng-select-option-bg-selected',\n '--tng-select-option-border-selected',\n '--tng-select-option-fg-selected',\n '--tng-select-option-bg-selected-active',\n '--tng-select-option-border-selected-active',\n '--tng-select-option-shadow-selected-active',\n '--tng-select-option-disabled-opacity',\n '--tng-select-option-font-weight',\n '--tng-select-value-font-size',\n '--tng-select-value-font-weight',\n '--tng-select-value-color',\n '--tng-select-icon-margin-inline-end',\n '--tng-select-border',\n '--tng-select-border-strong',\n '--tng-select-border-hover',\n '--tng-select-bg',\n '--tng-select-surface',\n '--tng-select-fg',\n '--tng-select-muted',\n '--tng-select-brand',\n '--tng-select-danger',\n '--tng-select-focus-ring',\n '--tng-select-ease',\n '--tng-select-shadow',\n '--tng-select-shadow-focus',\n '--tng-semantic-background-base',\n '--tng-semantic-background-surface',\n '--tng-semantic-border-subtle',\n '--tng-semantic-border-strong',\n '--tng-semantic-foreground-primary',\n '--tng-semantic-foreground-secondary',\n '--tng-semantic-foreground-muted',\n '--tng-semantic-accent-brand',\n '--tng-semantic-accent-danger',\n '--tng-semantic-focus-ring',\n] as const;\n\nconst TNG_OVERLAY_LAYER_ID_ATTR = 'data-tng-overlay-layer-id';\nconst TNG_OVERLAY_OWNER_ID_ATTR = 'data-tng-overlay-owner-id';\nconst createSelectOverlayLockId = createTngIdFactory('tng-select-overlay-lock');\n\nfunction rectFromClientRect(r: DOMRect | ClientRect): MaybeRect {\n return { left: r.left, top: r.top, width: r.width, height: r.height };\n}\n\nfunction viewportRect(): MaybeRect {\n return { left: 0, top: 0, width: window.innerWidth || 1024, height: window.innerHeight || 768 };\n}\n\nfunction isInside(target: EventTarget | null, container: HTMLElement): boolean {\n return !!target && target instanceof Node && container.contains(target);\n}\n\nfunction resolveOverlayOwnerId(host: HTMLElement): string | null {\n return host.closest<HTMLElement>(`[${TNG_OVERLAY_LAYER_ID_ATTR}]`)?.getAttribute(TNG_OVERLAY_LAYER_ID_ATTR) ?? null;\n}\n\n/**\n * When the overlay's host element lives inside a `tng-form-field`, the form-field\n * is the visible frame the consumer sees, so the overlay should align with it\n * (width + left/right edges). For the `left` label layout the form-field's root\n * spans the label column too, so anchor on the inner control-row instead.\n */\nfunction findFormFieldAnchor(host: HTMLElement): HTMLElement | null {\n const formField = host.closest('[data-slot=\"form-field\"]') as HTMLElement | null;\n if (!formField) return null;\n if (formField.getAttribute('data-label-position') === 'left') {\n const row = formField.querySelector('.tng-form-field__control-row') as HTMLElement | null;\n return row ?? formField;\n }\n return formField;\n}\n\n/**\n * Rect to use for overlay positioning. When the anchor is a form-field root, the\n * horizontal extent is taken from the form-field (so the overlay spans the field\n * frame) but the vertical extent is taken from the inner fieldset (the input row)\n * so the overlay opens directly under the input rather than below the messages\n * region beneath the frame.\n */\nfunction anchorRectFor(anchorEl: HTMLElement): MaybeRect {\n const widthRect = anchorEl.getBoundingClientRect();\n if (!anchorEl.matches('[data-slot=\"form-field\"]')) {\n return rectFromClientRect(widthRect);\n }\n const labelPosition = anchorEl.getAttribute('data-label-position');\n const fieldset = anchorEl.querySelector('[data-slot=\"form-field-control-row\"]') as HTMLElement | null;\n const innerRow = anchorEl.querySelector('.tng-form-field__control-row') as HTMLElement | null;\n const positionEl = labelPosition === 'outline' ? (fieldset ?? innerRow) : (innerRow ?? fieldset);\n if (!positionEl) return rectFromClientRect(widthRect);\n const positionRect = positionEl.getBoundingClientRect();\n return {\n left: widthRect.left,\n width: widthRect.width,\n top: positionRect.top,\n height: positionRect.height,\n };\n}\n\n@Directive({\n selector: '[tngSelectOverlay]',\n exportAs: 'tngSelectOverlay',\n})\nexport class TngSelectOverlay {\n private readonly host = inject<TngSelectHostApi>(TNG_SELECT_HOST);\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly instanceId = createSelectOverlayLockId();\n private readonly scrollLock = getGlobalScrollLockManager({\n documentRef: this.elRef.nativeElement.ownerDocument,\n });\n\n private lastFocusedBeforeOpen: HTMLElement | null = null;\n private removeResizeListener: (() => void) | null = null;\n private resizeObserver: ResizeObserver | null = null;\n\n public readonly placement = input<TngOverlayPlacement | undefined>(undefined);\n public readonly offset = input<TngOverlayOffset | undefined>(undefined);\n public readonly collision = input<TngOverlayCollisionOptions | undefined>(undefined);\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'select-overlay' as const;\n\n @HostBinding('attr.hidden')\n protected get hidden(): '' | null {\n return this.host.open() ? null : '';\n }\n\n private placeholder: Comment | null = null;\n private originalParent: Node | null = null;\n private removeDocPointerListener: (() => void) | null = null;\n\n public constructor() {\n this.placeholder = document.createComment('tng-select-overlay-anchor');\n const hostEl = this.elRef.nativeElement;\n this.originalParent = hostEl.parentNode;\n this.originalParent?.insertBefore(this.placeholder, hostEl);\n\n effect(() => {\n const open = this.host.open();\n if (open) this.mountToBodyAndPosition();\n else this.restoreToPlaceholder();\n });\n\n this.destroyRef.onDestroy(() => {\n this.teardownOutsidePointer();\n this.restoreToPlaceholder(true);\n this.placeholder = null;\n this.originalParent = null;\n });\n }\n\n private reposition(): void {\n if (!this.host.open()) return;\n const panel = this.elRef.nativeElement;\n const anchorEl = this.findAnchorEl();\n if (!anchorEl) return;\n\n const anchor = anchorRectFor(anchorEl);\n const overlay = rectFromClientRect(panel.getBoundingClientRect());\n const viewport = viewportRect();\n\n const result = computeOverlayPosition({\n anchorRect: anchor,\n overlayRect: overlay,\n viewportRect: viewport,\n placement: this.placement(),\n offset: this.offset(),\n collision: this.collision(),\n });\n\n panel.style.left = `${result.x}px`;\n panel.style.top = `${result.y}px`;\n }\n\n private setupRepositionListeners(): void {\n let rafId: number | null = null;\n const schedule = (): void => {\n if (rafId !== null) return;\n rafId = requestAnimationFrame(() => {\n rafId = null;\n this.reposition();\n });\n };\n\n const onResize = (): void => schedule();\n window.addEventListener('resize', onResize);\n this.removeResizeListener = (): void => window.removeEventListener('resize', onResize);\n\n if ('ResizeObserver' in window) {\n this.resizeObserver = new ResizeObserver(() => schedule());\n const anchorEl = this.findAnchorEl();\n if (anchorEl) this.resizeObserver.observe(anchorEl);\n this.resizeObserver.observe(this.elRef.nativeElement);\n }\n }\n\n private teardownRepositionListeners(): void {\n this.removeResizeListener?.();\n this.removeResizeListener = null;\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n }\n\n private findTriggerEl(): HTMLElement | null {\n const root = this.host.hostElement;\n return root.querySelector('[data-slot=\"select-trigger\"]') as HTMLElement | null;\n }\n\n /**\n * Anchor for overlay positioning, width, and dismiss boundary.\n * Prefer the enclosing form-field (so the overlay aligns with the visible\n * field frame), else the select trigger itself.\n */\n private findAnchorEl(): HTMLElement | null {\n return findFormFieldAnchor(this.host.hostElement) ?? this.findTriggerEl();\n }\n\n private syncPortalledThemeVars(): void {\n const panel = this.elRef.nativeElement;\n const hostStyles = getComputedStyle(this.host.hostElement);\n\n for (const cssVar of PORTALLED_SELECT_THEME_VARS) {\n const value = hostStyles.getPropertyValue(cssVar).trim();\n if (value) {\n panel.style.setProperty(cssVar, value);\n } else {\n panel.style.removeProperty(cssVar);\n }\n }\n\n const colorScheme = hostStyles.colorScheme?.trim();\n if (colorScheme && colorScheme !== 'normal') {\n panel.style.colorScheme = colorScheme;\n } else {\n panel.style.removeProperty('color-scheme');\n }\n }\n\n private applyPortalledStacking(): void {\n this.elRef.nativeElement.style.zIndex =\n 'var(--tng-select-z-overlay, var(--tng-select-overlay-z-index, var(--tng-z-overlay, 2)))';\n }\n\n private clearPortalledThemeVars(): void {\n const panel = this.elRef.nativeElement;\n\n for (const cssVar of PORTALLED_SELECT_THEME_VARS) {\n panel.style.removeProperty(cssVar);\n }\n\n panel.style.removeProperty('color-scheme');\n }\n\n private mountToBodyAndPosition(): void {\n this.lastFocusedBeforeOpen = document.activeElement as HTMLElement | null;\n this.scrollLock.acquire(this.instanceId);\n this.setupRepositionListeners();\n const panel = this.elRef.nativeElement;\n const ownerId = resolveOverlayOwnerId(this.host.hostElement);\n if (ownerId !== null) {\n panel.setAttribute(TNG_OVERLAY_OWNER_ID_ATTR, ownerId);\n }\n\n if (panel.parentNode !== document.body) {\n document.body.appendChild(panel);\n }\n\n panel.style.position = 'fixed';\n panel.style.left = '0px';\n panel.style.top = '0px';\n this.syncPortalledThemeVars();\n this.applyPortalledStacking();\n\n queueMicrotask(() => {\n if (!this.host.open()) return;\n const anchorEl = this.findAnchorEl();\n if (!anchorEl) return;\n\n const anchor = anchorRectFor(anchorEl);\n const viewportWidth = viewportRect().width;\n const inlineSize = Math.max(0, Math.min(anchor.width, viewportWidth - 16));\n panel.style.width = `${inlineSize}px`;\n panel.style.minWidth = `${inlineSize}px`;\n if (findFormFieldAnchor(this.host.hostElement)) {\n panel.style.maxWidth = 'none';\n }\n\n const overlay = rectFromClientRect(panel.getBoundingClientRect());\n const viewport = viewportRect();\n const result = computeOverlayPosition({\n anchorRect: anchor,\n overlayRect: overlay,\n viewportRect: viewport,\n placement: this.placement(),\n offset: this.offset(),\n collision: this.collision(),\n });\n\n panel.style.left = `${result.x}px`;\n panel.style.top = `${result.y}px`;\n });\n\n this.setupOutsidePointer();\n }\n\n private restoreToPlaceholder(force = false): void {\n const panel = this.elRef.nativeElement;\n if (!force && panel.parentNode !== document.body) {\n this.teardownOutsidePointer();\n return;\n }\n\n if (this.placeholder?.parentNode) {\n this.placeholder.parentNode.insertBefore(panel, this.placeholder);\n } else if (this.originalParent) {\n this.originalParent.appendChild(panel);\n }\n\n this.teardownRepositionListeners();\n this.scrollLock.release(this.instanceId);\n\n if (\n this.lastFocusedBeforeOpen &&\n document.contains(this.lastFocusedBeforeOpen)\n ) {\n const active = document.activeElement as HTMLElement | null;\n const panelEl = this.elRef.nativeElement;\n if (!active || panelEl.contains(active)) {\n this.lastFocusedBeforeOpen.focus();\n }\n }\n\n this.restoreFocusOnClose();\n panel.style.position = '';\n panel.style.left = '';\n panel.style.top = '';\n panel.style.zIndex = '';\n panel.style.width = '';\n panel.style.minWidth = '';\n panel.style.maxWidth = '';\n panel.removeAttribute(TNG_OVERLAY_OWNER_ID_ATTR);\n this.clearPortalledThemeVars();\n this.teardownOutsidePointer();\n }\n\n private setupOutsidePointer(): void {\n if (this.removeDocPointerListener) return;\n\n const onPointerDown = (ev: PointerEvent): void => {\n if (!this.host.open()) return;\n const panel = this.elRef.nativeElement;\n const anchorEl = this.findAnchorEl();\n if (isInside(ev.target, panel)) return;\n if (anchorEl && isInside(ev.target, anchorEl)) return;\n if (\n this.host.multiple() &&\n ev.target &&\n (ev.target as Element).closest?.(\n '[data-slot=\"select-option\"], [data-slot=\"multi-select-option\"]'\n )\n )\n return;\n this.host.close();\n };\n\n document.addEventListener('pointerdown', onPointerDown, true);\n this.removeDocPointerListener = (): void => {\n document.removeEventListener('pointerdown', onPointerDown, true);\n };\n }\n\n private teardownOutsidePointer(): void {\n this.removeDocPointerListener?.();\n this.removeDocPointerListener = null;\n }\n\n private restoreFocusOnClose(): void {\n const panel = this.elRef.nativeElement;\n const active = document.activeElement as HTMLElement | null;\n if (active && panel.contains(active)) {\n const trigger = this.findTriggerEl();\n trigger?.focus();\n return;\n }\n if (document.activeElement === document.body) {\n const trigger = this.findTriggerEl();\n trigger?.focus();\n }\n }\n}\n"]}
@@ -26,7 +26,12 @@ export declare class TngAutocompleteOverlay {
26
26
  protected readonly dataSlot: "autocomplete-overlay";
27
27
  protected get hidden(): '' | null;
28
28
  constructor();
29
- /** Anchor for overlay: container (trigger+icon) if present, else the input trigger. */
29
+ /**
30
+ * Anchor for overlay positioning, width, and dismiss boundary.
31
+ * Prefer the enclosing form-field (so the overlay aligns with the visible
32
+ * field frame), else the trigger container (trigger + icon), else the input
33
+ * trigger itself.
34
+ */
30
35
  private findAnchorEl;
31
36
  private findTriggerEl;
32
37
  private reposition;
@@ -1 +1 @@
1
- {"version":3,"file":"tng-autocomplete.overlay.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/autocomplete/tng-autocomplete.overlay.ts"],"names":[],"mappings":";AAoHA,qBAIa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6C;IAC1E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmC;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IAEjD,OAAO,CAAC,qBAAqB,CAA4B;IACzD,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,wBAAwB,CAA6B;IAE7D,QAAQ,CAAC,SAAS;;;oBAAqD;IACvE,QAAQ,CAAC,MAAM;;;oBAAkD;IACjE,QAAQ,CAAC,SAAS;;;;oBAA4D;IAE9E,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,cAAc,CAAqB;IAG3C,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,sBAAsB,CAAU;IAG9D,SAAS,KAAK,MAAM,IAAI,EAAE,GAAG,IAAI,CAEhC;;IAsBD,uFAAuF;IACvF,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,UAAU;IA4BlB,OAAO,CAAC,wBAAwB;IAuBhC,OAAO,CAAC,2BAA2B;IASnC,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,sBAAsB;IAqB9B,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,sBAAsB;IA4C9B,OAAO,CAAC,oBAAoB;IAmC5B,OAAO,CAAC,mBAAmB;yCAhQhB,sBAAsB;2CAAtB,sBAAsB;CAkRlC"}
1
+ {"version":3,"file":"tng-autocomplete.overlay.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/autocomplete/tng-autocomplete.overlay.ts"],"names":[],"mappings":";AA8JA,qBAIa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6C;IAC1E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmC;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IAEjD,OAAO,CAAC,qBAAqB,CAA4B;IACzD,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,wBAAwB,CAA6B;IAE7D,QAAQ,CAAC,SAAS;;;oBAAqD;IACvE,QAAQ,CAAC,MAAM;;;oBAAkD;IACjE,QAAQ,CAAC,SAAS;;;;oBAA4D;IAE9E,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,cAAc,CAAqB;IAG3C,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,sBAAsB,CAAU;IAG9D,SAAS,KAAK,MAAM,IAAI,EAAE,GAAG,IAAI,CAEhC;;IAsBD;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,UAAU;IA4BlB,OAAO,CAAC,wBAAwB;IAuBhC,OAAO,CAAC,2BAA2B;IASnC,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,sBAAsB;IAqB9B,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,sBAAsB;IAgD9B,OAAO,CAAC,oBAAoB;IAqC5B,OAAO,CAAC,mBAAmB;yCA7QhB,sBAAsB;2CAAtB,sBAAsB;CA+RlC"}
@@ -83,6 +83,48 @@ function resolveAnchoredYWhenOffscreen(resultY, anchor, overlay, viewport, side,
83
83
  function isInside(target, container) {
84
84
  return !!target && target instanceof Node && container.contains(target);
85
85
  }
86
+ /**
87
+ * When the overlay's host element lives inside a `tng-form-field`, the form-field
88
+ * is the visible frame the consumer sees, so the overlay should align with it
89
+ * (width + left/right edges). For the `left` label layout the form-field's root
90
+ * spans the label column too, so anchor on the inner control-row instead.
91
+ */
92
+ function findFormFieldAnchor(host) {
93
+ const formField = host.closest('[data-slot="form-field"]');
94
+ if (!formField)
95
+ return null;
96
+ if (formField.getAttribute('data-label-position') === 'left') {
97
+ const row = formField.querySelector('.tng-form-field__control-row');
98
+ return row ?? formField;
99
+ }
100
+ return formField;
101
+ }
102
+ /**
103
+ * Rect to use for overlay positioning. When the anchor is a form-field root, the
104
+ * horizontal extent is taken from the form-field (so the overlay spans the field
105
+ * frame) but the vertical extent is taken from the inner fieldset (the input row)
106
+ * so the overlay opens directly under the input rather than below the messages
107
+ * region beneath the frame.
108
+ */
109
+ function anchorRectFor(anchorEl) {
110
+ const widthRect = anchorEl.getBoundingClientRect();
111
+ if (!anchorEl.matches('[data-slot="form-field"]')) {
112
+ return rectFromClientRect(widthRect);
113
+ }
114
+ const labelPosition = anchorEl.getAttribute('data-label-position');
115
+ const fieldset = anchorEl.querySelector('[data-slot="form-field-control-row"]');
116
+ const innerRow = anchorEl.querySelector('.tng-form-field__control-row');
117
+ const positionEl = labelPosition === 'outline' ? (fieldset ?? innerRow) : (innerRow ?? fieldset);
118
+ if (!positionEl)
119
+ return rectFromClientRect(widthRect);
120
+ const positionRect = positionEl.getBoundingClientRect();
121
+ return {
122
+ left: widthRect.left,
123
+ width: widthRect.width,
124
+ top: positionRect.top,
125
+ height: positionRect.height,
126
+ };
127
+ }
86
128
  export class TngAutocompleteOverlay {
87
129
  autocomplete = inject(TNG_AUTOCOMPLETE);
88
130
  elRef = inject((ElementRef));
@@ -120,9 +162,17 @@ export class TngAutocompleteOverlay {
120
162
  this.originalParent = null;
121
163
  });
122
164
  }
123
- /** Anchor for overlay: container (trigger+icon) if present, else the input trigger. */
165
+ /**
166
+ * Anchor for overlay positioning, width, and dismiss boundary.
167
+ * Prefer the enclosing form-field (so the overlay aligns with the visible
168
+ * field frame), else the trigger container (trigger + icon), else the input
169
+ * trigger itself.
170
+ */
124
171
  findAnchorEl() {
125
172
  const root = this.autocomplete.hostElement;
173
+ const formFieldAnchor = findFormFieldAnchor(root);
174
+ if (formFieldAnchor)
175
+ return formFieldAnchor;
126
176
  const container = root.querySelector('[data-slot="autocomplete-trigger-container"]');
127
177
  if (container)
128
178
  return container;
@@ -139,7 +189,7 @@ export class TngAutocompleteOverlay {
139
189
  const anchorEl = this.findAnchorEl();
140
190
  if (!anchorEl)
141
191
  return;
142
- const anchor = rectFromClientRect(anchorEl.getBoundingClientRect());
192
+ const anchor = anchorRectFor(anchorEl);
143
193
  const overlay = rectFromClientRect(panel.getBoundingClientRect());
144
194
  const viewport = viewportRect();
145
195
  const offset = this.offset();
@@ -258,8 +308,12 @@ export class TngAutocompleteOverlay {
258
308
  const anchorEl = this.findAnchorEl();
259
309
  if (!anchorEl)
260
310
  return;
261
- const anchor = rectFromClientRect(anchorEl.getBoundingClientRect());
311
+ const anchor = anchorRectFor(anchorEl);
262
312
  panel.style.minWidth = `${anchor.width}px`;
313
+ if (findFormFieldAnchor(this.autocomplete.hostElement)) {
314
+ panel.style.width = `${anchor.width}px`;
315
+ panel.style.maxWidth = 'none';
316
+ }
263
317
  const overlay = rectFromClientRect(panel.getBoundingClientRect());
264
318
  const viewport = viewportRect();
265
319
  const offset = this.offset();
@@ -304,6 +358,8 @@ export class TngAutocompleteOverlay {
304
358
  panel.style.top = '';
305
359
  panel.style.zIndex = '';
306
360
  panel.style.minWidth = '';
361
+ panel.style.width = '';
362
+ panel.style.maxWidth = '';
307
363
  this.clearPortalledThemeVars();
308
364
  this.teardownOutsidePointer();
309
365
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tng-autocomplete.overlay.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/autocomplete/tng-autocomplete.overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;;AAK7D,MAAM,iCAAiC,GAAG;IACxC,2BAA2B;IAC3B,kCAAkC;IAClC,uCAAuC;IACvC,iDAAiD;IACjD,0CAA0C;IAC1C,yCAAyC;IACzC,+BAA+B;IAC/B,+BAA+B;IAC/B,8BAA8B;IAC9B,kCAAkC;IAClC,iCAAiC;IACjC,2CAA2C;IAC3C,oCAAoC;IACpC,mCAAmC;IACnC,mCAAmC;IACnC,sCAAsC;IACtC,8BAA8B;IAC9B,oCAAoC;IACpC,iBAAiB;IACjB,mCAAmC;IACnC,+BAA+B;IAC/B,gCAAgC;IAChC,sCAAsC;IACtC,8BAA8B;IAC9B,8BAA8B;IAC9B,kCAAkC;IAClC,qCAAqC;IACrC,yCAAyC;IACzC,uCAAuC;IACvC,2CAA2C;IAC3C,uCAAuC;IACvC,8CAA8C;IAC9C,kDAAkD;IAClD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QAC1B,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC/B,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAChC,CAAC;IAEO,mBAAmB;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;QACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAmC,CAAC;QAC5D,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,IAAI,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,IAAI,CAAC,YAAY,CAAC,eAAe,GAAG,IAAI,CAAC;YACzC,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,cAAc,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACrE,OAAO;QACT,CAAC;QACD,IAAI,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC7C,IAAI,CAAC,YAAY,CAAC,eAAe,GAAG,IAAI,CAAC;YACzC,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,cAAc,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;uGAjRU,sBAAsB;2FAAtB,sBAAsB;;2FAAtB,sBAAsB;kBAJlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,0BAA0B;oBACpC,QAAQ,EAAE,wBAAwB;iBACnC;;sBAmBE,WAAW;uBAAC,gBAAgB;;sBAG5B,WAAW;uBAAC,aAAa","sourcesContent":["import {\n DestroyRef,\n Directive,\n ElementRef,\n HostBinding,\n inject,\n input,\n effect,\n} from '@angular/core';\nimport type {\n TngOverlayCollisionOptions,\n TngOverlayOffset,\n TngOverlayPlacement,\n} from '@tailng-ui/cdk';\nimport { computeOverlayPosition } from '@tailng-ui/cdk';\nimport { TNG_AUTOCOMPLETE } from './tng-autocomplete.tokens';\nimport type { TngAutocomplete } from './tng-autocomplete';\n\ntype MaybeRect = Readonly<{ left: number; top: number; width: number; height: number }>;\n\nconst PORTALLED_AUTOCOMPLETE_THEME_VARS = [\n '--tng-autocomplete-radius',\n '--tng-autocomplete-trigger-width',\n '--tng-autocomplete-trigger-min-height',\n '--tng-autocomplete-trigger-container-min-height',\n '--tng-autocomplete-trigger-container-gap',\n '--tng-autocomplete-trigger-container-px',\n '--tng-autocomplete-trigger-py',\n '--tng-autocomplete-trigger-px',\n '--tng-autocomplete-icon-size',\n '--tng-autocomplete-icon-box-size',\n '--tng-autocomplete-icon-opacity',\n '--tng-autocomplete-icon-margin-inline-end',\n '--tng-autocomplete-overlay-padding',\n '--tng-autocomplete-overlay-radius',\n '--tng-autocomplete-overlay-shadow',\n '--tng-autocomplete-overlay-max-width',\n '--tng-autocomplete-z-overlay',\n '--tng-autocomplete-overlay-z-index',\n '--tng-z-overlay',\n '--tng-autocomplete-overlay-border',\n '--tng-autocomplete-overlay-bg',\n '--tng-autocomplete-listbox-gap',\n '--tng-autocomplete-option-min-height',\n '--tng-autocomplete-option-py',\n '--tng-autocomplete-option-px',\n '--tng-autocomplete-option-radius',\n '--tng-autocomplete-option-bg-active',\n '--tng-autocomplete-option-border-active',\n '--tng-autocomplete-option-bg-selected',\n '--tng-autocomplete-option-border-selected',\n '--tng-autocomplete-option-fg-selected',\n '--tng-autocomplete-option-bg-selected-active',\n '--tng-autocomplete-option-border-selected-active',\n '--tng-autocomplete-option-shadow-selected-active',\n '--tng-autocomplete-option-disabled-opacity',\n '--tng-autocomplete-border',\n '--tng-autocomplete-border-strong',\n '--tng-autocomplete-border-hover',\n '--tng-autocomplete-bg',\n '--tng-autocomplete-surface',\n '--tng-autocomplete-fg',\n '--tng-autocomplete-muted',\n '--tng-autocomplete-brand',\n '--tng-autocomplete-danger',\n '--tng-autocomplete-focus-ring',\n '--tng-autocomplete-ease',\n '--tng-autocomplete-shadow',\n '--tng-autocomplete-shadow-focus',\n '--tng-semantic-background-base',\n '--tng-semantic-background-canvas',\n '--tng-semantic-background-surface',\n '--tng-semantic-border-subtle',\n '--tng-semantic-border-strong',\n '--tng-semantic-foreground-primary',\n '--tng-semantic-foreground-secondary',\n '--tng-semantic-foreground-muted',\n '--tng-semantic-accent-brand',\n '--tng-semantic-accent-danger',\n '--tng-semantic-focus-ring',\n] as const;\n\nfunction rectFromClientRect(r: DOMRect | ClientRect): MaybeRect {\n return { left: r.left, top: r.top, width: r.width, height: r.height };\n}\n\nfunction viewportRect(): MaybeRect {\n return { left: 0, top: 0, width: window.innerWidth || 1024, height: window.innerHeight || 768 };\n}\n\nfunction resolveAnchoredYWhenOffscreen(\n resultY: number,\n anchor: MaybeRect,\n overlay: MaybeRect,\n viewport: MaybeRect,\n side: 'bottom' | 'top' | 'left' | 'right',\n sideOffset: number,\n): number {\n const viewportBottom = viewport.top + viewport.height;\n const anchorBottom = anchor.top + anchor.height;\n\n if (anchorBottom < viewport.top && side === 'bottom') {\n return anchorBottom + sideOffset;\n }\n\n if (anchor.top > viewportBottom && side === 'top') {\n return anchor.top - overlay.height - sideOffset;\n }\n\n return resultY;\n}\n\nfunction isInside(target: EventTarget | null, container: HTMLElement): boolean {\n return !!target && target instanceof Node && container.contains(target);\n}\n\n@Directive({\n selector: '[tngAutocompleteOverlay]',\n exportAs: 'tngAutocompleteOverlay',\n})\nexport class TngAutocompleteOverlay {\n private readonly autocomplete = inject<TngAutocomplete>(TNG_AUTOCOMPLETE);\n private readonly elRef = inject(ElementRef<HTMLElement>);\n private readonly destroyRef = inject(DestroyRef);\n\n private lastFocusedBeforeOpen: HTMLElement | null = null;\n private removeResizeListener: (() => void) | null = null;\n private removeScrollListener: (() => void) | null = null;\n private resizeObserver: ResizeObserver | null = null;\n private removeDocPointerListener: (() => void) | null = null;\n\n readonly placement = input<TngOverlayPlacement | undefined>(undefined);\n readonly offset = input<TngOverlayOffset | undefined>(undefined);\n readonly collision = input<TngOverlayCollisionOptions | undefined>(undefined);\n\n private placeholder: Comment | null = null;\n private originalParent: Node | null = null;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'autocomplete-overlay' as const;\n\n @HostBinding('attr.hidden')\n protected get hidden(): '' | null {\n return this.autocomplete.open() ? null : '';\n }\n\n constructor() {\n this.placeholder = document.createComment('tng-autocomplete-overlay-anchor');\n const hostEl = this.elRef.nativeElement;\n this.originalParent = hostEl.parentNode;\n this.originalParent?.insertBefore(this.placeholder, hostEl);\n\n effect(() => {\n const open = this.autocomplete.open();\n if (open) this.mountToBodyAndPosition();\n else this.restoreToPlaceholder();\n });\n\n this.destroyRef.onDestroy(() => {\n this.teardownOutsidePointer();\n this.restoreToPlaceholder(true);\n this.placeholder = null;\n this.originalParent = null;\n });\n }\n\n /** Anchor for overlay: container (trigger+icon) if present, else the input trigger. */\n private findAnchorEl(): HTMLElement | null {\n const root = this.autocomplete.hostElement;\n const container = root.querySelector('[data-slot=\"autocomplete-trigger-container\"]') as HTMLElement | null;\n if (container) return container;\n return root.querySelector('[data-slot=\"autocomplete-trigger\"]') as HTMLElement | null;\n }\n\n private findTriggerEl(): HTMLElement | null {\n const root = this.autocomplete.hostElement;\n return root.querySelector('[data-slot=\"autocomplete-trigger\"]') as HTMLElement | null;\n }\n\n private reposition(): void {\n if (!this.autocomplete.open()) return;\n const panel = this.elRef.nativeElement;\n const anchorEl = this.findAnchorEl();\n if (!anchorEl) return;\n const anchor = rectFromClientRect(anchorEl.getBoundingClientRect());\n const overlay = rectFromClientRect(panel.getBoundingClientRect());\n const viewport = viewportRect();\n const offset = this.offset();\n const result = computeOverlayPosition({\n anchorRect: anchor,\n overlayRect: overlay,\n viewportRect: viewport,\n placement: this.placement(),\n offset,\n collision: this.collision(),\n });\n panel.style.left = `${result.x}px`;\n panel.style.top = `${resolveAnchoredYWhenOffscreen(\n result.y,\n anchor,\n overlay,\n viewport,\n result.side,\n offset?.side ?? 0,\n )}px`;\n }\n\n private setupRepositionListeners(): void {\n let rafId: number | null = null;\n const schedule = () => {\n if (rafId !== null) return;\n rafId = requestAnimationFrame(() => {\n rafId = null;\n this.reposition();\n });\n };\n const onResize = () => schedule();\n const onScroll = () => schedule();\n window.addEventListener('resize', onResize);\n window.addEventListener('scroll', onScroll, true);\n this.removeResizeListener = () => window.removeEventListener('resize', onResize);\n this.removeScrollListener = () => window.removeEventListener('scroll', onScroll, true);\n if ('ResizeObserver' in window) {\n this.resizeObserver = new ResizeObserver(() => schedule());\n const anchorEl = this.findAnchorEl();\n if (anchorEl) this.resizeObserver.observe(anchorEl);\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 setupOutsidePointer(): void {\n if (this.removeDocPointerListener) return;\n const onPointerDown = (ev: PointerEvent) => {\n if (!this.autocomplete.open()) return;\n const panel = this.elRef.nativeElement;\n const anchorEl = this.findAnchorEl();\n if (isInside(ev.target, panel)) return;\n if (anchorEl && isInside(ev.target, anchorEl)) return;\n if (ev.target && (ev.target as Element).closest?.('[data-slot=\"autocomplete-option\"]')) return;\n this.autocomplete.close();\n };\n document.addEventListener('pointerdown', onPointerDown, true);\n this.removeDocPointerListener = () =>\n document.removeEventListener('pointerdown', onPointerDown, true);\n }\n\n private teardownOutsidePointer(): void {\n this.removeDocPointerListener?.();\n this.removeDocPointerListener = null;\n }\n\n private syncPortalledThemeVars(): void {\n const panel = this.elRef.nativeElement;\n const hostStyles = getComputedStyle(this.autocomplete.hostElement);\n\n for (const cssVar of PORTALLED_AUTOCOMPLETE_THEME_VARS) {\n const value = hostStyles.getPropertyValue(cssVar).trim();\n if (value) {\n panel.style.setProperty(cssVar, value);\n } else {\n panel.style.removeProperty(cssVar);\n }\n }\n\n const colorScheme = hostStyles.colorScheme?.trim();\n if (colorScheme && colorScheme !== 'normal') {\n panel.style.colorScheme = colorScheme;\n } else {\n panel.style.removeProperty('color-scheme');\n }\n }\n\n private applyPortalledStacking(): void {\n const panel = this.elRef.nativeElement;\n\n panel.style.zIndex = 'var(--tng-autocomplete-z-overlay, var(--tng-autocomplete-overlay-z-index, var(--tng-z-overlay, 2)))';\n }\n\n private clearPortalledThemeVars(): void {\n const panel = this.elRef.nativeElement;\n\n for (const cssVar of PORTALLED_AUTOCOMPLETE_THEME_VARS) {\n panel.style.removeProperty(cssVar);\n }\n\n panel.style.removeProperty('color-scheme');\n }\n\n private mountToBodyAndPosition(): void {\n this.lastFocusedBeforeOpen = document.activeElement as HTMLElement | null;\n this.setupRepositionListeners();\n const panel = this.elRef.nativeElement;\n if (panel.parentNode !== document.body) {\n document.body.appendChild(panel);\n }\n panel.style.position = 'fixed';\n panel.style.left = '0px';\n panel.style.top = '0px';\n this.syncPortalledThemeVars();\n this.applyPortalledStacking();\n\n queueMicrotask(() => {\n if (!this.autocomplete.open()) return;\n const anchorEl = this.findAnchorEl();\n if (!anchorEl) return;\n const anchor = rectFromClientRect(anchorEl.getBoundingClientRect());\n panel.style.minWidth = `${anchor.width}px`;\n const overlay = rectFromClientRect(panel.getBoundingClientRect());\n const viewport = viewportRect();\n const offset = this.offset();\n const result = computeOverlayPosition({\n anchorRect: anchor,\n overlayRect: overlay,\n viewportRect: viewport,\n placement: this.placement(),\n offset,\n collision: this.collision(),\n });\n panel.style.left = `${result.x}px`;\n panel.style.top = `${resolveAnchoredYWhenOffscreen(\n result.y,\n anchor,\n overlay,\n viewport,\n result.side,\n offset?.side ?? 0,\n )}px`;\n });\n\n this.setupOutsidePointer();\n }\n\n private restoreToPlaceholder(force = false): void {\n const panel = this.elRef.nativeElement;\n if (!force && panel.parentNode !== document.body) {\n this.teardownOutsidePointer();\n return;\n }\n if (this.placeholder?.parentNode) {\n this.placeholder.parentNode.insertBefore(panel, this.placeholder);\n } else if (this.originalParent) {\n this.originalParent.appendChild(panel);\n }\n this.teardownRepositionListeners();\n\n if (\n this.lastFocusedBeforeOpen &&\n document.contains(this.lastFocusedBeforeOpen)\n ) {\n const active = document.activeElement as HTMLElement | null;\n if (!active || panel.contains(active)) {\n this.autocomplete._restoringFocus = true;\n this.lastFocusedBeforeOpen.focus();\n queueMicrotask(() => { this.autocomplete._restoringFocus = false; });\n }\n }\n this.restoreFocusOnClose();\n\n panel.style.position = '';\n panel.style.left = '';\n panel.style.top = '';\n panel.style.zIndex = '';\n panel.style.minWidth = '';\n this.clearPortalledThemeVars();\n this.teardownOutsidePointer();\n }\n\n private restoreFocusOnClose(): void {\n const panel = this.elRef.nativeElement;\n const active = document.activeElement as HTMLElement | null;\n const trigger = this.findTriggerEl();\n if (!trigger) return;\n\n if (active && panel.contains(active)) {\n this.autocomplete._restoringFocus = true;\n trigger.focus();\n queueMicrotask(() => { this.autocomplete._restoringFocus = false; });\n return;\n }\n if (document.activeElement === document.body) {\n this.autocomplete._restoringFocus = true;\n trigger.focus();\n queueMicrotask(() => { this.autocomplete._restoringFocus = false; });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"tng-autocomplete.overlay.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/autocomplete/tng-autocomplete.overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,MAAM,EACN,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;;AAK7D,MAAM,iCAAiC,GAAG;IACxC,2BAA2B;IAC3B,kCAAkC;IAClC,uCAAuC;IACvC,iDAAiD;IACjD,0CAA0C;IAC1C,yCAAyC;IACzC,+BAA+B;IAC/B,+BAA+B;IAC/B,8BAA8B;IAC9B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,IAAI,CAAC;YACzC,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,cAAc,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACrE,OAAO;QACT,CAAC;QACD,IAAI,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC7C,IAAI,CAAC,YAAY,CAAC,eAAe,GAAG,IAAI,CAAC;YACzC,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,cAAc,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;uGA9RU,sBAAsB;2FAAtB,sBAAsB;;2FAAtB,sBAAsB;kBAJlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,0BAA0B;oBACpC,QAAQ,EAAE,wBAAwB;iBACnC;;sBAmBE,WAAW;uBAAC,gBAAgB;;sBAG5B,WAAW;uBAAC,aAAa","sourcesContent":["import {\n DestroyRef,\n Directive,\n ElementRef,\n HostBinding,\n inject,\n input,\n effect,\n} from '@angular/core';\nimport type {\n TngOverlayCollisionOptions,\n TngOverlayOffset,\n TngOverlayPlacement,\n} from '@tailng-ui/cdk';\nimport { computeOverlayPosition } from '@tailng-ui/cdk';\nimport { TNG_AUTOCOMPLETE } from './tng-autocomplete.tokens';\nimport type { TngAutocomplete } from './tng-autocomplete';\n\ntype MaybeRect = Readonly<{ left: number; top: number; width: number; height: number }>;\n\nconst PORTALLED_AUTOCOMPLETE_THEME_VARS = [\n '--tng-autocomplete-radius',\n '--tng-autocomplete-trigger-width',\n '--tng-autocomplete-trigger-min-height',\n '--tng-autocomplete-trigger-container-min-height',\n '--tng-autocomplete-trigger-container-gap',\n '--tng-autocomplete-trigger-container-px',\n '--tng-autocomplete-trigger-py',\n '--tng-autocomplete-trigger-px',\n '--tng-autocomplete-icon-size',\n '--tng-autocomplete-icon-box-size',\n '--tng-autocomplete-icon-opacity',\n '--tng-autocomplete-icon-margin-inline-end',\n '--tng-autocomplete-overlay-padding',\n '--tng-autocomplete-overlay-radius',\n '--tng-autocomplete-overlay-shadow',\n '--tng-autocomplete-overlay-max-width',\n '--tng-autocomplete-z-overlay',\n '--tng-autocomplete-overlay-z-index',\n '--tng-z-overlay',\n '--tng-autocomplete-overlay-border',\n '--tng-autocomplete-overlay-bg',\n '--tng-autocomplete-listbox-gap',\n '--tng-autocomplete-option-min-height',\n '--tng-autocomplete-option-py',\n '--tng-autocomplete-option-px',\n '--tng-autocomplete-option-radius',\n '--tng-autocomplete-option-bg-active',\n '--tng-autocomplete-option-border-active',\n '--tng-autocomplete-option-bg-selected',\n '--tng-autocomplete-option-border-selected',\n '--tng-autocomplete-option-fg-selected',\n '--tng-autocomplete-option-bg-selected-active',\n '--tng-autocomplete-option-border-selected-active',\n '--tng-autocomplete-option-shadow-selected-active',\n '--tng-autocomplete-option-disabled-opacity',\n '--tng-autocomplete-border',\n '--tng-autocomplete-border-strong',\n '--tng-autocomplete-border-hover',\n '--tng-autocomplete-bg',\n '--tng-autocomplete-surface',\n '--tng-autocomplete-fg',\n '--tng-autocomplete-muted',\n '--tng-autocomplete-brand',\n '--tng-autocomplete-danger',\n '--tng-autocomplete-focus-ring',\n '--tng-autocomplete-ease',\n '--tng-autocomplete-shadow',\n '--tng-autocomplete-shadow-focus',\n '--tng-semantic-background-base',\n '--tng-semantic-background-canvas',\n '--tng-semantic-background-surface',\n '--tng-semantic-border-subtle',\n '--tng-semantic-border-strong',\n '--tng-semantic-foreground-primary',\n '--tng-semantic-foreground-secondary',\n '--tng-semantic-foreground-muted',\n '--tng-semantic-accent-brand',\n '--tng-semantic-accent-danger',\n '--tng-semantic-focus-ring',\n] as const;\n\nfunction rectFromClientRect(r: DOMRect | ClientRect): MaybeRect {\n return { left: r.left, top: r.top, width: r.width, height: r.height };\n}\n\nfunction viewportRect(): MaybeRect {\n return { left: 0, top: 0, width: window.innerWidth || 1024, height: window.innerHeight || 768 };\n}\n\nfunction resolveAnchoredYWhenOffscreen(\n resultY: number,\n anchor: MaybeRect,\n overlay: MaybeRect,\n viewport: MaybeRect,\n side: 'bottom' | 'top' | 'left' | 'right',\n sideOffset: number,\n): number {\n const viewportBottom = viewport.top + viewport.height;\n const anchorBottom = anchor.top + anchor.height;\n\n if (anchorBottom < viewport.top && side === 'bottom') {\n return anchorBottom + sideOffset;\n }\n\n if (anchor.top > viewportBottom && side === 'top') {\n return anchor.top - overlay.height - sideOffset;\n }\n\n return resultY;\n}\n\nfunction isInside(target: EventTarget | null, container: HTMLElement): boolean {\n return !!target && target instanceof Node && container.contains(target);\n}\n\n/**\n * When the overlay's host element lives inside a `tng-form-field`, the form-field\n * is the visible frame the consumer sees, so the overlay should align with it\n * (width + left/right edges). For the `left` label layout the form-field's root\n * spans the label column too, so anchor on the inner control-row instead.\n */\nfunction findFormFieldAnchor(host: HTMLElement): HTMLElement | null {\n const formField = host.closest('[data-slot=\"form-field\"]') as HTMLElement | null;\n if (!formField) return null;\n if (formField.getAttribute('data-label-position') === 'left') {\n const row = formField.querySelector('.tng-form-field__control-row') as HTMLElement | null;\n return row ?? formField;\n }\n return formField;\n}\n\n/**\n * Rect to use for overlay positioning. When the anchor is a form-field root, the\n * horizontal extent is taken from the form-field (so the overlay spans the field\n * frame) but the vertical extent is taken from the inner fieldset (the input row)\n * so the overlay opens directly under the input rather than below the messages\n * region beneath the frame.\n */\nfunction anchorRectFor(anchorEl: HTMLElement): MaybeRect {\n const widthRect = anchorEl.getBoundingClientRect();\n if (!anchorEl.matches('[data-slot=\"form-field\"]')) {\n return rectFromClientRect(widthRect);\n }\n const labelPosition = anchorEl.getAttribute('data-label-position');\n const fieldset = anchorEl.querySelector('[data-slot=\"form-field-control-row\"]') as HTMLElement | null;\n const innerRow = anchorEl.querySelector('.tng-form-field__control-row') as HTMLElement | null;\n const positionEl = labelPosition === 'outline' ? (fieldset ?? innerRow) : (innerRow ?? fieldset);\n if (!positionEl) return rectFromClientRect(widthRect);\n const positionRect = positionEl.getBoundingClientRect();\n return {\n left: widthRect.left,\n width: widthRect.width,\n top: positionRect.top,\n height: positionRect.height,\n };\n}\n\n@Directive({\n selector: '[tngAutocompleteOverlay]',\n exportAs: 'tngAutocompleteOverlay',\n})\nexport class TngAutocompleteOverlay {\n private readonly autocomplete = inject<TngAutocomplete>(TNG_AUTOCOMPLETE);\n private readonly elRef = inject(ElementRef<HTMLElement>);\n private readonly destroyRef = inject(DestroyRef);\n\n private lastFocusedBeforeOpen: HTMLElement | null = null;\n private removeResizeListener: (() => void) | null = null;\n private removeScrollListener: (() => void) | null = null;\n private resizeObserver: ResizeObserver | null = null;\n private removeDocPointerListener: (() => void) | null = null;\n\n readonly placement = input<TngOverlayPlacement | undefined>(undefined);\n readonly offset = input<TngOverlayOffset | undefined>(undefined);\n readonly collision = input<TngOverlayCollisionOptions | undefined>(undefined);\n\n private placeholder: Comment | null = null;\n private originalParent: Node | null = null;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'autocomplete-overlay' as const;\n\n @HostBinding('attr.hidden')\n protected get hidden(): '' | null {\n return this.autocomplete.open() ? null : '';\n }\n\n constructor() {\n this.placeholder = document.createComment('tng-autocomplete-overlay-anchor');\n const hostEl = this.elRef.nativeElement;\n this.originalParent = hostEl.parentNode;\n this.originalParent?.insertBefore(this.placeholder, hostEl);\n\n effect(() => {\n const open = this.autocomplete.open();\n if (open) this.mountToBodyAndPosition();\n else this.restoreToPlaceholder();\n });\n\n this.destroyRef.onDestroy(() => {\n this.teardownOutsidePointer();\n this.restoreToPlaceholder(true);\n this.placeholder = null;\n this.originalParent = null;\n });\n }\n\n /**\n * Anchor for overlay positioning, width, and dismiss boundary.\n * Prefer the enclosing form-field (so the overlay aligns with the visible\n * field frame), else the trigger container (trigger + icon), else the input\n * trigger itself.\n */\n private findAnchorEl(): HTMLElement | null {\n const root = this.autocomplete.hostElement;\n const formFieldAnchor = findFormFieldAnchor(root);\n if (formFieldAnchor) return formFieldAnchor;\n const container = root.querySelector('[data-slot=\"autocomplete-trigger-container\"]') as HTMLElement | null;\n if (container) return container;\n return root.querySelector('[data-slot=\"autocomplete-trigger\"]') as HTMLElement | null;\n }\n\n private findTriggerEl(): HTMLElement | null {\n const root = this.autocomplete.hostElement;\n return root.querySelector('[data-slot=\"autocomplete-trigger\"]') as HTMLElement | null;\n }\n\n private reposition(): void {\n if (!this.autocomplete.open()) return;\n const panel = this.elRef.nativeElement;\n const anchorEl = this.findAnchorEl();\n if (!anchorEl) return;\n const anchor = anchorRectFor(anchorEl);\n const overlay = rectFromClientRect(panel.getBoundingClientRect());\n const viewport = viewportRect();\n const offset = this.offset();\n const result = computeOverlayPosition({\n anchorRect: anchor,\n overlayRect: overlay,\n viewportRect: viewport,\n placement: this.placement(),\n offset,\n collision: this.collision(),\n });\n panel.style.left = `${result.x}px`;\n panel.style.top = `${resolveAnchoredYWhenOffscreen(\n result.y,\n anchor,\n overlay,\n viewport,\n result.side,\n offset?.side ?? 0,\n )}px`;\n }\n\n private setupRepositionListeners(): void {\n let rafId: number | null = null;\n const schedule = () => {\n if (rafId !== null) return;\n rafId = requestAnimationFrame(() => {\n rafId = null;\n this.reposition();\n });\n };\n const onResize = () => schedule();\n const onScroll = () => schedule();\n window.addEventListener('resize', onResize);\n window.addEventListener('scroll', onScroll, true);\n this.removeResizeListener = () => window.removeEventListener('resize', onResize);\n this.removeScrollListener = () => window.removeEventListener('scroll', onScroll, true);\n if ('ResizeObserver' in window) {\n this.resizeObserver = new ResizeObserver(() => schedule());\n const anchorEl = this.findAnchorEl();\n if (anchorEl) this.resizeObserver.observe(anchorEl);\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 setupOutsidePointer(): void {\n if (this.removeDocPointerListener) return;\n const onPointerDown = (ev: PointerEvent) => {\n if (!this.autocomplete.open()) return;\n const panel = this.elRef.nativeElement;\n const anchorEl = this.findAnchorEl();\n if (isInside(ev.target, panel)) return;\n if (anchorEl && isInside(ev.target, anchorEl)) return;\n if (ev.target && (ev.target as Element).closest?.('[data-slot=\"autocomplete-option\"]')) return;\n this.autocomplete.close();\n };\n document.addEventListener('pointerdown', onPointerDown, true);\n this.removeDocPointerListener = () =>\n document.removeEventListener('pointerdown', onPointerDown, true);\n }\n\n private teardownOutsidePointer(): void {\n this.removeDocPointerListener?.();\n this.removeDocPointerListener = null;\n }\n\n private syncPortalledThemeVars(): void {\n const panel = this.elRef.nativeElement;\n const hostStyles = getComputedStyle(this.autocomplete.hostElement);\n\n for (const cssVar of PORTALLED_AUTOCOMPLETE_THEME_VARS) {\n const value = hostStyles.getPropertyValue(cssVar).trim();\n if (value) {\n panel.style.setProperty(cssVar, value);\n } else {\n panel.style.removeProperty(cssVar);\n }\n }\n\n const colorScheme = hostStyles.colorScheme?.trim();\n if (colorScheme && colorScheme !== 'normal') {\n panel.style.colorScheme = colorScheme;\n } else {\n panel.style.removeProperty('color-scheme');\n }\n }\n\n private applyPortalledStacking(): void {\n const panel = this.elRef.nativeElement;\n\n panel.style.zIndex = 'var(--tng-autocomplete-z-overlay, var(--tng-autocomplete-overlay-z-index, var(--tng-z-overlay, 2)))';\n }\n\n private clearPortalledThemeVars(): void {\n const panel = this.elRef.nativeElement;\n\n for (const cssVar of PORTALLED_AUTOCOMPLETE_THEME_VARS) {\n panel.style.removeProperty(cssVar);\n }\n\n panel.style.removeProperty('color-scheme');\n }\n\n private mountToBodyAndPosition(): void {\n this.lastFocusedBeforeOpen = document.activeElement as HTMLElement | null;\n this.setupRepositionListeners();\n const panel = this.elRef.nativeElement;\n if (panel.parentNode !== document.body) {\n document.body.appendChild(panel);\n }\n panel.style.position = 'fixed';\n panel.style.left = '0px';\n panel.style.top = '0px';\n this.syncPortalledThemeVars();\n this.applyPortalledStacking();\n\n queueMicrotask(() => {\n if (!this.autocomplete.open()) return;\n const anchorEl = this.findAnchorEl();\n if (!anchorEl) return;\n const anchor = anchorRectFor(anchorEl);\n panel.style.minWidth = `${anchor.width}px`;\n if (findFormFieldAnchor(this.autocomplete.hostElement)) {\n panel.style.width = `${anchor.width}px`;\n panel.style.maxWidth = 'none';\n }\n const overlay = rectFromClientRect(panel.getBoundingClientRect());\n const viewport = viewportRect();\n const offset = this.offset();\n const result = computeOverlayPosition({\n anchorRect: anchor,\n overlayRect: overlay,\n viewportRect: viewport,\n placement: this.placement(),\n offset,\n collision: this.collision(),\n });\n panel.style.left = `${result.x}px`;\n panel.style.top = `${resolveAnchoredYWhenOffscreen(\n result.y,\n anchor,\n overlay,\n viewport,\n result.side,\n offset?.side ?? 0,\n )}px`;\n });\n\n this.setupOutsidePointer();\n }\n\n private restoreToPlaceholder(force = false): void {\n const panel = this.elRef.nativeElement;\n if (!force && panel.parentNode !== document.body) {\n this.teardownOutsidePointer();\n return;\n }\n if (this.placeholder?.parentNode) {\n this.placeholder.parentNode.insertBefore(panel, this.placeholder);\n } else if (this.originalParent) {\n this.originalParent.appendChild(panel);\n }\n this.teardownRepositionListeners();\n\n if (\n this.lastFocusedBeforeOpen &&\n document.contains(this.lastFocusedBeforeOpen)\n ) {\n const active = document.activeElement as HTMLElement | null;\n if (!active || panel.contains(active)) {\n this.autocomplete._restoringFocus = true;\n this.lastFocusedBeforeOpen.focus();\n queueMicrotask(() => { this.autocomplete._restoringFocus = false; });\n }\n }\n this.restoreFocusOnClose();\n\n panel.style.position = '';\n panel.style.left = '';\n panel.style.top = '';\n panel.style.zIndex = '';\n panel.style.minWidth = '';\n panel.style.width = '';\n panel.style.maxWidth = '';\n this.clearPortalledThemeVars();\n this.teardownOutsidePointer();\n }\n\n private restoreFocusOnClose(): void {\n const panel = this.elRef.nativeElement;\n const active = document.activeElement as HTMLElement | null;\n const trigger = this.findTriggerEl();\n if (!trigger) return;\n\n if (active && panel.contains(active)) {\n this.autocomplete._restoringFocus = true;\n trigger.focus();\n queueMicrotask(() => { this.autocomplete._restoringFocus = false; });\n return;\n }\n if (document.activeElement === document.body) {\n this.autocomplete._restoringFocus = true;\n trigger.focus();\n queueMicrotask(() => { this.autocomplete._restoringFocus = false; });\n }\n }\n}\n"]}
@@ -56,6 +56,17 @@ export declare class TngDatepickerOverlay {
56
56
  protected onKeydown(event: KeyboardEvent): void;
57
57
  constructor();
58
58
  private initializeOverlayPortal;
59
+ /**
60
+ * Resolve the explicit/datepicker-owned anchor (input-shell or trigger).
61
+ * This is the element used to read datepicker-scoped CSS custom properties
62
+ * (e.g. `--tng-datepicker-overlay-gap`) and to align the overlay vertically.
63
+ */
64
+ private findDatepickerAnchorEl;
65
+ /**
66
+ * Anchor for overlay positioning, width, and dismiss boundary. Prefer the
67
+ * enclosing form-field (so the overlay spans the visible frame) and fall
68
+ * back to the datepicker-owned anchor otherwise.
69
+ */
59
70
  private findAnchorEl;
60
71
  private scheduleReposition;
61
72
  private positionOverlay;
@@ -1 +1 @@
1
- {"version":3,"file":"tng-datepicker.overlay.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/datepicker/tng-datepicker.overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAOX,MAAM,eAAe,CAAC;AAcvB,OAAO,KAAK,EACV,yBAAyB,EAC1B,MAAM,oBAAoB,CAAC;;AAa5B,KAAK,kBAAkB,GACnB,UAAU,CAAC,WAAW,CAAC,GACvB,WAAW,GACX,IAAI,GACJ,SAAS,CAAC;AAyDd,qBAIa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+C;IACrE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IAEjD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkD;IAChF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA2C;IACvE,OAAO,CAAC,QAAQ,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,IAAI,MAAM,GAAG,IAAI,CAGtC;IAGD,SAAS,KAAK,YAAY,IAAI,MAAM,GAAG,IAAI,CAG1C;IAGD,SAAS,KAAK,QAAQ,IAAI,MAAM,GAAG,IAAI,CAGtC;IAGD,SAAS,KAAK,EAAE,IAAI,MAAM,GAAG,IAAI,CAGhC;IAGD,SAAS,KAAK,IAAI,IAAI,MAAM,GAAG,IAAI,CAGlC;IAGD,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;;IAgD/C,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,wBAAwB;IA6BhC,OAAO,CAAC,2BAA2B;IAOnC,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,oBAAoB;IAuB5B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,gBAAgB;yCA1Wb,oBAAoB;2CAApB,oBAAoB;CA6WhC"}
1
+ {"version":3,"file":"tng-datepicker.overlay.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/datepicker/tng-datepicker.overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAOX,MAAM,eAAe,CAAC;AAevB,OAAO,KAAK,EACV,yBAAyB,EAC1B,MAAM,oBAAoB,CAAC;;AAa5B,KAAK,kBAAkB,GACnB,UAAU,CAAC,WAAW,CAAC,GACvB,WAAW,GACX,IAAI,GACJ,SAAS,CAAC;AAgHd,qBAIa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+C;IACrE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IAEjD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA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