refactor: refs #6897 update VnFilter and VnTable components to enhance customization and improve styling
gitea/salix-front/pipeline/pr-dev Build queued... Details

This commit is contained in:
Pablo Natek 2025-02-11 14:34:15 +01:00
parent 5605654bb8
commit b403daff0e
3 changed files with 16 additions and 6 deletions

View File

@ -25,6 +25,10 @@ const $props = defineProps({
type: String, type: String,
default: 'table', default: 'table',
}, },
customClass: {
type: String,
default: '',
},
}); });
defineExpose({ addFilter, props: $props }); defineExpose({ addFilter, props: $props });
@ -55,7 +59,7 @@ const selectComponent = {
component: markRaw(VnSelect), component: markRaw(VnSelect),
event: updateEvent, event: updateEvent,
attrs: { attrs: {
class: 'q-pt-none fit vn-label-padding', class: `q-pt-none fit ${$props.customClass}`,
dense: true, dense: true,
filled: !$props.showTitle, filled: !$props.showTitle,
}, },
@ -159,8 +163,8 @@ const onTabPressed = async () => {
/> />
</div> </div>
</template> </template>
<style lang="scss"> <style lang="scss" scoped>
label.vn-label-padding > .q-field__inner > .q-field__control { label.vn-label-padding > .q-field__inner > .q-field__control {
padding: inherit; padding: inherit !important;
} }
</style> </style>

View File

@ -384,7 +384,7 @@ async function renderInput(rowId, field, clickedElement) {
editingRow.value = rowId; editingRow.value = rowId;
const originalColumn = $props.columns.find((col) => col.name === field); const originalColumn = $props.columns.find((col) => col.name === field);
const column = { ...originalColumn }; const column = { ...originalColumn, ...{ label: '' } };
const row = CrudModelRef.value.formData[rowId]; const row = CrudModelRef.value.formData[rowId];
const oldValue = CrudModelRef.value.formData[rowId][column?.name]; const oldValue = CrudModelRef.value.formData[rowId][column?.name];
@ -626,6 +626,7 @@ const checkbox = ref(null);
v-if="col.visible ?? true" v-if="col.visible ?? true"
class="body-cell" class="body-cell"
:style="col?.width ? `max-width: ${col?.width}` : ''" :style="col?.width ? `max-width: ${col?.width}` : ''"
style="padding: inherit"
> >
<div <div
class="no-padding" class="no-padding"
@ -654,7 +655,7 @@ const checkbox = ref(null);
:data-key="$attrs['data-key']" :data-key="$attrs['data-key']"
v-model="params[columnName(col)]" v-model="params[columnName(col)]"
:search-url="searchUrl" :search-url="searchUrl"
class="full-width" customClass="header-filter"
/> />
</div> </div>
</QTh> </QTh>
@ -1174,4 +1175,8 @@ es:
height: 100%; height: 100%;
display: flex; display: flex;
} }
label.header-filter > .q-field__inner > .q-field__control {
padding: inherit;
}
</style> </style>

View File

@ -218,11 +218,11 @@ const columns = [
{ {
align: 'center', align: 'center',
labelAbbreviation: 'GM', labelAbbreviation: 'GM',
label: t('Grouping selector'),
toolTip: t('Grouping selector'), toolTip: t('Grouping selector'),
name: 'groupingMode', name: 'groupingMode',
component: 'toggle', component: 'toggle',
attrs: { attrs: {
label: '',
'toggle-indeterminate': true, 'toggle-indeterminate': true,
trueValue: 'grouping', trueValue: 'grouping',
falseValue: 'packing', falseValue: 'packing',
@ -595,6 +595,7 @@ onMounted(() => {
ref="entryBuysRef" ref="entryBuysRef"
data-key="EntryBuys" data-key="EntryBuys"
:url="`Entries/${entityId}/getBuyList`" :url="`Entries/${entityId}/getBuyList`"
order="name DESC"
save-url="Buys/crud" save-url="Buys/crud"
:disable-option="{ card: true }" :disable-option="{ card: true }"
v-model:selected="selectedRows" v-model:selected="selectedRows"