@object-ui/plugin-aggrid 3.1.3 → 3.1.4
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/.turbo/turbo-build.log +60 -91
- package/CHANGELOG.md +11 -0
- package/dist/AddressField-DKqaE9pD.js +93 -0
- package/dist/AgGridImpl-BD5cjyc0.js +226 -0
- package/dist/AutoNumberField-0RU2dNKe.js +13 -0
- package/dist/AvatarField-IZTLB0Ye.js +82 -0
- package/dist/BooleanField-DRzAZhSq.js +40 -0
- package/dist/CodeField-RWhnDMyL.js +22 -0
- package/dist/ColorField-B-YAFXdz.js +37 -0
- package/dist/CurrencyField-Bu80a-sI.js +51 -0
- package/dist/DateField-CV-NpLbM.js +21 -0
- package/dist/DateTimeField--YTsgTjw.js +32 -0
- package/dist/EmailField-B-3fWJsH.js +28 -0
- package/dist/FileField-DxxdESfc.js +160 -0
- package/dist/FormulaField-MQXJZOep.js +13 -0
- package/dist/GeolocationField-BzKgcWLN.js +156 -0
- package/dist/GridField-DHsGo9l2.js +51 -0
- package/dist/ImageField-DK7sUV6b.js +77 -0
- package/dist/LocationField-DSvhU9Dz.js +35 -0
- package/dist/LookupField-Dmzju5Q0.js +1033 -0
- package/dist/MasterDetailField-CPLHbe_Y.js +109 -0
- package/dist/NumberField-JaSlPVXs.js +26 -0
- package/dist/ObjectAgGridImpl-4uephlvO.js +19998 -0
- package/dist/ObjectField-FzUYlu-m.js +52 -0
- package/dist/PasswordField-d6E-vKBI.js +60 -0
- package/dist/PercentField-D2_kMuC_.js +63 -0
- package/dist/PhoneField-DOaMivd6.js +28 -0
- package/dist/QRCodeField-BIQhc73N.js +144 -0
- package/dist/RatingField-BKAGmlzh.js +42 -0
- package/dist/RichTextField-D4FIV9V8.js +32 -0
- package/dist/SelectField-C2gtlnLZ.js +30 -0
- package/dist/SignatureField-fFEb0h_C.js +98 -0
- package/dist/SliderField-BlAlK3g2.js +34 -0
- package/dist/SummaryField-Dy2Kkj6M.js +18 -0
- package/dist/TextAreaField-BCUkjKTc.js +36 -0
- package/dist/TextField-XWOnbUrk.js +29 -0
- package/dist/TimeField-CZdzdqOO.js +21 -0
- package/dist/UrlField-sq1mpRoG.js +33 -0
- package/dist/UserField-Dqk38Arc.js +79 -0
- package/dist/VectorField-CY70VLiW.js +35 -0
- package/dist/createLucideIcon-CWx7zIL1.js +39 -0
- package/dist/image-Cm7ExMY2.js +24 -0
- package/dist/index.css +2 -1
- package/dist/index.js +503 -8
- package/dist/index.umd.cjs +116 -112
- package/dist/jsx-runtime-CGDkM_Jn.js +189 -0
- package/dist/plus-CsEgF66K.js +10 -0
- package/dist/upload-B1x-ueFd.js +17 -0
- package/dist/x-Bwhzfvtg.js +10 -0
- package/package.json +9 -9
- package/dist/AddressField-CKC4ZJAb.js +0 -95
- package/dist/AgGridImpl-Da1-9kQm.js +0 -229
- package/dist/AutoNumberField-DUIGHfEs.js +0 -8
- package/dist/FileField-VTTCu1Mi.js +0 -144
- package/dist/FormulaField-Db3yTWbM.js +0 -9
- package/dist/GeolocationField-CEWtxddT.js +0 -141
- package/dist/GridField-Doeh0ghH.js +0 -29
- package/dist/LocationField-BF0sYg0h.js +0 -33
- package/dist/MasterDetailField-EG8aGKCm.js +0 -113
- package/dist/ObjectAgGridImpl-BQKWGygD.js +0 -28987
- package/dist/ObjectField-C63JFk2A.js +0 -51
- package/dist/QRCodeField-DnYB9SbX.js +0 -96
- package/dist/RichTextField-DJFKaCj6.js +0 -37
- package/dist/SignatureField-DdhPdmDm.js +0 -96
- package/dist/SummaryField-qwokC_TB.js +0 -9
- package/dist/UserField-BGSE0B99.js +0 -49
- package/dist/VectorField-MkcitfSl.js +0 -25
- package/dist/index-CTPRjgpn.js +0 -662
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { j as s } from "./index-CTPRjgpn.js";
|
|
2
|
-
import { useRef as R, useState as D, useCallback as h } from "react";
|
|
3
|
-
import { Button as B } from "@object-ui/components";
|
|
4
|
-
import { c as E, U as M, I as P, X as U } from "./ObjectAgGridImpl-BQKWGygD.js";
|
|
5
|
-
const $ = [
|
|
6
|
-
[
|
|
7
|
-
"path",
|
|
8
|
-
{
|
|
9
|
-
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
10
|
-
key: "1oefj6"
|
|
11
|
-
}
|
|
12
|
-
],
|
|
13
|
-
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
|
|
14
|
-
], C = E("file", $);
|
|
15
|
-
function V({ value: n, onChange: i, field: k, readonly: F, ...N }) {
|
|
16
|
-
const g = R(null), l = k || N.schema, m = l?.multiple || !1, d = l?.accept ? l.accept.join(",") : void 0, p = l?.maxSize, [j, y] = D(!1), [v, w] = D([]), c = n ? Array.isArray(n) ? n : [n] : [], x = h((e) => {
|
|
17
|
-
if (e.length === 0) return;
|
|
18
|
-
const t = [], a = e.filter((r) => {
|
|
19
|
-
if (p && r.size > p) {
|
|
20
|
-
const u = (p / 1048576).toFixed(1);
|
|
21
|
-
return t.push(`"${r.name}" exceeds max size (${u} MB)`), !1;
|
|
22
|
-
}
|
|
23
|
-
return !0;
|
|
24
|
-
});
|
|
25
|
-
if (w(t), a.length === 0) return;
|
|
26
|
-
const o = a.map((r) => ({
|
|
27
|
-
name: r.name,
|
|
28
|
-
original_name: r.name,
|
|
29
|
-
size: r.size,
|
|
30
|
-
mime_type: r.type,
|
|
31
|
-
// In a real implementation, this would upload the file and return a URL
|
|
32
|
-
url: URL.createObjectURL(r)
|
|
33
|
-
}));
|
|
34
|
-
i(m ? [...c, ...o] : o[0]);
|
|
35
|
-
}, [c, m, i, p]), _ = h((e) => {
|
|
36
|
-
e.preventDefault(), e.stopPropagation(), y(!0);
|
|
37
|
-
}, []), A = h((e) => {
|
|
38
|
-
e.preventDefault(), e.stopPropagation(), y(!1);
|
|
39
|
-
}, []), L = h((e) => {
|
|
40
|
-
e.preventDefault(), e.stopPropagation(), y(!1);
|
|
41
|
-
const t = Array.from(e.dataTransfer.files);
|
|
42
|
-
if (d) {
|
|
43
|
-
const a = d.split(",").map((r) => r.trim().toLowerCase()), o = t.filter((r) => {
|
|
44
|
-
const u = r.name.split("."), z = u.length > 1 ? "." + u.pop()?.toLowerCase() : "";
|
|
45
|
-
return a.some(
|
|
46
|
-
(f) => f === r.type || z && f === z || f.endsWith("/*") && r.type.startsWith(f.replace("/*", "/"))
|
|
47
|
-
);
|
|
48
|
-
});
|
|
49
|
-
x(o);
|
|
50
|
-
} else
|
|
51
|
-
x(t);
|
|
52
|
-
}, [d, x]);
|
|
53
|
-
if (F) {
|
|
54
|
-
if (!n) return /* @__PURE__ */ s.jsx("span", { className: "text-sm", children: "-" });
|
|
55
|
-
const e = Array.isArray(n) ? n : [n];
|
|
56
|
-
return /* @__PURE__ */ s.jsx("div", { className: "flex flex-wrap gap-2", children: e.map((t, a) => /* @__PURE__ */ s.jsx("span", { className: "text-sm truncate max-w-xs", children: t.name || t.original_name || "File" }, a)) });
|
|
57
|
-
}
|
|
58
|
-
const I = (e) => {
|
|
59
|
-
x(Array.from(e.target.files || []));
|
|
60
|
-
}, O = (e) => {
|
|
61
|
-
if (m) {
|
|
62
|
-
const t = c.filter((a, o) => o !== e);
|
|
63
|
-
i(t.length > 0 ? t : null);
|
|
64
|
-
} else
|
|
65
|
-
i(null);
|
|
66
|
-
}, b = (e) => (e.mime_type || "").startsWith("image/");
|
|
67
|
-
return /* @__PURE__ */ s.jsxs("div", { className: N.className, children: [
|
|
68
|
-
/* @__PURE__ */ s.jsx(
|
|
69
|
-
"input",
|
|
70
|
-
{
|
|
71
|
-
ref: g,
|
|
72
|
-
type: "file",
|
|
73
|
-
multiple: m,
|
|
74
|
-
accept: d,
|
|
75
|
-
onChange: I,
|
|
76
|
-
className: "hidden"
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
/* @__PURE__ */ s.jsxs("div", { className: "space-y-2", children: [
|
|
80
|
-
/* @__PURE__ */ s.jsxs(
|
|
81
|
-
"div",
|
|
82
|
-
{
|
|
83
|
-
onDragOver: _,
|
|
84
|
-
onDragLeave: A,
|
|
85
|
-
onDrop: L,
|
|
86
|
-
onClick: () => g.current?.click(),
|
|
87
|
-
className: `
|
|
88
|
-
flex flex-col items-center justify-center gap-2 p-6
|
|
89
|
-
border-2 border-dashed rounded-lg cursor-pointer
|
|
90
|
-
transition-colors duration-200
|
|
91
|
-
${j ? "border-primary bg-primary/5 text-primary" : "border-muted-foreground/25 hover:border-primary/50 text-muted-foreground hover:text-foreground"}
|
|
92
|
-
`,
|
|
93
|
-
role: "button",
|
|
94
|
-
tabIndex: 0,
|
|
95
|
-
onKeyDown: (e) => {
|
|
96
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), g.current?.click());
|
|
97
|
-
},
|
|
98
|
-
children: [
|
|
99
|
-
/* @__PURE__ */ s.jsx(M, { className: `size-8 ${j ? "text-primary" : "text-muted-foreground"}` }),
|
|
100
|
-
/* @__PURE__ */ s.jsxs("div", { className: "text-center", children: [
|
|
101
|
-
/* @__PURE__ */ s.jsx("p", { className: "text-sm font-medium", children: j ? "Drop files here" : "Drag & drop files here" }),
|
|
102
|
-
/* @__PURE__ */ s.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "or click to browse" })
|
|
103
|
-
] })
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
),
|
|
107
|
-
v.length > 0 && /* @__PURE__ */ s.jsx("div", { className: "space-y-0.5", children: v.map((e, t) => /* @__PURE__ */ s.jsx("p", { className: "text-xs text-destructive", children: e }, t)) }),
|
|
108
|
-
c.length > 0 && /* @__PURE__ */ s.jsx("div", { className: "space-y-1", children: c.map((e, t) => /* @__PURE__ */ s.jsxs(
|
|
109
|
-
"div",
|
|
110
|
-
{
|
|
111
|
-
className: "flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",
|
|
112
|
-
children: [
|
|
113
|
-
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
114
|
-
b(e) && e.url ? /* @__PURE__ */ s.jsx("img", { src: e.url, alt: e.name, className: "size-8 object-cover rounded flex-shrink-0" }) : b(e) ? /* @__PURE__ */ s.jsx(P, { className: "size-4 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ s.jsx(C, { className: "size-4 text-muted-foreground flex-shrink-0" }),
|
|
115
|
-
/* @__PURE__ */ s.jsx("span", { className: "text-sm truncate", children: e.name || e.original_name || "File" }),
|
|
116
|
-
e.size && /* @__PURE__ */ s.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
117
|
-
"(",
|
|
118
|
-
(e.size / 1024).toFixed(1),
|
|
119
|
-
" KB)"
|
|
120
|
-
] })
|
|
121
|
-
] }),
|
|
122
|
-
/* @__PURE__ */ s.jsx(
|
|
123
|
-
B,
|
|
124
|
-
{
|
|
125
|
-
type: "button",
|
|
126
|
-
variant: "ghost",
|
|
127
|
-
size: "sm",
|
|
128
|
-
onClick: (a) => {
|
|
129
|
-
a.stopPropagation(), O(t);
|
|
130
|
-
},
|
|
131
|
-
className: "h-6 w-6 p-0",
|
|
132
|
-
children: /* @__PURE__ */ s.jsx(U, { className: "size-3" })
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
]
|
|
136
|
-
},
|
|
137
|
-
t
|
|
138
|
-
)) })
|
|
139
|
-
] })
|
|
140
|
-
] });
|
|
141
|
-
}
|
|
142
|
-
export {
|
|
143
|
-
V as FileField
|
|
144
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { j as s } from "./index-CTPRjgpn.js";
|
|
2
|
-
function m({ value: e, field: o, ...r }) {
|
|
3
|
-
const n = (o || r.schema)?.return_type || "text";
|
|
4
|
-
let t = "-";
|
|
5
|
-
return e != null && (n === "number" || n === "currency" ? t = typeof e == "number" ? e.toFixed(2) : String(e) : n === "boolean" ? t = e ? "Yes" : "No" : n === "date" ? t = new Date(e).toLocaleDateString() : t = String(e)), /* @__PURE__ */ s.jsx("span", { className: `text-sm font-mono text-gray-700 ${r.className || ""}`, children: t });
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
m as FormulaField
|
|
9
|
-
};
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./index-CTPRjgpn.js";
|
|
2
|
-
import f from "react";
|
|
3
|
-
import { Button as n, Label as m, Input as x } from "@object-ui/components";
|
|
4
|
-
import { c as h } from "./ObjectAgGridImpl-BQKWGygD.js";
|
|
5
|
-
const b = [
|
|
6
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
7
|
-
["line", { x1: "22", x2: "18", y1: "12", y2: "12", key: "l9bcsi" }],
|
|
8
|
-
["line", { x1: "6", x2: "2", y1: "12", y2: "12", key: "13hhkx" }],
|
|
9
|
-
["line", { x1: "12", x2: "12", y1: "6", y2: "2", key: "10w3f3" }],
|
|
10
|
-
["line", { x1: "12", x2: "12", y1: "22", y2: "18", key: "15g9kq" }]
|
|
11
|
-
], N = h("crosshair", b);
|
|
12
|
-
const v = [
|
|
13
|
-
[
|
|
14
|
-
"path",
|
|
15
|
-
{
|
|
16
|
-
d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",
|
|
17
|
-
key: "1r0f0z"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }]
|
|
21
|
-
], g = h("map-pin", v);
|
|
22
|
-
function _({ value: p, onChange: c, field: k, readonly: a, ...s }) {
|
|
23
|
-
const [l, o] = f.useState(!1), i = p || {}, r = (e, u) => {
|
|
24
|
-
c({
|
|
25
|
-
...i,
|
|
26
|
-
[e]: u ? Number(u) : void 0
|
|
27
|
-
});
|
|
28
|
-
}, y = () => {
|
|
29
|
-
if (!navigator.geolocation) {
|
|
30
|
-
console.error("Geolocation is not supported by this browser");
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
o(!0), navigator.geolocation.getCurrentPosition(
|
|
34
|
-
(e) => {
|
|
35
|
-
c({
|
|
36
|
-
latitude: e.coords.latitude,
|
|
37
|
-
longitude: e.coords.longitude,
|
|
38
|
-
accuracy: e.coords.accuracy
|
|
39
|
-
}), o(!1);
|
|
40
|
-
},
|
|
41
|
-
(e) => {
|
|
42
|
-
console.error("Error getting location:", e.message), o(!1);
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
enableHighAccuracy: !0,
|
|
46
|
-
timeout: 5e3,
|
|
47
|
-
maximumAge: 0
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
}, j = (e) => !e.latitude || !e.longitude ? "-" : `${e.latitude.toFixed(6)}, ${e.longitude.toFixed(6)}`, d = () => {
|
|
51
|
-
if (!i.latitude || !i.longitude) return;
|
|
52
|
-
const e = `https://www.google.com/maps?q=${i.latitude},${i.longitude}`;
|
|
53
|
-
window.open(e, "_blank");
|
|
54
|
-
};
|
|
55
|
-
return a ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
56
|
-
/* @__PURE__ */ t.jsx(g, { className: "w-4 h-4 text-muted-foreground" }),
|
|
57
|
-
/* @__PURE__ */ t.jsx("span", { className: "text-sm", children: j(i) }),
|
|
58
|
-
i.latitude && i.longitude && /* @__PURE__ */ t.jsx(
|
|
59
|
-
n,
|
|
60
|
-
{
|
|
61
|
-
type: "button",
|
|
62
|
-
variant: "link",
|
|
63
|
-
size: "sm",
|
|
64
|
-
onClick: d,
|
|
65
|
-
className: "p-0 h-auto",
|
|
66
|
-
children: "View on map"
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
] }) : /* @__PURE__ */ t.jsxs("div", { className: "space-y-3", children: [
|
|
70
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
71
|
-
/* @__PURE__ */ t.jsxs(
|
|
72
|
-
n,
|
|
73
|
-
{
|
|
74
|
-
type: "button",
|
|
75
|
-
variant: "outline",
|
|
76
|
-
size: "sm",
|
|
77
|
-
onClick: y,
|
|
78
|
-
disabled: a || l,
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ t.jsx(N, { className: "w-4 h-4 mr-2" }),
|
|
81
|
-
l ? "Getting location..." : "Use Current Location"
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
i.latitude && i.longitude && /* @__PURE__ */ t.jsxs(
|
|
86
|
-
n,
|
|
87
|
-
{
|
|
88
|
-
type: "button",
|
|
89
|
-
variant: "link",
|
|
90
|
-
size: "sm",
|
|
91
|
-
onClick: d,
|
|
92
|
-
children: [
|
|
93
|
-
/* @__PURE__ */ t.jsx(g, { className: "w-4 h-4 mr-2" }),
|
|
94
|
-
"View on map"
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
] }),
|
|
99
|
-
/* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
100
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
101
|
-
/* @__PURE__ */ t.jsx(m, { htmlFor: "latitude", className: "text-xs", children: "Latitude" }),
|
|
102
|
-
/* @__PURE__ */ t.jsx(
|
|
103
|
-
x,
|
|
104
|
-
{
|
|
105
|
-
id: "latitude",
|
|
106
|
-
type: "number",
|
|
107
|
-
value: i.latitude ?? "",
|
|
108
|
-
onChange: (e) => r("latitude", e.target.value),
|
|
109
|
-
placeholder: "37.7749",
|
|
110
|
-
disabled: a || s.disabled,
|
|
111
|
-
step: "any",
|
|
112
|
-
className: s.className
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
] }),
|
|
116
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
117
|
-
/* @__PURE__ */ t.jsx(m, { htmlFor: "longitude", className: "text-xs", children: "Longitude" }),
|
|
118
|
-
/* @__PURE__ */ t.jsx(
|
|
119
|
-
x,
|
|
120
|
-
{
|
|
121
|
-
id: "longitude",
|
|
122
|
-
type: "number",
|
|
123
|
-
value: i.longitude ?? "",
|
|
124
|
-
onChange: (e) => r("longitude", e.target.value),
|
|
125
|
-
placeholder: "-122.4194",
|
|
126
|
-
disabled: a || s.disabled,
|
|
127
|
-
step: "any"
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
] })
|
|
131
|
-
] }),
|
|
132
|
-
i.accuracy && /* @__PURE__ */ t.jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
133
|
-
"Accuracy: ±",
|
|
134
|
-
i.accuracy.toFixed(0),
|
|
135
|
-
"m"
|
|
136
|
-
] })
|
|
137
|
-
] });
|
|
138
|
-
}
|
|
139
|
-
export {
|
|
140
|
-
_ as GeolocationField
|
|
141
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./index-CTPRjgpn.js";
|
|
2
|
-
import { cn as a } from "@object-ui/components";
|
|
3
|
-
function u({ value: r, field: i, readonly: l, ...d }) {
|
|
4
|
-
const n = (i || d.schema)?.columns || [];
|
|
5
|
-
return !r || !Array.isArray(r) ? /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: "-" }) : l ? /* @__PURE__ */ e.jsx("div", { className: a("text-sm", d.className), children: /* @__PURE__ */ e.jsxs("span", { className: "text-foreground", children: [
|
|
6
|
-
r.length,
|
|
7
|
-
" rows"
|
|
8
|
-
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: a("border border-border rounded-lg overflow-hidden", d.className), children: [
|
|
9
|
-
/* @__PURE__ */ e.jsx("div", { className: "overflow-auto max-h-60", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full text-sm", children: [
|
|
10
|
-
/* @__PURE__ */ e.jsx("thead", { className: "bg-muted border-b border-border", children: /* @__PURE__ */ e.jsx("tr", { children: n.map((s, t) => /* @__PURE__ */ e.jsx(
|
|
11
|
-
"th",
|
|
12
|
-
{
|
|
13
|
-
className: "px-3 py-2 text-left text-xs font-medium text-muted-foreground",
|
|
14
|
-
children: s.label || s.name
|
|
15
|
-
},
|
|
16
|
-
t
|
|
17
|
-
)) }) }),
|
|
18
|
-
/* @__PURE__ */ e.jsx("tbody", { className: "divide-y divide-border", children: r.slice(0, 5).map((s, t) => /* @__PURE__ */ e.jsx("tr", { className: "hover:bg-muted/50 transition-colors", children: n.map((o, m) => /* @__PURE__ */ e.jsx("td", { className: "px-3 py-2 text-foreground", children: s[o.name] != null ? String(s[o.name]) : "-" }, m)) }, t)) })
|
|
19
|
-
] }) }),
|
|
20
|
-
r.length > 5 && /* @__PURE__ */ e.jsxs("div", { className: "bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border", children: [
|
|
21
|
-
"Showing 5 of ",
|
|
22
|
-
r.length,
|
|
23
|
-
" rows"
|
|
24
|
-
] })
|
|
25
|
-
] });
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
u as GridField
|
|
29
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { j as r } from "./index-CTPRjgpn.js";
|
|
2
|
-
import { Input as f } from "@object-ui/components";
|
|
3
|
-
function x({ value: t, onChange: l, field: d, readonly: i, ...a }) {
|
|
4
|
-
const m = d || a.schema, n = t && typeof t == "object" ? `${t.latitude || 0}, ${t.longitude || 0}` : "";
|
|
5
|
-
if (i)
|
|
6
|
-
return /* @__PURE__ */ r.jsx("span", { className: "text-sm", children: n || "-" });
|
|
7
|
-
const u = (p) => {
|
|
8
|
-
const o = p.target.value;
|
|
9
|
-
if (!o.trim()) {
|
|
10
|
-
l(null);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const s = o.split(",").map((e) => e.trim());
|
|
14
|
-
if (s.length === 2) {
|
|
15
|
-
const e = parseFloat(s[0]), c = parseFloat(s[1]);
|
|
16
|
-
!isNaN(e) && !isNaN(c) && l({ latitude: e, longitude: c });
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
return /* @__PURE__ */ r.jsx(
|
|
20
|
-
f,
|
|
21
|
-
{
|
|
22
|
-
type: "text",
|
|
23
|
-
value: n,
|
|
24
|
-
onChange: u,
|
|
25
|
-
placeholder: m?.placeholder || "latitude, longitude",
|
|
26
|
-
disabled: i || a.disabled,
|
|
27
|
-
className: a.className
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
x as LocationField
|
|
33
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./index-CTPRjgpn.js";
|
|
2
|
-
import { Button as a, cn as c, Badge as b } from "@object-ui/components";
|
|
3
|
-
import { c as f, X as N, P as g } from "./ObjectAgGridImpl-BQKWGygD.js";
|
|
4
|
-
const v = [
|
|
5
|
-
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
6
|
-
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
7
|
-
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
8
|
-
], i = f("external-link", v);
|
|
9
|
-
function R({
|
|
10
|
-
value: o,
|
|
11
|
-
onChange: l,
|
|
12
|
-
field: x,
|
|
13
|
-
readonly: m,
|
|
14
|
-
className: n,
|
|
15
|
-
...d
|
|
16
|
-
}) {
|
|
17
|
-
const t = o || [], h = x || d.schema, u = () => {
|
|
18
|
-
const s = {
|
|
19
|
-
id: `new-${Date.now()}`,
|
|
20
|
-
label: "New Related Record"
|
|
21
|
-
};
|
|
22
|
-
l([...t, s]);
|
|
23
|
-
}, j = (s) => {
|
|
24
|
-
l(t.filter((p) => p.id !== s));
|
|
25
|
-
}, r = (s) => {
|
|
26
|
-
console.log("View detail:", s);
|
|
27
|
-
};
|
|
28
|
-
return m ? /* @__PURE__ */ e.jsxs("div", { className: c("space-y-2", n), children: [
|
|
29
|
-
t.length === 0 ? /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: "No related records" }) : t.map((s) => /* @__PURE__ */ e.jsxs(
|
|
30
|
-
"div",
|
|
31
|
-
{
|
|
32
|
-
className: "flex items-center justify-between p-2 border rounded hover:bg-muted/50",
|
|
33
|
-
children: [
|
|
34
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm", children: s.label }),
|
|
35
|
-
/* @__PURE__ */ e.jsx(
|
|
36
|
-
a,
|
|
37
|
-
{
|
|
38
|
-
type: "button",
|
|
39
|
-
variant: "ghost",
|
|
40
|
-
size: "sm",
|
|
41
|
-
onClick: () => r(s),
|
|
42
|
-
children: /* @__PURE__ */ e.jsx(i, { className: "w-4 h-4" })
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
s.id
|
|
48
|
-
)),
|
|
49
|
-
/* @__PURE__ */ e.jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
50
|
-
t.length,
|
|
51
|
-
" ",
|
|
52
|
-
t.length === 1 ? "record" : "records"
|
|
53
|
-
] })
|
|
54
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className: c("space-y-3", n), children: [
|
|
55
|
-
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
56
|
-
t.map((s) => /* @__PURE__ */ e.jsxs(
|
|
57
|
-
"div",
|
|
58
|
-
{
|
|
59
|
-
className: "flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",
|
|
60
|
-
children: [
|
|
61
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
62
|
-
/* @__PURE__ */ e.jsx(b, { variant: "outline", children: s.id }),
|
|
63
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm flex-1", children: s.label })
|
|
64
|
-
] }),
|
|
65
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
66
|
-
/* @__PURE__ */ e.jsx(
|
|
67
|
-
a,
|
|
68
|
-
{
|
|
69
|
-
type: "button",
|
|
70
|
-
variant: "ghost",
|
|
71
|
-
size: "sm",
|
|
72
|
-
onClick: () => r(s),
|
|
73
|
-
children: /* @__PURE__ */ e.jsx(i, { className: "w-4 h-4" })
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
/* @__PURE__ */ e.jsx(
|
|
77
|
-
a,
|
|
78
|
-
{
|
|
79
|
-
type: "button",
|
|
80
|
-
variant: "ghost",
|
|
81
|
-
size: "sm",
|
|
82
|
-
onClick: () => j(s.id),
|
|
83
|
-
disabled: d.disabled,
|
|
84
|
-
children: /* @__PURE__ */ e.jsx(N, { className: "w-4 h-4" })
|
|
85
|
-
}
|
|
86
|
-
)
|
|
87
|
-
] })
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
|
-
s.id
|
|
91
|
-
)),
|
|
92
|
-
t.length === 0 && /* @__PURE__ */ e.jsx("div", { className: "text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20", children: "No related records" })
|
|
93
|
-
] }),
|
|
94
|
-
/* @__PURE__ */ e.jsxs(
|
|
95
|
-
a,
|
|
96
|
-
{
|
|
97
|
-
type: "button",
|
|
98
|
-
variant: "outline",
|
|
99
|
-
className: "w-full",
|
|
100
|
-
onClick: u,
|
|
101
|
-
disabled: d.disabled,
|
|
102
|
-
children: [
|
|
103
|
-
/* @__PURE__ */ e.jsx(g, { className: "w-4 h-4 mr-2" }),
|
|
104
|
-
"Add ",
|
|
105
|
-
h?.label || "Record"
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
] });
|
|
110
|
-
}
|
|
111
|
-
export {
|
|
112
|
-
R as MasterDetailField
|
|
113
|
-
};
|