@spicainternational/ngx-sds-components 2.31.1 → 2.32.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/date-picker/date-picker.component.mjs +65 -15
- package/esm2020/src/lib/tooltip/components/tooltip.component.mjs +5 -4
- package/esm2020/src/lib/tooltip/tooltip.directive.mjs +21 -2
- package/esm2020/src/lib/tooltip/tooltip.module.mjs +8 -4
- package/esm2020/src/lib/tooltip/tooltip.types.mjs +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-date-picker.mjs +64 -14
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-date-picker.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-tooltip.mjs +31 -7
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-tooltip.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-date-picker.mjs +64 -14
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-date-picker.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-tooltip.mjs +31 -7
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/date-picker/date-picker.component.d.ts +12 -2
- package/src/lib/tooltip/components/tooltip.component.d.ts +4 -1
- package/src/lib/tooltip/tooltip.directive.d.ts +4 -1
- package/src/lib/tooltip/tooltip.module.d.ts +2 -1
- package/src/lib/tooltip/tooltip.types.d.ts +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, Directive, Input, HostListener, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
6
|
+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
5
7
|
|
|
6
8
|
class SdsTooltipComponent {
|
|
7
9
|
constructor() {
|
|
@@ -15,10 +17,10 @@ class SdsTooltipComponent {
|
|
|
15
17
|
ngOnInit() { }
|
|
16
18
|
}
|
|
17
19
|
SdsTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
-
SdsTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsTooltipComponent, selector: "
|
|
20
|
+
SdsTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsTooltipComponent, selector: "ng-component", ngImport: i0, template: "<div class=\"sds-tooltip\"\r\n [ngClass]=\"['sds-tooltip-' + position, 'sds-tooltip-' + theme, tooltipClass]\"\r\n [class.sds-tooltip-visible]=\"visible\"\r\n [style.left.px]=\"left\"\r\n [style.top.px]=\"top\"\r\n >\r\n <fa-icon class=\"sds-tooltip-icon\"\r\n *ngIf=\"tooltipIcon\" \r\n [icon]=\"tooltipIcon\">\r\n </fa-icon>\r\n\r\n <small class=\"sds-tooltip-text\">\r\n {{ tooltip }}\r\n </small>\r\n\r\n</div>\r\n", styles: [".sds-tooltip{position:fixed;background-color:#000;border-radius:4px;color:#fff;padding:3px 6px;max-width:15rem;z-index:1070;opacity:0}.sds-tooltip fa-icon{margin-right:.25rem}.sds-tooltip:before{content:\"\";width:0;height:0;position:absolute}.sds-tooltip-visible{opacity:1;transition:opacity .3s}.sds-tooltip-light{background-color:#e9ecef;color:#000}.sds-tooltip-light:before{border:5px solid #E9ECEF}.sds-tooltip-dark{background-color:#000;color:#fff}.sds-tooltip-dark:before{border:5px solid black}.sds-tooltip-danger{background-color:#cc5252;color:#fff}.sds-tooltip-danger:before{border:5px solid #cc5252}.sds-tooltip-success{background-color:#29ba60;color:#fff}.sds-tooltip-success:before{border:5px solid #29ba60}.sds-tooltip-warning{background-color:#ffc107;color:#212529}.sds-tooltip-warning:before{border:5px solid #ffc107}.sds-tooltip-info{background-color:#56ace0;color:#fff}.sds-tooltip-info:before{border:5px solid #56ace0}.sds-tooltip-below{transform:translate(-50%);margin-top:.5rem}.sds-tooltip-below:before{border-left-color:transparent;border-right-color:transparent;border-top:none;left:calc(50% - 5px);top:-4px}.sds-tooltip-above{transform:translate(-50%,calc(-100% - .5rem));margin-bottom:.5rem}.sds-tooltip-above:before{border-left-color:transparent;border-right-color:transparent;border-bottom:none;left:calc(50% - 5px);bottom:-4px}.sds-tooltip-left{transform:translate(calc(-100% - .5rem),-50%)}.sds-tooltip-left:before{border-top-color:transparent;border-bottom-color:transparent;border-right:none;right:-4px;top:calc(50% - 5px)}.sds-tooltip-right{transform:translateY(-50%);margin-left:.5rem}.sds-tooltip-right:before{border-top-color:transparent;border-bottom-color:transparent;border-left:none;left:-4px;top:calc(50% - 5px)}.sds-tooltip-dynamic{margin-left:20px}.sds-tooltip-dynamic:before{display:none}\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.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
19
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTooltipComponent, decorators: [{
|
|
20
22
|
type: Component,
|
|
21
|
-
args: [{
|
|
23
|
+
args: [{ template: "<div class=\"sds-tooltip\"\r\n [ngClass]=\"['sds-tooltip-' + position, 'sds-tooltip-' + theme, tooltipClass]\"\r\n [class.sds-tooltip-visible]=\"visible\"\r\n [style.left.px]=\"left\"\r\n [style.top.px]=\"top\"\r\n >\r\n <fa-icon class=\"sds-tooltip-icon\"\r\n *ngIf=\"tooltipIcon\" \r\n [icon]=\"tooltipIcon\">\r\n </fa-icon>\r\n\r\n <small class=\"sds-tooltip-text\">\r\n {{ tooltip }}\r\n </small>\r\n\r\n</div>\r\n", styles: [".sds-tooltip{position:fixed;background-color:#000;border-radius:4px;color:#fff;padding:3px 6px;max-width:15rem;z-index:1070;opacity:0}.sds-tooltip fa-icon{margin-right:.25rem}.sds-tooltip:before{content:\"\";width:0;height:0;position:absolute}.sds-tooltip-visible{opacity:1;transition:opacity .3s}.sds-tooltip-light{background-color:#e9ecef;color:#000}.sds-tooltip-light:before{border:5px solid #E9ECEF}.sds-tooltip-dark{background-color:#000;color:#fff}.sds-tooltip-dark:before{border:5px solid black}.sds-tooltip-danger{background-color:#cc5252;color:#fff}.sds-tooltip-danger:before{border:5px solid #cc5252}.sds-tooltip-success{background-color:#29ba60;color:#fff}.sds-tooltip-success:before{border:5px solid #29ba60}.sds-tooltip-warning{background-color:#ffc107;color:#212529}.sds-tooltip-warning:before{border:5px solid #ffc107}.sds-tooltip-info{background-color:#56ace0;color:#fff}.sds-tooltip-info:before{border:5px solid #56ace0}.sds-tooltip-below{transform:translate(-50%);margin-top:.5rem}.sds-tooltip-below:before{border-left-color:transparent;border-right-color:transparent;border-top:none;left:calc(50% - 5px);top:-4px}.sds-tooltip-above{transform:translate(-50%,calc(-100% - .5rem));margin-bottom:.5rem}.sds-tooltip-above:before{border-left-color:transparent;border-right-color:transparent;border-bottom:none;left:calc(50% - 5px);bottom:-4px}.sds-tooltip-left{transform:translate(calc(-100% - .5rem),-50%)}.sds-tooltip-left:before{border-top-color:transparent;border-bottom-color:transparent;border-right:none;right:-4px;top:calc(50% - 5px)}.sds-tooltip-right{transform:translateY(-50%);margin-left:.5rem}.sds-tooltip-right:before{border-top-color:transparent;border-bottom-color:transparent;border-left:none;left:-4px;top:calc(50% - 5px)}.sds-tooltip-dynamic{margin-left:20px}.sds-tooltip-dynamic:before{display:none}\n"] }]
|
|
22
24
|
}], ctorParameters: function () { return []; } });
|
|
23
25
|
|
|
24
26
|
class TooltipDirective {
|
|
@@ -30,6 +32,7 @@ class TooltipDirective {
|
|
|
30
32
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
31
33
|
this.injector = injector;
|
|
32
34
|
this.tooltip = '';
|
|
35
|
+
this.tooltipClass = '';
|
|
33
36
|
this.position = 'above';
|
|
34
37
|
this.theme = 'dark';
|
|
35
38
|
this.showDelay = 0;
|
|
@@ -46,6 +49,16 @@ class TooltipDirective {
|
|
|
46
49
|
this.componentRef.instance.tooltip = this.tooltip;
|
|
47
50
|
}
|
|
48
51
|
}
|
|
52
|
+
if (changes['tooltipIcon']) {
|
|
53
|
+
if (this.componentRef !== null) {
|
|
54
|
+
this.componentRef.instance.tooltipIcon = this.tooltipIcon;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (changes['tooltipClass']) {
|
|
58
|
+
if (this.componentRef !== null) {
|
|
59
|
+
this.componentRef.instance.tooltipClass = this.tooltipClass;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
49
62
|
}
|
|
50
63
|
onMouseEnter() {
|
|
51
64
|
this.initializeTooltip();
|
|
@@ -69,6 +82,8 @@ class TooltipDirective {
|
|
|
69
82
|
this.componentRef.instance.left = $event.clientX;
|
|
70
83
|
this.componentRef.instance.top = $event.clientY;
|
|
71
84
|
this.componentRef.instance.tooltip = this.tooltip;
|
|
85
|
+
this.componentRef.instance.tooltipIcon = this.tooltipIcon;
|
|
86
|
+
this.componentRef.instance.tooltipClass = this.tooltipClass;
|
|
72
87
|
}
|
|
73
88
|
}
|
|
74
89
|
onTouchStart($event) {
|
|
@@ -97,6 +112,8 @@ class TooltipDirective {
|
|
|
97
112
|
setTooltipComponentProperties() {
|
|
98
113
|
if (this.componentRef !== null) {
|
|
99
114
|
this.componentRef.instance.tooltip = this.tooltip;
|
|
115
|
+
this.componentRef.instance.tooltipIcon = this.tooltipIcon;
|
|
116
|
+
this.componentRef.instance.tooltipClass = this.tooltipClass;
|
|
100
117
|
this.componentRef.instance.position = this.position;
|
|
101
118
|
this.componentRef.instance.theme = this.theme;
|
|
102
119
|
const { left, right, top, bottom } = this.elementRef.nativeElement.getBoundingClientRect();
|
|
@@ -149,7 +166,7 @@ class TooltipDirective {
|
|
|
149
166
|
}
|
|
150
167
|
}
|
|
151
168
|
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 });
|
|
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 });
|
|
169
|
+
TooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.1", type: TooltipDirective, selector: "[sdsTooltip]", inputs: { tooltip: "tooltip", tooltipClass: "tooltipClass", tooltipIcon: "tooltipIcon", 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 });
|
|
153
170
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
154
171
|
type: Directive,
|
|
155
172
|
args: [{
|
|
@@ -157,6 +174,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
157
174
|
}]
|
|
158
175
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ApplicationRef }, { type: i0.ComponentFactoryResolver }, { type: i0.Injector }]; }, propDecorators: { tooltip: [{
|
|
159
176
|
type: Input
|
|
177
|
+
}], tooltipClass: [{
|
|
178
|
+
type: Input
|
|
179
|
+
}], tooltipIcon: [{
|
|
180
|
+
type: Input
|
|
160
181
|
}], position: [{
|
|
161
182
|
type: Input
|
|
162
183
|
}], theme: [{
|
|
@@ -186,9 +207,11 @@ class SdsTooltipModule {
|
|
|
186
207
|
}
|
|
187
208
|
SdsTooltipModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
188
209
|
SdsTooltipModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTooltipModule, declarations: [SdsTooltipComponent,
|
|
189
|
-
TooltipDirective], imports: [CommonModule
|
|
210
|
+
TooltipDirective], imports: [CommonModule,
|
|
211
|
+
FontAwesomeModule], exports: [TooltipDirective] });
|
|
190
212
|
SdsTooltipModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTooltipModule, imports: [[
|
|
191
|
-
CommonModule
|
|
213
|
+
CommonModule,
|
|
214
|
+
FontAwesomeModule
|
|
192
215
|
]] });
|
|
193
216
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTooltipModule, decorators: [{
|
|
194
217
|
type: NgModule,
|
|
@@ -198,7 +221,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
198
221
|
TooltipDirective
|
|
199
222
|
],
|
|
200
223
|
imports: [
|
|
201
|
-
CommonModule
|
|
224
|
+
CommonModule,
|
|
225
|
+
FontAwesomeModule
|
|
202
226
|
],
|
|
203
227
|
exports: [
|
|
204
228
|
TooltipDirective
|
|
@@ -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 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;AAA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,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\nimport { IconProp } from '@fortawesome/fontawesome-svg-core';\r\n\r\n@Component({\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 tooltipIcon?: IconProp;\r\n public tooltipClass?: string;\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, tooltipClass]\"\r\n [class.sds-tooltip-visible]=\"visible\"\r\n [style.left.px]=\"left\"\r\n [style.top.px]=\"top\"\r\n >\r\n <fa-icon class=\"sds-tooltip-icon\"\r\n *ngIf=\"tooltipIcon\" \r\n [icon]=\"tooltipIcon\">\r\n </fa-icon>\r\n\r\n <small class=\"sds-tooltip-text\">\r\n {{ tooltip }}\r\n </small>\r\n\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\nimport { IconProp } from '@fortawesome/fontawesome-svg-core';\r\n\r\n@Directive({\r\n selector: '[sdsTooltip]',\r\n})\r\nexport class TooltipDirective implements OnChanges {\r\n @Input() tooltip = '';\r\n @Input() tooltipClass = '';\r\n @Input() tooltipIcon?: IconProp;\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 if (changes['tooltipIcon']) {\r\n if (this.componentRef !== null) {\r\n this.componentRef.instance.tooltipIcon = this.tooltipIcon;\r\n } \r\n } \r\n \r\n if (changes['tooltipClass']) {\r\n if (this.componentRef !== null) {\r\n this.componentRef.instance.tooltipClass = this.tooltipClass;\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 this.componentRef.instance.tooltipIcon = this.tooltipIcon;\r\n this.componentRef.instance.tooltipClass = this.tooltipClass;\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.tooltipIcon = this.tooltipIcon;\r\n this.componentRef.instance.tooltipClass = this.tooltipClass;\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\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\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 FontAwesomeModule\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;AAe5B,IAAA,WAAA,GAAA;QAbO,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;QAKzB,IAAQ,CAAA,QAAA,GAAoB,OAAO,CAAC;QACpC,IAAK,CAAA,KAAA,GAAiB,MAAM,CAAC;KAIpB;AAEhB,IAAA,QAAQ,MAAW;;gHAjBV,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,oDCRhC,odAgBA,EAAA,MA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A,EAAA,EAAA,IAAA,EAAA,gBAAgB,EARlB,OAAA,EAAA,CAAA;YACP,YAAY;YACZ,iBAAiB;AAClB,SAAA,CAAA,EAAA,CAAA,CAAA;2FAKU,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,mBAAmB;wBACnB,gBAAgB;AACjB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,gBAAgB;AACjB,qBAAA;AACF,iBAAA,CAAA;;;ACrBD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
export declare class SdsDatePickerComponent implements OnInit, OnChanges {
|
|
6
6
|
private changeRef;
|
|
7
7
|
private datePickerService;
|
|
8
|
+
displayContent: any;
|
|
8
9
|
selectionKind: 'period' | 'single';
|
|
9
10
|
dateRangeDefinitions: Array<PeriodPickerDateRangeDefinition>;
|
|
10
11
|
selectedDate: Date;
|
|
@@ -28,6 +29,12 @@ export declare class SdsDatePickerComponent implements OnInit, OnChanges {
|
|
|
28
29
|
dateRangeDefinitionsWidth: string;
|
|
29
30
|
showPreviousAndNextButtons: boolean;
|
|
30
31
|
width: string;
|
|
32
|
+
dropdownWrapperClass: string;
|
|
33
|
+
dropdownWrapperId: string;
|
|
34
|
+
getPreviousDateCallback: (currentDate: string | number | Date) => string | number | Date;
|
|
35
|
+
getNextDateCallback: (currentDate: string | number | Date) => string | number | Date;
|
|
36
|
+
getPreviousRangeCallback: (currentStartDate: string | number | Date, currentEndDate: string | number | Date) => [string | number | Date, string | number | Date];
|
|
37
|
+
getNextRangeCallback: (currentStartDate: string | number | Date, currentEndDate: string | number | Date) => [string | number | Date, string | number | Date];
|
|
31
38
|
previousPeriodIcon: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
32
39
|
nextPeriodIcon: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
33
40
|
calendarIcon: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
@@ -80,7 +87,10 @@ export declare class SdsDatePickerComponent implements OnInit, OnChanges {
|
|
|
80
87
|
setSelectedDate(dateStart: string | number | Date, dateEnd: string | number | Date, emitChange?: boolean): void;
|
|
81
88
|
goToNextDate(): void;
|
|
82
89
|
goToPreviousDate(): void;
|
|
83
|
-
|
|
90
|
+
getNextDay(currentDate: string | number | Date): string | number | Date;
|
|
91
|
+
getPreviousDay(currentDate: string | number | Date): string | number | Date;
|
|
92
|
+
getNextRange(currentStartDate: string | number | Date, currentEndDate: string | number | Date): [string | number | Date, string | number | Date];
|
|
93
|
+
getPreviousRange(currentStartDate: string | number | Date, currentEndDate: string | number | Date): [string | number | Date, string | number | Date];
|
|
84
94
|
setNextPreviousRange(setNext: boolean): void;
|
|
85
95
|
getCellCssClass(date: any): string;
|
|
86
96
|
selectEndDate(event: any): void;
|
|
@@ -97,5 +107,5 @@ export declare class SdsDatePickerComponent implements OnInit, OnChanges {
|
|
|
97
107
|
private formatDate;
|
|
98
108
|
private generateDateRanges;
|
|
99
109
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsDatePickerComponent, never>;
|
|
100
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsDatePickerComponent, "sds-date-picker", never, { "selectionKind": "selectionKind"; "dateRangeDefinitions": "dateRangeDefinitions"; "selectedDate": "selectedDate"; "selectedDateStart": "selectedDateStart"; "selectedDateEnd": "selectedDateEnd"; "minDate": "minDate"; "maxDate": "maxDate"; "locales": "locales"; "disabled": "disabled"; "validationError": "validationError"; "isValid": "isValid"; "disabledDates": "disabledDates"; "applyText": "applyText"; "cancelText": "cancelText"; "translations": "translations"; "firstDayOfWeek": "firstDayOfWeek"; "dateRangeDefinitionsWidth": "dateRangeDefinitionsWidth"; "showPreviousAndNextButtons": "showPreviousAndNextButtons"; "width": "width"; }, { "selectedDateChange": "selectedDateChange"; "selectedDateStartChange": "selectedDateStartChange"; "selectedDateEndChange": "selectedDateEndChange"; "periodChange": "periodChange"; },
|
|
110
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsDatePickerComponent, "sds-date-picker", never, { "selectionKind": "selectionKind"; "dateRangeDefinitions": "dateRangeDefinitions"; "selectedDate": "selectedDate"; "selectedDateStart": "selectedDateStart"; "selectedDateEnd": "selectedDateEnd"; "minDate": "minDate"; "maxDate": "maxDate"; "locales": "locales"; "disabled": "disabled"; "validationError": "validationError"; "isValid": "isValid"; "disabledDates": "disabledDates"; "applyText": "applyText"; "cancelText": "cancelText"; "translations": "translations"; "firstDayOfWeek": "firstDayOfWeek"; "dateRangeDefinitionsWidth": "dateRangeDefinitionsWidth"; "showPreviousAndNextButtons": "showPreviousAndNextButtons"; "width": "width"; "dropdownWrapperClass": "dropdownWrapperClass"; "dropdownWrapperId": "dropdownWrapperId"; "getPreviousDateCallback": "getPreviousDateCallback"; "getNextDateCallback": "getNextDateCallback"; "getPreviousRangeCallback": "getPreviousRangeCallback"; "getNextRangeCallback": "getNextRangeCallback"; }, { "selectedDateChange": "selectedDateChange"; "selectedDateStartChange": "selectedDateStartChange"; "selectedDateEndChange": "selectedDateEndChange"; "periodChange": "periodChange"; }, ["displayContent"], ["display"]>;
|
|
101
111
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { TooltipPosition, TooltipTheme } from '../tooltip.types';
|
|
3
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class SdsTooltipComponent implements OnInit {
|
|
5
6
|
tooltip: string;
|
|
6
7
|
left: number;
|
|
7
8
|
top: number;
|
|
8
9
|
visible: boolean;
|
|
10
|
+
tooltipIcon?: IconProp;
|
|
11
|
+
tooltipClass?: string;
|
|
9
12
|
position: TooltipPosition;
|
|
10
13
|
theme: TooltipTheme;
|
|
11
14
|
constructor();
|
|
12
15
|
ngOnInit(): void;
|
|
13
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsTooltipComponent, never>;
|
|
14
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsTooltipComponent, "
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsTooltipComponent, "ng-component", never, {}, {}, never, never>;
|
|
15
18
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApplicationRef, ComponentFactoryResolver, ElementRef, Injector, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { TooltipPosition, TooltipTheme } from './tooltip.types';
|
|
3
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class TooltipDirective implements OnChanges {
|
|
5
6
|
private elementRef;
|
|
@@ -7,6 +8,8 @@ export declare class TooltipDirective implements OnChanges {
|
|
|
7
8
|
private componentFactoryResolver;
|
|
8
9
|
private injector;
|
|
9
10
|
tooltip: string;
|
|
11
|
+
tooltipClass: string;
|
|
12
|
+
tooltipIcon?: IconProp;
|
|
10
13
|
position: TooltipPosition;
|
|
11
14
|
theme: TooltipTheme;
|
|
12
15
|
showDelay: number;
|
|
@@ -29,5 +32,5 @@ export declare class TooltipDirective implements OnChanges {
|
|
|
29
32
|
ngOnDestroy(): void;
|
|
30
33
|
destroy(): void;
|
|
31
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
|
|
32
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[sdsTooltip]", never, { "tooltip": "tooltip"; "position": "position"; "theme": "theme"; "showDelay": "showDelay"; "hideDelay": "hideDelay"; }, {}, never>;
|
|
35
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[sdsTooltip]", never, { "tooltip": "tooltip"; "tooltipClass": "tooltipClass"; "tooltipIcon": "tooltipIcon"; "position": "position"; "theme": "theme"; "showDelay": "showDelay"; "hideDelay": "hideDelay"; }, {}, never>;
|
|
33
36
|
}
|
|
@@ -2,8 +2,9 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
import * as i1 from "./components/tooltip.component";
|
|
3
3
|
import * as i2 from "./tooltip.directive";
|
|
4
4
|
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@fortawesome/angular-fontawesome";
|
|
5
6
|
export declare class SdsTooltipModule {
|
|
6
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsTooltipModule, never>;
|
|
7
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SdsTooltipModule, [typeof i1.SdsTooltipComponent, typeof i2.TooltipDirective], [typeof i3.CommonModule], [typeof i2.TooltipDirective]>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SdsTooltipModule, [typeof i1.SdsTooltipComponent, typeof i2.TooltipDirective], [typeof i3.CommonModule, typeof i4.FontAwesomeModule], [typeof i2.TooltipDirective]>;
|
|
8
9
|
static ɵinj: i0.ɵɵInjectorDeclaration<SdsTooltipModule>;
|
|
9
10
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare type TooltipPosition = 'above' | 'below' | 'left' | 'right' | 'dynamic';
|
|
2
|
-
export declare type TooltipTheme = 'dark' | 'light';
|
|
2
|
+
export declare type TooltipTheme = 'dark' | 'light' | 'danger' | 'success' | 'warning' | 'info';
|