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

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 (176) hide show
  1. package/README.md +2 -2
  2. package/fesm2022/aeris-ui-core-accordion.mjs +14 -14
  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-auto-complete.mjs +45 -21
  6. package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -1
  7. package/fesm2022/aeris-ui-core-auto-focus.mjs +3 -3
  8. package/fesm2022/aeris-ui-core-avatar.mjs +9 -9
  9. package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -1
  10. package/fesm2022/aeris-ui-core-badge.mjs +10 -10
  11. package/fesm2022/aeris-ui-core-badge.mjs.map +1 -1
  12. package/fesm2022/aeris-ui-core-block-ui.mjs +3 -3
  13. package/fesm2022/aeris-ui-core-breadcrumb.mjs +14 -14
  14. package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -1
  15. package/fesm2022/aeris-ui-core-button-group.mjs +4 -4
  16. package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -1
  17. package/fesm2022/aeris-ui-core-button.mjs +6 -6
  18. package/fesm2022/aeris-ui-core-card.mjs +20 -20
  19. package/fesm2022/aeris-ui-core-card.mjs.map +1 -1
  20. package/fesm2022/aeris-ui-core-carousel.mjs +14 -14
  21. package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -1
  22. package/fesm2022/aeris-ui-core-cascade-select.mjs +39 -15
  23. package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -1
  24. package/fesm2022/aeris-ui-core-chart.mjs +5 -5
  25. package/fesm2022/aeris-ui-core-chart.mjs.map +1 -1
  26. package/fesm2022/aeris-ui-core-checkbox.mjs +3 -3
  27. package/fesm2022/aeris-ui-core-chip.mjs +9 -9
  28. package/fesm2022/aeris-ui-core-class-names.mjs +3 -3
  29. package/fesm2022/aeris-ui-core-color-picker.mjs +24 -9
  30. package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
  31. package/fesm2022/aeris-ui-core-compare.mjs +14 -14
  32. package/fesm2022/aeris-ui-core-compare.mjs.map +1 -1
  33. package/fesm2022/aeris-ui-core-confirm-dialog.mjs +26 -20
  34. package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -1
  35. package/fesm2022/aeris-ui-core-confirm-popup.mjs +41 -25
  36. package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
  37. package/fesm2022/aeris-ui-core-context-menu.mjs +26 -12
  38. package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
  39. package/fesm2022/aeris-ui-core-date-picker.mjs +24 -8
  40. package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
  41. package/fesm2022/aeris-ui-core-dialog.mjs +28 -20
  42. package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
  43. package/fesm2022/aeris-ui-core-divider.mjs +3 -3
  44. package/fesm2022/aeris-ui-core-drawer.mjs +27 -20
  45. package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
  46. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +10 -7
  47. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -1
  48. package/fesm2022/aeris-ui-core-editor.mjs +3 -3
  49. package/fesm2022/aeris-ui-core-file-upload.mjs +26 -26
  50. package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -1
  51. package/fesm2022/aeris-ui-core-filter-service.mjs +3 -3
  52. package/fesm2022/aeris-ui-core-fluid.mjs +3 -3
  53. package/fesm2022/aeris-ui-core-focus-trap.mjs +3 -3
  54. package/fesm2022/aeris-ui-core-form-field.mjs +181 -0
  55. package/fesm2022/aeris-ui-core-form-field.mjs.map +1 -0
  56. package/fesm2022/aeris-ui-core-galleria.mjs +29 -29
  57. package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -1
  58. package/fesm2022/aeris-ui-core-glass.mjs +3 -3
  59. package/fesm2022/aeris-ui-core-icon-field.mjs +14 -14
  60. package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -1
  61. package/fesm2022/aeris-ui-core-inplace.mjs +9 -9
  62. package/fesm2022/aeris-ui-core-input-group.mjs +16 -16
  63. package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -1
  64. package/fesm2022/aeris-ui-core-input-mask.mjs +5 -5
  65. package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -1
  66. package/fesm2022/aeris-ui-core-input-number.mjs +5 -5
  67. package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -1
  68. package/fesm2022/aeris-ui-core-input-otp.mjs +8 -8
  69. package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -1
  70. package/fesm2022/aeris-ui-core-input-text.mjs +8 -8
  71. package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -1
  72. package/fesm2022/aeris-ui-core-key-filter.mjs +3 -3
  73. package/fesm2022/aeris-ui-core-mega-menu.mjs +17 -9
  74. package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
  75. package/fesm2022/aeris-ui-core-menu.mjs +59 -23
  76. package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
  77. package/fesm2022/aeris-ui-core-menubar.mjs +135 -15
  78. package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
  79. package/fesm2022/aeris-ui-core-message.mjs +9 -9
  80. package/fesm2022/aeris-ui-core-meter-group.mjs +15 -15
  81. package/fesm2022/aeris-ui-core-multi-select.mjs +48 -25
  82. package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
  83. package/fesm2022/aeris-ui-core-order-list.mjs +11 -11
  84. package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -1
  85. package/fesm2022/aeris-ui-core-organization-chart.mjs +11 -11
  86. package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -1
  87. package/fesm2022/aeris-ui-core-paginator.mjs +45 -13
  88. package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
  89. package/fesm2022/aeris-ui-core-panel.mjs +17 -17
  90. package/fesm2022/aeris-ui-core-panel.mjs.map +1 -1
  91. package/fesm2022/aeris-ui-core-password.mjs +40 -18
  92. package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
  93. package/fesm2022/aeris-ui-core-pick-list.mjs +11 -11
  94. package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -1
  95. package/fesm2022/aeris-ui-core-popover.mjs +49 -25
  96. package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
  97. package/fesm2022/aeris-ui-core-progress-bar.mjs +9 -9
  98. package/fesm2022/aeris-ui-core-progress-spinner.mjs +6 -6
  99. package/fesm2022/aeris-ui-core-radio-button.mjs +3 -3
  100. package/fesm2022/aeris-ui-core-rating.mjs +3 -3
  101. package/fesm2022/aeris-ui-core-scroll-panel.mjs +5 -5
  102. package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -1
  103. package/fesm2022/aeris-ui-core-scroll-top.mjs +3 -3
  104. package/fesm2022/aeris-ui-core-select.mjs +66 -43
  105. package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
  106. package/fesm2022/aeris-ui-core-skeleton.mjs +3 -3
  107. package/fesm2022/aeris-ui-core-slider.mjs +3 -3
  108. package/fesm2022/aeris-ui-core-speed-dial.mjs +3 -3
  109. package/fesm2022/aeris-ui-core-split-button.mjs +25 -7
  110. package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
  111. package/fesm2022/aeris-ui-core-splitter.mjs +8 -8
  112. package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -1
  113. package/fesm2022/aeris-ui-core-stepper.mjs +14 -14
  114. package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -1
  115. package/fesm2022/aeris-ui-core-style-class.mjs +3 -3
  116. package/fesm2022/aeris-ui-core-table.mjs +24 -20
  117. package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
  118. package/fesm2022/aeris-ui-core-tabs.mjs +78 -27
  119. package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
  120. package/fesm2022/aeris-ui-core-textarea.mjs +8 -8
  121. package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -1
  122. package/fesm2022/aeris-ui-core-theme-builder.mjs +8 -8
  123. package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -1
  124. package/fesm2022/aeris-ui-core-theming.mjs +6 -3
  125. package/fesm2022/aeris-ui-core-theming.mjs.map +1 -1
  126. package/fesm2022/aeris-ui-core-tiered-menu.mjs +52 -15
  127. package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
  128. package/fesm2022/aeris-ui-core-timeline.mjs +17 -17
  129. package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -1
  130. package/fesm2022/aeris-ui-core-toast.mjs +12 -12
  131. package/fesm2022/aeris-ui-core-toggle-switch.mjs +3 -3
  132. package/fesm2022/aeris-ui-core-toolbar.mjs +20 -20
  133. package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -1
  134. package/fesm2022/aeris-ui-core-tooltip.mjs +54 -31
  135. package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -1
  136. package/fesm2022/aeris-ui-core-tree-select.mjs +48 -24
  137. package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
  138. package/fesm2022/aeris-ui-core-tree-table.mjs +21 -17
  139. package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
  140. package/fesm2022/aeris-ui-core-tree.mjs +14 -14
  141. package/fesm2022/aeris-ui-core-tree.mjs.map +1 -1
  142. package/fesm2022/aeris-ui-core.mjs +473 -63
  143. package/fesm2022/aeris-ui-core.mjs.map +1 -1
  144. package/package.json +12 -8
  145. package/schematics/runtime/theme-builder/aeris-theme.js +8 -8
  146. package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -1
  147. package/styles/aeris.css +36 -21
  148. package/styles/controls.css +10 -7
  149. package/types/aeris-ui-core-auto-complete.d.ts +8 -3
  150. package/types/aeris-ui-core-cascade-select.d.ts +8 -3
  151. package/types/aeris-ui-core-color-picker.d.ts +7 -2
  152. package/types/aeris-ui-core-confirm-dialog.d.ts +5 -1
  153. package/types/aeris-ui-core-confirm-popup.d.ts +6 -1
  154. package/types/aeris-ui-core-context-menu.d.ts +6 -1
  155. package/types/aeris-ui-core-date-picker.d.ts +7 -2
  156. package/types/aeris-ui-core-dialog.d.ts +4 -1
  157. package/types/aeris-ui-core-drawer.d.ts +4 -1
  158. package/types/aeris-ui-core-dynamic-dialog.d.ts +3 -0
  159. package/types/aeris-ui-core-form-field.d.ts +65 -0
  160. package/types/aeris-ui-core-mega-menu.d.ts +4 -2
  161. package/types/aeris-ui-core-menu.d.ts +7 -2
  162. package/types/aeris-ui-core-menubar.d.ts +27 -3
  163. package/types/aeris-ui-core-multi-select.d.ts +8 -4
  164. package/types/aeris-ui-core-paginator.d.ts +9 -1
  165. package/types/aeris-ui-core-password.d.ts +6 -1
  166. package/types/aeris-ui-core-popover.d.ts +5 -2
  167. package/types/aeris-ui-core-select.d.ts +8 -4
  168. package/types/aeris-ui-core-split-button.d.ts +7 -3
  169. package/types/aeris-ui-core-table.d.ts +3 -1
  170. package/types/aeris-ui-core-tabs.d.ts +23 -5
  171. package/types/aeris-ui-core-theming.d.ts +4 -0
  172. package/types/aeris-ui-core-tiered-menu.d.ts +8 -2
  173. package/types/aeris-ui-core-tooltip.d.ts +8 -4
  174. package/types/aeris-ui-core-tree-select.d.ts +8 -3
  175. package/types/aeris-ui-core-tree-table.d.ts +3 -1
  176. package/types/aeris-ui-core.d.ts +80 -26
