edvoyui-component-library-test-flight 0.0.145 → 0.0.146
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/dist/library-vue-ts.cjs.js +25 -25
- package/dist/library-vue-ts.css +1 -1
- package/dist/library-vue-ts.es.js +1032 -1031
- package/dist/library-vue-ts.umd.js +26 -26
- package/package.json +1 -1
- package/src/components/select/EUISelect.vue +19 -7
package/package.json
CHANGED
|
@@ -254,7 +254,8 @@ const startCaseText = (x: string) => {
|
|
|
254
254
|
return startCase(x);
|
|
255
255
|
};
|
|
256
256
|
|
|
257
|
-
const selected = ref<any[] | null>(
|
|
257
|
+
const selected = ref<string | string[] | Record<string, any> | Record<string, any>[] | null>(null)
|
|
258
|
+
|
|
258
259
|
const nodropDown = ref(false);
|
|
259
260
|
const props = defineProps({
|
|
260
261
|
clearable: {
|
|
@@ -458,20 +459,31 @@ const clearAll = (e:Event) => {
|
|
|
458
459
|
}
|
|
459
460
|
|
|
460
461
|
const onCheckBoxChange = (item: any, event: Event) => {
|
|
461
|
-
const target = event.target as HTMLInputElement
|
|
462
|
+
const target = event.target as HTMLInputElement;
|
|
462
463
|
|
|
463
464
|
if (!Array.isArray(selected.value)) {
|
|
464
|
-
selected.value = []
|
|
465
|
+
selected.value = [];
|
|
465
466
|
}
|
|
466
467
|
|
|
468
|
+
const current = selected.value as any[];
|
|
469
|
+
|
|
467
470
|
if (target.checked) {
|
|
468
|
-
|
|
469
|
-
|
|
471
|
+
const exists = current.some((s) => {
|
|
472
|
+
if (typeof s === 'string') return s === item[fieldName.value];
|
|
473
|
+
return s?.[fieldName.value] === item[fieldName.value];
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
if (!exists) {
|
|
477
|
+
current.push(item);
|
|
470
478
|
}
|
|
471
479
|
} else {
|
|
472
|
-
selected.value =
|
|
480
|
+
selected.value = current.filter((s) => {
|
|
481
|
+
if (typeof s === 'string') return s !== item[fieldName.value];
|
|
482
|
+
return s?.[fieldName.value] !== item[fieldName.value];
|
|
483
|
+
});
|
|
473
484
|
}
|
|
474
|
-
}
|
|
485
|
+
};
|
|
486
|
+
|
|
475
487
|
|
|
476
488
|
const selectAll = (e: Event) => {
|
|
477
489
|
if (e.target) {
|