@spicainternational/ngx-sds-components 5.12.3 → 5.13.0-beta.0
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/esm2020/src/lib/side-bar/side-bar.component.mjs +90 -15
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-side-bar.mjs +89 -14
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-side-bar.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-side-bar.mjs +89 -14
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-side-bar.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/side-bar/side-bar.component.d.ts +67 -9
|
@@ -1,17 +1,88 @@
|
|
|
1
1
|
import { Component, Input } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { faAngleLeft } from '@fortawesome/pro-solid-svg-icons';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
import * as i1 from "@fortawesome/angular-fontawesome";
|
|
5
6
|
import * as i2 from "@angular/common";
|
|
7
|
+
// import { faSidebar } from '@fortawesome/pro-light-svg-icons';
|
|
8
|
+
// import { IconDefinition, faSidebar, faChevronRight, faGripVertical, faGripLinesVertical, faChevronLeft, faArrowRightFromBracket } from '@fortawesome/pro-regular-svg-icons';
|
|
6
9
|
export class SdsSideBarComponent {
|
|
7
10
|
constructor() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Define when the hide panel button is shown.
|
|
13
|
+
* Default is 'auto' which will only show the button when the users hovers over the panel.
|
|
14
|
+
* 'always' will always show the button.
|
|
15
|
+
*
|
|
16
|
+
* @type {('always' | 'auto')}
|
|
17
|
+
* @memberof SdsSideBarComponent
|
|
18
|
+
*/
|
|
19
|
+
this.showCloseButton = 'auto';
|
|
20
|
+
/**
|
|
21
|
+
* Pull out mode will show the side bar as user hovers over the left side of the screen
|
|
22
|
+
* When side bar is in pull out mode it will be rendered over the main contents.
|
|
23
|
+
*
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
* @memberof SdsSideBarComponent
|
|
26
|
+
*/
|
|
27
|
+
this.enablePullOutMode = false;
|
|
28
|
+
/**
|
|
29
|
+
* Define the width of the side bar in rem.
|
|
30
|
+
*
|
|
31
|
+
* @type {number}
|
|
32
|
+
* @memberof SdsSideBarComponent
|
|
33
|
+
*/
|
|
34
|
+
this.widthRem = 14;
|
|
35
|
+
/**
|
|
36
|
+
* Product name defines the color scheme of the side bar.
|
|
37
|
+
* Default is 'all-hours'.
|
|
38
|
+
* Options: 'all-hours', 'door-cloud', 'my-hours', 'time-and-space'
|
|
39
|
+
*
|
|
40
|
+
* @type {string}
|
|
41
|
+
* @memberof SdsSideBarComponent
|
|
42
|
+
*/
|
|
43
|
+
this.product = 'all-hours';
|
|
44
|
+
/**
|
|
45
|
+
* Define the width of the screen that triggers hiding of the side bar.
|
|
46
|
+
* Note that the width is checked at the component creation and not when the screen is resized.
|
|
47
|
+
* If user resizes the screen he must manually hide the side bar.
|
|
48
|
+
*
|
|
49
|
+
* @type {(number | undefined)}
|
|
50
|
+
* @memberof SdsSideBarComponent
|
|
51
|
+
*/
|
|
52
|
+
this.autoHideScreenWidth = 992;
|
|
53
|
+
this.showSideBar = true;
|
|
54
|
+
this.pullOutSideBar = false;
|
|
55
|
+
this.caretIcon = faAngleLeft;
|
|
56
|
+
this.autoHideActive = false;
|
|
57
|
+
this.screenWidth = 0;
|
|
58
|
+
this.componentInitialized = false;
|
|
59
|
+
this._checkAutoHide$ = new Subject();
|
|
60
|
+
this._checkAutoHide$.subscribe(() => {
|
|
61
|
+
console.log('check autohide');
|
|
62
|
+
if (this.componentInitialized && this.autoHideScreenWidth) {
|
|
63
|
+
console.log('this.autoHideScreenWidthRem', this.autoHideScreenWidth);
|
|
64
|
+
this.autoHideActive = this.screenWidth < this.autoHideScreenWidth;
|
|
65
|
+
console.log('hideSideBar', this.autoHideActive);
|
|
66
|
+
if (this.autoHideActive) {
|
|
67
|
+
this.showSideBar = false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
ngOnDestroy() {
|
|
73
|
+
this._checkAutoHide$.unsubscribe();
|
|
74
|
+
}
|
|
75
|
+
ngOnChanges(changes) {
|
|
76
|
+
if (changes['autoHideScreenWidthRem']) {
|
|
77
|
+
this._checkAutoHide$.next();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
ngOnInit() {
|
|
81
|
+
this.componentInitialized = true;
|
|
82
|
+
this.screenWidth = window.innerWidth;
|
|
83
|
+
console.log('screenWidth', this.screenWidth);
|
|
84
|
+
this._checkAutoHide$.next();
|
|
13
85
|
}
|
|
14
|
-
ngOnInit() { }
|
|
15
86
|
toggleSideBar(state) {
|
|
16
87
|
if (state !== undefined) {
|
|
17
88
|
this.showSideBar = state;
|
|
@@ -22,19 +93,23 @@ export class SdsSideBarComponent {
|
|
|
22
93
|
}
|
|
23
94
|
}
|
|
24
95
|
SdsSideBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
-
SdsSideBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsSideBarComponent, selector: "sds-side-bar", inputs: {
|
|
96
|
+
SdsSideBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsSideBarComponent, selector: "sds-side-bar", inputs: { showCloseButton: "showCloseButton", enablePullOutMode: "enablePullOutMode", widthRem: "widthRem", product: "product", autoHideScreenWidth: "autoHideScreenWidth", closeButtonHint: "closeButtonHint", openButtonHint: "openButtonHint" }, usesOnChanges: true, ngImport: i0, template: "<div \r\n class=\"vh-100 position-relative sds-side-bar-container\"\r\n [class.sds-side-bar-open]=\"showSideBar\" \r\n >\r\n\r\n <!-- CLOSE SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || showSideBar)\"\r\n class=\"sds-side-bar-button-container close-side-bar-button\"\r\n [class.hidden]=\"!showSideBar\"\r\n [class.always-show]=\"showSideBar && showCloseButton === 'always'\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"closeButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\" \r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <!-- OPEN SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || !showSideBar)\" \r\n class=\"sds-side-bar-button-container open-side-bar-button\"\r\n [class.hidden]=\"showSideBar\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"openButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\"\r\n [rotate]=\"180\"\r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <aside\r\n class=\"sds-side-bar h-100 border-end\"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.shadow]=\"pullOutSideBar\"\r\n [class.sds-side-bar-open]=\"showSideBar\"\r\n [style.width.rem]=\"(showSideBar || pullOutSideBar) ? widthRem : enablePullOutMode ? 0.75 : 0\"\r\n \r\n (mouseleave)=\"pullOutSideBar = false\"\r\n >\r\n <div \r\n *ngIf=\"enablePullOutMode && !showSideBar && !pullOutSideBar\"\r\n class=\"sds-side-bar-pull-out h-100 position-absolute\" \r\n style=\"width: 0.75rem;\"\r\n (mouseenter)=\"pullOutSideBar = true\"\r\n >\r\n </div>\r\n\r\n <div class=\"d-flex flex-column flex-grow-0 h-100\" \r\n [style.width.rem]=\"widthRem\">\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n\r\n </aside>\r\n</div>", styles: [".sds-side-bar{transition:.3s;overflow-x:hidden;position:absolute;z-index:10}.sds-side-bar.sds-side-bar-open{position:relative}.sds-side-bar:has(.sds-side-bar-pull-out:hover){width:var(--sds-side-bar-width)!important}.sds-side-bar .sds-side-bar-pull-out{background-color:#f8f9fa}.sds-side-bar-container .sds-side-bar-button-container{position:absolute;z-index:11;height:2.2rem;width:2.2rem;top:.85rem;border-radius:50%;background-color:#fff}.sds-side-bar-container .sds-side-bar-button-container.always-show{visibility:visible;opacity:1}.sds-side-bar-container button{height:2.2rem;width:2.2rem;display:flex;align-items:center;justify-content:center;border:1px solid #CED4DA;border-radius:50%;color:#375d75!important;line-height:1rem}.sds-side-bar-container button:hover{color:#f8f9fa!important}.sds-side-bar-container button .hot-spot{position:absolute;inset:-1rem}.sds-side-bar-container .open-side-bar-button{top:.85rem;right:-2.3rem;transition:visibility 0ms linear .18s;transition:opacity 0ms linear .18s;visibility:visible;opacity:1}.sds-side-bar-container .open-side-bar-button.hidden{visibility:hidden;opacity:0}.sds-side-bar-container:hover .close-side-bar-button:not(.hidden){visibility:visible;opacity:1}.sds-side-bar-container .close-side-bar-button{right:-1.1rem;visibility:hidden;transition:visibility 0s linear;transition:opacity .3s ease-in;opacity:0}:host{display:block}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
26
97
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarComponent, decorators: [{
|
|
27
98
|
type: Component,
|
|
28
|
-
args: [{ selector: 'sds-side-bar', template: "<
|
|
29
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
99
|
+
args: [{ selector: 'sds-side-bar', template: "<div \r\n class=\"vh-100 position-relative sds-side-bar-container\"\r\n [class.sds-side-bar-open]=\"showSideBar\" \r\n >\r\n\r\n <!-- CLOSE SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || showSideBar)\"\r\n class=\"sds-side-bar-button-container close-side-bar-button\"\r\n [class.hidden]=\"!showSideBar\"\r\n [class.always-show]=\"showSideBar && showCloseButton === 'always'\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"closeButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\" \r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <!-- OPEN SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || !showSideBar)\" \r\n class=\"sds-side-bar-button-container open-side-bar-button\"\r\n [class.hidden]=\"showSideBar\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"openButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\"\r\n [rotate]=\"180\"\r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <aside\r\n class=\"sds-side-bar h-100 border-end\"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.shadow]=\"pullOutSideBar\"\r\n [class.sds-side-bar-open]=\"showSideBar\"\r\n [style.width.rem]=\"(showSideBar || pullOutSideBar) ? widthRem : enablePullOutMode ? 0.75 : 0\"\r\n \r\n (mouseleave)=\"pullOutSideBar = false\"\r\n >\r\n <div \r\n *ngIf=\"enablePullOutMode && !showSideBar && !pullOutSideBar\"\r\n class=\"sds-side-bar-pull-out h-100 position-absolute\" \r\n style=\"width: 0.75rem;\"\r\n (mouseenter)=\"pullOutSideBar = true\"\r\n >\r\n </div>\r\n\r\n <div class=\"d-flex flex-column flex-grow-0 h-100\" \r\n [style.width.rem]=\"widthRem\">\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n\r\n </aside>\r\n</div>", styles: [".sds-side-bar{transition:.3s;overflow-x:hidden;position:absolute;z-index:10}.sds-side-bar.sds-side-bar-open{position:relative}.sds-side-bar:has(.sds-side-bar-pull-out:hover){width:var(--sds-side-bar-width)!important}.sds-side-bar .sds-side-bar-pull-out{background-color:#f8f9fa}.sds-side-bar-container .sds-side-bar-button-container{position:absolute;z-index:11;height:2.2rem;width:2.2rem;top:.85rem;border-radius:50%;background-color:#fff}.sds-side-bar-container .sds-side-bar-button-container.always-show{visibility:visible;opacity:1}.sds-side-bar-container button{height:2.2rem;width:2.2rem;display:flex;align-items:center;justify-content:center;border:1px solid #CED4DA;border-radius:50%;color:#375d75!important;line-height:1rem}.sds-side-bar-container button:hover{color:#f8f9fa!important}.sds-side-bar-container button .hot-spot{position:absolute;inset:-1rem}.sds-side-bar-container .open-side-bar-button{top:.85rem;right:-2.3rem;transition:visibility 0ms linear .18s;transition:opacity 0ms linear .18s;visibility:visible;opacity:1}.sds-side-bar-container .open-side-bar-button.hidden{visibility:hidden;opacity:0}.sds-side-bar-container:hover .close-side-bar-button:not(.hidden){visibility:visible;opacity:1}.sds-side-bar-container .close-side-bar-button{right:-1.1rem;visibility:hidden;transition:visibility 0s linear;transition:opacity .3s ease-in;opacity:0}:host{display:block}\n"] }]
|
|
100
|
+
}], ctorParameters: function () { return []; }, propDecorators: { showCloseButton: [{
|
|
101
|
+
type: Input
|
|
102
|
+
}], enablePullOutMode: [{
|
|
103
|
+
type: Input
|
|
104
|
+
}], widthRem: [{
|
|
30
105
|
type: Input
|
|
31
|
-
}],
|
|
106
|
+
}], product: [{
|
|
32
107
|
type: Input
|
|
33
|
-
}],
|
|
108
|
+
}], autoHideScreenWidth: [{
|
|
34
109
|
type: Input
|
|
35
|
-
}],
|
|
110
|
+
}], closeButtonHint: [{
|
|
36
111
|
type: Input
|
|
37
|
-
}],
|
|
112
|
+
}], openButtonHint: [{
|
|
38
113
|
type: Input
|
|
39
114
|
}] } });
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lkZS1iYXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXNkcy1jb21wb25lbnRzL3NyYy9saWIvc2lkZS1iYXIvc2lkZS1iYXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXNkcy1jb21wb25lbnRzL3NyYy9saWIvc2lkZS1iYXIvc2lkZS1iYXIuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQVUsTUFBTSxlQUFlLENBQUM7QUFDekQsT0FBTyxFQUFrQixjQUFjLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQzs7OztBQU9wRixNQUFNLE9BQU8sbUJBQW1CO0lBYzVCO1FBWk8sZ0JBQVcsR0FBRyxLQUFLLENBQUM7UUFFbEIsWUFBTyxHQUFVLEVBQUUsQ0FBQztRQUNwQixrQkFBYSxHQUFZLEtBQUssQ0FBQztRQUMvQiw0QkFBdUIsR0FBWSxLQUFLLENBQUM7UUFNM0MsY0FBUyxHQUFtQixjQUFjLENBQUM7SUFFbkMsQ0FBQztJQUVoQixRQUFRLEtBQVUsQ0FBQztJQUVaLGFBQWEsQ0FBQyxLQUFlO1FBQ2hDLElBQUksS0FBSyxLQUFLLFNBQVMsRUFBRTtZQUNyQixJQUFJLENBQUMsV0FBVyxHQU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gPGRpdlxyXG4gICAgICAgICAgICAgICAgKm5nSWY9XCJzaG93U2lkZUJhclRvZ2dsZUJ1dHRvblwiXHJcbiAgICAgICAgICAgICAgICBjbGFzcz1cInRvZ2dsZS1zaWRlLWJhci1idXR0b24gcG9zaXRpb24tYWJzb2x1dGUgZC1tZC1ub25lIHJvdW5kZWQtY2lyY2xlIHRvZ2dsZVNpZGVCYXIgZC1mbGV4IGp1c3RpZnktY29udGVudC1jZW50ZXIganVzdGlmeS1jb250ZW50LWNlbnRlciBhbGlnbi1pdGVtcy1jZW50ZXJcIlxyXG4gICAgICAgICAgICAgICAgW2NsYXNzLm9wZW5dPVwic2hvd1NpZGVCYXJcIlxyXG4gICAgICAgICAgICAgICAgW3RpdGxlXT1cInNob3dTaWRlQmFyID8gaGlkZVNpZGVCYXJUZXh0IDogc2hvd1NpZGVCYXJUZXh0XCJcclxuICAgICAgICAgICAgICAgIChjbGljayk9XCJ0b2dnbGVTaWRlQmFyKClcIlxyXG4gICAgICAgICAgICA+XHJcbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidG9nZ2xlLXNpZGUtYmFyLWljb25cIj5cclxuICAgICAgICAgICAgICAgICAgICA8ZmEtaWNvbiBbaWNvbl09XCJjYXJldEljb25cIj48L2ZhLWljb24+XHJcbiAgICAgICAgICAgICAgICA8L2Rpdj4gICAgXHJcbiAgICAgICAgICAgIDwvZGl2PlxyXG5cclxuICAgICAgICAgICAgPG5nLWNvbnRlbnQ+PC9uZy1jb250ZW50PiAgICAgICAgICAgICAgICBcclxuICAgICAgICA8L2Rpdj5cclxuICAgIDwvZGl2PlxyXG48L2FzaWRlPlxyXG4iXX0=
|
|
115
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lkZS1iYXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXNkcy1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PC9mYS1pY29uPlxyXG5cclxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImhvdC1zcG90XCI+PC9kaXY+XHJcblxyXG4gICAgICAgIDwvYnV0dG9uPlxyXG4gICAgPC9kaXY+XHJcblxyXG4gICAgPCEtLSBPUEVOIFNJREVCQVIgLS0+XHJcbiAgICA8ZGl2IFxyXG4gICAgICAgICpuZ0lmPVwiIXB1bGxPdXRTaWRlQmFyICYmICh0cnVlIHx8ICFzaG93U2lkZUJhcilcIiAgICBcclxuICAgICAgICBjbGFzcz1cInNkcy1zaWRlLWJhci1idXR0b24tY29udGFpbmVyIG9wZW4tc2lkZS1iYXItYnV0dG9uXCJcclxuICAgICAgICBbY2xhc3MuaGlkZGVuXT1cInNob3dTaWRlQmFyXCJcclxuICAgICAgICA+XHJcbiAgICAgICAgXHJcbiAgICAgICAgPGJ1dHRvblxyXG4gICAgICAgICAgICBjbGFzcz1cImJ0biBidG4tb3V0bGluZS1wcmltYXJ5IHNoYWRvdy1zbVwiXHJcbiAgICAgICAgICAgIFt0aXRsZV09XCJvcGVuQnV0dG9uSGludFwiXHJcbiAgICAgICAgICAgIChjbGljayk9XCJ0b2dnbGVTaWRlQmFyKClcIlxyXG4gICAgICAgID5cclxuICAgICAgICAgICAgPGZhLWljb24gXHJcbiAgICAgICAgICAgICAgICBbaWNvbl09XCJjYXJldEljb25cIlxyXG4gICAgICAgICAgICAgICAgW3JvdGF0ZV09XCIxODBcIlxyXG4gICAgICAgICAgICAgICAgc2l6ZT1cInhzXCJcclxuICAgICAgICAgICAgICAgID5cclxuICAgICAgICAgICAgPC9mYS1pY29uPlxyXG5cclxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImhvdC1zcG90XCI+PC9kaXY+XHJcblxyXG4gICAgICAgICA8L2J1dHRvbj5cclxuICAgIDwvZGl2PlxyXG5cclxuICAgIDxhc2lkZVxyXG4gICAgICAgIGNsYXNzPVwic2RzLXNpZGUtYmFyIGgtMTAwIGJvcmRlci1lbmRcIlxyXG4gICAgICAgIFtjbGFzc109XCIocHJvZHVjdCA/ICdwcm9kdWN0LScgKyBwcm9kdWN0IDogbnVsbClcIlxyXG4gICAgICAgIFtjbGFzcy5zaGFkb3ddPVwicHVsbE91dFNpZGVCYXJcIlxyXG4gICAgICAgIFtjbGFzcy5zZHMtc2lkZS1iYXItb3Blbl09XCJzaG93U2lkZUJhclwiXHJcbiAgICAgICAgW3N0eWxlLndpZHRoLnJlbV09XCIoc2hvd1NpZGVCYXIgfHwgcHVsbE91dFNpZGVCYXIpID8gd2lkdGhSZW0gOiBlbmFibGVQdWxsT3V0TW9kZSA/IDAuNzUgOiAwXCJcclxuICAgICAgICBcclxuICAgICAgICAobW91c2VsZWF2ZSk9XCJwdWxsT3V0U2lkZUJhciA9IGZhbHNlXCJcclxuICAgID5cclxuICAgICAgICA8ZGl2IFxyXG4gICAgICAgICAgICAqbmdJZj1cImVuYWJsZVB1bGxPdXRNb2RlICYmICAhc2hvd1NpZGVCYXIgJiYgIXB1bGxPdXRTaWRlQmFyXCJcclxuICAgICAgICAgICAgY2xhc3M9XCJzZHMtc2lkZS1iYXItcHVsbC1vdXQgaC0xMDAgcG9zaXRpb24tYWJzb2x1dGVcIiBcclxuICAgICAgICAgICAgc3R5bGU9XCJ3aWR0aDogMC43NXJlbTtcIlxyXG4gICAgICAgICAgICAobW91c2VlbnRlcik9XCJwdWxsT3V0U2lkZUJhciA9IHRydWVcIlxyXG4gICAgICAgICAgICA+XHJcbiAgICAgICAgPC9kaXY+XHJcblxyXG4gICAgICAgIDxkaXYgY2xhc3M9XCJkLWZsZXggZmxleC1jb2x1bW4gZmxleC1ncm93LTAgaC0xMDBcIiBcclxuICAgICAgICAgICAgW3N0eWxlLndpZHRoLnJlbV09XCJ3aWR0aFJlbVwiPlxyXG5cclxuICAgICAgICAgICAgPG5nLWNvbnRlbnQ+PC9uZy1jb250ZW50PiAgICAgICAgICAgICAgICBcclxuICAgICAgICA8L2Rpdj5cclxuXHJcbiAgICA8L2FzaWRlPlxyXG48L2Rpdj4iXX0=
|
|
@@ -2,19 +2,90 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Component, Input, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import {
|
|
5
|
+
import { faAngleLeft } from '@fortawesome/pro-solid-svg-icons';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
6
7
|
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
7
8
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
8
9
|
|
|
10
|
+
// import { faSidebar } from '@fortawesome/pro-light-svg-icons';
|
|
11
|
+
// import { IconDefinition, faSidebar, faChevronRight, faGripVertical, faGripLinesVertical, faChevronLeft, faArrowRightFromBracket } from '@fortawesome/pro-regular-svg-icons';
|
|
9
12
|
class SdsSideBarComponent {
|
|
10
13
|
constructor() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Define when the hide panel button is shown.
|
|
16
|
+
* Default is 'auto' which will only show the button when the users hovers over the panel.
|
|
17
|
+
* 'always' will always show the button.
|
|
18
|
+
*
|
|
19
|
+
* @type {('always' | 'auto')}
|
|
20
|
+
* @memberof SdsSideBarComponent
|
|
21
|
+
*/
|
|
22
|
+
this.showCloseButton = 'auto';
|
|
23
|
+
/**
|
|
24
|
+
* Pull out mode will show the side bar as user hovers over the left side of the screen
|
|
25
|
+
* When side bar is in pull out mode it will be rendered over the main contents.
|
|
26
|
+
*
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
* @memberof SdsSideBarComponent
|
|
29
|
+
*/
|
|
30
|
+
this.enablePullOutMode = false;
|
|
31
|
+
/**
|
|
32
|
+
* Define the width of the side bar in rem.
|
|
33
|
+
*
|
|
34
|
+
* @type {number}
|
|
35
|
+
* @memberof SdsSideBarComponent
|
|
36
|
+
*/
|
|
37
|
+
this.widthRem = 14;
|
|
38
|
+
/**
|
|
39
|
+
* Product name defines the color scheme of the side bar.
|
|
40
|
+
* Default is 'all-hours'.
|
|
41
|
+
* Options: 'all-hours', 'door-cloud', 'my-hours', 'time-and-space'
|
|
42
|
+
*
|
|
43
|
+
* @type {string}
|
|
44
|
+
* @memberof SdsSideBarComponent
|
|
45
|
+
*/
|
|
46
|
+
this.product = 'all-hours';
|
|
47
|
+
/**
|
|
48
|
+
* Define the width of the screen that triggers hiding of the side bar.
|
|
49
|
+
* Note that the width is checked at the component creation and not when the screen is resized.
|
|
50
|
+
* If user resizes the screen he must manually hide the side bar.
|
|
51
|
+
*
|
|
52
|
+
* @type {(number | undefined)}
|
|
53
|
+
* @memberof SdsSideBarComponent
|
|
54
|
+
*/
|
|
55
|
+
this.autoHideScreenWidth = 992;
|
|
56
|
+
this.showSideBar = true;
|
|
57
|
+
this.pullOutSideBar = false;
|
|
58
|
+
this.caretIcon = faAngleLeft;
|
|
59
|
+
this.autoHideActive = false;
|
|
60
|
+
this.screenWidth = 0;
|
|
61
|
+
this.componentInitialized = false;
|
|
62
|
+
this._checkAutoHide$ = new Subject();
|
|
63
|
+
this._checkAutoHide$.subscribe(() => {
|
|
64
|
+
console.log('check autohide');
|
|
65
|
+
if (this.componentInitialized && this.autoHideScreenWidth) {
|
|
66
|
+
console.log('this.autoHideScreenWidthRem', this.autoHideScreenWidth);
|
|
67
|
+
this.autoHideActive = this.screenWidth < this.autoHideScreenWidth;
|
|
68
|
+
console.log('hideSideBar', this.autoHideActive);
|
|
69
|
+
if (this.autoHideActive) {
|
|
70
|
+
this.showSideBar = false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
ngOnDestroy() {
|
|
76
|
+
this._checkAutoHide$.unsubscribe();
|
|
77
|
+
}
|
|
78
|
+
ngOnChanges(changes) {
|
|
79
|
+
if (changes['autoHideScreenWidthRem']) {
|
|
80
|
+
this._checkAutoHide$.next();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
ngOnInit() {
|
|
84
|
+
this.componentInitialized = true;
|
|
85
|
+
this.screenWidth = window.innerWidth;
|
|
86
|
+
console.log('screenWidth', this.screenWidth);
|
|
87
|
+
this._checkAutoHide$.next();
|
|
16
88
|
}
|
|
17
|
-
ngOnInit() { }
|
|
18
89
|
toggleSideBar(state) {
|
|
19
90
|
if (state !== undefined) {
|
|
20
91
|
this.showSideBar = state;
|
|
@@ -25,19 +96,23 @@ class SdsSideBarComponent {
|
|
|
25
96
|
}
|
|
26
97
|
}
|
|
27
98
|
SdsSideBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
-
SdsSideBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsSideBarComponent, selector: "sds-side-bar", inputs: {
|
|
99
|
+
SdsSideBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsSideBarComponent, selector: "sds-side-bar", inputs: { showCloseButton: "showCloseButton", enablePullOutMode: "enablePullOutMode", widthRem: "widthRem", product: "product", autoHideScreenWidth: "autoHideScreenWidth", closeButtonHint: "closeButtonHint", openButtonHint: "openButtonHint" }, usesOnChanges: true, ngImport: i0, template: "<div \r\n class=\"vh-100 position-relative sds-side-bar-container\"\r\n [class.sds-side-bar-open]=\"showSideBar\" \r\n >\r\n\r\n <!-- CLOSE SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || showSideBar)\"\r\n class=\"sds-side-bar-button-container close-side-bar-button\"\r\n [class.hidden]=\"!showSideBar\"\r\n [class.always-show]=\"showSideBar && showCloseButton === 'always'\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"closeButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\" \r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <!-- OPEN SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || !showSideBar)\" \r\n class=\"sds-side-bar-button-container open-side-bar-button\"\r\n [class.hidden]=\"showSideBar\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"openButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\"\r\n [rotate]=\"180\"\r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <aside\r\n class=\"sds-side-bar h-100 border-end\"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.shadow]=\"pullOutSideBar\"\r\n [class.sds-side-bar-open]=\"showSideBar\"\r\n [style.width.rem]=\"(showSideBar || pullOutSideBar) ? widthRem : enablePullOutMode ? 0.75 : 0\"\r\n \r\n (mouseleave)=\"pullOutSideBar = false\"\r\n >\r\n <div \r\n *ngIf=\"enablePullOutMode && !showSideBar && !pullOutSideBar\"\r\n class=\"sds-side-bar-pull-out h-100 position-absolute\" \r\n style=\"width: 0.75rem;\"\r\n (mouseenter)=\"pullOutSideBar = true\"\r\n >\r\n </div>\r\n\r\n <div class=\"d-flex flex-column flex-grow-0 h-100\" \r\n [style.width.rem]=\"widthRem\">\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n\r\n </aside>\r\n</div>", styles: [".sds-side-bar{transition:.3s;overflow-x:hidden;position:absolute;z-index:10}.sds-side-bar.sds-side-bar-open{position:relative}.sds-side-bar:has(.sds-side-bar-pull-out:hover){width:var(--sds-side-bar-width)!important}.sds-side-bar .sds-side-bar-pull-out{background-color:#f8f9fa}.sds-side-bar-container .sds-side-bar-button-container{position:absolute;z-index:11;height:2.2rem;width:2.2rem;top:.85rem;border-radius:50%;background-color:#fff}.sds-side-bar-container .sds-side-bar-button-container.always-show{visibility:visible;opacity:1}.sds-side-bar-container button{height:2.2rem;width:2.2rem;display:flex;align-items:center;justify-content:center;border:1px solid #CED4DA;border-radius:50%;color:#375d75!important;line-height:1rem}.sds-side-bar-container button:hover{color:#f8f9fa!important}.sds-side-bar-container button .hot-spot{position:absolute;inset:-1rem}.sds-side-bar-container .open-side-bar-button{top:.85rem;right:-2.3rem;transition:visibility 0ms linear .18s;transition:opacity 0ms linear .18s;visibility:visible;opacity:1}.sds-side-bar-container .open-side-bar-button.hidden{visibility:hidden;opacity:0}.sds-side-bar-container:hover .close-side-bar-button:not(.hidden){visibility:visible;opacity:1}.sds-side-bar-container .close-side-bar-button{right:-1.1rem;visibility:hidden;transition:visibility 0s linear;transition:opacity .3s ease-in;opacity:0}:host{display:block}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
29
100
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarComponent, decorators: [{
|
|
30
101
|
type: Component,
|
|
31
|
-
args: [{ selector: 'sds-side-bar', template: "<
|
|
32
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
102
|
+
args: [{ selector: 'sds-side-bar', template: "<div \r\n class=\"vh-100 position-relative sds-side-bar-container\"\r\n [class.sds-side-bar-open]=\"showSideBar\" \r\n >\r\n\r\n <!-- CLOSE SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || showSideBar)\"\r\n class=\"sds-side-bar-button-container close-side-bar-button\"\r\n [class.hidden]=\"!showSideBar\"\r\n [class.always-show]=\"showSideBar && showCloseButton === 'always'\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"closeButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\" \r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <!-- OPEN SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || !showSideBar)\" \r\n class=\"sds-side-bar-button-container open-side-bar-button\"\r\n [class.hidden]=\"showSideBar\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"openButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\"\r\n [rotate]=\"180\"\r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <aside\r\n class=\"sds-side-bar h-100 border-end\"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.shadow]=\"pullOutSideBar\"\r\n [class.sds-side-bar-open]=\"showSideBar\"\r\n [style.width.rem]=\"(showSideBar || pullOutSideBar) ? widthRem : enablePullOutMode ? 0.75 : 0\"\r\n \r\n (mouseleave)=\"pullOutSideBar = false\"\r\n >\r\n <div \r\n *ngIf=\"enablePullOutMode && !showSideBar && !pullOutSideBar\"\r\n class=\"sds-side-bar-pull-out h-100 position-absolute\" \r\n style=\"width: 0.75rem;\"\r\n (mouseenter)=\"pullOutSideBar = true\"\r\n >\r\n </div>\r\n\r\n <div class=\"d-flex flex-column flex-grow-0 h-100\" \r\n [style.width.rem]=\"widthRem\">\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n\r\n </aside>\r\n</div>", styles: [".sds-side-bar{transition:.3s;overflow-x:hidden;position:absolute;z-index:10}.sds-side-bar.sds-side-bar-open{position:relative}.sds-side-bar:has(.sds-side-bar-pull-out:hover){width:var(--sds-side-bar-width)!important}.sds-side-bar .sds-side-bar-pull-out{background-color:#f8f9fa}.sds-side-bar-container .sds-side-bar-button-container{position:absolute;z-index:11;height:2.2rem;width:2.2rem;top:.85rem;border-radius:50%;background-color:#fff}.sds-side-bar-container .sds-side-bar-button-container.always-show{visibility:visible;opacity:1}.sds-side-bar-container button{height:2.2rem;width:2.2rem;display:flex;align-items:center;justify-content:center;border:1px solid #CED4DA;border-radius:50%;color:#375d75!important;line-height:1rem}.sds-side-bar-container button:hover{color:#f8f9fa!important}.sds-side-bar-container button .hot-spot{position:absolute;inset:-1rem}.sds-side-bar-container .open-side-bar-button{top:.85rem;right:-2.3rem;transition:visibility 0ms linear .18s;transition:opacity 0ms linear .18s;visibility:visible;opacity:1}.sds-side-bar-container .open-side-bar-button.hidden{visibility:hidden;opacity:0}.sds-side-bar-container:hover .close-side-bar-button:not(.hidden){visibility:visible;opacity:1}.sds-side-bar-container .close-side-bar-button{right:-1.1rem;visibility:hidden;transition:visibility 0s linear;transition:opacity .3s ease-in;opacity:0}:host{display:block}\n"] }]
|
|
103
|
+
}], ctorParameters: function () { return []; }, propDecorators: { showCloseButton: [{
|
|
104
|
+
type: Input
|
|
105
|
+
}], enablePullOutMode: [{
|
|
106
|
+
type: Input
|
|
107
|
+
}], widthRem: [{
|
|
33
108
|
type: Input
|
|
34
|
-
}],
|
|
109
|
+
}], product: [{
|
|
35
110
|
type: Input
|
|
36
|
-
}],
|
|
111
|
+
}], autoHideScreenWidth: [{
|
|
37
112
|
type: Input
|
|
38
|
-
}],
|
|
113
|
+
}], closeButtonHint: [{
|
|
39
114
|
type: Input
|
|
40
|
-
}],
|
|
115
|
+
}], openButtonHint: [{
|
|
41
116
|
type: Input
|
|
42
117
|
}] } });
|
|
43
118
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-side-bar.mjs","sources":["../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.component.ts","../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.component.html","../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.module.ts","../../../projects/ngx-sds-components/src/lib/side-bar/spicainternational-ngx-sds-components-src-lib-side-bar.ts"],"sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\r\nimport { IconDefinition, faChevronRight } from '@fortawesome/pro-regular-svg-icons';\r\n\r\n@Component({\r\n selector: 'sds-side-bar',\r\n templateUrl: './side-bar.component.html',\r\n styleUrls: ['./side-bar.component.scss'],\r\n})\r\nexport class SdsSideBarComponent implements OnInit {\r\n\r\n public showSideBar = false;\r\n\r\n @Input() product:string = '';\r\n @Input() isMainSideBar: boolean = false;\r\n @Input() showSideBarToggleButton: boolean = false;\r\n\r\n @Input() public hideSideBarText?: string;\r\n @Input() public showSideBarText?: string;\r\n\r\n\r\n public caretIcon: IconDefinition = faChevronRight;\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n\r\n public toggleSideBar(state?: boolean) {\r\n if (state !== undefined) {\r\n this.showSideBar = state;\r\n } else {\r\n this.showSideBar = !this.showSideBar;\r\n }\r\n } \r\n}\r\n","<aside\r\n class=\"sds-side-bar \"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.sds-main-side-bar] = \"isMainSideBar\"\r\n [class.hide-sidebar]=\"!showSideBar\"\r\n>\r\n <div class=\"d-flex flex-column h-100\">\r\n <div class=\"d-flex flex-column flex-grow-0 w-100 h-100\">\r\n <div\r\n *ngIf=\"showSideBarToggleButton\"\r\n class=\"toggle-side-bar-button position-absolute d-md-none rounded-circle toggleSideBar d-flex justify-content-center justify-content-center align-items-center\"\r\n [class.open]=\"showSideBar\"\r\n [title]=\"showSideBar ? hideSideBarText : showSideBarText\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <div class=\"toggle-side-bar-icon\">\r\n <fa-icon [icon]=\"caretIcon\"></fa-icon>\r\n </div> \r\n </div>\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n </div>\r\n</aside>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsSideBarComponent } from './side-bar.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\n\r\n\r\n\r\nconst components = [\r\n SdsSideBarComponent\r\n]\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule, FontAwesomeModule\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsSideBarModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAQa,mBAAmB,CAAA;AAc5B,IAAA,WAAA,GAAA;AAZO,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;AAElB,QAAA,IAAO,CAAA,OAAA,GAAU,EAAE,CAAC;AACpB,QAAA,IAAa,CAAA,aAAA,GAAY,KAAK,CAAC;AAC/B,QAAA,IAAuB,CAAA,uBAAA,GAAY,KAAK,CAAC;AAM3C,QAAA,IAAS,CAAA,SAAA,GAAmB,cAAc,CAAC;KAElC;AAEhB,IAAA,QAAQ,MAAW;AAEZ,IAAA,aAAa,CAAC,KAAe,EAAA;QAChC,IAAI,KAAK,KAAK,SAAS,EAAE;AACrB,YAAA,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;AAC5B,SAAA;AAAM,aAAA;AACH,YAAA,IAAI,CAAC,WAAW,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC;AACxC,SAAA;KACJ;;gHAxBQ,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,mBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,gPCR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,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAOnB,YAAY,EAAE,iBAAiB,aAP/B,mBAAmB,CAAA,EAAA,CAAA,CAAA;AAaV,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAPlB,OAAA,EAAA,CAAA;AACP,YAAA,YAAY,EAAE,iBAAiB;SAChC,CAAA,EAAA,CAAA,CAAA;2FAKU,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAX5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;AACZ,wBAAA,GAAG,UAAU;AACd,qBAAA;AACD,oBAAA,OAAO,EAAE;AACP,wBAAA,YAAY,EAAE,iBAAiB;AAChC,qBAAA;AACD,oBAAA,OAAO,EAAE;AACP,wBAAA,GAAG,UAAU;AACd,qBAAA;iBACF,CAAA;;;ACpBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-side-bar.mjs","sources":["../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.component.ts","../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.component.html","../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.module.ts","../../../projects/ngx-sds-components/src/lib/side-bar/spicainternational-ngx-sds-components-src-lib-side-bar.ts"],"sourcesContent":["import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';\r\nimport { IconDefinition, faAngleLeft, faChevronRight } from '@fortawesome/pro-solid-svg-icons';\r\nimport { Subject } from 'rxjs';\r\n// import { faSidebar } from '@fortawesome/pro-light-svg-icons';\r\n// import { IconDefinition, faSidebar, faChevronRight, faGripVertical, faGripLinesVertical, faChevronLeft, faArrowRightFromBracket } from '@fortawesome/pro-regular-svg-icons';\r\n\r\n@Component({\r\n selector: 'sds-side-bar',\r\n templateUrl: './side-bar.component.html',\r\n styleUrls: ['./side-bar.component.scss'],\r\n})\r\nexport class SdsSideBarComponent implements OnInit, OnChanges, OnDestroy {\r\n\r\n /**\r\n * Define when the hide panel button is shown. \r\n * Default is 'auto' which will only show the button when the users hovers over the panel.\r\n * 'always' will always show the button.\r\n *\r\n * @type {('always' | 'auto')}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public showCloseButton: 'always' | 'auto' = 'auto';\r\n \r\n /**\r\n * Pull out mode will show the side bar as user hovers over the left side of the screen\r\n * When side bar is in pull out mode it will be rendered over the main contents.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public enablePullOutMode: boolean = false;\r\n\r\n /**\r\n * Define the width of the side bar in rem.\r\n *\r\n * @type {number}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public widthRem: number = 14;\r\n\r\n /**\r\n * Product name defines the color scheme of the side bar.\r\n * Default is 'all-hours'.\r\n * Options: 'all-hours', 'door-cloud', 'my-hours', 'time-and-space'\r\n *\r\n * @type {string}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() product: 'all-hours' | 'door-cloud' | 'my-hours' | 'time-and-space' = 'all-hours';\r\n\r\n /**\r\n * Define the width of the screen that triggers hiding of the side bar.\r\n * Note that the width is checked at the component creation and not when the screen is resized.\r\n * If user resizes the screen he must manually hide the side bar.\r\n *\r\n * @type {(number | undefined)}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public autoHideScreenWidth: number | undefined = 992;\r\n\r\n /**\r\n * Define the hint of the hide button.\r\n *\r\n * @type {string}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public closeButtonHint?: string;\r\n\r\n /**\r\n * Define the hint of the show button.\r\n *\r\n * @type {string}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public openButtonHint?: string;\r\n\r\n\r\n public showSideBar = true;\r\n public pullOutSideBar = false; \r\n public caretIcon: IconDefinition = faAngleLeft;\r\n public autoHideActive: boolean = false;\r\n\r\n private screenWidth: number = 0;\r\n private componentInitialized: boolean = false;\r\n\r\n private _checkAutoHide$ = new Subject<void>();\r\n\r\n constructor() {\r\n\r\n this._checkAutoHide$.subscribe(() => {\r\n console.log('check autohide');\r\n if (this.componentInitialized && this.autoHideScreenWidth) {\r\n console.log('this.autoHideScreenWidthRem', this.autoHideScreenWidth);\r\n\r\n this.autoHideActive = this.screenWidth < this.autoHideScreenWidth;\r\n\r\n console.log('hideSideBar', this.autoHideActive);\r\n\r\n if (this.autoHideActive) {\r\n this.showSideBar = false;\r\n }\r\n }\r\n });\r\n }\r\n ngOnDestroy(): void {\r\n this._checkAutoHide$.unsubscribe();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['autoHideScreenWidthRem']) {\r\n this._checkAutoHide$.next();\r\n }\r\n }\r\n\r\n ngOnInit() { \r\n this.componentInitialized = true;\r\n this.screenWidth = window.innerWidth; \r\n console.log('screenWidth', this.screenWidth);\r\n this._checkAutoHide$.next();\r\n } \r\n\r\n public toggleSideBar(state?: boolean) {\r\n if (state !== undefined) {\r\n this.showSideBar = state;\r\n } else {\r\n this.showSideBar = !this.showSideBar;\r\n }\r\n } \r\n}\r\n","<div \r\n class=\"vh-100 position-relative sds-side-bar-container\"\r\n [class.sds-side-bar-open]=\"showSideBar\" \r\n >\r\n\r\n <!-- CLOSE SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || showSideBar)\"\r\n class=\"sds-side-bar-button-container close-side-bar-button\"\r\n [class.hidden]=\"!showSideBar\"\r\n [class.always-show]=\"showSideBar && showCloseButton === 'always'\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"closeButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\" \r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <!-- OPEN SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || !showSideBar)\" \r\n class=\"sds-side-bar-button-container open-side-bar-button\"\r\n [class.hidden]=\"showSideBar\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"openButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\"\r\n [rotate]=\"180\"\r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <aside\r\n class=\"sds-side-bar h-100 border-end\"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.shadow]=\"pullOutSideBar\"\r\n [class.sds-side-bar-open]=\"showSideBar\"\r\n [style.width.rem]=\"(showSideBar || pullOutSideBar) ? widthRem : enablePullOutMode ? 0.75 : 0\"\r\n \r\n (mouseleave)=\"pullOutSideBar = false\"\r\n >\r\n <div \r\n *ngIf=\"enablePullOutMode && !showSideBar && !pullOutSideBar\"\r\n class=\"sds-side-bar-pull-out h-100 position-absolute\" \r\n style=\"width: 0.75rem;\"\r\n (mouseenter)=\"pullOutSideBar = true\"\r\n >\r\n </div>\r\n\r\n <div class=\"d-flex flex-column flex-grow-0 h-100\" \r\n [style.width.rem]=\"widthRem\">\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n\r\n </aside>\r\n</div>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsSideBarComponent } from './side-bar.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\n\r\n\r\n\r\nconst components = [\r\n SdsSideBarComponent\r\n]\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule, FontAwesomeModule\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsSideBarModule { }\r\n","/**\n * Generated b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AA,EAAA,CAOnB,YAAY,EAAE,iBAAiB,aAP/B,mBAAmB,CAAA,EAAA,CAAA,CAAA;AAaV,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAPlB,OAAA,EAAA,CAAA;AACP,YAAA,YAAY,EAAE,iBAAiB;SAChC,CAAA,EAAA,CAAA,CAAA;2FAKU,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAX5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;AACZ,wBAAA,GAAG,UAAU;AACd,qBAAA;AACD,oBAAA,OAAO,EAAE;AACP,wBAAA,YAAY,EAAE,iBAAiB;AAChC,qBAAA;AACD,oBAAA,OAAO,EAAE;AACP,wBAAA,GAAG,UAAU;AACd,qBAAA;iBACF,CAAA;;;ACpBD;;AAEG;;;;"}
|
|
@@ -2,19 +2,90 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Component, Input, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import {
|
|
5
|
+
import { faAngleLeft } from '@fortawesome/pro-solid-svg-icons';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
6
7
|
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
7
8
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
8
9
|
|
|
10
|
+
// import { faSidebar } from '@fortawesome/pro-light-svg-icons';
|
|
11
|
+
// import { IconDefinition, faSidebar, faChevronRight, faGripVertical, faGripLinesVertical, faChevronLeft, faArrowRightFromBracket } from '@fortawesome/pro-regular-svg-icons';
|
|
9
12
|
class SdsSideBarComponent {
|
|
10
13
|
constructor() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Define when the hide panel button is shown.
|
|
16
|
+
* Default is 'auto' which will only show the button when the users hovers over the panel.
|
|
17
|
+
* 'always' will always show the button.
|
|
18
|
+
*
|
|
19
|
+
* @type {('always' | 'auto')}
|
|
20
|
+
* @memberof SdsSideBarComponent
|
|
21
|
+
*/
|
|
22
|
+
this.showCloseButton = 'auto';
|
|
23
|
+
/**
|
|
24
|
+
* Pull out mode will show the side bar as user hovers over the left side of the screen
|
|
25
|
+
* When side bar is in pull out mode it will be rendered over the main contents.
|
|
26
|
+
*
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
* @memberof SdsSideBarComponent
|
|
29
|
+
*/
|
|
30
|
+
this.enablePullOutMode = false;
|
|
31
|
+
/**
|
|
32
|
+
* Define the width of the side bar in rem.
|
|
33
|
+
*
|
|
34
|
+
* @type {number}
|
|
35
|
+
* @memberof SdsSideBarComponent
|
|
36
|
+
*/
|
|
37
|
+
this.widthRem = 14;
|
|
38
|
+
/**
|
|
39
|
+
* Product name defines the color scheme of the side bar.
|
|
40
|
+
* Default is 'all-hours'.
|
|
41
|
+
* Options: 'all-hours', 'door-cloud', 'my-hours', 'time-and-space'
|
|
42
|
+
*
|
|
43
|
+
* @type {string}
|
|
44
|
+
* @memberof SdsSideBarComponent
|
|
45
|
+
*/
|
|
46
|
+
this.product = 'all-hours';
|
|
47
|
+
/**
|
|
48
|
+
* Define the width of the screen that triggers hiding of the side bar.
|
|
49
|
+
* Note that the width is checked at the component creation and not when the screen is resized.
|
|
50
|
+
* If user resizes the screen he must manually hide the side bar.
|
|
51
|
+
*
|
|
52
|
+
* @type {(number | undefined)}
|
|
53
|
+
* @memberof SdsSideBarComponent
|
|
54
|
+
*/
|
|
55
|
+
this.autoHideScreenWidth = 992;
|
|
56
|
+
this.showSideBar = true;
|
|
57
|
+
this.pullOutSideBar = false;
|
|
58
|
+
this.caretIcon = faAngleLeft;
|
|
59
|
+
this.autoHideActive = false;
|
|
60
|
+
this.screenWidth = 0;
|
|
61
|
+
this.componentInitialized = false;
|
|
62
|
+
this._checkAutoHide$ = new Subject();
|
|
63
|
+
this._checkAutoHide$.subscribe(() => {
|
|
64
|
+
console.log('check autohide');
|
|
65
|
+
if (this.componentInitialized && this.autoHideScreenWidth) {
|
|
66
|
+
console.log('this.autoHideScreenWidthRem', this.autoHideScreenWidth);
|
|
67
|
+
this.autoHideActive = this.screenWidth < this.autoHideScreenWidth;
|
|
68
|
+
console.log('hideSideBar', this.autoHideActive);
|
|
69
|
+
if (this.autoHideActive) {
|
|
70
|
+
this.showSideBar = false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
ngOnDestroy() {
|
|
76
|
+
this._checkAutoHide$.unsubscribe();
|
|
77
|
+
}
|
|
78
|
+
ngOnChanges(changes) {
|
|
79
|
+
if (changes['autoHideScreenWidthRem']) {
|
|
80
|
+
this._checkAutoHide$.next();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
ngOnInit() {
|
|
84
|
+
this.componentInitialized = true;
|
|
85
|
+
this.screenWidth = window.innerWidth;
|
|
86
|
+
console.log('screenWidth', this.screenWidth);
|
|
87
|
+
this._checkAutoHide$.next();
|
|
16
88
|
}
|
|
17
|
-
ngOnInit() { }
|
|
18
89
|
toggleSideBar(state) {
|
|
19
90
|
if (state !== undefined) {
|
|
20
91
|
this.showSideBar = state;
|
|
@@ -25,19 +96,23 @@ class SdsSideBarComponent {
|
|
|
25
96
|
}
|
|
26
97
|
}
|
|
27
98
|
SdsSideBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
-
SdsSideBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsSideBarComponent, selector: "sds-side-bar", inputs: {
|
|
99
|
+
SdsSideBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsSideBarComponent, selector: "sds-side-bar", inputs: { showCloseButton: "showCloseButton", enablePullOutMode: "enablePullOutMode", widthRem: "widthRem", product: "product", autoHideScreenWidth: "autoHideScreenWidth", closeButtonHint: "closeButtonHint", openButtonHint: "openButtonHint" }, usesOnChanges: true, ngImport: i0, template: "<div \r\n class=\"vh-100 position-relative sds-side-bar-container\"\r\n [class.sds-side-bar-open]=\"showSideBar\" \r\n >\r\n\r\n <!-- CLOSE SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || showSideBar)\"\r\n class=\"sds-side-bar-button-container close-side-bar-button\"\r\n [class.hidden]=\"!showSideBar\"\r\n [class.always-show]=\"showSideBar && showCloseButton === 'always'\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"closeButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\" \r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <!-- OPEN SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || !showSideBar)\" \r\n class=\"sds-side-bar-button-container open-side-bar-button\"\r\n [class.hidden]=\"showSideBar\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"openButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\"\r\n [rotate]=\"180\"\r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <aside\r\n class=\"sds-side-bar h-100 border-end\"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.shadow]=\"pullOutSideBar\"\r\n [class.sds-side-bar-open]=\"showSideBar\"\r\n [style.width.rem]=\"(showSideBar || pullOutSideBar) ? widthRem : enablePullOutMode ? 0.75 : 0\"\r\n \r\n (mouseleave)=\"pullOutSideBar = false\"\r\n >\r\n <div \r\n *ngIf=\"enablePullOutMode && !showSideBar && !pullOutSideBar\"\r\n class=\"sds-side-bar-pull-out h-100 position-absolute\" \r\n style=\"width: 0.75rem;\"\r\n (mouseenter)=\"pullOutSideBar = true\"\r\n >\r\n </div>\r\n\r\n <div class=\"d-flex flex-column flex-grow-0 h-100\" \r\n [style.width.rem]=\"widthRem\">\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n\r\n </aside>\r\n</div>", styles: [".sds-side-bar{transition:.3s;overflow-x:hidden;position:absolute;z-index:10}.sds-side-bar.sds-side-bar-open{position:relative}.sds-side-bar:has(.sds-side-bar-pull-out:hover){width:var(--sds-side-bar-width)!important}.sds-side-bar .sds-side-bar-pull-out{background-color:#f8f9fa}.sds-side-bar-container .sds-side-bar-button-container{position:absolute;z-index:11;height:2.2rem;width:2.2rem;top:.85rem;border-radius:50%;background-color:#fff}.sds-side-bar-container .sds-side-bar-button-container.always-show{visibility:visible;opacity:1}.sds-side-bar-container button{height:2.2rem;width:2.2rem;display:flex;align-items:center;justify-content:center;border:1px solid #CED4DA;border-radius:50%;color:#375d75!important;line-height:1rem}.sds-side-bar-container button:hover{color:#f8f9fa!important}.sds-side-bar-container button .hot-spot{position:absolute;inset:-1rem}.sds-side-bar-container .open-side-bar-button{top:.85rem;right:-2.3rem;transition:visibility 0ms linear .18s;transition:opacity 0ms linear .18s;visibility:visible;opacity:1}.sds-side-bar-container .open-side-bar-button.hidden{visibility:hidden;opacity:0}.sds-side-bar-container:hover .close-side-bar-button:not(.hidden){visibility:visible;opacity:1}.sds-side-bar-container .close-side-bar-button{right:-1.1rem;visibility:hidden;transition:visibility 0s linear;transition:opacity .3s ease-in;opacity:0}:host{display:block}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
29
100
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarComponent, decorators: [{
|
|
30
101
|
type: Component,
|
|
31
|
-
args: [{ selector: 'sds-side-bar', template: "<
|
|
32
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
102
|
+
args: [{ selector: 'sds-side-bar', template: "<div \r\n class=\"vh-100 position-relative sds-side-bar-container\"\r\n [class.sds-side-bar-open]=\"showSideBar\" \r\n >\r\n\r\n <!-- CLOSE SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || showSideBar)\"\r\n class=\"sds-side-bar-button-container close-side-bar-button\"\r\n [class.hidden]=\"!showSideBar\"\r\n [class.always-show]=\"showSideBar && showCloseButton === 'always'\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"closeButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\" \r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <!-- OPEN SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || !showSideBar)\" \r\n class=\"sds-side-bar-button-container open-side-bar-button\"\r\n [class.hidden]=\"showSideBar\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"openButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\"\r\n [rotate]=\"180\"\r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <aside\r\n class=\"sds-side-bar h-100 border-end\"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.shadow]=\"pullOutSideBar\"\r\n [class.sds-side-bar-open]=\"showSideBar\"\r\n [style.width.rem]=\"(showSideBar || pullOutSideBar) ? widthRem : enablePullOutMode ? 0.75 : 0\"\r\n \r\n (mouseleave)=\"pullOutSideBar = false\"\r\n >\r\n <div \r\n *ngIf=\"enablePullOutMode && !showSideBar && !pullOutSideBar\"\r\n class=\"sds-side-bar-pull-out h-100 position-absolute\" \r\n style=\"width: 0.75rem;\"\r\n (mouseenter)=\"pullOutSideBar = true\"\r\n >\r\n </div>\r\n\r\n <div class=\"d-flex flex-column flex-grow-0 h-100\" \r\n [style.width.rem]=\"widthRem\">\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n\r\n </aside>\r\n</div>", styles: [".sds-side-bar{transition:.3s;overflow-x:hidden;position:absolute;z-index:10}.sds-side-bar.sds-side-bar-open{position:relative}.sds-side-bar:has(.sds-side-bar-pull-out:hover){width:var(--sds-side-bar-width)!important}.sds-side-bar .sds-side-bar-pull-out{background-color:#f8f9fa}.sds-side-bar-container .sds-side-bar-button-container{position:absolute;z-index:11;height:2.2rem;width:2.2rem;top:.85rem;border-radius:50%;background-color:#fff}.sds-side-bar-container .sds-side-bar-button-container.always-show{visibility:visible;opacity:1}.sds-side-bar-container button{height:2.2rem;width:2.2rem;display:flex;align-items:center;justify-content:center;border:1px solid #CED4DA;border-radius:50%;color:#375d75!important;line-height:1rem}.sds-side-bar-container button:hover{color:#f8f9fa!important}.sds-side-bar-container button .hot-spot{position:absolute;inset:-1rem}.sds-side-bar-container .open-side-bar-button{top:.85rem;right:-2.3rem;transition:visibility 0ms linear .18s;transition:opacity 0ms linear .18s;visibility:visible;opacity:1}.sds-side-bar-container .open-side-bar-button.hidden{visibility:hidden;opacity:0}.sds-side-bar-container:hover .close-side-bar-button:not(.hidden){visibility:visible;opacity:1}.sds-side-bar-container .close-side-bar-button{right:-1.1rem;visibility:hidden;transition:visibility 0s linear;transition:opacity .3s ease-in;opacity:0}:host{display:block}\n"] }]
|
|
103
|
+
}], ctorParameters: function () { return []; }, propDecorators: { showCloseButton: [{
|
|
104
|
+
type: Input
|
|
105
|
+
}], enablePullOutMode: [{
|
|
106
|
+
type: Input
|
|
107
|
+
}], widthRem: [{
|
|
33
108
|
type: Input
|
|
34
|
-
}],
|
|
109
|
+
}], product: [{
|
|
35
110
|
type: Input
|
|
36
|
-
}],
|
|
111
|
+
}], autoHideScreenWidth: [{
|
|
37
112
|
type: Input
|
|
38
|
-
}],
|
|
113
|
+
}], closeButtonHint: [{
|
|
39
114
|
type: Input
|
|
40
|
-
}],
|
|
115
|
+
}], openButtonHint: [{
|
|
41
116
|
type: Input
|
|
42
117
|
}] } });
|
|
43
118
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-side-bar.mjs","sources":["../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.component.ts","../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.component.html","../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.module.ts","../../../projects/ngx-sds-components/src/lib/side-bar/spicainternational-ngx-sds-components-src-lib-side-bar.ts"],"sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\r\nimport { IconDefinition, faChevronRight } from '@fortawesome/pro-regular-svg-icons';\r\n\r\n@Component({\r\n selector: 'sds-side-bar',\r\n templateUrl: './side-bar.component.html',\r\n styleUrls: ['./side-bar.component.scss'],\r\n})\r\nexport class SdsSideBarComponent implements OnInit {\r\n\r\n public showSideBar = false;\r\n\r\n @Input() product:string = '';\r\n @Input() isMainSideBar: boolean = false;\r\n @Input() showSideBarToggleButton: boolean = false;\r\n\r\n @Input() public hideSideBarText?: string;\r\n @Input() public showSideBarText?: string;\r\n\r\n\r\n public caretIcon: IconDefinition = faChevronRight;\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n\r\n public toggleSideBar(state?: boolean) {\r\n if (state !== undefined) {\r\n this.showSideBar = state;\r\n } else {\r\n this.showSideBar = !this.showSideBar;\r\n }\r\n } \r\n}\r\n","<aside\r\n class=\"sds-side-bar \"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.sds-main-side-bar] = \"isMainSideBar\"\r\n [class.hide-sidebar]=\"!showSideBar\"\r\n>\r\n <div class=\"d-flex flex-column h-100\">\r\n <div class=\"d-flex flex-column flex-grow-0 w-100 h-100\">\r\n <div\r\n *ngIf=\"showSideBarToggleButton\"\r\n class=\"toggle-side-bar-button position-absolute d-md-none rounded-circle toggleSideBar d-flex justify-content-center justify-content-center align-items-center\"\r\n [class.open]=\"showSideBar\"\r\n [title]=\"showSideBar ? hideSideBarText : showSideBarText\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <div class=\"toggle-side-bar-icon\">\r\n <fa-icon [icon]=\"caretIcon\"></fa-icon>\r\n </div> \r\n </div>\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n </div>\r\n</aside>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsSideBarComponent } from './side-bar.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\n\r\n\r\n\r\nconst components = [\r\n SdsSideBarComponent\r\n]\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule, FontAwesomeModule\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsSideBarModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAQa,mBAAmB,CAAA;AAc5B,IAAA,WAAA,GAAA;QAZO,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;QAElB,IAAO,CAAA,OAAA,GAAU,EAAE,CAAC;QACpB,IAAa,CAAA,aAAA,GAAY,KAAK,CAAC;QAC/B,IAAuB,CAAA,uBAAA,GAA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"}
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-side-bar.mjs","sources":["../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.component.ts","../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.component.html","../../../projects/ngx-sds-components/src/lib/side-bar/side-bar.module.ts","../../../projects/ngx-sds-components/src/lib/side-bar/spicainternational-ngx-sds-components-src-lib-side-bar.ts"],"sourcesContent":["import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';\r\nimport { IconDefinition, faAngleLeft, faChevronRight } from '@fortawesome/pro-solid-svg-icons';\r\nimport { Subject } from 'rxjs';\r\n// import { faSidebar } from '@fortawesome/pro-light-svg-icons';\r\n// import { IconDefinition, faSidebar, faChevronRight, faGripVertical, faGripLinesVertical, faChevronLeft, faArrowRightFromBracket } from '@fortawesome/pro-regular-svg-icons';\r\n\r\n@Component({\r\n selector: 'sds-side-bar',\r\n templateUrl: './side-bar.component.html',\r\n styleUrls: ['./side-bar.component.scss'],\r\n})\r\nexport class SdsSideBarComponent implements OnInit, OnChanges, OnDestroy {\r\n\r\n /**\r\n * Define when the hide panel button is shown. \r\n * Default is 'auto' which will only show the button when the users hovers over the panel.\r\n * 'always' will always show the button.\r\n *\r\n * @type {('always' | 'auto')}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public showCloseButton: 'always' | 'auto' = 'auto';\r\n \r\n /**\r\n * Pull out mode will show the side bar as user hovers over the left side of the screen\r\n * When side bar is in pull out mode it will be rendered over the main contents.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public enablePullOutMode: boolean = false;\r\n\r\n /**\r\n * Define the width of the side bar in rem.\r\n *\r\n * @type {number}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public widthRem: number = 14;\r\n\r\n /**\r\n * Product name defines the color scheme of the side bar.\r\n * Default is 'all-hours'.\r\n * Options: 'all-hours', 'door-cloud', 'my-hours', 'time-and-space'\r\n *\r\n * @type {string}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() product: 'all-hours' | 'door-cloud' | 'my-hours' | 'time-and-space' = 'all-hours';\r\n\r\n /**\r\n * Define the width of the screen that triggers hiding of the side bar.\r\n * Note that the width is checked at the component creation and not when the screen is resized.\r\n * If user resizes the screen he must manually hide the side bar.\r\n *\r\n * @type {(number | undefined)}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public autoHideScreenWidth: number | undefined = 992;\r\n\r\n /**\r\n * Define the hint of the hide button.\r\n *\r\n * @type {string}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public closeButtonHint?: string;\r\n\r\n /**\r\n * Define the hint of the show button.\r\n *\r\n * @type {string}\r\n * @memberof SdsSideBarComponent\r\n */\r\n @Input() public openButtonHint?: string;\r\n\r\n\r\n public showSideBar = true;\r\n public pullOutSideBar = false; \r\n public caretIcon: IconDefinition = faAngleLeft;\r\n public autoHideActive: boolean = false;\r\n\r\n private screenWidth: number = 0;\r\n private componentInitialized: boolean = false;\r\n\r\n private _checkAutoHide$ = new Subject<void>();\r\n\r\n constructor() {\r\n\r\n this._checkAutoHide$.subscribe(() => {\r\n console.log('check autohide');\r\n if (this.componentInitialized && this.autoHideScreenWidth) {\r\n console.log('this.autoHideScreenWidthRem', this.autoHideScreenWidth);\r\n\r\n this.autoHideActive = this.screenWidth < this.autoHideScreenWidth;\r\n\r\n console.log('hideSideBar', this.autoHideActive);\r\n\r\n if (this.autoHideActive) {\r\n this.showSideBar = false;\r\n }\r\n }\r\n });\r\n }\r\n ngOnDestroy(): void {\r\n this._checkAutoHide$.unsubscribe();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['autoHideScreenWidthRem']) {\r\n this._checkAutoHide$.next();\r\n }\r\n }\r\n\r\n ngOnInit() { \r\n this.componentInitialized = true;\r\n this.screenWidth = window.innerWidth; \r\n console.log('screenWidth', this.screenWidth);\r\n this._checkAutoHide$.next();\r\n } \r\n\r\n public toggleSideBar(state?: boolean) {\r\n if (state !== undefined) {\r\n this.showSideBar = state;\r\n } else {\r\n this.showSideBar = !this.showSideBar;\r\n }\r\n } \r\n}\r\n","<div \r\n class=\"vh-100 position-relative sds-side-bar-container\"\r\n [class.sds-side-bar-open]=\"showSideBar\" \r\n >\r\n\r\n <!-- CLOSE SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || showSideBar)\"\r\n class=\"sds-side-bar-button-container close-side-bar-button\"\r\n [class.hidden]=\"!showSideBar\"\r\n [class.always-show]=\"showSideBar && showCloseButton === 'always'\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"closeButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\" \r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <!-- OPEN SIDEBAR -->\r\n <div \r\n *ngIf=\"!pullOutSideBar && (true || !showSideBar)\" \r\n class=\"sds-side-bar-button-container open-side-bar-button\"\r\n [class.hidden]=\"showSideBar\"\r\n >\r\n \r\n <button\r\n class=\"btn btn-outline-primary shadow-sm\"\r\n [title]=\"openButtonHint\"\r\n (click)=\"toggleSideBar()\"\r\n >\r\n <fa-icon \r\n [icon]=\"caretIcon\"\r\n [rotate]=\"180\"\r\n size=\"xs\"\r\n >\r\n </fa-icon>\r\n\r\n <div class=\"hot-spot\"></div>\r\n\r\n </button>\r\n </div>\r\n\r\n <aside\r\n class=\"sds-side-bar h-100 border-end\"\r\n [class]=\"(product ? 'product-' + product : null)\"\r\n [class.shadow]=\"pullOutSideBar\"\r\n [class.sds-side-bar-open]=\"showSideBar\"\r\n [style.width.rem]=\"(showSideBar || pullOutSideBar) ? widthRem : enablePullOutMode ? 0.75 : 0\"\r\n \r\n (mouseleave)=\"pullOutSideBar = false\"\r\n >\r\n <div \r\n *ngIf=\"enablePullOutMode && !showSideBar && !pullOutSideBar\"\r\n class=\"sds-side-bar-pull-out h-100 position-absolute\" \r\n style=\"width: 0.75rem;\"\r\n (mouseenter)=\"pullOutSideBar = true\"\r\n >\r\n </div>\r\n\r\n <div class=\"d-flex flex-column flex-grow-0 h-100\" \r\n [style.width.rem]=\"widthRem\">\r\n\r\n <ng-content></ng-content> \r\n </div>\r\n\r\n </aside>\r\n</div>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsSideBarComponent } from './side-bar.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\n\r\n\r\n\r\nconst components = [\r\n SdsSideBarComponent\r\n]\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule, FontAwesomeModule\r\n ],\r\n exports: [\r\n ...components\r\n ]\r\n})\r\nexport class SdsSideBarModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAGA;AACA;MAOa,mBAAmB,CAAA;AA4E5B,IAAA,WAAA,GAAA;AA1EA;;;;;;;AAOG;QACa,IAAe,CAAA,eAAA,GAAsB,MAAM,CAAC;AAE5D;;;;;;AAMG;QACa,IAAiB,CAAA,iBAAA,GAAY,KAAK,CAAC;AAEnD;;;;;AAKG;QACa,IAAQ,CAAA,QAAA,GAAW,EAAE,CAAC;AAEtC;;;;;;;AAOG;QACM,IAAO,CAAA,OAAA,GAA+D,WAAW,CAAC;AAE3F;;;;;;;AAOG;QACa,IAAmB,CAAA,mBAAA,GAAuB,GAAG,CAAC;QAmBvD,IAAW,CAAA,WAAA,GAAG,IAAI,CAAC;QACnB,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;QACvB,IAAS,CAAA,SAAA,GAAmB,WAAW,CAAC;QACxC,IAAc,CAAA,cAAA,GAAY,KAAK,CAAC;QAE/B,IAAW,CAAA,WAAA,GAAW,CAAC,CAAC;QACxB,I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|
2
|
-
import { IconDefinition } from '@fortawesome/pro-
|
|
1
|
+
import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { IconDefinition } from '@fortawesome/pro-solid-svg-icons';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class SdsSideBarComponent implements OnInit {
|
|
4
|
+
export declare class SdsSideBarComponent implements OnInit, OnChanges, OnDestroy {
|
|
5
|
+
/**
|
|
6
|
+
* Define when the hide panel button is shown.
|
|
7
|
+
* Default is 'auto' which will only show the button when the users hovers over the panel.
|
|
8
|
+
* 'always' will always show the button.
|
|
9
|
+
*
|
|
10
|
+
* @type {('always' | 'auto')}
|
|
11
|
+
* @memberof SdsSideBarComponent
|
|
12
|
+
*/
|
|
13
|
+
showCloseButton: 'always' | 'auto';
|
|
14
|
+
/**
|
|
15
|
+
* Pull out mode will show the side bar as user hovers over the left side of the screen
|
|
16
|
+
* When side bar is in pull out mode it will be rendered over the main contents.
|
|
17
|
+
*
|
|
18
|
+
* @type {boolean}
|
|
19
|
+
* @memberof SdsSideBarComponent
|
|
20
|
+
*/
|
|
21
|
+
enablePullOutMode: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Define the width of the side bar in rem.
|
|
24
|
+
*
|
|
25
|
+
* @type {number}
|
|
26
|
+
* @memberof SdsSideBarComponent
|
|
27
|
+
*/
|
|
28
|
+
widthRem: number;
|
|
29
|
+
/**
|
|
30
|
+
* Product name defines the color scheme of the side bar.
|
|
31
|
+
* Default is 'all-hours'.
|
|
32
|
+
* Options: 'all-hours', 'door-cloud', 'my-hours', 'time-and-space'
|
|
33
|
+
*
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @memberof SdsSideBarComponent
|
|
36
|
+
*/
|
|
37
|
+
product: 'all-hours' | 'door-cloud' | 'my-hours' | 'time-and-space';
|
|
38
|
+
/**
|
|
39
|
+
* Define the width of the screen that triggers hiding of the side bar.
|
|
40
|
+
* Note that the width is checked at the component creation and not when the screen is resized.
|
|
41
|
+
* If user resizes the screen he must manually hide the side bar.
|
|
42
|
+
*
|
|
43
|
+
* @type {(number | undefined)}
|
|
44
|
+
* @memberof SdsSideBarComponent
|
|
45
|
+
*/
|
|
46
|
+
autoHideScreenWidth: number | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Define the hint of the hide button.
|
|
49
|
+
*
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof SdsSideBarComponent
|
|
52
|
+
*/
|
|
53
|
+
closeButtonHint?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Define the hint of the show button.
|
|
56
|
+
*
|
|
57
|
+
* @type {string}
|
|
58
|
+
* @memberof SdsSideBarComponent
|
|
59
|
+
*/
|
|
60
|
+
openButtonHint?: string;
|
|
5
61
|
showSideBar: boolean;
|
|
6
|
-
|
|
7
|
-
isMainSideBar: boolean;
|
|
8
|
-
showSideBarToggleButton: boolean;
|
|
9
|
-
hideSideBarText?: string;
|
|
10
|
-
showSideBarText?: string;
|
|
62
|
+
pullOutSideBar: boolean;
|
|
11
63
|
caretIcon: IconDefinition;
|
|
64
|
+
autoHideActive: boolean;
|
|
65
|
+
private screenWidth;
|
|
66
|
+
private componentInitialized;
|
|
67
|
+
private _checkAutoHide$;
|
|
12
68
|
constructor();
|
|
69
|
+
ngOnDestroy(): void;
|
|
70
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
13
71
|
ngOnInit(): void;
|
|
14
72
|
toggleSideBar(state?: boolean): void;
|
|
15
73
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsSideBarComponent, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsSideBarComponent, "sds-side-bar", never, { "
|
|
74
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsSideBarComponent, "sds-side-bar", never, { "showCloseButton": "showCloseButton"; "enablePullOutMode": "enablePullOutMode"; "widthRem": "widthRem"; "product": "product"; "autoHideScreenWidth": "autoHideScreenWidth"; "closeButtonHint": "closeButtonHint"; "openButtonHint": "openButtonHint"; }, {}, never, ["*"]>;
|
|
17
75
|
}
|