feature/tipo-operacion-invoice
This commit is contained in:
@@ -82,7 +82,11 @@
|
||||
let loadingTrigger = $state<HTMLDivElement>();
|
||||
|
||||
// Intersection Observer para detectar cuando el usuario llega al final
|
||||
onMount(() => {
|
||||
$effect(() => {
|
||||
const target = loadingTrigger;
|
||||
const root = scrollContainer;
|
||||
if (!target) return;
|
||||
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
const [entry] = entries;
|
||||
@@ -91,14 +95,12 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
root: scrollContainer,
|
||||
root: root,
|
||||
threshold: 0.1
|
||||
}
|
||||
);
|
||||
|
||||
if (loadingTrigger) {
|
||||
observer.observe(loadingTrigger);
|
||||
}
|
||||
observer.observe(target);
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
|
||||
@@ -152,56 +152,26 @@
|
||||
<!-- Datos Principales en una fila compacta (reusable across tabs) -->
|
||||
<div class="flex flex-wrap items-end gap-3 pb-3">
|
||||
{#if !isSettings}
|
||||
<!-- Campos no manipulables pero visibles -->
|
||||
<div class="min-w-[100px] flex-1 space-y-1">
|
||||
<Label for="operation_type" class="text-xs"
|
||||
>{m.invoice_edit_form_operation_type_label()}<span class="text-red-500">*</span></Label
|
||||
<Label class="text-xs text-muted-foreground"
|
||||
>{m.invoice_edit_form_operation_type_label()}</Label
|
||||
>
|
||||
<Select.Root
|
||||
type="single"
|
||||
value={formData.operation_type || ''}
|
||||
onValueChange={(v) => {
|
||||
formData.operation_type = v;
|
||||
}}
|
||||
>
|
||||
<Select.Trigger id="operation_type" class="h-8 text-sm">
|
||||
<span class="truncate">
|
||||
{formData.operation_type
|
||||
? (formData.operation_type === 'exp'
|
||||
? m.invoice_edit_form_operation_type_export()
|
||||
: m.invoice_edit_form_operation_type_import())
|
||||
: '...'}
|
||||
</span>
|
||||
</Select.Trigger>
|
||||
<Select.Content>
|
||||
<Select.Item value="exp">{m.invoice_edit_form_operation_type_export()}</Select.Item>
|
||||
<Select.Item value="imp">{m.invoice_edit_form_operation_type_import()}</Select.Item>
|
||||
</Select.Content>
|
||||
</Select.Root>
|
||||
<p class="h-8 text-sm font-medium flex items-center">
|
||||
{formData.operation_type
|
||||
? (formData.operation_type === 'exp'
|
||||
? m.invoice_edit_form_operation_type_export()
|
||||
: m.invoice_edit_form_operation_type_import())
|
||||
: '...'}
|
||||
</p>
|
||||
</div>
|
||||
<div class="min-w-[100px] flex-1 space-y-1">
|
||||
<Label for="operation_type" class="text-xs"
|
||||
>{m.invoice_edit_form_invoice_type_label()} <span class="text-red-500">*</span></Label
|
||||
<Label class="text-xs text-muted-foreground"
|
||||
>{m.invoice_edit_form_invoice_type_label()}</Label
|
||||
>
|
||||
<Select.Root
|
||||
type="single"
|
||||
value={formData.invoice_type || ''}
|
||||
onValueChange={(v) => {
|
||||
formData.invoice_type = v ?? '';
|
||||
}}
|
||||
>
|
||||
<Select.Trigger id="invoice_type" class="h-7 text-xs">
|
||||
<span class="truncate">
|
||||
{formData.invoice_type ? `${formData.invoice_type}` : '...'}
|
||||
</span>
|
||||
</Select.Trigger>
|
||||
<Select.Content class="max-h-[300px]">
|
||||
{#each filteredInvoiceTypes as type}
|
||||
<Select.Item value={type.key}>
|
||||
{type.key} - {type.description}
|
||||
</Select.Item>
|
||||
{/each}
|
||||
</Select.Content>
|
||||
</Select.Root>
|
||||
<p class="h-8 text-sm font-medium flex items-center">
|
||||
{formData.invoice_type ? `${formData.invoice_type}` : '...'}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -443,7 +443,7 @@ export function getSidebarData(): SidebarData {
|
||||
items: [
|
||||
{
|
||||
title: m["sidebar.export_invoices.exportation"](),
|
||||
url: "/dashboard/invoices?operation_type=exp",
|
||||
url: "/dashboard/invoices?operation_type=exp&invoice_type=EXDEF",
|
||||
},
|
||||
{
|
||||
title: m["sidebar.export_invoices.repair"](),
|
||||
|
||||
Reference in New Issue
Block a user