@1024pix/pix-ui 55.21.2 → 55.22.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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { warn } from '@ember/debug';
|
|
1
2
|
import { action } from '@ember/object';
|
|
2
3
|
import { guidFor } from '@ember/object/internals';
|
|
3
4
|
import Component from '@glimmer/component';
|
|
@@ -21,6 +22,18 @@ export default class PixMultiSelect extends Component {
|
|
|
21
22
|
@tracked isExpanded = false;
|
|
22
23
|
@tracked searchData;
|
|
23
24
|
|
|
25
|
+
constructor(...args) {
|
|
26
|
+
super(...args);
|
|
27
|
+
|
|
28
|
+
warn(
|
|
29
|
+
`PixMultiSelect: @strictSearch is deprecated in favour of @onSearch`,
|
|
30
|
+
!this.args.strictSearch,
|
|
31
|
+
{
|
|
32
|
+
id: 'pix-ui.pix-multi-select.strictSearch.deprecated',
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
get options() {
|
|
25
38
|
return [...(this.args.options || [])];
|
|
26
39
|
}
|
|
@@ -139,9 +152,13 @@ export default class PixMultiSelect extends Component {
|
|
|
139
152
|
|
|
140
153
|
@action
|
|
141
154
|
updateSearch(event) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
155
|
+
if (this.args.onSearch) {
|
|
156
|
+
this.args.onSearch(event.target.value);
|
|
157
|
+
} else {
|
|
158
|
+
this.searchData = this.args.strictSearch
|
|
159
|
+
? event.target.value
|
|
160
|
+
: removeCapitalizeAndDiacritics(event.target.value);
|
|
161
|
+
}
|
|
145
162
|
this.isExpanded = true;
|
|
146
163
|
}
|
|
147
164
|
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
|
|
3
3
|
export default class PixSelectList extends Component {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
get categories() {
|
|
5
|
+
const uniqueCategories = new Set(
|
|
6
|
+
...this.args.options.map((option) => option.category).filter(Boolean),
|
|
7
|
+
);
|
|
8
|
+
return Array.from(uniqueCategories.values());
|
|
9
|
+
}
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
categories.push(element.category);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
this.displayCategory = categories.length > 0;
|
|
11
|
+
get displayCategory() {
|
|
12
|
+
return this.categories.length > 0;
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
get isDefaultOptionHidden() {
|
|
18
16
|
return !this.args.isExpanded || this.args.hideDefaultOption;
|
|
19
17
|
}
|
|
18
|
+
|
|
20
19
|
get results() {
|
|
21
20
|
const results = [];
|
|
22
21
|
let options = this.args.options;
|