@1024pix/pix-ui 44.2.5 → 44.2.6
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.
|
@@ -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
|
|
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
|
-
|
|
40
|
-
|
|
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.
|
|
3
|
+
"version": "44.2.6",
|
|
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,9 +53,9 @@
|
|
|
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",
|