@skyux/layout 5.6.1 → 5.7.1
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/bundles/skyux-layout.umd.js +39 -42
- package/documentation.json +68 -1075
- package/esm2015/index.js +1 -1
- package/esm2015/index.js.map +1 -1
- package/esm2015/lib/modules/back-to-top/back-to-top-adapter.service.js +33 -38
- package/esm2015/lib/modules/back-to-top/back-to-top-adapter.service.js.map +1 -1
- package/esm2015/lib/modules/back-to-top/back-to-top.directive.js +1 -2
- package/esm2015/lib/modules/back-to-top/back-to-top.directive.js.map +1 -1
- package/esm2015/lib/modules/back-to-top/{back-top-top.module.js → back-to-top.module.js} +1 -1
- package/esm2015/lib/modules/back-to-top/back-to-top.module.js.map +1 -0
- package/esm2015/lib/modules/fluid-grid/column.component.js +3 -0
- package/esm2015/lib/modules/fluid-grid/column.component.js.map +1 -1
- package/esm2015/lib/modules/format/format.component.js +1 -1
- package/esm2015/lib/modules/format/format.component.js.map +1 -1
- package/esm2015/lib/modules/inline-delete/inline-delete-adapter.service.js.map +1 -1
- package/esm2015/lib/modules/shared/sky-layout-resources.module.js +1 -1
- package/esm2015/lib/modules/shared/sky-layout-resources.module.js.map +1 -1
- package/fesm2015/skyux-layout.js +41 -44
- package/fesm2015/skyux-layout.js.map +1 -1
- package/index.d.ts +1 -1
- package/lib/modules/back-to-top/back-to-top-adapter.service.d.ts +5 -4
- package/lib/modules/back-to-top/{back-top-top.module.d.ts → back-to-top.module.d.ts} +0 -0
- package/lib/modules/fluid-grid/column.component.d.ts +3 -0
- package/lib/modules/format/format.component.d.ts +1 -1
- package/lib/modules/shared/sky-layout-resources.module.d.ts +1 -1
- package/package.json +9 -9
- package/esm2015/lib/modules/back-to-top/back-top-top.module.js.map +0 -1
|
@@ -392,7 +392,7 @@
|
|
|
392
392
|
/**
|
|
393
393
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
394
394
|
* The contents of this file were automatically generated by
|
|
395
|
-
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-layout' schematic.
|
|
395
|
+
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-layout' schematic.
|
|
396
396
|
* To update this file, simply rerun the command.
|
|
397
397
|
*/
|
|
398
398
|
var RESOURCES = {
|
|
@@ -488,13 +488,17 @@
|
|
|
488
488
|
* @internal
|
|
489
489
|
*/
|
|
490
490
|
var SkyBackToTopDomAdapterService = /** @class */ (function () {
|
|
491
|
-
function SkyBackToTopDomAdapterService(windowRef) {
|
|
491
|
+
function SkyBackToTopDomAdapterService(windowRef, scrollableHostService) {
|
|
492
492
|
this.windowRef = windowRef;
|
|
493
|
+
this.scrollableHostService = scrollableHostService;
|
|
493
494
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
495
|
+
this.scrollableHostScrollEventUnsubscribe = new rxjs.Subject();
|
|
494
496
|
}
|
|
495
497
|
SkyBackToTopDomAdapterService.prototype.ngOnDestroy = function () {
|
|
496
498
|
this.ngUnsubscribe.next();
|
|
497
499
|
this.ngUnsubscribe.complete();
|
|
500
|
+
this.scrollableHostScrollEventUnsubscribe.next();
|
|
501
|
+
this.scrollableHostScrollEventUnsubscribe.complete();
|
|
498
502
|
};
|
|
499
503
|
/**
|
|
500
504
|
* This event returns a boolean on scroll indicating whether the provided element is in view.
|
|
@@ -502,11 +506,16 @@
|
|
|
502
506
|
*/
|
|
503
507
|
SkyBackToTopDomAdapterService.prototype.elementInViewOnScroll = function (elementRef) {
|
|
504
508
|
var _this = this;
|
|
505
|
-
var
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
509
|
+
var scrollableHostObservable = this.scrollableHostService.watchScrollableHostScrollEvents(elementRef);
|
|
510
|
+
var isInitiallyInView = this.isElementScrolledInView(elementRef);
|
|
511
|
+
var returnedObservable = new rxjs.BehaviorSubject(isInitiallyInView);
|
|
512
|
+
scrollableHostObservable
|
|
513
|
+
.pipe(operators.takeUntil(this.scrollableHostScrollEventUnsubscribe))
|
|
514
|
+
.subscribe(function () {
|
|
515
|
+
var isInView = _this.isElementScrolledInView(elementRef);
|
|
516
|
+
returnedObservable.next(isInView);
|
|
517
|
+
});
|
|
518
|
+
return returnedObservable;
|
|
510
519
|
};
|
|
511
520
|
/**
|
|
512
521
|
* Scrolls the window or scrollable parent to the provided element.
|
|
@@ -518,9 +527,8 @@
|
|
|
518
527
|
if (!elementRef || !elementRef.nativeElement) {
|
|
519
528
|
return;
|
|
520
529
|
}
|
|
521
|
-
var
|
|
522
|
-
|
|
523
|
-
if (parent === windowObj) {
|
|
530
|
+
var scrollableHost = this.scrollableHostService.getScrollableHost(elementRef);
|
|
531
|
+
if (scrollableHost instanceof Window) {
|
|
524
532
|
// Scroll to top of window, but account for the body margin that allows for the omnibar if it exists.
|
|
525
533
|
var bodyMarginOffset = parseInt(getComputedStyle(document.body).marginTop, 10);
|
|
526
534
|
var newOffsetTop = elementRef.nativeElement.offsetTop - bodyMarginOffset;
|
|
@@ -528,46 +536,33 @@
|
|
|
528
536
|
}
|
|
529
537
|
else {
|
|
530
538
|
// Scroll to top of parent element.
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
var
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
do {
|
|
541
|
-
parent = parent.parentNode;
|
|
542
|
-
style = windowObj.getComputedStyle(parent);
|
|
543
|
-
} while (!regex.test(style.overflow) &&
|
|
544
|
-
!regex.test(style.overflowY) &&
|
|
545
|
-
parent !== bodyObj);
|
|
546
|
-
if (parent === bodyObj) {
|
|
547
|
-
return windowObj;
|
|
548
|
-
}
|
|
549
|
-
return parent;
|
|
550
|
-
};
|
|
551
|
-
SkyBackToTopDomAdapterService.prototype.isElementScrolledInView = function (element, parentElement) {
|
|
539
|
+
scrollableHost.scrollTop =
|
|
540
|
+
scrollableHost.offsetTop - elementRef.nativeElement.offsetTop;
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
SkyBackToTopDomAdapterService.prototype.isElementScrolledInView = function (element) {
|
|
544
|
+
var parentElement = this.scrollableHostService.getScrollableHost(element.nativeElement);
|
|
545
|
+
if (!element.nativeElement.offsetParent) {
|
|
546
|
+
return true;
|
|
547
|
+
}
|
|
552
548
|
var buffer = 25;
|
|
553
|
-
var
|
|
554
|
-
var elementRect = element.getBoundingClientRect();
|
|
549
|
+
var elementRect = element.nativeElement.getBoundingClientRect();
|
|
555
550
|
/* istanbul ignore else */
|
|
556
|
-
if (parentElement
|
|
557
|
-
return elementRect.top > -buffer;
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
551
|
+
if (parentElement instanceof HTMLElement) {
|
|
560
552
|
var parentRect = parentElement.getBoundingClientRect();
|
|
561
553
|
return elementRect.top > parentRect.top - buffer;
|
|
562
554
|
}
|
|
555
|
+
else {
|
|
556
|
+
return elementRect.top > -buffer;
|
|
557
|
+
}
|
|
563
558
|
};
|
|
564
559
|
return SkyBackToTopDomAdapterService;
|
|
565
560
|
}());
|
|
566
|
-
SkyBackToTopDomAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyBackToTopDomAdapterService, deps: [{ token: i1__namespace.SkyAppWindowRef }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
561
|
+
SkyBackToTopDomAdapterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyBackToTopDomAdapterService, deps: [{ token: i1__namespace.SkyAppWindowRef }, { token: i1__namespace.SkyScrollableHostService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
567
562
|
SkyBackToTopDomAdapterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyBackToTopDomAdapterService });
|
|
568
563
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyBackToTopDomAdapterService, decorators: [{
|
|
569
564
|
type: i0.Injectable
|
|
570
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.SkyAppWindowRef }]; } });
|
|
565
|
+
}], ctorParameters: function () { return [{ type: i1__namespace.SkyAppWindowRef }, { type: i1__namespace.SkyScrollableHostService }]; } });
|
|
571
566
|
|
|
572
567
|
/**
|
|
573
568
|
* Specifies the type of message to send to the back to top component.
|
|
@@ -622,8 +617,7 @@
|
|
|
622
617
|
configurable: true
|
|
623
618
|
});
|
|
624
619
|
SkyBackToTopDirective.prototype.ngAfterViewInit = function () {
|
|
625
|
-
|
|
626
|
-
this.elementInView = this.domAdapter.isElementScrolledInView(this.element.nativeElement, scrollableParent);
|
|
620
|
+
this.elementInView = this.domAdapter.isElementScrolledInView(this.element);
|
|
627
621
|
this.handleBackToTopButton(this.elementInView);
|
|
628
622
|
this.setBackToTopListeners();
|
|
629
623
|
};
|
|
@@ -1882,6 +1876,9 @@
|
|
|
1882
1876
|
SkyFluidGridGutterSize[SkyFluidGridGutterSize["Large"] = 2] = "Large";
|
|
1883
1877
|
})(exports.SkyFluidGridGutterSize || (exports.SkyFluidGridGutterSize = {}));
|
|
1884
1878
|
|
|
1879
|
+
/**
|
|
1880
|
+
* Displays a column within a row of the fluid grid.
|
|
1881
|
+
*/
|
|
1885
1882
|
var SkyColumnComponent = /** @class */ (function () {
|
|
1886
1883
|
function SkyColumnComponent() {
|
|
1887
1884
|
}
|
|
@@ -2387,7 +2384,7 @@
|
|
|
2387
2384
|
},
|
|
2388
2385
|
/**
|
|
2389
2386
|
* The tokenized string that represents the template. Tokens use the `{n}` notation
|
|
2390
|
-
* where n is the ordinal of the item to replace the token.
|
|
2387
|
+
* where `n` is the ordinal of the item to replace the token.
|
|
2391
2388
|
*/
|
|
2392
2389
|
set: function (value) {
|
|
2393
2390
|
this._text = value;
|