@talentlytica/prodigy 1.4.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,62 @@ Semua perubahan penting pada `@talentlytica/prodigy` dicatat di berkas ini.
5
5
  Format mengikuti [Keep a Changelog](https://keepachangelog.com/id/1.1.0/),
6
6
  dan versinya mengikuti [Semantic Versioning](https://semver.org/lang/id/).
7
7
 
8
+ ## [1.6.0] — 2026-11-23
9
+
10
+ ### Ditambahkan
11
+
12
+ - **Teks multi-bahasa (i18n) untuk `DataTable`.** Prop opsional `labels` (tipe `DataTableLabels`,
13
+ diekspor dari `@talentlytica/prodigy/data-table`) mengganti semua teks yang sebelumnya
14
+ tertanam: footer jumlah baris (`rowCount(from, to, total)`, menerima angka mentah),
15
+ `aria-label` tombol urut (`sortBy(header)`), `aria-label` ukuran halaman (`pageSize`),
16
+ placeholder cari (`search`), teks kosong (`empty`), dan label checkbox (`selectRow`,
17
+ `selectAll`). Prioritas: prop langsung (`searchPlaceholder`, `emptyLabel`, `getRowLabel`,
18
+ `selectAllLabel`) → `labels` → `ProdigyLabelsProvider` → default Indonesia.
19
+ - **`DateTimePicker` dan `DateTimeRangePicker`: prop opsional `labels`** (`DateTimeLabels`):
20
+ `locale` (BCP-47, mis. `"id-ID"`) memakai `Intl` untuk nama bulan dan header hari (minggu
21
+ mulai Senin, header hari tidak dipotong), dan `time` mengganti label "Jam" (hanya ada di
22
+ `DateTimePicker`); `start` dan `end` mengganti "Mulai" dan "Selesai" (hanya `DateTimeRangePicker`).
23
+ Tanpa `locale`, nama Inggris lama tetap dipakai.
24
+ - **`ProdigyLabelsProvider`** (barrel utama): memasang default `labels` `DataTable` dan
25
+ `DateTimeLabels` sekali di akar aplikasi, supaya tidak perlu dikirim per komponen.
26
+
27
+ Semua prop baru bersifat **opsional** dan **tidak ada default yang berubah**: aplikasi yang
28
+ tidak mengirim `labels` dan tidak memasang provider melihat tampilan, `aria-label`, dan teks
29
+ yang identik dengan 1.5.0.
30
+
31
+ ## [1.5.0] — 2026-08-11
32
+
33
+ ### Diubah
34
+
35
+ - **BREAKING (visual): skala `fontSizes` kembali ke bawaan Mantine.** Sampai v1.4.1 skala
36
+ teks non-heading digeser satu tingkat ke bawah dari Mantine:
37
+
38
+ | Token | v1.4.1 | v1.5.0 |
39
+ |---|---|---|
40
+ | `xs` | 10px | **12px** |
41
+ | `sm` | 12px | **14px** |
42
+ | `md` (default `Text`) | 14px | **16px** |
43
+ | `lg` | 16px | **18px** |
44
+ | `xl` | 18px | **20px** |
45
+
46
+ Karena `sm` adalah ukuran yang dipakai di mana-mana pada aplikasi konsumen, pergeseran
47
+ itu menyebar ke seluruh UI: di Integro ~93% teks (618 pemakaian `sm` + 375 `xs`) berakhir
48
+ di 12px atau 10px, dan QA melaporkan teks terasa kecil **di semua halaman**. Gejalanya
49
+ sempat ditambal setempat di sisi aplikasi — tab navbar Integro dinaikkan manual ke `lg`
50
+ supaya tidak jauh lebih kecil dari navbar lama — yang justru menunjukkan masalahnya ada
51
+ di token, bukan di pemakaian.
52
+
53
+ **Tidak ada API yang berubah**, tapi SETIAP teks yang memakai token ikut naik ~2px, jadi
54
+ ini perlu QA visual di aplikasi konsumen sebelum diadopsi. Yang paling rawan: tabel padat
55
+ dengan `minWidth` yang dipatok, sidebar berlebar tetap, badge, dan tombol berteks panjang.
56
+
57
+ `Title`/heading **TIDAK** terpengaruh — `headings` tidak menetapkan ukuran per-level.
58
+ `lineHeights` juga tidak diubah karena berupa rasio, sehingga tinggi baris ikut
59
+ proporsional dengan sendirinya.
60
+
61
+ Tambalan font-size manual di aplikasi konsumen sebaiknya ditinjau ulang setelah bump —
62
+ sebagiannya kemungkinan sudah tidak perlu, atau justru jadi kebesaran.
63
+
8
64
  ## [1.4.1] — 2026-08-10
9
65
 
10
66
  ### Diperbaiki
@@ -1,6 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type ColumnDef, type PaginationState, type RowData, type SortingState } from '@tanstack/react-table';
3
3
  import { type TableProps } from '../Table/Table';
4
+ import type { DataTableLabels } from './labels';
5
+ export type { DataTableLabels } from './labels';
4
6
  declare module '@tanstack/react-table' {
5
7
  interface ColumnMeta<TData extends RowData, TValue> {
6
8
  /** Lebar CSS kolom (boleh persentase, mis. "12%", atau unit lain) diterapkan ke `<Table.Th>`. */
@@ -58,6 +60,13 @@ export interface DataTableProps<T> {
58
60
  getRowLabel?: (row: T) => string;
59
61
  /** Nama aksesibel checkbox pilih-semua di header. Default `"Pilih semua baris di halaman ini"`. */
60
62
  selectAllLabel?: string;
63
+ /**
64
+ * Teks tertanam yang bisa diganti (i18n): footer jumlah baris, aria-label urut/ukuran halaman,
65
+ * placeholder cari, teks kosong, dan label checkbox. Semua opsional; default = teks Indonesia.
66
+ * Prioritas: prop langsung (`searchPlaceholder`, `emptyLabel`, `getRowLabel`, `selectAllLabel`) →
67
+ * `labels` → `ProdigyLabelsProvider` → default.
68
+ */
69
+ labels?: DataTableLabels;
61
70
  /** Sedang memuat — merender baris skeleton, BUKAN mengosongkan tabel. */
62
71
  loading?: boolean;
63
72
  /** Pesan galat; menggantikan isi tabel. App yang menyediakan tombol coba lagi. */
@@ -77,4 +86,4 @@ export interface DataTableProps<T> {
77
86
  * proyek ini di v9 — lihat design-system.md §5). Tampilan tetap `Table` Prodigy, jadi
78
87
  * styling ikut tema Kelola secara otomatis.
79
88
  */
80
- export declare function DataTable<T>({ data, columns, searchPlaceholder, withSearch, pageSize, emptyLabel, pagination, onPaginationChange, sorting, onSortingChange, globalFilter, onGlobalFilterChange, manualPagination, manualSorting, manualFiltering, rowCount, pageSizeOptions, withRowCount, getRowId, enableRowSelection, rowSelection, onRowSelectionChange, getRowLabel, selectAllLabel, loading, error, toolbar, minWidth, tableProps, }: DataTableProps<T>): import("react").JSX.Element;
89
+ export declare function DataTable<T>({ data, columns, searchPlaceholder, withSearch, pageSize, emptyLabel, pagination, onPaginationChange, sorting, onSortingChange, globalFilter, onGlobalFilterChange, manualPagination, manualSorting, manualFiltering, rowCount, pageSizeOptions, withRowCount, getRowId, enableRowSelection, rowSelection, onRowSelectionChange, getRowLabel, selectAllLabel, labels, loading, error, toolbar, minWidth, tableProps, }: DataTableProps<T>): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Teks tertanam `DataTable` yang bisa diganti (i18n). Semua opsional; default = teks Indonesia 1.5.0. */
3
+ export interface DataTableLabels {
4
+ /** Teks footer jumlah baris. Menerima angka mentah (tanpa format). Default: `(f, t, total) => \`Tampilkan ${f} ke ${t} dari ${total.toLocaleString('en-US')} entri\`` */
5
+ rowCount?: (from: number, to: number, total: number) => ReactNode;
6
+ /** aria-label tombol urut. `header` = teks header kolom, atau `column.id` bila header bukan string. Default: `(header) => \`Urutkan ${header}\`` */
7
+ sortBy?: (header: string) => string;
8
+ /** aria-label select ukuran halaman. Default: "Baris per halaman" */
9
+ pageSize?: string;
10
+ /** Placeholder kotak cari bila `searchPlaceholder` tidak diisi. Default: "Cari..." */
11
+ search?: string;
12
+ /** Teks kosong bila `emptyLabel` tidak diisi. Default: "Belum ada data" */
13
+ empty?: string;
14
+ /** aria-label checkbox baris bila `getRowLabel` tidak diisi. Default: "Pilih baris" */
15
+ selectRow?: string;
16
+ /** aria-label checkbox header bila `selectAllLabel` tidak diisi. Default: "Pilih semua baris di halaman ini" */
17
+ selectAll?: string;
18
+ }
@@ -1,3 +1,4 @@
1
+ import { type DateTimeLabels } from '../_shared/calendarLabels';
1
2
  export interface DateTimePickerProps {
2
3
  /** Controlled/initial value */
3
4
  value?: Date | null;
@@ -5,5 +6,7 @@ export interface DateTimePickerProps {
5
6
  onChange?: (value: Date | null) => void;
6
7
  /** Placeholder shown in the trigger when empty */
7
8
  placeholder?: string;
9
+ /** Teks i18n: `locale` (nama bulan/hari via Intl) dan `time` (label jam). Default: perilaku lama. Menang atas `ProdigyLabelsProvider`. */
10
+ labels?: DateTimeLabels;
8
11
  }
9
- export declare function DateTimePicker({ value, onChange, placeholder }: DateTimePickerProps): import("react").JSX.Element;
12
+ export declare function DateTimePicker({ value, onChange, placeholder, labels }: DateTimePickerProps): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { type DateTimeLabels } from '../_shared/calendarLabels';
1
2
  export type DateTimeRangeValue = [Date | null, Date | null];
2
3
  export interface DateTimeRangePickerProps {
3
4
  /** Controlled/initial value as [start, end] */
@@ -6,5 +7,7 @@ export interface DateTimeRangePickerProps {
6
7
  onChange?: (value: DateTimeRangeValue) => void;
7
8
  /** Placeholder shown in the trigger when empty */
8
9
  placeholder?: string;
10
+ /** Teks i18n: `locale` (nama bulan/hari via Intl), `start` dan `end` (label waktu). Default: perilaku lama. Menang atas `ProdigyLabelsProvider`. */
11
+ labels?: DateTimeLabels;
9
12
  }
10
- export declare function DateTimeRangePicker({ value, onChange, placeholder }: DateTimeRangePickerProps): import("react").JSX.Element;
13
+ export declare function DateTimeRangePicker({ value, onChange, placeholder, labels }: DateTimeRangePickerProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * ProdigyLabelsProvider — default teks (i18n) untuk komponen Prodigy yang punya teks tertanam.
3
+ * Opsional: tanpa provider, komponen memakai default Indonesia seperti sebelumnya.
4
+ * Prioritas di komponen: prop langsung → prop `labels` → provider ini → default.
5
+ * Contoh: `<ProdigyLabelsProvider dataTable={{ search: 'Search...' }} dateTime={{ locale: 'en-US', time: 'Hour' }}>`
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ import type { DataTableLabels } from '../DataTable/labels';
9
+ import type { DateTimeLabels } from '../_shared/calendarLabels';
10
+ export interface ProdigyLabelsProviderProps {
11
+ /** Default `labels` untuk semua `DataTable` di bawah provider ini. */
12
+ dataTable?: DataTableLabels;
13
+ /** Default `labels` untuk `DateTimePicker` dan `DateTimeRangePicker` di bawah provider ini. */
14
+ dateTime?: DateTimeLabels;
15
+ children?: ReactNode;
16
+ }
17
+ export declare function ProdigyLabelsProvider({ dataTable, dateTime, children }: ProdigyLabelsProviderProps): import("react").JSX.Element;
18
+ /** Internal — label DataTable dari provider (objek kosong bila tanpa provider). */
19
+ export declare function useDataTableLabels(): DataTableLabels | undefined;
20
+ /** Internal — label picker tanggal dari provider. */
21
+ export declare function useDateTimeLabels(): DateTimeLabels | undefined;
@@ -0,0 +1,16 @@
1
+ /** Teks tertanam picker tanggal yang bisa diganti (i18n). */
2
+ export interface DateTimeLabels {
3
+ /** Locale BCP-47 untuk nama bulan & hari, mis. "id-ID". Default: nama Inggris seperti sebelumnya. */
4
+ locale?: string;
5
+ /** Label input jam. Hanya berlaku untuk DateTimePicker (DateTimeRangePicker memakai `start`/`end`). Default: "Jam" */
6
+ time?: string;
7
+ /** Label waktu mulai. Hanya berlaku untuk DateTimeRangePicker. Default: "Mulai" */
8
+ start?: string;
9
+ /** Label waktu selesai. Hanya berlaku untuk DateTimeRangePicker. Default: "Selesai" */
10
+ end?: string;
11
+ }
12
+ export interface CalendarNames {
13
+ months: string[];
14
+ days: string[];
15
+ }
16
+ export declare function getCalendarNames(locale?: string): CalendarNames;
@@ -17,6 +17,8 @@ export { Switch, type SwitchProps } from './Switch/Switch';
17
17
  export { SegmentedControl, type SegmentedControlProps } from './SegmentedControl/SegmentedControl';
18
18
  export { DateTimePicker, type DateTimePickerProps } from './DateTimePicker/DateTimePicker';
19
19
  export { DateTimeRangePicker, type DateTimeRangePickerProps } from './DateTimeRangePicker/DateTimeRangePicker';
20
+ export type { DateTimeLabels } from './_shared/calendarLabels';
21
+ export { ProdigyLabelsProvider, type ProdigyLabelsProviderProps } from './ProdigyLabels/ProdigyLabelsProvider';
20
22
  export { Anchor, type AnchorProps } from './Anchor/Anchor';
21
23
  export { Breadcrumbs, type BreadcrumbsProps } from './Breadcrumbs/Breadcrumbs';
22
24
  export { NavLink, type NavLinkProps } from './NavLink/NavLink';
@@ -1 +1,2 @@
1
1
  export { DataTable, type DataTableProps } from './components/DataTable/DataTable';
2
+ export type { DataTableLabels } from './components/DataTable/labels';
@@ -1,38 +1,38 @@
1
- import { _ as e, d as t, g as n, h as r, m as ee, o as i, p as a, u as te, v as ne } from "./primitives-cJiG7HAD.js";
1
+ import { _ as e, b as t, d as n, h as r, m as ee, o as i, p as a, u as te, x as ne, y as o } from "./primitives-DYEZHr1L.js";
2
2
  import { UnstyledButton as re } from "@mantine/core";
3
- import { useEffect as o, useMemo as ie, useRef as ae, useState as s } from "react";
3
+ import { useEffect as s, useMemo as ie, useRef as ae, useState as c } from "react";
4
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
5
  import { IconChevronDown as oe, IconChevronUp as se, IconSearch as ce, IconSelector as le } from "@tabler/icons-react";
5
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
- import { flexRender as u, getCoreRowModel as ue, getFilteredRowModel as de, getPaginationRowModel as fe, getSortedRowModel as pe, useReactTable as me } from "@tanstack/react-table";
6
+ import { flexRender as d, getCoreRowModel as ue, getFilteredRowModel as de, getPaginationRowModel as fe, getSortedRowModel as pe, useReactTable as me } from "@tanstack/react-table";
7
7
  //#region src/components/DataTable/DataTable.tsx
8
- var d = (() => {
8
+ var f = (() => {
9
9
  try {
10
10
  return process.env.NODE_ENV !== "production";
11
11
  } catch {
12
12
  return !1;
13
13
  }
14
14
  })();
15
- function f(e, t) {
15
+ function p(e, t) {
16
16
  return typeof e == "function" ? e(t) : e;
17
17
  }
18
- var p = /* @__PURE__ */ new Set();
19
- function m(e, t) {
20
- p.has(e) || (p.add(e), console.warn(t));
18
+ var m = /* @__PURE__ */ new Set();
19
+ function h(e, t) {
20
+ m.has(e) || (m.add(e), console.warn(t));
21
21
  }
22
22
  function he({ table: e }) {
23
- let t = e.options.meta, r = !!t?.selectionDisabled;
24
- return /* @__PURE__ */ c(n, {
23
+ let t = e.options.meta, n = !!t?.selectionDisabled;
24
+ return /* @__PURE__ */ l(o, {
25
25
  "aria-label": t?.selectAllLabel ?? "Pilih semua baris di halaman ini",
26
26
  checked: e.getIsAllPageRowsSelected(),
27
27
  indeterminate: e.getIsSomePageRowsSelected() && !e.getIsAllPageRowsSelected(),
28
28
  onChange: e.getToggleAllPageRowsSelectedHandler(),
29
- disabled: r
29
+ disabled: n
30
30
  });
31
31
  }
32
32
  function ge({ row: e, table: t }) {
33
- let r = t.options.meta;
34
- return /* @__PURE__ */ c(n, {
35
- "aria-label": r?.getRowLabel ? r.getRowLabel(e.original) : "Pilih baris",
33
+ let n = t.options.meta;
34
+ return /* @__PURE__ */ l(o, {
35
+ "aria-label": n?.getRowLabel ? n.getRowLabel(e.original) : n?.selectRowLabel ?? "Pilih baris",
36
36
  checked: e.getIsSelected(),
37
37
  disabled: !e.getCanSelect(),
38
38
  onChange: e.getToggleSelectedHandler()
@@ -42,178 +42,179 @@ function _e(e) {
42
42
  let t = e.column.columnDef.header;
43
43
  return typeof t == "string" ? t : e.column.id;
44
44
  }
45
- function h({ data: n, columns: p, searchPlaceholder: h = "Cari...", withSearch: g = !0, pageSize: _ = 10, emptyLabel: ve = "Belum ada data", pagination: v, onPaginationChange: y, sorting: b, onSortingChange: x, globalFilter: S, onGlobalFilterChange: C, manualPagination: w, manualSorting: T, manualFiltering: E, rowCount: D, pageSizeOptions: O, withRowCount: k, getRowId: A, enableRowSelection: j, rowSelection: M, onRowSelectionChange: N, getRowLabel: ye, selectAllLabel: P, loading: F, error: I, toolbar: L, minWidth: R, tableProps: be }) {
46
- let [xe, Se] = s({
45
+ function g({ data: o, columns: m, searchPlaceholder: g, withSearch: _ = !0, pageSize: v = 10, emptyLabel: ve, pagination: y, onPaginationChange: b, sorting: x, onSortingChange: S, globalFilter: C, onGlobalFilterChange: w, manualPagination: T, manualSorting: E, manualFiltering: D, rowCount: O, pageSizeOptions: k, withRowCount: A, getRowId: j, enableRowSelection: M, rowSelection: N, onRowSelectionChange: P, getRowLabel: ye, selectAllLabel: be, labels: F, loading: I, error: L, toolbar: R, minWidth: z, tableProps: xe }) {
46
+ let B = e(), V = {
47
+ rowCount: F?.rowCount ?? B?.rowCount ?? ((e, t, n) => `Tampilkan ${e} ke ${t} dari ${n.toLocaleString("en-US")} entri`),
48
+ sortBy: F?.sortBy ?? B?.sortBy ?? ((e) => `Urutkan ${e}`),
49
+ pageSize: F?.pageSize ?? B?.pageSize ?? "Baris per halaman",
50
+ search: g ?? F?.search ?? B?.search ?? "Cari...",
51
+ empty: ve ?? F?.empty ?? B?.empty ?? "Belum ada data",
52
+ selectRow: F?.selectRow ?? B?.selectRow,
53
+ selectAll: be ?? F?.selectAll ?? B?.selectAll
54
+ }, [Se, Ce] = c({
47
55
  pageIndex: 0,
48
- pageSize: _
49
- }), [Ce, we] = s([]), [Te, Ee] = s(""), [De, Oe] = s(_);
50
- _ !== De && (Oe(_), d && !v && m("pageSize-changed-while-uncontrolled", "[DataTable] `pageSize` diubah setelah mount, tapi dalam mode tak-terkendali prop ini hanya dibaca sekali saat mount — perubahan ini tidak berpengaruh. Pakai `pageSizeOptions` untuk kontrol UI rows-per-page, atau kendalikan lewat `pagination`/`onPaginationChange` untuk mengubahnya secara programatis."));
51
- let z = v ?? xe, B = b ?? Ce, V = S ?? Te, H = (e) => {
52
- let t = f(e, z);
53
- v || Se((t) => f(e, t)), y?.(t);
54
- }, ke = (e) => {
55
- let t = f(e, B);
56
- b || we((t) => f(e, t)), x?.(t);
57
- }, [Ae, je] = s({}), U = M ?? Ae, Me = (e) => {
58
- let t = f(e, U);
59
- M || je((t) => f(e, t)), N?.(t);
60
- }, W = ie(() => j ? [{
56
+ pageSize: v
57
+ }), [we, Te] = c([]), [Ee, De] = c(""), [Oe, ke] = c(v);
58
+ v !== Oe && (ke(v), f && !y && h("pageSize-changed-while-uncontrolled", "[DataTable] `pageSize` diubah setelah mount, tapi dalam mode tak-terkendali prop ini hanya dibaca sekali saat mount — perubahan ini tidak berpengaruh. Pakai `pageSizeOptions` untuk kontrol UI rows-per-page, atau kendalikan lewat `pagination`/`onPaginationChange` untuk mengubahnya secara programatis."));
59
+ let H = y ?? Se, U = x ?? we, W = C ?? Ee, G = (e) => {
60
+ let t = p(e, H);
61
+ y || Ce((t) => p(e, t)), b?.(t);
62
+ }, Ae = (e) => {
63
+ let t = p(e, U);
64
+ x || Te((t) => p(e, t)), S?.(t);
65
+ }, [je, Me] = c({}), K = N ?? je, Ne = (e) => {
66
+ let t = p(e, K);
67
+ N || Me((t) => p(e, t)), P?.(t);
68
+ }, q = ie(() => M ? [{
61
69
  id: "__pilih",
62
70
  header: he,
63
71
  cell: ge
64
- }, ...p] : p, [p, j]), Ne = typeof j == "function" ? (e) => j(e.original) : j, Pe = (e) => {
65
- let t = f(e, V);
66
- S === void 0 && Ee((t) => f(e, t)), C?.(t ?? "");
72
+ }, ...m] : m, [m, M]), Pe = typeof M == "function" ? (e) => M(e.original) : M, Fe = (e) => {
73
+ let t = p(e, W);
74
+ C === void 0 && De((t) => p(e, t)), w?.(t ?? "");
67
75
  };
68
- o(() => {
69
- d && (v !== void 0 && !y && m("pagination-without-onPaginationChange", "[DataTable] `pagination` diberikan tanpa `onPaginationChange` — kontrol paginasi akan macet permanen (klik tombol halaman tidak akan pernah berpindah)."), b !== void 0 && !x && m("sorting-without-onSortingChange", "[DataTable] `sorting` diberikan tanpa `onSortingChange` — kontrol urutan akan macet permanen (klik header tidak akan pernah mengurutkan)."), S !== void 0 && !C && m("globalFilter-without-onGlobalFilterChange", "[DataTable] `globalFilter` diberikan tanpa `onGlobalFilterChange` — kotak cari akan menelan setiap ketikan tanpa pernah berubah nilainya."), j && !A && m("enableRowSelection-without-getRowId", "[DataTable] `enableRowSelection` diberikan tanpa `getRowId` — TanStack jatuh ke indeks baris sebagai id, jadi seleksi mengikuti POSISI baris, bukan ENTITAS-nya: pindah halaman akan membuat baris yang tampak \"terpilih\" berbeda dari yang sebenarnya dipilih pengguna, dan `onRowSelectionChange` mengirim kunci seperti `{\"0\":true}` yang tidak bisa dipetakan balik ke data. Beri `getRowId` yang stabil."), M !== void 0 && !N && m("rowSelection-without-onRowSelectionChange", "[DataTable] `rowSelection` diberikan tanpa `onRowSelectionChange` — kontrol seleksi akan macet permanen (klik checkbox tidak akan pernah mengubah baris yang terpilih)."), T && !(b !== void 0 && x) && m("manualSorting-without-controlled-sorting", "[DataTable] `manualSorting` diberikan tanpa pasangan `sorting`/`onSortingChange` lengkap — klik header akan mengurutkan state internal yang tidak pernah dipakai (server tidak pernah tahu urutan yang diminta), sehingga kolom tampak bisa diklik tapi tidak benar-benar mengurutkan apa pun."), E && !(S !== void 0 && C) && m("manualFiltering-without-controlled-globalFilter", "[DataTable] `manualFiltering` diberikan tanpa pasangan `globalFilter`/`onGlobalFilterChange` lengkap — kotak cari akan menelan setiap ketikan tanpa pernah berubah nilainya."));
76
+ s(() => {
77
+ f && (y !== void 0 && !b && h("pagination-without-onPaginationChange", "[DataTable] `pagination` diberikan tanpa `onPaginationChange` — kontrol paginasi akan macet permanen (klik tombol halaman tidak akan pernah berpindah)."), x !== void 0 && !S && h("sorting-without-onSortingChange", "[DataTable] `sorting` diberikan tanpa `onSortingChange` — kontrol urutan akan macet permanen (klik header tidak akan pernah mengurutkan)."), C !== void 0 && !w && h("globalFilter-without-onGlobalFilterChange", "[DataTable] `globalFilter` diberikan tanpa `onGlobalFilterChange` — kotak cari akan menelan setiap ketikan tanpa pernah berubah nilainya."), M && !j && h("enableRowSelection-without-getRowId", "[DataTable] `enableRowSelection` diberikan tanpa `getRowId` — TanStack jatuh ke indeks baris sebagai id, jadi seleksi mengikuti POSISI baris, bukan ENTITAS-nya: pindah halaman akan membuat baris yang tampak \"terpilih\" berbeda dari yang sebenarnya dipilih pengguna, dan `onRowSelectionChange` mengirim kunci seperti `{\"0\":true}` yang tidak bisa dipetakan balik ke data. Beri `getRowId` yang stabil."), N !== void 0 && !P && h("rowSelection-without-onRowSelectionChange", "[DataTable] `rowSelection` diberikan tanpa `onRowSelectionChange` — kontrol seleksi akan macet permanen (klik checkbox tidak akan pernah mengubah baris yang terpilih)."), E && !(x !== void 0 && S) && h("manualSorting-without-controlled-sorting", "[DataTable] `manualSorting` diberikan tanpa pasangan `sorting`/`onSortingChange` lengkap — klik header akan mengurutkan state internal yang tidak pernah dipakai (server tidak pernah tahu urutan yang diminta), sehingga kolom tampak bisa diklik tapi tidak benar-benar mengurutkan apa pun."), D && !(C !== void 0 && w) && h("manualFiltering-without-controlled-globalFilter", "[DataTable] `manualFiltering` diberikan tanpa pasangan `globalFilter`/`onGlobalFilterChange` lengkap — kotak cari akan menelan setiap ketikan tanpa pernah berubah nilainya."));
70
78
  }, []);
71
- let G = ae(!1);
72
- o(() => {
73
- if (d) {
74
- if (!G.current) {
75
- G.current = !0;
79
+ let J = ae(!1);
80
+ s(() => {
81
+ if (f) {
82
+ if (!J.current) {
83
+ J.current = !0;
76
84
  return;
77
85
  }
78
- w && D === void 0 && m("manualPagination-without-rowCount", "[DataTable] `manualPagination` diberikan tanpa `rowCount` — jumlah halaman akan salah (dihitung dari data satu halaman) dan navigasi paginasi tidak akan muncul.");
86
+ T && O === void 0 && h("manualPagination-without-rowCount", "[DataTable] `manualPagination` diberikan tanpa `rowCount` — jumlah halaman akan salah (dihitung dari data satu halaman) dan navigasi paginasi tidak akan muncul.");
79
87
  }
80
88
  });
81
- let Fe = {
82
- selectionDisabled: !!(I || F),
89
+ let Ie = {
90
+ selectionDisabled: !!(L || I),
83
91
  getRowLabel: ye,
84
- selectAllLabel: P
85
- }, K = me({
86
- data: n,
87
- columns: W,
88
- getRowId: A,
89
- enableRowSelection: Ne,
92
+ selectRowLabel: V.selectRow,
93
+ selectAllLabel: V.selectAll
94
+ }, Y = me({
95
+ data: o,
96
+ columns: q,
97
+ getRowId: j,
98
+ enableRowSelection: Pe,
90
99
  state: {
91
- pagination: z,
92
- sorting: B,
93
- globalFilter: V,
94
- rowSelection: U
100
+ pagination: H,
101
+ sorting: U,
102
+ globalFilter: W,
103
+ rowSelection: K
95
104
  },
96
- onPaginationChange: H,
97
- onSortingChange: ke,
98
- onGlobalFilterChange: Pe,
99
- onRowSelectionChange: Me,
100
- manualPagination: w,
101
- manualSorting: T,
102
- manualFiltering: E,
103
- rowCount: w ? D : void 0,
105
+ onPaginationChange: G,
106
+ onSortingChange: Ae,
107
+ onGlobalFilterChange: Fe,
108
+ onRowSelectionChange: Ne,
109
+ manualPagination: T,
110
+ manualSorting: E,
111
+ manualFiltering: D,
112
+ rowCount: T ? O : void 0,
104
113
  getCoreRowModel: ue(),
105
- getSortedRowModel: T ? void 0 : pe(),
106
- getFilteredRowModel: E ? void 0 : de(),
107
- getPaginationRowModel: w ? void 0 : fe(),
108
- meta: Fe
109
- }), q = K.getRowModel().rows, J = {
110
- asc: /* @__PURE__ */ c(se, { size: 14 }),
111
- desc: /* @__PURE__ */ c(oe, { size: 14 })
112
- }, Y = w ? D ?? 0 : K.getFilteredRowModel().rows.length, X = Y === 0 || q.length === 0, Z = X ? 0 : z.pageIndex * z.pageSize + 1, Ie = X ? 0 : Math.min(Z + q.length - 1, Y), Q = /* @__PURE__ */ l(a, {
113
- ...be,
114
- children: [/* @__PURE__ */ c(a.Thead, {
114
+ getSortedRowModel: E ? void 0 : pe(),
115
+ getFilteredRowModel: D ? void 0 : de(),
116
+ getPaginationRowModel: T ? void 0 : fe(),
117
+ meta: Ie
118
+ }), X = Y.getRowModel().rows, Le = {
119
+ asc: /* @__PURE__ */ l(se, { size: 14 }),
120
+ desc: /* @__PURE__ */ l(oe, { size: 14 })
121
+ }, Z = T ? O ?? 0 : Y.getFilteredRowModel().rows.length, Q = Z === 0 || X.length === 0, Re = Q ? 0 : H.pageIndex * H.pageSize + 1, ze = Q ? 0 : Math.min(Re + X.length - 1, Z), Be = /* @__PURE__ */ u(a, {
122
+ ...xe,
123
+ children: [/* @__PURE__ */ l(a.Thead, {
115
124
  bg: "neutral.1",
116
- children: K.getHeaderGroups().map((e) => /* @__PURE__ */ c(a.Tr, { children: e.headers.map((e) => {
117
- let t = e.column.columnDef.meta?.width, n = e.column.getCanSort(), r = e.isPlaceholder ? null : u(e.column.columnDef.header, e.getContext());
118
- return /* @__PURE__ */ c(a.Th, {
125
+ children: Y.getHeaderGroups().map((e) => /* @__PURE__ */ l(a.Tr, { children: e.headers.map((e) => {
126
+ let t = e.column.columnDef.meta?.width, n = e.column.getCanSort(), r = e.isPlaceholder ? null : d(e.column.columnDef.header, e.getContext());
127
+ return /* @__PURE__ */ l(a.Th, {
119
128
  style: { width: t },
120
129
  onClick: n ? e.column.getToggleSortingHandler() : void 0,
121
- children: !e.isPlaceholder && n ? /* @__PURE__ */ c(re, {
130
+ children: !e.isPlaceholder && n ? /* @__PURE__ */ l(re, {
122
131
  onClick: (t) => {
123
132
  t.stopPropagation(), e.column.getToggleSortingHandler()?.(t);
124
133
  },
125
- "aria-label": `Urutkan ${_e(e)}`,
134
+ "aria-label": V.sortBy(_e(e)),
126
135
  style: {
127
136
  font: "inherit",
128
137
  cursor: "pointer",
129
138
  width: "100%",
130
139
  textAlign: "left"
131
140
  },
132
- children: /* @__PURE__ */ l(i, {
141
+ children: /* @__PURE__ */ u(i, {
133
142
  gap: 4,
134
143
  wrap: "nowrap",
135
- children: [r, J[e.column.getIsSorted()] ?? /* @__PURE__ */ c(le, {
144
+ children: [r, Le[e.column.getIsSorted()] ?? /* @__PURE__ */ l(le, {
136
145
  size: 14,
137
146
  opacity: .4
138
147
  })]
139
148
  })
140
- }) : /* @__PURE__ */ c(i, {
149
+ }) : /* @__PURE__ */ l(i, {
141
150
  gap: 4,
142
151
  wrap: "nowrap",
143
152
  children: r
144
153
  })
145
154
  }, e.id);
146
155
  }) }, e.id))
147
- }), /* @__PURE__ */ c(a.Tbody, { children: I ? /* @__PURE__ */ c(a.Tr, { children: /* @__PURE__ */ c(a.Td, {
148
- colSpan: W.length,
149
- children: I
150
- }) }) : F ? Array.from({ length: z.pageSize }).map((e, t) => /* @__PURE__ */ c(a.Tr, { children: W.map((e, t) => /* @__PURE__ */ c(a.Td, { children: /* @__PURE__ */ c(ee, {
156
+ }), /* @__PURE__ */ l(a.Tbody, { children: L ? /* @__PURE__ */ l(a.Tr, { children: /* @__PURE__ */ l(a.Td, {
157
+ colSpan: q.length,
158
+ children: L
159
+ }) }) : I ? Array.from({ length: H.pageSize }).map((e, t) => /* @__PURE__ */ l(a.Tr, { children: q.map((e, t) => /* @__PURE__ */ l(a.Td, { children: /* @__PURE__ */ l(ee, {
151
160
  height: 12,
152
161
  radius: "sm"
153
- }) }, e.id ?? t)) }, `skeleton-${t}`)) : q.length === 0 ? /* @__PURE__ */ c(a.Tr, { children: /* @__PURE__ */ c(a.Td, {
154
- colSpan: W.length,
155
- children: /* @__PURE__ */ c(t, {
162
+ }) }, e.id ?? t)) }, `skeleton-${t}`)) : X.length === 0 ? /* @__PURE__ */ l(a.Tr, { children: /* @__PURE__ */ l(a.Td, {
163
+ colSpan: q.length,
164
+ children: /* @__PURE__ */ l(n, {
156
165
  ta: "center",
157
166
  c: "dimmed",
158
167
  py: "md",
159
- children: ve
168
+ children: V.empty
160
169
  })
161
- }) }) : q.map((e) => /* @__PURE__ */ c(a.Tr, { children: e.getVisibleCells().map((e) => /* @__PURE__ */ c(a.Td, { children: u(e.column.columnDef.cell, e.getContext()) }, e.id)) }, e.id)) })]
162
- }), $ = (e) => /* @__PURE__ */ c(ne, {
163
- placeholder: h,
164
- leftSection: /* @__PURE__ */ c(ce, { size: 16 }),
165
- value: K.getState().globalFilter ?? "",
166
- onChange: (e) => K.setGlobalFilter(e.currentTarget.value),
170
+ }) }) : X.map((e) => /* @__PURE__ */ l(a.Tr, { children: e.getVisibleCells().map((e) => /* @__PURE__ */ l(a.Td, { children: d(e.column.columnDef.cell, e.getContext()) }, e.id)) }, e.id)) })]
171
+ }), $ = (e) => /* @__PURE__ */ l(ne, {
172
+ placeholder: V.search,
173
+ leftSection: /* @__PURE__ */ l(ce, { size: 16 }),
174
+ value: Y.getState().globalFilter ?? "",
175
+ onChange: (e) => Y.setGlobalFilter(e.currentTarget.value),
167
176
  ...e === void 0 ? {} : { w: e }
168
177
  });
169
- return /* @__PURE__ */ l(te, {
178
+ return /* @__PURE__ */ u(te, {
170
179
  gap: "sm",
171
180
  children: [
172
- L ? /* @__PURE__ */ l(i, {
181
+ R ? /* @__PURE__ */ u(i, {
173
182
  justify: "space-between",
174
183
  wrap: "wrap",
175
184
  gap: "sm",
176
- children: [/* @__PURE__ */ c(i, {
185
+ children: [/* @__PURE__ */ l(i, {
177
186
  gap: "sm",
178
- children: L
179
- }), g && $(260)]
180
- }) : g && $(),
181
- R ? /* @__PURE__ */ c(a.ScrollContainer, {
182
- minWidth: R,
183
- children: Q
184
- }) : Q,
185
- !I && (O && O.length > 0 || k || K.getPageCount() > 1) && /* @__PURE__ */ l(i, {
187
+ children: R
188
+ }), _ && $(260)]
189
+ }) : _ && $(),
190
+ z ? /* @__PURE__ */ l(a.ScrollContainer, {
191
+ minWidth: z,
192
+ children: Be
193
+ }) : Be,
194
+ !L && (k && k.length > 0 || A || Y.getPageCount() > 1) && /* @__PURE__ */ u(i, {
186
195
  justify: "space-between",
187
196
  wrap: "wrap",
188
- children: [/* @__PURE__ */ l(i, {
197
+ children: [/* @__PURE__ */ u(i, {
189
198
  gap: "sm",
190
- children: [O && O.length > 0 && /* @__PURE__ */ c(e, {
191
- "aria-label": "Baris per halaman",
199
+ children: [k && k.length > 0 && /* @__PURE__ */ l(t, {
200
+ "aria-label": V.pageSize,
192
201
  size: "xs",
193
202
  w: 90,
194
- value: String(z.pageSize),
195
- data: O.map(String),
196
- onChange: (e) => H({
203
+ value: String(H.pageSize),
204
+ data: k.map(String),
205
+ onChange: (e) => G({
197
206
  pageIndex: 0,
198
207
  pageSize: Number(e.currentTarget.value)
199
208
  })
200
- }), k && /* @__PURE__ */ l(t, {
209
+ }), A && /* @__PURE__ */ l(n, {
201
210
  size: "sm",
202
211
  c: "dimmed",
203
- children: [
204
- "Tampilkan ",
205
- Z,
206
- " ke ",
207
- Ie,
208
- " dari ",
209
- Y.toLocaleString("en-US"),
210
- " entri"
211
- ]
212
+ children: V.rowCount(Re, ze, Z)
212
213
  })]
213
- }), K.getPageCount() > 1 && /* @__PURE__ */ c(r, {
214
- total: K.getPageCount(),
215
- value: z.pageIndex + 1,
216
- onChange: (e) => K.setPageIndex(e - 1),
214
+ }), Y.getPageCount() > 1 && /* @__PURE__ */ l(r, {
215
+ total: Y.getPageCount(),
216
+ value: H.pageIndex + 1,
217
+ onChange: (e) => Y.setPageIndex(e - 1),
217
218
  size: "sm"
218
219
  })]
219
220
  })
@@ -221,4 +222,4 @@ function h({ data: n, columns: p, searchPlaceholder: h = "Cari...", withSearch:
221
222
  });
222
223
  }
223
224
  //#endregion
224
- export { h as DataTable };
225
+ export { g as DataTable };