@aeris-ui/core 22.0.0-alpha.5 → 22.0.0-alpha.6

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 (184) hide show
  1. package/README.md +2 -2
  2. package/fesm2022/aeris-ui-core-accordion.mjs +12 -12
  3. package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -1
  4. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +3 -3
  5. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs.map +1 -1
  6. package/fesm2022/aeris-ui-core-auto-complete.mjs +55 -54
  7. package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -1
  8. package/fesm2022/aeris-ui-core-auto-focus.mjs +3 -3
  9. package/fesm2022/aeris-ui-core-auto-focus.mjs.map +1 -1
  10. package/fesm2022/aeris-ui-core-avatar.mjs +6 -6
  11. package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -1
  12. package/fesm2022/aeris-ui-core-badge.mjs +6 -6
  13. package/fesm2022/aeris-ui-core-badge.mjs.map +1 -1
  14. package/fesm2022/aeris-ui-core-block-ui.mjs +3 -3
  15. package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -1
  16. package/fesm2022/aeris-ui-core-breadcrumb.mjs +12 -12
  17. package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -1
  18. package/fesm2022/aeris-ui-core-button-group.mjs +3 -3
  19. package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -1
  20. package/fesm2022/aeris-ui-core-button.mjs +8 -8
  21. package/fesm2022/aeris-ui-core-button.mjs.map +1 -1
  22. package/fesm2022/aeris-ui-core-card.mjs +18 -18
  23. package/fesm2022/aeris-ui-core-card.mjs.map +1 -1
  24. package/fesm2022/aeris-ui-core-carousel.mjs +12 -12
  25. package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -1
  26. package/fesm2022/aeris-ui-core-cascade-select.mjs +36 -39
  27. package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -1
  28. package/fesm2022/aeris-ui-core-chart.mjs +3 -3
  29. package/fesm2022/aeris-ui-core-chart.mjs.map +1 -1
  30. package/fesm2022/aeris-ui-core-checkbox.mjs +5 -5
  31. package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -1
  32. package/fesm2022/aeris-ui-core-chip.mjs +9 -9
  33. package/fesm2022/aeris-ui-core-chip.mjs.map +1 -1
  34. package/fesm2022/aeris-ui-core-class-names.mjs +3 -3
  35. package/fesm2022/aeris-ui-core-class-names.mjs.map +1 -1
  36. package/fesm2022/aeris-ui-core-color-picker.mjs +5 -19
  37. package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
  38. package/fesm2022/aeris-ui-core-compare.mjs +12 -12
  39. package/fesm2022/aeris-ui-core-compare.mjs.map +1 -1
  40. package/fesm2022/aeris-ui-core-confirm-dialog.mjs +19 -19
  41. package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -1
  42. package/fesm2022/aeris-ui-core-confirm-popup.mjs +18 -18
  43. package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
  44. package/fesm2022/aeris-ui-core-context-menu.mjs +6 -6
  45. package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
  46. package/fesm2022/aeris-ui-core-date-picker.mjs +302 -302
  47. package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
  48. package/fesm2022/aeris-ui-core-dialog.mjs +30 -24
  49. package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
  50. package/fesm2022/aeris-ui-core-divider.mjs +3 -3
  51. package/fesm2022/aeris-ui-core-divider.mjs.map +1 -1
  52. package/fesm2022/aeris-ui-core-drawer.mjs +30 -24
  53. package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
  54. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +7 -7
  55. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -1
  56. package/fesm2022/aeris-ui-core-editor.mjs +3 -3
  57. package/fesm2022/aeris-ui-core-editor.mjs.map +1 -1
  58. package/fesm2022/aeris-ui-core-file-upload.mjs +24 -24
  59. package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -1
  60. package/fesm2022/aeris-ui-core-filter-service.mjs +3 -3
  61. package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -1
  62. package/fesm2022/aeris-ui-core-fluid.mjs +3 -3
  63. package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -1
  64. package/fesm2022/aeris-ui-core-focus-trap.mjs +3 -3
  65. package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -1
  66. package/fesm2022/aeris-ui-core-form-field.mjs +15 -15
  67. package/fesm2022/aeris-ui-core-form-field.mjs.map +1 -1
  68. package/fesm2022/aeris-ui-core-galleria.mjs +27 -27
  69. package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -1
  70. package/fesm2022/aeris-ui-core-glass.mjs +3 -3
  71. package/fesm2022/aeris-ui-core-glass.mjs.map +1 -1
  72. package/fesm2022/aeris-ui-core-icon-field.mjs +12 -12
  73. package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -1
  74. package/fesm2022/aeris-ui-core-inplace.mjs +9 -9
  75. package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -1
  76. package/fesm2022/aeris-ui-core-input-group.mjs +15 -15
  77. package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -1
  78. package/fesm2022/aeris-ui-core-input-mask.mjs +5 -5
  79. package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -1
  80. package/fesm2022/aeris-ui-core-input-number.mjs +77 -22
  81. package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -1
  82. package/fesm2022/aeris-ui-core-input-otp.mjs +6 -6
  83. package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -1
  84. package/fesm2022/aeris-ui-core-input-text.mjs +6 -6
  85. package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -1
  86. package/fesm2022/aeris-ui-core-key-filter.mjs +3 -3
  87. package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -1
  88. package/fesm2022/aeris-ui-core-mega-menu.mjs +6 -6
  89. package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
  90. package/fesm2022/aeris-ui-core-menu.mjs +15 -15
  91. package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
  92. package/fesm2022/aeris-ui-core-menubar.mjs +14 -14
  93. package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
  94. package/fesm2022/aeris-ui-core-message.mjs +9 -9
  95. package/fesm2022/aeris-ui-core-message.mjs.map +1 -1
  96. package/fesm2022/aeris-ui-core-meter-group.mjs +15 -15
  97. package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -1
  98. package/fesm2022/aeris-ui-core-multi-select.mjs +30 -44
  99. package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
  100. package/fesm2022/aeris-ui-core-order-list.mjs +9 -9
  101. package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -1
  102. package/fesm2022/aeris-ui-core-organization-chart.mjs +9 -9
  103. package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -1
  104. package/fesm2022/aeris-ui-core-paginator.mjs +3 -3
  105. package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
  106. package/fesm2022/aeris-ui-core-panel.mjs +15 -15
  107. package/fesm2022/aeris-ui-core-panel.mjs.map +1 -1
  108. package/fesm2022/aeris-ui-core-password.mjs +16 -16
  109. package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
  110. package/fesm2022/aeris-ui-core-pick-list.mjs +9 -9
  111. package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -1
  112. package/fesm2022/aeris-ui-core-popover.mjs +15 -15
  113. package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
  114. package/fesm2022/aeris-ui-core-progress-bar.mjs +9 -9
  115. package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -1
  116. package/fesm2022/aeris-ui-core-progress-spinner.mjs +6 -6
  117. package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -1
  118. package/fesm2022/aeris-ui-core-radio-button.mjs +5 -5
  119. package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -1
  120. package/fesm2022/aeris-ui-core-rating.mjs +3 -3
  121. package/fesm2022/aeris-ui-core-rating.mjs.map +1 -1
  122. package/fesm2022/aeris-ui-core-scroll-panel.mjs +3 -3
  123. package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -1
  124. package/fesm2022/aeris-ui-core-scroll-top.mjs +3 -3
  125. package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -1
  126. package/fesm2022/aeris-ui-core-select.mjs +74 -66
  127. package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
  128. package/fesm2022/aeris-ui-core-skeleton.mjs +3 -3
  129. package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -1
  130. package/fesm2022/aeris-ui-core-slider.mjs +3 -3
  131. package/fesm2022/aeris-ui-core-slider.mjs.map +1 -1
  132. package/fesm2022/aeris-ui-core-speed-dial.mjs +3 -3
  133. package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -1
  134. package/fesm2022/aeris-ui-core-split-button.mjs +3 -3
  135. package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
  136. package/fesm2022/aeris-ui-core-splitter.mjs +6 -6
  137. package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -1
  138. package/fesm2022/aeris-ui-core-stepper.mjs +12 -12
  139. package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -1
  140. package/fesm2022/aeris-ui-core-style-class.mjs +3 -3
  141. package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -1
  142. package/fesm2022/aeris-ui-core-table.mjs +18 -18
  143. package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
  144. package/fesm2022/aeris-ui-core-tabs.mjs +12 -12
  145. package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
  146. package/fesm2022/aeris-ui-core-textarea.mjs +6 -6
  147. package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -1
  148. package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -1
  149. package/fesm2022/aeris-ui-core-theming.mjs +3 -3
  150. package/fesm2022/aeris-ui-core-theming.mjs.map +1 -1
  151. package/fesm2022/aeris-ui-core-tiered-menu.mjs +6 -6
  152. package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
  153. package/fesm2022/aeris-ui-core-timeline.mjs +15 -15
  154. package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -1
  155. package/fesm2022/aeris-ui-core-toast.mjs +47 -36
  156. package/fesm2022/aeris-ui-core-toast.mjs.map +1 -1
  157. package/fesm2022/aeris-ui-core-toggle-switch.mjs +5 -5
  158. package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -1
  159. package/fesm2022/aeris-ui-core-toolbar.mjs +18 -18
  160. package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -1
  161. package/fesm2022/aeris-ui-core-tooltip.mjs +6 -6
  162. package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -1
  163. package/fesm2022/aeris-ui-core-tree-select.mjs +88 -66
  164. package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
  165. package/fesm2022/aeris-ui-core-tree-table.mjs +15 -15
  166. package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
  167. package/fesm2022/aeris-ui-core-tree.mjs +12 -12
  168. package/fesm2022/aeris-ui-core-tree.mjs.map +1 -1
  169. package/fesm2022/aeris-ui-core.mjs +175 -49
  170. package/fesm2022/aeris-ui-core.mjs.map +1 -1
  171. package/package.json +1 -1
  172. package/styles/aeris.css +56 -0
  173. package/styles/controls.css +9 -2
  174. package/types/aeris-ui-core-auto-complete.d.ts +1 -0
  175. package/types/aeris-ui-core-cascade-select.d.ts +1 -0
  176. package/types/aeris-ui-core-date-picker.d.ts +2 -0
  177. package/types/aeris-ui-core-dialog.d.ts +5 -3
  178. package/types/aeris-ui-core-drawer.d.ts +5 -3
  179. package/types/aeris-ui-core-input-number.d.ts +2 -0
  180. package/types/aeris-ui-core-multi-select.d.ts +1 -0
  181. package/types/aeris-ui-core-select.d.ts +4 -1
  182. package/types/aeris-ui-core-toast.d.ts +3 -2
  183. package/types/aeris-ui-core-tree-select.d.ts +1 -0
  184. package/types/aeris-ui-core.d.ts +5 -1
