@1024pix/pix-ui 11.2.0 → 13.2.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +37 -3
  2. package/addon/components/pix-block.hbs +1 -1
  3. package/addon/components/pix-collapsible.hbs +4 -4
  4. package/addon/components/pix-dropdown.hbs +85 -0
  5. package/addon/components/pix-dropdown.js +181 -0
  6. package/addon/components/pix-icon-button.hbs +1 -1
  7. package/addon/components/pix-input-password.hbs +3 -4
  8. package/addon/components/pix-input-password.js +0 -5
  9. package/addon/components/pix-input.hbs +2 -8
  10. package/addon/components/pix-input.js +0 -8
  11. package/addon/components/pix-message.hbs +1 -1
  12. package/addon/components/pix-modal.hbs +28 -0
  13. package/addon/components/pix-modal.js +11 -0
  14. package/addon/components/pix-multi-select.hbs +5 -5
  15. package/addon/components/pix-progress-gauge.hbs +1 -1
  16. package/addon/components/pix-radio-button.hbs +1 -1
  17. package/addon/components/pix-select.hbs +3 -2
  18. package/addon/components/pix-selectable-tag.hbs +1 -1
  19. package/addon/components/pix-textarea.hbs +1 -1
  20. package/addon/components/pix-tooltip-deprecated.hbs +3 -3
  21. package/addon/components/pix-tooltip.hbs +12 -10
  22. package/addon/components/pix-tooltip.js +4 -0
  23. package/addon/styles/_pix-dropdown.scss +149 -0
  24. package/addon/styles/_pix-input.scss +1 -3
  25. package/addon/styles/_pix-modal.scss +95 -0
  26. package/addon/styles/_pix-selectable-tag.scss +4 -0
  27. package/addon/styles/addon.scss +2 -0
  28. package/app/components/pix-dropdown.js +1 -0
  29. package/app/components/pix-modal-content.js +1 -0
  30. package/app/components/pix-modal-footer.js +1 -0
  31. package/app/components/pix-modal.js +1 -0
  32. package/app/stories/form.stories.js +13 -0
  33. package/app/stories/pix-dropdown.stories.js +180 -0
  34. package/app/stories/pix-dropdown.stories.mdx +69 -0
  35. package/app/stories/pix-input-password.stories.mdx +0 -1
  36. package/app/stories/pix-input.stories.mdx +1 -2
  37. package/app/stories/pix-modal.stories.js +40 -0
  38. package/app/stories/pix-modal.stories.mdx +59 -0
  39. package/app/stories/pix-tooltip.stories.js +15 -1
  40. package/app/stories/pix-tooltip.stories.mdx +19 -0
  41. package/docs/adr/0001-utiliser-les-balises-html-natives.md +53 -0
  42. package/docs/test-component-without-release.stories.mdx +19 -0
  43. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Pix-UI Changelog
2
2
 
