pagination-table #33
@@ -10,7 +10,7 @@
|
||||
let isLoading = $state(true)
|
||||
const init = async () => await promise.then(
|
||||
/**
|
||||
* @param {Array<{ workingDays: Number; totalHours: any; overtime: string; period: string; }>} data
|
||||
* @param {Array<{ workingDays: Number; totalHours: any; overtime: string; period: string; homeOfficeDays: Number; }>} data
|
||||
*/
|
||||
data => {
|
||||
records = data.map(row => new PeriodRecord(row))
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
import documentIcon from "@iconify-icons/oi/document.js";
|
||||
import wrenchIcon from "@iconify-icons/oi/wrench.js";
|
||||
import IconifyIcon from "@iconify/svelte";
|
||||
import TablePagination from "$lib/TablePagination.svelte";
|
||||
let { data } = $props();
|
||||
const TITLE = "Bearbeitung Einträge"
|
||||
/** @type {{workingDay: String, workingTime: String, isHomeOffice: Boolean, }[]|null} **/
|
||||
let records = $state([])
|
||||
let records = $state(null)
|
||||
/** @type {{workingDay: String, workingTime: String, isHomeOffice: Boolean, }[]} **/
|
||||
let actual_records = $state([])
|
||||
const init = async () => await data.promise.then(
|
||||
/**
|
||||
* @param {{workingDay: String, workingTime: String, isHomeOffice: Boolean, }[]} data
|
||||
@@ -58,7 +61,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each records as record}
|
||||
{#each actual_records as record}
|
||||
<tr style="{record.isHomeOffice ? 'background: aqua' : ''}">
|
||||
<td>{record.workingDay}</td>
|
||||
<td>{record.workingTime}</td>
|
||||
@@ -71,6 +74,13 @@
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<TablePagination promise_data={records} bind:actual_records={actual_records}/>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
{/if}
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user