@skyux/core 12.0.0-alpha.6 → 12.0.0-alpha.8

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,11 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { NgModule, Injectable, inject, RendererFactory2, NgZone, EventEmitter, Directive, Input, Output, EnvironmentInjector, createEnvironmentInjector, createComponent, ChangeDetectorRef, ElementRef, ViewContainerRef, Component, ChangeDetectionStrategy, ViewChild, InjectionToken, Optional, Inject, ApplicationRef, afterNextRender, Injector, Pipe, HostBinding, Renderer2, HostListener } from '@angular/core';
2
+ import { NgModule, Injectable, inject, RendererFactory2, NgZone, EventEmitter, Directive, Input, Output, EnvironmentInjector, createEnvironmentInjector, createComponent, ChangeDetectorRef, ElementRef, ViewContainerRef, Component, ChangeDetectionStrategy, ViewChild, InjectionToken, input, effect, Optional, Inject, ApplicationRef, afterNextRender, Injector, Pipe, HostBinding, Renderer2, HostListener } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import { DOCUMENT, CommonModule } from '@angular/common';
5
5
  import { Subject, Subscription, ReplaySubject, fromEvent, of, Observable, filter, map, distinctUntilChanged, shareReplay, throttle, animationFrames, take, takeUntil as takeUntil$1, BehaviorSubject, concat, animationFrameScheduler } from 'rxjs';
6
6
  import { takeUntil, debounceTime, switchMap, map as map$1 } from 'rxjs/operators';
7
7
  import { ViewportRuler } from '@angular/cdk/overlay';
8
- import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
8
+ import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
9
9
  import * as i1 from '@skyux/i18n';
10
10
  import { SkyLibResourcesService, SkyI18nModule, SkyIntlNumberFormatStyle, SkyIntlNumberFormatter } from '@skyux/i18n';
11
11
  import { Router, NavigationStart } from '@angular/router';
@@ -322,6 +322,9 @@ function getInversePlacement(placement) {
322
322
  return pairings[placement];
323
323
  }
324
324
 
325
+ function useViewportForBounds(element) {
326
+ return 'BODY' === element.tagName;
327
+ }
325
328
  /**
326
329
  * Returns the offset values of a given element.
327
330
  * @param element The HTML element.
@@ -418,7 +421,7 @@ function getOverflowParents(child) {
418
421
  */
