@aeris-ui/core 22.0.0-alpha.4 → 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.
- package/README.md +2 -2
- package/fesm2022/aeris-ui-core-accordion.mjs +12 -12
- package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +3 -3
- package/fesm2022/aeris-ui-core-auto-complete.mjs +21 -17
- package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-auto-focus.mjs +3 -3
- package/fesm2022/aeris-ui-core-avatar.mjs +9 -9
- package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-badge.mjs +10 -10
- package/fesm2022/aeris-ui-core-badge.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-block-ui.mjs +3 -3
- package/fesm2022/aeris-ui-core-breadcrumb.mjs +12 -12
- package/fesm2022/aeris-ui-core-button-group.mjs +3 -3
- package/fesm2022/aeris-ui-core-button.mjs +6 -6
- package/fesm2022/aeris-ui-core-card.mjs +18 -18
- package/fesm2022/aeris-ui-core-carousel.mjs +12 -12
- package/fesm2022/aeris-ui-core-cascade-select.mjs +15 -11
- package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-chart.mjs +3 -3
- package/fesm2022/aeris-ui-core-checkbox.mjs +3 -3
- package/fesm2022/aeris-ui-core-chip.mjs +9 -9
- package/fesm2022/aeris-ui-core-class-names.mjs +3 -3
- package/fesm2022/aeris-ui-core-color-picker.mjs +9 -5
- package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-compare.mjs +12 -12
- package/fesm2022/aeris-ui-core-confirm-dialog.mjs +18 -18
- package/fesm2022/aeris-ui-core-confirm-popup.mjs +19 -19
- package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-context-menu.mjs +15 -8
- package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-date-picker.mjs +9 -5
- package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-dialog.mjs +17 -17
- package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-divider.mjs +3 -3
- package/fesm2022/aeris-ui-core-drawer.mjs +16 -16
- package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +6 -6
- package/fesm2022/aeris-ui-core-editor.mjs +3 -3
- package/fesm2022/aeris-ui-core-file-upload.mjs +24 -24
- package/fesm2022/aeris-ui-core-filter-service.mjs +3 -3
- package/fesm2022/aeris-ui-core-fluid.mjs +3 -3
- package/fesm2022/aeris-ui-core-focus-trap.mjs +3 -3
- package/fesm2022/aeris-ui-core-form-field.mjs +181 -0
- package/fesm2022/aeris-ui-core-form-field.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-galleria.mjs +27 -27
- package/fesm2022/aeris-ui-core-glass.mjs +3 -3
- package/fesm2022/aeris-ui-core-icon-field.mjs +12 -12
- package/fesm2022/aeris-ui-core-inplace.mjs +9 -9
- package/fesm2022/aeris-ui-core-input-group.mjs +15 -15
- package/fesm2022/aeris-ui-core-input-mask.mjs +3 -3
- package/fesm2022/aeris-ui-core-input-number.mjs +3 -3
- package/fesm2022/aeris-ui-core-input-otp.mjs +6 -6
- package/fesm2022/aeris-ui-core-input-text.mjs +6 -6
- package/fesm2022/aeris-ui-core-key-filter.mjs +3 -3
- package/fesm2022/aeris-ui-core-mega-menu.mjs +15 -7
- package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-menu.mjs +38 -18
- package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-menubar.mjs +135 -15
- package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-message.mjs +9 -9
- package/fesm2022/aeris-ui-core-meter-group.mjs +15 -15
- package/fesm2022/aeris-ui-core-multi-select.mjs +24 -20
- package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-order-list.mjs +9 -9
- package/fesm2022/aeris-ui-core-organization-chart.mjs +9 -9
- package/fesm2022/aeris-ui-core-paginator.mjs +9 -5
- package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-panel.mjs +15 -15
- package/fesm2022/aeris-ui-core-password.mjs +18 -14
- package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-pick-list.mjs +9 -9
- package/fesm2022/aeris-ui-core-popover.mjs +30 -19
- package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-progress-bar.mjs +9 -9
- package/fesm2022/aeris-ui-core-progress-spinner.mjs +6 -6
- package/fesm2022/aeris-ui-core-radio-button.mjs +3 -3
- package/fesm2022/aeris-ui-core-rating.mjs +3 -3
- package/fesm2022/aeris-ui-core-scroll-panel.mjs +3 -3
- package/fesm2022/aeris-ui-core-scroll-top.mjs +3 -3
- package/fesm2022/aeris-ui-core-select.mjs +42 -38
- package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-skeleton.mjs +3 -3
- package/fesm2022/aeris-ui-core-slider.mjs +3 -3
- package/fesm2022/aeris-ui-core-speed-dial.mjs +3 -3
- package/fesm2022/aeris-ui-core-split-button.mjs +9 -5
- package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-splitter.mjs +6 -6
- package/fesm2022/aeris-ui-core-stepper.mjs +12 -12
- package/fesm2022/aeris-ui-core-style-class.mjs +3 -3
- package/fesm2022/aeris-ui-core-table.mjs +19 -19
- package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tabs.mjs +76 -25
- package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-textarea.mjs +6 -6
- package/fesm2022/aeris-ui-core-theming.mjs +3 -3
- package/fesm2022/aeris-ui-core-tiered-menu.mjs +29 -10
- package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-timeline.mjs +15 -15
- package/fesm2022/aeris-ui-core-toast.mjs +12 -12
- package/fesm2022/aeris-ui-core-toggle-switch.mjs +3 -3
- package/fesm2022/aeris-ui-core-toolbar.mjs +18 -18
- package/fesm2022/aeris-ui-core-tooltip.mjs +29 -30
- package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tree-select.mjs +24 -20
- package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tree-table.mjs +16 -16
- package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tree.mjs +12 -12
- package/fesm2022/aeris-ui-core.mjs +165 -42
- package/fesm2022/aeris-ui-core.mjs.map +1 -1
- package/package.json +6 -2
- package/styles/aeris.css +7 -0
- package/types/aeris-ui-core-auto-complete.d.ts +3 -2
- package/types/aeris-ui-core-cascade-select.d.ts +3 -2
- package/types/aeris-ui-core-color-picker.d.ts +3 -2
- package/types/aeris-ui-core-context-menu.d.ts +3 -1
- package/types/aeris-ui-core-date-picker.d.ts +3 -2
- package/types/aeris-ui-core-form-field.d.ts +65 -0
- package/types/aeris-ui-core-mega-menu.d.ts +4 -2
- package/types/aeris-ui-core-menu.d.ts +3 -2
- package/types/aeris-ui-core-menubar.d.ts +27 -3
- package/types/aeris-ui-core-multi-select.d.ts +3 -2
- package/types/aeris-ui-core-paginator.d.ts +3 -2
- package/types/aeris-ui-core-password.d.ts +3 -2
- package/types/aeris-ui-core-popover.d.ts +2 -2
- package/types/aeris-ui-core-select.d.ts +3 -2
- package/types/aeris-ui-core-split-button.d.ts +3 -2
- package/types/aeris-ui-core-tabs.d.ts +23 -5
- package/types/aeris-ui-core-tiered-menu.d.ts +5 -3
- package/types/aeris-ui-core-tooltip.d.ts +2 -4
- package/types/aeris-ui-core-tree-select.d.ts +3 -2
- package/types/aeris-ui-core.d.ts +40 -26
|
@@ -2,39 +2,70 @@ import { DOCUMENT } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { InjectionToken, inject, DestroyRef, ElementRef, Renderer2, input, output, effect, Directive } from '@angular/core';
|
|
4
4
|
|
|
5
|
-
function aerisInternalClampOverlayPoint(point, width, height, viewportWidth, viewportHeight, margin) {
|
|
5
|
+
function aerisInternalClampOverlayPoint(point, width, height, viewportWidth, viewportHeight, margin, viewportLeft = 0, viewportTop = 0) {
|
|
6
|
+
const padding = normalizePadding(margin);
|
|
6
7
|
return {
|
|
7
|
-
x: clamp(point.x,
|
|
8
|
-
y: clamp(point.y,
|
|
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)),
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
function aerisInternalPositionAnchoredOverlay(options) {
|
|
12
|
-
const
|
|
13
|
+
const bounds = resolveBounds(options);
|
|
14
|
+
const placement = resolvePlacement(options, bounds);
|
|
13
15
|
const point = rawPosition(placement, options);
|
|
14
16
|
return {
|
|
15
17
|
placement,
|
|
16
|
-
...aerisInternalClampOverlayPoint(point, options.width, options.height,
|
|
18
|
+
...aerisInternalClampOverlayPoint(point, options.width, options.height, bounds.right - bounds.left, bounds.bottom - bounds.top, 0, bounds.left, bounds.top),
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
|
-
function resolvePlacement(options) {
|
|
20
|
-
if (options.placement !== 'auto')
|
|
21
|
-
return options.placement;
|
|
21
|
+
function resolvePlacement(options, bounds) {
|
|
22
22
|
const spaces = {
|
|
23
|
-
bottom:
|
|
24
|
-
top: options.target.top - options.offset,
|
|
25
|
-
right:
|
|
26
|
-
left: options.target.left - options.offset,
|
|
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
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
+
}
|
|
38
69
|
}
|
|
39
70
|
function rawPosition(placement, options) {
|
|
40
71
|
if (placement === 'top' || placement === 'bottom') {
|
|
@@ -94,17 +125,29 @@ class ɵAerisAppendTo {
|
|
|
94
125
|
...(ngDevMode ? [{ debugName: "aerisInternalAppendToOffset" }] : /* istanbul ignore next */ []));
|
|
95
126
|
aerisInternalAppendToMatchWidth = input(false, /* @ts-ignore */
|
|
96
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 */ []));
|
|
97
136
|
aerisInternalAppendToOutside = output();
|
|
98
137
|
constructor() {
|
|
99
138
|
effect((onCleanup) => {
|
|
100
139
|
const target = aerisInternalResolveAppendTo(this.aerisInternalAppendTo() ?? this.defaultAppendTo, this.document);
|
|
101
140
|
const anchor = this.aerisInternalAppendToAnchor();
|
|
102
141
|
this.captureOrigin();
|
|
103
|
-
if (target === 'self')
|
|
142
|
+
if (target === 'self')
|
|
104
143
|
this.restoreToOrigin();
|
|
144
|
+
if (target === 'self' && (!anchor || !this.aerisInternalAppendToPositionSelf())) {
|
|
105
145
|
this.element.removeAttribute('data-aeris-append-to');
|
|
106
146
|
return;
|
|
107
147
|
}
|
|
148
|
+
const positioningTarget = target === 'self' ? this.element.parentElement : target;
|
|
149
|
+
if (!positioningTarget)
|
|
150
|
+
return;
|
|
108
151
|
const inheritedStyles = this.preserveInheritedStyles();
|
|
109
152
|
const positioningStyles = this.preserveInlineStyles([
|
|
110
153
|
'position',
|
|
@@ -116,14 +159,24 @@ class ɵAerisAppendTo {
|
|
|
116
159
|
'left',
|
|
117
160
|
'top',
|
|
118
161
|
'min-width',
|
|
162
|
+
'max-width',
|
|
163
|
+
'max-height',
|
|
164
|
+
'overflow-x',
|
|
165
|
+
'overflow-y',
|
|
166
|
+
'overscroll-behavior',
|
|
119
167
|
'z-index',
|
|
120
168
|
]);
|
|
121
|
-
const targetPosition = this.ensurePositionedTarget(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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);
|
|
127
180
|
const pointerdown = (event) => {
|
|
128
181
|
const eventTarget = event.target;
|
|
129
182
|
if (!isDomNode(eventTarget))
|
|
@@ -133,7 +186,10 @@ class ɵAerisAppendTo {
|
|
|
133
186
|
this.aerisInternalAppendToOutside.emit(event);
|
|
134
187
|
};
|
|
135
188
|
const view = this.document.defaultView;
|
|
189
|
+
const visualViewport = view?.visualViewport;
|
|
136
190
|
view?.addEventListener('resize', reposition);
|
|
191
|
+
visualViewport?.addEventListener('resize', reposition);
|
|
192
|
+
visualViewport?.addEventListener('scroll', reposition);
|
|
137
193
|
this.document.addEventListener('scroll', reposition, true);
|
|
138
194
|
this.document.addEventListener('pointerdown', pointerdown, true);
|
|
139
195
|
const resizeObserver = typeof ResizeObserver === 'undefined' || !anchor ? null : new ResizeObserver(reposition);
|
|
@@ -141,9 +197,11 @@ class ɵAerisAppendTo {
|
|
|
141
197
|
resizeObserver?.observe(anchor);
|
|
142
198
|
resizeObserver?.observe(this.element);
|
|
143
199
|
if (anchor && view)
|
|
144
|
-
this.positionConnectedOverlay(anchor,
|
|
200
|
+
this.positionConnectedOverlay(anchor, positioningTarget, view);
|
|
145
201
|
onCleanup(() => {
|
|
146
202
|
view?.removeEventListener('resize', reposition);
|
|
203
|
+
visualViewport?.removeEventListener('resize', reposition);
|
|
204
|
+
visualViewport?.removeEventListener('scroll', reposition);
|
|
147
205
|
this.document.removeEventListener('scroll', reposition, true);
|
|
148
206
|
this.document.removeEventListener('pointerdown', pointerdown, true);
|
|
149
207
|
resizeObserver?.disconnect();
|
|
@@ -151,10 +209,13 @@ class ɵAerisAppendTo {
|
|
|
151
209
|
this.restoreInlineStyles(positioningStyles);
|
|
152
210
|
this.element.removeAttribute('data-placement');
|
|
153
211
|
this.element.removeAttribute('data-positioned');
|
|
212
|
+
this.element.removeAttribute('data-viewport-constrained');
|
|
213
|
+
this.element.removeAttribute('data-viewport-constrained-width');
|
|
154
214
|
this.restoreInheritedStyles(inheritedStyles);
|
|
155
215
|
targetPosition.restore();
|
|
156
216
|
this.element.removeAttribute('data-aeris-append-to');
|
|
157
|
-
|
|
217
|
+
if (target !== 'self')
|
|
218
|
+
this.element.remove();
|
|
158
219
|
});
|
|
159
220
|
});
|
|
160
221
|
this.destroyRef.onDestroy(() => {
|
|
@@ -187,21 +248,66 @@ class ɵAerisAppendTo {
|
|
|
187
248
|
this.element.style.insetInlineStart = 'auto';
|
|
188
249
|
this.element.style.right = 'auto';
|
|
189
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));
|
|
190
258
|
if (this.aerisInternalAppendToMatchWidth()) {
|
|
191
|
-
this.element.style.minWidth = `${anchorRect.width}px`;
|
|
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();
|
|
192
291
|
}
|
|
193
|
-
const panelRect = this.element.getBoundingClientRect();
|
|
194
292
|
const direction = view.getComputedStyle(anchor).direction;
|
|
293
|
+
const configuredAlignment = this.aerisInternalAppendToAlignment();
|
|
195
294
|
const point = aerisInternalPositionAnchoredOverlay({
|
|
196
295
|
target: anchorRect,
|
|
197
296
|
width: panelRect.width || this.element.offsetWidth || anchorRect.width,
|
|
198
297
|
height: panelRect.height || this.element.offsetHeight,
|
|
199
|
-
placement:
|
|
200
|
-
alignment:
|
|
298
|
+
placement: this.aerisInternalAppendToPlacement(),
|
|
299
|
+
alignment: configuredAlignment === 'auto'
|
|
300
|
+
? direction === 'rtl'
|
|
301
|
+
? 'end'
|
|
302
|
+
: 'start'
|
|
303
|
+
: configuredAlignment,
|
|
201
304
|
offset: this.aerisInternalAppendToOffset(),
|
|
202
305
|
margin: 8,
|
|
203
|
-
viewportWidth: view.innerWidth,
|
|
204
|
-
viewportHeight: view.innerHeight,
|
|
306
|
+
viewportWidth: viewport?.width ?? view.innerWidth,
|
|
307
|
+
viewportHeight: viewport?.height ?? view.innerHeight,
|
|
308
|
+
viewportLeft,
|
|
309
|
+
viewportTop,
|
|
310
|
+
collisionPadding,
|
|
205
311
|
});
|
|
206
312
|
if (target === this.document.body) {
|
|
207
313
|
this.element.style.left = `${point.x}px`;
|
|
@@ -215,6 +321,23 @@ class ɵAerisAppendTo {
|
|
|
215
321
|
this.element.setAttribute('data-placement', point.placement);
|
|
216
322
|
this.element.setAttribute('data-positioned', 'true');
|
|
217
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
|
+
}
|
|
218
341
|
preserveInheritedStyles() {
|
|
219
342
|
const view = this.document.defaultView;
|
|
220
343
|
if (!view)
|
|
@@ -319,13 +442,13 @@ class ɵAerisAppendTo {
|
|
|
319
442
|
return;
|
|
320
443
|
this.renderer.insertBefore(this.originParent, this.element, this.originNextSibling?.parentNode === this.originParent ? this.originNextSibling : null);
|
|
321
444
|
}
|
|
322
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
323
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.
|
|
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 });
|
|
324
447
|
}
|
|
325
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
448
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ɵAerisAppendTo, decorators: [{
|
|
326
449
|
type: Directive,
|
|
327
450
|
args: [{ selector: '[aerisInternalAppendTo]' }]
|
|
328
|
-
}], 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 }] }], aerisInternalAppendToOutside: [{ type: i0.Output, args: ["aerisInternalAppendToOutside"] }] } });
|
|
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"] }] } });
|
|
329
452
|
function elementRefNativeElement(value) {
|
|
330
453
|
if ('nativeElement' in value)
|
|
331
454
|
return value.nativeElement;
|
|
@@ -637,7 +760,7 @@ function aerisInternalCreateFrameScheduler(callback) {
|
|
|
637
760
|
};
|
|
638
761
|
}
|
|
639
762
|
|
|
640
|
-
const AERIS_UI_VERSION = '22.0.0-alpha.
|
|
763
|
+
const AERIS_UI_VERSION = '22.0.0-alpha.5';
|
|
641
764
|
|
|
642
765
|
/**
|
|
643
766
|
* Generated bundle index. Do not edit.
|