@starasia/admin 12.41.1 → 13.0.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/dist/components/AppLayout/index.d.ts +3 -2
- package/dist/components/RightDrawer/index.d.ts +69 -3
- package/dist/components/TableSection/components/TableSection.d.ts +11 -0
- package/dist/components/TableSection/index.d.ts +11 -0
- package/dist/components/TableSection/types.d.ts +3 -0
- package/dist/entries/App/sidebar.d.ts +7 -6
- package/dist/index.cjs.js +18 -18
- package/dist/index.es.js +3666 -3674
- package/dist/index.umd.js +16 -16
- package/dist/style.css +1 -1
- package/package.json +19 -19
|
@@ -47,13 +47,14 @@ interface AppLayoutProps {
|
|
|
47
47
|
/**
|
|
48
48
|
* Optional: array tombol di profile menu body. Caller bisa tambah
|
|
49
49
|
* berapapun item terstruktur (Settings, Bahasa, Tema, dll). Tiap item
|
|
50
|
-
* dirender sebagai `<
|
|
50
|
+
* dirender sebagai `<MenuItem>` dari `@starasia/menu` — hover, spacing,
|
|
51
|
+
* dan auto-close saat dipilih mengikuti komponen menu DS.
|
|
51
52
|
*/
|
|
52
53
|
profileMenuButtons?: ProfileMenuButton[];
|
|
53
54
|
/**
|
|
54
55
|
* Optional: slot kustom tambahan di profile menu body (setelah
|
|
55
56
|
* `profileMenuButtons`). Pakai untuk konten non-button atau item dengan
|
|
56
|
-
* style/struktur custom. Caller compose `<
|
|
57
|
+
* style/struktur custom. Caller compose `<MenuItem>` sendiri.
|
|
57
58
|
*/
|
|
58
59
|
profileMenuItems?: ReactNode;
|
|
59
60
|
/**
|
|
@@ -12,16 +12,82 @@ export interface RightDrawerProps {
|
|
|
12
12
|
style?: CSSProperties;
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
closeButton?: CloseButton | null | false;
|
|
15
|
+
/**
|
|
16
|
+
* Padding kiri/kanan body panel. Default `true` (`lg`, sama seperti
|
|
17
|
+
* sebelumnya). Set `false` kalau konten mau edge-to-edge horizontal — mis.
|
|
18
|
+
* list/tabel yang punya padding row sendiri. Padding atas/bawah dan header
|
|
19
|
+
* bar tidak terpengaruh.
|
|
20
|
+
*/
|
|
15
21
|
paddingHorizontal?: boolean;
|
|
16
22
|
width?: CSSProperties["width"];
|
|
17
23
|
minWidth?: CSSProperties["minWidth"];
|
|
18
24
|
maxWidth?: CSSProperties["maxWidth"];
|
|
25
|
+
hideBackdrop?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Konten sisi kiri header bar — judul, breadcrumb, atau node apapun.
|
|
28
|
+
* String dibungkus otomatis jadi `<Text>`.
|
|
29
|
+
*/
|
|
30
|
+
title?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Aksi di sisi kanan header bar, dirender sebelum tombol resize & close.
|
|
33
|
+
* Mis. tombol Favorite / Ask AI / navigasi prev-next.
|
|
34
|
+
*/
|
|
35
|
+
headerAction?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Matikan header bar sepenuhnya (tanpa border & tanpa tombol close).
|
|
38
|
+
* Default `true`.
|
|
39
|
+
*/
|
|
40
|
+
header?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Preset lebar yang bisa diputar lewat tombol di header. Isi minimal 2
|
|
43
|
+
* nilai untuk mengaktifkannya — tombolnya muncul di sisi kanan header,
|
|
44
|
+
* sebelum tombol close. Preset awal diambil dari `width` kalau nilainya
|
|
45
|
+
* ada di daftar, kalau tidak dari elemen pertama.
|
|
46
|
+
*
|
|
47
|
+
* Butuh `header` aktif — tombolnya tinggal di header bar.
|
|
48
|
+
*/
|
|
49
|
+
widthPresets?: CSSProperties["width"][];
|
|
50
|
+
/**
|
|
51
|
+
* Drag-to-resize lewat handle di tepi kiri panel. Default `true`.
|
|
52
|
+
* Otomatis mati di mobile (< 768px) — drag di layar sentuh bentrok dengan
|
|
53
|
+
* gestur swipe, dan lebar panel di sana praktis selalu penuh.
|
|
54
|
+
*/
|
|
55
|
+
resizable?: boolean;
|
|
56
|
+
/** Lebar minimum saat di-drag, dalam px. Default `320`. */
|
|
57
|
+
resizeMin?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Lebar maksimum saat di-drag, dalam px. Default lebar viewport
|
|
60
|
+
* (panel tetap di-clamp oleh CSS `max-width` milik Drawer).
|
|
61
|
+
*/
|
|
62
|
+
resizeMax?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Dipanggil saat lebar berubah — setelah drag selesai (bukan tiap frame)
|
|
65
|
+
* dan saat preset berganti. Lebarnya disimpan internal (uncontrolled);
|
|
66
|
+
* pakai callback ini kalau mau persist sendiri, dan beri key per konteks:
|
|
67
|
+
* lebar yang pas untuk drawer filter belum tentu pas untuk drawer detail.
|
|
68
|
+
*/
|
|
69
|
+
onWidthChange?: (width: CSSProperties["width"]) => void;
|
|
19
70
|
}
|
|
20
71
|
/**
|
|
21
|
-
* Lebar panel
|
|
22
|
-
*
|
|
23
|
-
*
|
|
72
|
+
* Lebar panel di-set via prop `size` milik Drawer (bukan inline `style` +
|
|
73
|
+
* helper clamp manual). Drawer's CSS `max-width: calc(100vw - 16px)` yang
|
|
74
|
+
* otomatis meng-clamp ke viewport, jadi tidak perlu `min(...)` lagi.
|
|
24
75
|
* `width`/`minWidth`/`maxWidth` dipertahankan untuk backward-compat call site.
|
|
76
|
+
*
|
|
77
|
+
* Tiga cara mengatur lebar, prioritas dari atas:
|
|
78
|
+
* 1. drag handle → menang selama sesi drawer terbuka
|
|
79
|
+
* 2. `widthPresets` → klik preset menghapus hasil drag
|
|
80
|
+
* 3. `width` / `maxWidth` / `minWidth` → nilai awal
|
|
81
|
+
*
|
|
82
|
+
* `paddingHorizontal` sebelumnya ada di type tapi tidak pernah dipakai —
|
|
83
|
+
* sekarang benar-benar mengontrol padding kiri/kanan body (default `true`,
|
|
84
|
+
* jadi perilaku lama tidak berubah).
|
|
85
|
+
*
|
|
86
|
+
* Header bar tingginya mengikuti `--app-header-height` supaya sejajar dengan
|
|
87
|
+
* header AppLayout. AppLayout mem-publish var itu ke `<html>` justru karena
|
|
88
|
+
* Drawer di-portal ke `document.body` — di luar subtree AppLayout, jadi var
|
|
89
|
+
* yang di-set di root-nya tidak terwarisi. Fallback `44px` dipakai kalau
|
|
90
|
+
* RightDrawer dipakai di luar AppLayout.
|
|
25
91
|
*/
|
|
26
92
|
export declare const RightDrawer: React.ForwardRefExoticComponent<RightDrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
93
|
export {};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { BaseRecord, TableSectionProps } from '../types';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Template tabel + header + footer pagination dalam satu komponen.
|
|
6
|
+
*
|
|
7
|
+
* @deprecated Digantikan oleh `<FilterBar>` + `<TableLayout>` yang memisahkan
|
|
8
|
+
* kontrol filter dari tabel, mendukung row selection, kolom yang bisa
|
|
9
|
+
* di-customize, saved views, dan layout mobile. Panduan migrasi ada di skill
|
|
10
|
+
* `starasia-list-page-pattern`.
|
|
11
|
+
*
|
|
12
|
+
* Masih berfungsi penuh, tapi tidak lagi menerima fitur baru dan akan dihapus
|
|
13
|
+
* di `@starasia/admin@14.0.0`.
|
|
14
|
+
*/
|
|
4
15
|
export declare const TableSection: <T extends BaseRecord>({ wrapperProps, dataTableProps, headerProps, footerProps }: TableSectionProps<T>) => React.JSX.Element;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚠️ Pattern tabel LAMA — deprecated, akan dihapus di `@starasia/admin@14.0.0`.
|
|
3
|
+
*
|
|
4
|
+
* Untuk halaman list baru pakai `<FilterBar>` + `<TableLayout>` (skill
|
|
5
|
+
* `starasia-list-page-pattern`). Sub-komponen di bawah (`TableWrapper`,
|
|
6
|
+
* `TableHeader`, `TableFooter`, `DataTable`, `ColumnFilterDropdown`) adalah
|
|
7
|
+
* bagian dari pattern ini dan ikut dihapus bersamanya.
|
|
8
|
+
*
|
|
9
|
+
* Catatan: `./types` masih dipakai pattern baru (mis. tipe `Pagination` yang
|
|
10
|
+
* di-import `FilterBar`), jadi modul tipe-nya sendiri TIDAK deprecated.
|
|
11
|
+
*/
|
|
1
12
|
export { TableSection } from './components/TableSection';
|
|
2
13
|
export { TableWrapper } from './components/Wrapper';
|
|
3
14
|
export { TableHeader } from './components/Header';
|
|
@@ -117,6 +117,9 @@ export type TableFooterProps = {
|
|
|
117
117
|
showFooter?: boolean;
|
|
118
118
|
totalData?: number;
|
|
119
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* @deprecated Ikut `TableSection`. Pakai props `<FilterBar>` + `<TableLayout>`.
|
|
122
|
+
*/
|
|
120
123
|
export type TableSectionProps<T extends BaseRecord> = {
|
|
121
124
|
headerProps?: TableHeaderProps;
|
|
122
125
|
wrapperProps?: Omit<WrapperProps, 'children'>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { default as React, PropsWithChildren } from 'react';
|
|
2
2
|
|
|
3
|
-
/** Default expanded sidebar width in px (
|
|
4
|
-
export declare const SIDEBAR_DEFAULT_WIDTH =
|
|
3
|
+
/** Default expanded sidebar width in px (15rem). */
|
|
4
|
+
export declare const SIDEBAR_DEFAULT_WIDTH = 240;
|
|
5
5
|
/**
|
|
6
|
-
* Smallest draggable expanded width in px.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Smallest draggable expanded width in px. Sengaja SAMA dengan
|
|
7
|
+
* `SIDEBAR_SNAP_COLLAPSE_THRESHOLD` di AppLayout: menyeret sampai batas ini
|
|
8
|
+
* masih menyisakan sidebar, sedikit lebih sempit dari itu langsung snap ke
|
|
9
|
+
* icon rail — tanpa zona mati di antaranya.
|
|
9
10
|
*/
|
|
10
|
-
export declare const SIDEBAR_MIN_WIDTH =
|
|
11
|
+
export declare const SIDEBAR_MIN_WIDTH = 200;
|
|
11
12
|
/** Largest draggable expanded width in px. */
|
|
12
13
|
export declare const SIDEBAR_MAX_WIDTH = 480;
|
|
13
14
|
export interface SidebarContextValue {
|