@educarehq/solaris-ui 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, PLATFORM_ID, Injectable, Pipe, Directive, signal, DestroyRef, DOCUMENT, input, computed, ChangeDetectionStrategy, Component, output, ElementRef, EnvironmentInjector, effect, createComponent, HostListener, contentChild, contentChildren, NgZone, TemplateRef, ViewContainerRef, Injector, viewChild, isDevMode, forwardRef, ChangeDetectorRef, booleanAttribute, numberAttribute, afterNextRender, viewChildren, ApplicationRef, model } from '@angular/core';
3
- import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT as DOCUMENT$1 } from '@angular/common';
4
- import { FormControlDirective, FormControlName, NgModel, NG_VALUE_ACCESSOR, NgControl, FormsModule } from '@angular/forms';
2
+ import { InjectionToken, inject, PLATFORM_ID, Injectable, Pipe, Directive, signal, DestroyRef, DOCUMENT, input, computed, ChangeDetectionStrategy, Component, output, ElementRef, EnvironmentInjector, effect, createComponent, HostListener, model, TemplateRef, ViewContainerRef, contentChild, forwardRef, ViewChild, ViewEncapsulation, contentChildren, NgZone, Injector, viewChild, isDevMode, ChangeDetectorRef, booleanAttribute, numberAttribute, afterNextRender, viewChildren, ApplicationRef } from '@angular/core';
3
+ import { isPlatformBrowser, DOCUMENT as DOCUMENT$1, NgTemplateOutlet } from '@angular/common';
5
4
  import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
6
- import { ComponentPortal } from '@angular/cdk/portal';
5
+ import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
6
+ import { FormControlDirective, FormControlName, NgModel, NG_VALUE_ACCESSOR, NgControl, FormsModule } from '@angular/forms';
7
7
  import { DomSanitizer } from '@angular/platform-browser';
8
8
  import { getCountries, getCountryCallingCode, Metadata, AsYouType, parsePhoneNumberFromString, getExampleNumber } from 'libphonenumber-js';
9
9
  import * as FLAG_3X2 from 'country-flag-icons/string/3x2';
@@ -78,6 +78,8 @@ const SOLARIS_TRANSLATE_DEFAULT_CONFIG = {
78
78
  'solaris.toast.continue': 'click to continue',
79
79
  'solaris.toast.expand': 'Expand',
80
80
  'solaris.toast.collapse': 'Collapse',
81
+ 'solaris.menuToggle.open': 'Open menu',
82
+ 'solaris.menuToggle.close': 'Close menu',
81
83
  'solaris.dialog.close': 'Close',
82
84
  'solaris.dialog.confirm': 'Confirm',
83
85
  'solaris.dialog.cancel': 'Cancel',
@@ -2398,6 +2400,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
2398
2400
  args: [{ selector: 'solaris-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (definition(); as icon) {\n <svg\n width=\"100%\"\n height=\"100%\"\n [attr.viewBox]=\"icon.viewBox\"\n [attr.fill]=\"icon.fill ?? 'none'\"\n [attr.stroke]=\"resolvedStroke()\"\n [attr.stroke-width]=\"resolvedStrokeWidth()\"\n [attr.stroke-linecap]=\"icon.strokeLinecap ?? 'round'\"\n [attr.stroke-linejoin]=\"icon.strokeLinejoin ?? 'round'\"\n [attr.aria-hidden]=\"isHidden() ? 'true' : null\"\n [attr.aria-label]=\"hasSemanticLabel() ? accessibleLabel() : null\"\n [attr.role]=\"isHidden() ? 'presentation' : 'img'\"\n >\n @for (element of icon.elements; track $index) {\n @switch (element.type) {\n @case ('path') {\n <path\n [attr.d]=\"element.d\"\n [attr.fill]=\"element.fill ?? null\"\n [attr.stroke]=\"element.stroke ?? null\"\n [attr.stroke-width]=\"element.strokeWidth ?? null\"\n [attr.stroke-linecap]=\"element.strokeLinecap ?? null\"\n [attr.stroke-linejoin]=\"element.strokeLinejoin ?? null\"\n />\n }\n @case ('line') {\n <line\n [attr.x1]=\"element.x1\"\n [attr.y1]=\"element.y1\"\n [attr.x2]=\"element.x2\"\n [attr.y2]=\"element.y2\"\n [attr.fill]=\"element.fill ?? null\"\n [attr.stroke]=\"element.stroke ?? null\"\n [attr.stroke-width]=\"element.strokeWidth ?? null\"\n [attr.stroke-linecap]=\"element.strokeLinecap ?? null\"\n [attr.stroke-linejoin]=\"element.strokeLinejoin ?? null\"\n />\n }\n @case ('polyline') {\n <polyline\n [attr.points]=\"element.points\"\n [attr.fill]=\"element.fill ?? null\"\n [attr.stroke]=\"element.stroke ?? null\"\n [attr.stroke-width]=\"element.strokeWidth ?? null\"\n [attr.stroke-linecap]=\"element.strokeLinecap ?? null\"\n [attr.stroke-linejoin]=\"element.strokeLinejoin ?? null\"\n />\n }\n @case ('polygon') {\n <polygon\n [attr.points]=\"element.points\"\n [attr.fill]=\"element.fill ?? null\"\n [attr.stroke]=\"element.stroke ?? null\"\n [attr.stroke-width]=\"element.strokeWidth ?? null\"\n [attr.stroke-linecap]=\"element.strokeLinecap ?? null\"\n [attr.stroke-linejoin]=\"element.strokeLinejoin ?? null\"\n />\n }\n @case ('circle') {\n <circle\n [attr.cx]=\"element.cx\"\n [attr.cy]=\"element.cy\"\n [attr.r]=\"element.r\"\n [attr.fill]=\"element.fill ?? null\"\n [attr.stroke]=\"element.stroke ?? null\"\n [attr.stroke-width]=\"element.strokeWidth ?? null\"\n [attr.stroke-linecap]=\"element.strokeLinecap ?? null\"\n [attr.stroke-linejoin]=\"element.strokeLinejoin ?? null\"\n />\n }\n @case ('rect') {\n <rect\n [attr.x]=\"element.x\"\n [attr.y]=\"element.y\"\n [attr.width]=\"element.width\"\n [attr.height]=\"element.height\"\n [attr.rx]=\"element.rx\"\n [attr.ry]=\"element.ry\"\n [attr.fill]=\"element.fill ?? null\"\n [attr.stroke]=\"element.stroke ?? null\"\n [attr.stroke-width]=\"element.strokeWidth ?? null\"\n [attr.stroke-linecap]=\"element.strokeLinecap ?? null\"\n [attr.stroke-linejoin]=\"element.strokeLinejoin ?? null\"\n />\n }\n }\n }\n </svg>\n}\n", styles: [":host{width:1em;height:1em;align-items:center;display:inline-flex;justify-content:center}:host svg{width:100%;height:100%}\n"] }]
2399
2401
  }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], decorative: [{ type: i0.Input, args: [{ isSignal: true, alias: "decorative", required: false }] }], inheritColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "inheritColor", required: false }] }] } });
2400
2402
 
