zero-tooltip 1.4.3 → 2.0.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.
@@ -1,6 +1,6 @@
1
- export type ScrollContainer = {
2
- 'element': HTMLElement | Window,
3
- 'eventController': AbortController
4
- }
5
-
1
+ export type ScrollContainer = {
2
+ 'element': HTMLElement | Window,
3
+ 'eventController': AbortController
4
+ }
5
+
6
6
  export type ScrollContainers = ScrollContainer[]
@@ -1,24 +1,91 @@
1
- import TooltipPosition from "./tooltipPosition"
2
- import TooltipPositions from "./tooltipPositions"
3
-
4
- type TooltipConfig = {
5
- appendTo?: string,
6
- defaultPosition?: TooltipPosition,
7
- positions?: Partial<TooltipPositions>,
8
- offsetFromSource?: number,
9
- offsetFromViewport?: number,
10
- minWidth?: number,
11
- maxWidth?: number,
12
- tooltipBorderWidth?: number,
13
- tooltipClasses?: string,
14
- textClasses?: string,
15
- arrowSize?: number,
16
- arrowClasses?: string,
17
- arrowMinOffsetFromTooltipCorner?: number,
18
- zIndex?: number | string,
19
- showDelay?: number,
20
- hideDelay?: number,
21
- showWarnings?: boolean,
22
- }
23
-
24
- export default TooltipConfig
1
+ import TooltipPosition from "./tooltipPosition"
2
+ import TooltipPositions from "./tooltipPositions"
3
+
4
+ type TooltipConfig = {
5
+ /**
6
+ * A valid CSS query selector to specify where Tooltip gets appended.
7
+ */
8
+ appendTo?: string,
9
+
10
+ /**
11
+ * Position of tooltip component relative to element that is being hovered.
12
+ */
13
+ defaultPosition?: TooltipPosition,
14
+
15
+ /**
16
+ * Ordered list of fallback positions in case tooltip does not have enough space in default position. If none of given positions will have enough space for tooltip, then it will not be rendered.
17
+ */
18
+ positions?: Partial<TooltipPositions>,
19
+
20
+ /**
21
+ * Tooltip offset in px from element that's being hovered *(arrow size is not added to this value)*
22
+ */
23
+ offsetFromSource?: number,
24
+
25
+ /**
26
+ * Minimal allowed tooltip offset in `px` from viewport sides
27
+ */
28
+ offsetFromViewport?: number,
29
+
30
+ /**
31
+ * Minimal tooltip width in `px` that will be allowed to render
32
+ */
33
+ minWidth?: number,
34
+
35
+ /**
36
+ * Maximal tooltip width in `px` that will be allowed to render
37
+ */
38
+ maxWidth?: number,
39
+
40
+ /**
41
+ * Tooltip container border width in `px`
42
+ */
43
+ tooltipBorderWidth?: number,
44
+
45
+ /**
46
+ * List of classes that will be added to tooltip element
47
+ */
48
+ tooltipClasses?: string,
49
+
50
+ /**
51
+ * List of classes that will be added to text element
52
+ */
53
+ textClasses?: string,
54
+
55
+ /**
56
+ * Length of arrow hypotenuse in `px` (arrow is generated using border width property, creating square which gets divided in four triangles, thus `arrowSize` is length of square side)
57
+ */
58
+ arrowSize?: number,
59
+
60
+ /**
61
+ * List of classes that will be added to arrow element
62
+ */
63
+ arrowClasses?: string,
64
+
65
+ /**
66
+ * Minimal allowed arrow offset in `px` from tooltip corner. Used in situations when tooltip does not have enough space to be centered relative to element that is being hover, thus arrow is rendered closer to one of the tooltip corners
67
+ */
68
+ arrowMinOffsetFromTooltipCorner?: number,
69
+
70
+ /**
71
+ * `z-index` css property value of tooltip
72
+ */
73
+ zIndex?: number | string,
74
+
75
+ /**
76
+ * Delay in milliseconds after which to show tooltip while hovering over element
77
+ */
78
+ showDelay?: number,
79
+
80
+ /**
81
+ * Delay in milliseconds after which to hide tooltip when leaving element boundaries
82
+ */
83
+ hideDelay?: number,
84
+
85
+ /**
86
+ * Whether to show warning about empty tooltip text value in cases when tooltip was expected to be shown
87
+ */
88
+ showWarnings?: boolean,
89
+ }
90
+
91
+ export default TooltipConfig
@@ -1,9 +1,21 @@
1
- import TooltipConfig from "./tooltipConfig"
2
-
3
- type TooltipLocalConfig = {
4
- content: string,
5
- show?: boolean,
6
- alwaysOn?: boolean,
7
- } & TooltipConfig
8
-
9
- export default TooltipLocalConfig
1
+ import TooltipConfig from "./tooltipConfig"
2
+
3
+ type TooltipLocalConfig = {
4
+ /**
5
+ * Tooltip text. Text is rendered as HTML, thus it's possible to give simple HTML structure, e.g., `<h1>Tooltip text</h1>`
6
+ */
7
+ content: string,
8
+
9
+ /**
10
+ * Define whether tooltip should be shown on hover (enabled/disabled). Default value is `false` if `alwaysOn` is set, otherwise it's `true`.
11
+ */
12
+ show?: boolean,
13
+
14
+ /**
15
+ * Define whether to show tooltip (on mount) without needing hover trigger
16
+ * If `alwaysOn` is set, `show` will be set to `false` by default.
17
+ */
18
+ alwaysOn?: boolean,
19
+ } & TooltipConfig
20
+
21
+ export default TooltipLocalConfig
@@ -1,4 +1,4 @@
1
- type TooltipPosition = 'left' | 'top' | 'right' | 'bottom'
2
-
3
- export default TooltipPosition
4
-
1
+ type TooltipPosition = 'left' | 'top' | 'right' | 'bottom'
2
+
3
+ export default TooltipPosition
4
+
@@ -1,10 +1,10 @@
1
- import TooltipPosition from "./tooltipPosition"
2
-
3
- type TooltipPositions = {
4
- left: [ TooltipPosition, TooltipPosition, TooltipPosition, TooltipPosition]
5
- top: [ TooltipPosition, TooltipPosition, TooltipPosition, TooltipPosition]
6
- right: [ TooltipPosition, TooltipPosition, TooltipPosition, TooltipPosition]
7
- bottom: [ TooltipPosition, TooltipPosition, TooltipPosition, TooltipPosition]
8
- }
9
-
10
- export default TooltipPositions
1
+ import TooltipPosition from "./tooltipPosition"
2
+
3
+ type TooltipPositions = {
4
+ left: [ TooltipPosition, TooltipPosition, TooltipPosition, TooltipPosition]
5
+ top: [ TooltipPosition, TooltipPosition, TooltipPosition, TooltipPosition]
6
+ right: [ TooltipPosition, TooltipPosition, TooltipPosition, TooltipPosition]
7
+ bottom: [ TooltipPosition, TooltipPosition, TooltipPosition, TooltipPosition]
8
+ }
9
+
10
+ export default TooltipPositions