@@ -13,11 +13,19 @@ function aerisInternalPositionAnchoredOverlay(options) {
13
13
  const bounds = resolveBounds(options);
14
14
  const placement = resolvePlacement(options, bounds);
15
15
  const point = rawPosition(placement, options);
16
+ const clampedPoint = aerisInternalClampOverlayPoint(point, options.width, options.height, bounds.right - bounds.left, bounds.bottom - bounds.top, 0, bounds.left, bounds.top);
16
17
  return {
17
18
  placement,
18
- ...aerisInternalClampOverlayPoint(point, options.width, options.height, bounds.right - bounds.left, bounds.bottom - bounds.top, 0, bounds.left, bounds.top),
19
+ ...(options.tetherToAnchor
20
+ ? tetheredPoint(placement, point, clampedPoint)
21
+ : clampedPoint),
19
22
  };
20
23
  }
24
+ function tetheredPoint(placement, point, clampedPoint) {
25
+ return placement === 'top' || placement === 'bottom'
26
+ ? { x: clampedPoint.x, y: point.y }
27
+ : { x: point.x, y: clampedPoint.y };
28
+ }
21
29
  function resolvePlacement(options, bounds) {
22
30
  const spaces = {
23
31
  bottom: bounds.bottom - options.target.bottom - options.offset,
@@ -26,7 +34,7 @@ function resolvePlacement(options, bounds) {
26
34
  left: options.target.left - bounds.left - options.offset,
27
35
  };
28
36
  const preferred = options.placement === 'auto' ? 'bottom' : options.placement;
29
- const candidates = placementCandidates(preferred);
37
+ const candidates = placementCandidates(preferred, options.tetherToAnchor ?? false);
30
38
  const fitting = candidates.find((placement) => spaces[placement] >=
31
39
  (placement === 'top' || placement === 'bottom' ? options.height : options.width));
32
40
  return (fitting ??
@@ -55,7 +63,16 @@ function normalizePadding(padding) {
55
63
  left: Math.max(0, padding.left ?? 0),
56
64
  };
57
65
  }
58
- function placementCandidates(preferred) {
66
+ function placementCandidates(preferred, preserveAxis) {
67
+ if (preserveAxis) {
68
+ if (preferred === 'top')
69
+ return ['top', 'bottom'];
70
+ if (preferred === 'bottom')
71
+ return ['bottom', 'top'];
72
+ if (preferred === 'right')
73
+ return ['right', 'left'];
74
+ return ['left', 'right'];
75
+ }
59
76
  switch (preferred) {
60
77
  case 'top':
61
78
  return ['top', 'bottom', 'right', 'left'];
@@ -117,6 +134,8 @@ class ɵAerisAppendTo {
117
134
  originCaptured = false;
118
135
  originParent = null;
119
136
  originNextSibling = null;
137
+ unconstrainedPanelWidth = 0;
138
+ unconstrainedPanelHeight = 0;
120
139
  aerisInternalAppendTo = input(/* @ts-ignore */
121
140
  ...(ngDevMode ? [undefined, { debugName: "aerisInternalAppendTo" }] : /* istanbul ignore next */ []));
122
141
  aerisInternalAppendToAnchor = input(null, /* @ts-ignore */
@@ -138,14 +157,21 @@ class ɵAerisAppendTo {
138
157
  effect((onCleanup) => {
139
158
  const target = aerisInternalResolveAppendTo(this.aerisInternalAppendTo() ?? this.defaultAppendTo, this.document);
140
159
  const anchor = this.aerisInternalAppendToAnchor();
160
+ const automaticallyPortaled = this.aerisInternalAppendTo() === undefined &&
161
+ target === 'self' &&
162
+ !!anchor &&
163
+ this.hasClippingAncestor(anchor);
164
+ const effectiveTarget = automaticallyPortaled ? this.document.body : target;
141
165
  this.captureOrigin();
142
- if (target === 'self')
166
+ if (effectiveTarget === 'self')
143
167
  this.restoreToOrigin();
144
- if (target === 'self' && (!anchor || !this.aerisInternalAppendToPositionSelf())) {
168
+ if (effectiveTarget === 'self' &&
169
+ (!anchor || !this.aerisInternalAppendToPositionSelf())) {
145
170
  this.element.removeAttribute('data-aeris-append-to');
171
+ this.element.removeAttribute('data-aeris-auto-portaled');
146
172
  return;
147
173
  }
148
- const positioningTarget = target === 'self' ? this.element.parentElement : target;
174
+ const positioningTarget = effectiveTarget === 'self' ? this.element.parentElement : effectiveTarget;
149
175
  if (!positioningTarget)
150
176
  return;
151
177
  const inheritedStyles = this.preserveInheritedStyles();
@@ -167,14 +193,21 @@ class ɵAerisAppendTo {
167
193
  'z-index',
168
194
  ]);
169
195
  const targetPosition = this.ensurePositionedTarget(positioningTarget);
170
- if (target !== 'self') {
171
- this.renderer.appendChild(target, this.element);
196
+ if (effectiveTarget !== 'self') {
197
+ this.renderer.appendChild(effectiveTarget, this.element);
172
198
  this.applyInheritedStyles(inheritedStyles);
173
- this.renderer.setAttribute(this.element, 'data-aeris-append-to', target === this.document.body ? 'body' : 'target');
199
+ this.renderer.setAttribute(this.element, 'data-aeris-append-to', effectiveTarget === this.document.body ? 'body' : 'target');
200
+ if (automaticallyPortaled) {
201
+ this.renderer.setAttribute(this.element, 'data-aeris-auto-portaled', 'true');
202
+ }
203
+ else {
204
+ this.element.removeAttribute('data-aeris-auto-portaled');
205
+ }
174
206
  this.bringToFront();
175
207
  }
176
208
  else {
177
209
  this.element.removeAttribute('data-aeris-append-to');
210
+ this.element.removeAttribute('data-aeris-auto-portaled');
178
211
  }
179
212
  const reposition = () => this.schedulePosition(anchor, positioningTarget);
180
213
  const pointerdown = (event) => {
@@ -214,7 +247,8 @@ class ɵAerisAppendTo {
214
247
  this.restoreInheritedStyles(inheritedStyles);
215
248
  targetPosition.restore();
216
249
  this.element.removeAttribute('data-aeris-append-to');
217
- if (target !== 'self')
250
+ this.element.removeAttribute('data-aeris-auto-portaled');
251
+ if (effectiveTarget !== 'self')
218
252
  this.element.remove();
219
253
  });
220
254
  });
@@ -227,9 +261,8 @@ class ɵAerisAppendTo {
227
261
  this.restoreToOrigin();
228
262
  }
229
263
  schedulePosition(anchor, target) {
230
- if (!anchor)
264
+ if (!anchor || this.frame !== null)
231
265
  return;
232
- this.cancelFrame();
233
266
  const view = this.document.defaultView;
234
267
  if (!view)
235
268
  return;
@@ -262,45 +295,42 @@ class ɵAerisAppendTo {
262
295
  (collisionPadding.top ?? 0) -
263
296
  (collisionPadding.bottom ?? 0));
264
297
  let panelRect = this.element.getBoundingClientRect();
265
- if (panelRect.width > availableWidth && availableWidth > 0) {
298
+ const wasWidthConstrained = this.element.hasAttribute('data-viewport-constrained-width');
299
+ const naturalWidth = wasWidthConstrained
300
+ ? Math.max(this.unconstrainedPanelWidth, this.element.scrollWidth)
301
+ : panelRect.width;
302
+ this.unconstrainedPanelWidth = naturalWidth;
303
+ if (naturalWidth > availableWidth && availableWidth > 0) {
266
304
  this.element.style.maxWidth = `${availableWidth}px`;
267
305
  this.element.style.overflowX = 'auto';
268
306
  this.element.style.overscrollBehavior = 'contain';
269
307
  this.element.setAttribute('data-viewport-constrained-width', 'true');
270
308
  panelRect = this.element.getBoundingClientRect();
271
309
  }
272
- else if (this.element.hasAttribute('data-viewport-constrained-width')) {
310
+ else if (wasWidthConstrained) {
273
311
  this.element.style.removeProperty('max-width');
274
312
  this.element.style.removeProperty('overflow-x');
275
313
  this.element.removeAttribute('data-viewport-constrained-width');
276
314
  panelRect = this.element.getBoundingClientRect();
277
315
  }
278
- if (panelRect.height > availableHeight && availableHeight > 0) {
279
- this.element.style.maxHeight = `${availableHeight}px`;
280
- this.element.style.overflowY = 'auto';
281
- this.element.style.overscrollBehavior = 'contain';
282
- this.element.setAttribute('data-viewport-constrained', 'true');
283
- panelRect = this.element.getBoundingClientRect();
284
- }
285
- else if (this.element.hasAttribute('data-viewport-constrained')) {
286
- this.element.style.removeProperty('max-height');
287
- this.element.style.removeProperty('overflow-y');
288
- this.element.style.removeProperty('overscroll-behavior');
289
- this.element.removeAttribute('data-viewport-constrained');
290
- panelRect = this.element.getBoundingClientRect();
291
- }
316
+ const wasHeightConstrained = this.element.hasAttribute('data-viewport-constrained');
317
+ const naturalHeight = wasHeightConstrained
318
+ ? Math.max(this.unconstrainedPanelHeight, this.element.scrollHeight)
319
+ : panelRect.height;
320
+ this.unconstrainedPanelHeight = naturalHeight;
292
321
  const direction = view.getComputedStyle(anchor).direction;
293
322
  const configuredAlignment = this.aerisInternalAppendToAlignment();
294
- const point = aerisInternalPositionAnchoredOverlay({
323
+ const alignment = configuredAlignment === 'auto'
324
+ ? direction === 'rtl'
325
+ ? 'end'
326
+ : 'start'
327
+ : configuredAlignment;
328
+ const position = (height = panelRect.height || this.element.offsetHeight) => aerisInternalPositionAnchoredOverlay({
295
329
  target: anchorRect,
296
330
  width: panelRect.width || this.element.offsetWidth || anchorRect.width,
297
- height: panelRect.height || this.element.offsetHeight,
331
+ height,
298
332
  placement: this.aerisInternalAppendToPlacement(),
299
- alignment: configuredAlignment === 'auto'
300
- ? direction === 'rtl'
301
- ? 'end'
302
- : 'start'
303
- : configuredAlignment,
333
+ alignment,
304
334
  offset: this.aerisInternalAppendToOffset(),
305
335
  margin: 8,
306
336
  viewportWidth: viewport?.width ?? view.innerWidth,
@@ -308,7 +338,40 @@ class ɵAerisAppendTo {
308
338
  viewportLeft,
309
339
  viewportTop,
310
340
  collisionPadding,
341
+ tetherToAnchor: true,
311
342
  });
343
+ let point = position(naturalHeight);
344
+ const viewportBounds = {
345
+ top: viewportTop + (collisionPadding.top ?? 0),
346
+ bottom: viewportTop +
347
+ (viewport?.height ?? view.innerHeight) -
348
+ (collisionPadding.bottom ?? 0),
349
+ };
350
+ const anchorIntersectsViewport = anchorRect.bottom > viewportBounds.top && anchorRect.top < viewportBounds.bottom;
351
+ const placementHeight = anchorIntersectsViewport && point.placement === 'bottom'
352
+ ? viewportBounds.bottom - anchorRect.bottom - this.aerisInternalAppendToOffset()
353
+ : anchorIntersectsViewport && point.placement === 'top'
354
+ ? anchorRect.top - viewportBounds.top - this.aerisInternalAppendToOffset()
355
+ : availableHeight;
356
+ const constrainedHeight = Math.max(0, Math.min(availableHeight, placementHeight));
357
+ if (naturalHeight > constrainedHeight && constrainedHeight > 0) {
358
+ this.element.style.maxHeight = `${Math.floor(constrainedHeight)}px`;
359
+ this.element.style.overflowY = 'auto';
360
+ this.element.style.overscrollBehavior = 'contain';
361
+ this.element.setAttribute('data-viewport-constrained', 'true');
362
+ panelRect = this.element.getBoundingClientRect();
363
+ }
364
+ else if (wasHeightConstrained) {
365
+ this.element.style.removeProperty('max-height');
366
+ this.element.style.removeProperty('overflow-y');
367
+ this.element.removeAttribute('data-viewport-constrained');
368
+ panelRect = this.element.getBoundingClientRect();
369
+ }
370
+ point = position();
371
+ if (!this.element.hasAttribute('data-viewport-constrained') &&
372
+ !this.element.hasAttribute('data-viewport-constrained-width')) {
373
+ this.element.style.removeProperty('overscroll-behavior');
374
+ }
312
375
  if (target === this.document.body) {
313
376
  this.element.style.left = `${point.x}px`;
314
377
  this.element.style.top = `${point.y}px`;
@@ -424,6 +487,26 @@ class ɵAerisAppendTo {
424
487
  target.style.position = entry.previous;
425
488
  positionedTargets.delete(target);
426
489
  }
490
+ hasClippingAncestor(anchor) {
491
+ const view = this.document.defaultView;
492
+ if (!view)
493
+ return false;
494
+ let ancestor = anchor.parentElement;
495
+ while (ancestor &&
496
+ ancestor !== this.document.body &&
497
+ ancestor !== this.document.documentElement) {
498
+ const style = view.getComputedStyle(ancestor);
499
+ if (isClippingOverflow(style.overflow) ||
500
+ isClippingOverflow(style.overflowX) ||
501
+ isClippingOverflow(style.overflowY) ||
502
+ hasPaintContainment(style.contain) ||
503
+ (style.clipPath && style.clipPath !== 'none')) {
504
+ return true;
505
+ }
506
+ ancestor = ancestor.parentElement;
507
+ }
508
+ return false;
509
+ }
427
510
  cancelFrame() {
428
511
  if (this.frame === null)
429
512
  return;
@@ -442,10 +525,10 @@ class ɵAerisAppendTo {
442
525
  return;
443
526
  this.renderer.insertBefore(this.originParent, this.element, this.originNextSibling?.parentNode === this.originParent ? this.originNextSibling : null);
444
527
  }
445
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ɵAerisAppendTo, deps: [], target: i0.ɵɵFactoryTarget.Directive });
446
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: ɵAerisAppendTo, isStandalone: true, selector: "[aerisInternalAppendTo]", inputs: { aerisInternalAppendTo: { classPropertyName: "aerisInternalAppendTo", publicName: "aerisInternalAppendTo", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToAnchor: { classPropertyName: "aerisInternalAppendToAnchor", publicName: "aerisInternalAppendToAnchor", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToOffset: { classPropertyName: "aerisInternalAppendToOffset", publicName: "aerisInternalAppendToOffset", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToMatchWidth: { classPropertyName: "aerisInternalAppendToMatchWidth", publicName: "aerisInternalAppendToMatchWidth", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToPlacement: { classPropertyName: "aerisInternalAppendToPlacement", publicName: "aerisInternalAppendToPlacement", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToAlignment: { classPropertyName: "aerisInternalAppendToAlignment", publicName: "aerisInternalAppendToAlignment", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToCollisionPadding: { classPropertyName: "aerisInternalAppendToCollisionPadding", publicName: "aerisInternalAppendToCollisionPadding", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToPositionSelf: { classPropertyName: "aerisInternalAppendToPositionSelf", publicName: "aerisInternalAppendToPositionSelf", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aerisInternalAppendToOutside: "aerisInternalAppendToOutside" }, ngImport: i0 });
528
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ɵAerisAppendTo, deps: [], target: i0.ɵɵFactoryTarget.Directive });
529
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: ɵAerisAppendTo, isStandalone: true, selector: "[aerisInternalAppendTo]", inputs: { aerisInternalAppendTo: { classPropertyName: "aerisInternalAppendTo", publicName: "aerisInternalAppendTo", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToAnchor: { classPropertyName: "aerisInternalAppendToAnchor", publicName: "aerisInternalAppendToAnchor", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToOffset: { classPropertyName: "aerisInternalAppendToOffset", publicName: "aerisInternalAppendToOffset", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToMatchWidth: { classPropertyName: "aerisInternalAppendToMatchWidth", publicName: "aerisInternalAppendToMatchWidth", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToPlacement: { classPropertyName: "aerisInternalAppendToPlacement", publicName: "aerisInternalAppendToPlacement", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToAlignment: { classPropertyName: "aerisInternalAppendToAlignment", publicName: "aerisInternalAppendToAlignment", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToCollisionPadding: { classPropertyName: "aerisInternalAppendToCollisionPadding", publicName: "aerisInternalAppendToCollisionPadding", isSignal: true, isRequired: false, transformFunction: null }, aerisInternalAppendToPositionSelf: { classPropertyName: "aerisInternalAppendToPositionSelf", publicName: "aerisInternalAppendToPositionSelf", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { aerisInternalAppendToOutside: "aerisInternalAppendToOutside" }, ngImport: i0 });
447
530
  }
448
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ɵAerisAppendTo, decorators: [{
531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: ɵAerisAppendTo, decorators: [{
449
532
  type: Directive,
450
533
  args: [{ selector: '[aerisInternalAppendTo]' }]
451
534
  }], ctorParameters: () => [], propDecorators: { aerisInternalAppendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "aerisInternalAppendTo", required: false }] }], aerisInternalAppendToAnchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "aerisInternalAppendToAnchor", required: false }] }], aerisInternalAppendToOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "aerisInternalAppendToOffset", required: false }] }], aerisInternalAppendToMatchWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "aerisInternalAppendToMatchWidth", required: false }] }], aerisInternalAppendToPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "aerisInternalAppendToPlacement", required: false }] }], aerisInternalAppendToAlignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "aerisInternalAppendToAlignment", required: false }] }], aerisInternalAppendToCollisionPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "aerisInternalAppendToCollisionPadding", required: false }] }], aerisInternalAppendToPositionSelf: [{ type: i0.Input, args: [{ isSignal: true, alias: "aerisInternalAppendToPositionSelf", required: false }] }], aerisInternalAppendToOutside: [{ type: i0.Output, args: ["aerisInternalAppendToOutside"] }] } });
