@isi-ui7/bos7-shared 0.2.13 → 0.3.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/crud-types.d.ts +29 -0
- package/dist/{index-CPY3DDQN.js → index-1k-PSj-b.js} +363 -359
- package/dist/{index.es-Dy3lNA6h.js → index.es-zuTIhIvp.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{jspdf.es.min-Ds3Fsl60.js → jspdf.es.min-CnDMxfNp.js} +1 -1
- package/package.json +16 -15
- package/src/crud-components.tsx +52 -9
- package/src/crud-types.ts +26 -0
- package/src/data-table/proxy.ts +11 -2
package/dist/crud-types.d.ts
CHANGED
|
@@ -57,6 +57,16 @@ export type CrudCustomActionSchema = {
|
|
|
57
57
|
* Dipakai untuk aksi operasional seperti employee terminate/reactivate.
|
|
58
58
|
*/
|
|
59
59
|
direct?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Tampilkan textarea alasan di modal konfirmasi dan wajibkan isi non-kosong
|
|
62
|
+
* sebelum tombol confirm aktif. Nilai dikirim sebagai `{ reason }` di body
|
|
63
|
+
* request (digabung ke payload lain bila apiPath sama dipakai untuk field
|
|
64
|
+
* lain). Dipakai untuk aksi yang butuh audit trail eksplisit (mis. Set
|
|
65
|
+
* Non-Aktif produk) — lihat appdefs/{module}/index.def `withReason: true`.
|
|
66
|
+
*/
|
|
67
|
+
reasonRequired?: boolean;
|
|
68
|
+
/** Label di atas textarea alasan. Default "Alasan". */
|
|
69
|
+
reasonLabel?: string;
|
|
60
70
|
};
|
|
61
71
|
export type CrudListSchema = {
|
|
62
72
|
title: string;
|
|
@@ -95,6 +105,25 @@ export type CrudListSchema = {
|
|
|
95
105
|
* or onCustomAction).
|
|
96
106
|
*/
|
|
97
107
|
popupMenuItemsForRow?: (row: Record<string, unknown>) => CrudPopupMenuItem[];
|
|
108
|
+
/**
|
|
109
|
+
* Optional single-select toolbar filter. When an option other than "(all)"
|
|
110
|
+
* is picked, the list request carries `?<param>=<value>`; picking back to
|
|
111
|
+
* "(all)" removes the param. Mirrors `showInactiveToggle`'s additionalParams
|
|
112
|
+
* wiring but for an arbitrary enum column (e.g. `vendor_type`). Additive +
|
|
113
|
+
* backward-compatible: omit it and the toolbar renders exactly as before.
|
|
114
|
+
*/
|
|
115
|
+
filterSelect?: {
|
|
116
|
+
/** Query param name the backend reads (e.g. "vendor_type"). */
|
|
117
|
+
param: string;
|
|
118
|
+
/** Toolbar label for the select. */
|
|
119
|
+
label: string;
|
|
120
|
+
options: Array<{
|
|
121
|
+
value: string;
|
|
122
|
+
label: string;
|
|
123
|
+
}>;
|
|
124
|
+
/** Label for the "no filter" option. Default "Semua". */
|
|
125
|
+
allLabel?: string;
|
|
126
|
+
};
|
|
98
127
|
};
|
|
99
128
|
export type CrudDeleteSchema<TData extends Record<string, unknown>> = {
|
|
100
129
|
/** Omit to use i18n default ("Konfirmasi Hapus"). */
|