419
422
  function isOffsetFullyVisibleWithinParent(viewportRuler, parent, offset, bufferOffset) {
420
423
  let parentOffset;
421
- if (parent.matches('body')) {
424
+ if (useViewportForBounds(parent)) {
422
425
  const viewportRect = viewportRuler.getViewportRect();
423
426
  parentOffset = {
424
427
  top: 0,
@@ -439,9 +442,22 @@ function isOffsetFullyVisibleWithinParent(viewportRuler, parent, offset, bufferO
439
442
  parentOffset.left <= offset.left);
440
443
  }
441
444
  function isOffsetPartiallyVisibleWithinParent(viewportRuler, parent, offset, bufferOffset) {
442
- const parentOffset = bufferOffset
443
- ? getElementOffset(parent, bufferOffset)
444
- : getVisibleRectForElement(viewportRuler, parent);
445
+ let parentOffset;
446
+ if (useViewportForBounds(parent)) {
447
+ const viewportRect = viewportRuler.getViewportRect();
448
+ parentOffset = {
449
+ top: 0,
450
+ left: 0,
451
+ right: viewportRect.width,
452
+ bottom: viewportRect.height,
453
+ };
454
+ }
455
+ else if (bufferOffset) {
456
+ parentOffset = getElementOffset(parent, bufferOffset);
457
+ }
458
+ else {
459
+ parentOffset = getVisibleRectForElement(viewportRuler, parent);
460
+ }
445
461
  return !(parentOffset.top >= offset.bottom ||
446
462
  parentOffset.right <= offset.left ||
447
463
  parentOffset.bottom <= offset.top ||
@@ -1774,6 +1790,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
1774
1790
  type: Injectable
1775
1791
  }] });
1776
1792
 
1793
+ const LAYOUT_FOR_CHILD_CLASS_PREFIX = 'sky-layout-host-for-child-';
1794
+ const LAYOUT_CLASS_PREFIX = 'sky-layout-host-';
1795
+ /**
1796
+ * @internal
1797
+ */
1798
+ class SkyLayoutHostDirective {
1799
+ #elementRef;
1800
+ #layoutForChild;
1801
+ #renderer;
1802
+ constructor() {
1803
+ this.#elementRef = inject(ElementRef);
1804
+ this.#layoutForChild = toSignal(inject(SkyLayoutHostService).hostLayoutForChild);
1805
+ this.#renderer = inject(RendererFactory2).createRenderer(null, null);
1806
+ this.layout = input();
1807
+ effect(() => {
1808
+ const cssClass = [`${LAYOUT_CLASS_PREFIX}${this.layout() ?? 'none'}`];
1809
+ const layoutForChild = this.#layoutForChild()?.layout;
1810
+ if (layoutForChild) {
1811
+ cssClass.push(`${LAYOUT_FOR_CHILD_CLASS_PREFIX}${layoutForChild}`);
1812
+ }
1813
+ const classList = this.#elementRef.nativeElement.classList.values();
1814
+ for (const className of classList) {
1815
+ if (className.startsWith(LAYOUT_CLASS_PREFIX) &&
1816
+ !cssClass.includes(className)) {
1817
+ this.#renderer.removeClass(this.#elementRef.nativeElement, className);
1818
+ }
1819
+ }
1820
+ for (const className of cssClass) {
1821
+ this.#renderer.addClass(this.#elementRef.nativeElement, className);
1822
+ }
1823
+ });
1824
+ }
1825
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SkyLayoutHostDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1826
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.5", type: SkyLayoutHostDirective, isStandalone: true, selector: "[skyLayoutHost]", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null } }, providers: [SkyLayoutHostService], ngImport: i0 }); }
1827
+ }
1828
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SkyLayoutHostDirective, decorators: [{
1829
+ type: Directive,
1830
+ args: [{
1831
+ selector: '[skyLayoutHost]',
1832
+ standalone: true,
1833
+ providers: [SkyLayoutHostService],
1834
+ }]
1835
+ }], ctorParameters: () => [] });
1836
+
1777
1837
  /**
1778
1838
  * Allows for announcing messages to screen reader users through the use of a common `aria-live` element.
1779
1839
  * @internal
@@ -2441,6 +2501,12 @@ const RESOURCES = {
2441
2501
  skyux_numeric_thousands_symbol: { message: 'K' },
2442
2502
  skyux_numeric_trillions_symbol: { message: 'T' },
2443
2503
  },
2504
+ 'FR-CA': {
2505
+ skyux_numeric_billions_symbol: { message: 'G' },
2506
+ skyux_numeric_millions_symbol: { message: 'M' },
2507
+ skyux_numeric_thousands_symbol: { message: 'K' },
2508
+ skyux_numeric_trillions_symbol: { message: 'T' },
2509
+ },
2444
2510
  };
2445
2511
  SkyLibResourcesService.addResources(RESOURCES);
2446
2512
  /**
@@ -4552,11 +4618,11 @@ class Version {
4552
4618
  /**
4553
4619
  * Represents the version of @skyux/core.
4554
4620
  */
4555
- const VERSION = new Version('12.0.0-alpha.6');
4621
+ const VERSION = new Version('12.0.0-alpha.8');
4556
4622
 
4557
4623
  /**
4558
4624
  * Generated bundle index. Do not edit.
4559
4625
  */
4560
4626
 
4561
- export { NumericOptions, SKY_BREAKPOINTS, SKY_BREAKPOINT_OBSERVER, SKY_HELP_GLOBAL_OPTIONS, SKY_LOG_LEVEL, SKY_STACKING_CONTEXT, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyContainerBreakpointObserver, SkyContentInfoProvider, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDefaultInputProvider, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLegacyService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyFileReaderService, SkyHelpService, SkyIdModule, SkyIdService, SkyLayoutHostService, SkyLiveAnnouncerService, SkyLogLevel, SkyLogModule, SkyLogService, SkyMediaBreakpointObserver, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyMutationObserverService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayLegacyService, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyResizeObserverMediaQueryService, SkyResizeObserverService, SkyResponsiveHostDirective, SkyScreenReaderLabelDirective, SkyScrollShadowDirective, SkyScrollableHostService, SkyTrimModule, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, VERSION, provideSkyBreakpointObserver, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3, SkyTrimDirective as λ4 };
4627
+ export { NumericOptions, SKY_BREAKPOINTS, SKY_BREAKPOINT_OBSERVER, SKY_HELP_GLOBAL_OPTIONS, SKY_LOG_LEVEL, SKY_STACKING_CONTEXT, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyContainerBreakpointObserver, SkyContentInfoProvider, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDefaultInputProvider, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLegacyService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyFileReaderService, SkyHelpService, SkyIdModule, SkyIdService, SkyLayoutHostDirective, SkyLayoutHostService, SkyLiveAnnouncerService, SkyLogLevel, SkyLogModule, SkyLogService, SkyMediaBreakpointObserver, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyMutationObserverService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayLegacyService, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyResizeObserverMediaQueryService, SkyResizeObserverService, SkyResponsiveHostDirective, SkyScreenReaderLabelDirective, SkyScrollShadowDirective, SkyScrollableHostService, SkyTrimModule, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, VERSION, provideSkyBreakpointObserver, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3, SkyTrimDirective as λ4 };
4562
4628
  //# sourceMappingURL=skyux-core.mjs.map