3
+ ## v13.2.0 (17/02/2022)
4
+
5
+
6
+ ### :rocket: Enhancement
7
+ - [#193](https://github.com/1024pix/pix-ui/pull/193) [FEATURE] Ajouter le composant dropdown (PIX-4295).
8
+
9
+ ## v13.1.0 (16/02/2022)
10
+
11
+
12
+ ### :building_construction: Tech
13
+ - [#194](https://github.com/1024pix/pix-ui/pull/194) [TECH] Mise a jour du package-lock.
14
+ - [#192](https://github.com/1024pix/pix-ui/pull/192) [TECH] Améliorer le blueprint pour auto-générer les nouveaux composants.
15
+
16
+ ### :coffee: Various
17
+ - [#198](https://github.com/1024pix/pix-ui/pull/198) [FEAT] Permettre à la tooltip de ne pas s'afficher (PIX-4375)
18
+ - [#196](https://github.com/1024pix/pix-ui/pull/196) [FIX] Corriger les tests qui bloquent la pipeline.
19
+ - [#183](https://github.com/1024pix/pix-ui/pull/183) [DOC] Utiliser les champs de saisie natifs HTML plutôt que ceux d'Ember.
20
+
21
+ ## v13.0.0 (27/01/2022)
22
+
23
+
24
+ ### :coffee: Various
25
+ - [#188](https://github.com/1024pix/pix-ui/pull/188) [BREAKING_CHANGES] Input / InputPassword missing event on onChange (PIX-4243)
26
+
27
+ ## v12.0.0 (24/01/2022)
28
+
29
+
30
+ ### :rocket: Enhancement
31
+ - [#94](https://github.com/1024pix/pix-ui/pull/94) [FEATURE] Ajout du composant PixModal
32
+
33
+ ### :bug: Bug fix
34
+ - [#186](https://github.com/1024pix/pix-ui/pull/186) [BREAKING_CHANGES] Désactiver l'autocomplete sur le composant Pix Select (PIX-4158)
35
+ - [#187](https://github.com/1024pix/pix-ui/pull/187) [BUGFIX] Rendre tout le tag sélectionnable (PIX-4179)
36
+
3
37
  ## v11.2.0 (14/01/2022)
4
38
 
5
39
 
@@ -16,7 +50,7 @@
16
50
 
17
51
 
18
52
  ### :building_construction: Tech
19
- - [#175](https://github.com/1024pix/pix-ui/pull/175) [TECH] Faire en sorte que le message d'erreur soit situé à l'intérieur de l'élément qui le compose (PIX-3829)
53
+ - [#175](https://github.com/1024pix/pix-ui/pull/175) [BREAKING_CHANGES] Faire en sorte que le message d'erreur soit situé à l'intérieur de l'élément qui le compose (PIX-3829)
20
54
 
21
55
  ## v11.0.1 (08/12/2021)
22
56
 
@@ -34,12 +68,12 @@
34
68
  - [#177](https://github.com/1024pix/pix-ui/pull/177) [FEATURE] Création du composant Tag sélectionnable dans Pix UI (PIX-3757)
35
69
 
36
70
  ### :building_construction: Tech
37
- - [#180](https://github.com/1024pix/pix-ui/pull/180) [TECH] Ajouter la possibilité d'utiliser des composants Ember à l'intérieur de la tooltip (Pix-3925)
71
+ - [#180](https://github.com/1024pix/pix-ui/pull/180) [BREAKING_CHANGES] Ajouter la possibilité d'utiliser des composants Ember à l'intérieur de la tooltip (Pix-3925)
38
72
  - [#179](https://github.com/1024pix/pix-ui/pull/179) [TECH] Mise à jour du template de pull request pour faire apparaître plus clairement les BREAKING_CHANGES
39
73
  - [#148](https://github.com/1024pix/pix-ui/pull/148) [TECH] Formatter les fichiers avec prettier (PIX-3469)
40
74
 
41
75
  ### :bug: Bug fix
42
- - [#147](https://github.com/1024pix/pix-ui/pull/147) [BUGFIX] Ajout de l'évènement onChange afin de supprimer le message d'erreur lorsque l'utilisateur modifie sa saisie (PIX-3476)
76
+ - [#147](https://github.com/1024pix/pix-ui/pull/147) [BREAKING_CHANGES] Ajout de l'évènement onChange afin de supprimer le message d'erreur lorsque l'utilisateur modifie sa saisie (PIX-3476)
43
77
 
44
78
  ### :coffee: Various
45
79
  - [#178](https://github.com/1024pix/pix-ui/pull/178) [DOC] Améliorer l'information sur les breaking changes dans Pix UI
@@ -1,4 +1,4 @@
1
- <div class="pix-block {{concat "pix-block--shadow-" this.getShadowWeight}}" ...attributes>
1
+ <div class="pix-block {{concat 'pix-block--shadow-' this.getShadowWeight}}" ...attributes>
2
2
 
3
3
  {{yield}}
4
4
 
@@ -1,9 +1,9 @@
1
- <div class="pix-collapsible {{if this.isUnCollapsed "pix-collapsible--uncollapsed"}}">
1
+ <div class="pix-collapsible {{if this.isUnCollapsed 'pix-collapsible--uncollapsed'}}">
2
2
 
3
3
  <button
4
4
  type="button"
5
5
  {{on "click" this.toggleCollapsible}}
6
- class="pix-collapsible__title {{if this.isUnCollapsed "pix-collapsible__title--uncollapsed"}}"
6
+ class="pix-collapsible__title {{if this.isUnCollapsed 'pix-collapsible__title--uncollapsed'}}"
7
7
  aria-controls={{this.contentId}}
8
8
  aria-expanded={{if this.isUnCollapsed "true" "false"}}
9
9
  ...attributes
@@ -15,14 +15,14 @@
15
15
  {{this.title}}
16
16
  </span>
17
17
 
18
- <FaIcon @icon="{{if this.isCollapsed "plus" "minus"}}" class="pix-collapsible-title__icon" />
18
+ <FaIcon @icon="{{if this.isCollapsed 'plus' 'minus'}}" class="pix-collapsible-title__icon" />
19
19
  </button>
20
20
 
21
21
  <div
22
22
  id={{this.contentId}}
23
23
  aria-hidden={{if this.isCollapsed "true" "false"}}
24
24
  class="pix-collapsible__content
25
- {{if this.isUnCollapsed " pix-collapsible__content--uncollapse"}}"
25
+ {{if this.isUnCollapsed ' pix-collapsible__content--uncollapse'}}"
26
26
  >
27
27
  {{yield}}
28
28
  </div>
@@ -0,0 +1,85 @@
1
+ <div class="pix-dropdown">
2
+ {{#if this.label}}
3
+ <label id={{@id}} class="pix-dropdown__label">{{this.label}}</label>
4
+ {{/if}}
5
+ <div class="pix-dropdown__controller">
6
+ <button
7
+ type="button"
8
+ class="pix-dropdown__controller--placeholder{{if this.isExpanded ' expanded'}}"
9
+ aria-label={{if this.isExpanded @collapseLabel @expandLabel}}
10
+ {{on "click" this.toggleDropdown}}
11
+ {{on "keyup" this.navigateThroughOptions}}
12
+ >
13
+ <p
14
+ title={{this.placeholder}}
15
+ class="pix-dropdown__controller--placeholder-text{{unless
16
+ this.hasSelectedOption
17
+ ' default'
18
+ }}"
19
+ >{{this.placeholder}}</p>
20
+ </button>
21
+ {{#if this.hasSelectedOption}}
22
+ <button
23
+ type="button"
24
+ class="pix-dropdown__controller--clear"
25
+ {{on "click" this.clearSelection}}
26
+ aria-label={{@clearLabel}}
27
+ >
28
+ <FaIcon @icon="times" />
29
+ </button>
30
+ {{/if}}
31
+ <FaIcon
32
+ class="pix-dropdown__controller--chevron"
33
+ @icon={{if this.isExpanded "chevron-up" "chevron-down"}}
34
+ />
35
+ </div>
36
+ <div
37
+ role="listbox"
38
+ id={{this.menuId}}
39
+ tabindex="-1"
40
+ class="pix-dropdown__menu{{if this.isExpanded ' expanded'}}"
41
+ aria-labelledby={{if this.label @id}}
42
+ aria-label={{unless this.label @placeholder}}
43
+ aria-hidden={{if this.isExpanded "false" "true"}}
44
+ aria-activedescendant={{if this.selectedOption this.selectedOption.value}}
45
+ {{on "keyup" this.navigateThroughOptions}}
46
+ {{on "scroll" this.incrementPage}}
47
+ >
48
+ {{#if @isSearchable}}
49
+ <div class="pix-dropdown__menu--search">
50
+ <FaIcon class="pix-dropdown__menu--search-icon" @icon="search" />
51
+ <label
52
+ class="pix-dropdown__menu--search-input-label"
53
+ for={{this.searchInputId}}
54
+ >{{@searchPlaceholder}}</label>
55
+ <input
56
+ class="pix-dropdown__menu--search-input"
57
+ id={{this.searchInputId}}
58
+ autocomplete="off"
59
+ tabindex={{unless this.isExpanded "-1"}}
60
+ placeholder={{@searchPlaceholder}}
61
+ {{on "input" this.filterOptions}}
62
+ />
63
+ </div>
64
+ {{/if}}
65
+ {{#each this.options as |opt index|}}
66
+ {{#if (lt index this.showLimit)}}
67
+ <div
68
+ role="option"
69
+ id={{opt.value}}
70
+ tabindex="-1"
71
+ class="pix-dropdown__menu--option{{if
72
+ (eq this.selectedOption.value opt.value)
73
+ ' selected'
74
+ }}"
75
+ aria-selected={{if (eq this.selectedOption.value opt.value) "true"}}
76
+ {{on "click" (fn this.selectOption opt)}}
77
+ {{on "mouseover" this.resetPreviouslyFocused}}
78
+ {{on "keypress" (fn this.onOptionKeyPress opt)}}
79
+ >
80
+ {{opt.label}}
81
+ </div>
82
+ {{/if}}
83
+ {{/each}}
84
+ </div>
85
+ </div>
@@ -0,0 +1,181 @@
1
+ import Component from '@glimmer/component';
2
+ import { tracked } from '@glimmer/tracking';
3
+ import { action } from '@ember/object';
4
+
5
+ export default class PixDropdown extends Component {
6
+ defaultId = Math.floor(Math.random() * 100);
7
+ focusedOption = null;
8
+ focusedIndex = null;
9
+ @tracked page = 1;
10
+ @tracked selectedOption = null;
11
+ @tracked isExpanded = false;
12
+ @tracked options = this.args.options;
13
+ @tracked menuId = `menu-${this.defaultId}`;
14
+ @tracked searchInputId = `search-input-${this.defaultId}`;
15
+
16
+ constructor() {
17
+ super(...arguments);
18
+
19
+ if (!this.args.label && !this.args.placeholder) {
20
+ throw new Error(
21
+ 'ERROR in PixDropdown component, you need to provide a label and/or a placeholder'
22
+ );
23
+ }
24
+
25
+ if (this.args.selectedOption) {
26
+ this.selectedOption = this.args.options.find(
27
+ ({ value }) => value === this.args.selectedOption
28
+ );
29
+ }
30
+ }
31
+
32
+ get hasSelectedOption() {
33
+ return !!this.selectedOption;
34
+ }
35
+
36
+ get placeholder() {
37
+ return this.selectedOption?.label || this.args.placeholder;
38
+ }
39
+
40
+ get label() {
41
+ const labelIsDefined = this.args.label?.trim();
42
+ const idIsNotDefined = !this.args.id?.trim();
43
+
44
+ if (labelIsDefined && idIsNotDefined) {
45
+ throw new Error('ERROR in PixDropdown component, @id param is necessary when giving @label');
46
+ }
47
+ return this.args.label || null;
48
+ }
49
+
50
+ get showLimit() {
51
+ if (!this.args.pageSize) return this.options.length;
52
+
53
+ const numberOfOptionsAccordingToPage = this.args.pageSize * this.page;
54
+ return Math.min(this.options.length, numberOfOptionsAccordingToPage);
55
+ }
56
+
57
+ @action
58
+ resetPreviouslyFocused() {
59
+ if (!this.focusedOption) return;
60
+
61
+ const previouslyFocusedElement = document.getElementById(this.focusedOption.value);
62
+ previouslyFocusedElement?.blur();
63
+ this.focusedOption = undefined;
64
+ this.focusedIndex = undefined;
65
+ }
66
+
67
+ _navigateToOption(option, index) {
68
+ if (!option) return;
69
+
70
+ this.resetPreviouslyFocused();
71
+ this.focusedOption = option;
72
+ this.focusedIndex = index;
73
+ const focusedElement = document.getElementById(option.value);
74
+ focusedElement?.scrollIntoView({ block: 'nearest' });
75
+ focusedElement?.focus();
76
+ }
77
+
78
+ _computeNextIndex(isArrowDown, index) {
79
+ const length = this.showLimit;
80
+ let nextIndex;
81
+ if (index === undefined || index === null) {
82
+ nextIndex = isArrowDown ? 0 : length - 1;
83
+ } else {
84
+ const delta = isArrowDown ? 1 : -1;
85
+ nextIndex = index + delta;
86
+ }
87
+ // navigate through array in a circle
88
+ // (i.e. go back to first after last or last after first)
89
+ return ((nextIndex % length) + length) % length;
90
+ }
91
+
92
+ @action
93
+ navigateThroughOptions(event) {
94
+ const isArrowDown = event.code === 'ArrowDown';
95
+ if (event.code !== 'ArrowUp' && !isArrowDown) return;
96
+ const nextIndex = this._computeNextIndex(isArrowDown, this.focusedIndex);
97
+ this._navigateToOption(this.options[nextIndex], nextIndex);
98
+ }
99
+
100
+ @action
101
+ toggleDropdown() {
102
+ this.isExpanded = !this.isExpanded;
103
+
104
+ if (this.isExpanded) {
105
+ this.resetPreviouslyFocused();
106
+ const searchInput = document.getElementById(this.searchInputId);
107
+ if (searchInput) {
108
+ searchInput.focus();
109
+ } else {
110
+ this._navigateToOption(this.options[0], 0);
111
+ }
112
+ }
113
+
114
+ const menu = document.getElementById(this.menuId);
115
+ menu.scrollTop = 0;
116
+ this.page = 1;
117
+ }
118
+
119
+ @action
120
+ selectOption(option) {
121
+ if (this.selectedOption?.value !== option.value) {
122
+ this.args.onSelect?.(option.value);
123
+ this.selectedOption = option;
124
+ }
125
+ this.isExpanded = false;
126
+
127
+ const searchInput = document.getElementById(this.searchInputId);
128
+ if (searchInput) {
129
+ searchInput.value = '';
130
+ this.options = this.args.options;
131
+ }
132
+ }
133
+
134
+ @action
135
+ onOptionKeyPress(option, event) {
136
+ if (event.code === 'Enter' || event.code === 'Space') this.selectOption(option);
137
+ }
138
+
139
+ @action
140
+ clearSelection(event) {
141
+ event.stopPropagation();
142
+ event.preventDefault();
143
+ this.selectedOption = null;
144
+ this._navigateToOption(this.options[0], 0);
145
+ this.args.onSelect?.();
146
+ }
147
+
148
+ @action
149
+ onClearKeyPress(event) {
150
+ if (event.code === 'Enter' || event.code === 'Space') this.clearSelection(event);
151
+ }
152
+
153
+ @action
154
+ filterOptions(event) {
155
+ this.resetPreviouslyFocused();
156
+ const filterValue = event.target?.value.toLowerCase();
157
+ this.page = 1;
158
+ this.options = filterValue
159
+ ? this.args.options.filter(({ label }) => label.toLowerCase().includes(filterValue))
160
+ : this.args.options;
161
+ }
162
+
163
+ _isLastOptionVisible(option) {
164
+ const lastVisibleOption = document.getElementById(option.value);
165
+ const menu = document.getElementById(this.menuId);
166
+
167
+ const { bottom, height, top } = lastVisibleOption.getBoundingClientRect();
168
+ const menuRect = menu.getBoundingClientRect();
169
+
170
+ return top <= menuRect.top ? menuRect.top - top <= height : bottom - menuRect.bottom <= height;
171
+ }
172
+
173
+ @action
174
+ incrementPage() {
175
+ if (!this.args.pageSize) return;
176
+
177
+ if (this._isLastOptionVisible(this.options[this.showLimit - 1])) {
178
+ this.page += 1;
179
+ }
180
+ }
181
+ }
@@ -3,7 +3,7 @@
3
3
  aria-label={{this.ariaLabel}}
4
4
  class="pix-icon-button pix-icon-button--{{this.size}}
5
5
  pix-icon-button--{{this.color}}
6
- {{if @withBackground " pix-icon-button--background"}}"
6
+ {{if @withBackground ' pix-icon-button--background'}}"
7
7
  {{on "click" this.triggerAction}}
8
8
  ...attributes
9
9
  >
@@ -7,8 +7,8 @@
7
7
  {{/if}}
8
8
  <div
9
9
  class="pix-input-password__container
10
- {{if @errorMessage "pix-input-password__error-container"}}
11
- {{if @prefix "pix-input-password__with-prefix"}}"
10
+ {{if @errorMessage 'pix-input-password__error-container'}}
11
+ {{if @prefix 'pix-input-password__with-prefix'}}"
12
12
  >
13
13
 
14
14
  {{#if @prefix}}
@@ -20,12 +20,11 @@
20
20
  type={{if this.isPasswordVisible "text" "password"}}
21
21
  value={{@value}}
22
22
  aria-label={{this.ariaLabel}}
23
- {{on "change" this.onChange}}
24
23
  ...attributes
25
24
  />
26
25
 
27
26
  <PixIconButton
28
- class="pix-input-password__button {{if @errorMessage " pix-input-password__error-button"}}"
27
+ class="pix-input-password__button {{if @errorMessage ' pix-input-password__error-button'}}"
29
28
  @icon={{if this.isPasswordVisible "eye" "eye-slash"}}
30
29
  @ariaLabel={{if this.isPasswordVisible "Masquer le mot de passe" "Afficher le mot de passe"}}
31
30
  @triggerAction={{this.togglePasswordVisibility}}
@@ -26,9 +26,4 @@ export default class PixInputPassword extends PixInput {
26
26
  togglePasswordVisibility() {
27
27
  this.isPasswordVisible = !this.isPasswordVisible;
28
28
  }
29
-
30
- @action
31
- onChange() {
32
- if (typeof this.args.onChange === 'function') this.args.onChange();
33
- }
34
29
  }
@@ -7,20 +7,14 @@
7
7
  {{/if}}
8
8
 
9
9
  <div class="pix-input__container">
10
- <input
11
- id={{this.id}}
12
- class={{this.className}}
13
- value={{@value}}
14
- {{on "change" this.onChange}}
15
- ...attributes
16
- />
10
+ <input id={{this.id}} class={{this.className}} value={{@value}} ...attributes />
17
11
 
18
12
  {{#if @errorMessage}}
19
13
  <FaIcon @icon="times" class="pix-input__error-icon" />
20
14
  {{/if}}
21
15
 
22
16
  {{#if @icon}}
23
- <FaIcon @icon={{@icon}} class="pix-input__icon {{if @isIconLeft "pix-input__icon--left"}}" />
17
+ <FaIcon @icon={{@icon}} class="pix-input__icon {{if @isIconLeft 'pix-input__icon--left'}}" />
24
18
  {{/if}}
25
19
  </div>
26
20
 
@@ -1,9 +1,6 @@
1
1
  import Component from '@glimmer/component';
2
2
 
3
- import { action } from '@ember/object';
4
3
  export default class PixInput extends Component {
5
- text = 'pix-input';
6
-
7
4
  get id() {
8
5
  if (!this.args.id || !this.args.id.toString().trim()) {
9
6
  throw new Error('ERROR in PixInput component, @id param is not provided');
@@ -18,9 +15,4 @@ export default class PixInput extends Component {
18
15
  this.args.isIconLeft && classNames.push('pix-input__input--icon-left');
19
16
  return classNames.join(' ');
20
17
  }
21
-
22
- @action
23
- onChange() {
24
- if (typeof this.args.onChange === 'function') this.args.onChange();
25
- }
26
18
  }
@@ -1,4 +1,4 @@
1
- <p class="pix-message {{concat "pix-message--" this.type}}" ...attributes>
1
+ <p class="pix-message {{concat 'pix-message--' this.type}}" ...attributes>
2
2
  {{#if @withIcon}}
3
3
  <FaIcon @icon={{this.iconClass}} />
4
4
  {{/if}}
@@ -0,0 +1,28 @@
1
+ <div class="pix-modal__overlay">
2
+ <div
3
+ class="pix-modal"
4
+ role="dialog"
5
+ aria-labelledby="modal-title"
6
+ aria-describedby="modal-content"
7
+ aria-modal="true"
8
+ ...attributes
9
+ >
10
+ <header class="pix-modal__header">
11
+ <h1 id="modal-title" class="pix-modal__title">{{@title}}</h1>
12
+ <PixIconButton
13
+ @icon="times"
14
+ @triggerAction={{@onCloseButtonClick}}
15
+ @ariaLabel="Fermer"
16
+ @size="small"
17
+ @withBackground={{true}}
18
+ class="pix-modal__close-button"
19
+ />
20
+ </header>
21
+ <main id="modal-content" class="pix-modal__content">
22
+ {{yield to="content"}}
23
+ </main>
24
+ <footer class="pix-modal__footer">
25
+ {{yield to="footer"}}
26
+ </footer>
27
+ </div>
28
+ </div>
@@ -0,0 +1,11 @@
1
+ import Component from '@glimmer/component';
2
+
3
+ export default class PixModal extends Component {
4
+ constructor(...args) {
5
+ super(...args);
6
+
7
+ if (!this.args.title) {
8
+ throw new Error('ERROR in PixModal component: @title argument is required.');
9
+ }
10
+ }
11
+ }
@@ -5,7 +5,7 @@
5
5
  {{/if}}
6
6
 
7
7
  {{#if @isSearchable}}
8
- <label class="pix-multi-select-header {{if this.isBig "pix-multi-select-header--big"}}">
8
+ <label class="pix-multi-select-header {{if this.isBig 'pix-multi-select-header--big'}}">
9
9
 
10
10
  <span class="pix-multi-select-header__title">{{@title}}</span>
11
11
  <FaIcon @icon="search" class="pix-multi-select-header__search-icon" />
@@ -26,25 +26,25 @@
26
26
  <button
27
27
  id={{@id}}
28
28
  type="button"
29
- class="pix-multi-select-header {{if this.isBig "pix-multi-select-header--big"}}"
29
+ class="pix-multi-select-header {{if this.isBig 'pix-multi-select-header--big'}}"
30
30
  {{on "click" this.toggleDropDown}}
31
31
  >
32
32
  {{@title}}
33
33
  <FaIcon
34
34
  class="pix-multi-select-header__dropdown-icon
35
- {{if this.isExpanded " pix-multi-select-header__dropdown-icon--expand"}}"
35
+ {{if this.isExpanded ' pix-multi-select-header__dropdown-icon--expand'}}"
36
36
  @icon={{if this.isExpanded "chevron-up" "chevron-down"}}
37
37
  />
38
38
  </button>
39
39
  {{/if}}
40
40
 
41
- <ul class="pix-multi-select-list {{unless this.isExpanded "pix-multi-select-list--hidden"}}">
41
+ <ul class="pix-multi-select-list {{unless this.isExpanded 'pix-multi-select-list--hidden'}}">
42
42
  {{#if (gt this.results.length 0)}}
43
43
  {{#each this.results as |option|}}
44
44
  <li class="pix-multi-select-list__item">
45
45
  <input
46
46
  class="pix-multi-select-list__checkbox
47
- {{if @isSearchable " pix-multi-select-list__checkbox--searchable"}}"
47
+ {{if @isSearchable ' pix-multi-select-list__checkbox--searchable'}}"
48
48
  type="checkbox"
49
49
  checked={{option.checked}}
50
50
  id={{concat @id "-" option.value}}
@@ -1,7 +1,7 @@
1
1
  <div
2
2
  class="progress-gauge
3
3
  {{this.progressGaugeClass}}
4
- {{if @isArrowLeft "progress-gauge--tooltip-left"}}"
4
+ {{if @isArrowLeft 'progress-gauge--tooltip-left'}}"
5
5
  ...attributes
6
6
  >
7
7
  <div class="progress-gauge__referrer"></div>
@@ -1,5 +1,5 @@
1
1
  <div class="pix-radio-button">
2
- <label class="{{if @isDisabled " pix-radio-button--disabled"}}">
2
+ <label class="{{if @isDisabled ' pix-radio-button--disabled'}}">
3
3
  <input
4
4
  disabled={{@isDisabled}}
5
5
  aria-disabled="{{@isDisabled}}"
@@ -10,8 +10,9 @@
10
10
  id={{@id}}
11
11
  list="{{this.datalistId}}"
12
12
  {{on "input" this.onChange}}
13
- class="{{if this.isValid "pix-select--is-valid"}} {{if this.isBig "pix-select--big"}}"
13
+ class="{{if this.isValid 'pix-select--is-valid'}} {{if this.isBig 'pix-select--big'}}"
14
14
  ...attributes
15
+ autocomplete="off"
15
16
  />
16
17
 
17
18
  <datalist id={{this.datalistId}}>
@@ -24,7 +25,7 @@
24
25
 
25
26
  <select
26
27
  id={{@id}}
27
- class="{{if this.isBig "pix-select--big"}}"
28
+ class="{{if this.isBig 'pix-select--big'}}"
28
29
  {{on "change" this.onChange}}
29
30
  ...attributes
30
31
  >
@@ -1,4 +1,4 @@
1
- <div class="pix-selectable-tag {{if this.isChecked " pix-selectable-tag--checked"}}">
1
+ <div class="pix-selectable-tag {{if this.isChecked ' pix-selectable-tag--checked'}}">
2
2
  <input
3
3
  type="checkbox"
4
4
  id={{@id}}
@@ -8,7 +8,7 @@
8
8
  id={{@id}}
9
9
  @value={{@value}}
10
10
  maxlength={{if @maxlength @maxlength}}
11
- class="{{if @errorMessage "pix-textarea--error"}}"
11
+ class="{{if @errorMessage 'pix-textarea--error'}}"
12
12
  ...attributes
13
13
  />
14
14
  {{#if @maxlength}}
@@ -7,9 +7,9 @@
7
7
  id={{@id}}
8
8
  role="tooltip"
9
9
  class="pix-tooltip__content pix-tooltip__content--{{this.position}}
10
- {{if @isInline "pix-tooltip__content--inline"}}
11
- {{if @isLight "pix-tooltip__content--light"}}
12
- {{if @isWide "pix-tooltip__content--wide"}}"
10
+ {{if @isInline 'pix-tooltip__content--inline'}}
11
+ {{if @isLight 'pix-tooltip__content--light'}}
12
+ {{if @isWide 'pix-tooltip__content--wide'}}"
13
13
  >
14
14
  {{this.text}}
15
15
  </span>
@@ -4,15 +4,17 @@
4
4
  {{/if}}
5
5
 
6
6
  {{#if (has-block "tooltip")}}
7
- <span
8
- id={{@id}}
9
- role="tooltip"
10
- class="pix-tooltip__content pix-tooltip__content--{{this.position}}
11
- {{if @isInline "pix-tooltip__content--inline"}}
12
- {{if @isLight "pix-tooltip__content--light"}}
13
- {{if @isWide "pix-tooltip__content--wide"}}"
14
- >
15
- {{yield to="tooltip"}}
16
- </span>
7
+ {{#if this.display}}
8
+ <span
9
+ id={{@id}}
10
+ role="tooltip"
11
+ class="pix-tooltip__content pix-tooltip__content--{{this.position}}
12
+ {{if @isInline 'pix-tooltip__content--inline'}}
13
+ {{if @isLight 'pix-tooltip__content--light'}}
14
+ {{if @isWide 'pix-tooltip__content--wide'}}"
15
+ >
16
+ {{yield to="tooltip"}}
17
+ </span>
18
+ {{/if}}
17
19
  {{/if}}
18
20
  </span>
@@ -14,4 +14,8 @@ export default class PixTooltip extends Component {
14
14
  ];
15
15
  return correctsPosition.includes(this.args.position) ? this.args.position : 'top';
16
16
  }
17
+
18
+ get display() {
19
+ return typeof this.args.hide === 'undefined' || !this.args.hide;
20
+ }
17
21
  }