@isi-ui7/bos7-shared 0.3.11 → 0.4.1
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 +50 -0
- package/dist/form-renderer-utils.d.ts +11 -0
- package/dist/{index-C_114Ysm.js → index-DqWPV29B.js} +71 -71
- package/dist/{index.es-B-MluT1E.js → index.es-9cvhYbjn.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{jspdf.es.min-C5VEsLZd.js → jspdf.es.min-CCBzPHw4.js} +2 -2
- package/dist/{jspdf.plugin.autotable-DcntYaes.js → jspdf.plugin.autotable-DFaknRns.js} +19 -22
- package/dist/purify.es-Cm3utOpm.js +560 -0
- package/package.json +9 -9
- package/src/crud-components.tsx +81 -3
- package/src/crud-filter-fields.test.tsx +156 -0
- package/src/crud-types.ts +50 -0
- package/src/date-field-render.test.tsx +83 -0
- package/src/form-renderer-aria-required.test.tsx +101 -0
- package/src/form-renderer-utils.ts +19 -0
- package/src/form-renderer.tsx +28 -3
- package/src/vitest.setup.ts +14 -0
- package/dist/purify.es-CiEWEeUM.js +0 -605
package/dist/crud-types.d.ts
CHANGED
|
@@ -127,6 +127,11 @@ export type CrudListSchema = {
|
|
|
127
127
|
* "(all)" removes the param. Mirrors `showInactiveToggle`'s additionalParams
|
|
128
128
|
* wiring but for an arbitrary enum column (e.g. `vendor_type`). Additive +
|
|
129
129
|
* backward-compatible: omit it and the toolbar renders exactly as before.
|
|
130
|
+
*
|
|
131
|
+
* @deprecated Use `filterFields` (a single `{ type: "select", ... }` entry
|
|
132
|
+
* covers this exact case). Kept working, unchanged, so existing callers
|
|
133
|
+
* never have to move — the two coexist because they write to different
|
|
134
|
+
* query params and share the same additionalParams merge.
|
|
130
135
|
*/
|
|
131
136
|
filterSelect?: {
|
|
132
137
|
/** Query param name the backend reads (e.g. "vendor_type"). */
|
|
@@ -140,6 +145,51 @@ export type CrudListSchema = {
|
|
|
140
145
|
/** Label for the "no filter" option. Default "Semua". */
|
|
141
146
|
allLabel?: string;
|
|
142
147
|
};
|
|
148
|
+
/**
|
|
149
|
+
* Granular toolbar filters: N independent fields, each contributing one
|
|
150
|
+
* query param via the SAME additionalParams merge `filterSelect` and
|
|
151
|
+
* `showInactiveToggle` already use — `@isi-ui7/data-table` is untouched.
|
|
152
|
+
* Additive + backward-compatible: omit it and the toolbar renders exactly
|
|
153
|
+
* as before. Coexists with `filterSelect`/`showInactiveToggle` as long as
|
|
154
|
+
* `param` names don't collide (caller's responsibility, same as today).
|
|
155
|
+
*
|
|
156
|
+
* K-6 (user, 2026-08-26): prototype daftar nasabah wants filtering finer
|
|
157
|
+
* than one search bar + one dropdown. `filterSelect` proved the mechanism
|
|
158
|
+
* for exactly one enum column; this generalizes it to N fields of mixed
|
|
159
|
+
* type instead of duplicating that mechanism per field. The union is
|
|
160
|
+
* closed but extensible — a new variant (e.g. `dateRange`) is additive to
|
|
161
|
+
* this type, not a breaking change to it.
|
|
162
|
+
*
|
|
163
|
+
* ⚠️ This is FRONTEND capacity only. Each `param` still needs the target
|
|
164
|
+
* service's own query endpoint to read it and filter server-side — adding
|
|
165
|
+
* a field here does nothing until the backend honors that param.
|
|
166
|
+
*/
|
|
167
|
+
filterFields?: CrudFilterFieldDef[];
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* One granular toolbar filter field (see `CrudListSchema.filterFields`).
|
|
171
|
+
* Closed union so a new widget type is additive here, not a breaking change
|
|
172
|
+
* to `CrudListSchema` itself.
|
|
173
|
+
*/
|
|
174
|
+
export type CrudFilterFieldDef = {
|
|
175
|
+
type: "select";
|
|
176
|
+
/** Query param name the backend reads. */
|
|
177
|
+
param: string;
|
|
178
|
+
/** Toolbar label for the field. */
|
|
179
|
+
label: string;
|
|
180
|
+
options: Array<{
|
|
181
|
+
value: string;
|
|
182
|
+
label: string;
|
|
183
|
+
}>;
|
|
184
|
+
/** Label for the "no filter" option. Default "Semua". */
|
|
185
|
+
allLabel?: string;
|
|
186
|
+
} | {
|
|
187
|
+
type: "text";
|
|
188
|
+
/** Query param name the backend reads. */
|
|
189
|
+
param: string;
|
|
190
|
+
/** Toolbar label for the field. */
|
|
191
|
+
label: string;
|
|
192
|
+
placeholder?: string;
|
|
143
193
|
};
|
|
144
194
|
export type CrudDeleteSchema<TData extends Record<string, unknown>> = {
|
|
145
195
|
/** Omit to use i18n default ("Konfirmasi Hapus"). */
|
|
@@ -31,4 +31,15 @@ export declare function getLayoutPageCount<TData extends Record<string, unknown>
|
|
|
31
31
|
* sebagai titik waktu, dan di situlah pergeserannya lahir.
|
|
32
32
|
*/
|
|
33
33
|
export declare function toLocalISODate(date: Date | undefined | null): string;
|
|
34
|
+
/**
|
|
35
|
+
* Kebalikan `toLocalISODate` — mem-parse "YYYY-MM-DD" jadi `Date` lokal
|
|
36
|
+
* (bukan `new Date(iso)` yang mem-parse sbg UTC dan bisa menggeser sehari,
|
|
37
|
+
* kelas bug yang sama dgn di atas, arah terbalik).
|
|
38
|
+
*
|
|
39
|
+
* Dipakai supaya prop `value` DatePicker Carbon menerima `Date`, BUKAN
|
|
40
|
+
* string ISO mentah — string ISO yang diberikan ke DatePicker dgn
|
|
41
|
+
* `dateFormat="d-m-Y"` di-parse ULANG flatpickr SEOLAH ia format d-m-Y,
|
|
42
|
+
* menghasilkan tanggal lain sama sekali (laporan DG-00, agent7 2026-08-31).
|
|
43
|
+
*/
|
|
44
|
+
export declare function fromLocalISODate(iso: string | undefined | null): Date | undefined;
|
|
34
45
|
export {};
|
|
@@ -27391,7 +27391,7 @@ function ba(M, L) {
|
|
|
27391
27391
|
return String(pr(M, L));
|
|
27392
27392
|
}
|
|
27393
27393
|
async function Io(M, L, r) {
|
|
27394
|
-
const { default: x } = await import("./jspdf.es.min-
|
|
27394
|
+
const { default: x } = await import("./jspdf.es.min-CCBzPHw4.js").then((o) => o.j), { default: w } = await import("./jspdf.plugin.autotable-DFaknRns.js"), c = new x({ orientation: "landscape" });
|
|
27395
27395
|
c.setFontSize(14), c.text(r, 14, 15), c.setFontSize(10), w(c, {
|
|
27396
27396
|
head: [L.map((o) => o.title)],
|
|
27397
27397
|
body: M.map((o) => L.map((a) => ba(o[a.field], a.displayFormat))),
|
|
@@ -28698,77 +28698,77 @@ async function rl(M, L) {
|
|
|
28698
28698
|
return o.columnTypes = { ...a, ...L.extraColumnTypes }, Dt.NextResponse.json(o, { status: c.status });
|
|
28699
28699
|
}
|
|
28700
28700
|
export {
|
|
28701
|
-
|
|
28702
|
-
|
|
28703
|
-
|
|
28704
|
-
|
|
28705
|
-
|
|
28706
|
-
|
|
28707
|
-
|
|
28708
|
-
|
|
28709
|
-
|
|
28710
|
-
|
|
28711
|
-
|
|
28712
|
-
|
|
28713
|
-
|
|
28714
|
-
|
|
28715
|
-
|
|
28701
|
+
Wi as $,
|
|
28702
|
+
vo as A,
|
|
28703
|
+
Lo as B,
|
|
28704
|
+
Vo as C,
|
|
28705
|
+
wi as D,
|
|
28706
|
+
io as E,
|
|
28707
|
+
Jr as F,
|
|
28708
|
+
Oo as G,
|
|
28709
|
+
Io as H,
|
|
28710
|
+
jo as I,
|
|
28711
|
+
Bo as J,
|
|
28712
|
+
uo as K,
|
|
28713
|
+
ho as L,
|
|
28714
|
+
dr as M,
|
|
28715
|
+
ga as N,
|
|
28716
28716
|
go as O,
|
|
28717
|
-
|
|
28718
|
-
|
|
28719
|
-
|
|
28720
|
-
|
|
28721
|
-
|
|
28722
|
-
|
|
28723
|
-
|
|
28724
|
-
|
|
28725
|
-
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
|
|
28729
|
-
|
|
28730
|
-
|
|
28731
|
-
|
|
28732
|
-
|
|
28733
|
-
|
|
28734
|
-
|
|
28735
|
-
|
|
28736
|
-
|
|
28737
|
-
|
|
28738
|
-
|
|
28739
|
-
|
|
28740
|
-
|
|
28741
|
-
|
|
28742
|
-
|
|
28743
|
-
|
|
28744
|
-
|
|
28745
|
-
|
|
28746
|
-
|
|
28747
|
-
|
|
28748
|
-
|
|
28749
|
-
|
|
28717
|
+
ko as P,
|
|
28718
|
+
qo as Q,
|
|
28719
|
+
xa as R,
|
|
28720
|
+
Sa as S,
|
|
28721
|
+
ao as T,
|
|
28722
|
+
Wo as U,
|
|
28723
|
+
Ko as V,
|
|
28724
|
+
Go as W,
|
|
28725
|
+
Yo as X,
|
|
28726
|
+
Zo as Y,
|
|
28727
|
+
xo as Z,
|
|
28728
|
+
Do as _,
|
|
28729
|
+
Xo as a,
|
|
28730
|
+
_a as a0,
|
|
28731
|
+
Uo as a1,
|
|
28732
|
+
wa as a2,
|
|
28733
|
+
Qa as a3,
|
|
28734
|
+
rl as a4,
|
|
28735
|
+
Po as a5,
|
|
28736
|
+
$i as a6,
|
|
28737
|
+
_o as a7,
|
|
28738
|
+
Ho as a8,
|
|
28739
|
+
so as a9,
|
|
28740
|
+
Jo as aa,
|
|
28741
|
+
wo as ab,
|
|
28742
|
+
lo as ac,
|
|
28743
|
+
qi as ad,
|
|
28744
|
+
Fi as ae,
|
|
28745
|
+
En as af,
|
|
28746
|
+
tl as ag,
|
|
28747
|
+
Fo as ah,
|
|
28748
|
+
fo as ai,
|
|
28749
|
+
Bi as b,
|
|
28750
28750
|
Ze as c,
|
|
28751
|
-
|
|
28752
|
-
|
|
28753
|
-
|
|
28751
|
+
yo as d,
|
|
28752
|
+
To as e,
|
|
28753
|
+
Eo as f,
|
|
28754
28754
|
Qi as g,
|
|
28755
|
-
|
|
28756
|
-
|
|
28757
|
-
|
|
28758
|
-
|
|
28759
|
-
|
|
28760
|
-
|
|
28761
|
-
|
|
28762
|
-
|
|
28763
|
-
|
|
28764
|
-
|
|
28765
|
-
|
|
28766
|
-
|
|
28767
|
-
|
|
28768
|
-
|
|
28769
|
-
|
|
28770
|
-
|
|
28771
|
-
|
|
28772
|
-
|
|
28773
|
-
|
|
28755
|
+
So as h,
|
|
28756
|
+
Bt as i,
|
|
28757
|
+
$o as j,
|
|
28758
|
+
zo as k,
|
|
28759
|
+
Qo as l,
|
|
28760
|
+
Mo as m,
|
|
28761
|
+
Ao as n,
|
|
28762
|
+
Co as o,
|
|
28763
|
+
Ro as p,
|
|
28764
|
+
no as q,
|
|
28765
|
+
el as r,
|
|
28766
|
+
Za as s,
|
|
28767
|
+
No as t,
|
|
28768
|
+
mo as u,
|
|
28769
|
+
co as v,
|
|
28770
|
+
po as w,
|
|
28771
|
+
oo as x,
|
|
28772
|
+
ya as y,
|
|
28773
|
+
bo as z
|
|
28774
28774
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as Ke, g as Do } from "./index-
|
|
2
|
-
import { _ as Xa } from "./jspdf.es.min-
|
|
1
|
+
import { c as Ke, g as Do } from "./index-DqWPV29B.js";
|
|
2
|
+
import { _ as Xa } from "./jspdf.es.min-CCBzPHw4.js";
|
|
3
3
|
var vt = function(a) {
|
|
4
4
|
return a && a.Math === Math && a;
|
|
5
5
|
}, _ = (
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as s, a as o, b as t, D as r, N as i, O as n, d as l, P as c, e as d, f as u, h as S, U as h, i as A, j as T, k, l as C, m as _, n as O, o as U, p as g, q as N, r as P, s as m, t as E, u as F, v as p, w as f, x as I, y as R, z as x, B as v, C as y, E as L, F as b, G as B, H as D, I as M, J as H, K as V, L as W, M as q, Q as K, R as w, S as z, T as G, V as Q, W as X, X as Y, Y as j, Z as J, _ as Z, $, a0 as aa, a1 as ea, a2 as sa, a3 as oa, a4 as ta, a5 as ra, a6 as ia, a7 as na, a8 as la, a9 as ca, aa as da, ab as ua, ac as Sa, ad as ha, ae as Aa, af as Ta, ag as ka, ah as Ca, ai as _a } from "./index-DqWPV29B.js";
|
|
2
2
|
export {
|
|
3
3
|
s as AUTH7_SCOPES,
|
|
4
4
|
o as AppShellLayout,
|
|
@@ -8506,7 +8506,7 @@ function(n) {
|
|
|
8506
8506
|
});
|
|
8507
8507
|
}
|
|
8508
8508
|
function t() {
|
|
8509
|
-
return (Kt.DOMPurify ? Promise.resolve(Kt.DOMPurify) : import("./purify.es-
|
|
8509
|
+
return (Kt.DOMPurify ? Promise.resolve(Kt.DOMPurify) : import("./purify.es-Cm3utOpm.js")).catch(function(l) {
|
|
8510
8510
|
return Promise.reject(new Error("Could not load dompurify: " + l));
|
|
8511
8511
|
}).then(function(l) {
|
|
8512
8512
|
return l.default ? l.default : l;
|
|
@@ -9216,7 +9216,7 @@ function(n) {
|
|
|
9216
9216
|
var d = h.getContext("2d");
|
|
9217
9217
|
d.fillStyle = "#fff", d.fillRect(0, 0, h.width, h.height);
|
|
9218
9218
|
var m = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, _ = this;
|
|
9219
|
-
return (Kt.canvg ? Promise.resolve(Kt.canvg) : import("./index.es-
|
|
9219
|
+
return (Kt.canvg ? Promise.resolve(Kt.canvg) : import("./index.es-9cvhYbjn.js")).catch(function(k) {
|
|
9220
9220
|
return Promise.reject(new Error("Could not load canvg: " + k));
|
|
9221
9221
|
}).then(function(k) {
|
|
9222
9222
|
return k.default ? k.default : k;
|
|
@@ -256,8 +256,8 @@ function ot(e, t, r, i, n) {
|
|
|
256
256
|
isNaN(p) || (a.fontSize = p / s);
|
|
257
257
|
var y = st(i);
|
|
258
258
|
y && (a.fontStyle = y);
|
|
259
|
-
var
|
|
260
|
-
return e.indexOf(
|
|
259
|
+
var x = (i.fontFamily || "").toLowerCase();
|
|
260
|
+
return e.indexOf(x) !== -1 && (a.font = x), a;
|
|
261
261
|
}
|
|
262
262
|
function st(e) {
|
|
263
263
|
var t = "";
|
|
@@ -398,10 +398,10 @@ function dt(e, t) {
|
|
|
398
398
|
t.showFoot === !0 ? p = "everyPage" : t.showFoot === !1 ? p = "never" : p = (i = t.showFoot) !== null && i !== void 0 ? i : "everyPage";
|
|
399
399
|
var y;
|
|
400
400
|
t.showHead === !0 ? y = "everyPage" : t.showHead === !1 ? y = "never" : y = (n = t.showHead) !== null && n !== void 0 ? n : "everyPage";
|
|
401
|
-
var
|
|
401
|
+
var x = (a = t.useCss) !== null && a !== void 0 ? a : !1, c = t.theme || (x ? "plain" : "striped"), C = !!t.horizontalPageBreak, rt = (s = t.horizontalPageBreakRepeat) !== null && s !== void 0 ? s : null;
|
|
402
402
|
return {
|
|
403
403
|
includeHiddenHtml: (h = t.includeHiddenHtml) !== null && h !== void 0 ? h : !1,
|
|
404
|
-
useCss:
|
|
404
|
+
useCss: x,
|
|
405
405
|
theme: c,
|
|
406
406
|
startY: m,
|
|
407
407
|
margin: d,
|
|
@@ -412,7 +412,7 @@ function dt(e, t) {
|
|
|
412
412
|
showFoot: p,
|
|
413
413
|
tableLineWidth: (g = t.tableLineWidth) !== null && g !== void 0 ? g : 0,
|
|
414
414
|
tableLineColor: (u = t.tableLineColor) !== null && u !== void 0 ? u : 200,
|
|
415
|
-
horizontalPageBreak:
|
|
415
|
+
horizontalPageBreak: C,
|
|
416
416
|
horizontalPageBreakRepeat: rt,
|
|
417
417
|
horizontalPageBreakBehaviour: (v = t.horizontalPageBreakBehaviour) !== null && v !== void 0 ? v : "afterAllRows"
|
|
418
418
|
};
|
|
@@ -604,8 +604,8 @@ var A = (
|
|
|
604
604
|
}, e;
|
|
605
605
|
}()
|
|
606
606
|
);
|
|
607
|
-
function
|
|
608
|
-
|
|
607
|
+
function xt(e, t) {
|
|
608
|
+
Ct(e, t);
|
|
609
609
|
var r = [], i = 0;
|
|
610
610
|
t.columns.forEach(function(a) {
|
|
611
611
|
var s = a.getMaxCustomCellWidth(t);
|
|
@@ -618,7 +618,7 @@ function Ct(e, t) {
|
|
|
618
618
|
return a.minWidth;
|
|
619
619
|
})), n = Math.abs(n), !t.settings.horizontalPageBreak && n > 0.1 / e.scaleFactor() && (n = n < 1 ? n : Math.round(n), console.log("Of the table content, ".concat(n, " units width could not fit page"))), Ht(t), Dt(t, e), Pt(t);
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function Ct(e, t) {
|
|
622
622
|
var r = e.scaleFactor(), i = t.settings.horizontalPageBreak, n = U(e, t);
|
|
623
623
|
t.allRows().forEach(function(a) {
|
|
624
624
|
for (var s = 0, h = t.columns; s < h.length; s++) {
|
|
@@ -747,7 +747,7 @@ function Wt(e, t, r, i, n) {
|
|
|
747
747
|
}
|
|
748
748
|
function V(e, t) {
|
|
749
749
|
var r = new P(e), i = Ft(t, r.scaleFactor()), n = new wt(t, i);
|
|
750
|
-
return
|
|
750
|
+
return xt(r, n), r.applyStyles(r.userStyles), n;
|
|
751
751
|
}
|
|
752
752
|
function Ft(e, t) {
|
|
753
753
|
var r = e.content, i = kt(r.columns);
|
|
@@ -775,11 +775,11 @@ function k(e, t, r, i, n, a) {
|
|
|
775
775
|
if (v === 0) {
|
|
776
776
|
var y = void 0;
|
|
777
777
|
Array.isArray(f) ? y = f[p.index - u - l] : y = f[p.dataKey];
|
|
778
|
-
var
|
|
779
|
-
typeof y == "object" && !Array.isArray(y) && (
|
|
780
|
-
var c = Rt(e, p, o, n, i, a,
|
|
781
|
-
g[p.dataKey] =
|
|
782
|
-
left:
|
|
778
|
+
var x = {};
|
|
779
|
+
typeof y == "object" && !Array.isArray(y) && (x = (y == null ? void 0 : y.styles) || {});
|
|
780
|
+
var c = Rt(e, p, o, n, i, a, x), C = new Z(y, c, e);
|
|
781
|
+
g[p.dataKey] = C, g[p.index] = C, v = C.colSpan - 1, s[p.index] = {
|
|
782
|
+
left: C.rowSpan - 1,
|
|
783
783
|
times: v
|
|
784
784
|
};
|
|
785
785
|
} else
|
|
@@ -908,14 +908,11 @@ function jt(e, t, r, i, n) {
|
|
|
908
908
|
}
|
|
909
909
|
function N(e, t, r, i, n, a) {
|
|
910
910
|
e.applyStyles(e.userStyles), a = a ?? t.body.length;
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
break;
|
|
917
|
-
}
|
|
918
|
-
return h;
|
|
911
|
+
var s = Math.min(r + a, t.body.length), h = -1;
|
|
912
|
+
return t.body.slice(r, s).forEach(function(f, o) {
|
|
913
|
+
var l = r + o === t.body.length - 1, g = et(e, t, l, i);
|
|
914
|
+
f.canEntireRowFit(g, n) && (S(e, t, f, i, n), h = r + o);
|
|
915
|
+
}), h;
|
|
919
916
|
}
|
|
920
917
|
function R(e, t, r, i) {
|
|
921
918
|
var n = t.settings;
|