@1024pix/pix-ui 34.0.0 → 34.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Pix-UI Changelog
2
2
 
3
+ ## v34.1.0 (05/05/2023)
4
+
5
+
6
+ ### :rocket: Amélioration
7
+ - [#397](https://github.com/1024pix/pix-ui/pull/397) [FEATURE] Améliorer le composant PixFilterbanner (PIX-7854)
8
+
3
9
  ## v34.0.0 (04/05/2023)
4
10
 
5
11
 
@@ -13,8 +13,8 @@
13
13
  class={{this.className}}
14
14
  {{on "click" this.triggerAction}}
15
15
  ...attributes
16
- disabled={{this.isButtonLoadingOrDisabled}}
17
- aria-disabled="{{this.ariaDisabled}}"
16
+ disabled={{this.isDisabled}}
17
+ aria-disabled="{{this.isDisabled}}"
18
18
  >
19
19
  {{#if this.isLoading}}
20
20
  <div class="loader loader--{{this.loadingColor}}">
@@ -21,21 +21,17 @@ export default class PixButton extends PixButtonBase {
21
21
  return this.args.loadingColor || this.args['loading-color'] || 'white';
22
22
  }
23
23
 
24
- get isButtonLoadingOrDisabled() {
24
+ get isDisabled() {
25
25
  return this.isLoading || this.args.isDisabled;
26
26
  }
27
27
 
28
- get ariaDisabled() {
29
- return this.isButtonLoadingOrDisabled;
30
- }
31
-
32
28
  get className() {
33
29
  return super.baseClassNames.join(' ');
34
30
  }
35
31
 
36
32
  @action
37
33
  async triggerAction(params) {
38
- if (this.type === 'submit' && !this.args.triggerAction) return;
34
+ if (this.isDisabled || (this.type === 'submit' && !this.args.triggerAction)) return;
39
35
  if (!this.args.triggerAction) {
40
36
  throw new Error('@triggerAction params is required for PixButton !');
41
37
  }
@@ -22,8 +22,7 @@
22
22
  @shape="squircle"
23
23
  @size="small"
24
24
  @triggerAction={{@onClearFilters}}
25
- @iconBefore="trash-can"
26
- @prefixIconBefore="far"
25
+ @isDisabled={{@isClearFilterButtonDisabled}}
27
26
  >
28
27
  {{@clearFiltersLabel}}
29
28
  </PixButton>
@@ -4,9 +4,11 @@ export default class PixFilterBanner extends Component {
4
4
  get displayTitle() {
5
5
  return Boolean(this.args.title);
6
6
  }
7
+
7
8
  get displayDetails() {
8
9
  return Boolean(this.args.details);
9
10
  }
11
+
10
12
  get displayClearFilters() {
11
13
  return Boolean(this.args.clearFiltersLabel);
12
14
  }
@@ -8,6 +8,7 @@ export const filterBanner = (args) => {
8
8
  @details={{this.details}}
9
9
  @clearFiltersLabel={{this.clearFiltersLabel}}
10
10
  @onClearFilters={{this.onClearFilters}}
11
+ @isClearFilterButtonDisabled={{this.isClearFilterButtonDisabled}}
11
12
  >
12
13
  <PixSelect @options={{this.options}} @onChange={{this.onChange}} @label="mon label" @screenReaderOnly={{true}} @placeholder="placeholer"/>
13
14
  <PixSelect @options={{this.options}} @onChange={{this.onChange}} @label="mon label" @screenReaderOnly={{true}} @placeholder="placeholer"/>
@@ -49,4 +50,14 @@ export const argTypes = {
49
50
  description: 'fonction à appeler pour déclencher l’action de suppression des filtres',
50
51
  type: { required: false },
51
52
  },
53
+ isClearFilterButtonDisabled: {
54
+ name: 'isClearFilterButtonDisabled',
55
+ description: 'Désactiver le button de la suppresion des filtres',
56
+ type: { name: 'boolean', required: true },
57
+ control: { type: 'boolean' },
58
+ table: {
59
+ type: { summary: 'boolean' },
60
+ defaultValue: { summary: false },
61
+ },
62
+ },
52
63
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "34.0.0",
3
+ "version": "34.1.0",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"