Limpieza y correcion de warnings en ultimos cambios
This commit is contained in:
@@ -34,7 +34,7 @@ export function createColumns(onSuccess?: () => void): ColumnDef<Part>[] {
|
||||
// Usamos el componente Checkbox si es posible, pero para snippets crudos en TanStack 5
|
||||
// a veces es más directo un input o un Snippet de Svelte.
|
||||
// Aquí usaremos renderComponent para el Checkbox real.
|
||||
return "";
|
||||
return "<span></span>";
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -162,9 +162,7 @@ export function createColumns(onSuccess?: () => void): ColumnDef<Part>[] {
|
||||
const { um } = getUm();
|
||||
return {
|
||||
render: () =>
|
||||
`<span class="inline-flex items-center rounded-sm bg-blue-50 dark:bg-blue-900 text-blue-700 dark:text-blue-300 px-1.5 py-0.5 text-[10px] font-bold ring-1 ring-inset ring-blue-700/10">
|
||||
${um || '-'}
|
||||
</span>`
|
||||
`<span class="inline-flex items-center rounded-sm bg-blue-50 dark:bg-blue-900 text-blue-700 dark:text-blue-300 px-1.5 py-0.5 text-[10px] font-bold ring-1 ring-inset ring-blue-700/10">${um || '-'}</span>`
|
||||
};
|
||||
});
|
||||
return renderSnippet(umSnippet, { um: row.original.unit_of_measure });
|
||||
@@ -246,7 +244,7 @@ export function createColumns(onSuccess?: () => void): ColumnDef<Part>[] {
|
||||
const { weight, type } = getWeight();
|
||||
return {
|
||||
render: () => {
|
||||
if (weight === null || weight === undefined) return '-';
|
||||
if (weight === null || weight === undefined) return '<span>-</span>';
|
||||
return `<div class="text-xs font-mono">${Number(weight).toFixed(4)} ${type || ''}</div>`;
|
||||
}
|
||||
};
|
||||
@@ -281,7 +279,7 @@ export function createColumns(onSuccess?: () => void): ColumnDef<Part>[] {
|
||||
cell: ({ row }) => {
|
||||
const dateSnippet = createRawSnippet<[{ date: string }]>((getDate) => {
|
||||
const { date } = getDate();
|
||||
if (!date) return { render: () => '-' };
|
||||
if (!date) return { render: () => '<span>-</span>' };
|
||||
const formatted = new Date(date).toLocaleDateString('es-MX', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
|
||||
@@ -152,9 +152,7 @@ export function createColumns(
|
||||
const { type, colorClass } = getProps();
|
||||
return {
|
||||
render: () =>
|
||||
`<span class="inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${colorClass}">
|
||||
${type || '-'}
|
||||
</span>`
|
||||
`<span class="inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${colorClass}">${type || '-'}</span>`
|
||||
};
|
||||
});
|
||||
return renderSnippet(typeSnippet, { type: invoiceType, colorClass });
|
||||
|
||||
@@ -53,11 +53,15 @@
|
||||
},
|
||||
onStateChange: (updater: any) => {
|
||||
if (onSortingChange) {
|
||||
const nextSorting = typeof updater === 'function' ? updater(sorting) : updater;
|
||||
if (nextSorting.sorting !== undefined) {
|
||||
onSortingChange(nextSorting.sorting);
|
||||
} else {
|
||||
onSortingChange(nextSorting);
|
||||
const currentState = table.getState();
|
||||
const nextState = typeof updater === 'function' ? updater(currentState) : updater;
|
||||
|
||||
// Identify if this was a sorting update or at least contains sorting
|
||||
if (nextState && nextState.sorting !== undefined) {
|
||||
onSortingChange(nextState.sorting);
|
||||
} else if (Array.isArray(nextState)) {
|
||||
// Fallback for when updater might return just the array slice
|
||||
onSortingChange(nextState);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -64,12 +64,14 @@
|
||||
: null
|
||||
);
|
||||
|
||||
// Ensure descriptions.has_serial has default
|
||||
$effect(() => {
|
||||
if (descriptions && descriptions.has_serial === undefined) {
|
||||
descriptions.has_serial = false;
|
||||
const internalHasSerial = $derived(descriptions?.has_serial === true);
|
||||
function toggleHasSerial() {
|
||||
if (descriptions) {
|
||||
descriptions.has_serial = !descriptions.has_serial;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const hasSerial = $derived(internalHasSerial);
|
||||
|
||||
// Ensure current serie has defaults for form fields
|
||||
$effect(() => {
|
||||
@@ -83,7 +85,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
const hasSerial = $derived(Boolean(descriptions?.has_serial));
|
||||
const invoiceNumber = $derived(invoice?.invoice_number || '');
|
||||
const invoiceLine = $derived(lineItem?.line_number != null ? String(lineItem.line_number) : '');
|
||||
const partNumber = $derived((lineItem as any)?.part_number_display || lineItem?.part_number || '');
|
||||
@@ -137,7 +138,11 @@
|
||||
|
||||
<div class="flex items-center justify-between gap-2 flex-wrap">
|
||||
<div class="flex items-center space-x-1.5">
|
||||
<Checkbox id="has_serial" bind:checked={descriptions.has_serial} />
|
||||
<Checkbox
|
||||
id="has_serial"
|
||||
checked={descriptions?.has_serial === true}
|
||||
onCheckedChange={(v: boolean) => { if (descriptions) descriptions.has_serial = v; }}
|
||||
/>
|
||||
<Label for="has_serial" class="text-xs font-normal">Lleva serie (LLEVASERIE)</Label>
|
||||
</div>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user