2403
+ class SolarisAnimatedIconComponent {
2404
+ name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
2405
+ active = input(false, ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
2406
+ ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
2407
+ decorative = input(false, ...(ngDevMode ? [{ debugName: "decorative" }] : /* istanbul ignore next */ []));
2408
+ isHidden = computed(() => this.decorative(), ...(ngDevMode ? [{ debugName: "isHidden" }] : /* istanbul ignore next */ []));
2409
+ accessibleLabel = computed(() => this.ariaLabel() ?? '', ...(ngDevMode ? [{ debugName: "accessibleLabel" }] : /* istanbul ignore next */ []));
2410
+ hasSemanticLabel = computed(() => !this.decorative() && !!this.ariaLabel(), ...(ngDevMode ? [{ debugName: "hasSemanticLabel" }] : /* istanbul ignore next */ []));
2411
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisAnimatedIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2412
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisAnimatedIconComponent, isStandalone: true, selector: "solaris-animated-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, decorative: { classPropertyName: "decorative", publicName: "decorative", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-active": "active() ? \"\" : null" } }, ngImport: i0, template: "<svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n [attr.aria-hidden]=\"isHidden() ? 'true' : null\"\n [attr.aria-label]=\"hasSemanticLabel() ? accessibleLabel() : null\"\n [attr.role]=\"isHidden() ? 'presentation' : 'img'\"\n>\n @switch (name()) {\n @case ('menu') {\n <path\n class=\"solaris-animated-icon__line solaris-animated-icon__line--top\"\n d=\"M2 8h20\"\n />\n <path\n class=\"solaris-animated-icon__line solaris-animated-icon__line--bottom\"\n d=\"M2 16h20\"\n />\n }\n }\n</svg>\n", styles: [":host{width:1em;height:1em;align-items:center;display:inline-flex;justify-content:center}svg{width:100%;height:100%}.solaris-animated-icon__line{transform-box:view-box;transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-animated-icon__line--top{transform-origin:50% 33.333%}.solaris-animated-icon__line--bottom{transform-origin:50% 66.667%}:host([data-active]) .solaris-animated-icon__line--top{transform:translateY(16.667%) rotate(45deg)}:host([data-active]) .solaris-animated-icon__line--bottom{transform:translateY(-16.667%) rotate(-45deg)}@media(prefers-reduced-motion:reduce){.solaris-animated-icon__line{transition:none}}:host-context([data-reduced-motion=true]) .solaris-animated-icon__line{transition:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2413
+ }
2414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisAnimatedIconComponent, decorators: [{
2415
+ type: Component,
2416
+ args: [{ selector: 'solaris-animated-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
2417
+ '[attr.data-active]': 'active() ? "" : null',
2418
+ }, template: "<svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n [attr.aria-hidden]=\"isHidden() ? 'true' : null\"\n [attr.aria-label]=\"hasSemanticLabel() ? accessibleLabel() : null\"\n [attr.role]=\"isHidden() ? 'presentation' : 'img'\"\n>\n @switch (name()) {\n @case ('menu') {\n <path\n class=\"solaris-animated-icon__line solaris-animated-icon__line--top\"\n d=\"M2 8h20\"\n />\n <path\n class=\"solaris-animated-icon__line solaris-animated-icon__line--bottom\"\n d=\"M2 16h20\"\n />\n }\n }\n</svg>\n", styles: [":host{width:1em;height:1em;align-items:center;display:inline-flex;justify-content:center}svg{width:100%;height:100%}.solaris-animated-icon__line{transform-box:view-box;transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-animated-icon__line--top{transform-origin:50% 33.333%}.solaris-animated-icon__line--bottom{transform-origin:50% 66.667%}:host([data-active]) .solaris-animated-icon__line--top{transform:translateY(16.667%) rotate(45deg)}:host([data-active]) .solaris-animated-icon__line--bottom{transform:translateY(-16.667%) rotate(-45deg)}@media(prefers-reduced-motion:reduce){.solaris-animated-icon__line{transition:none}}:host-context([data-reduced-motion=true]) .solaris-animated-icon__line{transition:none}\n"] }]
2419
+ }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], decorative: [{ type: i0.Input, args: [{ isSignal: true, alias: "decorative", required: false }] }] } });
2420
+
2401
2421
  class SolarisBadgeComponent {
2402
2422
  appearance = input('tonal', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
2403
2423
  variant = input('standard', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
@@ -3133,6 +3153,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
3133
3153
  }]
3134
3154
  }] });
3135
3155
 
