@eui/components 18.0.0-rc.29 → 18.0.0-rc.30

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,7 +1,7 @@
1
1
  import * as i1$1 from '@angular/common';
2
- import { CommonModule, NgFor, NgIf, NgForOf, AsyncPipe, NgTemplateOutlet } from '@angular/common';
2
+ import { CommonModule, NgFor, NgIf, NgForOf, AsyncPipe, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Component, ChangeDetectionStrategy, ViewEncapsulation, Optional, HostBinding, HostListener, EventEmitter, booleanAttribute, Input, Output, ContentChildren, forwardRef, NgModule, Inject, ContentChild, Host, Directive, ViewChild } from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, ViewEncapsulation, Optional, HostBinding, HostListener, EventEmitter, booleanAttribute, Input, Output, ContentChildren, forwardRef, NgModule, Inject, ContentChild, Host, PLATFORM_ID, Directive, ViewChild } from '@angular/core';
5
5
  import * as i1$2 from '@angular/router';
6
6
  import { RouterModule, RouterLink } from '@angular/router';
7
7
  import { Subscription, Subject, fromEvent, startWith } from 'rxjs';
@@ -1210,10 +1210,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
1210
1210
  }] });
1211
1211
 
1212
1212
  class EuiAppComponent {
1213
- constructor(asService, euiGrowlService, cdRef) {
1213
+ constructor(asService, euiGrowlService, cdRef, platformId) {
1214
1214
  this.asService = asService;
1215
1215
  this.euiGrowlService = euiGrowlService;
1216
1216
  this.cdRef = cdRef;
1217
+ this.platformId = platformId;
1217
1218
  this.cssClasses = 'eui-app';
1218
1219
  this.appSubTitle = '';
1219
1220
  this.themeClass = '';
@@ -1230,20 +1231,22 @@ class EuiAppComponent {
1230
1231
  ngOnInit() {
1231
1232
  this.isViewLoaded = false;
1232
1233
  CssUtils.initCssVars();
1233
- const browserAgent = window.navigator.userAgent.toLowerCase();
1234
- this.asService.setState({
1235
- ...this.asService.state,
1236
- windowHeight: window.innerHeight,
1237
- windowWidth: window.innerWidth,
1238
- hasHeader: false,
1239
- hasSidebar: false,
1240
- deviceInfo: {
1241
- isChrome: browserAgent.indexOf('chrome') > -1,
1242
- isIE: browserAgent.indexOf('trident') > -1,
1243
- isFF: browserAgent.indexOf('firefox') > -1,
1244
- },
1245
- appBaseFontSize: this.asService.getBaseFontSize(),
1246
- });
1234
+ if (isPlatformBrowser(this.platformId)) {
1235
+ const browserAgent = window.navigator.userAgent.toLowerCase();
1236
+ this.asService.setState({
1237
+ ...this.asService.state,
1238
+ windowHeight: window.innerHeight,
1239
+ windowWidth: window.innerWidth,
1240
+ hasHeader: false,
1241
+ hasSidebar: false,
1242
+ deviceInfo: {
1243
+ isChrome: browserAgent.indexOf('chrome') > -1,
1244
+ isIE: browserAgent.indexOf('trident') > -1,
1245
+ isFF: browserAgent.indexOf('firefox') > -1,
1246
+ },
1247
+ appBaseFontSize: this.asService.getBaseFontSize(),
1248
+ });
1249
+ }
1247
1250
  this.asService
1248
1251
  .getState('wrapperClasses')
1249
1252
  .pipe(takeUntil(this.destroy$))
@@ -1282,13 +1285,16 @@ class EuiAppComponent {
1282
1285
  this.destroy$.next(true);
1283
1286
  this.destroy$.unsubscribe();
1284
1287
  }
1285
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: EuiAppComponent, deps: [{ token: i1.EuiAppShellService }, { token: i1.EuiGrowlService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1288
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: EuiAppComponent, deps: [{ token: i1.EuiAppShellService }, { token: i1.EuiGrowlService }, { token: i0.ChangeDetectorRef }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component }); }
1286
1289
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.0", type: EuiAppComponent, selector: "eui-app", inputs: { appSubTitle: "appSubTitle", themeClass: "themeClass", isSidebarOpen: ["isSidebarOpen", "isSidebarOpen", booleanAttribute], isShrinkHeaderActive: ["isShrinkHeaderActive", "isShrinkHeaderActive", booleanAttribute], isSidebarHidden: ["isSidebarHidden", "isSidebarHidden", booleanAttribute] }, host: { properties: { "class": "this.cssClasses" } }, queries: [{ propertyName: "appSidebar", first: true, predicate: i0.forwardRef(() => EuiAppSidebarComponent), descendants: true }, { propertyName: "customPageWrapper", first: true, predicate: i0.forwardRef(() => EuiAppPageWrapperDirective), descendants: true }, { propertyName: "appToolbar", first: true, predicate: i0.forwardRef(() => EuiAppToolbarComponent), descendants: true }], usesOnChanges: true, ngImport: i0, template: "<eui-dimmer [isDimmerActive]=\"(asService.state$ | async).isDimmerActive\"></eui-dimmer>\n\n<ng-content select=\"eui-app-sidebar\"></ng-content>\n<ng-container *ngIf=\"!appSidebar && (asService.state$ | async).menuLinks.length !== 0 && (asService.state$ | async).hasHeader && (asService.breakpoints$ | async).isMobile\">\n <eui-app-sidebar>\n <eui-app-sidebar-body>\n <eui-app-sidebar-menu [items]=\"(asService.state$ | async).menuLinks\" [hasIcons]=\"true\"></eui-app-sidebar-menu>\n </eui-app-sidebar-body>\n </eui-app-sidebar>\n</ng-container>\n\n<div class=\"eui-app-main\" *ngIf=\"isViewLoaded\">\n <ng-content select=\"eui-app-top-message\"></ng-content>\n\n <ng-content select=\"eui-app-header\"></ng-content>\n\n <ng-container\n *ngIf=\"!appToolbar && (asService.state$ | async).hasHeader && (asService.breakpoints$ | async).isMobile; else elseBlockToolbar\">\n <eui-app-toolbar>\n <eui-toolbar></eui-toolbar>\n </eui-app-toolbar>\n </ng-container>\n\n <ng-template #elseBlockToolbar>\n <ng-content select=\"eui-app-toolbar\"></ng-content>\n </ng-template>\n\n <ng-content select=\"eui-app-breadcrumb\"></ng-content>\n\n <div class=\"eui-app-main-content\" role=\"main\">\n <ng-content select=\"eui-app-page-wrapper\"></ng-content>\n <ng-container *ngIf=\"hasNoPageWrapper\">\n <router-outlet></router-outlet>\n </ng-container>\n </div>\n\n <ng-content select=\"eui-app-footer\"></ng-content>\n</div>\n\n<eui-growl\n [value]=\"euiGrowlService.growlMessages\"\n [sticky]=\"euiGrowlService.isGrowlSticky\"\n [closeAllSticky]=\"euiGrowlService.isCloseAllSticky\"\n [life]=\"euiGrowlService.growlLife\"\n [position]=\"euiGrowlService.growlPosition\"\n (clicked)=\"euiGrowlService.growlCallback ? euiGrowlService.growlCallback(): null\"></eui-growl>\n\n<eui-block-document [isBlocked]=\"(asService.state$ | async).isBlockDocumentActive\"></eui-block-document>\n", styles: [".eui-app{display:flex;overflow:hidden}@media screen and (max-width: 767px){.eui-app.sidebar--open:before{background:#0000004d;bottom:0;content:\"\";position:fixed;right:0;top:calc(var(--eui-app-header-height) + var(--eui-app-toolbar-height) + var(--eui-app-top-message-height));transition:all .1s ease;width:100vw;z-index:980}}@media screen and (min-width: 768px) and (max-width: 995px){.eui-app.sidebar--open:before{background:#0000004d;bottom:0;content:\"\";position:fixed;right:0;top:calc(var(--eui-app-header-height) + var(--eui-app-toolbar-height) + var(--eui-app-top-message-height));transition:all .1s ease;width:100vw;z-index:980}}@media screen and (min-width: 996px){.sidebar--hidden.eui-app.sidebar--open:before{background:#0000004d;bottom:0;content:\"\";position:fixed;right:0;top:calc(var(--eui-app-header-height) + var(--eui-app-toolbar-height) + var(--eui-app-top-message-height));transition:all .1s ease;width:100vw;z-index:980}}.eui-app-main{min-height:100vh;background:var(--eui-c-bg);width:calc(100% - var(--eui-app-sidebar-width));margin-left:var(--eui-app-sidebar-width);transition:top .1s ease,width .1s ease-in,margin-left .1s ease-in-out;display:flex;flex-direction:column}@media screen and (max-width: 767px){.eui-app-main{margin-left:0;width:100%}}@media screen and (min-width: 768px) and (max-width: 995px){.eui-app-main{margin-left:0;width:100%}}@media screen and (min-width: 996px){.sidebar--close .eui-app-main{margin-left:var(--eui-app-sidebar-width-close);width:calc(100% - var(--eui-app-sidebar-width-close))}.sidebar--hidden.sidebar--close .eui-app-main,.sidebar--hidden.sidebar--open .eui-app-main{margin-left:0;width:100%}}.eui-app-main-content{flex-grow:1;margin-top:calc(var(--eui-app-header-height) + var(--eui-app-toolbar-height) + var(--eui-app-top-message-height) - var(--eui-app-breadcrumb-height));position:relative}eui-app-page-wrapper{display:flex;width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: EuiAppToolbarComponent, selector: "eui-app-toolbar", inputs: ["euiSecondary"] }, { kind: "component", type: EuiToolbarComponent, selector: "eui-toolbar", inputs: ["euiSecondary", "euiPrimary"] }, { kind: "component", type: EuiAppSidebarComponent, selector: "eui-app-sidebar" }, { kind: "component", type: EuiAppSidebarBodyComponent, selector: "eui-app-sidebar-body" }, { kind: "component", type: EuiAppSidebarMenuComponent, selector: "eui-app-sidebar-menu", inputs: ["hasFilter", "hasIcons", "hasTooltip", "expandAllItems", "isCollapsed", "hasCollapsedInitials", "isFlat", "hasScrollToItem", "hasBoldRootLevel", "items"], outputs: ["sidebarItemClick"] }, { kind: "component", type: i9$1.EuiBlockDocumentComponent, selector: "eui-block-document", inputs: ["isBlocked", "ariaLabel"] }, { kind: "component", type: i10.EuiGrowlComponent, selector: "eui-growl", inputs: ["e2eAttr", "sticky", "life", "value", "closeAllSticky", "position"], outputs: ["growlClick"] }, { kind: "component", type: i11.EuiDimmerComponent, selector: "eui-dimmer", inputs: ["isDimmerActive", "e2eAttr"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None }); }
1287
1290
  }
1288
1291
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: EuiAppComponent, decorators: [{
1289
1292
  type: Component,
1290
1293
  args: [{ selector: 'eui-app', encapsulation: ViewEncapsulation.None, template: "<eui-dimmer [isDimmerActive]=\"(asService.state$ | async).isDimmerActive\"></eui-dimmer>\n\n<ng-content select=\"eui-app-sidebar\"></ng-content>\n<ng-container *ngIf=\"!appSidebar && (asService.state$ | async).menuLinks.length !== 0 && (asService.state$ | async).hasHeader && (asService.breakpoints$ | async).isMobile\">\n <eui-app-sidebar>\n <eui-app-sidebar-body>\n <eui-app-sidebar-menu [items]=\"(asService.state$ | async).menuLinks\" [hasIcons]=\"true\"></eui-app-sidebar-menu>\n </eui-app-sidebar-body>\n </eui-app-sidebar>\n</ng-container>\n\n<div class=\"eui-app-main\" *ngIf=\"isViewLoaded\">\n <ng-content select=\"eui-app-top-message\"></ng-content>\n\n <ng-content select=\"eui-app-header\"></ng-content>\n\n <ng-container\n *ngIf=\"!appToolbar && (asService.state$ | async).hasHeader && (asService.breakpoints$ | async).isMobile; else elseBlockToolbar\">\n <eui-app-toolbar>\n <eui-toolbar></eui-toolbar>\n </eui-app-toolbar>\n </ng-container>\n\n <ng-template #elseBlockToolbar>\n <ng-content select=\"eui-app-toolbar\"></ng-content>\n </ng-template>\n\n <ng-content select=\"eui-app-breadcrumb\"></ng-content>\n\n <div class=\"eui-app-main-content\" role=\"main\">\n <ng-content select=\"eui-app-page-wrapper\"></ng-content>\n <ng-container *ngIf=\"hasNoPageWrapper\">\n <router-outlet></router-outlet>\n </ng-container>\n </div>\n\n <ng-content select=\"eui-app-footer\"></ng-content>\n</div>\n\n<eui-growl\n [value]=\"euiGrowlService.growlMessages\"\n [sticky]=\"euiGrowlService.isGrowlSticky\"\n [closeAllSticky]=\"euiGrowlService.isCloseAllSticky\"\n [life]=\"euiGrowlService.growlLife\"\n [position]=\"euiGrowlService.growlPosition\"\n (clicked)=\"euiGrowlService.growlCallback ? euiGrowlService.growlCallback(): null\"></eui-growl>\n\n<eui-block-document [isBlocked]=\"(asService.state$ | async).isBlockDocumentActive\"></eui-block-document>\n", styles: [".eui-app{display:flex;overflow:hidden}@media screen and (max-width: 767px){.eui-app.sidebar--open:before{background:#0000004d;bottom:0;content:\"\";position:fixed;right:0;top:calc(var(--eui-app-header-height) + var(--eui-app-toolbar-height) + var(--eui-app-top-message-height));transition:all .1s ease;width:100vw;z-index:980}}@media screen and (min-width: 768px) and (max-width: 995px){.eui-app.sidebar--open:before{background:#0000004d;bottom:0;content:\"\";position:fixed;right:0;top:calc(var(--eui-app-header-height) + var(--eui-app-toolbar-height) + var(--eui-app-top-message-height));transition:all .1s ease;width:100vw;z-index:980}}@media screen and (min-width: 996px){.sidebar--hidden.eui-app.sidebar--open:before{background:#0000004d;bottom:0;content:\"\";position:fixed;right:0;top:calc(var(--eui-app-header-height) + var(--eui-app-toolbar-height) + var(--eui-app-top-message-height));transition:all .1s ease;width:100vw;z-index:980}}.eui-app-main{min-height:100vh;background:var(--eui-c-bg);width:calc(100% - var(--eui-app-sidebar-width));margin-left:var(--eui-app-sidebar-width);transition:top .1s ease,width .1s ease-in,margin-left .1s ease-in-out;display:flex;flex-direction:column}@media screen and (max-width: 767px){.eui-app-main{margin-left:0;width:100%}}@media screen and (min-width: 768px) and (max-width: 995px){.eui-app-main{margin-left:0;width:100%}}@media screen and (min-width: 996px){.sidebar--close .eui-app-main{margin-left:var(--eui-app-sidebar-width-close);width:calc(100% - var(--eui-app-sidebar-width-close))}.sidebar--hidden.sidebar--close .eui-app-main,.sidebar--hidden.sidebar--open .eui-app-main{margin-left:0;width:100%}}.eui-app-main-content{flex-grow:1;margin-top:calc(var(--eui-app-header-height) + var(--eui-app-toolbar-height) + var(--eui-app-top-message-height) - var(--eui-app-breadcrumb-height));position:relative}eui-app-page-wrapper{display:flex;width:100%}\n"] }]
1291
- }], ctorParameters: () => [{ type: i1.EuiAppShellService }, { type: i1.EuiGrowlService }, { type: i0.ChangeDetectorRef }], propDecorators: { cssClasses: [{
1294
+ }], ctorParameters: () => [{ type: i1.EuiAppShellService }, { type: i1.EuiGrowlService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
1295
+ type: Inject,
1296
+ args: [PLATFORM_ID]
1297
+ }] }], propDecorators: { cssClasses: [{
1292
1298
  type: HostBinding,
1293
1299
  args: ['class']
1294
1300
  }], appSubTitle: [{