@skyux/core 8.0.0-alpha.14 → 8.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/documentation.json +1121 -952
- package/esm2020/index.mjs +3 -1
- package/esm2020/lib/modules/affix/affix-config.mjs +1 -1
- package/esm2020/lib/modules/affix/affix-position.mjs +2 -0
- package/esm2020/lib/modules/affix/affix-rect.mjs +2 -0
- package/esm2020/lib/modules/affix/affix.directive.mjs +6 -2
- package/esm2020/lib/modules/affix/affixer.mjs +32 -7
- package/esm2020/lib/modules/overlay/overlay-config.mjs +1 -1
- package/esm2020/lib/modules/overlay/overlay-position.mjs +2 -0
- package/esm2020/lib/modules/overlay/overlay.component.mjs +6 -3
- package/fesm2015/skyux-core.mjs +41 -9
- package/fesm2015/skyux-core.mjs.map +1 -1
- package/fesm2020/skyux-core.mjs +41 -9
- package/fesm2020/skyux-core.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/lib/modules/affix/affix-config.d.ts +5 -0
- package/lib/modules/affix/affix-position.d.ts +1 -0
- package/lib/modules/affix/affix-rect.d.ts +11 -0
- package/lib/modules/affix/affix.directive.d.ts +6 -1
- package/lib/modules/overlay/overlay-config.d.ts +5 -0
- package/lib/modules/overlay/overlay-position.d.ts +1 -0
- package/lib/modules/overlay/overlay.component.d.ts +2 -0
- package/package.json +2 -2
package/fesm2020/skyux-core.mjs
CHANGED
@@ -375,7 +375,7 @@ function isOffsetPartiallyVisibleWithinParent(parent, offset, bufferOffset) {
|
|
375
375
|
parentOffset.left >= offset.right);
|
376
376
|
}
|
377
377
|
|
378
|
-
var _SkyAffixer_instances, _SkyAffixer_config_get, _SkyAffixer_config_set, _SkyAffixer_affixedElement, _SkyAffixer_baseElement, _SkyAffixer_currentOffset, _SkyAffixer_currentPlacement, _SkyAffixer_offsetChange, _SkyAffixer_offsetChangeObs, _SkyAffixer_overflowParents, _SkyAffixer_overflowScroll, _SkyAffixer_overflowScrollObs, _SkyAffixer_placementChange, _SkyAffixer_placementChangeObs, _SkyAffixer_renderer, _SkyAffixer_resizeListener, _SkyAffixer_scrollListeners, _SkyAffixer__config, _SkyAffixer_affix, _SkyAffixer_getOffset, _SkyAffixer_getPreferredOffset, _SkyAffixer_adjustOffsetToOverflowParent, _SkyAffixer_getImmediateOverflowParent, _SkyAffixer_getAutoFitContextParent, _SkyAffixer_notifyPlacementChange, _SkyAffixer_reset, _SkyAffixer_isNewOffset, _SkyAffixer_isBaseElementVisible, _SkyAffixer_addScrollListeners, _SkyAffixer_addResizeListener, _SkyAffixer_removeResizeListener, _SkyAffixer_removeScrollListeners;
|
378
|
+
var _SkyAffixer_instances, _SkyAffixer_config_get, _SkyAffixer_config_set, _SkyAffixer_affixedElement, _SkyAffixer_baseElement, _SkyAffixer_currentOffset, _SkyAffixer_currentPlacement, _SkyAffixer_offsetChange, _SkyAffixer_offsetChangeObs, _SkyAffixer_overflowParents, _SkyAffixer_overflowScroll, _SkyAffixer_overflowScrollObs, _SkyAffixer_placementChange, _SkyAffixer_placementChangeObs, _SkyAffixer_renderer, _SkyAffixer_resizeListener, _SkyAffixer_scrollListeners, _SkyAffixer__config, _SkyAffixer_affix, _SkyAffixer_getOffset, _SkyAffixer_getRect, _SkyAffixer_getPreferredOffset, _SkyAffixer_adjustOffsetToOverflowParent, _SkyAffixer_getImmediateOverflowParent, _SkyAffixer_getAutoFitContextParent, _SkyAffixer_notifyPlacementChange, _SkyAffixer_reset, _SkyAffixer_isNewOffset, _SkyAffixer_isBaseElementVisible, _SkyAffixer_addScrollListeners, _SkyAffixer_addResizeListener, _SkyAffixer_removeResizeListener, _SkyAffixer_removeScrollListeners;
|
379
379
|
const DEFAULT_AFFIX_CONFIG = {
|
380
380
|
autoFitContext: SkyAffixAutoFitContext.OverflowParent,
|
381
381
|
enableAutoFit: false,
|
@@ -497,9 +497,19 @@ _SkyAffixer_affixedElement = new WeakMap(), _SkyAffixer_baseElement = new WeakMa
|
|
497
497
|
let isAffixedElementFullyVisible = false;
|
498
498
|
let offset;
|
499
499
|
let placement = __classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).placement;
|
500
|
+
const autoFitOverflowOffset = __classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).autoFitOverflowOffset || {
|
501
|
+
bottom: 0,
|
502
|
+
left: 0,
|
503
|
+
right: 0,
|
504
|
+
top: 0,
|
505
|
+
};
|
506
|
+
if (__classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).position === 'absolute') {
|
507
|
+
autoFitOverflowOffset.top =
|
508
|
+
(autoFitOverflowOffset.top || 0) + window.scrollY;
|
509
|
+
}
|
500
510
|
do {
|
501
511
|
offset = __classPrivateFieldGet(this, _SkyAffixer_instances, "m", _SkyAffixer_getPreferredOffset).call(this, placement);
|
502
|
-
isAffixedElementFullyVisible = isOffsetFullyVisibleWithinParent(parent, offset,
|
512
|
+
isAffixedElementFullyVisible = isOffsetFullyVisibleWithinParent(parent, offset, autoFitOverflowOffset);
|
503
513
|
if (!__classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).enableAutoFit) {
|
504
514
|
break;
|
505
515
|
}
|
@@ -525,12 +535,27 @@ _SkyAffixer_affixedElement = new WeakMap(), _SkyAffixer_baseElement = new WeakMa
|
|
525
535
|
}
|
526
536
|
// No suitable placement was found, so revert to preferred placement.
|
527
537
|
return __classPrivateFieldGet(this, _SkyAffixer_instances, "m", _SkyAffixer_getPreferredOffset).call(this, __classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).placement);
|
538
|
+
}, _SkyAffixer_getRect = function _SkyAffixer_getRect(baseElement) {
|
539
|
+
const baseDomRect = baseElement.getBoundingClientRect();
|
540
|
+
const baseRect = {
|
541
|
+
top: baseDomRect.top,
|
542
|
+
bottom: baseDomRect.bottom,
|
543
|
+
left: baseDomRect.left,
|
544
|
+
right: baseDomRect.right,
|
545
|
+
width: baseDomRect.width,
|
546
|
+
height: baseDomRect.height,
|
547
|
+
};
|
548
|
+
if (__classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).position === 'absolute') {
|
549
|
+
baseRect.top += window.scrollY;
|
550
|
+
baseRect.bottom = baseRect.top + baseDomRect.height;
|
551
|
+
}
|
552
|
+
return baseRect;
|
528
553
|
}, _SkyAffixer_getPreferredOffset = function _SkyAffixer_getPreferredOffset(placement) {
|
529
554
|
if (!__classPrivateFieldGet(this, _SkyAffixer_baseElement, "f")) {
|
530
555
|
return { top: 0, left: 0, bottom: 0, right: 0 };
|
531
556
|
}
|
532
|
-
const affixedRect = __classPrivateFieldGet(this,
|
533
|
-
const baseRect = __classPrivateFieldGet(this,
|
557
|
+
const affixedRect = __classPrivateFieldGet(this, _SkyAffixer_instances, "m", _SkyAffixer_getRect).call(this, __classPrivateFieldGet(this, _SkyAffixer_affixedElement, "f"));
|
558
|
+
const baseRect = __classPrivateFieldGet(this, _SkyAffixer_instances, "m", _SkyAffixer_getRect).call(this, __classPrivateFieldGet(this, _SkyAffixer_baseElement, "f"));
|
534
559
|
const horizontalAlignment = __classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).horizontalAlignment;
|
535
560
|
const verticalAlignment = __classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).verticalAlignment;
|
536
561
|
const enableAutoFit = __classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).enableAutoFit;
|
@@ -610,8 +635,8 @@ _SkyAffixer_affixedElement = new WeakMap(), _SkyAffixer_baseElement = new WeakMa
|
|
610
635
|
}, _SkyAffixer_adjustOffsetToOverflowParent = function _SkyAffixer_adjustOffsetToOverflowParent(offset, placement, baseElement) {
|
611
636
|
const parent = __classPrivateFieldGet(this, _SkyAffixer_instances, "m", _SkyAffixer_getAutoFitContextParent).call(this);
|
612
637
|
const parentOffset = getElementOffset(parent, __classPrivateFieldGet(this, _SkyAffixer_instances, "a", _SkyAffixer_config_get).autoFitOverflowOffset);
|
613
|
-
const affixedRect = __classPrivateFieldGet(this,
|
614
|
-
const baseRect =
|
638
|
+
const affixedRect = __classPrivateFieldGet(this, _SkyAffixer_instances, "m", _SkyAffixer_getRect).call(this, __classPrivateFieldGet(this, _SkyAffixer_affixedElement, "f"));
|
639
|
+
const baseRect = __classPrivateFieldGet(this, _SkyAffixer_instances, "m", _SkyAffixer_getRect).call(this, baseElement);
|
615
640
|
// A pixel value representing the leeway between the edge of the overflow parent and the edge
|
616
641
|
// of the base element before it disappears from view.
|
617
642
|
// If the visible portion of the base element is less than this pixel value, the auto-fit
|
@@ -793,6 +818,7 @@ class SkyAffixDirective {
|
|
793
818
|
changes.affixHorizontalAlignment ||
|
794
819
|
changes.affixIsSticky ||
|
795
820
|
changes.affixPlacement ||
|
821
|
+
changes.affixPosition ||
|
796
822
|
changes.affixVerticalAlignment) {
|
797
823
|
__classPrivateFieldGet(this, _SkyAffixDirective_instances, "m", _SkyAffixDirective_updateAlignment).call(this);
|
798
824
|
}
|
@@ -819,12 +845,13 @@ _SkyAffixDirective_affixer = new WeakMap(), _SkyAffixDirective_affixService = ne
|
|
819
845
|
horizontalAlignment: this.affixHorizontalAlignment,
|
820
846
|
isSticky: this.affixIsSticky,
|
821
847
|
placement: this.affixPlacement,
|
848
|
+
position: this.affixPosition,
|
822
849
|
verticalAlignment: this.affixVerticalAlignment,
|
823
850
|
});
|
824
851
|
}
|
825
852
|
};
|
826
853
|
SkyAffixDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: SkyAffixDirective, deps: [{ token: i0.ElementRef }, { token: SkyAffixService }], target: i0.ɵɵFactoryTarget.Directive });
|
827
|
-
SkyAffixDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", type: SkyAffixDirective, selector: "[skyAffixTo]", inputs: { skyAffixTo: "skyAffixTo", affixAutoFitContext: "affixAutoFitContext", affixAutoFitOverflowOffset: "affixAutoFitOverflowOffset", affixEnableAutoFit: "affixEnableAutoFit", affixHorizontalAlignment: "affixHorizontalAlignment", affixIsSticky: "affixIsSticky", affixPlacement: "affixPlacement", affixVerticalAlignment: "affixVerticalAlignment" }, outputs: { affixOffsetChange: "affixOffsetChange", affixOverflowScroll: "affixOverflowScroll", affixPlacementChange: "affixPlacementChange" }, usesOnChanges: true, ngImport: i0 });
|
854
|
+
SkyAffixDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", type: SkyAffixDirective, selector: "[skyAffixTo]", inputs: { skyAffixTo: "skyAffixTo", affixAutoFitContext: "affixAutoFitContext", affixAutoFitOverflowOffset: "affixAutoFitOverflowOffset", affixEnableAutoFit: "affixEnableAutoFit", affixHorizontalAlignment: "affixHorizontalAlignment", affixIsSticky: "affixIsSticky", affixPlacement: "affixPlacement", affixPosition: "affixPosition", affixVerticalAlignment: "affixVerticalAlignment" }, outputs: { affixOffsetChange: "affixOffsetChange", affixOverflowScroll: "affixOverflowScroll", affixPlacementChange: "affixPlacementChange" }, usesOnChanges: true, ngImport: i0 });
|
828
855
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: SkyAffixDirective, decorators: [{
|
829
856
|
type: Directive,
|
830
857
|
args: [{
|
@@ -844,6 +871,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
844
871
|
type: Input
|
845
872
|
}], affixPlacement: [{
|
846
873
|
type: Input
|
874
|
+
}], affixPosition: [{
|
875
|
+
type: Input
|
847
876
|
}], affixVerticalAlignment: [{
|
848
877
|
type: Input
|
849
878
|
}], affixOffsetChange: [{
|
@@ -2262,6 +2291,7 @@ class SkyOverlayContext {
|
|
2262
2291
|
}
|
2263
2292
|
|
2264
2293
|
var _SkyOverlayComponent_instances, _SkyOverlayComponent_backdropClick, _SkyOverlayComponent_backdropClickObs, _SkyOverlayComponent_changeDetector, _SkyOverlayComponent_closed, _SkyOverlayComponent_closedObs, _SkyOverlayComponent_context, _SkyOverlayComponent_coreAdapter, _SkyOverlayComponent_injector, _SkyOverlayComponent_ngUnsubscribe, _SkyOverlayComponent_router, _SkyOverlayComponent_routerSubscription, _SkyOverlayComponent_applyConfig, _SkyOverlayComponent_addBackdropClickListener, _SkyOverlayComponent_addRouteListener, _SkyOverlayComponent_removeRouteListener;
|
2294
|
+
const POSITION_DEFAULT = 'fixed';
|
2265
2295
|
/**
|
2266
2296
|
* Omnibar is 1000.
|
2267
2297
|
* See: https://github.com/blackbaud/auth-client/blob/master/src/omnibar/omnibar.ts#L139
|
@@ -2293,6 +2323,7 @@ class SkyOverlayComponent {
|
|
2293
2323
|
this.showBackdrop = false;
|
2294
2324
|
this.zIndex = `${++uniqueZIndex}`;
|
2295
2325
|
this.clipPath$ = new ReplaySubject(1);
|
2326
|
+
this.position = POSITION_DEFAULT;
|
2296
2327
|
_SkyOverlayComponent_backdropClick.set(this, void 0);
|
2297
2328
|
_SkyOverlayComponent_backdropClickObs.set(this, void 0);
|
2298
2329
|
_SkyOverlayComponent_changeDetector.set(this, void 0);
|
@@ -2375,6 +2406,7 @@ _SkyOverlayComponent_backdropClick = new WeakMap(), _SkyOverlayComponent_backdro
|
|
2375
2406
|
this.wrapperClass = config.wrapperClass || '';
|
2376
2407
|
this.showBackdrop = !!config.showBackdrop;
|
2377
2408
|
this.enablePointerEvents = !!config.enablePointerEvents;
|
2409
|
+
this.position = config.position || POSITION_DEFAULT;
|
2378
2410
|
__classPrivateFieldGet(this, _SkyOverlayComponent_changeDetector, "f").markForCheck();
|
2379
2411
|
}, _SkyOverlayComponent_addBackdropClickListener = function _SkyOverlayComponent_addBackdropClickListener() {
|
2380
2412
|
fromEvent(window.document, 'click')
|
@@ -2409,10 +2441,10 @@ _SkyOverlayComponent_backdropClick = new WeakMap(), _SkyOverlayComponent_backdro
|
|
2409
2441
|
}
|
2410
2442
|
};
|
2411
2443
|
SkyOverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: SkyOverlayComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Injector }, { token: SkyCoreAdapterService }, { token: SkyOverlayContext }, { token: SkyIdService }, { token: i4.Router, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
2412
|
-
SkyOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: SkyOverlayComponent, selector: "sky-overlay", host: { properties: { "id": "this.id" } }, viewQueries: [{ propertyName: "overlayContentRef", first: true, predicate: ["overlayContentRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "overlayRef", first: true, predicate: ["overlayRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "targetRef", first: true, predicate: ["target"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n [class]=\"wrapperClass\"\n [style.z-index]=\"zIndex\"\n [style.clip-path]=\"clipPath$ | async\"\n [ngClass]=\"{\n 'enable-pointer-events-pass-through': enablePointerEvents,\n 'sky-overlay': true\n }\"\n #overlayRef\n>\n <div class=\"sky-overlay-content\" #overlayContentRef>\n <ng-template #target> </ng-template>\n </div>\n <div *ngIf=\"showBackdrop\" class=\"sky-overlay-backdrop\"></div>\n</div>\n", styles: [".sky-overlay{
|
2444
|
+
SkyOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: SkyOverlayComponent, selector: "sky-overlay", host: { properties: { "id": "this.id" } }, viewQueries: [{ propertyName: "overlayContentRef", first: true, predicate: ["overlayContentRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "overlayRef", first: true, predicate: ["overlayRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "targetRef", first: true, predicate: ["target"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n [class]=\"'sky-overlay-position-' + position + ' ' + wrapperClass\"\n [style.z-index]=\"zIndex\"\n [style.clip-path]=\"clipPath$ | async\"\n [ngClass]=\"{\n 'enable-pointer-events-pass-through': enablePointerEvents,\n 'sky-overlay': true\n }\"\n #overlayRef\n>\n <div class=\"sky-overlay-content\" #overlayContentRef>\n <ng-template #target> </ng-template>\n </div>\n <div *ngIf=\"showBackdrop\" class=\"sky-overlay-backdrop\"></div>\n</div>\n", styles: [".sky-overlay{inset:0;width:100%;height:100%;display:flex;pointer-events:auto}.sky-overlay-position-absolute{position:absolute}.sky-overlay-position-fixed{position:fixed}.sky-overlay-content{position:relative;z-index:1;display:inline-flex;align-self:start;pointer-events:auto}.sky-overlay-backdrop{background:rgba(0,0,0,.5);inset:0;width:100%;height:100%;position:absolute}.enable-pointer-events-pass-through,.enable-pointer-events-pass-through .sky-overlay-backdrop{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-content{pointer-events:auto}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
2413
2445
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: SkyOverlayComponent, decorators: [{
|
2414
2446
|
type: Component,
|
2415
|
-
args: [{ selector: 'sky-overlay', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class]=\"wrapperClass\"\n [style.z-index]=\"zIndex\"\n [style.clip-path]=\"clipPath$ | async\"\n [ngClass]=\"{\n 'enable-pointer-events-pass-through': enablePointerEvents,\n 'sky-overlay': true\n }\"\n #overlayRef\n>\n <div class=\"sky-overlay-content\" #overlayContentRef>\n <ng-template #target> </ng-template>\n </div>\n <div *ngIf=\"showBackdrop\" class=\"sky-overlay-backdrop\"></div>\n</div>\n", styles: [".sky-overlay{
|
2447
|
+
args: [{ selector: 'sky-overlay', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class]=\"'sky-overlay-position-' + position + ' ' + wrapperClass\"\n [style.z-index]=\"zIndex\"\n [style.clip-path]=\"clipPath$ | async\"\n [ngClass]=\"{\n 'enable-pointer-events-pass-through': enablePointerEvents,\n 'sky-overlay': true\n }\"\n #overlayRef\n>\n <div class=\"sky-overlay-content\" #overlayContentRef>\n <ng-template #target> </ng-template>\n </div>\n <div *ngIf=\"showBackdrop\" class=\"sky-overlay-backdrop\"></div>\n</div>\n", styles: [".sky-overlay{inset:0;width:100%;height:100%;display:flex;pointer-events:auto}.sky-overlay-position-absolute{position:absolute}.sky-overlay-position-fixed{position:fixed}.sky-overlay-content{position:relative;z-index:1;display:inline-flex;align-self:start;pointer-events:auto}.sky-overlay-backdrop{background:rgba(0,0,0,.5);inset:0;width:100%;height:100%;position:absolute}.enable-pointer-events-pass-through,.enable-pointer-events-pass-through .sky-overlay-backdrop{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-content{pointer-events:auto}\n"] }]
|
2416
2448
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.Injector }, { type: SkyCoreAdapterService }, { type: SkyOverlayContext }, { type: SkyIdService }, { type: i4.Router, decorators: [{
|
2417
2449
|
type: Optional
|
2418
2450
|
}] }]; }, propDecorators: { id: [{
|