@@ -468,6 +551,15 @@ function isHtmlElement(value) {
468
551
  function isDomNode(value) {
469
552
  return typeof value === 'object' && value !== null && 'nodeType' in value;
470
553
  }
554
+ function isClippingOverflow(value) {
555
+ return /^(auto|clip|hidden|overlay|scroll)$/.test(value.trim());
556
+ }
557
+ function hasPaintContainment(value) {
558
+ return value
559
+ .trim()
560
+ .split(/\s+/)
561
+ .some((token) => token === 'paint' || token === 'content' || token === 'strict');
562
+ }
471
563
 
472
564
  function filterSelectOptions(options, query, fields, matchMode, locale) {
473
565
  const normalizedQuery = query.trim().toLocaleLowerCase(locale);
@@ -618,26 +710,60 @@ function ɵunlockAerisDocumentScroll(document) {
618
710
 
619
711
  const BASE_FOCUSABLE_SELECTORS = [
620
712
  'a[href]',
621
- 'button:not([disabled])',
622
- 'input:not([disabled])',
623
- 'select:not([disabled])',
624
- 'textarea:not([disabled])',
625
- '[tabindex]:not([tabindex="-1"])',
713
+ 'area[href]',
714
+ 'button',
715
+ 'input',
716
+ 'select',
717
+ 'textarea',
718
+ 'iframe',
719
+ 'object',
720
+ 'embed',
721
+ 'audio[controls]',
722
+ 'video[controls]',
723
+ 'summary',
724
+ '[tabindex]',
626
725
  ];
627
726
  function aerisInternalIsFocusable(element, options = {}) {
628
- if (!element || element.hasAttribute('disabled') || element.getAttribute('aria-hidden') === 'true') {
727
+ if (!element ||
728
+ element.tabIndex < 0 ||
729
+ element.matches(':disabled') ||
730
+ element.hidden ||
731
+ element.inert ||
732
+ element.closest('[hidden], [inert], [aria-hidden="true"]')) {
733
+ return false;
734
+ }
735
+ if (element instanceof HTMLInputElement && element.type === 'hidden')
629
736
  return false;
737
+ const closedDetails = element.closest('details:not([open])');
738
+ if (closedDetails) {
739
+ const summary = Array.from(closedDetails.children).find((child) => child instanceof HTMLElement && child.tagName === 'SUMMARY');
740
+ if (!summary?.contains(element))
741
+ return false;
630
742
  }
631
743
  if (!options.checkComputedVisibility)
632
744
  return true;
633
- const style = element.ownerDocument.defaultView?.getComputedStyle(element);
634
- return style?.visibility !== 'hidden' && style?.display !== 'none';
745
+ const view = element.ownerDocument.defaultView;
746
+ for (let current = element; current; current = current.parentElement) {
747
+ const style = view?.getComputedStyle(current);
748
+ if (style?.visibility === 'hidden' ||
749
+ style?.visibility === 'collapse' ||
750
+ style?.display === 'none') {
751
+ return false;
752
+ }
753
+ }
754
+ return true;
635
755
  }
636
756
  function aerisInternalFocusableElements(root, options = {}) {
637
757
  const selectors = options.includeContentEditable
638
- ? [...BASE_FOCUSABLE_SELECTORS, '[contenteditable="true"]']
758
+ ? [...BASE_FOCUSABLE_SELECTORS, '[contenteditable]:not([contenteditable="false"])']
639
759
  : BASE_FOCUSABLE_SELECTORS;
640
- return Array.from(root.querySelectorAll(selectors.join(','))).filter((element) => aerisInternalIsFocusable(element, options));
760
+ return Array.from(root.querySelectorAll(selectors.join(',')))
761
+ .filter((element) => aerisInternalIsFocusable(element, options))
762
+ .sort((left, right) => {
763
+ const leftOrder = left.tabIndex > 0 ? left.tabIndex : Number.MAX_SAFE_INTEGER;
764
+ const rightOrder = right.tabIndex > 0 ? right.tabIndex : Number.MAX_SAFE_INTEGER;
765
+ return leftOrder - rightOrder;
766
+ });
641
767
  }
642
768
  function aerisInternalFocusInitialElement(root, selector, focusOptions, options = {}) {
643
769
  let requested = null;
@@ -760,7 +886,7 @@ function aerisInternalCreateFrameScheduler(callback) {
760
886
  };
761
887
  }
762
888
 
763
- const AERIS_UI_VERSION = '22.0.0-alpha.5';
889
+ const AERIS_UI_VERSION = '22.0.0-alpha.6';
764
890
 
765
891
  /**
766
892
  * Generated bundle index. Do not edit.