@object-ui/plugin-aggrid 3.3.0 → 3.3.2
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 +23 -0
- package/README.md +20 -0
- package/dist/AddressField-CP-8JJvR.js +98 -0
- package/dist/{AgGridImpl-DBqxIsko.js → AgGridImpl-DJWnS8p3.js} +1 -1
- package/dist/AutoNumberField-DCL2eUJj.js +14 -0
- package/dist/{AvatarField-C5b9biGa.js → AvatarField-CpFxJRdO.js} +4 -3
- package/dist/{BooleanField-DRzAZhSq.js → BooleanField-Chphr8cB.js} +2 -1
- package/dist/CodeField-BWngVIw1.js +23 -0
- package/dist/ColorField-GygyYArR.js +38 -0
- package/dist/CurrencyField-O8Pn59RO.js +49 -0
- package/dist/DateField-u6U8wmvI.js +22 -0
- package/dist/DateTimeField-D1z1Ovvy.js +30 -0
- package/dist/EmailField-IOcDmGjJ.js +26 -0
- package/dist/FileField-D3mZIrJ1.js +158 -0
- package/dist/FormulaField-MuyWzQx0.js +17 -0
- package/dist/GeolocationField-BfhC7QLw.js +161 -0
- package/dist/GridField-gN34gk4b.js +49 -0
- package/dist/ImageField-BZfSFwmJ.js +75 -0
- package/dist/LocationField-B-zwfw3h.js +36 -0
- package/dist/{LookupField-DoOmbbZF.js → LookupField-Cms1Cu_l.js} +347 -349
- package/dist/{MasterDetailField-BnSPGAtS.js → MasterDetailField-DGUmvg2f.js} +5 -4
- package/dist/NumberField-BV5sKwZ7.js +27 -0
- package/dist/{ObjectAgGridImpl-DrI0aa8t.js → ObjectAgGridImpl-yiHlXYgp.js} +5804 -5804
- package/dist/ObjectField-DJ5s3ciA.js +50 -0
- package/dist/{PasswordField-k5JeKk9f.js → PasswordField-BJboeBJY.js} +3 -2
- package/dist/PercentField-DO3be_bL.js +61 -0
- package/dist/PhoneField-CT6XcO6O.js +26 -0
- package/dist/{QRCodeField-BIrSW1Zr.js → QRCodeField-COLyc5iQ.js} +31 -30
- package/dist/{RatingField-5iMhn2GL.js → RatingField-B2momIna.js} +3 -2
- package/dist/RichTextField-C7qzDPJy.js +33 -0
- package/dist/SelectField-oo6vnNhQ.js +36 -0
- package/dist/{SignatureField-BAMvNrE6.js → SignatureField-DUgoK09r.js} +3 -2
- package/dist/{SliderField-C9IhmjbF.js → SliderField-DrggtBSX.js} +2 -1
- package/dist/SummaryField-DuMsFoY5.js +22 -0
- package/dist/TextAreaField-CLzzmPce.js +37 -0
- package/dist/TextField-CZE7SzK4.js +30 -0
- package/dist/TimeField-Bha4cayv.js +22 -0
- package/dist/UrlField-Dff4WLlN.js +31 -0
- package/dist/UserField-eT5njHwQ.js +77 -0
- package/dist/VectorField-BHe8lDOH.js +34 -0
- package/dist/{image-DlUdeTgT.js → image-DmzU2ETO.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +77 -77
- package/dist/{jsx-runtime-CGDkM_Jn.js → jsx-runtime-CXSCp6pT.js} +30 -39
- package/dist/{plus-BwEV_Q5_.js → plus-bvZ2f9T_.js} +1 -1
- package/dist/rolldown-runtime-CkxV0rQ3.js +14 -0
- package/dist/{upload-DPiohvXv.js → upload-BdzwEMeV.js} +1 -1
- package/dist/{useFieldTranslation-C69OtouR.js → useFieldTranslation-CfXaJRC4.js} +2 -2
- package/dist/{x-BFq2GeQ5.js → x-98xe-fYG.js} +1 -1
- package/package.json +34 -11
- package/.turbo/turbo-build.log +0 -71
- package/OBJECT_AGGRID_CN.md +0 -483
- package/QUICKSTART.md +0 -186
- package/dist/AddressField-DKqaE9pD.js +0 -93
- package/dist/AutoNumberField-0RU2dNKe.js +0 -13
- package/dist/CodeField-RWhnDMyL.js +0 -22
- package/dist/ColorField-B-YAFXdz.js +0 -37
- package/dist/CurrencyField-Bu80a-sI.js +0 -51
- package/dist/DateField-CV-NpLbM.js +0 -21
- package/dist/DateTimeField--YTsgTjw.js +0 -32
- package/dist/EmailField-B-3fWJsH.js +0 -28
- package/dist/FileField-BcGMvBnI.js +0 -160
- package/dist/FormulaField-MQXJZOep.js +0 -13
- package/dist/GeolocationField-D3BrmwqV.js +0 -156
- package/dist/GridField-DHsGo9l2.js +0 -51
- package/dist/ImageField-BBqwJEkk.js +0 -77
- package/dist/LocationField-DSvhU9Dz.js +0 -35
- package/dist/LookupField-KfYQlgUd.js +0 -2
- package/dist/NumberField-Kz4_o5DE.js +0 -26
- package/dist/ObjectField-C1qkl6s4.js +0 -52
- package/dist/PercentField-Dmipqv0I.js +0 -63
- package/dist/PhoneField-Dn4h6V9H.js +0 -28
- package/dist/RichTextField-CN5BRd_7.js +0 -32
- package/dist/SelectField-Bjk_S2zT.js +0 -31
- package/dist/SelectField-CcWvzp9g.js +0 -2
- package/dist/SummaryField-R9RENAZv.js +0 -18
- package/dist/TextAreaField-BY63Nr6-.js +0 -36
- package/dist/TextField-SIw8aMzf.js +0 -29
- package/dist/TimeField-xxziHPjE.js +0 -21
- package/dist/UrlField-Ihk3_ff5.js +0 -33
- package/dist/UserField-BHl6mmIH.js +0 -79
- package/dist/VectorField-Ci167cxr.js +0 -35
- package/src/AgGridImpl.tsx +0 -405
- package/src/ObjectAgGridImpl.tsx +0 -509
- package/src/VirtualScrolling.ts +0 -74
- package/src/ag-grid.d.ts +0 -10
- package/src/field-renderers.test.tsx +0 -383
- package/src/field-renderers.tsx +0 -224
- package/src/index.test.ts +0 -139
- package/src/index.tsx +0 -514
- package/src/object-aggrid.test.ts +0 -99
- package/src/object-aggrid.types.ts +0 -123
- package/src/types.ts +0 -184
- package/tsconfig.json +0 -17
- package/vite.config.ts +0 -64
- /package/dist/{createLucideIcon-BjfZYZey.js → createLucideIcon-C_5JZ35b.js} +0 -0
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { cn as n } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/GridField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ e({ GridField: () => a }), i = t();
|
|
6
|
-
function a({ value: e, field: t, readonly: r, ...a }) {
|
|
7
|
-
let o = (t || a.schema)?.columns || [];
|
|
8
|
-
return !e || !Array.isArray(e) ? /* @__PURE__ */ (0, i.jsx)("span", {
|
|
9
|
-
className: "text-sm text-muted-foreground",
|
|
10
|
-
children: "-"
|
|
11
|
-
}) : r ? /* @__PURE__ */ (0, i.jsx)("div", {
|
|
12
|
-
className: n("text-sm", a.className),
|
|
13
|
-
children: /* @__PURE__ */ (0, i.jsxs)("span", {
|
|
14
|
-
className: "text-foreground",
|
|
15
|
-
children: [e.length, " rows"]
|
|
16
|
-
})
|
|
17
|
-
}) : /* @__PURE__ */ (0, i.jsxs)("div", {
|
|
18
|
-
className: n("border border-border rounded-lg overflow-hidden", a.className),
|
|
19
|
-
children: [/* @__PURE__ */ (0, i.jsx)("div", {
|
|
20
|
-
className: "overflow-auto max-h-60",
|
|
21
|
-
children: /* @__PURE__ */ (0, i.jsxs)("table", {
|
|
22
|
-
className: "w-full text-sm",
|
|
23
|
-
children: [/* @__PURE__ */ (0, i.jsx)("thead", {
|
|
24
|
-
className: "bg-muted border-b border-border",
|
|
25
|
-
children: /* @__PURE__ */ (0, i.jsx)("tr", { children: o.map((e, t) => /* @__PURE__ */ (0, i.jsx)("th", {
|
|
26
|
-
className: "px-3 py-2 text-left text-xs font-medium text-muted-foreground",
|
|
27
|
-
children: e.label || e.name
|
|
28
|
-
}, t)) })
|
|
29
|
-
}), /* @__PURE__ */ (0, i.jsx)("tbody", {
|
|
30
|
-
className: "divide-y divide-border",
|
|
31
|
-
children: e.slice(0, 5).map((e, t) => /* @__PURE__ */ (0, i.jsx)("tr", {
|
|
32
|
-
className: "hover:bg-muted/50 transition-colors",
|
|
33
|
-
children: o.map((t, n) => /* @__PURE__ */ (0, i.jsx)("td", {
|
|
34
|
-
className: "px-3 py-2 text-foreground",
|
|
35
|
-
children: e[t.name] == null ? "-" : String(e[t.name])
|
|
36
|
-
}, n))
|
|
37
|
-
}, t))
|
|
38
|
-
})]
|
|
39
|
-
})
|
|
40
|
-
}), e.length > 5 && /* @__PURE__ */ (0, i.jsxs)("div", {
|
|
41
|
-
className: "bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border",
|
|
42
|
-
children: [
|
|
43
|
-
"Showing 5 of ",
|
|
44
|
-
e.length,
|
|
45
|
-
" rows"
|
|
46
|
-
]
|
|
47
|
-
})]
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
export { r as t };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import { t as n } from "./image-DlUdeTgT.js";
|
|
3
|
-
import { t as r } from "./x-BFq2GeQ5.js";
|
|
4
|
-
import { useRef as i } from "react";
|
|
5
|
-
import { Button as a } from "@object-ui/components";
|
|
6
|
-
//#region ../fields/src/widgets/ImageField.tsx
|
|
7
|
-
var o = /* @__PURE__ */ e({ ImageField: () => c }), s = t();
|
|
8
|
-
function c({ value: e, onChange: t, field: o, readonly: c, ...l }) {
|
|
9
|
-
let u = i(null), d = o || l.schema, f = d?.multiple || !1, p = d?.accept ? d.accept.join(",") : "image/*";
|
|
10
|
-
if (c) return e ? /* @__PURE__ */ (0, s.jsx)("div", {
|
|
11
|
-
className: "flex flex-wrap gap-2",
|
|
12
|
-
children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ (0, s.jsx)("img", {
|
|
13
|
-
src: e.url || "",
|
|
14
|
-
alt: e.name || `Image ${t + 1}`,
|
|
15
|
-
className: "size-20 rounded-md object-cover border border-gray-200"
|
|
16
|
-
}, t))
|
|
17
|
-
}) : /* @__PURE__ */ (0, s.jsx)("span", {
|
|
18
|
-
className: "text-sm",
|
|
19
|
-
children: "-"
|
|
20
|
-
});
|
|
21
|
-
let m = e ? Array.isArray(e) ? e : [e] : [], h = (e) => {
|
|
22
|
-
let n = Array.from(e.target.files || []);
|
|
23
|
-
if (n.length === 0) return;
|
|
24
|
-
let r = n.map((e) => ({
|
|
25
|
-
name: e.name,
|
|
26
|
-
original_name: e.name,
|
|
27
|
-
size: e.size,
|
|
28
|
-
mime_type: e.type,
|
|
29
|
-
url: URL.createObjectURL(e)
|
|
30
|
-
}));
|
|
31
|
-
t(f ? [...m, ...r] : r[0]);
|
|
32
|
-
}, g = (e) => {
|
|
33
|
-
if (f) {
|
|
34
|
-
let n = m.filter((t, n) => n !== e);
|
|
35
|
-
t(n.length > 0 ? n : null);
|
|
36
|
-
} else t(null);
|
|
37
|
-
};
|
|
38
|
-
return /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
39
|
-
className: l.className,
|
|
40
|
-
children: [/* @__PURE__ */ (0, s.jsx)("input", {
|
|
41
|
-
ref: u,
|
|
42
|
-
type: "file",
|
|
43
|
-
multiple: f,
|
|
44
|
-
accept: p,
|
|
45
|
-
onChange: h,
|
|
46
|
-
className: "hidden"
|
|
47
|
-
}), /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
48
|
-
className: "space-y-2",
|
|
49
|
-
children: [m.length > 0 && /* @__PURE__ */ (0, s.jsx)("div", {
|
|
50
|
-
className: "grid grid-cols-4 gap-2",
|
|
51
|
-
children: m.map((e, t) => /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
52
|
-
className: "relative group",
|
|
53
|
-
children: [/* @__PURE__ */ (0, s.jsx)("img", {
|
|
54
|
-
src: e.url || "",
|
|
55
|
-
alt: e.name || `Image ${t + 1}`,
|
|
56
|
-
className: "size-20 rounded-md object-cover border border-gray-200"
|
|
57
|
-
}), /* @__PURE__ */ (0, s.jsx)(a, {
|
|
58
|
-
type: "button",
|
|
59
|
-
variant: "destructive",
|
|
60
|
-
size: "sm",
|
|
61
|
-
onClick: () => g(t),
|
|
62
|
-
className: "absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
63
|
-
children: /* @__PURE__ */ (0, s.jsx)(r, { className: "size-3" })
|
|
64
|
-
})]
|
|
65
|
-
}, t))
|
|
66
|
-
}), /* @__PURE__ */ (0, s.jsxs)(a, {
|
|
67
|
-
type: "button",
|
|
68
|
-
variant: "outline",
|
|
69
|
-
onClick: () => u.current?.click(),
|
|
70
|
-
className: "w-full",
|
|
71
|
-
children: [/* @__PURE__ */ (0, s.jsx)(n, { className: "size-4 mr-2" }), m.length > 0 ? "Add More Images" : "Upload Image"]
|
|
72
|
-
})]
|
|
73
|
-
})]
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
export { o as n, c as t };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Input as n } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/LocationField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ e({ LocationField: () => a }), i = t();
|
|
6
|
-
function a({ value: e, onChange: t, field: r, readonly: a, ...o }) {
|
|
7
|
-
let s = r || o.schema, c = e && typeof e == "object" ? `${e.latitude || 0}, ${e.longitude || 0}` : "";
|
|
8
|
-
return a ? /* @__PURE__ */ (0, i.jsx)("span", {
|
|
9
|
-
className: "text-sm",
|
|
10
|
-
children: c || "-"
|
|
11
|
-
}) : /* @__PURE__ */ (0, i.jsx)(n, {
|
|
12
|
-
type: "text",
|
|
13
|
-
value: c,
|
|
14
|
-
onChange: (e) => {
|
|
15
|
-
let n = e.target.value;
|
|
16
|
-
if (!n.trim()) {
|
|
17
|
-
t(null);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
let r = n.split(",").map((e) => e.trim());
|
|
21
|
-
if (r.length === 2) {
|
|
22
|
-
let e = parseFloat(r[0]), n = parseFloat(r[1]);
|
|
23
|
-
!isNaN(e) && !isNaN(n) && t({
|
|
24
|
-
latitude: e,
|
|
25
|
-
longitude: n
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
placeholder: s?.placeholder || "latitude, longitude",
|
|
30
|
-
disabled: a || o.disabled,
|
|
31
|
-
className: o.className
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { r as t };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Input as n } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/NumberField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ e({ NumberField: () => a }), i = t();
|
|
6
|
-
function a({ value: e, onChange: t, field: r, readonly: a, ...o }) {
|
|
7
|
-
if (a) return /* @__PURE__ */ (0, i.jsx)("span", {
|
|
8
|
-
className: "text-sm",
|
|
9
|
-
children: e ?? "-"
|
|
10
|
-
});
|
|
11
|
-
let s = r || o.schema, c = s?.precision, { inputType: l, ...u } = o;
|
|
12
|
-
return /* @__PURE__ */ (0, i.jsx)(n, {
|
|
13
|
-
...u,
|
|
14
|
-
type: "number",
|
|
15
|
-
value: e ?? "",
|
|
16
|
-
onChange: (e) => {
|
|
17
|
-
let n = e.target.value;
|
|
18
|
-
t(n === "" ? null : Number(n));
|
|
19
|
-
},
|
|
20
|
-
placeholder: s?.placeholder,
|
|
21
|
-
disabled: a || u.disabled,
|
|
22
|
-
step: c ? 10 ** -c : "any"
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { r as n, a as t };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import { useEffect as n, useState as r } from "react";
|
|
3
|
-
import { Textarea as i, cn as a } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/ObjectField.tsx
|
|
5
|
-
var o = /* @__PURE__ */ e({ ObjectField: () => c }), s = t();
|
|
6
|
-
function c({ value: e, onChange: t, field: o, readonly: c, ...l }) {
|
|
7
|
-
let u = o || l.schema, [d, f] = r(() => e == null ? "" : JSON.stringify(e, null, 2)), [p, m] = r(null);
|
|
8
|
-
return n(() => {
|
|
9
|
-
try {
|
|
10
|
-
if (e == null) {
|
|
11
|
-
f("");
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
let t = d ? JSON.parse(d) : null;
|
|
15
|
-
JSON.stringify(t) !== JSON.stringify(e) && f(JSON.stringify(e, null, 2));
|
|
16
|
-
} catch {
|
|
17
|
-
f(JSON.stringify(e, null, 2));
|
|
18
|
-
}
|
|
19
|
-
}, [e, d]), c ? e ? /* @__PURE__ */ (0, s.jsx)("pre", {
|
|
20
|
-
className: a("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", l.className),
|
|
21
|
-
children: JSON.stringify(e, null, 2)
|
|
22
|
-
}) : /* @__PURE__ */ (0, s.jsx)("span", {
|
|
23
|
-
className: "text-sm",
|
|
24
|
-
children: "-"
|
|
25
|
-
}) : /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
26
|
-
className: "space-y-1",
|
|
27
|
-
children: [/* @__PURE__ */ (0, s.jsx)(i, {
|
|
28
|
-
value: d,
|
|
29
|
-
onChange: (e) => {
|
|
30
|
-
let n = e.target.value;
|
|
31
|
-
if (f(n), m(null), !n.trim()) {
|
|
32
|
-
t(null);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
t(JSON.parse(n));
|
|
37
|
-
} catch {
|
|
38
|
-
m("Invalid JSON");
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
placeholder: u?.placeholder || "{\n \"key\": \"value\"\n}",
|
|
42
|
-
disabled: c || l.disabled,
|
|
43
|
-
className: a("font-mono text-xs", p ? "border-red-500 focus-visible:ring-red-500" : "", l.className),
|
|
44
|
-
rows: 6
|
|
45
|
-
}), p && /* @__PURE__ */ (0, s.jsx)("p", {
|
|
46
|
-
className: "text-xs text-red-500",
|
|
47
|
-
children: p
|
|
48
|
-
})]
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
export { o as t };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Input as n, Slider as r } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/PercentField.tsx
|
|
5
|
-
var i = /* @__PURE__ */ e({ PercentField: () => o }), a = t();
|
|
6
|
-
function o({ value: e, onChange: t, field: i, readonly: o, errorMessage: s, className: c, ...l }) {
|
|
7
|
-
let u = i || l.schema, d = u?.precision ?? 2;
|
|
8
|
-
if (o) return e == null ? /* @__PURE__ */ (0, a.jsx)("span", {
|
|
9
|
-
className: "text-sm",
|
|
10
|
-
children: "-"
|
|
11
|
-
}) : /* @__PURE__ */ (0, a.jsxs)("span", {
|
|
12
|
-
className: "text-sm font-medium tabular-nums",
|
|
13
|
-
children: [(e * 100).toFixed(d), "%"]
|
|
14
|
-
});
|
|
15
|
-
let f = e == null ? "" : e * 100, p = e == null ? 0 : e * 100, m = (e) => {
|
|
16
|
-
if (e.target.value === "") {
|
|
17
|
-
t(null);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
let n = parseFloat(e.target.value);
|
|
21
|
-
t(isNaN(n) ? null : n / 100);
|
|
22
|
-
}, h = (e) => {
|
|
23
|
-
if (o || l.disabled) return;
|
|
24
|
-
if (!Array.isArray(e) || e.length === 0) {
|
|
25
|
-
t(null);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
let n = e[0];
|
|
29
|
-
t(typeof n == "number" ? n / 100 : null);
|
|
30
|
-
}, g = 10 ** -d;
|
|
31
|
-
return /* @__PURE__ */ (0, a.jsxs)("div", {
|
|
32
|
-
className: "space-y-2",
|
|
33
|
-
children: [/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
34
|
-
className: "relative",
|
|
35
|
-
children: [/* @__PURE__ */ (0, a.jsx)(n, {
|
|
36
|
-
...l,
|
|
37
|
-
type: "number",
|
|
38
|
-
value: f,
|
|
39
|
-
onChange: m,
|
|
40
|
-
placeholder: u?.placeholder || "0",
|
|
41
|
-
disabled: o || l.disabled,
|
|
42
|
-
className: `pr-8 ${c || ""}`,
|
|
43
|
-
step: (10 ** -d).toFixed(d),
|
|
44
|
-
"aria-invalid": !!s
|
|
45
|
-
}), /* @__PURE__ */ (0, a.jsx)("span", {
|
|
46
|
-
className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
|
|
47
|
-
children: "%"
|
|
48
|
-
})]
|
|
49
|
-
}), /* @__PURE__ */ (0, a.jsx)(r, {
|
|
50
|
-
value: [p],
|
|
51
|
-
onValueChange: h,
|
|
52
|
-
min: 0,
|
|
53
|
-
max: 100,
|
|
54
|
-
step: g,
|
|
55
|
-
disabled: o || l.disabled,
|
|
56
|
-
className: "w-full",
|
|
57
|
-
"aria-label": "Percentage",
|
|
58
|
-
"data-testid": "percent-slider"
|
|
59
|
-
})]
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { i as n, o as t };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Input as n } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/PhoneField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ e({ PhoneField: () => a }), i = t();
|
|
6
|
-
function a({ value: e, onChange: t, field: r, readonly: a, errorMessage: o, ...s }) {
|
|
7
|
-
let c = r || s.schema;
|
|
8
|
-
if (a) return e ? /* @__PURE__ */ (0, i.jsx)("a", {
|
|
9
|
-
href: `tel:${e}`,
|
|
10
|
-
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
11
|
-
children: e
|
|
12
|
-
}) : /* @__PURE__ */ (0, i.jsx)("span", {
|
|
13
|
-
className: "text-sm",
|
|
14
|
-
children: "-"
|
|
15
|
-
});
|
|
16
|
-
let { inputType: l, ...u } = s;
|
|
17
|
-
return /* @__PURE__ */ (0, i.jsx)(n, {
|
|
18
|
-
...u,
|
|
19
|
-
type: "tel",
|
|
20
|
-
value: e || "",
|
|
21
|
-
onChange: (e) => t(e.target.value),
|
|
22
|
-
placeholder: c?.placeholder || "(555) 123-4567",
|
|
23
|
-
disabled: a || u.disabled,
|
|
24
|
-
"aria-invalid": !!o
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
export { r as n, a as t };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Textarea as n } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/RichTextField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ e({ RichTextField: () => a }), i = t();
|
|
6
|
-
function a({ value: e, onChange: t, field: r, readonly: a, errorMessage: o, ...s }) {
|
|
7
|
-
if (a) return /* @__PURE__ */ (0, i.jsx)("div", {
|
|
8
|
-
className: "text-sm prose prose-sm max-w-none",
|
|
9
|
-
children: e || "-"
|
|
10
|
-
});
|
|
11
|
-
let c = r || s.schema, l = c?.rows || 8;
|
|
12
|
-
return /* @__PURE__ */ (0, i.jsxs)("div", {
|
|
13
|
-
className: "space-y-2",
|
|
14
|
-
children: [/* @__PURE__ */ (0, i.jsxs)("div", {
|
|
15
|
-
className: "flex items-center justify-between text-xs text-gray-500",
|
|
16
|
-
children: [/* @__PURE__ */ (0, i.jsxs)("span", { children: ["Format: ", c?.format || "markdown"] }), /* @__PURE__ */ (0, i.jsx)("span", {
|
|
17
|
-
className: "italic",
|
|
18
|
-
children: "Rich text editor (basic)"
|
|
19
|
-
})]
|
|
20
|
-
}), /* @__PURE__ */ (0, i.jsx)(n, {
|
|
21
|
-
value: e || "",
|
|
22
|
-
onChange: (e) => t(e.target.value),
|
|
23
|
-
placeholder: c?.placeholder || "Enter text...",
|
|
24
|
-
disabled: a || s.disabled,
|
|
25
|
-
rows: l,
|
|
26
|
-
className: `font-mono text-sm ${s.className || ""}`,
|
|
27
|
-
"aria-invalid": !!o
|
|
28
|
-
})]
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { r as t };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import { t } from "./useFieldTranslation-C69OtouR.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { Select as n, SelectContent as r, SelectItem as i, SelectTrigger as a, SelectValue as o } from "@object-ui/components";
|
|
5
|
-
//#region ../fields/src/widgets/SelectField.tsx
|
|
6
|
-
var s = e();
|
|
7
|
-
function c({ value: e, onChange: c, field: l, readonly: u, ...d }) {
|
|
8
|
-
let f = l || d.schema, p = f?.options || [], { t: m } = t();
|
|
9
|
-
return u ? /* @__PURE__ */ (0, s.jsx)("span", {
|
|
10
|
-
className: "text-sm",
|
|
11
|
-
children: p.find((t) => t.value === e)?.label || e || "-"
|
|
12
|
-
}) : /* @__PURE__ */ (0, s.jsxs)(n, {
|
|
13
|
-
...d,
|
|
14
|
-
value: e,
|
|
15
|
-
onValueChange: c,
|
|
16
|
-
disabled: u || d.disabled,
|
|
17
|
-
children: [/* @__PURE__ */ (0, s.jsx)(a, {
|
|
18
|
-
className: d.className,
|
|
19
|
-
id: d.id,
|
|
20
|
-
children: /* @__PURE__ */ (0, s.jsx)(o, { placeholder: f?.placeholder || m("common.selectOption") })
|
|
21
|
-
}), /* @__PURE__ */ (0, s.jsx)(r, {
|
|
22
|
-
position: "popper",
|
|
23
|
-
children: p.map((e) => /* @__PURE__ */ (0, s.jsx)(i, {
|
|
24
|
-
value: e.value,
|
|
25
|
-
children: e.label
|
|
26
|
-
}, e.value))
|
|
27
|
-
})]
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
export { c as t };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
//#region ../fields/src/widgets/SummaryField.tsx
|
|
4
|
-
var n = /* @__PURE__ */ e({ SummaryField: () => i }), r = t();
|
|
5
|
-
function i({ value: e, field: t, ...n }) {
|
|
6
|
-
let i = (t || n.schema)?.summary_type || "count", a = "-";
|
|
7
|
-
return e != null && (a = i === "count" ? String(e) : [
|
|
8
|
-
"sum",
|
|
9
|
-
"avg",
|
|
10
|
-
"min",
|
|
11
|
-
"max"
|
|
12
|
-
].includes(i) && typeof e == "number" ? e.toFixed(2) : String(e)), /* @__PURE__ */ (0, r.jsx)("span", {
|
|
13
|
-
className: `text-sm font-medium tabular-nums text-gray-700 ${n.className || ""}`,
|
|
14
|
-
children: a
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { n as t };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Textarea as n } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/TextAreaField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ e({ TextAreaField: () => a }), i = t();
|
|
6
|
-
function a({ value: e, onChange: t, field: r, readonly: a, errorMessage: o, ...s }) {
|
|
7
|
-
if (a) return /* @__PURE__ */ (0, i.jsx)("div", {
|
|
8
|
-
className: "text-sm whitespace-pre-wrap",
|
|
9
|
-
children: e || "-"
|
|
10
|
-
});
|
|
11
|
-
let c = r || s.schema, l = c?.rows || 4, u = c?.max_length, { inputType: d, ...f } = s;
|
|
12
|
-
return /* @__PURE__ */ (0, i.jsxs)("div", {
|
|
13
|
-
className: "relative",
|
|
14
|
-
children: [/* @__PURE__ */ (0, i.jsx)(n, {
|
|
15
|
-
...f,
|
|
16
|
-
value: e || "",
|
|
17
|
-
onChange: (e) => t(e.target.value),
|
|
18
|
-
placeholder: c?.placeholder,
|
|
19
|
-
disabled: a || f.disabled,
|
|
20
|
-
rows: l,
|
|
21
|
-
maxLength: u,
|
|
22
|
-
"aria-invalid": !!o
|
|
23
|
-
}), u && /* @__PURE__ */ (0, i.jsxs)("div", {
|
|
24
|
-
className: "absolute bottom-2 right-2 text-xs text-gray-400",
|
|
25
|
-
"aria-live": "polite",
|
|
26
|
-
"aria-label": `Character count: ${(e || "").length} of ${u}`,
|
|
27
|
-
children: [
|
|
28
|
-
(e || "").length,
|
|
29
|
-
"/",
|
|
30
|
-
u
|
|
31
|
-
]
|
|
32
|
-
})]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { r as n, a as t };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Input as n, Textarea as r } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/TextField.tsx
|
|
5
|
-
var i = /* @__PURE__ */ e({ TextField: () => o }), a = t();
|
|
6
|
-
function o({ value: e, onChange: t, field: i, readonly: o, ...s }) {
|
|
7
|
-
let c = i || s.schema;
|
|
8
|
-
if (o) return /* @__PURE__ */ (0, a.jsx)("span", {
|
|
9
|
-
className: "text-sm",
|
|
10
|
-
children: e || "-"
|
|
11
|
-
});
|
|
12
|
-
let l = c?.rows, { inputType: u, ...d } = s;
|
|
13
|
-
return l && l > 1 ? /* @__PURE__ */ (0, a.jsx)(r, {
|
|
14
|
-
...d,
|
|
15
|
-
value: e || "",
|
|
16
|
-
onChange: (e) => t(e.target.value),
|
|
17
|
-
placeholder: c?.placeholder,
|
|
18
|
-
disabled: o || d.disabled
|
|
19
|
-
}) : /* @__PURE__ */ (0, a.jsx)(n, {
|
|
20
|
-
...d,
|
|
21
|
-
type: c?.type === "password" ? "password" : "text",
|
|
22
|
-
value: e || "",
|
|
23
|
-
onChange: (e) => t(e.target.value),
|
|
24
|
-
placeholder: c?.placeholder,
|
|
25
|
-
disabled: o || d.disabled
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { i as n, o as t };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Input as n } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/TimeField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ e({ TimeField: () => a }), i = t();
|
|
6
|
-
function a({ value: e, onChange: t, field: r, readonly: a, ...o }) {
|
|
7
|
-
if (a) return /* @__PURE__ */ (0, i.jsx)("span", {
|
|
8
|
-
className: "text-sm",
|
|
9
|
-
children: e || "-"
|
|
10
|
-
});
|
|
11
|
-
let { inputType: s, ...c } = o;
|
|
12
|
-
return /* @__PURE__ */ (0, i.jsx)(n, {
|
|
13
|
-
...c,
|
|
14
|
-
type: "time",
|
|
15
|
-
value: e || "",
|
|
16
|
-
onChange: (e) => t(e.target.value),
|
|
17
|
-
disabled: a || c.disabled
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { r as n, a as t };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Input as n } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/UrlField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ e({ UrlField: () => a }), i = t();
|
|
6
|
-
function a({ value: e, onChange: t, field: r, readonly: a, errorMessage: o, ...s }) {
|
|
7
|
-
let c = r || s.schema;
|
|
8
|
-
if (a) return e ? e.startsWith("http://") || e.startsWith("https://") ? /* @__PURE__ */ (0, i.jsx)("a", {
|
|
9
|
-
href: e,
|
|
10
|
-
target: "_blank",
|
|
11
|
-
rel: "noopener noreferrer",
|
|
12
|
-
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
13
|
-
children: e
|
|
14
|
-
}) : /* @__PURE__ */ (0, i.jsx)("span", {
|
|
15
|
-
className: "text-sm",
|
|
16
|
-
children: e
|
|
17
|
-
}) : /* @__PURE__ */ (0, i.jsx)("span", {
|
|
18
|
-
className: "text-sm",
|
|
19
|
-
children: "-"
|
|
20
|
-
});
|
|
21
|
-
let { inputType: l, ...u } = s;
|
|
22
|
-
return /* @__PURE__ */ (0, i.jsx)(n, {
|
|
23
|
-
...u,
|
|
24
|
-
type: "url",
|
|
25
|
-
value: e || "",
|
|
26
|
-
onChange: (e) => t(e.target.value),
|
|
27
|
-
placeholder: c?.placeholder || "https://example.com",
|
|
28
|
-
disabled: a || u.disabled,
|
|
29
|
-
"aria-invalid": !!o
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { r as n, a as t };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import { t as n } from "./x-BFq2GeQ5.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { Avatar as r, AvatarFallback as i, Badge as a } from "@object-ui/components";
|
|
5
|
-
//#region ../fields/src/widgets/UserField.tsx
|
|
6
|
-
var o = /* @__PURE__ */ e({ UserField: () => c }), s = t();
|
|
7
|
-
function c({ value: e, onChange: t, field: o, readonly: c, ...l }) {
|
|
8
|
-
let u = (o || l.schema)?.multiple || !1;
|
|
9
|
-
if (c) {
|
|
10
|
-
if (!e) return /* @__PURE__ */ (0, s.jsx)("span", {
|
|
11
|
-
className: "text-sm",
|
|
12
|
-
children: "-"
|
|
13
|
-
});
|
|
14
|
-
let t = Array.isArray(e) ? e : [e];
|
|
15
|
-
return /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
16
|
-
className: "flex -space-x-2",
|
|
17
|
-
children: [t.slice(0, 3).map((e, t) => {
|
|
18
|
-
let n = e.name || e.username || "User";
|
|
19
|
-
return /* @__PURE__ */ (0, s.jsx)(r, {
|
|
20
|
-
className: "size-8 border-2 border-white",
|
|
21
|
-
title: n,
|
|
22
|
-
children: /* @__PURE__ */ (0, s.jsx)(i, {
|
|
23
|
-
className: "bg-blue-500 text-white text-xs",
|
|
24
|
-
children: n.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
|
|
25
|
-
})
|
|
26
|
-
}, t);
|
|
27
|
-
}), t.length > 3 && /* @__PURE__ */ (0, s.jsx)(r, {
|
|
28
|
-
className: "size-8 border-2 border-white",
|
|
29
|
-
children: /* @__PURE__ */ (0, s.jsxs)(i, {
|
|
30
|
-
className: "bg-gray-200 text-gray-600 text-xs",
|
|
31
|
-
children: ["+", t.length - 3]
|
|
32
|
-
})
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
let d = e ? Array.isArray(e) ? e : [e] : [], f = (e) => {
|
|
37
|
-
if (u) {
|
|
38
|
-
let n = d.filter((t, n) => n !== e);
|
|
39
|
-
t(n.length > 0 ? n : null);
|
|
40
|
-
} else t(null);
|
|
41
|
-
};
|
|
42
|
-
return /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
43
|
-
className: l.className,
|
|
44
|
-
children: [d.length > 0 && /* @__PURE__ */ (0, s.jsx)("div", {
|
|
45
|
-
className: "flex flex-wrap gap-2 mb-2",
|
|
46
|
-
children: d.map((e, t) => {
|
|
47
|
-
let o = e.name || e.username || "User";
|
|
48
|
-
return /* @__PURE__ */ (0, s.jsxs)(a, {
|
|
49
|
-
variant: "outline",
|
|
50
|
-
className: "gap-2 pr-1",
|
|
51
|
-
children: [
|
|
52
|
-
/* @__PURE__ */ (0, s.jsx)(r, {
|
|
53
|
-
className: "size-5",
|
|
54
|
-
children: /* @__PURE__ */ (0, s.jsx)(i, {
|
|
55
|
-
className: "bg-blue-500 text-white text-xs",
|
|
56
|
-
children: o.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
|
|
57
|
-
})
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ (0, s.jsx)("span", {
|
|
60
|
-
className: "text-sm",
|
|
61
|
-
children: o
|
|
62
|
-
}),
|
|
63
|
-
/* @__PURE__ */ (0, s.jsx)("button", {
|
|
64
|
-
type: "button",
|
|
65
|
-
onClick: () => f(t),
|
|
66
|
-
className: "ml-1 rounded-full hover:bg-gray-200 p-0.5",
|
|
67
|
-
children: /* @__PURE__ */ (0, s.jsx)(n, { className: "size-3" })
|
|
68
|
-
})
|
|
69
|
-
]
|
|
70
|
-
}, t);
|
|
71
|
-
})
|
|
72
|
-
}), /* @__PURE__ */ (0, s.jsx)("div", {
|
|
73
|
-
className: "text-sm text-gray-500 italic",
|
|
74
|
-
children: "User selection component requires integration with user management system"
|
|
75
|
-
})]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
//#endregion
|
|
79
|
-
export { o as t };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
//#region ../fields/src/widgets/VectorField.tsx
|
|
4
|
-
var n = /* @__PURE__ */ e({ VectorField: () => i }), r = t();
|
|
5
|
-
function i({ value: e, field: t, ...n }) {
|
|
6
|
-
let i = (t || n.schema)?.dimensions || (Array.isArray(e) ? e.length : 0);
|
|
7
|
-
if (!e || !Array.isArray(e)) return /* @__PURE__ */ (0, r.jsx)("span", {
|
|
8
|
-
className: "text-sm text-gray-500",
|
|
9
|
-
children: "-"
|
|
10
|
-
});
|
|
11
|
-
let a = e.slice(0, 3).map((e) => {
|
|
12
|
-
let t = Number(e);
|
|
13
|
-
return isNaN(t) ? "0" : t.toFixed(4);
|
|
14
|
-
}).join(", ");
|
|
15
|
-
return /* @__PURE__ */ (0, r.jsxs)("div", {
|
|
16
|
-
className: `text-sm ${n.className || ""}`,
|
|
17
|
-
children: [/* @__PURE__ */ (0, r.jsxs)("span", {
|
|
18
|
-
className: "font-mono text-gray-700",
|
|
19
|
-
children: [
|
|
20
|
-
"[",
|
|
21
|
-
a,
|
|
22
|
-
"...]"
|
|
23
|
-
]
|
|
24
|
-
}), /* @__PURE__ */ (0, r.jsxs)("span", {
|
|
25
|
-
className: "text-gray-500 ml-2",
|
|
26
|
-
children: [
|
|
27
|
-
"(",
|
|
28
|
-
i,
|
|
29
|
-
"D)"
|
|
30
|
-
]
|
|
31
|
-
})]
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { n as t };
|