@@ -1,3 +1,474 @@
1
+ import { DOCUMENT } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, inject, DestroyRef, ElementRef, Renderer2, input, output, effect, Directive } from '@angular/core';
4
+
5
+ function aerisInternalClampOverlayPoint(point, width, height, viewportWidth, viewportHeight, margin, viewportLeft = 0, viewportTop = 0) {
6
+ const padding = normalizePadding(margin);
7
+ return {
8
+ x: clamp(point.x, viewportLeft + padding.left, Math.max(viewportLeft + padding.left, viewportLeft + viewportWidth - width - padding.right)),
9
+ y: clamp(point.y, viewportTop + padding.top, Math.max(viewportTop + padding.top, viewportTop + viewportHeight - height - padding.bottom)),
10
+ };
11
+ }
12
+ function aerisInternalPositionAnchoredOverlay(options) {
13
+ const bounds = resolveBounds(options);
14
+ const placement = resolvePlacement(options, bounds);
15
+ const point = rawPosition(placement, options);
16
+ return {
17
+ placement,
18
+ ...aerisInternalClampOverlayPoint(point, options.width, options.height, bounds.right - bounds.left, bounds.bottom - bounds.top, 0, bounds.left, bounds.top),
19
+ };
20
+ }
21
+ function resolvePlacement(options, bounds) {
22
+ const spaces = {
23
+ bottom: bounds.bottom - options.target.bottom - options.offset,
24
+ top: options.target.top - bounds.top - options.offset,
25
+ right: bounds.right - options.target.right - options.offset,
26
+ left: options.target.left - bounds.left - options.offset,
27
+ };
28
+ const preferred = options.placement === 'auto' ? 'bottom' : options.placement;
29
+ const candidates = placementCandidates(preferred);
30
+ const fitting = candidates.find((placement) => spaces[placement] >=
31
+ (placement === 'top' || placement === 'bottom' ? options.height : options.width));
32
+ return (fitting ??
33
+ candidates.reduce((best, placement) => (spaces[placement] > spaces[best] ? placement : best)));
34
+ }
35
+ function resolveBounds(options) {
36
+ const padding = normalizePadding(options.collisionPadding ?? options.margin);
37
+ const left = options.viewportLeft ?? 0;
38
+ const top = options.viewportTop ?? 0;
39
+ return {
40
+ top: top + padding.top,
41
+ right: left + options.viewportWidth - padding.right,
42
+ bottom: top + options.viewportHeight - padding.bottom,
43
+ left: left + padding.left,
44
+ };
45
+ }
46
+ function normalizePadding(padding) {
47
+ if (typeof padding === 'number') {
48
+ const value = Math.max(0, padding);
49
+ return { top: value, right: value, bottom: value, left: value };
50
+ }
51
+ return {
52
+ top: Math.max(0, padding.top ?? 0),
53
+ right: Math.max(0, padding.right ?? 0),
54
+ bottom: Math.max(0, padding.bottom ?? 0),
55
+ left: Math.max(0, padding.left ?? 0),
56
+ };
57
+ }
58
+ function placementCandidates(preferred) {
59
+ switch (preferred) {
60
+ case 'top':
61
+ return ['top', 'bottom', 'right', 'left'];
62
+ case 'right':
63
+ return ['right', 'left', 'bottom', 'top'];
64
+ case 'bottom':
65
+ return ['bottom', 'top', 'right', 'left'];
66
+ case 'left':
67
+ return ['left', 'right', 'bottom', 'top'];
68
+ }
69
+ }
70
+ function rawPosition(placement, options) {
71
+ if (placement === 'top' || placement === 'bottom') {
72
+ return {
73
+ x: aligned(options.target.left, options.target.width, options.width, options.alignment),
74
+ y: placement === 'bottom'
75
+ ? options.target.bottom + options.offset
76
+ : options.target.top - options.height - options.offset,
77
+ };
78
+ }
79
+ return {
80
+ x: placement === 'right'
81
+ ? options.target.right + options.offset
82
+ : options.target.left - options.width - options.offset,
83
+ y: aligned(options.target.top, options.target.height, options.height, options.alignment),
84
+ };
85
+ }
86
+ function aligned(start, targetSize, overlaySize, alignment) {
87
+ if (alignment === 'start')
88
+ return start;
89
+ if (alignment === 'end')
90
+ return start + targetSize - overlaySize;
91
+ return start + targetSize / 2 - overlaySize / 2;
92
+ }
93
+ function clamp(value, minimum, maximum) {
94
+ return Math.min(Math.max(value, minimum), maximum);
95
+ }
96
+
97
+ let nextAppendToZIndex = 1100;
98
+ const positionedTargets = new WeakMap();
99
+ const AERIS_OVERLAY_APPEND_TO = new InjectionToken('AERIS_OVERLAY_APPEND_TO', { factory: () => 'self' });
100
+ function aerisInternalResolveAppendTo(appendTo, document) {
101
+ if (!appendTo || appendTo === 'self')
102
+ return 'self';
103
+ if (appendTo === 'body')
104
+ return document.body;
105
+ if (isHtmlElement(appendTo))
106
+ return appendTo;
107
+ const nativeElement = elementRefNativeElement(appendTo);
108
+ return isHtmlElement(nativeElement) ? nativeElement : 'self';
109
+ }
110
+ class ɵAerisAppendTo {
111
+ document = inject(DOCUMENT);
112
+ destroyRef = inject(DestroyRef);
113
+ element = inject(ElementRef).nativeElement;
114
+ renderer = inject(Renderer2);
115
+ defaultAppendTo = inject(AERIS_OVERLAY_APPEND_TO);
116
+ frame = null;
117
+ originCaptured = false;
118
+ originParent = null;
119
+ originNextSibling = null;
120
+ aerisInternalAppendTo = input(/* @ts-ignore */
121
+ ...(ngDevMode ? [undefined, { debugName: "aerisInternalAppendTo" }] : /* istanbul ignore next */ []));
122
+ aerisInternalAppendToAnchor = input(null, /* @ts-ignore */
123
+ ...(ngDevMode ? [{ debugName: "aerisInternalAppendToAnchor" }] : /* istanbul ignore next */ []));
124
+ aerisInternalAppendToOffset = input(7, /* @ts-ignore */
125
+ ...(ngDevMode ? [{ debugName: "aerisInternalAppendToOffset" }] : /* istanbul ignore next */ []));
126
+ aerisInternalAppendToMatchWidth = input(false, /* @ts-ignore */
127
+ ...(ngDevMode ? [{ debugName: "aerisInternalAppendToMatchWidth" }] : /* istanbul ignore next */ []));
128
+ aerisInternalAppendToPlacement = input('auto', /* @ts-ignore */
129
+ ...(ngDevMode ? [{ debugName: "aerisInternalAppendToPlacement" }] : /* istanbul ignore next */ []));
130
+ aerisInternalAppendToAlignment = input('auto', /* @ts-ignore */
131
+ ...(ngDevMode ? [{ debugName: "aerisInternalAppendToAlignment" }] : /* istanbul ignore next */ []));
132
+ aerisInternalAppendToCollisionPadding = input(8, /* @ts-ignore */
133
+ ...(ngDevMode ? [{ debugName: "aerisInternalAppendToCollisionPadding" }] : /* istanbul ignore next */ []));
134
+ aerisInternalAppendToPositionSelf = input(true, /* @ts-ignore */
135
+ ...(ngDevMode ? [{ debugName: "aerisInternalAppendToPositionSelf" }] : /* istanbul ignore next */ []));
136
+ aerisInternalAppendToOutside = output();
137
+ constructor() {
138
+ effect((onCleanup) => {
139
+ const target = aerisInternalResolveAppendTo(this.aerisInternalAppendTo() ?? this.defaultAppendTo, this.document);
140
+ const anchor = this.aerisInternalAppendToAnchor();
141
+ this.captureOrigin();
142
+ if (target === 'self')
143
+ this.restoreToOrigin();
144
+ if (target === 'self' && (!anchor || !this.aerisInternalAppendToPositionSelf())) {
145
+ this.element.removeAttribute('data-aeris-append-to');
146
+ return;
147
+ }
148
+ const positioningTarget = target === 'self' ? this.element.parentElement : target;
149
+ if (!positioningTarget)
150
+ return;
151
+ const inheritedStyles = this.preserveInheritedStyles();
152
+ const positioningStyles = this.preserveInlineStyles([
153
+ 'position',
154
+ 'inset',
155
+ 'inset-block-start',
156
+ 'inset-inline-start',
157
+ 'right',
158
+ 'bottom',
159
+ 'left',
160
+ 'top',
161
+ 'min-width',
162
+ 'max-width',
163
+ 'max-height',
164
+ 'overflow-x',
165
+ 'overflow-y',
166
+ 'overscroll-behavior',
167
+ 'z-index',
168
+ ]);
169
+ const targetPosition = this.ensurePositionedTarget(positioningTarget);
170
+ if (target !== 'self') {
171
+ this.renderer.appendChild(target, this.element);
172
+ this.applyInheritedStyles(inheritedStyles);
173
+ this.renderer.setAttribute(this.element, 'data-aeris-append-to', target === this.document.body ? 'body' : 'target');
174
+ this.bringToFront();
175
+ }
176
+ else {
177
+ this.element.removeAttribute('data-aeris-append-to');
178
+ }
179
+ const reposition = () => this.schedulePosition(anchor, positioningTarget);
180
+ const pointerdown = (event) => {
181
+ const eventTarget = event.target;
182
+ if (!isDomNode(eventTarget))
183
+ return;
184
+ if (this.element.contains(eventTarget) || anchor?.contains(eventTarget))
185
+ return;
186
+ this.aerisInternalAppendToOutside.emit(event);
187
+ };
188
+ const view = this.document.defaultView;
189
+ const visualViewport = view?.visualViewport;
190
+ view?.addEventListener('resize', reposition);
191
+ visualViewport?.addEventListener('resize', reposition);
192
+ visualViewport?.addEventListener('scroll', reposition);
193
+ this.document.addEventListener('scroll', reposition, true);
194
+ this.document.addEventListener('pointerdown', pointerdown, true);
195
+ const resizeObserver = typeof ResizeObserver === 'undefined' || !anchor ? null : new ResizeObserver(reposition);
196
+ if (anchor)
197
+ resizeObserver?.observe(anchor);
198
+ resizeObserver?.observe(this.element);
199
+ if (anchor && view)
200
+ this.positionConnectedOverlay(anchor, positioningTarget, view);
201
+ onCleanup(() => {
202
+ view?.removeEventListener('resize', reposition);
203
+ visualViewport?.removeEventListener('resize', reposition);
204
+ visualViewport?.removeEventListener('scroll', reposition);
205
+ this.document.removeEventListener('scroll', reposition, true);
206
+ this.document.removeEventListener('pointerdown', pointerdown, true);
207
+ resizeObserver?.disconnect();
208
+ this.cancelFrame();
209
+ this.restoreInlineStyles(positioningStyles);
210
+ this.element.removeAttribute('data-placement');
211
+ this.element.removeAttribute('data-positioned');
212
+ this.element.removeAttribute('data-viewport-constrained');
213
+ this.element.removeAttribute('data-viewport-constrained-width');
214
+ this.restoreInheritedStyles(inheritedStyles);
215
+ targetPosition.restore();
216
+ this.element.removeAttribute('data-aeris-append-to');
217
+ if (target !== 'self')
218
+ this.element.remove();
219
+ });
220
+ });
221
+ this.destroyRef.onDestroy(() => {
222
+ this.element.remove();
223
+ queueMicrotask(() => this.element.remove());
224
+ });
225
+ }
226
+ restore() {
227
+ this.restoreToOrigin();
228
+ }
229
+ schedulePosition(anchor, target) {
230
+ if (!anchor)
231
+ return;
232
+ this.cancelFrame();
233
+ const view = this.document.defaultView;
234
+ if (!view)
235
+ return;
236
+ this.frame = view.requestAnimationFrame(() => {
237
+ this.frame = null;
238
+ this.positionConnectedOverlay(anchor, target, view);
239
+ });
240
+ }
241
+ positionConnectedOverlay(anchor, target, view) {
242
+ if (!anchor.isConnected || !this.element.isConnected)
243
+ return;
244
+ const anchorRect = anchor.getBoundingClientRect();
245
+ this.element.style.position = target === this.document.body ? 'fixed' : 'absolute';
246
+ this.element.style.inset = 'auto';
247
+ this.element.style.insetBlockStart = 'auto';
248
+ this.element.style.insetInlineStart = 'auto';
249
+ this.element.style.right = 'auto';
250
+ this.element.style.bottom = 'auto';
251
+ const viewport = view.visualViewport;
252
+ const viewportLeft = viewport?.offsetLeft ?? 0;
253
+ const viewportTop = viewport?.offsetTop ?? 0;
254
+ const collisionPadding = this.collisionPadding(view);
255
+ const availableWidth = Math.max(0, (viewport?.width ?? view.innerWidth) -
256
+ (collisionPadding.left ?? 0) -
257
+ (collisionPadding.right ?? 0));
258
+ if (this.aerisInternalAppendToMatchWidth()) {
259
+ this.element.style.minWidth = `${Math.min(anchorRect.width, availableWidth)}px`;
260
+ }
261
+ const availableHeight = Math.max(0, (viewport?.height ?? view.innerHeight) -
262
+ (collisionPadding.top ?? 0) -
263
+ (collisionPadding.bottom ?? 0));
264
+ let panelRect = this.element.getBoundingClientRect();
265
+ if (panelRect.width > availableWidth && availableWidth > 0) {
266
+ this.element.style.maxWidth = `${availableWidth}px`;
267
+ this.element.style.overflowX = 'auto';
268
+ this.element.style.overscrollBehavior = 'contain';
269
+ this.element.setAttribute('data-viewport-constrained-width', 'true');
270
+ panelRect = this.element.getBoundingClientRect();
271
+ }
272
+ else if (this.element.hasAttribute('data-viewport-constrained-width')) {
273
+ this.element.style.removeProperty('max-width');
274
+ this.element.style.removeProperty('overflow-x');
275
+ this.element.removeAttribute('data-viewport-constrained-width');
276
+ panelRect = this.element.getBoundingClientRect();
277
+ }
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
+ }
292
+ const direction = view.getComputedStyle(anchor).direction;
293
+ const configuredAlignment = this.aerisInternalAppendToAlignment();
294
+ const point = aerisInternalPositionAnchoredOverlay({
295
+ target: anchorRect,
296
+ width: panelRect.width || this.element.offsetWidth || anchorRect.width,
297
+ height: panelRect.height || this.element.offsetHeight,
298
+ placement: this.aerisInternalAppendToPlacement(),
299
+ alignment: configuredAlignment === 'auto'
300
+ ? direction === 'rtl'
301
+ ? 'end'
302
+ : 'start'
303
+ : configuredAlignment,
304
+ offset: this.aerisInternalAppendToOffset(),
305
+ margin: 8,
306
+ viewportWidth: viewport?.width ?? view.innerWidth,
307
+ viewportHeight: viewport?.height ?? view.innerHeight,
308
+ viewportLeft,
309
+ viewportTop,
310
+ collisionPadding,
311
+ });
312
+ if (target === this.document.body) {
313
+ this.element.style.left = `${point.x}px`;
314
+ this.element.style.top = `${point.y}px`;
315
+ }
316
+ else {
317
+ const targetRect = target.getBoundingClientRect();
318
+ this.element.style.left = `${point.x - targetRect.left - target.clientLeft + target.scrollLeft}px`;
319
+ this.element.style.top = `${point.y - targetRect.top - target.clientTop + target.scrollTop}px`;
320
+ }
321
+ this.element.setAttribute('data-placement', point.placement);
322
+ this.element.setAttribute('data-positioned', 'true');
323
+ }
324
+ collisionPadding(view) {
325
+ const configured = this.aerisInternalAppendToCollisionPadding();
326
+ const padding = typeof configured === 'number'
327
+ ? { top: configured, right: configured, bottom: configured, left: configured }
328
+ : configured;
329
+ const rootStyles = view.getComputedStyle(this.document.documentElement);
330
+ const value = (side) => {
331
+ const safeArea = Number.parseFloat(rootStyles.getPropertyValue(`--aeris-safe-area-${side}`)) || 0;
332
+ return Math.max(0, padding[side] ?? 0) + safeArea;
333
+ };
334
+ return {
335
+ top: value('top'),
336
+ right: value('right'),
337
+ bottom: value('bottom'),
338
+ left: value('left'),
339
+ };
340
+ }
341
+ preserveInheritedStyles() {
342
+ const view = this.document.defaultView;
343
+ if (!view)
344
+ return new Map();
345
+ const computed = view.getComputedStyle(this.element);
346
+ const preserved = new Map();
347
+ const properties = ['color', 'direction', 'font'];
348
+ for (let index = 0; index < computed.length; index += 1) {
349
+ const property = computed.item(index);
350
+ if (property.startsWith('--aeris-') || property.startsWith('--_aeris-')) {
351
+ properties.push(property);
352
+ }
353
+ }
354
+ for (const property of properties) {
355
+ const value = computed.getPropertyValue(property);
356
+ if (!value)
357
+ continue;
358
+ preserved.set(property, {
359
+ source: value,
360
+ previous: this.element.style.getPropertyValue(property),
361
+ });
362
+ }
363
+ return preserved;
364
+ }
365
+ applyInheritedStyles(preserved) {
366
+ const computed = this.document.defaultView?.getComputedStyle(this.element);
367
+ if (!computed)
368
+ return;
369
+ for (const [property, value] of preserved) {
370
+ if (computed.getPropertyValue(property) !== value.source) {
371
+ this.element.style.setProperty(property, value.source);
372
+ }
373
+ }
374
+ }
375
+ restoreInheritedStyles(preserved) {
376
+ for (const [property, value] of preserved) {
377
+ if (value.previous)
378
+ this.element.style.setProperty(property, value.previous);
379
+ else
380
+ this.element.style.removeProperty(property);
381
+ }
382
+ }
383
+ preserveInlineStyles(properties) {
384
+ return new Map(properties.map((property) => [property, this.element.style.getPropertyValue(property)]));
385
+ }
386
+ restoreInlineStyles(previous) {
387
+ for (const [property, value] of previous) {
388
+ if (value)
389
+ this.element.style.setProperty(property, value);
390
+ else
391
+ this.element.style.removeProperty(property);
392
+ }
393
+ }
394
+ bringToFront() {
395
+ const computedZIndex = Number.parseInt(this.document.defaultView?.getComputedStyle(this.element).zIndex ?? '', 10);
396
+ const zIndex = Math.max(Number.isFinite(computedZIndex) ? computedZIndex : 0, nextAppendToZIndex);
397
+ nextAppendToZIndex = zIndex + 1;
398
+ this.element.style.zIndex = String(zIndex);
399
+ }
400
+ ensurePositionedTarget(target) {
401
+ if (target === this.document.body || !this.document.defaultView) {
402
+ return { restore: () => undefined };
403
+ }
404
+ const existing = positionedTargets.get(target);
405
+ if (existing) {
406
+ existing.count += 1;
407
+ return { restore: () => this.releasePositionedTarget(target) };
408
+ }
409
+ if (this.document.defaultView.getComputedStyle(target).position !== 'static') {
410
+ return { restore: () => undefined };
411
+ }
412
+ const previous = target.style.position;
413
+ target.style.position = 'relative';
414
+ positionedTargets.set(target, { count: 1, previous });
415
+ return { restore: () => this.releasePositionedTarget(target) };
416
+ }
417
+ releasePositionedTarget(target) {
418
+ const entry = positionedTargets.get(target);
419
+ if (!entry)
420
+ return;
421
+ entry.count -= 1;
422
+ if (entry.count > 0)
423
+ return;
424
+ target.style.position = entry.previous;
425
+ positionedTargets.delete(target);
426
+ }
427
+ cancelFrame() {
428
+ if (this.frame === null)
429
+ return;
430
+ this.document.defaultView?.cancelAnimationFrame(this.frame);
431
+ this.frame = null;
432
+ }
433
+ captureOrigin() {
434
+ if (this.originCaptured)
435
+ return;
436
+ this.originCaptured = true;
437
+ this.originParent = this.element.parentNode;
438
+ this.originNextSibling = this.element.nextSibling;
439
+ }
440
+ restoreToOrigin() {
441
+ if (!this.originParent || this.element.parentNode === this.originParent)
442
+ return;
443
+ this.renderer.insertBefore(this.originParent, this.element, this.originNextSibling?.parentNode === this.originParent ? this.originNextSibling : null);
444
+ }
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 });
447
+ }
448
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ɵAerisAppendTo, decorators: [{
449
+ type: Directive,
450
+ args: [{ selector: '[aerisInternalAppendTo]' }]
451
+ }], 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"] }] } });
452
+ function elementRefNativeElement(value) {
453
+ if ('nativeElement' in value)
454
+ return value.nativeElement;
455
+ if ('elementRef' in value) {
456
+ const node = value.elementRef.nativeElement;
457
+ if (isHtmlElement(node))
458
+ return node;
459
+ if (typeof node === 'object' && node !== null && 'parentElement' in node) {
460
+ return node.parentElement;
461
+ }
462
+ }
463
+ return null;
464
+ }
465
+ function isHtmlElement(value) {
466
+ return typeof value === 'object' && value !== null && 'nodeType' in value && value.nodeType === 1;
467
+ }
468
+ function isDomNode(value) {
469
+ return typeof value === 'object' && value !== null && 'nodeType' in value;
470
+ }
471
+
1
472
  function filterSelectOptions(options, query, fields, matchMode, locale) {
2
473
  const normalizedQuery = query.trim().toLocaleLowerCase(locale);
3
474
  if (!normalizedQuery)
@@ -202,67 +673,6 @@ function aerisInternalTrapTabFocus(event, root, activeElement, options = {}) {
202
673
  }
203
674
  }
