@hostlink/nuxt-light 1.52.3 → 1.52.4
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/module.json
CHANGED
|
@@ -399,6 +399,9 @@ const onDelete = async (id) => {
|
|
|
399
399
|
};
|
|
400
400
|
const attrs = computed(() => {
|
|
401
401
|
const a = { ...light.styles.table, ...Object.fromEntries(Object.entries(props).filter(([key, value]) => value !== void 0)) };
|
|
402
|
+
if (props.name) {
|
|
403
|
+
a.visibleColumns = visibleColumns.value;
|
|
404
|
+
}
|
|
402
405
|
return {
|
|
403
406
|
...a,
|
|
404
407
|
loadingLabel: t(props.loadingLabel),
|
|
@@ -491,7 +494,21 @@ const showTopRight = computed(() => {
|
|
|
491
494
|
const hidableColumns = computed(() => {
|
|
492
495
|
return props.columns?.filter((c) => !c.required) || [];
|
|
493
496
|
});
|
|
494
|
-
const visibleColumns =
|
|
497
|
+
const visibleColumns = computed({
|
|
498
|
+
get() {
|
|
499
|
+
if (props.name) {
|
|
500
|
+
return useStorage("l-table-visible-columns-" + simpleRouteName.value + "-" + props.name, hidableColumns.value.map((c) => c.name)).value;
|
|
501
|
+
} else {
|
|
502
|
+
return null;
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
set(value) {
|
|
506
|
+
if (props.name) {
|
|
507
|
+
const storage = useStorage("l-table-visible-columns-" + simpleRouteName.value + "-" + props.name, hidableColumns.value.map((c) => c.name));
|
|
508
|
+
storage.value = value;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
});
|
|
495
512
|
watch(filters, () => {
|
|
496
513
|
onFilters();
|
|
497
514
|
}, { deep: true });
|
|
@@ -504,13 +521,12 @@ const hasFilters = computed(() => {
|
|
|
504
521
|
|
|
505
522
|
<template>
|
|
506
523
|
<q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="onLocalRequest" :columns="columns"
|
|
507
|
-
v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected"
|
|
508
|
-
:visible-columns="visibleColumns">
|
|
524
|
+
v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
|
|
509
525
|
<template #header="props">
|
|
510
526
|
<q-tr :props="props">
|
|
511
|
-
<q-
|
|
512
|
-
<q-checkbox v-model="props.selected" />
|
|
513
|
-
</q-
|
|
527
|
+
<q-th v-if="selection != 'none'" auto-width>
|
|
528
|
+
<q-checkbox v-model="props.selected" :dense="table?.dense" />
|
|
529
|
+
</q-th>
|
|
514
530
|
<q-th v-if="hasRowExpand" auto-width></q-th>
|
|
515
531
|
<q-th v-if="hasActions" auto-width></q-th>
|
|
516
532
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">{{ col.label }}</q-th>
|
|
@@ -535,7 +551,7 @@ const hasFilters = computed(() => {
|
|
|
535
551
|
<template #body="props">
|
|
536
552
|
<q-tr :props="props">
|
|
537
553
|
<q-td v-if="selection != 'none'" auto-width>
|
|
538
|
-
<q-checkbox v-model="props.selected" />
|
|
554
|
+
<q-checkbox v-model="props.selected" :dense="table?.dense" />
|
|
539
555
|
</q-td>
|
|
540
556
|
<q-td v-if="hasRowExpand" auto-width>
|
|
541
557
|
<q-btn flat round size="sm" :icon="props.expand ? 'sym_o_expand_more' : 'sym_o_expand_less'"
|