@isi-ui7/bos7-shared 0.2.6 → 0.2.7
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 +2 -0
- package/dist/form-types.d.ts +15 -2
- package/dist/{index.es-Bylk5fh-.js → index.es-B4p6mwaz.js} +1 -1
- package/dist/index.js +5 -2
- package/dist/{jspdf.es.min-Dzm5j8wC.js → jspdf.es.min-CpRUhh3E.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/dist/shell/app-shell-layout.d.ts +1 -1
- package/package.json +3 -3
- package/src/crud-types.ts +2 -0
- package/src/form-renderer.tsx +78 -6
- package/src/form-types.ts +15 -2
- package/src/form-value-schema.ts +6 -1
- package/src/shell/app-shell-layout.tsx +2 -2
- package/dist/purify.es-CiEWEeUM.js +0 -605
package/dist/crud-types.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export type CrudListSchema = {
|
|
|
63
63
|
showSort?: boolean;
|
|
64
64
|
/** Enable search bar. Defaults to true. */
|
|
65
65
|
showSearch?: boolean;
|
|
66
|
+
/** Endpoint for LookupInput (defaults to apiPath if omitted). In Pattern B both DataTable and LookupInput share the same /query endpoint. */
|
|
67
|
+
lookupApiPath?: string;
|
|
66
68
|
/**
|
|
67
69
|
* Level 2: schema-driven confirmation modals for custom popup actions.
|
|
68
70
|
* Keyed by popup menu item id. Actions not listed here fall through to onCustomAction (Level 1).
|
package/dist/form-types.d.ts
CHANGED
|
@@ -19,9 +19,15 @@ export type FieldValidation<TData extends Record<string, unknown>> = {
|
|
|
19
19
|
/** Array of validators — compose Rules.* or custom functions. Runs after built-in rules. */
|
|
20
20
|
validators?: FieldValidatorFn<TData>[];
|
|
21
21
|
};
|
|
22
|
-
export type FormFieldType = "text" | "textarea" | "number" | "date" | "select" | "lookup" | "checkbox" | "toggle" | "detail-rows";
|
|
22
|
+
export type FormFieldType = "text" | "textarea" | "number" | "date" | "datetime" | "select" | "lookup" | "checkbox" | "toggle" | "detail-rows";
|
|
23
|
+
/**
|
|
24
|
+
* Select option. `value` may be a number for numeric-coded columns (e.g.
|
|
25
|
+
* kolektibilitas 1–5); the renderer compares via `String(value)` and the
|
|
26
|
+
* native `<select>` still round-trips strings, so `format`/`onDataPatch`
|
|
27
|
+
* should not assume the runtime type survives an edit.
|
|
28
|
+
*/
|
|
23
29
|
export type FormFieldOption = {
|
|
24
|
-
value: string;
|
|
30
|
+
value: string | number;
|
|
25
31
|
label: string;
|
|
26
32
|
};
|
|
27
33
|
export type FormFieldLookupConfig<TData extends Record<string, unknown>> = {
|
|
@@ -90,6 +96,13 @@ export type DetailRowsConfig = {
|
|
|
90
96
|
newRowFactory: () => Record<string, unknown>;
|
|
91
97
|
validateRow?: (row: Record<string, unknown>, index: number) => Record<string, string>;
|
|
92
98
|
maxRows?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Assignment/master-detail mode: rows loaded from the server render
|
|
101
|
+
* delete-only (read-only cells, no lookup picker) while rows added in the
|
|
102
|
+
* current session stay editable. Defaults to `false` (normal edit-in-place).
|
|
103
|
+
* Forwarded to `<EditableTable lockExistingRows>`.
|
|
104
|
+
*/
|
|
105
|
+
lockExistingRows?: boolean;
|
|
93
106
|
};
|
|
94
107
|
export type FormField<TData extends Record<string, unknown>> = {
|
|
95
108
|
key: keyof TData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as Xa } from "./jspdf.es.min-
|
|
1
|
+
import { _ as Xa } from "./jspdf.es.min-CpRUhh3E.js";
|
|
2
2
|
var Ke = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3
3
|
function Do(a) {
|
|
4
4
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
package/dist/index.js
CHANGED
|
@@ -19778,7 +19778,7 @@ function d_(e, t, r) {
|
|
|
19778
19778
|
Na.book_append_sheet(s, i, r.slice(0, 31)), Wg(s, `${r}.xlsx`);
|
|
19779
19779
|
}
|
|
19780
19780
|
async function p_(e, t, r) {
|
|
19781
|
-
const { default: n } = await import("./jspdf.es.min-
|
|
19781
|
+
const { default: n } = await import("./jspdf.es.min-CpRUhh3E.js").then((s) => s.j), { default: a } = await import("./jspdf.plugin.autotable-DFaknRns.js"), i = new n({ orientation: "landscape" });
|
|
19782
19782
|
i.setFontSize(14), i.text(r, 14, 15), i.setFontSize(10), a(i, {
|
|
19783
19783
|
head: [t.map((s) => s.title)],
|
|
19784
19784
|
body: e.map(
|
|
@@ -20872,7 +20872,10 @@ function Nx(e, t, r) {
|
|
|
20872
20872
|
return (a == null ? void 0 : a.kind) === "currency" ? {
|
|
20873
20873
|
type: "currency",
|
|
20874
20874
|
precision: a.defaultPrecision ?? qa.defaultPrecision
|
|
20875
|
-
} : (a == null ? void 0 : a.kind) === "percent" ? { type: "number", decimals: a.maxFractionDigits ?? 2, min: e.minimum, max: e.maximum } : (a == null ? void 0 : a.kind) === "integer" || e.type === "integer" ? { type: "number", decimals: 0, min: e.minimum, max: e.maximum } : n === "number" ? { type: "number", min: e.minimum, max: e.maximum } : n === "select" ? {
|
|
20875
|
+
} : (a == null ? void 0 : a.kind) === "percent" ? { type: "number", decimals: a.maxFractionDigits ?? 2, min: e.minimum, max: e.maximum } : (a == null ? void 0 : a.kind) === "integer" || e.type === "integer" ? { type: "number", decimals: 0, min: e.minimum, max: e.maximum } : n === "number" ? { type: "number", min: e.minimum, max: e.maximum } : n === "select" ? {
|
|
20876
|
+
type: "select",
|
|
20877
|
+
options: (mc(e, t, r) ?? []).map((i) => ({ value: String(i.value), label: i.label }))
|
|
20878
|
+
} : n === "date" ? { type: "date" } : { type: "text", maxLength: e.maxLength, placeholder: t == null ? void 0 : t.placeholder };
|
|
20876
20879
|
}
|
|
20877
20880
|
function Ix(e, t) {
|
|
20878
20881
|
const r = e.items;
|
|
@@ -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-B4p6mwaz.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;
|