204
675
 
205
- function aerisInternalClampOverlayPoint(point, width, height, viewportWidth, viewportHeight, margin) {
206
- return {
207
- x: clamp(point.x, margin, Math.max(margin, viewportWidth - width - margin)),
208
- y: clamp(point.y, margin, Math.max(margin, viewportHeight - height - margin)),
209
- };
210
- }
211
- function aerisInternalPositionAnchoredOverlay(options) {
212
- const placement = resolvePlacement(options);
213
- const point = rawPosition(placement, options);
214
- return {
215
- placement,
216
- ...aerisInternalClampOverlayPoint(point, options.width, options.height, options.viewportWidth, options.viewportHeight, options.margin),
217
- };
218
- }
219
- function resolvePlacement(options) {
220
- if (options.placement !== 'auto')
221
- return options.placement;
222
- const spaces = {
223
- bottom: options.viewportHeight - options.target.bottom - options.offset,
224
- top: options.target.top - options.offset,
225
- right: options.viewportWidth - options.target.right - options.offset,
226
- left: options.target.left - options.offset,
227
- };
228
- if (spaces.bottom >= options.height)
229
- return 'bottom';
230
- if (spaces.top >= options.height)
231
- return 'top';
232
- if (spaces.right >= options.width)
233
- return 'right';
234
- if (spaces.left >= options.width)
235
- return 'left';
236
- return (Object.entries(spaces).sort((left, right) => right[1] - left[1])[0]?.[0] ??
237
- 'bottom');
238
- }
239
- function rawPosition(placement, options) {
240
- if (placement === 'top' || placement === 'bottom') {
241
- return {
242
- x: aligned(options.target.left, options.target.width, options.width, options.alignment),
243
- y: placement === 'bottom'
244
- ? options.target.bottom + options.offset
245
- : options.target.top - options.height - options.offset,
246
- };
247
- }
248
- return {
249
- x: placement === 'right'
250
- ? options.target.right + options.offset
251
- : options.target.left - options.width - options.offset,
252
- y: aligned(options.target.top, options.target.height, options.height, options.alignment),
253
- };
254
- }
255
- function aligned(start, targetSize, overlaySize, alignment) {
256
- if (alignment === 'start')
257
- return start;
258
- if (alignment === 'end')
259
- return start + targetSize - overlaySize;
260
- return start + targetSize / 2 - overlaySize / 2;
261
- }
262
- function clamp(value, minimum, maximum) {
263
- return Math.min(Math.max(value, minimum), maximum);
264
- }
265
-
266
676
  function aerisInternalPixelWidth(width) {
267
677
  return `${Math.round(width * 100) / 100}px`;
268
678
  }
