@avakhula/ui 0.0.32 → 0.0.33
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/package.json
CHANGED
|
@@ -82,6 +82,9 @@ export default {
|
|
|
82
82
|
isToggle: {
|
|
83
83
|
control: { type: "boolean" },
|
|
84
84
|
},
|
|
85
|
+
alphabetSort: {
|
|
86
|
+
control: { type: "boolean" },
|
|
87
|
+
},
|
|
85
88
|
},
|
|
86
89
|
};
|
|
87
90
|
|
|
@@ -131,7 +134,7 @@ const testData = [
|
|
|
131
134
|
const testData1 = [
|
|
132
135
|
{
|
|
133
136
|
id: "1",
|
|
134
|
-
title: "Education",
|
|
137
|
+
title: "A Education",
|
|
135
138
|
is_category: true,
|
|
136
139
|
initiallyVisible: true,
|
|
137
140
|
visible: true,
|
|
@@ -367,6 +367,10 @@ export default {
|
|
|
367
367
|
type: Boolean,
|
|
368
368
|
default: false,
|
|
369
369
|
},
|
|
370
|
+
alphabetSort: {
|
|
371
|
+
type: Boolean,
|
|
372
|
+
default: false,
|
|
373
|
+
},
|
|
370
374
|
},
|
|
371
375
|
watch: {
|
|
372
376
|
value(value) {
|
|
@@ -577,17 +581,22 @@ export default {
|
|
|
577
581
|
this.$emit("search", { search: this.filterString });
|
|
578
582
|
this.defaultFilter(options);
|
|
579
583
|
},
|
|
580
|
-
setPreparedValues(
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
584
|
+
setPreparedValues(opt) {
|
|
585
|
+
let options = opt || this.options;
|
|
586
|
+
if (this.alphabetSort) {
|
|
587
|
+
options = options.sort((a, b) =>
|
|
588
|
+
a.title.toLowerCase().localeCompare(b.title.toLowerCase())
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return this.prepare(options).then(([options, selected]) => {
|
|
593
|
+
this.actualOptions = options;
|
|
594
|
+
this.allOptionsIsChecked = this.checkIfOptionsChecked(options);
|
|
595
|
+
this.countVisibleChildren = options.length;
|
|
596
|
+
this.isInitialized = true;
|
|
597
|
+
this.selected = selected;
|
|
598
|
+
this.setBookmarkedOptions(options);
|
|
599
|
+
});
|
|
591
600
|
},
|
|
592
601
|
clear() {
|
|
593
602
|
this.actualOptions = [];
|