@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
package/esm2015/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export * from './lib/modules/action-button/action-button-permalink';
|
|
|
2
2
|
export * from './lib/modules/action-button/action-button.module';
|
|
3
3
|
export * from './lib/modules/action-button/types/action-button-container-align-items';
|
|
4
4
|
export * from './lib/modules/action-button/types/action-button-container-align-items-type';
|
|
5
|
-
export * from './lib/modules/back-to-top/back-
|
|
5
|
+
export * from './lib/modules/back-to-top/back-to-top.module';
|
|
6
6
|
export * from './lib/modules/back-to-top/models/back-to-top-message';
|
|
7
7
|
export * from './lib/modules/back-to-top/models/back-to-top-message-type';
|
|
8
8
|
export * from './lib/modules/back-to-top/models/back-to-top-options';
|
package/esm2015/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/layout/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qDAAqD,CAAC;AACpE,cAAc,kDAAkD,CAAC;AACjE,cAAc,uEAAuE,CAAC;AACtF,cAAc,4EAA4E,CAAC;AAE3F,cAAc
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/layout/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qDAAqD,CAAC;AACpE,cAAc,kDAAkD,CAAC;AACjE,cAAc,uEAAuE,CAAC;AACtF,cAAc,4EAA4E,CAAC;AAE3F,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sDAAsD,CAAC;AACrE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,sDAAsD,CAAC;AAErE,cAAc,8BAA8B,CAAC;AAE7C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,sDAAsD,CAAC;AAErE,cAAc,wDAAwD,CAAC;AACvE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,iEAAiE,CAAC;AAEhF,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4DAA4D,CAAC;AAE3E,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kDAAkD,CAAC;AAEjE,cAAc,gCAAgC,CAAC;AAE/C,cAAc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,8BAA8B,IAAI,GAAG,EAAE,MAAM,mEAAmE,CAAC;AAC1H,OAAO,EAAE,mBAAmB,IAAI,GAAG,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,0BAA0B,IAAI,GAAG,EAAE,MAAM,iDAAiD,CAAC;AACpG,OAAO,EAAE,uBAAuB,IAAI,GAAG,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,EAAE,8BAA8B,IAAI,GAAG,EAAE,MAAM,sDAAsD,CAAC;AAC7G,OAAO,EAAE,eAAe,IAAI,GAAG,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,qBAAqB,IAAI,GAAG,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,sBAAsB,IAAI,GAAG,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,uBAAuB,IAAI,GAAG,EAAE,MAAM,0CAA0C,CAAC","sourcesContent":["export * from './lib/modules/action-button/action-button-permalink';\nexport * from './lib/modules/action-button/action-button.module';\nexport * from './lib/modules/action-button/types/action-button-container-align-items';\nexport * from './lib/modules/action-button/types/action-button-container-align-items-type';\n\nexport * from './lib/modules/back-to-top/back-to-top.module';\nexport * from './lib/modules/back-to-top/models/back-to-top-message';\nexport * from './lib/modules/back-to-top/models/back-to-top-message-type';\nexport * from './lib/modules/back-to-top/models/back-to-top-options';\n\nexport * from './lib/modules/box/box.module';\n\nexport * from './lib/modules/card/card.module';\n\nexport * from './lib/modules/definition-list/definition-list.module';\n\nexport * from './lib/modules/description-list/description-list.module';\nexport * from './lib/modules/description-list/types/description-list-mode';\nexport * from './lib/modules/description-list/types/description-list-mode-type';\n\nexport * from './lib/modules/fluid-grid/fluid-grid-gutter-size';\nexport * from './lib/modules/fluid-grid/fluid-grid.module';\nexport * from './lib/modules/fluid-grid/types/fluid-grid-gutter-size-type';\n\nexport * from './lib/modules/format/format-item';\nexport * from './lib/modules/format/format.module';\n\nexport * from './lib/modules/inline-delete/inline-delete-type';\nexport * from './lib/modules/inline-delete/inline-delete.module';\n\nexport * from './lib/modules/page/page.module';\n\nexport * from './lib/modules/page-summary/page-summary.module';\n\nexport * from './lib/modules/text-expand/text-expand.module';\n\nexport * from './lib/modules/text-expand-repeater/types/text-expand-repeater-list-style-type';\nexport * from './lib/modules/text-expand-repeater/text-expand-repeater.module';\n\nexport * from './lib/modules/toolbar/toolbar.module';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of public API.\nexport { SkyActionButtonComponent as λ1 } from './lib/modules/action-button/action-button.component';\nexport { SkyActionButtonContainerComponent as λ2 } from './lib/modules/action-button/action-button-container.component';\nexport { SkyActionButtonDetailsComponent as λ3 } from './lib/modules/action-button/action-button-details.component';\nexport { SkyActionButtonHeaderComponent as λ4 } from './lib/modules/action-button/action-button-header.component';\nexport { SkyActionButtonIconComponent as λ5 } from './lib/modules/action-button/action-button-icon.component';\nexport { SkyBackToTopComponent as λ6 } from './lib/modules/back-to-top/back-to-top.component';\nexport { SkyBackToTopDirective as λ7 } from './lib/modules/back-to-top/back-to-top.directive';\nexport { SkyInlineDeleteComponent as λ8 } from './lib/modules/inline-delete/inline-delete.component';\nexport { SkyCardComponent as λ9 } from './lib/modules/card/card.component';\nexport { SkyCardActionsComponent as λ10 } from './lib/modules/card/card-actions.component';\nexport { SkyCardContentComponent as λ11 } from './lib/modules/card/card-content.component';\nexport { SkyCardTitleComponent as λ12 } from './lib/modules/card/card-title.component';\nexport { SkyDefinitionListComponent as λ13 } from './lib/modules/definition-list/definition-list.component';\nexport { SkyDefinitionListContentComponent as λ14 } from './lib/modules/definition-list/definition-list-content.component';\nexport { SkyDefinitionListHeadingComponent as λ15 } from './lib/modules/definition-list/definition-list-heading.component';\nexport { SkyDefinitionListLabelComponent as λ16 } from './lib/modules/definition-list/definition-list-label.component';\nexport { SkyDefinitionListValueComponent as λ17 } from './lib/modules/definition-list/definition-list-value.component';\nexport { SkyDescriptionListComponent as λ18 } from './lib/modules/description-list/description-list.component';\nexport { SkyDescriptionListTermComponent as λ19 } from './lib/modules/description-list/description-list-term.component';\nexport { SkyDescriptionListDescriptionComponent as λ20 } from './lib/modules/description-list/description-list-description.component';\nexport { SkyDescriptionListContentComponent as λ21 } from './lib/modules/description-list/description-list-content.component';\nexport { SkyFluidGridComponent as λ22 } from './lib/modules/fluid-grid/fluid-grid.component';\nexport { SkyRowComponent as λ23 } from './lib/modules/fluid-grid//row.component';\nexport { SkyColumnComponent as λ24 } from './lib/modules/fluid-grid/column.component';\nexport { SkyFormatComponent as λ25 } from './lib/modules/format/format.component';\nexport { SkyPageComponent as λ26 } from './lib/modules/page/page.component';\nexport { SkyPageSummaryComponent as λ27 } from './lib/modules/page-summary/page-summary.component';\nexport { SkyPageSummaryAlertComponent as λ28 } from './lib/modules/page-summary/page-summary-alert.component';\nexport { SkyPageSummaryContentComponent as λ29 } from './lib/modules/page-summary/page-summary-content.component';\nexport { SkyPageSummaryImageComponent as λ30 } from './lib/modules/page-summary/page-summary-image.component';\nexport { SkyPageSummaryKeyInfoComponent as λ31 } from './lib/modules/page-summary/page-summary-key-info.component';\nexport { SkyPageSummaryStatusComponent as λ32 } from './lib/modules/page-summary/page-summary-status.component';\nexport { SkyPageSummarySubtitleComponent as λ33 } from './lib/modules/page-summary/page-summary-subtitle.component';\nexport { SkyPageSummaryTitleComponent as λ34 } from './lib/modules/page-summary/page-summary-title.component';\nexport { SkyTextExpandComponent as λ35 } from './lib/modules/text-expand/text-expand.component';\nexport { SkyTextExpandRepeaterComponent as λ36 } from './lib/modules/text-expand-repeater/text-expand-repeater.component';\nexport { SkyToolbarComponent as λ37 } from './lib/modules/toolbar/toolbar.component';\nexport { SkyToolbarSectionComponent as λ38 } from './lib/modules/toolbar/toolbar-section.component';\nexport { SkyToolbarItemComponent as λ39 } from './lib/modules/toolbar/toolbar-item.component';\nexport { SkyToolbarViewActionsComponent as λ40 } from './lib/modules/toolbar/toolbar-view-actions.component';\nexport { SkyBoxComponent as λ41 } from './lib/modules/box/box.component';\nexport { SkyBoxHeaderComponent as λ42 } from './lib/modules/box/box-header.component';\nexport { SkyBoxContentComponent as λ43 } from './lib/modules/box/box-content.component';\nexport { SkyBoxControlsComponent as λ44 } from './lib/modules/box/box-controls.component';\n"]}
|
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import { SkyAppWindowRef } from '@skyux/core';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { SkyAppWindowRef, SkyScrollableHostService } from '@skyux/core';
|
|
3
|
+
import { BehaviorSubject, Subject } from 'rxjs';
|
|
4
|
+
import { takeUntil } from 'rxjs/operators';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
import * as i1 from "@skyux/core";
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export class SkyBackToTopDomAdapterService {
|
|
11
|
-
constructor(windowRef) {
|
|
11
|
+
constructor(windowRef, scrollableHostService) {
|
|
12
12
|
this.windowRef = windowRef;
|
|
13
|
+
this.scrollableHostService = scrollableHostService;
|
|
13
14
|
this.ngUnsubscribe = new Subject();
|
|
15
|
+
this.scrollableHostScrollEventUnsubscribe = new Subject();
|
|
14
16
|
}
|
|
15
17
|
ngOnDestroy() {
|
|
16
18
|
this.ngUnsubscribe.next();
|
|
17
19
|
this.ngUnsubscribe.complete();
|
|
20
|
+
this.scrollableHostScrollEventUnsubscribe.next();
|
|
21
|
+
this.scrollableHostScrollEventUnsubscribe.complete();
|
|
18
22
|
}
|
|
19
23
|
/**
|
|
20
24
|
* This event returns a boolean on scroll indicating whether the provided element is in view.
|
|
21
25
|
* @param elementRef The target element reference.
|
|
22
26
|
*/
|
|
23
27
|
elementInViewOnScroll(elementRef) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
const scrollableHostObservable = this.scrollableHostService.watchScrollableHostScrollEvents(elementRef);
|
|
29
|
+
const isInitiallyInView = this.isElementScrolledInView(elementRef);
|
|
30
|
+
const returnedObservable = new BehaviorSubject(isInitiallyInView);
|
|
31
|
+
scrollableHostObservable
|
|
32
|
+
.pipe(takeUntil(this.scrollableHostScrollEventUnsubscribe))
|
|
33
|
+
.subscribe(() => {
|
|
34
|
+
const isInView = this.isElementScrolledInView(elementRef);
|
|
35
|
+
returnedObservable.next(isInView);
|
|
36
|
+
});
|
|
37
|
+
return returnedObservable;
|
|
29
38
|
}
|
|
30
39
|
/**
|
|
31
40
|
* Scrolls the window or scrollable parent to the provided element.
|
|
@@ -37,9 +46,8 @@ export class SkyBackToTopDomAdapterService {
|
|
|
37
46
|
if (!elementRef || !elementRef.nativeElement) {
|
|
38
47
|
return;
|
|
39
48
|
}
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
if (parent === windowObj) {
|
|
49
|
+
const scrollableHost = this.scrollableHostService.getScrollableHost(elementRef);
|
|
50
|
+
if (scrollableHost instanceof Window) {
|
|
43
51
|
// Scroll to top of window, but account for the body margin that allows for the omnibar if it exists.
|
|
44
52
|
const bodyMarginOffset = parseInt(getComputedStyle(document.body).marginTop, 10);
|
|
45
53
|
const newOffsetTop = elementRef.nativeElement.offsetTop - bodyMarginOffset;
|
|
@@ -47,43 +55,30 @@ export class SkyBackToTopDomAdapterService {
|
|
|
47
55
|
}
|
|
48
56
|
else {
|
|
49
57
|
// Scroll to top of parent element.
|
|
50
|
-
|
|
58
|
+
scrollableHost.scrollTop =
|
|
59
|
+
scrollableHost.offsetTop - elementRef.nativeElement.offsetTop;
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
let style = windowObj.getComputedStyle(element);
|
|
58
|
-
let parent = element;
|
|
59
|
-
do {
|
|
60
|
-
parent = parent.parentNode;
|
|
61
|
-
style = windowObj.getComputedStyle(parent);
|
|
62
|
-
} while (!regex.test(style.overflow) &&
|
|
63
|
-
!regex.test(style.overflowY) &&
|
|
64
|
-
parent !== bodyObj);
|
|
65
|
-
if (parent === bodyObj) {
|
|
66
|
-
return windowObj;
|
|
62
|
+
isElementScrolledInView(element) {
|
|
63
|
+
const parentElement = this.scrollableHostService.getScrollableHost(element.nativeElement);
|
|
64
|
+
if (!element.nativeElement.offsetParent) {
|
|
65
|
+
return true;
|
|
67
66
|
}
|
|
68
|
-
return parent;
|
|
69
|
-
}
|
|
70
|
-
isElementScrolledInView(element, parentElement) {
|
|
71
67
|
const buffer = 25;
|
|
72
|
-
const
|
|
73
|
-
const elementRect = element.getBoundingClientRect();
|
|
68
|
+
const elementRect = element.nativeElement.getBoundingClientRect();
|
|
74
69
|
/* istanbul ignore else */
|
|
75
|
-
if (parentElement
|
|
76
|
-
return elementRect.top > -buffer;
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
70
|
+
if (parentElement instanceof HTMLElement) {
|
|
79
71
|
const parentRect = parentElement.getBoundingClientRect();
|
|
80
72
|
return elementRect.top > parentRect.top - buffer;
|
|
81
73
|
}
|
|
74
|
+
else {
|
|
75
|
+
return elementRect.top > -buffer;
|
|
76
|
+
}
|
|
82
77
|
}
|
|
83
78
|
}
|
|
84
|
-
SkyBackToTopDomAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyBackToTopDomAdapterService, deps: [{ token: i1.SkyAppWindowRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
79
|
+
SkyBackToTopDomAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyBackToTopDomAdapterService, deps: [{ token: i1.SkyAppWindowRef }, { token: i1.SkyScrollableHostService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
85
80
|
SkyBackToTopDomAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyBackToTopDomAdapterService });
|
|
86
81
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyBackToTopDomAdapterService, decorators: [{
|
|
87
82
|
type: Injectable
|
|
88
|
-
}], ctorParameters: function () { return [{ type: i1.SkyAppWindowRef }]; } });
|
|
83
|
+
}], ctorParameters: function () { return [{ type: i1.SkyAppWindowRef }, { type: i1.SkyScrollableHostService }]; } });
|
|
89
84
|
//# sourceMappingURL=back-to-top-adapter.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"back-to-top-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/back-to-top/back-to-top-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAa,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"back-to-top-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/back-to-top/back-to-top-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAa,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAExE,OAAO,EAAE,eAAe,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;;;AAE3C;;GAEG;AAEH,MAAM,OAAO,6BAA6B;IAIxC,YACU,SAA0B,EAC1B,qBAA+C;QAD/C,cAAS,GAAT,SAAS,CAAiB;QAC1B,0BAAqB,GAArB,qBAAqB,CAA0B;QALjD,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;QACpC,yCAAoC,GAAG,IAAI,OAAO,EAAQ,CAAC;IAKhE,CAAC;IAEG,WAAW;QAChB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,a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,CAAC,aAAa,CAAC,UAAU,EACnC,YAAY,CACb,CAAC;SACH;aAAM;YACL,mCAAmC;YACnC,cAAc,CAAC,SAAS;gBACtB,cAAc,CAAC,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;SACjE;IACH,CAAC;IAEM,uBAAuB,CAAC,OAAmB;QAChD,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,iBAAiB,CAChE,OAAO,CAAC,aAAa,CACtB,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,YAAY,EAAE;YACvC,OAAO,IAAI,CAAC;SACb;QACD,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;QAElE,0BAA0B;QAC1B,IAAI,aAAa,YAAY,WAAW,EAAE;YACxC,MAAM,UAAU,GAAG,aAAa,CAAC,qBAAqB,EAAE,CAAC;YACzD,OAAO,WAAW,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,GAAG,MAAM,CAAC;SAClD;aAAM;YACL,OAAO,WAAW,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;SAClC;IACH,CAAC;;2HAvFU,6BAA6B;+HAA7B,6BAA6B;4FAA7B,6BAA6B;kBADzC,UAAU","sourcesContent":["import { ElementRef, Injectable, OnDestroy } from '@angular/core';\nimport { SkyAppWindowRef, SkyScrollableHostService } from '@skyux/core';\n\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyBackToTopDomAdapterService implements OnDestroy {\n private ngUnsubscribe = new Subject<void>();\n private scrollableHostScrollEventUnsubscribe = new Subject<void>();\n\n constructor(\n private windowRef: SkyAppWindowRef,\n private scrollableHostService: SkyScrollableHostService\n ) {}\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.scrollableHostScrollEventUnsubscribe.next();\n this.scrollableHostScrollEventUnsubscribe.complete();\n }\n\n /**\n * This event returns a boolean on scroll indicating whether the provided element is in view.\n * @param elementRef The target element reference.\n */\n public elementInViewOnScroll(elementRef: ElementRef): Observable<boolean> {\n const scrollableHostObservable =\n this.scrollableHostService.watchScrollableHostScrollEvents(elementRef);\n\n const isInitiallyInView = this.isElementScrolledInView(elementRef);\n const returnedObservable = new BehaviorSubject<boolean>(isInitiallyInView);\n\n scrollableHostObservable\n .pipe(takeUntil(this.scrollableHostScrollEventUnsubscribe))\n .subscribe(() => {\n const isInView = this.isElementScrolledInView(elementRef);\n returnedObservable.next(isInView);\n });\n\n return returnedObservable;\n }\n\n /**\n * Scrolls the window or scrollable parent to the provided element.\n * @param elementRef The target element reference.\n */\n public scrollToElement(elementRef: ElementRef): void {\n /* sanity check */\n /* istanbul ignore if */\n if (!elementRef || !elementRef.nativeElement) {\n return;\n }\n\n const scrollableHost =\n this.scrollableHostService.getScrollableHost(elementRef);\n\n if (scrollableHost instanceof Window) {\n // Scroll to top of window, but account for the body margin that allows for the omnibar if it exists.\n const bodyMarginOffset = parseInt(\n getComputedStyle(document.body).marginTop,\n 10\n );\n const newOffsetTop =\n elementRef.nativeElement.offsetTop - bodyMarginOffset;\n this.windowRef.nativeWindow.scrollTo(\n elementRef.nativeElement.offsetLeft,\n newOffsetTop\n );\n } else {\n // Scroll to top of parent element.\n scrollableHost.scrollTop =\n scrollableHost.offsetTop - elementRef.nativeElement.offsetTop;\n }\n }\n\n public isElementScrolledInView(element: ElementRef): boolean {\n const parentElement = this.scrollableHostService.getScrollableHost(\n element.nativeElement\n );\n if (!element.nativeElement.offsetParent) {\n return true;\n }\n const buffer = 25;\n const elementRect = element.nativeElement.getBoundingClientRect();\n\n /* istanbul ignore else */\n if (parentElement instanceof HTMLElement) {\n const parentRect = parentElement.getBoundingClientRect();\n return elementRect.top > parentRect.top - buffer;\n } else {\n return elementRect.top > -buffer;\n }\n }\n}\n"]}
|
|
@@ -41,8 +41,7 @@ export class SkyBackToTopDirective {
|
|
|
41
41
|
.subscribe((message) => this.handleIncomingMessages(message));
|
|
42
42
|
}
|
|
43
43
|
ngAfterViewInit() {
|
|
44
|
-
|
|
45
|
-
this.elementInView = this.domAdapter.isElementScrolledInView(this.element.nativeElement, scrollableParent);
|
|
44
|
+
this.elementInView = this.domAdapter.isElementScrolledInView(this.element);
|
|
46
45
|
this.handleBackToTopButton(this.elementInView);
|
|
47
46
|
this.setBackToTopListeners();
|
|
48
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"back-to-top.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/back-to-top/back-to-top.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,UAAU,EACV,KAAK,GAEN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;;;;AAG5E;;;GAGG;AAKH,MAAM,OAAO,qBAAqB;IAmChC,YACU,WAA2B,EAC3B,UAAyC,EACzC,OAAmB;QAFnB,gBAAW,GAAX,WAAW,CAAgB;QAC3B,eAAU,GAAV,UAAU,CAA+B;QACzC,YAAO,GAAP,OAAO,CAAY;QAVrB,iBAAY,GAAG,KAAK,CAAC;QAIrB,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;IAOzC,CAAC;IAtCJ;;OAEG;IACH,IACW,YAAY,CAAC,KAA0B;QAChD,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,YAAY,CAAA,CAAC;QAE1C,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACH,IACW,yBAAyB,CAAC,KAAmC;QACtE,IAAI,IAAI,CAAC,0BAA0B,EAAE;YACnC,IAAI,CAAC,0BAA0B,CAAC,WAAW,EAAE,CAAC;SAC/C;QACD,IAAI,CAAC,0BAA0B,GAAG,KAAK,CAAC;QACxC,IAAI,CAAC,0BAA0B;aAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;aACnC,SAAS,CAAC,CAAC,OAA4B,EAAE,EAAE,CAC1C,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CACrC,CAAC;IACN,CAAC;IAeM,eAAe;QACpB,
|
|
1
|
+
{"version":3,"file":"back-to-top.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/back-to-top/back-to-top.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,UAAU,EACV,KAAK,GAEN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;;;;AAG5E;;;GAGG;AAKH,MAAM,OAAO,qBAAqB;IAmChC,YACU,WAA2B,EAC3B,UAAyC,EACzC,OAAmB;QAFnB,gBAAW,GAAX,WAAW,CAAgB;QAC3B,eAAU,GAAV,UAAU,CAA+B;QACzC,YAAO,GAAP,OAAO,CAAY;QAVrB,iBAAY,GAAG,KAAK,C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B;uGAArB,qBAAqB,2IAFrB,CAAC,6BAA6B,CAAC;4FAE/B,qBAAqB;kBAJjC,SAAS;mBAAC;oBACT,QAAQ,EAAE,gBAAgB;oBAC1B,SAAS,EAAE,CAAC,6BAA6B,CAAC;iBAC3C;0KAMY,YAAY;sBADtB,KAAK;gBAYK,yBAAyB;sBADnC,KAAK","sourcesContent":["import {\n AfterViewInit,\n Directive,\n ElementRef,\n Input,\n OnDestroy,\n} from '@angular/core';\nimport { SkyDockItem, SkyDockService } from '@skyux/core';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyBackToTopDomAdapterService } from './back-to-top-adapter.service';\nimport { SkyBackToTopComponent } from './back-to-top.component';\nimport { SkyBackToTopMessage } from './models/back-to-top-message';\nimport { SkyBackToTopMessageType } from './models/back-to-top-message-type';\nimport { SkyBackToTopOptions } from './models/back-to-top-options';\n\n/**\n * Associates a button with an element on the page and displays that button\n * to return to the element after users scroll away.\n */\n@Directive({\n selector: '[skyBackToTop]',\n providers: [SkyBackToTopDomAdapterService],\n})\nexport class SkyBackToTopDirective implements AfterViewInit, OnDestroy {\n /**\n * Specifies configuration options for the back to top component.\n */\n @Input()\n public set skyBackToTop(value: SkyBackToTopOptions) {\n this.buttonHidden = !!value?.buttonHidden;\n\n this.handleBackToTopButton(this.elementInView);\n }\n\n /**\n * Provides an observable to send commands to the back to top component.\n * The commands respect the `SkyBackToTopMessage` type.\n */\n @Input()\n public set skyBackToTopMessageStream(value: Subject<SkyBackToTopMessage>) {\n if (this._skyBackToTopMessageStream) {\n this._skyBackToTopMessageStream.unsubscribe();\n }\n this._skyBackToTopMessageStream = value;\n this._skyBackToTopMessageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message: SkyBackToTopMessage) =>\n this.handleIncomingMessages(message)\n );\n }\n\n private buttonHidden = false;\n private dockItem: SkyDockItem<SkyBackToTopComponent>;\n private elementInView: boolean;\n\n private ngUnsubscribe = new Subject<void>();\n private _skyBackToTopMessageStream: Subject<SkyBackToTopMessage>;\n\n constructor(\n private dockService: SkyDockService,\n private domAdapter: SkyBackToTopDomAdapterService,\n private element: ElementRef\n ) {}\n\n public ngAfterViewInit(): void {\n this.elementInView = this.domAdapter.isElementScrolledInView(this.element);\n\n this.handleBackToTopButton(this.elementInView);\n this.setBackToTopListeners();\n }\n\n public ngOnDestroy(): void {\n if (this.dockItem) {\n this.dockItem.destroy();\n }\n }\n\n private handleBackToTopButton(elementInView: boolean): void {\n // Add back to top button if user scrolls down and button is not hidden.\n if (\n !this.dockItem &&\n elementInView !== undefined &&\n !elementInView &&\n !this.buttonHidden\n ) {\n this.addBackToTop();\n }\n // Remove back to top button if user scrolls back up.\n if (elementInView || this.buttonHidden) {\n this.destroyBackToTop();\n }\n }\n\n private addBackToTop(): void {\n this.dockItem = this.dockService.insertComponent(SkyBackToTopComponent);\n\n // Listen for clicks on the \"back to top\" button so we know when to scroll up.\n this.dockItem.componentInstance.scrollToTopClick\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.domAdapter.scrollToElement(this.element);\n });\n }\n\n private handleIncomingMessages(message: SkyBackToTopMessage): void {\n /* istanbul ignore else */\n if (message.type === SkyBackToTopMessageType.BackToTop) {\n this.domAdapter.scrollToElement(this.element);\n }\n }\n\n private setBackToTopListeners(): void {\n /* istanbul ignore else */\n if (this.element) {\n this.domAdapter\n .elementInViewOnScroll(this.element)\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((elementInView: boolean) => {\n this.elementInView = elementInView;\n\n this.handleBackToTopButton(elementInView);\n });\n }\n }\n\n private destroyBackToTop(): void {\n /* istanbul ignore else */\n if (this.dockItem) {\n this.dockItem.destroy();\n this.dockItem = undefined;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"back-to-top.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/back-to-top/back-to-top.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;;AAahE,MAAM,OAAO,kBAAkB;;gHAAlB,kBAAkB;iHAAlB,kBAAkB,iBAVd,qBAAqB,EAAE,qBAAqB,aAEzD,YAAY;QACZ,aAAa;QACb,aAAa;QACb,wBAAwB,aAEhB,qBAAqB,EAAE,qBAAqB;iHAG3C,kBAAkB,YATpB;YACP,YAAY;YACZ,aAAa;YACb,aAAa;YACb,wBAAwB;SACzB;4FAIU,kBAAkB;kBAX9B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;oBAC5D,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,aAAa;wBACb,wBAAwB;qBACzB;oBACD,OAAO,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;oBACvD,eAAe,EAAE,CAAC,qBAAqB,CAAC;iBACzC","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyDockModule } from '@skyux/core';\nimport { SkyI18nModule } from '@skyux/i18n';\n\nimport { SkyLayoutResourcesModule } from '../shared/sky-layout-resources.module';\n\nimport { SkyBackToTopComponent } from './back-to-top.component';\nimport { SkyBackToTopDirective } from './back-to-top.directive';\n\n@NgModule({\n declarations: [SkyBackToTopComponent, SkyBackToTopDirective],\n imports: [\n CommonModule,\n SkyDockModule,\n SkyI18nModule,\n SkyLayoutResourcesModule,\n ],\n exports: [SkyBackToTopComponent, SkyBackToTopDirective],\n entryComponents: [SkyBackToTopComponent],\n})\nexport class SkyBackToTopModule {}\n"]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Component, HostBinding, Input, ViewEncapsulation, } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Displays a column within a row of the fluid grid.
|
|
5
|
+
*/
|
|
3
6
|
export class SkyColumnComponent {
|
|
4
7
|
ngOnChanges(changes) {
|
|
5
8
|
/* istanbul ignore else */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/fluid-grid/column.component.ts","../../../../../../../../libs/components/layout/src/lib/modules/fluid-grid/column.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,KAAK,EAIL,iBAAiB,GAClB,MAAM,eAAe,CAAC;;
|
|
1
|
+
{"version":3,"file":"column.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/fluid-grid/column.component.ts","../../../../../../../../libs/components/layout/src/lib/modules/fluid-grid/column.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,KAAK,EAIL,iBAAiB,GAClB,MAAM,eAAe,CAAC;;AAEvB;;GAEG;AAOH,MAAM,OAAO,kBAAkB;IAqCtB,WAAW,CAAC,OAAsB;QACvC,0BAA0B;QAC1B,IACE,OAAO,CAAC,YAAY;YACpB,OAAO,CAAC,WAAW;YACnB,OAAO,CAAC,YAAY;YACpB,OAAO,CAAC,WAAW,EACnB;YACA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;SACxC;IACH,CAAC;IAEM,aAAa;QAClB,MAAM,UAAU,GAAG,CAAC,YAAY,CAAC,CAAC;QAElC,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,UAAU,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;SACvD;QAED,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,UAAU,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;SACtD;QAED,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,UAAU,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;SACvD;QAED,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,UAAU,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;SACtD;QAED,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAEM,QAAQ;QACb,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;;gHAzEU,kBAAkB;oGAAlB,kBAAkB,6PCnB/B,6BACA;4FDkBa,kBAAkB;kBAN9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,YAAY;oBACtB,WAAW,EAAE,yBAAyB;oBACtC,SAAS,EAAE,CAAC,yBAAyB,CAAC;oBACtC,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;8BASQ,YAAY;sBADlB,KAAK;gBASC,WAAW;sBADjB,KAAK;gBASC,YAAY;sBADlB,KAAK;gBASC,WAAW;sBADjB,KAAK;gBAIC,UAAU;sBADhB,WAAW;uBAAC,OAAO","sourcesContent":["import {\n Component,\n HostBinding,\n Input,\n OnChanges,\n OnInit,\n SimpleChanges,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Displays a column within a row of the fluid grid.\n */\n@Component({\n selector: 'sky-column',\n templateUrl: './column.component.html',\n styleUrls: ['./column.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkyColumnComponent implements OnInit, OnChanges {\n /**\n * Specifies the number of columns (1-12) to use on extra-small screens\n * (less than 768px). If you do not specify a value, the fluid grid displays\n * the column at the full width of the screen.\n * @default 12\n */\n @Input()\n public screenXSmall: number;\n\n /**\n * Specifies the number of columns (1-12) to use on small screens\n * (768-991px). If you do not specify a value, the column inherits\n * the `screenXSmall` value.\n */\n @Input()\n public screenSmall: number;\n\n /**\n * Specifies the number of columns (1-12) to use on medium screens\n * (992-1199px). If you do not specify a value, the column inherits\n * the `screenSmall` value.\n */\n @Input()\n public screenMedium: number;\n\n /**\n * Specifies the number of columns (1-12) to use on large screens\n * (more than 1200px). If you do not specify a value, the column\n * inherits the `screenMedium` value.\n */\n @Input()\n public screenLarge: number;\n\n @HostBinding('class')\n public classnames: string;\n\n public ngOnChanges(changes: SimpleChanges) {\n /* istanbul ignore else */\n if (\n changes.screenXSmall ||\n changes.screenSmall ||\n changes.screenMedium ||\n changes.screenLarge\n ) {\n this.classnames = this.getClassNames();\n }\n }\n\n public getClassNames(): string {\n const classnames = ['sky-column'];\n\n if (this.screenXSmall) {\n classnames.push(`sky-column-xs-${this.screenXSmall}`);\n }\n\n if (this.screenSmall) {\n classnames.push(`sky-column-sm-${this.screenSmall}`);\n }\n\n if (this.screenMedium) {\n classnames.push(`sky-column-md-${this.screenMedium}`);\n }\n\n if (this.screenLarge) {\n classnames.push(`sky-column-lg-${this.screenLarge}`);\n }\n\n return classnames.join(' ');\n }\n\n public ngOnInit(): void {\n this.classnames = this.getClassNames();\n }\n}\n","<ng-content></ng-content>\n"]}
|
|
@@ -5,7 +5,7 @@ const tokenRegex = /(\{\d+\})/;
|
|
|
5
5
|
export class SkyFormatComponent {
|
|
6
6
|
/**
|
|
7
7
|
* The tokenized string that represents the template. Tokens use the `{n}` notation
|
|
8
|
-
* where n is the ordinal of the item to replace the token.
|
|
8
|
+
* where `n` is the ordinal of the item to replace the token.
|
|
9
9
|
*/
|
|
10
10
|
set text(value) {
|
|
11
11
|
this._text = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/format/format.component.ts","../../../../../../../../libs/components/layout/src/lib/modules/format/format.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,KAAK,GAEN,MAAM,eAAe,CAAC;;;AAIvB,MAAM,UAAU,GAAG,WAAW,CAAC;AAO/B,MAAM,OAAO,kBAAkB;IAG7B;;;OAGG;IACH,IACW,IAAI,CAAC,KAAa;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC/B,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,IACW,IAAI,CAAC,KAAyB;QACvC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC/B,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAMO,qBAAqB;QAC3B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAE1B,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;YAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAE9C,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;gBAChC,2BAA2B;gBAC3B,IAAI,QAAQ,EAAE;oBACZ,MAAM,IAAI,GAAkB,EAAE,CAAC;oBAE/B,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;wBAC7B,MAAM,UAAU,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;wBAE/D,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;qBAC1C;yBAAM;wBACL,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;qBACtB;oBAED,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACjC;aACF;SACF;IACH,CAAC;;gHA1DU,kBAAkB;oGAAlB,kBAAkB,0FChB/B,sRAQA;4FDQa,kBAAkB;kBAL9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,YAAY;oBACtB,WAAW,EAAE,yBAAyB;oBACtC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BASY,IAAI;sBADd,KAAK;gBAeK,IAAI;sBADd,KAAK","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n TemplateRef,\n} from '@angular/core';\n\nimport { SkyFormatItem } from './format-item';\n\nconst tokenRegex = /(\\{\\d+\\})/;\n\n@Component({\n selector: 'sky-format',\n templateUrl: './format.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyFormatComponent {\n public itemsForDisplay: SkyFormatItem[];\n\n /**\n * The tokenized string that represents the template. Tokens use the `{n}` notation\n * where n is the ordinal of the item to replace the token.\n */\n @Input()\n public set text(value: string) {\n this._text = value;\n this.updateItemsForDisplay();\n }\n\n public get text(): string {\n return this._text;\n }\n\n /**\n * An array of `TemplateRef` objects to be placed in the template, where the `nth`\n * item is placed at the `{n}` location in the template.\n */\n @Input()\n public set args(value: TemplateRef<any>[]) {\n this._args = value;\n this.updateItemsForDisplay();\n }\n\n public get args(): TemplateRef<any>[] {\n return this._args;\n }\n\n private _text: string;\n\n private _args: TemplateRef<any>[];\n\n private updateItemsForDisplay(): void {\n this.itemsForDisplay = [];\n\n if (this.text && this.args) {\n const textParts = this.text.split(tokenRegex);\n\n for (const textPart of textParts) {\n // Disregard empty strings.\n if (textPart) {\n const item: SkyFormatItem = {};\n\n if (tokenRegex.test(textPart)) {\n const valueIndex = +textPart.substring(1, textPart.length - 1);\n\n item.templateRef = this.args[valueIndex];\n } else {\n item.text = textPart;\n }\n\n this.itemsForDisplay.push(item);\n }\n }\n }\n }\n}\n","<ng-container *ngFor=\"let item of itemsForDisplay\">\n <!--\n The following ng-container must be on one line so no extra whitespace is introduced.\n -->\n <ng-container *ngIf=\"item.text; else item.templateRef\">{{\n item.text\n }}</ng-container>\n</ng-container>\n"]}
|
|
1
|
+
{"version":3,"file":"format.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/format/format.component.ts","../../../../../../../../libs/components/layout/src/lib/modules/format/format.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,KAAK,GAEN,MAAM,eAAe,CAAC;;;AAIvB,MAAM,UAAU,GAAG,WAAW,CAAC;AAO/B,MAAM,OAAO,kBAAkB;IAG7B;;;OAGG;IACH,IACW,IAAI,CAAC,KAAa;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC/B,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,IACW,IAAI,CAAC,KAAyB;QACvC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC/B,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAMO,qBAAqB;QAC3B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAE1B,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;YAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAE9C,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;gBAChC,2BAA2B;gBAC3B,IAAI,QAAQ,EAAE;oBACZ,MAAM,IAAI,GAAkB,EAAE,CAAC;oBAE/B,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;wBAC7B,MAAM,UAAU,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;wBAE/D,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;qBAC1C;yBAAM;wBACL,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;qBACtB;oBAED,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACjC;aACF;SACF;IACH,CAAC;;gHA1DU,kBAAkB;oGAAlB,kBAAkB,0FChB/B,sRAQA;4FDQa,kBAAkB;kBAL9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,YAAY;oBACtB,WAAW,EAAE,yBAAyB;oBACtC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BASY,IAAI;sBADd,KAAK;gBAeK,IAAI;sBADd,KAAK","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n TemplateRef,\n} from '@angular/core';\n\nimport { SkyFormatItem } from './format-item';\n\nconst tokenRegex = /(\\{\\d+\\})/;\n\n@Component({\n selector: 'sky-format',\n templateUrl: './format.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyFormatComponent {\n public itemsForDisplay: SkyFormatItem[];\n\n /**\n * The tokenized string that represents the template. Tokens use the `{n}` notation\n * where `n` is the ordinal of the item to replace the token.\n */\n @Input()\n public set text(value: string) {\n this._text = value;\n this.updateItemsForDisplay();\n }\n\n public get text(): string {\n return this._text;\n }\n\n /**\n * An array of `TemplateRef` objects to be placed in the template, where the `nth`\n * item is placed at the `{n}` location in the template.\n */\n @Input()\n public set args(value: TemplateRef<any>[]) {\n this._args = value;\n this.updateItemsForDisplay();\n }\n\n public get args(): TemplateRef<any>[] {\n return this._args;\n }\n\n private _text: string;\n\n private _args: TemplateRef<any>[];\n\n private updateItemsForDisplay(): void {\n this.itemsForDisplay = [];\n\n if (this.text && this.args) {\n const textParts = this.text.split(tokenRegex);\n\n for (const textPart of textParts) {\n // Disregard empty strings.\n if (textPart) {\n const item: SkyFormatItem = {};\n\n if (tokenRegex.test(textPart)) {\n const valueIndex = +textPart.substring(1, textPart.length - 1);\n\n item.templateRef = this.args[valueIndex];\n } else {\n item.text = textPart;\n }\n\n this.itemsForDisplay.push(item);\n }\n }\n }\n }\n}\n","<ng-container *ngFor=\"let item of itemsForDisplay\">\n <!--\n The following ng-container must be on one line so no extra whitespace is introduced.\n -->\n <ng-container *ngIf=\"item.text; else item.templateRef\">{{\n item.text\n }}</ng-container>\n</ng-container>\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-delete-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/inline-delete/inline-delete-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;;;AAEpD;;GAEG;AAEH,MAAM,OAAO,6BAA6B;IAOxC,YACU,kBAAyC,EACjD,eAAiC;QADzB,uBAAkB,GAAlB,kBAAkB,CAAuB;QAGjD,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvE,CAAC;IAEM,cAAc;QACnB,0BAA0B;QAC1B,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,IAAI,CAAC,kBAAkB,EAAE,CAAC;SAC3B;IACH,CAAC;IAEM,KAAK,CAAC,OAAoB;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC;QAEtC,0BAA0B;QAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAC5C,IAAI,CAAC,QAAQ,EACb,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BAC9B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;oBAC9B,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC,CAAC,CAC7D,CAAC;IACJ,CAAC;IAEO,eAAe,CAAC,OAAY;QAClC,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC/C,OAAO,KAAK,CAAC,OAAO,KAAK,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ,CAAC;IACnE,CAAC;IAEO,OAAO,CAAC,KAAY;QAC1B,yDAAyD;QACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAClD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CACtC,CAAC;QAEF,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAE,KAAa,CAAC,aAAa,CAAC,CAAC;QACnE,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,MAAqB,CAAC,CAAC;QAEjE,0BAA0B;QAC1B,OAAO,CACL,WAAW,KAAK,UAAU,GAAG,CAAC;YAC9B,CAAC,WAAW,KAAK,CAAC,IAAI,UAAU,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;YACzD,WAAW,GAAG,UAAU;YACxB,CAAE,KAAa,CAAC,aAAa,CAC9B,CAAC;IACJ,CAAC;;2HArJU,6BAA6B;+HAA7B,6BAA6B;4FAA7B,6BAA6B;kBADzC,UAAU","sourcesContent":["import { Injectable, Renderer2, RendererFactory2 } from '@angular/core';\nimport { SkyCoreAdapterService } from '@skyux/core';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyInlineDeleteAdapterService {\n private element: HTMLElement;\n private focussableElements: HTMLElement[];\n private parentEl: HTMLElement;\n private parentElUnlistenFn:
|
|
1
|
+
{"version":3,"file":"inline-delete-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/inline-delete/inline-delete-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;;;AAEpD;;GAEG;AAEH,MAAM,OAAO,6BAA6B;IAOxC,YACU,kBAAyC,EACjD,eAAiC;QADzB,uBAAkB,GAAlB,kBAAkB,CAAuB;QAGjD,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvE,CAAC;IAEM,cAAc;QACnB,0BAA0B;QAC1B,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,IAAI,CAAC,kBAAkB,EAAE,CAAC;SAC3B;IACH,CAAC;IAEM,KAAK,CAAC,OAAoB;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC;QAEtC,0BAA0B;QAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAC5C,IAAI,CAAC,QAAQ,EACb,SAAS,EACT,CAAC,KAAiB,EAAE,EAAE;gBACpB,MAAM,MAAM,GAAQ,KAAK,CAAC,MAAM,CAAC;gBACjC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,MAAM,EAAE;oBAC9D,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;oBACxB,KAAK,CAAC,wBAAwB,EAAE,CAAC;oBAEjC,MAAM,CAAC,IAAI,EAAE,CAAC;oBACd,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,I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B,yDAAyD;QACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAClD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CACtC,CAAC;QAEF,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAE,KAAa,CAAC,aAAa,CAAC,CAAC;QACnE,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,MAAqB,CAAC,CAAC;QAEjE,0BAA0B;QAC1B,OAAO,CACL,WAAW,KAAK,UAAU,GAAG,CAAC;YAC9B,CAAC,WAAW,KAAK,CAAC,IAAI,UAAU,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;YACzD,WAAW,GAAG,UAAU;YACxB,CAAE,KAAa,CAAC,aAAa,CAC9B,CAAC;IACJ,CAAC;;2HArJU,6BAA6B;+HAA7B,6BAA6B;4FAA7B,6BAA6B;kBADzC,UAAU","sourcesContent":["import { Injectable, Renderer2, RendererFactory2 } from '@angular/core';\nimport { SkyCoreAdapterService } from '@skyux/core';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyInlineDeleteAdapterService {\n private element: HTMLElement;\n private focussableElements: HTMLElement[];\n private parentEl: HTMLElement;\n private parentElUnlistenFn: () => void;\n private renderer: Renderer2;\n\n constructor(\n private coreAdapterService: SkyCoreAdapterService,\n rendererFactory: RendererFactory2\n ) {\n this.renderer = rendererFactory.createRenderer(undefined, undefined);\n }\n\n public clearListeners(): void {\n /* istanbul ignore else */\n if (this.parentElUnlistenFn) {\n this.parentElUnlistenFn();\n }\n }\n\n public setEl(element: HTMLElement): void {\n this.element = element;\n this.parentEl = element.parentElement;\n\n /* istanbul ignore else */\n if (this.parentEl) {\n this.parentElUnlistenFn = this.renderer.listen(\n this.parentEl,\n 'focusin',\n (event: FocusEvent) => {\n const target: any = event.target;\n if (!this.element.contains(target) && this.parentEl !== target) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n\n target.blur();\n this.focusNextElement(target, this.isShift(event), this.parentEl);\n }\n }\n );\n }\n }\n\n private focusNextElement(\n targetElement: HTMLElement,\n shiftKey: boolean,\n busyEl: Element\n ): void {\n const focussable = this.getFocussableElements();\n\n // If shift tab, go in the other direction\n const modifier = shiftKey ? -1 : 1;\n\n // Find the next navigable element that isn't waiting\n const startingIndex = focussable.indexOf(targetElement);\n let curIndex = startingIndex + modifier;\n while (\n focussable[curIndex] &&\n this.isElementHiddenOrCovered(focussable[curIndex])\n ) {\n curIndex += modifier;\n }\n\n if (\n focussable[curIndex] &&\n !this.isElementHiddenOrCovered(focussable[curIndex])\n ) {\n focussable[curIndex].focus();\n } else {\n // Try wrapping the navigation\n /* istanbul ignore next */\n curIndex = modifier > 0 ? 0 : focussable.length - 1;\n\n /* istanbul ignore next */\n while (\n curIndex !== startingIndex &&\n focussable[curIndex] &&\n this.isElementHiddenOrCovered(focussable[curIndex])\n ) {\n curIndex += modifier;\n }\n\n /* istanbul ignore else */\n /* sanity check */\n if (\n focussable[curIndex] &&\n !this.isElementHiddenOrCovered(focussable[curIndex])\n ) {\n focussable[curIndex].focus();\n } else {\n // No valid target, wipe focus\n // This should never happen in practice due to the multiple inline delete buttons\n if (document.activeElement && (document.activeElement as any).blur) {\n (document.activeElement as any).blur();\n }\n document.body.focus();\n }\n }\n\n // clear focussableElements list so that if things change between tabbing we know about it\n this.focussableElements = undefined;\n }\n\n private getFocussableElements(): HTMLElement[] {\n // Keep this cached so we can reduce querys\n if (this.focussableElements) {\n return this.focussableElements;\n }\n\n this.focussableElements = this.coreAdapterService.getFocusableChildren(\n document.body\n );\n\n return this.focussableElements;\n }\n\n private isElementHiddenOrCovered(element: any): boolean {\n // Check if the element is hidden by css, not within the inline delete, or a wait is covering it\n return (\n this.isElementHidden(element) ||\n (this.parentEl.contains(element) &&\n (!this.element.contains(element) ||\n this.parentEl.querySelector('.sky-wait-mask') !== null))\n );\n }\n\n private isElementHidden(element: any): boolean {\n const style = window.getComputedStyle(element);\n return style.display === 'none' || style.visibility === 'hidden';\n }\n\n private isShift(event: Event): boolean {\n // Determine if shift+tab was used based on element order\n const elements = this.getFocussableElements().filter(\n (elem) => !this.isElementHidden(elem)\n );\n\n const previousInd = elements.indexOf((event as any).relatedTarget);\n const currentInd = elements.indexOf(event.target as HTMLElement);\n\n /* istanbul ignore next */\n return (\n previousInd === currentInd + 1 ||\n (previousInd === 0 && currentInd === elements.length - 1) ||\n previousInd > currentInd ||\n !(event as any).relatedTarget\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
3
3
|
* The contents of this file were automatically generated by
|
|
4
|
-
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-layout' schematic.
|
|
4
|
+
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-layout' schematic.
|
|
5
5
|
* To update this file, simply rerun the command.
|
|
6
6
|
*/
|
|
7
7
|
import { NgModule } from '@angular/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky-layout-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/shared/sky-layout-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAE3B,aAAa,EAGb,qBAAqB,GACtB,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,iBAAiB,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QAC7C,yBAAyB,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QACrD,gCAAgC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QAC5D,iCAAiC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QAC7D,kCAAkC,EAAE;YAClC,OAAO,EAAE,4CAA4C;SACtD;QACD,0BAA0B,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACjD,oCAAoC,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE;QACrE,0BAA0B,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACjD,4BAA4B,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QAClD,6BAA6B,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;QAC3D,0BAA0B,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;QACnD,0BAA0B,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;KACpD;CACF,CAAC;AAEF,MAAM,OAAO,0BAA0B;IAC9B,SAAS,
|
|
1
|
+
{"version":3,"file":"sky-layout-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/layout/src/lib/modules/shared/sky-layout-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAE3B,aAAa,EAGb,qBAAqB,GACtB,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,iBAAiB,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QAC7C,yBAAyB,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QACrD,gCAAgC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QAC5D,iCAAiC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QAC7D,kCAAkC,EAAE;YAClC,OAAO,EAAE,4CAA4C;SACtD;QACD,0BAA0B,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACjD,oCAAoC,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE;QACrE,0BAA0B,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACjD,4BAA4B,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QAClD,6BAA6B,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;QAC3D,0BAA0B,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;QACnD,0BAA0B,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;KACpD;CACF,CAAC;AAEF,MAAM,OAAO,0BAA0B;IAC9B,SAAS,CACd,UAA4B,EAC5B,IAAY;QAEZ,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;CACF;AAED;;GAEG;AAWH,MAAM,OAAO,wBAAwB;;sHAAxB,wBAAwB;uHAAxB,wBAAwB,YATzB,aAAa;uHASZ,wBAAwB,aARxB;QACT;YACE,OAAO,EAAE,2BAA2B;YACpC,QAAQ,EAAE,0BAA0B;YACpC,KAAK,EAAE,IAAI;SACZ;KACF,YAPS,aAAa;4FASZ,wBAAwB;kBAVpC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,2BAA2B;4BACpC,QAAQ,EAAE,0BAA0B;4BACpC,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF","sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-layout' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_back_to_top: { message: 'Back to top' },\n skyux_card_checkbox_label: { message: 'Select card' },\n skyux_definition_list_none_found: { message: 'None found.' },\n skyux_description_list_none_found: { message: 'None found.' },\n skyux_inline_delete_assistive_text: {\n message: 'Are you sure you want to delete this item?',\n },\n skyux_inline_delete_cancel: { message: 'Cancel' },\n skyux_inline_delete_confirm_deletion: { message: 'Confirm deletion' },\n skyux_inline_delete_delete: { message: 'Delete' },\n skyux_text_expand_close_text: { message: 'Close' },\n skyux_text_expand_modal_title: { message: 'Expanded view' },\n skyux_text_expand_see_less: { message: 'See less' },\n skyux_text_expand_see_more: { message: 'See more' },\n },\n};\n\nexport class SkyLayoutResourcesProvider implements SkyLibResourcesProvider {\n public getString(\n localeInfo: SkyAppLocaleInfo,\n name: string\n ): string | undefined {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyLayoutResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyLayoutResourcesModule {}\n"]}
|
package/fesm2015/skyux-layout.js
CHANGED
|
@@ -12,8 +12,8 @@ import * as i3$1 from '@skyux/theme';
|
|
|
12
12
|
import { SkyThemeModule } from '@skyux/theme';
|
|
13
13
|
import * as i1 from '@skyux/core';
|
|
14
14
|
import { SkyMediaBreakpoints, SkyDockModule, SkyCoreAdapterService } from '@skyux/core';
|
|
15
|
-
import { Subject,
|
|
16
|
-
import { takeUntil,
|
|
15
|
+
import { Subject, BehaviorSubject, forkJoin } from 'rxjs';
|
|
16
|
+
import { takeUntil, take } from 'rxjs/operators';
|
|
17
17
|
import * as i1$1 from '@skyux/i18n';
|
|
18
18
|
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
19
19
|
import * as i3$2 from '@angular/forms';
|
|
@@ -354,7 +354,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
354
354
|
/**
|
|
355
355
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
356
356
|
* The contents of this file were automatically generated by
|
|
357
|
-
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-layout' schematic.
|
|
357
|
+
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-layout' schematic.
|
|
358
358
|
* To update this file, simply rerun the command.
|
|
359
359
|
*/
|
|
360
360
|
const RESOURCES = {
|
|
@@ -439,24 +439,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
439
439
|
* @internal
|
|
440
440
|
*/
|
|
441
441
|
class SkyBackToTopDomAdapterService {
|
|
442
|
-
constructor(windowRef) {
|
|
442
|
+
constructor(windowRef, scrollableHostService) {
|
|
443
443
|
this.windowRef = windowRef;
|
|
444
|
+
this.scrollableHostService = scrollableHostService;
|
|
444
445
|
this.ngUnsubscribe = new Subject();
|
|
446
|
+
this.scrollableHostScrollEventUnsubscribe = new Subject();
|
|
445
447
|
}
|
|
446
448
|
ngOnDestroy() {
|
|
447
449
|
this.ngUnsubscribe.next();
|
|
448
450
|
this.ngUnsubscribe.complete();
|
|
451
|
+
this.scrollableHostScrollEventUnsubscribe.next();
|
|
452
|
+
this.scrollableHostScrollEventUnsubscribe.complete();
|
|
449
453
|
}
|
|
450
454
|
/**
|
|
451
455
|
* This event returns a boolean on scroll indicating whether the provided element is in view.
|
|
452
456
|
* @param elementRef The target element reference.
|
|
453
457
|
*/
|
|
454
458
|
elementInViewOnScroll(elementRef) {
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
459
|
+
const scrollableHostObservable = this.scrollableHostService.watchScrollableHostScrollEvents(elementRef);
|
|
460
|
+
const isInitiallyInView = this.isElementScrolledInView(elementRef);
|
|
461
|
+
const returnedObservable = new BehaviorSubject(isInitiallyInView);
|
|
462
|
+
scrollableHostObservable
|
|
463
|
+
.pipe(takeUntil(this.scrollableHostScrollEventUnsubscribe))
|
|
464
|
+
.subscribe(() => {
|
|
465
|
+
const isInView = this.isElementScrolledInView(elementRef);
|
|
466
|
+
returnedObservable.next(isInView);
|
|
467
|
+
});
|
|
468
|
+
return returnedObservable;
|
|
460
469
|
}
|
|
461
470
|
/**
|
|
462
471
|
* Scrolls the window or scrollable parent to the provided element.
|
|
@@ -468,9 +477,8 @@ class SkyBackToTopDomAdapterService {
|
|
|
468
477
|
if (!elementRef || !elementRef.nativeElement) {
|
|
469
478
|
return;
|
|
470
479
|
}
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
if (parent === windowObj) {
|
|
480
|
+
const scrollableHost = this.scrollableHostService.getScrollableHost(elementRef);
|
|
481
|
+
if (scrollableHost instanceof Window) {
|
|
474
482
|
// Scroll to top of window, but account for the body margin that allows for the omnibar if it exists.
|
|
475
483
|
const bodyMarginOffset = parseInt(getComputedStyle(document.body).marginTop, 10);
|
|
476
484
|
const newOffsetTop = elementRef.nativeElement.offsetTop - bodyMarginOffset;
|
|
@@ -478,45 +486,32 @@ class SkyBackToTopDomAdapterService {
|
|
|
478
486
|
}
|
|
479
487
|
else {
|
|
480
488
|
// Scroll to top of parent element.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
do {
|
|
491
|
-
parent = parent.parentNode;
|
|
492
|
-
style = windowObj.getComputedStyle(parent);
|
|
493
|
-
} while (!regex.test(style.overflow) &&
|
|
494
|
-
!regex.test(style.overflowY) &&
|
|
495
|
-
parent !== bodyObj);
|
|
496
|
-
if (parent === bodyObj) {
|
|
497
|
-
return windowObj;
|
|
498
|
-
}
|
|
499
|
-
return parent;
|
|
500
|
-
}
|
|
501
|
-
isElementScrolledInView(element, parentElement) {
|
|
489
|
+
scrollableHost.scrollTop =
|
|
490
|
+
scrollableHost.offsetTop - elementRef.nativeElement.offsetTop;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
isElementScrolledInView(element) {
|
|
494
|
+
const parentElement = this.scrollableHostService.getScrollableHost(element.nativeElement);
|
|
495
|
+
if (!element.nativeElement.offsetParent) {
|
|
496
|
+
return true;
|
|
497
|
+
}
|
|
502
498
|
const buffer = 25;
|
|
503
|
-
const
|
|
504
|
-
const elementRect = element.getBoundingClientRect();
|
|
499
|
+
const elementRect = element.nativeElement.getBoundingClientRect();
|
|
505
500
|
/* istanbul ignore else */
|
|
506
|
-
if (parentElement
|
|
507
|
-
return elementRect.top > -buffer;
|
|
508
|
-
}
|
|
509
|
-
else {
|
|
501
|
+
if (parentElement instanceof HTMLElement) {
|
|
510
502
|
const parentRect = parentElement.getBoundingClientRect();
|
|
511
503
|
return elementRect.top > parentRect.top - buffer;
|
|
512
504
|
}
|
|
505
|
+
else {
|
|
506
|
+
return elementRect.top > -buffer;
|
|
507
|
+
}
|
|
513
508
|
}
|
|
514
509
|
}
|
|
515
|
-
SkyBackToTopDomAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyBackToTopDomAdapterService, deps: [{ token: i1.SkyAppWindowRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
510
|
+
SkyBackToTopDomAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyBackToTopDomAdapterService, deps: [{ token: i1.SkyAppWindowRef }, { token: i1.SkyScrollableHostService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
516
511
|
SkyBackToTopDomAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyBackToTopDomAdapterService });
|
|
517
512
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyBackToTopDomAdapterService, decorators: [{
|
|
518
513
|
type: Injectable
|
|
519
|
-
}], ctorParameters: function () { return [{ type: i1.SkyAppWindowRef }]; } });
|
|
514
|
+
}], ctorParameters: function () { return [{ type: i1.SkyAppWindowRef }, { type: i1.SkyScrollableHostService }]; } });
|
|
520
515
|
|
|
521
516
|
/**
|
|
522
517
|
* Specifies the type of message to send to the back to top component.
|
|
@@ -562,8 +557,7 @@ class SkyBackToTopDirective {
|
|
|
562
557
|
.subscribe((message) => this.handleIncomingMessages(message));
|
|
563
558
|
}
|
|
564
559
|
ngAfterViewInit() {
|
|
565
|
-
|
|
566
|
-
this.elementInView = this.domAdapter.isElementScrolledInView(this.element.nativeElement, scrollableParent);
|
|
560
|
+
this.elementInView = this.domAdapter.isElementScrolledInView(this.element);
|
|
567
561
|
this.handleBackToTopButton(this.elementInView);
|
|
568
562
|
this.setBackToTopListeners();
|
|
569
563
|
}
|
|
@@ -1731,6 +1725,9 @@ var SkyFluidGridGutterSize;
|
|
|
1731
1725
|
SkyFluidGridGutterSize[SkyFluidGridGutterSize["Large"] = 2] = "Large";
|
|
1732
1726
|
})(SkyFluidGridGutterSize || (SkyFluidGridGutterSize = {}));
|
|
1733
1727
|
|
|
1728
|
+
/**
|
|
1729
|
+
* Displays a column within a row of the fluid grid.
|
|
1730
|
+
*/
|
|
1734
1731
|
class SkyColumnComponent {
|
|
1735
1732
|
ngOnChanges(changes) {
|
|
1736
1733
|
/* istanbul ignore else */
|
|
@@ -1890,7 +1887,7 @@ const tokenRegex = /(\{\d+\})/;
|
|
|
1890
1887
|
class SkyFormatComponent {
|
|
1891
1888
|
/**
|
|
1892
1889
|
* The tokenized string that represents the template. Tokens use the `{n}` notation
|
|
1893
|
-
* where n is the ordinal of the item to replace the token.
|
|
1890
|
+
* where `n` is the ordinal of the item to replace the token.
|
|
1894
1891
|
*/
|
|
1895
1892
|
set text(value) {
|
|
1896
1893
|
this._text = value;
|