@1024pix/pix-ui 44.2.5 → 44.2.7

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.
@@ -16,8 +16,8 @@
16
16
  class="pix-search-input__input"
17
17
  name={{@inputName}}
18
18
  placeholder={{@placeholder}}
19
- value={{@value}}
20
- oninput={{this.onSearch}}
19
+ value={{this.initialValue}}
20
+ {{on "input" this.onSearch}}
21
21
  ...attributes
22
22
  />
23
23
  </div>
@@ -1,14 +1,16 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { action } from '@ember/object';
3
3
  import { guidFor } from '@ember/object/internals';
4
- import debounce from 'lodash.debounce';
4
+ import { debounceTask } from 'ember-lifeline';
5
5
 
6
6
  export default class PixSearchInput extends Component {
7
+ initialValue = this.args.value;
8
+
7
9
  constructor() {
8
10
  super(...arguments);
9
11
 
10
12
  this.debounceTimeBeforeSearch = parseInt(this.args.debounceTimeInMs);
11
- if (isNaN(this.debounceTimeBeforeSearch)) {
13
+ if (Number.isNaN(this.debounceTimeBeforeSearch)) {
12
14
  throw new Error('ERROR in PixSearchInput component, @debounceTimeInMs param is not provided');
13
15
  }
14
16
  if (!this.args.triggerFiltering) {
@@ -21,10 +23,6 @@ export default class PixSearchInput extends Component {
21
23
  }
22
24
 
23
25
  this.searchInputId = this.args.id || guidFor(this);
24
- this.debouncedTriggerFiltering = debounce(
25
- this.args.triggerFiltering,
26
- this.debounceTimeBeforeSearch,
27
- );
28
26
  }
29
27
 
30
28
  get label() {
@@ -35,8 +33,17 @@ export default class PixSearchInput extends Component {
35
33
  return this.args.label ? null : this.args.ariaLabel;
36
34
  }
37
35
 
36
+ debouncedTriggerFiltering(value) {
37
+ this.args.triggerFiltering(this.searchInputId, value);
38
+ }
39
+
38
40
  @action
39
- async onSearch(event) {
40
- await this.debouncedTriggerFiltering(this.searchInputId, event.target.value);
41
+ onSearch(event) {
42
+ debounceTask(
43
+ this,
44
+ 'debouncedTriggerFiltering',
45
+ event.target.value,
46
+ this.debounceTimeBeforeSearch,
47
+ );
41
48
  }
42
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "44.2.5",
3
+ "version": "44.2.7",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -53,15 +53,15 @@
53
53
  "ember-cli-htmlbars": "^6.1.1",
54
54
  "ember-cli-sass": "^11.0.1",
55
55
  "ember-click-outside": "^6.0.1",
56
+ "ember-lifeline": "^7.0.0",
56
57
  "ember-popperjs": "^3.0.0",
57
- "ember-truth-helpers": "^4.0.0",
58
- "lodash.debounce": "^4.0.8"
58
+ "ember-truth-helpers": "^4.0.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@1024pix/ember-testing-library": "^1.0.0",
62
62
  "@1024pix/eslint-config": "^1.2.2",
63
63
  "@1024pix/storybook-ember": "^7.1.1",
64
- "@1024pix/stylelint-config": "^5.1.1",
64
+ "@1024pix/stylelint-config": "^5.1.2",
65
65
  "@babel/eslint-parser": "^7.19.1",
66
66
  "@babel/plugin-proposal-decorators": "^7.20.5",
67
67
  "@ember/optional-features": "^2.0.0",