@educarehq/solaris-components 0.2.2 → 0.2.4
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.
|
@@ -1,14 +1,377 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { inject, ElementRef, Renderer2, Directive, TemplateRef, Injectable, ViewContainerRef, DestroyRef, Input, ContentChild, ViewEncapsulation, Component, EventEmitter, Output, HostBinding, ChangeDetectionStrategy, signal, ContentChildren, HostListener, Optional, viewChild, input, booleanAttribute, numberAttribute, computed, afterNextRender, effect, InjectionToken, forwardRef, ViewChild, Injector } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
5
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
6
|
+
import { fromEvent, merge } from 'rxjs';
|
|
7
|
+
import { filter } from 'rxjs/operators';
|
|
3
8
|
import { CdkMenu, CdkMenuItem, CdkMenuTrigger } from '@angular/cdk/menu';
|
|
4
9
|
import { RouterLink } from '@angular/router';
|
|
5
10
|
import { NgClass, NgTemplateOutlet, NgStyle } from '@angular/common';
|
|
6
11
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgForm, FormGroupDirective, NgControl } from '@angular/forms';
|
|
7
12
|
import { getCountries, getCountryCallingCode, parsePhoneNumberFromString, AsYouType } from 'libphonenumber-js';
|
|
8
13
|
import intlTelInput from 'intl-tel-input';
|
|
9
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
10
14
|
import { SolarisTranslationPipe } from '@educarehq/solaris-services';
|
|
11
|
-
|
|
15
|
+
|
|
16
|
+
class SolarisDropdownContentTriggerDirective {
|
|
17
|
+
elementRef = inject((ElementRef));
|
|
18
|
+
solarisRenderer = inject(Renderer2);
|
|
19
|
+
ensureFocusable() {
|
|
20
|
+
const solarisEl = this.elementRef.nativeElement;
|
|
21
|
+
const solarisTag = solarisEl.tagName.toLowerCase();
|
|
22
|
+
const solarisIsNaturallyFocusable = solarisTag === 'button' || solarisTag === 'a' ||
|
|
23
|
+
solarisEl.hasAttribute('tabindex');
|
|
24
|
+
if (!solarisIsNaturallyFocusable) {
|
|
25
|
+
this.solarisRenderer.setAttribute(solarisEl, 'tabindex', '0');
|
|
26
|
+
this.solarisRenderer.setAttribute(solarisEl, 'role', 'button');
|
|
27
|
+
}
|
|
28
|
+
this.solarisRenderer.setAttribute(solarisEl, 'aria-haspopup', 'true');
|
|
29
|
+
}
|
|
30
|
+
setExpanded(isExpanded, panelId) {
|
|
31
|
+
const solarisEl = this.elementRef.nativeElement;
|
|
32
|
+
this.solarisRenderer.setAttribute(solarisEl, 'aria-expanded', String(isExpanded));
|
|
33
|
+
this.solarisRenderer.setAttribute(solarisEl, 'aria-controls', panelId);
|
|
34
|
+
}
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDropdownContentTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
36
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisDropdownContentTriggerDirective, isStandalone: true, selector: "[solaris-dropdown-content-trigger]", ngImport: i0 });
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDropdownContentTriggerDirective, decorators: [{
|
|
39
|
+
type: Directive,
|
|
40
|
+
args: [{
|
|
41
|
+
selector: '[solaris-dropdown-content-trigger]',
|
|
42
|
+
standalone: true
|
|
43
|
+
}]
|
|
44
|
+
}] });
|
|
45
|
+
|
|
46
|
+
class SolarisDropdownContentPanelDirective {
|
|
47
|
+
templateRef = inject((TemplateRef));
|
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDropdownContentPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
49
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisDropdownContentPanelDirective, isStandalone: true, selector: "ng-template[solaris-dropdown-content-panel]", ngImport: i0 });
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDropdownContentPanelDirective, decorators: [{
|
|
52
|
+
type: Directive,
|
|
53
|
+
args: [{
|
|
54
|
+
selector: 'ng-template[solaris-dropdown-content-panel]',
|
|
55
|
+
standalone: true,
|
|
56
|
+
}]
|
|
57
|
+
}] });
|
|
58
|
+
|
|
59
|
+
class SolarisDropdownContentRegistry {
|
|
60
|
+
solarisInstances = new Set();
|
|
61
|
+
register(instance) {
|
|
62
|
+
this.solarisInstances.add(instance);
|
|
63
|
+
}
|
|
64
|
+
unregister(instance) {
|
|
65
|
+
this.solarisInstances.delete(instance);
|
|
66
|
+
}
|
|
67
|
+
notifyOpen(openingInstance) {
|
|
68
|
+
for (const solarisInstance of this.solarisInstances) {
|
|
69
|
+
if (solarisInstance !== openingInstance) {
|
|
70
|
+
solarisInstance.closeFromRegistry();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDropdownContentRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
75
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDropdownContentRegistry, providedIn: 'root' });
|
|
76
|
+
}
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDropdownContentRegistry, decorators: [{
|
|
78
|
+
type: Injectable,
|
|
79
|
+
args: [{ providedIn: 'root' }]
|
|
80
|
+
}] });
|
|
81
|
+
|
|
82
|
+
class SolarisDropdownContent {
|
|
83
|
+
solarisRegistry = inject(SolarisDropdownContentRegistry);
|
|
84
|
+
solarisVcr = inject(ViewContainerRef);
|
|
85
|
+
solarisDestroyRef = inject(DestroyRef);
|
|
86
|
+
solarisOverlay = inject(Overlay);
|
|
87
|
+
trigger;
|
|
88
|
+
panel;
|
|
89
|
+
container;
|
|
90
|
+
widthMode = 'auto';
|
|
91
|
+
maxWidth = '72rem';
|
|
92
|
+
closeDelay = 120;
|
|
93
|
+
openDelay = 60;
|
|
94
|
+
solarisPanelId = `solaris-dropdown-panel-${Math.random().toString(16).slice(2)}`;
|
|
95
|
+
solarisIsHoveringTrigger = false;
|
|
96
|
+
solarisPortal;
|
|
97
|
+
solarisIsHoveringPanel = false;
|
|
98
|
+
solarisOutsideClickSub;
|
|
99
|
+
solarisIsPinned = false;
|
|
100
|
+
solarisOverlayRef;
|
|
101
|
+
solarisIsOpen = false;
|
|
102
|
+
solarisCloseTimer;
|
|
103
|
+
solarisOpenTimer;
|
|
104
|
+
ngAfterContentInit() {
|
|
105
|
+
if (!this.trigger)
|
|
106
|
+
throw new Error('solaris-dropdown: missing [solaris-dropdown-trigger].');
|
|
107
|
+
if (!this.panel)
|
|
108
|
+
throw new Error('solaris-dropdown: missing <ng-template solaris-dropdown-content-panel>.');
|
|
109
|
+
this.solarisRegistry.register(this);
|
|
110
|
+
this.trigger.ensureFocusable();
|
|
111
|
+
this.trigger.setExpanded(false, this.solarisPanelId);
|
|
112
|
+
const solarisTriggerEl = this.trigger.elementRef.nativeElement;
|
|
113
|
+
fromEvent(solarisTriggerEl, 'mouseenter').pipe(takeUntilDestroyed(this.solarisDestroyRef))
|
|
114
|
+
.subscribe(() => this.solarisOnTriggerEnter());
|
|
115
|
+
fromEvent(solarisTriggerEl, 'mouseleave').pipe(takeUntilDestroyed(this.solarisDestroyRef))
|
|
116
|
+
.subscribe(() => this.solarisOnTriggerLeave());
|
|
117
|
+
fromEvent(solarisTriggerEl, 'click').pipe(takeUntilDestroyed(this.solarisDestroyRef))
|
|
118
|
+
.subscribe((solarisEvent) => {
|
|
119
|
+
solarisEvent.preventDefault();
|
|
120
|
+
this.solarisTogglePinned();
|
|
121
|
+
});
|
|
122
|
+
fromEvent(solarisTriggerEl, 'keydown').pipe(takeUntilDestroyed(this.solarisDestroyRef))
|
|
123
|
+
.subscribe((solarisEvent) => {
|
|
124
|
+
if (solarisEvent.key === 'Enter' || solarisEvent.key === ' ') {
|
|
125
|
+
solarisEvent.preventDefault();
|
|
126
|
+
this.solarisTogglePinned();
|
|
127
|
+
}
|
|
128
|
+
if (solarisEvent.key === 'Escape') {
|
|
129
|
+
solarisEvent.preventDefault();
|
|
130
|
+
this.close('escape');
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
ngOnDestroy() {
|
|
135
|
+
this.solarisRegistry.unregister(this);
|
|
136
|
+
this.solarisUnbindOutsideClick();
|
|
137
|
+
this.solarisOverlayRef?.dispose();
|
|
138
|
+
}
|
|
139
|
+
closeFromRegistry() {
|
|
140
|
+
this.close('registry');
|
|
141
|
+
}
|
|
142
|
+
solarisOnTriggerEnter() {
|
|
143
|
+
this.solarisIsHoveringTrigger = true;
|
|
144
|
+
if (this.solarisIsPinned)
|
|
145
|
+
return;
|
|
146
|
+
this.solarisScheduleOpen('hover');
|
|
147
|
+
}
|
|
148
|
+
solarisOnTriggerLeave() {
|
|
149
|
+
this.solarisIsHoveringTrigger = false;
|
|
150
|
+
if (this.solarisIsPinned)
|
|
151
|
+
return;
|
|
152
|
+
this.solarisScheduleClose();
|
|
153
|
+
}
|
|
154
|
+
solarisOnPanelEnter() {
|
|
155
|
+
this.solarisIsHoveringPanel = true;
|
|
156
|
+
if (this.solarisIsPinned)
|
|
157
|
+
return;
|
|
158
|
+
this.solarisClearCloseTimer();
|
|
159
|
+
}
|
|
160
|
+
solarisOnPanelLeave() {
|
|
161
|
+
this.solarisIsHoveringPanel = false;
|
|
162
|
+
if (this.solarisIsPinned)
|
|
163
|
+
return;
|
|
164
|
+
this.solarisScheduleClose();
|
|
165
|
+
}
|
|
166
|
+
solarisTogglePinned() {
|
|
167
|
+
if (!this.solarisIsOpen) {
|
|
168
|
+
this.solarisIsPinned = true;
|
|
169
|
+
this.open('pinned');
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (this.solarisIsPinned) {
|
|
173
|
+
this.close('toggle');
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
this.solarisIsPinned = true;
|
|
177
|
+
this.solarisBindOutsideClick();
|
|
178
|
+
}
|
|
179
|
+
solarisScheduleOpen(reason) {
|
|
180
|
+
this.solarisClearOpenTimer();
|
|
181
|
+
this.solarisOpenTimer = globalThis.setTimeout(() => this.open(reason), this.openDelay);
|
|
182
|
+
}
|
|
183
|
+
solarisScheduleClose() {
|
|
184
|
+
this.solarisClearCloseTimer();
|
|
185
|
+
this.solarisCloseTimer = globalThis.setTimeout(() => {
|
|
186
|
+
if (this.solarisIsPinned)
|
|
187
|
+
return;
|
|
188
|
+
if (this.solarisIsHoveringTrigger || this.solarisIsHoveringPanel)
|
|
189
|
+
return;
|
|
190
|
+
this.close('hover-leave');
|
|
191
|
+
}, this.closeDelay);
|
|
192
|
+
}
|
|
193
|
+
solarisClearOpenTimer() {
|
|
194
|
+
if (this.solarisOpenTimer)
|
|
195
|
+
globalThis.clearTimeout(this.solarisOpenTimer);
|
|
196
|
+
this.solarisOpenTimer = undefined;
|
|
197
|
+
}
|
|
198
|
+
solarisClearCloseTimer() {
|
|
199
|
+
if (this.solarisCloseTimer)
|
|
200
|
+
globalThis.clearTimeout(this.solarisCloseTimer);
|
|
201
|
+
this.solarisCloseTimer = undefined;
|
|
202
|
+
}
|
|
203
|
+
open(reason) {
|
|
204
|
+
if (!this.trigger || !this.panel)
|
|
205
|
+
return;
|
|
206
|
+
if (reason === 'hover')
|
|
207
|
+
this.solarisIsPinned = false;
|
|
208
|
+
this.solarisRegistry.notifyOpen(this);
|
|
209
|
+
const solarisTriggerEl = this.trigger.elementRef.nativeElement;
|
|
210
|
+
const solarisOriginRect = solarisTriggerEl.getBoundingClientRect();
|
|
211
|
+
const solarisContainerEl = this.solarisGetContainerEl();
|
|
212
|
+
const solarisContainerRect = solarisContainerEl?.getBoundingClientRect();
|
|
213
|
+
const solarisIsFull = this.widthMode === 'full';
|
|
214
|
+
const solarisViewportMargin = solarisIsFull ? 0 : 8;
|
|
215
|
+
const solarisOffsetX = this.solarisComputeOffsetX(solarisOriginRect, solarisContainerRect);
|
|
216
|
+
const solarisPositionStrategy = this.solarisOverlay
|
|
217
|
+
.position().flexibleConnectedTo(solarisTriggerEl)
|
|
218
|
+
.withFlexibleDimensions(false).withPush(!solarisIsFull)
|
|
219
|
+
.withViewportMargin(solarisViewportMargin).withDefaultOffsetX(solarisOffsetX)
|
|
220
|
+
.withDefaultOffsetY(8).withPositions([
|
|
221
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
|
|
222
|
+
{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },
|
|
223
|
+
]);
|
|
224
|
+
if (this.solarisOverlayRef) {
|
|
225
|
+
this.solarisOverlayRef.updatePositionStrategy(solarisPositionStrategy);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
this.solarisOverlayRef = this.solarisOverlay.create({
|
|
229
|
+
positionStrategy: solarisPositionStrategy,
|
|
230
|
+
scrollStrategy: this.solarisOverlay.scrollStrategies.reposition(),
|
|
231
|
+
panelClass: ['solaris-dropdown-content-overlay']
|
|
232
|
+
});
|
|
233
|
+
this.solarisOverlayRef.detachments().pipe(takeUntilDestroyed(this.solarisDestroyRef))
|
|
234
|
+
.subscribe(() => this.solarisResetState());
|
|
235
|
+
}
|
|
236
|
+
this.solarisApplyOverlaySize(solarisOriginRect, solarisContainerRect);
|
|
237
|
+
this.solarisPortal ??= new TemplatePortal(this.panel.templateRef, this.solarisVcr);
|
|
238
|
+
if (!this.solarisOverlayRef.hasAttached()) {
|
|
239
|
+
this.solarisOverlayRef.attach(this.solarisPortal);
|
|
240
|
+
this.solarisWirePanelEvents();
|
|
241
|
+
}
|
|
242
|
+
this.solarisIsOpen = true;
|
|
243
|
+
this.trigger.setExpanded(true, this.solarisPanelId);
|
|
244
|
+
if (this.solarisIsPinned) {
|
|
245
|
+
this.solarisBindOutsideClick();
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
this.solarisUnbindOutsideClick();
|
|
249
|
+
}
|
|
250
|
+
this.solarisClearCloseTimer();
|
|
251
|
+
}
|
|
252
|
+
close(reason) {
|
|
253
|
+
this.solarisClearOpenTimer();
|
|
254
|
+
this.solarisClearCloseTimer();
|
|
255
|
+
this.solarisIsPinned = false;
|
|
256
|
+
this.solarisUnbindOutsideClick();
|
|
257
|
+
if (this.solarisOverlayRef?.hasAttached()) {
|
|
258
|
+
this.solarisOverlayRef.detach();
|
|
259
|
+
}
|
|
260
|
+
this.solarisIsOpen = false;
|
|
261
|
+
this.trigger?.setExpanded(false, this.solarisPanelId);
|
|
262
|
+
}
|
|
263
|
+
solarisResetState() {
|
|
264
|
+
this.solarisIsOpen = false;
|
|
265
|
+
this.solarisIsPinned = false;
|
|
266
|
+
this.solarisIsHoveringPanel = false;
|
|
267
|
+
this.solarisIsHoveringTrigger = false;
|
|
268
|
+
this.solarisUnbindOutsideClick();
|
|
269
|
+
this.trigger?.setExpanded(false, this.solarisPanelId);
|
|
270
|
+
}
|
|
271
|
+
solarisWirePanelEvents() {
|
|
272
|
+
if (!this.solarisOverlayRef)
|
|
273
|
+
return;
|
|
274
|
+
const solarisPanelHost = this.solarisOverlayRef.overlayElement;
|
|
275
|
+
solarisPanelHost.id = this.solarisPanelId;
|
|
276
|
+
fromEvent(solarisPanelHost, 'mouseenter').pipe(takeUntilDestroyed(this.solarisDestroyRef))
|
|
277
|
+
.subscribe(() => this.solarisOnPanelEnter());
|
|
278
|
+
fromEvent(solarisPanelHost, 'mouseleave').pipe(takeUntilDestroyed(this.solarisDestroyRef))
|
|
279
|
+
.subscribe(() => this.solarisOnPanelLeave());
|
|
280
|
+
fromEvent(solarisPanelHost, 'keydown').pipe(takeUntilDestroyed(this.solarisDestroyRef))
|
|
281
|
+
.subscribe((solarisEvent) => {
|
|
282
|
+
if (solarisEvent.key === 'Escape') {
|
|
283
|
+
solarisEvent.preventDefault();
|
|
284
|
+
this.close('escape');
|
|
285
|
+
this.trigger?.elementRef.nativeElement.focus();
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
solarisBindOutsideClick() {
|
|
290
|
+
if (!this.solarisIsPinned)
|
|
291
|
+
return;
|
|
292
|
+
if (this.solarisOutsideClickSub)
|
|
293
|
+
return;
|
|
294
|
+
const solarisTriggerEl = this.trigger?.elementRef.nativeElement;
|
|
295
|
+
const solarisOverlayEl = this.solarisOverlayRef?.overlayElement;
|
|
296
|
+
if (!solarisTriggerEl || !solarisOverlayEl)
|
|
297
|
+
return;
|
|
298
|
+
this.solarisOutsideClickSub = fromEvent(document, 'mousedown')
|
|
299
|
+
.pipe(filter(() => this.solarisIsPinned), filter((solarisEvent) => {
|
|
300
|
+
const solarisTarget = solarisEvent.target;
|
|
301
|
+
if (!solarisTarget)
|
|
302
|
+
return false;
|
|
303
|
+
const solarisInsideTrigger = solarisTriggerEl.contains(solarisTarget);
|
|
304
|
+
const solarisInsidePanel = solarisOverlayEl.contains(solarisTarget);
|
|
305
|
+
return !solarisInsideTrigger && !solarisInsidePanel;
|
|
306
|
+
}), takeUntilDestroyed(this.solarisDestroyRef))
|
|
307
|
+
.subscribe(() => this.close('outside'));
|
|
308
|
+
}
|
|
309
|
+
solarisUnbindOutsideClick() {
|
|
310
|
+
this.solarisOutsideClickSub?.unsubscribe();
|
|
311
|
+
this.solarisOutsideClickSub = undefined;
|
|
312
|
+
}
|
|
313
|
+
solarisGetContainerEl() {
|
|
314
|
+
const solarisContainer = this.container;
|
|
315
|
+
if (!solarisContainer)
|
|
316
|
+
return undefined;
|
|
317
|
+
return solarisContainer instanceof ElementRef ? solarisContainer.nativeElement : solarisContainer;
|
|
318
|
+
}
|
|
319
|
+
solarisComputeOffsetX(solarisOriginRect, solarisContainerRect) {
|
|
320
|
+
if (this.widthMode === 'full') {
|
|
321
|
+
return -solarisOriginRect.left;
|
|
322
|
+
}
|
|
323
|
+
if (this.widthMode === 'container' && solarisContainerRect) {
|
|
324
|
+
return solarisContainerRect.left - solarisOriginRect.left;
|
|
325
|
+
}
|
|
326
|
+
return 0;
|
|
327
|
+
}
|
|
328
|
+
solarisApplyOverlaySize(solarisOriginRect, solarisContainerRect) {
|
|
329
|
+
if (!this.solarisOverlayRef)
|
|
330
|
+
return;
|
|
331
|
+
if (this.widthMode === 'match-trigger') {
|
|
332
|
+
this.solarisOverlayRef.updateSize({ width: solarisOriginRect.width });
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (this.widthMode === 'full') {
|
|
336
|
+
const solarisViewportWidth = document.documentElement.clientWidth;
|
|
337
|
+
this.solarisOverlayRef.updateSize({
|
|
338
|
+
width: solarisViewportWidth,
|
|
339
|
+
maxWidth: solarisViewportWidth
|
|
340
|
+
});
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (this.widthMode === 'container' && solarisContainerRect) {
|
|
344
|
+
this.solarisOverlayRef.updateSize({
|
|
345
|
+
width: solarisContainerRect.width,
|
|
346
|
+
maxWidth: solarisContainerRect.width,
|
|
347
|
+
});
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
this.solarisOverlayRef.updateSize({ maxWidth: this.maxWidth });
|
|
351
|
+
}
|
|
352
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDropdownContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
353
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.1", type: SolarisDropdownContent, isStandalone: true, selector: "solaris-dropdown-content", inputs: { container: "container", widthMode: "widthMode", maxWidth: "maxWidth", closeDelay: "closeDelay", openDelay: "openDelay" }, queries: [{ propertyName: "trigger", first: true, predicate: SolarisDropdownContentTriggerDirective, descendants: true }, { propertyName: "panel", first: true, predicate: SolarisDropdownContentPanelDirective, descendants: true }], ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: [".solaris-dropdown-content-overlay{width:100%;display:block;z-index:var(--solaris-z-dropdown);padding:var(--solaris-dropdown-content-padding, var(--solaris-space-6));box-shadow:var(--solaris-dropdown-content-shadow, var(--solaris-shadow-md));background:var(--solaris-dropdown-content-bg, var(--solaris-color-surface));border-radius:var(--solaris-dropdown-content-radius, var(--solaris-radius-lg));border:1px solid var(--solaris-dropdown-content-border, var(--solaris-color-border))}.solaris-dropdown-content-overlay:focus{outline:none}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
354
|
+
}
|
|
355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDropdownContent, decorators: [{
|
|
356
|
+
type: Component,
|
|
357
|
+
args: [{ selector: 'solaris-dropdown-content', standalone: true, imports: [], encapsulation: ViewEncapsulation.None, template: "<ng-content></ng-content>\r\n", styles: [".solaris-dropdown-content-overlay{width:100%;display:block;z-index:var(--solaris-z-dropdown);padding:var(--solaris-dropdown-content-padding, var(--solaris-space-6));box-shadow:var(--solaris-dropdown-content-shadow, var(--solaris-shadow-md));background:var(--solaris-dropdown-content-bg, var(--solaris-color-surface));border-radius:var(--solaris-dropdown-content-radius, var(--solaris-radius-lg));border:1px solid var(--solaris-dropdown-content-border, var(--solaris-color-border))}.solaris-dropdown-content-overlay:focus{outline:none}\n"] }]
|
|
358
|
+
}], propDecorators: { trigger: [{
|
|
359
|
+
type: ContentChild,
|
|
360
|
+
args: [SolarisDropdownContentTriggerDirective]
|
|
361
|
+
}], panel: [{
|
|
362
|
+
type: ContentChild,
|
|
363
|
+
args: [SolarisDropdownContentPanelDirective]
|
|
364
|
+
}], container: [{
|
|
365
|
+
type: Input
|
|
366
|
+
}], widthMode: [{
|
|
367
|
+
type: Input
|
|
368
|
+
}], maxWidth: [{
|
|
369
|
+
type: Input
|
|
370
|
+
}], closeDelay: [{
|
|
371
|
+
type: Input
|
|
372
|
+
}], openDelay: [{
|
|
373
|
+
type: Input
|
|
374
|
+
}] } });
|
|
12
375
|
|
|
13
376
|
class SolarisBreadcrumb {
|
|
14
377
|
minItems = 2;
|
|
@@ -290,7 +653,7 @@ class SolarisLoadingOverlay {
|
|
|
290
653
|
}
|
|
291
654
|
}
|
|
292
655
|
get overlayStyle() {
|
|
293
|
-
return this.zIndex
|
|
656
|
+
return this.zIndex == null ? null : { 'z-index': String(this.zIndex) };
|
|
294
657
|
}
|
|
295
658
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisLoadingOverlay, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
296
659
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisLoadingOverlay, isStandalone: true, selector: "solaris-loading-overlay", inputs: { zIndex: ["z-index", "zIndex"], backdrop: "backdrop", appearance: "appearance", blur: ["blur", "blur", coerceBoolean$1], open: ["open", "open", coerceBoolean$1], lockScroll: ["lock-scroll", "lockScroll", coerceBoolean$1] }, host: { properties: { "attr.solaris-loading-overlay": "this.marker" } }, usesOnChanges: true, ngImport: i0, template: "@if (open) {\r\n <div class=\"solaris-loading-overlay\" [class.backdrop-soft]=\"backdrop === 'soft'\"\r\n [class.backdrop-strong]=\"backdrop === 'strong'\" [class.is-blur]=\"blur\"\r\n [class.appearance-card]=\"appearance === 'card'\" [class.appearance-minimal]=\"appearance === 'minimal'\"\r\n [ngStyle]=\"overlayStyle\" role=\"presentation\">\r\n <div class=\"solaris-loading-overlay__backdrop\" aria-hidden=\"true\"></div>\r\n\r\n <div class=\"solaris-loading-overlay__content\" role=\"status\" aria-live=\"polite\" aria-busy=\"true\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n}\r\n", styles: [":host{display:contents}.solaris-loading-overlay{--solaris-overlay-z: var(--solaris-z-overlay, 2000);position:fixed;inset:0;z-index:var(--solaris-overlay-z);display:grid;place-items:center;pointer-events:auto}.solaris-loading-overlay__backdrop{position:absolute;inset:0;background:#00000059}.solaris-loading-overlay.backdrop-strong .solaris-loading-overlay__backdrop{background:#0000008c}.solaris-loading-overlay.is-blur .solaris-loading-overlay__backdrop{-webkit-backdrop-filter:blur(.8rem);backdrop-filter:blur(.8rem)}.solaris-loading-overlay__content{position:relative;z-index:1;display:grid;place-items:center;gap:var(--solaris-space-3);color:var(--solaris-color-text);outline:none}.solaris-loading-overlay.appearance-card .solaris-loading-overlay__content{min-width:18rem;max-width:min(42rem,100vw - 4rem);padding:var(--solaris-space-6);border-radius:var(--solaris-radius-md);border:1px solid color-mix(in srgb,var(--solaris-color-border) 70%,transparent);background:color-mix(in srgb,var(--solaris-color-surface) 88%,transparent);box-shadow:var(--solaris-shadow-md)}.solaris-loading-overlay.appearance-minimal .solaris-loading-overlay__content{padding:0;border:0;background:transparent;box-shadow:none}:host ::ng-deep [solaris-loading-overlay-text]{font-size:var(--solaris-fs-14);color:color-mix(in srgb,var(--solaris-color-text) 85%,transparent);text-align:center}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -662,13 +1025,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
662
1025
|
}]
|
|
663
1026
|
}] });
|
|
664
1027
|
|
|
665
|
-
class
|
|
1028
|
+
class SolarisPage {
|
|
666
1029
|
stickyHeader = false;
|
|
667
1030
|
container = 'contained';
|
|
668
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
669
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type:
|
|
1031
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1032
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisPage, isStandalone: true, selector: "solaris-page", inputs: { stickyHeader: "stickyHeader", container: "container" }, host: { classAttribute: "solaris-page-host" }, ngImport: i0, template: "<div class=\"solaris-page\" [ngClass]=\"['container-' + container]\">\r\n <header class=\"solaris-page__header\" [ngClass]=\"{ 'is-sticky': stickyHeader }\">\r\n <ng-content select=\"[solaris-header]\"></ng-content>\r\n @if (stickyHeader) { <solaris-divider class=\"solaris-page__header-divider\"/> }\r\n </header>\r\n\r\n <main class=\"solaris-page__body\">\r\n <ng-content select=\"[solaris-body]\"></ng-content>\r\n </main>\r\n\r\n <footer class=\"solaris-page__footer\">\r\n <solaris-divider class=\"solaris-page__footer-divider\"/>\r\n\r\n <div class=\"solaris-page__footer-content\">\r\n <ng-content select=\"[solaris-footer]\"></ng-content>\r\n </div>\r\n </footer>\r\n</div>\r\n", styles: [":host.solaris-page-host{display:block}.solaris-page{--solaris-page-gap: var(--solaris-space-8);--solaris-header-gap: var(--solaris-space-4);--solaris-footer-gap: var(--solaris-space-4);--solaris-page-padding-x: var(--solaris-space-8);--solaris-page-padding-y: var(--solaris-space-8);display:grid;min-height:100%;gap:var(--solaris-page-gap);color:var(--solaris-color-text);grid-template-rows:auto 1fr auto;padding:var(--solaris-page-padding-y) var(--solaris-page-padding-x)}.solaris-page.container-contained{margin-inline:auto}.solaris-page.container-fluid{max-width:none}.solaris-page__header{display:flex;flex-direction:column;gap:var(--solaris-header-gap)}.solaris-page__header.is-sticky{position:sticky;top:0;-webkit-backdrop-filter:blur(1rem);backdrop-filter:blur(1rem);z-index:var(--solaris-z-sticky, 100);padding:var(--solaris-page-padding-y) var(--solaris-page-padding-x) var(--solaris-space-4)}.solaris-page__body{min-width:0;display:flex;flex-direction:column;gap:var(--solaris-space-8)}.solaris-page__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--solaris-footer-gap);padding-top:var(--solaris-space-4)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: SolarisDivider, selector: "solaris-divider", inputs: ["label", "inset", "spacing", "variant", "strength", "orientation", "label-align"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
670
1033
|
}
|
|
671
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1034
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPage, decorators: [{
|
|
672
1035
|
type: Component,
|
|
673
1036
|
args: [{ selector: 'solaris-page', standalone: true, imports: [NgClass, SolarisDivider], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
674
1037
|
class: 'solaris-page-host',
|
|
@@ -1858,5 +2221,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
1858
2221
|
* Generated bundle index. Do not edit.
|
|
1859
2222
|
*/
|
|
1860
2223
|
|
|
1861
|
-
export { FieldErrorComponent, FormField, InputTextDirective, PasswordToggle, SOLARIS_FORM_FIELD_CONTROLLER, SOLARIS_FORM_FIELD_FEATURES, SOLARIS_INPUT, SolarisBadge, SolarisBodyDirective, SolarisBreadcrumb, SolarisButtonDirective, SolarisButtonGroupDirective, SolarisControlBridgeDirective, SolarisDivider, SolarisEmailDirective, SolarisFooterDirective, SolarisFormFieldController, SolarisHeaderDirective, SolarisImageSliderComponent, SolarisLoading, SolarisLoadingOverlay,
|
|
2224
|
+
export { FieldErrorComponent, FormField, InputTextDirective, PasswordToggle, SOLARIS_FORM_FIELD_CONTROLLER, SOLARIS_FORM_FIELD_FEATURES, SOLARIS_INPUT, SolarisBadge, SolarisBodyDirective, SolarisBreadcrumb, SolarisButtonDirective, SolarisButtonGroupDirective, SolarisControlBridgeDirective, SolarisDivider, SolarisDropdownContent, SolarisDropdownContentPanelDirective, SolarisDropdownContentRegistry, SolarisDropdownContentTriggerDirective, SolarisEmailDirective, SolarisFooterDirective, SolarisFormFieldController, SolarisHeaderDirective, SolarisImageSliderComponent, SolarisLoading, SolarisLoadingOverlay, SolarisPage, SolarisPageHeader, SolarisPageHeaderBreadcrumbDirective, SolarisPageHeaderDescriptionDirective, SolarisPageHeaderTitle, SolarisPageHeaderTitleDirective, SolarisPasswordDirective, SolarisPhoneInput, SolarisPrefixDirective, SolarisSectionComponent, SolarisSuffixDirective, SolarisTab, SolarisTabs };
|
|
1862
2225
|
//# sourceMappingURL=educarehq-solaris-components.mjs.map
|