@1024pix/pix-ui 20.2.0 → 20.2.2
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/CHANGELOG.md +12 -0
- package/addon/components/pix-progress-gauge.js +1 -1
- package/addon/components/pix-tooltip.hbs +4 -2
- package/addon/components/pix-tooltip.js +8 -5
- package/addon/styles/_pix-tooltip.scss +1 -0
- package/app/stories/pix-tooltip.stories.js +27 -0
- package/app/stories/pix-tooltip.stories.mdx +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Pix-UI Changelog
|
|
2
2
|
|
|
3
|
+
## v20.2.2 (09/11/2022)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### :building_construction: Tech
|
|
7
|
+
- [#273](https://github.com/1024pix/pix-ui/pull/273) [TECH] Remplacer l'import d'`htmlSafe` depuis `ember/string` en `ember/template`
|
|
8
|
+
|
|
9
|
+
## v20.2.1 (28/10/2022)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### :bug: Correction
|
|
13
|
+
- [#268](https://github.com/1024pix/pix-ui/pull/268) [BUGFIX] Empêcher la propagation des événements dans tous les enfants sur la Tooltip (PIX-6149)
|
|
14
|
+
|
|
3
15
|
## v20.2.0 (25/10/2022)
|
|
4
16
|
|
|
5
17
|
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
class="pix-tooltip"
|
|
3
3
|
{{on-escape-action this.hideTooltip}}
|
|
4
4
|
{{on "mouseover" this.showTooltip}}
|
|
5
|
-
{{on "
|
|
5
|
+
{{on "mouseleave" this.hideTooltipOnMouseOut}}
|
|
6
6
|
{{on "focusin" this.showTooltip}}
|
|
7
7
|
{{on "focusout" this.hideTooltip}}
|
|
8
8
|
...attributes
|
|
9
9
|
>
|
|
10
10
|
{{#if (has-block "triggerElement")}}
|
|
11
|
-
{{
|
|
11
|
+
<div class={{if this.isVisible "pix-tooltip--visible" ""}}>
|
|
12
|
+
{{yield to="triggerElement"}}
|
|
13
|
+
</div>
|
|
12
14
|
{{/if}}
|
|
13
15
|
|
|
14
16
|
{{#if (has-block "tooltip")}}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { action } from '@ember/object';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
4
|
|
|
4
5
|
export default class PixTooltip extends Component {
|
|
6
|
+
@tracked isVisible = false;
|
|
7
|
+
|
|
5
8
|
get position() {
|
|
6
9
|
const correctsPosition = [
|
|
7
10
|
'top',
|
|
@@ -21,18 +24,18 @@ export default class PixTooltip extends Component {
|
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
@action
|
|
24
|
-
showTooltip(
|
|
25
|
-
|
|
27
|
+
showTooltip() {
|
|
28
|
+
this.isVisible = true;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
@action
|
|
29
|
-
hideTooltip(
|
|
30
|
-
|
|
32
|
+
hideTooltip() {
|
|
33
|
+
this.isVisible = false;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
@action
|
|
34
37
|
hideTooltipOnMouseOut(event) {
|
|
35
|
-
const isFocused = document.activeElement
|
|
38
|
+
const isFocused = event.target.contains(document.activeElement);
|
|
36
39
|
|
|
37
40
|
if (isFocused) {
|
|
38
41
|
return;
|
|
@@ -46,6 +46,27 @@ const TemplateWithHTMLElement = (args) => {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
const TemplateWithIconElement = (args) => {
|
|
50
|
+
return {
|
|
51
|
+
template: hbs`
|
|
52
|
+
<PixTooltip
|
|
53
|
+
@id={{this.id}}
|
|
54
|
+
@isInline=true>
|
|
55
|
+
<:triggerElement>
|
|
56
|
+
<button style='padding:0; margin-left:4px; line-height:0;'>
|
|
57
|
+
<FaIcon class="external-link" @icon="up-right-from-square" />
|
|
58
|
+
</button>
|
|
59
|
+
</:triggerElement>
|
|
60
|
+
|
|
61
|
+
<:tooltip>
|
|
62
|
+
{{this.text}}
|
|
63
|
+
</:tooltip>
|
|
64
|
+
</PixTooltip>
|
|
65
|
+
`,
|
|
66
|
+
context: args,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
49
70
|
export const Default = Template.bind({});
|
|
50
71
|
Default.args = {
|
|
51
72
|
text: 'Hello World',
|
|
@@ -113,6 +134,12 @@ WithHTML.args = {
|
|
|
113
134
|
label: 'À survoler pour voir la tooltip',
|
|
114
135
|
};
|
|
115
136
|
|
|
137
|
+
export const WithIcon = TemplateWithIconElement.bind({});
|
|
138
|
+
Default.args = {
|
|
139
|
+
text: 'Hello World',
|
|
140
|
+
label: 'À survoler pour voir la tooltip',
|
|
141
|
+
};
|
|
142
|
+
|
|
116
143
|
export const argTypes = {
|
|
117
144
|
id: {
|
|
118
145
|
name: 'id',
|