3156
+ // SECURITY_EXCEPTION_FILE: ElementRef.nativeElement reads the host button's disabled and loading state before toggling.
3157
+ class SolarisMenuToggleDirective {
3158
+ elementRef = inject(ElementRef);
3159
+ translateService = inject(SolarisTranslateService, {
3160
+ optional: true,
3161
+ });
3162
+ open = model(false, { ...(ngDevMode ? { debugName: "open" } : /* istanbul ignore next */ {}), alias: 'solarisMenuToggleOpen' });
3163
+ controls = input(undefined, { ...(ngDevMode ? { debugName: "controls" } : /* istanbul ignore next */ {}), alias: 'solarisMenuToggleControls' });
3164
+ openLabel = input(undefined, { ...(ngDevMode ? { debugName: "openLabel" } : /* istanbul ignore next */ {}), alias: 'solarisMenuToggleOpenLabel' });
3165
+ closeLabel = input(undefined, { ...(ngDevMode ? { debugName: "closeLabel" } : /* istanbul ignore next */ {}), alias: 'solarisMenuToggleCloseLabel' });
3166
+ resolvedAriaLabel = computed(() => {
3167
+ const label = this.open() ? this.closeLabel() : this.openLabel();
3168
+ if (label) {
3169
+ return label;
3170
+ }
3171
+ const key = this.open()
3172
+ ? 'solaris.menuToggle.close'
3173
+ : 'solaris.menuToggle.open';
3174
+ const fallback = this.open() ? 'Close menu' : 'Open menu';
3175
+ const translated = this.translateService?.translate(key);
3176
+ return translated && translated !== key ? translated : fallback;
3177
+ }, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
3178
+ toggle() {
3179
+ const button = this.elementRef.nativeElement;
3180
+ if (button.disabled ||
3181
+ button.getAttribute('aria-disabled') === 'true' ||
3182
+ button.hasAttribute('data-loading')) {
3183
+ return;
3184
+ }
3185
+ this.open.update((open) => !open);
3186
+ }
3187
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMenuToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3188
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.17", type: SolarisMenuToggleDirective, isStandalone: true, selector: "button[solaris-icon-button][solaris-menu-toggle]", inputs: { open: { classPropertyName: "open", publicName: "solarisMenuToggleOpen", isSignal: true, isRequired: false, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "solarisMenuToggleControls", isSignal: true, isRequired: false, transformFunction: null }, openLabel: { classPropertyName: "openLabel", publicName: "solarisMenuToggleOpenLabel", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "solarisMenuToggleCloseLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "solarisMenuToggleOpenChange" }, host: { listeners: { "click": "toggle()" }, properties: { "attr.data-state": "open() ? \"open\" : \"closed\"", "attr.aria-expanded": "open() ? \"true\" : \"false\"", "attr.aria-controls": "controls() ?? null", "attr.aria-label": "resolvedAriaLabel()" } }, ngImport: i0 });
3189
+ }
3190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMenuToggleDirective, decorators: [{
3191
+ type: Directive,
3192
+ args: [{
3193
+ selector: 'button[solaris-icon-button][solaris-menu-toggle]',
3194
+ standalone: true,
3195
+ host: {
3196
+ '[attr.data-state]': 'open() ? "open" : "closed"',
3197
+ '[attr.aria-expanded]': 'open() ? "true" : "false"',
3198
+ '[attr.aria-controls]': 'controls() ?? null',
3199
+ '[attr.aria-label]': 'resolvedAriaLabel()',
3200
+ },
3201
+ }]
3202
+ }], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisMenuToggleOpen", required: false }] }, { type: i0.Output, args: ["solarisMenuToggleOpenChange"] }], controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisMenuToggleControls", required: false }] }], openLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisMenuToggleOpenLabel", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "solarisMenuToggleCloseLabel", required: false }] }], toggle: [{
3203
+ type: HostListener,
3204
+ args: ['click']
3205
+ }] } });
3206
+
3136
3207
  class SolarisButtonGroupComponent {
3137
3208
  orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
3138
3209
  attached = input(true, ...(ngDevMode ? [{ debugName: "attached" }] : /* istanbul ignore next */ []));
@@ -3175,6 +3246,585 @@ function resolveElementId(ref, prefix) {
3175
3246
  return existingId || nextIdFor(prefix);
3176
3247
  }
3177
3248
 
3249
+ class SolarisMegaMenuPanelDirective {
3250
+ templateRef = inject((TemplateRef));
3251
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3252
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: SolarisMegaMenuPanelDirective, isStandalone: true, selector: "ng-template[solaris-mega-menu-panel]", exportAs: ["solarisMegaMenuPanel"], ngImport: i0 });
3253
+ }
3254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuPanelDirective, decorators: [{
3255
+ type: Directive,
3256
+ args: [{
3257
+ selector: 'ng-template[solaris-mega-menu-panel]',
3258
+ standalone: true,
3259
+ exportAs: 'solarisMegaMenuPanel',
3260
+ }]
3261
+ }] });
3262
+
3263
+ const getMegaMenuPanelWidth = (panelWidth, anchor, trigger, viewportWidth) => {
3264
+ switch (panelWidth) {
3265
+ case 'trigger':
3266
+ return trigger.getBoundingClientRect().width;
3267
+ case 'anchor':
3268
+ return anchor.getBoundingClientRect().width;
3269
+ case 'viewport':
3270
+ return viewportWidth;
3271
+ }
3272
+ };
3273
+
3274
+ const SOLARIS_MEGA_MENU = new InjectionToken('SOLARIS_MEGA_MENU');
3275
+ const SOLARIS_MEGA_MENU_GROUP = new InjectionToken('SOLARIS_MEGA_MENU_GROUP');
3276
+ const SOLARIS_MEGA_MENU_ANCHOR = new InjectionToken('SOLARIS_MEGA_MENU_ANCHOR');
3277
+
3278
+ // SECURITY_EXCEPTION_FILE: ElementRef and injected DOCUMENT support focus restoration, overlay geometry, and browser-only event listeners. Angular bindings cannot express these imperative DOM APIs; component specs cover open, close, focus, and viewport behavior.
3279
+ const MEGA_MENU_ANCHOR_ERROR = 'SolarisMegaMenuComponent requires an ancestor with the [solaris-mega-menu-anchor] directive. The anchor defines the menu panel position and width, and the interactive area excluded from the backdrop. Add solaris-mega-menu-anchor to the navigation container that wraps this mega menu.';
3280
+ class SolarisMegaMenuComponent {
3281
+ overlay = inject(Overlay);
3282
+ viewContainerRef = inject(ViewContainerRef);
3283
+ hostElement = inject(ElementRef);
3284
+ platformId = inject(PLATFORM_ID);
3285
+ destroyRef = inject(DestroyRef);
3286
+ document = inject(DOCUMENT$1);
3287
+ group = inject(SOLARIS_MEGA_MENU_GROUP, { optional: true });
3288
+ anchorControl = inject(SOLARIS_MEGA_MENU_ANCHOR, { optional: true });
3289
+ overlayPanel;
3290
+ panel = contentChild(SolarisMegaMenuPanelDirective, ...(ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []));
3291
+ openState = model(false, { ...(ngDevMode ? { debugName: "openState" } : /* istanbul ignore next */ {}), alias: 'open' });
3292
+ panelWidth = input('viewport', ...(ngDevMode ? [{ debugName: "panelWidth" }] : /* istanbul ignore next */ []));
3293
+ appearance = input('underline', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
3294
+ backdrop = input(false, ...(ngDevMode ? [{ debugName: "backdrop" }] : /* istanbul ignore next */ []));
3295
+ persistentOnClick = input(false, ...(ngDevMode ? [{ debugName: "persistentOnClick" }] : /* istanbul ignore next */ []));
3296
+ hoverOpenDelay = input(120, ...(ngDevMode ? [{ debugName: "hoverOpenDelay" }] : /* istanbul ignore next */ []));
3297
+ hoverCloseDelay = input(160, ...(ngDevMode ? [{ debugName: "hoverCloseDelay" }] : /* istanbul ignore next */ []));
3298
+ opened = output();
3299
+ closed = output();
3300
+ panelId = nextIdFor('solaris-mega-menu-panel');
3301
+ isOpen = computed(() => this.openState(), ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
3302
+ isPinned = signal(false, ...(ngDevMode ? [{ debugName: "isPinned" }] : /* istanbul ignore next */ []));
3303
+ overlayRef = null;
3304
+ scheduledOpen = null;
3305
+ scheduledClose = null;
3306
+ outsideClickCleanup = null;
3307
+ resizeObserver = null;
3308
+ viewportResizeCleanup = null;
3309
+ backdropClickCleanup = null;
3310
+ backdropRegions = [];
3311
+ anchorUnderline = null;
3312
+ constructor() {
3313
+ if (!this.anchorControl) {
3314
+ throw new Error(MEGA_MENU_ANCHOR_ERROR);
3315
+ }
3316
+ effect(() => {
3317
+ if (!isPlatformBrowser(this.platformId)) {
3318
+ return;
3319
+ }
3320
+ if (this.openState()) {
3321
+ this.attachPanel();
3322
+ }
3323
+ else {
3324
+ this.detachPanel();
3325
+ }
3326
+ });
3327
+ effect(() => {
3328
+ this.appearance();
3329
+ if (this.isOpen()) {
3330
+ this.syncAnchorUnderline();
3331
+ }
3332
+ });
3333
+ this.destroyRef.onDestroy(() => {
3334
+ this.clearTimers();
3335
+ this.removeOutsideClickHandler();
3336
+ this.stopGeometryObserver();
3337
+ this.clearBackdrop();
3338
+ this.clearAnchorUnderline();
3339
+ this.overlayRef?.dispose();
3340
+ });
3341
+ }
3342
+ open() {
3343
+ if (this.isOpen()) {
3344
+ return;
3345
+ }
3346
+ this.clearTimers();
3347
+ this.group?.open(this);
3348
+ this.openState.set(true);
3349
+ }
3350
+ close(restoreFocus = false) {
3351
+ if (!this.isOpen()) {
3352
+ return;
3353
+ }
3354
+ this.clearTimers();
3355
+ this.isPinned.set(false);
3356
+ this.openState.set(false);
3357
+ this.group?.close(this);
3358
+ if (restoreFocus) {
3359
+ this.hostElement.nativeElement
3360
+ .querySelector('[solaris-mega-menu-trigger]')
3361
+ ?.focus();
3362
+ }
3363
+ }
3364
+ toggleFromClick() {
3365
+ if (this.persistentOnClick()) {
3366
+ if (this.isOpen() && this.isPinned()) {
3367
+ this.close();
3368
+ return;
3369
+ }
3370
+ this.open();
3371
+ this.isPinned.set(true);
3372
+ return;
3373
+ }
3374
+ if (this.isOpen()) {
3375
+ this.close();
3376
+ }
3377
+ else {
3378
+ this.open();
3379
+ }
3380
+ }
3381
+ scheduleOpen() {
3382
+ this.clearCloseTimer();
3383
+ if (this.isOpen() || this.scheduledOpen) {
3384
+ return;
3385
+ }
3386
+ this.scheduledOpen = setTimeout(() => {
3387
+ this.scheduledOpen = null;
3388
+ this.open();
3389
+ }, this.hoverOpenDelay());
3390
+ }
3391
+ scheduleClose() {
3392
+ this.clearOpenTimer();
3393
+ if (!this.isOpen() || this.isPinned() || this.scheduledClose) {
3394
+ return;
3395
+ }
3396
+ this.scheduledClose = setTimeout(() => {
3397
+ this.scheduledClose = null;
3398
+ this.close();
3399
+ }, this.hoverCloseDelay());
3400
+ }
3401
+ cancelScheduledClose() {
3402
+ this.clearCloseTimer();
3403
+ }
3404
+ onPanelPointerEnter() {
3405
+ this.cancelScheduledClose();
3406
+ }
3407
+ onPanelPointerLeave() {
3408
+ this.scheduleClose();
3409
+ }
3410
+ onPanelFocusOut() {
3411
+ queueMicrotask(() => {
3412
+ const activeElement = this.hostElement.nativeElement.ownerDocument.activeElement;
3413
+ const trigger = this.hostElement.nativeElement.querySelector('[solaris-mega-menu-trigger]');
3414
+ const panel = this.overlayRef?.overlayElement;
3415
+ if (!trigger?.contains(activeElement) &&
3416
+ !panel?.contains(activeElement)) {
3417
+ this.close();
3418
+ }
3419
+ });
3420
+ }
3421
+ onPanelEscape(event) {
3422
+ event.preventDefault();
3423
+ this.close(true);
3424
+ }
3425
+ attachPanel() {
3426
+ const panel = this.panel();
3427
+ if (!panel || this.overlayRef?.hasAttached()) {
3428
+ return;
3429
+ }
3430
+ this.overlayRef ??= this.createOverlay();
3431
+ this.overlayRef.attach(new TemplatePortal(this.overlayPanel, this.viewContainerRef));
3432
+ this.updatePanelGeometry();
3433
+ this.startGeometryObserver();
3434
+ this.setupBackdrop();
3435
+ if (!this.backdrop()) {
3436
+ this.addOutsideClickHandler();
3437
+ }
3438
+ this.opened.emit();
3439
+ }
3440
+ detachPanel() {
3441
+ if (!this.overlayRef?.hasAttached()) {
3442
+ return;
3443
+ }
3444
+ this.clearBackdrop();
3445
+ const backdrop = this.overlayRef.backdropElement;
3446
+ this.overlayRef.detachBackdrop();
3447
+ backdrop?.remove();
3448
+ this.overlayRef.detach();
3449
+ this.overlayRef.dispose();
3450
+ this.overlayRef = null;
3451
+ this.removeOutsideClickHandler();
3452
+ this.stopGeometryObserver();
3453
+ this.clearAnchorUnderline();
3454
+ this.closed.emit();
3455
+ }
3456
+ createOverlay() {
3457
+ const positionStrategy = this.createPositionStrategy();
3458
+ const config = new OverlayConfig({
3459
+ backdropClass: 'solaris-mega-menu-backdrop',
3460
+ hasBackdrop: this.backdrop(),
3461
+ positionStrategy,
3462
+ scrollStrategy: this.backdrop()
3463
+ ? this.overlay.scrollStrategies.block()
3464
+ : this.overlay.scrollStrategies.reposition(),
3465
+ });
3466
+ const overlayRef = this.overlay.create(config);
3467
+ positionStrategy.positionChanges.subscribe(({ connectionPair }) => {
3468
+ const panel = overlayRef.overlayElement.querySelector('.solaris-mega-menu__panel');
3469
+ if (connectionPair.originY === 'top') {
3470
+ panel?.style.setProperty('--solaris-mega-menu-shadow', 'none');
3471
+ }
3472
+ else {
3473
+ panel?.style.removeProperty('--solaris-mega-menu-shadow');
3474
+ }
3475
+ });
3476
+ overlayRef.keydownEvents().subscribe((event) => {
3477
+ if (event.key === 'Escape') {
3478
+ this.close(true);
3479
+ }
3480
+ });
3481
+ return overlayRef;
3482
+ }
3483
+ addOutsideClickHandler() {
3484
+ this.removeOutsideClickHandler();
3485
+ const onPointerDown = (event) => {
3486
+ const target = event.target;
3487
+ const trigger = this.hostElement.nativeElement.querySelector('[solaris-mega-menu-trigger]');
3488
+ if (!target ||
3489
+ trigger?.contains(target) ||
3490
+ this.overlayRef?.overlayElement.contains(target)) {
3491
+ return;
3492
+ }
3493
+ this.close();
3494
+ };
3495
+ this.document.addEventListener('pointerdown', onPointerDown, true);
3496
+ this.outsideClickCleanup = () => {
3497
+ this.document.removeEventListener('pointerdown', onPointerDown, true);
3498
+ };
3499
+ }
3500
+ removeOutsideClickHandler() {
3501
+ this.outsideClickCleanup?.();
3502
+ this.outsideClickCleanup = null;
3503
+ }
3504
+ createPositionStrategy() {
3505
+ return this.overlay
3506
+ .position()
3507
+ .flexibleConnectedTo(this.anchor.element)
3508
+ .withPositions([
3509
+ {
3510
+ originX: 'start',
3511
+ originY: 'bottom',
3512
+ overlayX: 'start',
3513
+ overlayY: 'top',
3514
+ },
3515
+ {
3516
+ originX: 'start',
3517
+ originY: 'top',
3518
+ overlayX: 'start',
3519
+ overlayY: 'bottom',
3520
+ },
3521
+ ])
3522
+ .withFlexibleDimensions(false)
3523
+ .withPush(true);
3524
+ }
3525
+ get anchor() {
3526
+ if (!this.anchorControl) {
3527
+ throw new Error(MEGA_MENU_ANCHOR_ERROR);
3528
+ }
3529
+ return this.anchorControl;
3530
+ }
3531
+ updatePanelGeometry() {
3532
+ if (!this.overlayRef) {
3533
+ return;
3534
+ }
3535
+ this.overlayRef.updateSize({
3536
+ width: getMegaMenuPanelWidth(this.panelWidth(), this.anchor.element, this.getTrigger(), this.hostElement.nativeElement.ownerDocument.defaultView?.innerWidth ??
3537
+ 0),
3538
+ });
3539
+ this.overlayRef.updatePosition();
3540
+ this.updateBackdropGeometry();
3541
+ this.syncAnchorUnderline();
3542
+ }
3543
+ syncAnchorUnderline() {
3544
+ const anchor = this.anchor.element;
3545
+ if (!this.isOpen() || this.appearance() !== 'underline') {
3546
+ this.clearAnchorUnderline();
3547
+ return;
3548
+ }
3549
+ const anchorRect = anchor.getBoundingClientRect();
3550
+ const triggerRect = this.getTrigger().getBoundingClientRect();
3551
+ this.anchorUnderline ??= this.createAnchorUnderline(anchor);
3552
+ this.anchorUnderline.style.left = `${triggerRect.left - anchorRect.left}px`;
3553
+ this.anchorUnderline.style.width = `${triggerRect.width}px`;
3554
+ }
3555
+ clearAnchorUnderline() {
3556
+ this.anchorUnderline?.remove();
3557
+ this.anchorUnderline = null;
3558
+ }
3559
+ createAnchorUnderline(anchor) {
3560
+ const underline = this.document.createElement('span');
3561
+ underline.className = 'solaris-mega-menu-anchor__underline';
3562
+ anchor.appendChild(underline);
3563
+ return underline;
3564
+ }
3565
+ setupBackdrop() {
3566
+ const backdrop = this.overlayRef?.backdropElement;
3567
+ if (!backdrop) {
3568
+ return;
3569
+ }
3570
+ this.backdropRegions = ['top', 'left', 'right', 'bottom'].map((position) => {
3571
+ const region = this.document.createElement('span');
3572
+ region.className = `solaris-mega-menu-backdrop__region solaris-mega-menu-backdrop__region--${position}`;
3573
+ backdrop.appendChild(region);
3574
+ return region;
3575
+ });
3576
+ const subscription = this.overlayRef?.backdropClick().subscribe(() => {
3577
+ this.close();
3578
+ });
3579
+ this.backdropClickCleanup = () => subscription?.unsubscribe();
3580
+ this.updateBackdropGeometry();
3581
+ }
3582
+ clearBackdrop() {
3583
+ this.backdropClickCleanup?.();
3584
+ this.backdropClickCleanup = null;
3585
+ this.backdropRegions.forEach((region) => region.remove());
3586
+ this.backdropRegions = [];
3587
+ }
3588
+ updateBackdropGeometry() {
3589
+ const backdrop = this.overlayRef?.backdropElement;
3590
+ if (!backdrop || this.backdropRegions.length !== 4) {
3591
+ return;
3592
+ }
3593
+ const backdropRect = backdrop.getBoundingClientRect();
3594
+ const viewport = this.document.defaultView;
3595
+ const width = backdropRect.width || viewport?.innerWidth || 0;
3596
+ const height = backdropRect.height || viewport?.innerHeight || 0;
3597
+ const anchorRect = this.anchor.element.getBoundingClientRect();
3598
+ const inset = 1;
3599
+ const top = Math.max(0, Math.floor(anchorRect.top - backdropRect.top) - inset);
3600
+ const right = Math.min(width, Math.ceil(anchorRect.right - backdropRect.left) + inset);
3601
+ const bottom = Math.min(height, Math.ceil(anchorRect.bottom - backdropRect.top) + inset);
3602
+ const left = Math.max(0, Math.floor(anchorRect.left - backdropRect.left) - inset);
3603
+ const [topRegion, leftRegion, rightRegion, bottomRegion] = this.backdropRegions;
3604
+ topRegion.style.height = `${top}px`;
3605
+ leftRegion.style.top = `${top}px`;
3606
+ leftRegion.style.height = `${bottom - top}px`;
3607
+ leftRegion.style.width = `${left}px`;
3608
+ rightRegion.style.top = `${top}px`;
3609
+ rightRegion.style.height = `${bottom - top}px`;
3610
+ rightRegion.style.width = `${width - right}px`;
3611
+ bottomRegion.style.top = `${bottom}px`;
3612
+ }
3613
+ startGeometryObserver() {
3614
+ const anchor = this.anchor.element;
3615
+ const trigger = this.getTrigger();
3616
+ const updateGeometry = () => this.updatePanelGeometry();
3617
+ if (typeof ResizeObserver !== 'undefined') {
3618
+ this.resizeObserver?.disconnect();
3619
+ this.resizeObserver = new ResizeObserver(updateGeometry);
3620
+ this.resizeObserver.observe(anchor);
3621
+ this.resizeObserver.observe(trigger);
3622
+ }
3623
+ const viewport = this.hostElement.nativeElement.ownerDocument.defaultView;
3624
+ viewport?.addEventListener('resize', updateGeometry);
3625
+ this.viewportResizeCleanup = () => {
3626
+ viewport?.removeEventListener('resize', updateGeometry);
3627
+ };
3628
+ }
3629
+ stopGeometryObserver() {
3630
+ this.resizeObserver?.disconnect();
3631
+ this.resizeObserver = null;
3632
+ this.viewportResizeCleanup?.();
3633
+ this.viewportResizeCleanup = null;
3634
+ }
3635
+ getTrigger() {
3636
+ return (this.hostElement.nativeElement.querySelector('[solaris-mega-menu-trigger]') ?? this.hostElement.nativeElement);
3637
+ }
3638
+ clearTimers() {
3639
+ this.clearOpenTimer();
3640
+ this.clearCloseTimer();
3641
+ }
3642
+ clearOpenTimer() {
3643
+ if (this.scheduledOpen) {
3644
+ clearTimeout(this.scheduledOpen);
3645
+ this.scheduledOpen = null;
3646
+ }
3647
+ }
3648
+ clearCloseTimer() {
3649
+ if (this.scheduledClose) {
3650
+ clearTimeout(this.scheduledClose);
3651
+ this.scheduledClose = null;
3652
+ }
3653
+ }
3654
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3655
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.17", type: SolarisMegaMenuComponent, isStandalone: true, selector: "solaris-mega-menu", inputs: { openState: { classPropertyName: "openState", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, persistentOnClick: { classPropertyName: "persistentOnClick", publicName: "persistentOnClick", isSignal: true, isRequired: false, transformFunction: null }, hoverOpenDelay: { classPropertyName: "hoverOpenDelay", publicName: "hoverOpenDelay", isSignal: true, isRequired: false, transformFunction: null }, hoverCloseDelay: { classPropertyName: "hoverCloseDelay", publicName: "hoverCloseDelay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openState: "openChange", opened: "opened", closed: "closed" }, host: { properties: { "attr.data-open": "isOpen() ? \"\" : null" }, classAttribute: "solaris-mega-menu" }, providers: [
3656
+ {
3657
+ provide: SOLARIS_MEGA_MENU,
3658
+ useExisting: forwardRef(() => SolarisMegaMenuComponent),
3659
+ },
3660
+ ], queries: [{ propertyName: "panel", first: true, predicate: SolarisMegaMenuPanelDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "overlayPanel", first: true, predicate: ["overlayPanel"], descendants: true, static: true }], ngImport: i0, template: "<ng-content select=\"[solaris-mega-menu-trigger]\" />\n<ng-content select=\"ng-template[solaris-mega-menu-panel]\" />\n\n<ng-template #overlayPanel>\n <section\n class=\"solaris-mega-menu__panel\"\n [id]=\"panelId\"\n tabindex=\"-1\"\n (pointerenter)=\"onPanelPointerEnter()\"\n (pointerleave)=\"onPanelPointerLeave()\"\n (focusout)=\"onPanelFocusOut()\"\n (keydown.escape)=\"onPanelEscape($event)\"\n >\n <ng-container *ngTemplateOutlet=\"panel()?.templateRef\" />\n </section>\n</ng-template>\n", styles: ["solaris-mega-menu{display:inline-block}[solaris-mega-menu-trigger]{display:inline-flex;align-items:center;gap:var(--solaris-spacing-2);transition:color var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard)}.solaris-mega-menu-trigger__chevron{flex:0 0 auto;order:1;margin-inline-start:auto;transition:transform var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard)}[solaris-mega-menu-trigger][data-open] .solaris-mega-menu-trigger__chevron{transform:rotate(180deg)}[solaris-mega-menu-trigger][data-appearance=underline]{border-bottom:2px solid transparent}[solaris-mega-menu-trigger][data-appearance=underline][data-open]{border-bottom-color:transparent}[solaris-mega-menu-anchor]{position:relative}.solaris-mega-menu-anchor__underline{position:absolute;z-index:var(--solaris-z-index-raised);bottom:1px;height:2px;background:var(--solaris-primary-base);pointer-events:none;transition:left var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard),width var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard)}[solaris-mega-menu-trigger][data-appearance=underline]:hover,[solaris-mega-menu-trigger][data-appearance=underline]:focus-visible{background:transparent}[solaris-mega-menu-trigger][data-appearance=text]{color:var(--solaris-text-muted)}[solaris-mega-menu-trigger][data-appearance=text][data-open]{color:var(--solaris-text-strong)}.solaris-mega-menu__panel{--solaris-mega-menu-background: var(--solaris-surface-raised);--solaris-mega-menu-color: var(--solaris-text-default);--solaris-mega-menu-shadow: var(--solaris-shadow-lg);box-sizing:border-box;width:100%;color:var(--solaris-mega-menu-color);background:var(--solaris-mega-menu-background);box-shadow:var(--solaris-mega-menu-shadow);animation:solaris-mega-menu-enter var(--solaris-motion-duration-fast) var(--solaris-motion-easing-decelerate)}.cdk-overlay-backdrop.solaris-mega-menu-backdrop{background:transparent;pointer-events:none}.solaris-mega-menu-backdrop__region{display:block;position:absolute;background:var(--solaris-backdrop);pointer-events:auto}.solaris-mega-menu-backdrop__region--top,.solaris-mega-menu-backdrop__region--bottom{right:0;left:0}.solaris-mega-menu-backdrop__region--top{top:0}.solaris-mega-menu-backdrop__region--bottom{bottom:0}.solaris-mega-menu-backdrop__region--left{left:0}.solaris-mega-menu-backdrop__region--right{right:0}@keyframes solaris-mega-menu-enter{0%{opacity:0;transform:translateY(calc(-1 * var(--solaris-spacing-1)))}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){[solaris-mega-menu-trigger],.solaris-mega-menu-anchor__underline,.solaris-mega-menu-trigger__chevron,.solaris-mega-menu__panel{animation:none;transition:none}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None });
3661
+ }
3662
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuComponent, decorators: [{
3663
+ type: Component,
3664
+ args: [{ selector: 'solaris-mega-menu', standalone: true, encapsulation: ViewEncapsulation.None, imports: [NgTemplateOutlet], providers: [
3665
+ {
3666
+ provide: SOLARIS_MEGA_MENU,
3667
+ useExisting: forwardRef(() => SolarisMegaMenuComponent),
3668
+ },
3669
+ ], host: {
3670
+ class: 'solaris-mega-menu',
3671
+ '[attr.data-open]': 'isOpen() ? "" : null',
3672
+ }, template: "<ng-content select=\"[solaris-mega-menu-trigger]\" />\n<ng-content select=\"ng-template[solaris-mega-menu-panel]\" />\n\n<ng-template #overlayPanel>\n <section\n class=\"solaris-mega-menu__panel\"\n [id]=\"panelId\"\n tabindex=\"-1\"\n (pointerenter)=\"onPanelPointerEnter()\"\n (pointerleave)=\"onPanelPointerLeave()\"\n (focusout)=\"onPanelFocusOut()\"\n (keydown.escape)=\"onPanelEscape($event)\"\n >\n <ng-container *ngTemplateOutlet=\"panel()?.templateRef\" />\n </section>\n</ng-template>\n", styles: ["solaris-mega-menu{display:inline-block}[solaris-mega-menu-trigger]{display:inline-flex;align-items:center;gap:var(--solaris-spacing-2);transition:color var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard)}.solaris-mega-menu-trigger__chevron{flex:0 0 auto;order:1;margin-inline-start:auto;transition:transform var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard)}[solaris-mega-menu-trigger][data-open] .solaris-mega-menu-trigger__chevron{transform:rotate(180deg)}[solaris-mega-menu-trigger][data-appearance=underline]{border-bottom:2px solid transparent}[solaris-mega-menu-trigger][data-appearance=underline][data-open]{border-bottom-color:transparent}[solaris-mega-menu-anchor]{position:relative}.solaris-mega-menu-anchor__underline{position:absolute;z-index:var(--solaris-z-index-raised);bottom:1px;height:2px;background:var(--solaris-primary-base);pointer-events:none;transition:left var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard),width var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard)}[solaris-mega-menu-trigger][data-appearance=underline]:hover,[solaris-mega-menu-trigger][data-appearance=underline]:focus-visible{background:transparent}[solaris-mega-menu-trigger][data-appearance=text]{color:var(--solaris-text-muted)}[solaris-mega-menu-trigger][data-appearance=text][data-open]{color:var(--solaris-text-strong)}.solaris-mega-menu__panel{--solaris-mega-menu-background: var(--solaris-surface-raised);--solaris-mega-menu-color: var(--solaris-text-default);--solaris-mega-menu-shadow: var(--solaris-shadow-lg);box-sizing:border-box;width:100%;color:var(--solaris-mega-menu-color);background:var(--solaris-mega-menu-background);box-shadow:var(--solaris-mega-menu-shadow);animation:solaris-mega-menu-enter var(--solaris-motion-duration-fast) var(--solaris-motion-easing-decelerate)}.cdk-overlay-backdrop.solaris-mega-menu-backdrop{background:transparent;pointer-events:none}.solaris-mega-menu-backdrop__region{display:block;position:absolute;background:var(--solaris-backdrop);pointer-events:auto}.solaris-mega-menu-backdrop__region--top,.solaris-mega-menu-backdrop__region--bottom{right:0;left:0}.solaris-mega-menu-backdrop__region--top{top:0}.solaris-mega-menu-backdrop__region--bottom{bottom:0}.solaris-mega-menu-backdrop__region--left{left:0}.solaris-mega-menu-backdrop__region--right{right:0}@keyframes solaris-mega-menu-enter{0%{opacity:0;transform:translateY(calc(-1 * var(--solaris-spacing-1)))}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){[solaris-mega-menu-trigger],.solaris-mega-menu-anchor__underline,.solaris-mega-menu-trigger__chevron,.solaris-mega-menu__panel{animation:none;transition:none}}\n"] }]
3673
+ }], ctorParameters: () => [], propDecorators: { overlayPanel: [{
3674
+ type: ViewChild,
3675
+ args: ['overlayPanel', { static: true }]
3676
+ }], panel: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SolarisMegaMenuPanelDirective), { isSignal: true }] }], openState: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], panelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelWidth", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], persistentOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistentOnClick", required: false }] }], hoverOpenDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverOpenDelay", required: false }] }], hoverCloseDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverCloseDelay", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
3677
+
3678
+ // SECURITY_EXCEPTION_FILE: The CDK connected overlay requires the anchor HTMLElement as its positioning origin. Exposing the injected host avoids document lookup; mega-menu component specs cover anchored positioning.
3679
+ class SolarisMegaMenuAnchorDirective {
3680
+ elementRef = inject(ElementRef);
3681
+ get element() {
3682
+ return this.elementRef.nativeElement;
3683
+ }
3684
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuAnchorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3685
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: SolarisMegaMenuAnchorDirective, isStandalone: true, selector: "[solaris-mega-menu-anchor]", providers: [
3686
+ {
3687
+ provide: SOLARIS_MEGA_MENU_ANCHOR,
3688
+ useExisting: SolarisMegaMenuAnchorDirective,
3689
+ },
3690
+ ], ngImport: i0 });
3691
+ }
3692
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuAnchorDirective, decorators: [{
3693
+ type: Directive,
3694
+ args: [{
3695
+ selector: '[solaris-mega-menu-anchor]',
3696
+ standalone: true,
3697
+ providers: [
3698
+ {
3699
+ provide: SOLARIS_MEGA_MENU_ANCHOR,
3700
+ useExisting: SolarisMegaMenuAnchorDirective,
3701
+ },
3702
+ ],
3703
+ }]
3704
+ }] });
3705
+
3706
+ class SolarisMegaMenuGroupDirective {
3707
+ activeMenu = null;
3708
+ open(menu) {
3709
+ if (this.activeMenu && this.activeMenu !== menu) {
3710
+ this.activeMenu.close(false);
3711
+ }
3712
+ this.activeMenu = menu;
3713
+ }
3714
+ close(menu) {
3715
+ if (this.activeMenu === menu) {
3716
+ this.activeMenu = null;
3717
+ }
3718
+ }
3719
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3720
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: SolarisMegaMenuGroupDirective, isStandalone: true, selector: "[solaris-mega-menu-group]", providers: [
3721
+ {
3722
+ provide: SOLARIS_MEGA_MENU_GROUP,
3723
+ useExisting: SolarisMegaMenuGroupDirective,
3724
+ },
3725
+ ], ngImport: i0 });
3726
+ }
3727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuGroupDirective, decorators: [{
3728
+ type: Directive,
3729
+ args: [{
3730
+ selector: '[solaris-mega-menu-group]',
3731
+ standalone: true,
3732
+ providers: [
3733
+ {
3734
+ provide: SOLARIS_MEGA_MENU_GROUP,
3735
+ useExisting: SolarisMegaMenuGroupDirective,
3736
+ },
3737
+ ],
3738
+ }]
3739
+ }] });
3740
+
3741
+ // SECURITY_EXCEPTION_FILE: Native host access sets the semantic button type and appends the decorative chevron component. Host bindings cannot set a missing attribute conditionally; directive specs cover trigger semantics and interaction.
3742
+ class SolarisMegaMenuTriggerDirective {
3743
+ megaMenu = inject(SOLARIS_MEGA_MENU);
3744
+ elementRef = inject(ElementRef);
3745
+ environmentInjector = inject(EnvironmentInjector);
3746
+ platformId = inject(PLATFORM_ID);
3747
+ destroyRef = inject(DestroyRef);
3748
+ chevronRef = null;
3749
+ constructor() {
3750
+ if (this.elementRef.nativeElement.getAttribute('type') === null) {
3751
+ this.elementRef.nativeElement.setAttribute('type', 'button');
3752
+ }
3753
+ this.attachChevron();
3754
+ this.destroyRef.onDestroy(() => this.chevronRef?.destroy());
3755
+ }
3756
+ onClick() {
3757
+ this.megaMenu.toggleFromClick();
3758
+ }
3759
+ onPointerEnter() {
3760
+ this.megaMenu.scheduleOpen();
3761
+ }
3762
+ onPointerLeave() {
3763
+ this.megaMenu.scheduleClose();
3764
+ }
3765
+ onFocusIn() {
3766
+ this.megaMenu.open();
3767
+ }
3768
+ onArrowDown(event) {
3769
+ event.preventDefault();
3770
+ this.megaMenu.open();
3771
+ }
3772
+ onEscape(event) {
3773
+ event.preventDefault();
3774
+ this.megaMenu.close(true);
3775
+ }
3776
+ attachChevron() {
3777
+ if (!isPlatformBrowser(this.platformId)) {
3778
+ return;
3779
+ }
3780
+ const chevronRef = createComponent(SolarisIconComponent, {
3781
+ environmentInjector: this.environmentInjector,
3782
+ });
3783
+ chevronRef.setInput('name', 'chevron-down');
3784
+ chevronRef.setInput('decorative', true);
3785
+ chevronRef.changeDetectorRef.detectChanges();
3786
+ const chevronElement = chevronRef.location.nativeElement;
3787
+ chevronElement.classList.add('solaris-mega-menu-trigger__chevron');
3788
+ this.elementRef.nativeElement.appendChild(chevronElement);
3789
+ this.chevronRef = chevronRef;
3790
+ }
3791
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3792
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: SolarisMegaMenuTriggerDirective, isStandalone: true, selector: "button[solaris-mega-menu-trigger]", host: { listeners: { "click": "onClick()", "pointerenter": "onPointerEnter()", "pointerleave": "onPointerLeave()", "focusin": "onFocusIn()", "keydown.arrowdown": "onArrowDown($event)", "keydown.escape": "onEscape($event)" }, properties: { "attr.aria-controls": "megaMenu.panelId", "attr.aria-expanded": "megaMenu.isOpen() ? \"true\" : \"false\"", "attr.aria-haspopup": "\"true\"", "attr.data-open": "megaMenu.isOpen() ? \"\" : null", "attr.data-appearance": "megaMenu.appearance()" }, classAttribute: "solaris-mega-menu-trigger" }, ngImport: i0 });
3793
+ }
3794
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisMegaMenuTriggerDirective, decorators: [{
3795
+ type: Directive,
3796
+ args: [{
3797
+ selector: 'button[solaris-mega-menu-trigger]',
3798
+ standalone: true,
3799
+ host: {
3800
+ '[attr.aria-controls]': 'megaMenu.panelId',
3801
+ '[attr.aria-expanded]': 'megaMenu.isOpen() ? "true" : "false"',
3802
+ '[attr.aria-haspopup]': '"true"',
3803
+ '[attr.data-open]': 'megaMenu.isOpen() ? "" : null',
3804
+ '[attr.data-appearance]': 'megaMenu.appearance()',
3805
+ class: 'solaris-mega-menu-trigger',
3806
+ },
3807
+ }]
3808
+ }], ctorParameters: () => [], propDecorators: { onClick: [{
3809
+ type: HostListener,
3810
+ args: ['click']
3811
+ }], onPointerEnter: [{
3812
+ type: HostListener,
3813
+ args: ['pointerenter']
3814
+ }], onPointerLeave: [{
3815
+ type: HostListener,
3816
+ args: ['pointerleave']
3817
+ }], onFocusIn: [{
3818
+ type: HostListener,
3819
+ args: ['focusin']
3820
+ }], onArrowDown: [{
3821
+ type: HostListener,
3822
+ args: ['keydown.arrowdown', ['$event']]
3823
+ }], onEscape: [{
3824
+ type: HostListener,
3825
+ args: ['keydown.escape', ['$event']]
3826
+ }] } });
3827
+
3178
3828
  class SolarisOptionLeadingDirective {
3179
3829
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisOptionLeadingDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3180
3830
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: SolarisOptionLeadingDirective, isStandalone: true, selector: "[solaris-option-leading]", ngImport: i0 });
@@ -15227,5 +15877,5 @@ function provideSolaris(config) {
15227
15877
  * Generated bundle index. Do not edit.
15228
15878
  */
15229
15879
 
15230
- export { SOLARIS_ACCESSIBILITY_CONFIG, SOLARIS_BUILT_IN_ICONS, SOLARIS_DIALOG_CONFIG, SOLARIS_DIALOG_DATA, SOLARIS_DIALOG_REF, SOLARIS_ICONS_CONFIG, SOLARIS_SEGMENTED_CONTROL, SOLARIS_STEPPER, SOLARIS_TABS, SOLARIS_THEME_CONFIG, SOLARIS_TOAST_CONFIG, SOLARIS_TRANSLATE_CONFIG, SolarisAccessibilityService, SolarisAccordionComponent, SolarisAlertActionsComponent, SolarisAlertComponent, SolarisAlertDescriptionDirective, SolarisAlertTitleDirective, SolarisBadgeComponent, SolarisBadgeIconDirective, SolarisBreadcrumbComponent, SolarisButtonDirective, SolarisButtonGroupComponent, SolarisButtonIconDirective, SolarisCardActionsDirective, SolarisCardComponent, SolarisCardContentDirective, SolarisCardDescriptionDirective, SolarisCardFooterDirective, SolarisCardHeaderDirective, SolarisCardMediaDirective, SolarisCardTitleDirective, SolarisCheckboxComponent, SolarisCheckboxGroupComponent, SolarisCollapsibleComponent, SolarisDialogActionsComponent, SolarisDialogComponent, SolarisDialogContainerComponent, SolarisDialogContentComponent, SolarisDialogFlowComponent, SolarisDialogHeaderComponent, SolarisDialogRef, SolarisDialogService, SolarisDialogStepComponent, SolarisDividerComponent, SolarisDividerStackComponent, SolarisDropdownMenuComponent, SolarisDropdownMenuGroupComponent, SolarisDropdownMenuItemComponent, SolarisDropdownMenuLabelComponent, SolarisDropdownMenuTriggerDirective, SolarisDropdownSubmenuComponent, SolarisDropdownSubmenuTriggerComponent, SolarisEditableTabComponent, SolarisEditableTabsComponent, SolarisEmailFieldComponent, SolarisFormErrorComponent, SolarisFormFieldComponent, SolarisFormHintComponent, SolarisFormLabelActionDirective, SolarisFormLabelComponent, SolarisFormPrefixDirective, SolarisFormSuffixDirective, SolarisIconButtonBadgeDirective, SolarisIconButtonDirective, SolarisIconComponent, SolarisIconRegistryService, SolarisInputDirective, SolarisLoadingTextComponent, SolarisMultiSelectComponent, SolarisOptionComponent, SolarisOptionDescriptionDirective, SolarisOptionGroupComponent, SolarisOptionLabelDirective, SolarisOptionLeadingDirective, SolarisOptionMetaDirective, SolarisOptionTrailingDirective, SolarisOtpInputComponent, SolarisPasswordFieldComponent, SolarisPhoneCountryListComponent, SolarisPhoneFieldComponent, SolarisPopoverDirective, SolarisPopoverPanelComponent, SolarisPopoverTriggerDirective, SolarisProgressComponent, SolarisRadioComponent, SolarisRadioGroupComponent, SolarisSegmentedControlComponent, SolarisSegmentedItemComponent, SolarisSelectComponent, SolarisSkeletonComponent, SolarisSpinnerComponent, SolarisStepComponent, SolarisStepperActionsComponent, SolarisStepperComponent, SolarisStepperContentComponent, SolarisSwitchComponent, SolarisSwitchGroupComponent, SolarisTabComponent, SolarisTabPanelComponent, SolarisTabsComponent, SolarisTextareaDirective, SolarisThemeService, SolarisToastComponent, SolarisToastContainerComponent, SolarisToastService, SolarisTooltipDirective, SolarisTooltipPanelComponent, SolarisTranslatePipe, SolarisTranslateService, SolarisVisuallyHiddenDirective, configureSolarisTesting, nextIdFor, provideSolaris, provideSolarisAccessibilityTesting, provideSolarisTesting, provideSolarisThemeTesting, provideSolarisTranslateTesting, resolveElementId, solarisAllowedDomainsValidator, solarisBlockedDomainsValidator, solarisEmailValidator, solarisOtpValidator, solarisPasswordValidator, solarisPhoneValidator };
15880
+ export { SOLARIS_ACCESSIBILITY_CONFIG, SOLARIS_BUILT_IN_ICONS, SOLARIS_DIALOG_CONFIG, SOLARIS_DIALOG_DATA, SOLARIS_DIALOG_REF, SOLARIS_ICONS_CONFIG, SOLARIS_SEGMENTED_CONTROL, SOLARIS_STEPPER, SOLARIS_TABS, SOLARIS_THEME_CONFIG, SOLARIS_TOAST_CONFIG, SOLARIS_TRANSLATE_CONFIG, SolarisAccessibilityService, SolarisAccordionComponent, SolarisAlertActionsComponent, SolarisAlertComponent, SolarisAlertDescriptionDirective, SolarisAlertTitleDirective, SolarisAnimatedIconComponent, SolarisBadgeComponent, SolarisBadgeIconDirective, SolarisBreadcrumbComponent, SolarisButtonDirective, SolarisButtonGroupComponent, SolarisButtonIconDirective, SolarisCardActionsDirective, SolarisCardComponent, SolarisCardContentDirective, SolarisCardDescriptionDirective, SolarisCardFooterDirective, SolarisCardHeaderDirective, SolarisCardMediaDirective, SolarisCardTitleDirective, SolarisCheckboxComponent, SolarisCheckboxGroupComponent, SolarisCollapsibleComponent, SolarisDialogActionsComponent, SolarisDialogComponent, SolarisDialogContainerComponent, SolarisDialogContentComponent, SolarisDialogFlowComponent, SolarisDialogHeaderComponent, SolarisDialogRef, SolarisDialogService, SolarisDialogStepComponent, SolarisDividerComponent, SolarisDividerStackComponent, SolarisDropdownMenuComponent, SolarisDropdownMenuGroupComponent, SolarisDropdownMenuItemComponent, SolarisDropdownMenuLabelComponent, SolarisDropdownMenuTriggerDirective, SolarisDropdownSubmenuComponent, SolarisDropdownSubmenuTriggerComponent, SolarisEditableTabComponent, SolarisEditableTabsComponent, SolarisEmailFieldComponent, SolarisFormErrorComponent, SolarisFormFieldComponent, SolarisFormHintComponent, SolarisFormLabelActionDirective, SolarisFormLabelComponent, SolarisFormPrefixDirective, SolarisFormSuffixDirective, SolarisIconButtonBadgeDirective, SolarisIconButtonDirective, SolarisIconComponent, SolarisIconRegistryService, SolarisInputDirective, SolarisLoadingTextComponent, SolarisMegaMenuAnchorDirective, SolarisMegaMenuComponent, SolarisMegaMenuGroupDirective, SolarisMegaMenuPanelDirective, SolarisMegaMenuTriggerDirective, SolarisMenuToggleDirective, SolarisMultiSelectComponent, SolarisOptionComponent, SolarisOptionDescriptionDirective, SolarisOptionGroupComponent, SolarisOptionLabelDirective, SolarisOptionLeadingDirective, SolarisOptionMetaDirective, SolarisOptionTrailingDirective, SolarisOtpInputComponent, SolarisPasswordFieldComponent, SolarisPhoneCountryListComponent, SolarisPhoneFieldComponent, SolarisPopoverDirective, SolarisPopoverPanelComponent, SolarisPopoverTriggerDirective, SolarisProgressComponent, SolarisRadioComponent, SolarisRadioGroupComponent, SolarisSegmentedControlComponent, SolarisSegmentedItemComponent, SolarisSelectComponent, SolarisSkeletonComponent, SolarisSpinnerComponent, SolarisStepComponent, SolarisStepperActionsComponent, SolarisStepperComponent, SolarisStepperContentComponent, SolarisSwitchComponent, SolarisSwitchGroupComponent, SolarisTabComponent, SolarisTabPanelComponent, SolarisTabsComponent, SolarisTextareaDirective, SolarisThemeService, SolarisToastComponent, SolarisToastContainerComponent, SolarisToastService, SolarisTooltipDirective, SolarisTooltipPanelComponent, SolarisTranslatePipe, SolarisTranslateService, SolarisVisuallyHiddenDirective, configureSolarisTesting, nextIdFor, provideSolaris, provideSolarisAccessibilityTesting, provideSolarisTesting, provideSolarisThemeTesting, provideSolarisTranslateTesting, resolveElementId, solarisAllowedDomainsValidator, solarisBlockedDomainsValidator, solarisEmailValidator, solarisOtpValidator, solarisPasswordValidator, solarisPhoneValidator };
15231
15881
  //# sourceMappingURL=educarehq-solaris-ui.mjs.map