@energycap/components 0.31.2 → 0.31.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/energycap-components.umd.js +95 -6
- package/bundles/energycap-components.umd.js.map +1 -1
- package/bundles/energycap-components.umd.min.js +1 -1
- package/bundles/energycap-components.umd.min.js.map +1 -1
- package/energycap-components.metadata.json +1 -1
- package/energycap-components.min.css +2 -2
- package/esm2015/lib/components.module.js +6 -3
- package/esm2015/lib/controls/combobox/combobox.component.js +2 -1
- package/esm2015/lib/display/tooltip/tooltip.component.js +24 -0
- package/esm2015/lib/display/tooltip/tooltip.service.js +64 -0
- package/esm2015/public-api.js +3 -1
- package/fesm2015/energycap-components.js +88 -4
- package/fesm2015/energycap-components.js.map +1 -1
- package/lib/display/tooltip/tooltip.component.d.ts +53 -0
- package/lib/display/tooltip/tooltip.service.d.ts +12 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/src/styles/_base.scss +4 -0
- package/src/styles/_global-variables.scss +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { OverlayRef } from '@angular/cdk/overlay';
|
|
2
|
+
import { EventEmitter, TemplateRef } from '@angular/core';
|
|
3
|
+
/**
|
|
4
|
+
* The position of the tooltip relative to its anchor. For example, if position is 'top-left' the the tooltip will appear above the anchor and expand to the left of the anchor.
|
|
5
|
+
*/
|
|
6
|
+
export declare type TooltipPosition = 'top-left' | 'top-center' | 'top-right' | 'right-top' | 'right-center' | 'right-bottom' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'left-top' | 'left-center' | 'left-bottom';
|
|
7
|
+
export interface TooltipOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Unique identifier for the tooltip that is assigned to the <article> element that wraps the tooltip content.
|
|
10
|
+
*/
|
|
11
|
+
id?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The tooltip title. Hidden if not defined. The tooltip header is hidden if both title and subtile are not defined.
|
|
14
|
+
*/
|
|
15
|
+
title?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Text to display under the tooltip title. Hidden if not defined. The tooltip header is hidden if both title and subtitle are not defined.
|
|
18
|
+
*/
|
|
19
|
+
subtitle?: string;
|
|
20
|
+
/**
|
|
21
|
+
* HTML string for the main content of the tooltip. Will be ignored if customContent has a value.
|
|
22
|
+
*/
|
|
23
|
+
text?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Provide a TemplateRef for custom content. If customContent is defined, any value for text will be ignored.
|
|
26
|
+
*/
|
|
27
|
+
customContent?: TemplateRef<any>;
|
|
28
|
+
/**
|
|
29
|
+
* When true a close button appears in the top right corner to hide the tooltip. Useful when tooltips are used in a tour. An event will emitted when the tooltip is hidden.
|
|
30
|
+
*/
|
|
31
|
+
dismissible?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Number in pixels of the width of the tooltip. If undefined width will be auto.
|
|
34
|
+
*/
|
|
35
|
+
width?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Customize the background color. Can be any color value or css varialbe with var() function. For example: var(--ec-background-color-success);
|
|
38
|
+
*/
|
|
39
|
+
backgroundColor?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare class TooltipComponent implements TooltipOptions {
|
|
42
|
+
position: TooltipPosition;
|
|
43
|
+
id?: string;
|
|
44
|
+
title?: string;
|
|
45
|
+
subtitle?: string;
|
|
46
|
+
text?: string;
|
|
47
|
+
dismissible: boolean;
|
|
48
|
+
customContent?: TemplateRef<any> | undefined;
|
|
49
|
+
overlayRef?: OverlayRef;
|
|
50
|
+
backgroundColor?: string;
|
|
51
|
+
onHide: EventEmitter<void>;
|
|
52
|
+
hide(): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Overlay } from "@angular/cdk/overlay";
|
|
2
|
+
import { TooltipComponent, TooltipOptions, TooltipPosition } from "./tooltip.component";
|
|
3
|
+
export declare class TooltipService {
|
|
4
|
+
private overlay;
|
|
5
|
+
private positions;
|
|
6
|
+
constructor(overlay: Overlay);
|
|
7
|
+
/**
|
|
8
|
+
* Show a tooltip attached to a specified element
|
|
9
|
+
*/
|
|
10
|
+
show(anchor: HTMLElement, position?: TooltipPosition, options?: TooltipOptions): TooltipComponent;
|
|
11
|
+
private getOverlayConfig;
|
|
12
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ export * from './lib/display/toast/toast-types';
|
|
|
76
76
|
export * from './lib/display/toast/toast.service';
|
|
77
77
|
export * from './lib/display/toast/toaster/toaster.component';
|
|
78
78
|
export * from './lib/display/toast/toast/toast.component';
|
|
79
|
+
export * from './lib/display/tooltip/tooltip.component';
|
|
80
|
+
export * from './lib/display/tooltip/tooltip.service';
|
|
79
81
|
export * from './lib/core/telemetry.service';
|
|
80
82
|
export * from './lib/core/telemetry-tracker.service';
|
|
81
83
|
export * from './lib/shared/page/page-base/page-base.component';
|
package/src/styles/_base.scss
CHANGED
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
--ec-font-weight-normal: normal;
|
|
76
76
|
|
|
77
77
|
// Z-indexes
|
|
78
|
-
--ec-z-index-tooltip: 10;
|
|
79
78
|
--ec-z-index-overlay: 20;
|
|
80
79
|
--ec-z-index-splitter: 30;
|
|
81
80
|
--ec-z-index-navbar: 40;
|
|
81
|
+
--ec-z-index-tooltip: 45;
|
|
82
82
|
--ec-z-index-popup: 50;
|
|
83
83
|
--ec-z-index-dialog: 60;
|
|
84
84
|
--ec-z-index-toast: 70;
|