Skip to content

Commit 95720b3

Browse files
author
Baby Beet
committed
fix: Added a delay of 500ms before showing tooltips
1 parent 2839ccf commit 95720b3

17 files changed

+763
-973
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
22

3+
.ignored
34
# Compiled output
45
/dist
56
/tmp

README.md

+15-18
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The tooltip component that gets created handles wiring up `aria-describedby` att
5858

5959
## Tooltip placement
6060

61-
There are 2 supported placement values: `Placement.VERTICAL` (`vertical`) and `Placement.HORIZONTAL` (`horizontal`). `Placement.VERTICAL` will either place the tooltip at the bottom or top of the anchor element depending on which side has enough space for the tooltip to not be cutoff. Similarly, `Placement.VERTICAL` will either place the tooltip at the right or left of the anchor element depending on which side has enough space for the tooltip to not be cutoff. By default, `Placement.VERTICAL` is used and the tooltip is placed at the bottom of the anchor.
61+
There are 2 supported placement values: `vertical` and `horizontal`. `vertical` will either place the tooltip at the bottom or top of the anchor element depending on which side has enough space for the tooltip to not be cutoff. Similarly, `horizontal` will either place the tooltip at the right or left of the anchor element depending on which side has enough space for the tooltip to not be cutoff. By default, `vertical` is used and the tooltip is placed at the bottom of the anchor.
6262

6363
## Using `TooltipDirective`
6464

@@ -91,9 +91,9 @@ Sets the theme. Must be either `dark` or `light`. `dark` is the default if not p
9191
<button
9292
bbbTooltip='Hello World'
9393
<!-- if "bbbTooltipPlacement" is not specified, "vertical" is assumed -->
94-
kunTooltipPlacement='vertical'
95-
<!-- if "kunTooltipTheme" is not specified, "dark" is assumed -->
96-
kunTooltipTheme='dark'>
94+
bbbTooltipPlacement='vertical'
95+
<!-- if "bbbTooltipTheme" is not specified, "dark" is assumed -->
96+
bbbTooltipTheme='dark'>
9797
Hover me
9898
</button>
9999
`
@@ -191,11 +191,11 @@ interface TooltipConfiguration<C extends Record<string, unknown> | unknown = unk
191191
*/
192192
context?: C;
193193
/**
194-
* Where to position the tooltip. Default is `Placement.VERTICAL`.
194+
* Where to position the tooltip. Default is `vertical`.
195195
*/
196196
placement?: Placement;
197197
/**
198-
* The optional theme for this tooltip. Default is `Theme.LIGHT Theme.LIGHT`.
198+
* The optional theme for this tooltip. Default is `light`.
199199
*/
200200
theme?: Theme;
201201
}
@@ -206,29 +206,26 @@ interface TooltipConfiguration<C extends Record<string, unknown> | unknown = unk
206206
Describes the direction in which the tooltip is placed with respect to its anchor.
207207

208208
```ts
209-
const enum Placement {
209+
type Placement =
210210
/**
211211
* The tooltip will be placed either at the bottom or at the top with respect to its anchor
212212
* depending on how much available space there is in that direction. By default,
213213
* the tooltip will be placed at the bottom of its anchor for this placement.
214214
*/
215-
HORIZONTAL = 'horizontal',
215+
| 'horizontal'
216+
216217
/**
217218
* The tooltip will be placed either at the left or at the right with respect to its anchor
218219
* depending on how much available space there is in that direction. By default,
219220
* the tooltip will be placed at the right of its anchor for this placement.
220221
*/
221-
VERTICAL = 'vertical'
222-
}
222+
| 'vertical';
223223
```
224224

225225
### `Theme`
226226

227227
```ts
228-
const enum Theme {
229-
LIGHT = 'light',
230-
DARK = 'dark'
231-
}
228+
type Theme = 'light' | 'dark';
232229
```
233230

234231
<br/>
@@ -260,8 +257,8 @@ export class TestComponent {
260257
this.tooltipService.show(trigger, {
261258
content: 'This is a tooltip',
262259
className: 'optional-class-name',
263-
placement: Placement.HORIZONTAL,
264-
theme: Theme.LIGHT
260+
placement: 'horizontal',
261+
theme: 'light'
265262
});
266263
}
267264

@@ -315,8 +312,8 @@ export class TestComponent {
315312
context: {
316313
$implicit: 'TemplateRef'
317314
},
318-
placement: Placement.VERTICAL,
319-
theme: Theme.DARK
315+
placement: 'vertical',
316+
theme: 'dark'
320317
});
321318
}
322319

package.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,9 @@
3939
"@angular-eslint/template-parser": "16.3.1",
4040
"@angular/cli": "^16.2.9",
4141
"@angular/compiler-cli": "^16.2.0",
42-
"@babybeet/angular-testing-kit": "^1.0.6",
43-
"@babybeet/eslint-config-base": "^1.0.2",
42+
"@babybeet/angular-testing-kit": "^1.0.8",
43+
"@babybeet/eslint-config-base": "^1.0.12",
4444
"@types/jasmine": "~4.3.0",
45-
"@typescript-eslint/eslint-plugin": "5.62.0",
46-
"@typescript-eslint/parser": "5.62.0",
47-
"eslint": "^8.51.0",
4845
"husky": "^8.0.3",
4946
"jasmine-core": "~4.6.0",
5047
"karma": "~6.4.0",
@@ -55,7 +52,6 @@
5552
"lint-staged": "^15.0.2",
5653
"markdown-toc": "^1.2.0",
5754
"ng-packagr": "^16.2.0",
58-
"prettier": "^3.0.3",
5955
"typescript": "~5.1.3"
6056
},
6157
"lint-staged": {

0 commit comments

Comments
 (0)