diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 6cf04f2d9..63a6feab0 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -34,7 +34,7 @@ import VnTableFilter from './VnTableFilter.vue'; import { getColAlign } from 'src/composables/getColAlign'; import RightMenu from '../common/RightMenu.vue'; import VnScroll from '../common/VnScroll.vue'; -import VnMultiCheck from '../common/VnMultiCheck.vue'; +import VnCheckboxMenu from '../common/VnCheckboxMenu.vue'; const arrayData = useArrayData(useAttrs()['data-key']); const $props = defineProps({ @@ -649,23 +649,15 @@ const rowCtrlClickFunction = computed(() => { }; return () => {}; }); -const handleMultiCheck = (value) => { - if (value) { - const fn = $props.selectionFn; - const rows = tableRef.value.rows; - selected.value = fn ? fn(rows) : rows; - } else { - selected.value = []; - } - emit('update:selected', selected.value); -}; - -const handleSelectedAll = (data) => { - if (data) { +const handleHeaderSelection = (evt, data) => { + if (evt === 'selected' && data) { + selected.value = tableRef.value.rows; + } else if (evt === 'selectAll') { selected.value = data; } else { selected.value = []; } + emit('update:selected', selected.value); }; @@ -739,14 +731,14 @@ const handleSelectedAll = (data) => { :data-cy > - + @update:selected="handleHeaderSelection('selected', $event)" + @select:all="handleHeaderSelection('selectAll', $event)" + /> diff --git a/src/components/common/VnCheckboxMenu.vue b/src/components/common/VnCheckboxMenu.vue new file mode 100644 index 000000000..bfb5b4441 --- /dev/null +++ b/src/components/common/VnCheckboxMenu.vue @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +en: + tooManyResults: Too many results. Please narrow down your search. + records: '{rows} records' +es: + Select all: Seleccionar todo + tooManyResults: Demasiados registros. Restringe la búsqueda. + records: '{rows} registros' + diff --git a/src/components/common/VnMultiCheck.vue b/src/components/common/VnMultiCheck.vue deleted file mode 100644 index 19b93ffa9..000000000 --- a/src/components/common/VnMultiCheck.vue +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - {{ t('Select all', { rows: rows.length }) }} - - - - - - - - -en: - Select all: 'Select all ({rows})' -fr: - Select all: 'Sélectionner tout ({rows})' -es: - Select all: 'Seleccionar todo ({rows})' -de: - Select all: 'Alle auswählen ({rows})' -it: - Select all: 'Seleziona tutto ({rows})' -pt: - Select all: 'Selecionar tudo ({rows})' - diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 9f95d639c..a071b9928 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -19,7 +19,7 @@ export function useArrayData(key, userOptions) { let canceller = null; onMounted(() => { - setOptions(); + setOptions(userOptions ?? {}); reset(['skip']); const query = route.query; @@ -39,9 +39,10 @@ export function useArrayData(key, userOptions) { setCurrentFilter(); }); - if (key && userOptions) setOptions(); + if (userOptions) setOptions(userOptions); - function setOptions(params = userOptions) { + function setOptions(params) { + if (!params) return; const allowedOptions = [ 'url', 'filter', diff --git a/src/pages/Customer/Notifications/CustomerNotifications.vue b/src/pages/Customer/Notifications/CustomerNotifications.vue index 02792182c..84babe24d 100644 --- a/src/pages/Customer/Notifications/CustomerNotifications.vue +++ b/src/pages/Customer/Notifications/CustomerNotifications.vue @@ -89,7 +89,6 @@ const columns = computed(() => [ diff --git a/src/pages/Customer/Notifications/CustomerNotificationsCampaignConsumption.vue b/src/pages/Customer/Notifications/CustomerNotificationsCampaignConsumption.vue index 141a02bfc..36157082b 100644 --- a/src/pages/Customer/Notifications/CustomerNotificationsCampaignConsumption.vue +++ b/src/pages/Customer/Notifications/CustomerNotificationsCampaignConsumption.vue @@ -142,13 +142,13 @@ onMounted(async () => { valentinesDay: Valentine's Day mothersDay: Mother's Day allSaints: All Saints' Day - Campaign consumption: Campaign consumption ({rows}) + Campaign consumption: Campaign consumption - {rows} records es: params: valentinesDay: Día de San Valentín mothersDay: Día de la Madre allSaints: Día de Todos los Santos - Campaign consumption: Consumo campaña ({rows}) + Campaign consumption: Consumo campaña - {rows} registros Campaign: Campaña From: Desde To: Hasta diff --git a/src/pages/Customer/components/CustomerFileManagementActions.vue b/src/pages/Customer/components/CustomerFileManagementActions.vue index 683f062ff..1fcafdccd 100644 --- a/src/pages/Customer/components/CustomerFileManagementActions.vue +++ b/src/pages/Customer/components/CustomerFileManagementActions.vue @@ -1,9 +1,9 @@