From aa9a2856849d8962d65378cad9a90e1006e99c80 Mon Sep 17 00:00:00 2001 From: "aji@catalis.app" Date: Sun, 7 Sep 2025 23:38:20 +0700 Subject: [PATCH] penambahan modul employee --- .../humanresource/employee/+page.svelte | 605 ++++++++++++++++++ yarn.lock | 56 +- 2 files changed, 643 insertions(+), 18 deletions(-) diff --git a/src/routes/backoffice/humanresource/employee/+page.svelte b/src/routes/backoffice/humanresource/employee/+page.svelte index e69de29..07a3037 100644 --- a/src/routes/backoffice/humanresource/employee/+page.svelte +++ b/src/routes/backoffice/humanresource/employee/+page.svelte @@ -0,0 +1,605 @@ + + +
+
+
+

+ 👥 + Employee +

+

Manage your employee data here.

+
+
+ { + const searchTerm = ( + e.target as HTMLInputElement + ).value.toLowerCase(); + fetchEmployee(searchTerm, "created_at", "desc"); + }} + /> + + +
+
+
+ + + + {#each columns as col} + {#if col.key === "guest_name"} + + {:else} + + {/if} + {/each} + + + + {#each allRows as row, i} + + {#each columns as col} + {#if col.key === "no"} + + {:else if col.key === "employee_name"} + + {:else if col.key === "created_at"} + + {:else if col.key === "actions"} + + {:else} + + {/if} + {/each} + + {/each} + +
+ {col.title} + + {col.title} +
+ {offset + i + 1} + + {row[col.key as keyof EmployeeItem]} + + {row[col.key as keyof EmployeeItem] + ? new Date( + row[ + col.key as keyof EmployeeItem + ] as string | number | Date, + ).toLocaleDateString() + : "N/A"} + + + + + {row[col.key as keyof EmployeeItem]} +
+
+ + +
+
+ Showing {(currentPage - 1) * rowsPerPage + 1}– + {Math.min(currentPage * rowsPerPage, totalItems)} of {totalItems} items +
+
+ + {#each pageRange(totalPages, currentPage) as page} + {#if page === "..."} + ... + {:else} + + {/if} + {/each} + +
+
+
+ +{#if showModal} +
+
+

+ {isEditing ? "Edit Employee" : "New Employee"} +

+
+ {#each formColumns as col} +
+ + {#if col.key === "contract_start" || col.key === "end_of_contract" || col.key === "date_of_birth"} + + {:else if col.key === "salary"} + + {:else} + + {/if} + {#if $formErrors[col.key]} +

+ {$formErrors[col.key]} +

+ {/if} +
+ {/each} +
+ + +
+
+
+
+{/if} diff --git a/yarn.lock b/yarn.lock index 61050bf..f939287 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,10 +10,10 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@esbuild/win32-x64@0.25.4": +"@esbuild/linux-x64@0.25.4": version "0.25.4" - resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.4.tgz" - integrity sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ== + resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.4.tgz" + integrity sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA== "@fast-csv/format@4.3.5": version "4.3.5" @@ -144,10 +144,20 @@ estree-walker "^2.0.2" picomatch "^4.0.2" -"@rollup/rollup-win32-x64-msvc@4.41.1": +"@rollup/rollup-linux-x64-gnu@4.41.1": version "4.41.1" - resolved "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.1.tgz" - integrity sha512-Wq2zpapRYLfi4aKxf2Xff0tN+7slj2d4R87WEzqw7ZLsVvO5zwYCIuEGSZYiK41+GlwUo1HiR+GdkLEJnCKTCw== + resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.1.tgz" + integrity sha512-cWBOvayNvA+SyeQMp79BHPK8ws6sHSsYnK5zDcsC3Hsxr1dgTABKjMnMslPq1DvZIp6uO7kIWhiGwaTdR4Og9A== + +"@rollup/rollup-linux-x64-gnu@4.9.5": + version "4.9.5" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.5.tgz" + integrity sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA== + +"@rollup/rollup-linux-x64-musl@4.41.1": + version "4.41.1" + resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.41.1.tgz" + integrity sha512-y5CbN44M+pUCdGDlZFzGGBSKCA4A/J2ZH4edTYSSxFg7ce1Xt3GtydbVKWLlzL+INfFIZAEg1ZV6hh9+QQf9YQ== "@supabase/auth-js@2.69.1": version "2.69.1" @@ -283,10 +293,15 @@ source-map-js "^1.2.1" tailwindcss "4.1.7" -"@tailwindcss/oxide-win32-x64-msvc@4.1.7": +"@tailwindcss/oxide-linux-x64-gnu@4.1.7": version "4.1.7" - resolved "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.7.tgz" - integrity sha512-rYHGmvoHiLJ8hWucSfSOEmdCBIGZIq7SpkPRSqLsH2Ab2YUNgKeAPT1Fi2cx3+hnYOrAb0jp9cRyode3bBW4mQ== + resolved "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.7.tgz" + integrity sha512-HMs+Va+ZR3gC3mLZE00gXxtBo3JoSQxtu9lobbZd+DmfkIxR54NO7Z+UQNPsa0P/ITn1TevtFxXTpsRU7qEvWg== + +"@tailwindcss/oxide-linux-x64-musl@4.1.7": + version "4.1.7" + resolved "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.7.tgz" + integrity sha512-MHZ6jyNlutdHH8rd+YTdr3QbXrHXqwIhHw9e7yXEBcQdluGwhpQY2Eku8UZK6ReLaWtQ4gijIv5QoM5eE+qlsA== "@tailwindcss/oxide@4.1.7": version "4.1.7" @@ -588,9 +603,9 @@ crc32-stream@^4.0.2: readable-stream "^3.4.0" dayjs@^1.8.34: - version "1.11.13" - resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz" - integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg== + version "1.11.18" + resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.11.18.tgz" + integrity sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA== debug@^4.3.7, debug@^4.4.0: version "4.4.1" @@ -854,10 +869,15 @@ lie@~3.3.0: dependencies: immediate "~3.0.5" -lightningcss-win32-x64-msvc@1.30.1: +lightningcss-linux-x64-gnu@1.30.1: version "1.30.1" - resolved "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz" - integrity sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg== + resolved "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz" + integrity sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw== + +lightningcss-linux-x64-musl@1.30.1: + version "1.30.1" + resolved "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz" + integrity sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ== lightningcss@^1.21.0, lightningcss@1.30.1: version "1.30.1" @@ -1358,9 +1378,9 @@ tinyglobby@^0.2.13: picomatch "^4.0.2" tmp@^0.2.0: - version "0.2.4" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz" - integrity sha512-UdiSoX6ypifLmrfQ/XfiawN6hkjSBpCjhKxxZcWlUUmoXLaCKQU0bx4HF/tdDK2uzRuchf1txGvrWBzYREssoQ== + version "0.2.5" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz" + integrity sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow== totalist@^3.0.0: version "3.0.1"