@@ -350,11 +760,11 @@ function aerisInternalCreateFrameScheduler(callback) {
350
760
  };
351
761
  }
352
762
 
353
- const AERIS_UI_VERSION = '22.0.0-alpha.3';
763
+ const AERIS_UI_VERSION = '22.0.0-alpha.5';
354
764
 
355
765
  /**
356
766
  * Generated bundle index. Do not edit.
357
767
  */
358
768
 
359
- export { AERIS_UI_VERSION, aerisInternalApplyMeasuredColumnWidths, aerisInternalClampColumnResizeDelta, aerisInternalClampOverlayPoint, aerisInternalColumnResizeDirection, aerisInternalColumnWidthPixels, aerisInternalCreateFrameScheduler, aerisInternalFocusInitialElement, aerisInternalFocusableElements, aerisInternalIsFocusable, aerisInternalListenForColumnResize, aerisInternalMeasureColumnWidths, aerisInternalPixelWidth, aerisInternalPositionAnchoredOverlay, aerisInternalSetColumnPairWidths, aerisInternalTrapTabFocus, boundarySelectValue, filterSelectOptions, groupSelectOptions, nextEnabledSelectValue, selectVirtualRange, ɵisTopmostAerisOverlay, ɵlockAerisDocumentScroll, ɵregisterAerisOverlay, ɵunlockAerisDocumentScroll, ɵunregisterAerisOverlay };
769
+ export { AERIS_OVERLAY_APPEND_TO, AERIS_UI_VERSION, aerisInternalApplyMeasuredColumnWidths, aerisInternalClampColumnResizeDelta, aerisInternalClampOverlayPoint, aerisInternalColumnResizeDirection, aerisInternalColumnWidthPixels, aerisInternalCreateFrameScheduler, aerisInternalFocusInitialElement, aerisInternalFocusableElements, aerisInternalIsFocusable, aerisInternalListenForColumnResize, aerisInternalMeasureColumnWidths, aerisInternalPixelWidth, aerisInternalPositionAnchoredOverlay, aerisInternalSetColumnPairWidths, aerisInternalTrapTabFocus, boundarySelectValue, filterSelectOptions, groupSelectOptions, nextEnabledSelectValue, selectVirtualRange, ɵAerisAppendTo, aerisInternalResolveAppendTo as ɵaerisResolveAppendTo, ɵisTopmostAerisOverlay, ɵlockAerisDocumentScroll, ɵregisterAerisOverlay, ɵunlockAerisDocumentScroll, ɵunregisterAerisOverlay };
360
770
  //# sourceMappingURL=aeris-ui-core.mjs.map