@spicainternational/ngx-sds-components 2.30.3 → 2.31.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/esm2020/src/lib/expansion-panel/expansion-panel.component.mjs +3 -3
- package/esm2020/src/lib/expansion-panel/expansion-panel.module.mjs +6 -15
- package/esm2020/src/lib/modal/dialog/dialog.component.mjs +11 -5
- package/esm2020/src/lib/modal/dialog/dialog.types.mjs +2 -0
- package/esm2020/src/lib/side-bar/side-bar.component.mjs +11 -4
- package/esm2020/src/lib/side-bar/side-bar.module.mjs +5 -4
- package/esm2020/src/lib/tooltip/tooltip.directive.mjs +9 -2
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-expansion-panel.mjs +7 -16
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-expansion-panel.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-modal.mjs +10 -4
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-modal.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-side-bar.mjs +14 -6
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-side-bar.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-tooltip.mjs +8 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-tooltip.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-expansion-panel.mjs +7 -16
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-expansion-panel.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-modal.mjs +10 -4
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-modal.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-side-bar.mjs +14 -6
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-side-bar.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-tooltip.mjs +8 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/modal/dialog/dialog.component.d.ts +5 -2
- package/src/lib/modal/dialog/dialog.types.d.ts +1 -0
- package/src/lib/side-bar/side-bar.component.d.ts +5 -1
- package/src/lib/side-bar/side-bar.module.d.ts +2 -1
- package/src/lib/tooltip/tooltip.directive.d.ts +3 -2
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, Input, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { faChevronRight } from '@fortawesome/pro-regular-svg-icons';
|
|
6
|
+
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
7
|
+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
5
8
|
|
|
6
9
|
class SdsSideBarComponent {
|
|
7
10
|
constructor() {
|
|
@@ -9,6 +12,7 @@ class SdsSideBarComponent {
|
|
|
9
12
|
this.product = '';
|
|
10
13
|
this.isMainSideBar = false;
|
|
11
14
|
this.showSideBarToggleButton = false;
|
|
15
|
+
this.caretIcon = faChevronRight;
|
|
12
16
|
}
|
|
13
17
|
ngOnInit() { }
|
|
14
18
|
toggleSideBar(state) {
|
|
@@ -21,16 +25,20 @@ class SdsSideBarComponent {
|
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
SdsSideBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
-
SdsSideBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsSideBarComponent, selector: "sds-side-bar", inputs: { product: "product", isMainSideBar: "isMainSideBar", showSideBarToggleButton: "showSideBarToggleButton"
|
|
28
|
+
SdsSideBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsSideBarComponent, selector: "sds-side-bar", inputs: { product: "product", isMainSideBar: "isMainSideBar", showSideBarToggleButton: "showSideBarToggleButton", hideSideBarText: "hideSideBarText", showSideBarText: "showSideBarText" }, ngImport: i0, template: "<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", styles: [".toggle-side-bar-button{transition:transform .2s linear}.toggle-side-bar-button.open .toggle-side-bar-icon{transform:rotate(-180deg)}\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"] }] });
|
|
25
29
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarComponent, decorators: [{
|
|
26
30
|
type: Component,
|
|
27
|
-
args: [{ selector: 'sds-side-bar', template: "
|
|
31
|
+
args: [{ selector: 'sds-side-bar', template: "<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", styles: [".toggle-side-bar-button{transition:transform .2s linear}.toggle-side-bar-button.open .toggle-side-bar-icon{transform:rotate(-180deg)}\n"] }]
|
|
28
32
|
}], ctorParameters: function () { return []; }, propDecorators: { product: [{
|
|
29
33
|
type: Input
|
|
30
34
|
}], isMainSideBar: [{
|
|
31
35
|
type: Input
|
|
32
36
|
}], showSideBarToggleButton: [{
|
|
33
37
|
type: Input
|
|
38
|
+
}], hideSideBarText: [{
|
|
39
|
+
type: Input
|
|
40
|
+
}], showSideBarText: [{
|
|
41
|
+
type: Input
|
|
34
42
|
}] } });
|
|
35
43
|
|
|
36
44
|
const components = [
|
|
@@ -39,9 +47,9 @@ const components = [
|
|
|
39
47
|
class SdsSideBarModule {
|
|
40
48
|
}
|
|
41
49
|
SdsSideBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
42
|
-
SdsSideBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarModule, declarations: [SdsSideBarComponent], imports: [CommonModule], exports: [SdsSideBarComponent] });
|
|
50
|
+
SdsSideBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarModule, declarations: [SdsSideBarComponent], imports: [CommonModule, FontAwesomeModule], exports: [SdsSideBarComponent] });
|
|
43
51
|
SdsSideBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarModule, imports: [[
|
|
44
|
-
CommonModule
|
|
52
|
+
CommonModule, FontAwesomeModule
|
|
45
53
|
]] });
|
|
46
54
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsSideBarModule, decorators: [{
|
|
47
55
|
type: NgModule,
|
|
@@ -50,7 +58,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
50
58
|
...components
|
|
51
59
|
],
|
|
52
60
|
imports: [
|
|
53
|
-
CommonModule
|
|
61
|
+
CommonModule, FontAwesomeModule
|
|
54
62
|
],
|
|
55
63
|
exports: [
|
|
56
64
|
...components
|
|
@@ -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\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 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","
|
|
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,GAAY,KAAK,CAAC;QAM3C,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,mB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AA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhB,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,iBAbzB,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;AAChC,SAAA,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;AACF,iBAAA,CAAA;;;ACpBD;;AAEG;;;;"}
|
|
@@ -40,6 +40,13 @@ class TooltipDirective {
|
|
|
40
40
|
// this.setHideTooltipTimeout();
|
|
41
41
|
// });
|
|
42
42
|
}
|
|
43
|
+
ngOnChanges(changes) {
|
|
44
|
+
if (changes['tooltip']) {
|
|
45
|
+
if (this.componentRef !== null) {
|
|
46
|
+
this.componentRef.instance.tooltip = this.tooltip;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
43
50
|
onMouseEnter() {
|
|
44
51
|
this.initializeTooltip();
|
|
45
52
|
}
|
|
@@ -142,7 +149,7 @@ class TooltipDirective {
|
|
|
142
149
|
}
|
|
143
150
|
}
|
|
144
151
|
TooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.ApplicationRef }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
145
|
-
TooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.1", type: TooltipDirective, selector: "[sdsTooltip]", inputs: { tooltip: "tooltip", position: "position", theme: "theme", showDelay: "showDelay", hideDelay: "hideDelay" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "mousemove": "onMouseMove($event)", "touchstart": "onTouchStart($event)", "touchend": "onTouchEnd()" } }, ngImport: i0 });
|
|
152
|
+
TooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.1", type: TooltipDirective, selector: "[sdsTooltip]", inputs: { tooltip: "tooltip", position: "position", theme: "theme", showDelay: "showDelay", hideDelay: "hideDelay" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "mousemove": "onMouseMove($event)", "touchstart": "onTouchStart($event)", "touchend": "onTouchEnd()" } }, usesOnChanges: true, ngImport: i0 });
|
|
146
153
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
147
154
|
type: Directive,
|
|
148
155
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-tooltip.mjs","sources":["../../../projects/ngx-sds-components/src/lib/tooltip/components/tooltip.component.ts","../../../projects/ngx-sds-components/src/lib/tooltip/components/tooltip.component.html","../../../projects/ngx-sds-components/src/lib/tooltip/tooltip.directive.ts","../../../projects/ngx-sds-components/src/lib/tooltip/tooltip.module.ts","../../../projects/ngx-sds-components/src/lib/tooltip/spicainternational-ngx-sds-components-src-lib-tooltip.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\r\nimport { TooltipPosition, TooltipTheme } from '../tooltip.types';\r\n\r\n@Component({\r\n selector: 'sds-tooltip',\r\n templateUrl: './tooltip.component.html',\r\n styleUrls: ['./tooltip.component.scss'],\r\n})\r\nexport class SdsTooltipComponent implements OnInit {\r\n\r\n public tooltip: string = '';\r\n public left: number = 0;\r\n public top: number = 0;\r\n public visible: boolean = false;\r\n\r\n public position: TooltipPosition = 'above';\r\n public theme: TooltipTheme = 'dark';\r\n\r\n\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n}\r\n","<div class=\"sds-tooltip\"\r\n [ngClass]=\"['sds-tooltip-' + position, 'sds-tooltip-' + theme]\"\r\n [class.sds-tooltip-visible]=\"visible\"\r\n [style.left.px]=\"left\"\r\n [style.top.px]=\"top\"\r\n >\r\n <small>\r\n {{ tooltip }}\r\n </small>\r\n</div>\r\n","import {\r\n ApplicationRef,\r\n ComponentFactoryResolver,\r\n ComponentRef,\r\n Directive,\r\n ElementRef,\r\n EmbeddedViewRef,\r\n HostListener,\r\n Injector,\r\n Input,\r\n Renderer2,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\nimport { SdsTooltipComponent } from './components/tooltip.component';\r\nimport { TooltipPosition, TooltipTheme } from './tooltip.types';\r\n\r\n@Directive({\r\n selector: '[sdsTooltip]',\r\n})\r\nexport class TooltipDirective {\r\n @Input() tooltip = '';\r\n @Input() position: TooltipPosition = 'above';\r\n @Input() theme: TooltipTheme = 'dark';\r\n @Input() showDelay = 0;\r\n @Input() hideDelay = 0;\r\n\r\n private componentRef: ComponentRef<any> | null = null;\r\n private showTimeout?: number;\r\n private hideTimeout?: number;\r\n private touchTimeout?: number;\r\n\r\n\r\n constructor(\r\n private elementRef: ElementRef,\r\n private appRef: ApplicationRef,\r\n private componentFactoryResolver: ComponentFactoryResolver,\r\n // private viewContainerRef: ViewContainerRef,\r\n private injector: Injector,\r\n // private renderer2: Renderer2\r\n ) {\r\n // this.renderer2.listen('window', 'scroll', (_) => {\r\n // console.log('scroll');\r\n // this.setHideTooltipTimeout();\r\n // });\r\n }\r\n\r\n @HostListener('mouseenter')\r\n onMouseEnter(): void {\r\n this.initializeTooltip();\r\n }\r\n\r\n @HostListener('mouseleave')\r\n onMouseLeave(): void {\r\n this.setHideTooltipTimeout();\r\n }\r\n\r\n // @HostListener(\"window:scroll\", [])\r\n // onWindowScroll() {\r\n // console.log('scroll');\r\n // this.setHideTooltipTimeout();\r\n // }\r\n\r\n // @HostListener('window:scroll') onScroll(e: Event): void {\r\n // console.log((e.target as Element).scrollTop);\r\n // }\r\n\r\n // @HostListener('scroll') onScrollHost(e: Event): void {\r\n // console.log((e.target as Element).scrollTop);\r\n // }\r\n\r\n @HostListener('mousemove', ['$event'])\r\n onMouseMove($event: MouseEvent): void {\r\n if (this.componentRef !== null && this.position === 'dynamic') {\r\n this.componentRef.instance.left = $event.clientX;\r\n this.componentRef.instance.top = $event.clientY;\r\n this.componentRef.instance.tooltip = this.tooltip;\r\n }\r\n }\r\n\r\n @HostListener('touchstart', ['$event'])\r\n onTouchStart($event: TouchEvent): void {\r\n $event.preventDefault();\r\n window.clearTimeout(this.touchTimeout);\r\n this.touchTimeout = window.setTimeout(this.initializeTooltip.bind(this), 500);\r\n }\r\n\r\n @HostListener('touchend')\r\n onTouchEnd(): void {\r\n window.clearTimeout(this.touchTimeout);\r\n this.setHideTooltipTimeout();\r\n }\r\n\r\n private initializeTooltip() {\r\n if (this.componentRef === null) {\r\n window.clearInterval(this.hideDelay);\r\n\r\n if (this.tooltip) {\r\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(SdsTooltipComponent);\r\n this.componentRef = componentFactory.create(this.injector);\r\n\r\n this.appRef.attachView(this.componentRef.hostView);\r\n const [tooltipDOMElement] = (this.componentRef.hostView as EmbeddedViewRef<any>).rootNodes;\r\n\r\n this.setTooltipComponentProperties();\r\n\r\n document.body.appendChild(tooltipDOMElement);\r\n this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);\r\n }\r\n }\r\n }\r\n\r\n private setTooltipComponentProperties() {\r\n if (this.componentRef !== null) {\r\n this.componentRef.instance.tooltip = this.tooltip;\r\n this.componentRef.instance.position = this.position;\r\n this.componentRef.instance.theme = this.theme;\r\n\r\n const { left, right, top, bottom } = this.elementRef.nativeElement.getBoundingClientRect();\r\n\r\n switch (this.position) {\r\n case 'below': {\r\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\r\n this.componentRef.instance.top = Math.round(bottom);\r\n break;\r\n }\r\n case 'above': {\r\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\r\n this.componentRef.instance.top = Math.round(top);\r\n break;\r\n }\r\n case 'right': {\r\n this.componentRef.instance.left = Math.round(right);\r\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\r\n break;\r\n }\r\n case 'left': {\r\n this.componentRef.instance.left = Math.round(left);\r\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n private showTooltip() {\r\n if (this.tooltip && this.componentRef !== null) {\r\n this.componentRef.instance.visible = true;\r\n }\r\n }\r\n\r\n private setHideTooltipTimeout() {\r\n this.hideTimeout = window.setTimeout(this.destroy.bind(this), this.hideDelay);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.destroy();\r\n }\r\n\r\n destroy(): void {\r\n if (this.componentRef !== null) {\r\n window.clearInterval(this.showTimeout);\r\n window.clearInterval(this.hideDelay);\r\n this.appRef.detachView(this.componentRef.hostView);\r\n this.componentRef.destroy();\r\n this.componentRef = null;\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsTooltipComponent } from '../tooltip/components/tooltip.component';\r\nimport { TooltipDirective } from './tooltip.directive';\r\nimport { TooltipPosition, TooltipTheme } from './tooltip.types';\r\n\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsTooltipComponent,\r\n TooltipDirective\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n TooltipDirective\r\n ]\r\n})\r\nexport class SdsTooltipModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,mBAAmB,CAAA;AAY5B,IAAA,WAAA,GAAA;QAVO,IAAO,CAAA,OAAA,GAAW,EAAE,CAAC;QACrB,IAAI,CAAA,IAAA,GAAW,CAAC,CAAC;QACjB,IAAG,CAAA,GAAA,GAAW,CAAC,CAAC;QAChB,IAAO,CAAA,OAAA,GAAY,KAAK,CAAC;QAEzB,IAAQ,CAAA,QAAA,GAAoB,OAAO,CAAC;QACpC,IAAK,CAAA,KAAA,GAAiB,MAAM,CAAC;KAIpB;AAEhB,IAAA,QAAQ,MAAW;;gHAdV,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,mDCRhC,iSAUA,EAAA,MAAA,EAAA,CAAA,20CAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;2FDFa,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,SAAS;+BACI,aAAa,EAAA,QAAA,EAAA,iSAAA,EAAA,MAAA,EAAA,CAAA,20CAAA,CAAA,EAAA,CAAA;;;MEed,gBAAg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AA,CAAA;sBADT,YAAY;uBAAC,UAAU,CAAA;;;MClEf,gBAAgB,CAAA;;6GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhB,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,iBAVzB,mBAAmB;QACnB,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAGhB,YAAY,CAAA,EAAA,OAAA,EAAA,CAGZ,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAGP,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;YACP,YAAY;AACb,SAAA,CAAA,EAAA,CAAA,CAAA;2FAKU,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAZ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,mBAAmB;wBACnB,gBAAgB;AACjB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,gBAAgB;AACjB,qBAAA;AACF,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-tooltip.mjs","sources":["../../../projects/ngx-sds-components/src/lib/tooltip/components/tooltip.component.ts","../../../projects/ngx-sds-components/src/lib/tooltip/components/tooltip.component.html","../../../projects/ngx-sds-components/src/lib/tooltip/tooltip.directive.ts","../../../projects/ngx-sds-components/src/lib/tooltip/tooltip.module.ts","../../../projects/ngx-sds-components/src/lib/tooltip/spicainternational-ngx-sds-components-src-lib-tooltip.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\r\nimport { TooltipPosition, TooltipTheme } from '../tooltip.types';\r\n\r\n@Component({\r\n selector: 'sds-tooltip',\r\n templateUrl: './tooltip.component.html',\r\n styleUrls: ['./tooltip.component.scss'],\r\n})\r\nexport class SdsTooltipComponent implements OnInit {\r\n\r\n public tooltip: string = '';\r\n public left: number = 0;\r\n public top: number = 0;\r\n public visible: boolean = false;\r\n\r\n public position: TooltipPosition = 'above';\r\n public theme: TooltipTheme = 'dark';\r\n\r\n\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {}\r\n}\r\n","<div class=\"sds-tooltip\"\r\n [ngClass]=\"['sds-tooltip-' + position, 'sds-tooltip-' + theme]\"\r\n [class.sds-tooltip-visible]=\"visible\"\r\n [style.left.px]=\"left\"\r\n [style.top.px]=\"top\"\r\n >\r\n <small>\r\n {{ tooltip }}\r\n </small>\r\n</div>\r\n","import {\r\n ApplicationRef,\r\n ComponentFactoryResolver,\r\n ComponentRef,\r\n Directive,\r\n ElementRef,\r\n EmbeddedViewRef,\r\n HostListener,\r\n Injector,\r\n Input,\r\n OnChanges,\r\n Renderer2,\r\n SimpleChanges,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\nimport { SdsTooltipComponent } from './components/tooltip.component';\r\nimport { TooltipPosition, TooltipTheme } from './tooltip.types';\r\n\r\n@Directive({\r\n selector: '[sdsTooltip]',\r\n})\r\nexport class TooltipDirective implements OnChanges {\r\n @Input() tooltip = '';\r\n @Input() position: TooltipPosition = 'above';\r\n @Input() theme: TooltipTheme = 'dark';\r\n @Input() showDelay = 0;\r\n @Input() hideDelay = 0;\r\n\r\n private componentRef: ComponentRef<any> | null = null;\r\n private showTimeout?: number;\r\n private hideTimeout?: number;\r\n private touchTimeout?: number;\r\n\r\n\r\n constructor(\r\n private elementRef: ElementRef,\r\n private appRef: ApplicationRef,\r\n private componentFactoryResolver: ComponentFactoryResolver,\r\n // private viewContainerRef: ViewContainerRef,\r\n private injector: Injector,\r\n // private renderer2: Renderer2\r\n ) {\r\n // this.renderer2.listen('window', 'scroll', (_) => {\r\n // console.log('scroll');\r\n // this.setHideTooltipTimeout();\r\n // });\r\n }\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['tooltip']) {\r\n if (this.componentRef !== null) {\r\n this.componentRef.instance.tooltip = this.tooltip;\r\n } \r\n }\r\n }\r\n\r\n @HostListener('mouseenter')\r\n onMouseEnter(): void {\r\n this.initializeTooltip();\r\n }\r\n\r\n @HostListener('mouseleave')\r\n onMouseLeave(): void {\r\n this.setHideTooltipTimeout();\r\n }\r\n\r\n // @HostListener(\"window:scroll\", [])\r\n // onWindowScroll() {\r\n // console.log('scroll');\r\n // this.setHideTooltipTimeout();\r\n // }\r\n\r\n // @HostListener('window:scroll') onScroll(e: Event): void {\r\n // console.log((e.target as Element).scrollTop);\r\n // }\r\n\r\n // @HostListener('scroll') onScrollHost(e: Event): void {\r\n // console.log((e.target as Element).scrollTop);\r\n // }\r\n\r\n @HostListener('mousemove', ['$event'])\r\n onMouseMove($event: MouseEvent): void {\r\n if (this.componentRef !== null && this.position === 'dynamic') {\r\n this.componentRef.instance.left = $event.clientX;\r\n this.componentRef.instance.top = $event.clientY;\r\n this.componentRef.instance.tooltip = this.tooltip;\r\n }\r\n }\r\n\r\n @HostListener('touchstart', ['$event'])\r\n onTouchStart($event: TouchEvent): void {\r\n $event.preventDefault();\r\n window.clearTimeout(this.touchTimeout);\r\n this.touchTimeout = window.setTimeout(this.initializeTooltip.bind(this), 500);\r\n }\r\n\r\n @HostListener('touchend')\r\n onTouchEnd(): void {\r\n window.clearTimeout(this.touchTimeout);\r\n this.setHideTooltipTimeout();\r\n }\r\n\r\n private initializeTooltip() {\r\n if (this.componentRef === null) {\r\n window.clearInterval(this.hideDelay);\r\n\r\n if (this.tooltip) {\r\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(SdsTooltipComponent);\r\n this.componentRef = componentFactory.create(this.injector);\r\n\r\n this.appRef.attachView(this.componentRef.hostView);\r\n const [tooltipDOMElement] = (this.componentRef.hostView as EmbeddedViewRef<any>).rootNodes;\r\n\r\n this.setTooltipComponentProperties();\r\n\r\n document.body.appendChild(tooltipDOMElement);\r\n this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);\r\n }\r\n }\r\n }\r\n\r\n private setTooltipComponentProperties() {\r\n if (this.componentRef !== null) {\r\n this.componentRef.instance.tooltip = this.tooltip;\r\n this.componentRef.instance.position = this.position;\r\n this.componentRef.instance.theme = this.theme;\r\n\r\n const { left, right, top, bottom } = this.elementRef.nativeElement.getBoundingClientRect();\r\n\r\n switch (this.position) {\r\n case 'below': {\r\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\r\n this.componentRef.instance.top = Math.round(bottom);\r\n break;\r\n }\r\n case 'above': {\r\n this.componentRef.instance.left = Math.round((right - left) / 2 + left);\r\n this.componentRef.instance.top = Math.round(top);\r\n break;\r\n }\r\n case 'right': {\r\n this.componentRef.instance.left = Math.round(right);\r\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\r\n break;\r\n }\r\n case 'left': {\r\n this.componentRef.instance.left = Math.round(left);\r\n this.componentRef.instance.top = Math.round(top + (bottom - top) / 2);\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n private showTooltip() {\r\n if (this.tooltip && this.componentRef !== null) {\r\n this.componentRef.instance.visible = true;\r\n }\r\n }\r\n\r\n private setHideTooltipTimeout() {\r\n this.hideTimeout = window.setTimeout(this.destroy.bind(this), this.hideDelay);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.destroy();\r\n }\r\n\r\n destroy(): void {\r\n if (this.componentRef !== null) {\r\n window.clearInterval(this.showTimeout);\r\n window.clearInterval(this.hideDelay);\r\n this.appRef.detachView(this.componentRef.hostView);\r\n this.componentRef.destroy();\r\n this.componentRef = null;\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsTooltipComponent } from '../tooltip/components/tooltip.component';\r\nimport { TooltipDirective } from './tooltip.directive';\r\nimport { TooltipPosition, TooltipTheme } from './tooltip.types';\r\n\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsTooltipComponent,\r\n TooltipDirective\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n TooltipDirective\r\n ]\r\n})\r\nexport class SdsTooltipModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,mBAAmB,CAAA;AAY5B,IAAA,WAAA,GAAA;QAVO,IAAO,CAAA,OAAA,GAAW,EAAE,CAAC;QACrB,IAAI,CAAA,IAAA,GAAW,CAAC,CAAC;QACjB,IAAG,CAAA,GAAA,GAAW,CAAC,CAAC;QAChB,IAAO,CAAA,OAAA,GAAY,KAAK,CAAC;QAEzB,IAAQ,CAAA,QAAA,GAAoB,OAAO,CAAC;QACpC,IAAK,CAAA,KAAA,GAAiB,MAAM,CAAC;KAIpB;AAEhB,IAAA,QAAQ,MAAW;;gHAdV,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,mDCRhC,iSAUA,EAAA,MAAA,EAAA,CAAA,20CAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;2FDFa,mBAAmB,EAAA,UAAA,EAAA,CAAA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BAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,gBAAgB;AACjB,qBAAA;AACF,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { ButtonType } from './dialog.types';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
declare type modalButton = 'primary' | 'secondary' | 'close';
|
|
4
5
|
export declare class SdsDialogComponent implements OnInit {
|
|
@@ -6,9 +7,11 @@ export declare class SdsDialogComponent implements OnInit {
|
|
|
6
7
|
closeText?: string;
|
|
7
8
|
size: 'sm' | 'md' | 'lg' | 'xl';
|
|
8
9
|
primaryButtonText: string;
|
|
9
|
-
secondaryButtonText: string;
|
|
10
10
|
primaryButtonClass: string;
|
|
11
|
+
primaryButtonType: ButtonType;
|
|
12
|
+
secondaryButtonText: string;
|
|
11
13
|
secondaryButtonClass: string;
|
|
14
|
+
secondaryButtonType: ButtonType;
|
|
12
15
|
showHeader: boolean;
|
|
13
16
|
showCloseButton: boolean;
|
|
14
17
|
showPrimaryButton: boolean;
|
|
@@ -28,6 +31,6 @@ export declare class SdsDialogComponent implements OnInit {
|
|
|
28
31
|
onModalClose(): void;
|
|
29
32
|
onModalOpen(): void;
|
|
30
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsDialogComponent, never>;
|
|
31
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsDialogComponent, "sds-dialog", never, { "title": "title"; "closeText": "closeText"; "size": "size"; "primaryButtonText": "primaryButtonText"; "
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsDialogComponent, "sds-dialog", never, { "title": "title"; "closeText": "closeText"; "size": "size"; "primaryButtonText": "primaryButtonText"; "primaryButtonClass": "primaryButtonClass"; "primaryButtonType": "primaryButtonType"; "secondaryButtonText": "secondaryButtonText"; "secondaryButtonClass": "secondaryButtonClass"; "secondaryButtonType": "secondaryButtonType"; "showHeader": "showHeader"; "showCloseButton": "showCloseButton"; "showPrimaryButton": "showPrimaryButton"; "showSecondaryButton": "showSecondaryButton"; }, { "dialogOpen": "dialogOpen"; "dialogClose": "dialogClose"; }, never, ["*"]>;
|
|
32
35
|
}
|
|
33
36
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type ButtonType = 'button' | 'submit' | 'reset';
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
+
import { IconDefinition } from '@fortawesome/pro-regular-svg-icons';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class SdsSideBarComponent implements OnInit {
|
|
4
5
|
showSideBar: boolean;
|
|
5
6
|
product: string;
|
|
6
7
|
isMainSideBar: boolean;
|
|
7
8
|
showSideBarToggleButton: boolean;
|
|
9
|
+
hideSideBarText?: string;
|
|
10
|
+
showSideBarText?: string;
|
|
11
|
+
caretIcon: IconDefinition;
|
|
8
12
|
constructor();
|
|
9
13
|
ngOnInit(): void;
|
|
10
14
|
toggleSideBar(state?: boolean): void;
|
|
11
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsSideBarComponent, never>;
|
|
12
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsSideBarComponent, "sds-side-bar", never, { "product": "product"; "isMainSideBar": "isMainSideBar"; "showSideBarToggleButton": "showSideBarToggleButton"; }, {}, never, ["*"]>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsSideBarComponent, "sds-side-bar", never, { "product": "product"; "isMainSideBar": "isMainSideBar"; "showSideBarToggleButton": "showSideBarToggleButton"; "hideSideBarText": "hideSideBarText"; "showSideBarText": "showSideBarText"; }, {}, never, ["*"]>;
|
|
13
17
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./side-bar.component";
|
|
3
3
|
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@fortawesome/angular-fontawesome";
|
|
4
5
|
export declare class SdsSideBarModule {
|
|
5
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsSideBarModule, never>;
|
|
6
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SdsSideBarModule, [typeof i1.SdsSideBarComponent], [typeof i2.CommonModule], [typeof i1.SdsSideBarComponent]>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SdsSideBarModule, [typeof i1.SdsSideBarComponent], [typeof i2.CommonModule, typeof i3.FontAwesomeModule], [typeof i1.SdsSideBarComponent]>;
|
|
7
8
|
static ɵinj: i0.ɵɵInjectorDeclaration<SdsSideBarModule>;
|
|
8
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ApplicationRef, ComponentFactoryResolver, ElementRef, Injector } from '@angular/core';
|
|
1
|
+
import { ApplicationRef, ComponentFactoryResolver, ElementRef, Injector, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { TooltipPosition, TooltipTheme } from './tooltip.types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TooltipDirective {
|
|
4
|
+
export declare class TooltipDirective implements OnChanges {
|
|
5
5
|
private elementRef;
|
|
6
6
|
private appRef;
|
|
7
7
|
private componentFactoryResolver;
|
|
@@ -16,6 +16,7 @@ export declare class TooltipDirective {
|
|
|
16
16
|
private hideTimeout?;
|
|
17
17
|
private touchTimeout?;
|
|
18
18
|
constructor(elementRef: ElementRef, appRef: ApplicationRef, componentFactoryResolver: ComponentFactoryResolver, injector: Injector);
|
|
19
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
19
20
|
onMouseEnter(): void;
|
|
20
21
|
onMouseLeave(): void;
|
|
21
22
|
onMouseMove($event: MouseEvent): void;
|