@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.
Files changed (68) hide show
  1. package/.turbo/turbo-build.log +60 -91
  2. package/CHANGELOG.md +11 -0
  3. package/dist/AddressField-DKqaE9pD.js +93 -0
  4. package/dist/AgGridImpl-BD5cjyc0.js +226 -0
  5. package/dist/AutoNumberField-0RU2dNKe.js +13 -0
  6. package/dist/AvatarField-IZTLB0Ye.js +82 -0
  7. package/dist/BooleanField-DRzAZhSq.js +40 -0
  8. package/dist/CodeField-RWhnDMyL.js +22 -0
  9. package/dist/ColorField-B-YAFXdz.js +37 -0
  10. package/dist/CurrencyField-Bu80a-sI.js +51 -0
  11. package/dist/DateField-CV-NpLbM.js +21 -0
  12. package/dist/DateTimeField--YTsgTjw.js +32 -0
  13. package/dist/EmailField-B-3fWJsH.js +28 -0
  14. package/dist/FileField-DxxdESfc.js +160 -0
  15. package/dist/FormulaField-MQXJZOep.js +13 -0
  16. package/dist/GeolocationField-BzKgcWLN.js +156 -0
  17. package/dist/GridField-DHsGo9l2.js +51 -0
  18. package/dist/ImageField-DK7sUV6b.js +77 -0
  19. package/dist/LocationField-DSvhU9Dz.js +35 -0
  20. package/dist/LookupField-Dmzju5Q0.js +1033 -0
  21. package/dist/MasterDetailField-CPLHbe_Y.js +109 -0
  22. package/dist/NumberField-JaSlPVXs.js +26 -0
  23. package/dist/ObjectAgGridImpl-4uephlvO.js +19998 -0
  24. package/dist/ObjectField-FzUYlu-m.js +52 -0
  25. package/dist/PasswordField-d6E-vKBI.js +60 -0
  26. package/dist/PercentField-D2_kMuC_.js +63 -0
  27. package/dist/PhoneField-DOaMivd6.js +28 -0
  28. package/dist/QRCodeField-BIQhc73N.js +144 -0
  29. package/dist/RatingField-BKAGmlzh.js +42 -0
  30. package/dist/RichTextField-D4FIV9V8.js +32 -0
  31. package/dist/SelectField-C2gtlnLZ.js +30 -0
  32. package/dist/SignatureField-fFEb0h_C.js +98 -0
  33. package/dist/SliderField-BlAlK3g2.js +34 -0
  34. package/dist/SummaryField-Dy2Kkj6M.js +18 -0
  35. package/dist/TextAreaField-BCUkjKTc.js +36 -0
  36. package/dist/TextField-XWOnbUrk.js +29 -0
  37. package/dist/TimeField-CZdzdqOO.js +21 -0
  38. package/dist/UrlField-sq1mpRoG.js +33 -0
  39. package/dist/UserField-Dqk38Arc.js +79 -0
  40. package/dist/VectorField-CY70VLiW.js +35 -0
  41. package/dist/createLucideIcon-CWx7zIL1.js +39 -0
  42. package/dist/image-Cm7ExMY2.js +24 -0
  43. package/dist/index.css +2 -1
  44. package/dist/index.js +503 -8
  45. package/dist/index.umd.cjs +116 -112
  46. package/dist/jsx-runtime-CGDkM_Jn.js +189 -0
  47. package/dist/plus-CsEgF66K.js +10 -0
  48. package/dist/upload-B1x-ueFd.js +17 -0
  49. package/dist/x-Bwhzfvtg.js +10 -0
  50. package/package.json +9 -9
  51. package/dist/AddressField-CKC4ZJAb.js +0 -95
  52. package/dist/AgGridImpl-Da1-9kQm.js +0 -229
  53. package/dist/AutoNumberField-DUIGHfEs.js +0 -8
  54. package/dist/FileField-VTTCu1Mi.js +0 -144
  55. package/dist/FormulaField-Db3yTWbM.js +0 -9
  56. package/dist/GeolocationField-CEWtxddT.js +0 -141
  57. package/dist/GridField-Doeh0ghH.js +0 -29
  58. package/dist/LocationField-BF0sYg0h.js +0 -33
  59. package/dist/MasterDetailField-EG8aGKCm.js +0 -113
  60. package/dist/ObjectAgGridImpl-BQKWGygD.js +0 -28987
  61. package/dist/ObjectField-C63JFk2A.js +0 -51
  62. package/dist/QRCodeField-DnYB9SbX.js +0 -96
  63. package/dist/RichTextField-DJFKaCj6.js +0 -37
  64. package/dist/SignatureField-DdhPdmDm.js +0 -96
  65. package/dist/SummaryField-qwokC_TB.js +0 -9
  66. package/dist/UserField-BGSE0B99.js +0 -49
  67. package/dist/VectorField-MkcitfSl.js +0 -25
  68. package/dist/index-CTPRjgpn.js +0 -662
@@ -0,0 +1,37 @@
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/ColorField.tsx
5
+ var r = /* @__PURE__ */ e({ ColorField: () => a }), i = t();
6
+ function a({ value: e, onChange: t, field: r, readonly: a, ...o }) {
7
+ let s = r || o.schema;
8
+ return a ? /* @__PURE__ */ (0, i.jsxs)("div", {
9
+ className: "flex items-center gap-2",
10
+ children: [/* @__PURE__ */ (0, i.jsx)("div", {
11
+ className: "w-6 h-6 rounded border border-input",
12
+ style: { backgroundColor: e || "#000000" }
13
+ }), /* @__PURE__ */ (0, i.jsx)("span", {
14
+ className: "text-sm",
15
+ children: e || "-"
16
+ })]
17
+ }) : /* @__PURE__ */ (0, i.jsxs)("div", {
18
+ className: "flex items-center gap-2",
19
+ children: [/* @__PURE__ */ (0, i.jsx)("input", {
20
+ type: "color",
21
+ value: e || "#000000",
22
+ onChange: (e) => t(e.target.value),
23
+ disabled: a || o.disabled,
24
+ className: "w-10 h-10 rounded border border-input cursor-pointer"
25
+ }), /* @__PURE__ */ (0, i.jsx)(n, {
26
+ type: "text",
27
+ value: e || "",
28
+ onChange: (e) => t(e.target.value),
29
+ placeholder: s?.placeholder || "#000000",
30
+ disabled: a || o.disabled,
31
+ className: o.className,
32
+ pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
33
+ })]
34
+ });
35
+ }
36
+ //#endregion
37
+ export { r as n, a as t };
@@ -0,0 +1,51 @@
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/CurrencyField.tsx
5
+ var r = /* @__PURE__ */ e({ CurrencyField: () => o }), i = t();
6
+ function a(e, t = "USD") {
7
+ try {
8
+ return new Intl.NumberFormat("en-US", {
9
+ style: "currency",
10
+ currency: t
11
+ }).format(e);
12
+ } catch {
13
+ return `${t} ${e.toFixed(2)}`;
14
+ }
15
+ }
16
+ function o({ value: e, onChange: t, field: r, readonly: o, errorMessage: s, className: c, ...l }) {
17
+ let u = r || l.schema, d = u?.currency || "USD", f = u?.precision ?? 2;
18
+ if (o) return e == null ? /* @__PURE__ */ (0, i.jsx)("span", {
19
+ className: "text-sm",
20
+ children: "-"
21
+ }) : /* @__PURE__ */ (0, i.jsx)("span", {
22
+ className: "text-sm font-medium tabular-nums",
23
+ children: a(Number(e), d)
24
+ });
25
+ let p = (e) => {
26
+ let n = parseFloat(e.target.value);
27
+ isNaN(n) || t(parseFloat(n.toFixed(f)));
28
+ };
29
+ return /* @__PURE__ */ (0, i.jsxs)("div", {
30
+ className: "relative",
31
+ children: [/* @__PURE__ */ (0, i.jsx)("span", {
32
+ className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
33
+ children: d === "USD" ? "$" : d
34
+ }), /* @__PURE__ */ (0, i.jsx)(n, {
35
+ ...l,
36
+ type: "number",
37
+ value: e ?? "",
38
+ onChange: (e) => {
39
+ t(e.target.value === "" ? null : parseFloat(e.target.value));
40
+ },
41
+ onBlur: p,
42
+ placeholder: u?.placeholder || "0.00",
43
+ disabled: o || l.disabled,
44
+ className: `pl-8 ${c || ""}`,
45
+ step: (10 ** -f).toFixed(f),
46
+ "aria-invalid": !!s
47
+ })]
48
+ });
49
+ }
50
+ //#endregion
51
+ export { r as n, o as t };
@@ -0,0 +1,21 @@
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/DateField.tsx
5
+ var r = /* @__PURE__ */ e({ DateField: () => 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 ? new Date(e).toLocaleDateString() : "-"
10
+ });
11
+ let { inputType: s, ...c } = o;
12
+ return /* @__PURE__ */ (0, i.jsx)(n, {
13
+ ...c,
14
+ type: "date",
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 };
@@ -0,0 +1,32 @@
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/DateTimeField.tsx
5
+ var r = /* @__PURE__ */ e({ DateTimeField: () => a }), i = t();
6
+ function a({ value: e, onChange: t, field: r, readonly: a, ...o }) {
7
+ if (a) {
8
+ if (!e) return /* @__PURE__ */ (0, i.jsx)("span", {
9
+ className: "text-sm",
10
+ children: "-"
11
+ });
12
+ let t = new Date(e);
13
+ return /* @__PURE__ */ (0, i.jsxs)("span", {
14
+ className: "text-sm",
15
+ children: [
16
+ t.toLocaleDateString(),
17
+ " ",
18
+ t.toLocaleTimeString()
19
+ ]
20
+ });
21
+ }
22
+ let { inputType: s, ...c } = o;
23
+ return /* @__PURE__ */ (0, i.jsx)(n, {
24
+ ...c,
25
+ type: "datetime-local",
26
+ value: e || "",
27
+ onChange: (e) => t(e.target.value),
28
+ disabled: a || c.disabled
29
+ });
30
+ }
31
+ //#endregion
32
+ export { r as n, a as t };
@@ -0,0 +1,28 @@
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/EmailField.tsx
5
+ var r = /* @__PURE__ */ e({ EmailField: () => 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: `mailto:${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: "email",
20
+ value: e || "",
21
+ onChange: (e) => t(e.target.value),
22
+ placeholder: c?.placeholder || "email@example.com",
23
+ disabled: a || u.disabled,
24
+ "aria-invalid": !!o
25
+ });
26
+ }
27
+ //#endregion
28
+ export { r as n, a as t };
@@ -0,0 +1,160 @@
1
+ import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
2
+ import { t as n } from "./createLucideIcon-CWx7zIL1.js";
3
+ import { t as r } from "./image-Cm7ExMY2.js";
4
+ import { t as i } from "./upload-B1x-ueFd.js";
5
+ import { t as a } from "./x-Bwhzfvtg.js";
6
+ import { useCallback as o, useRef as s, useState as c } from "react";
7
+ import { Button as l } from "@object-ui/components";
8
+ var u = n("file", [["path", {
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
+ }], ["path", {
12
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
13
+ key: "wfsgrz"
14
+ }]]), d = /* @__PURE__ */ e({ FileField: () => p }), f = t();
15
+ function p({ value: e, onChange: t, field: n, readonly: d, ...p }) {
16
+ let m = s(null), h = n || p.schema, g = h?.multiple || !1, _ = h?.accept ? h.accept.join(",") : void 0, v = h?.maxSize, [y, b] = c(!1), [x, S] = c([]), C = e ? Array.isArray(e) ? e : [e] : [], w = o((e) => {
17
+ if (e.length === 0) return;
18
+ let n = [], r = e.filter((e) => {
19
+ if (v && e.size > v) {
20
+ let t = (v / (1024 * 1024)).toFixed(1);
21
+ return n.push(`"${e.name}" exceeds max size (${t} MB)`), !1;
22
+ }
23
+ return !0;
24
+ });
25
+ if (S(n), r.length === 0) return;
26
+ let i = r.map((e) => ({
27
+ name: e.name,
28
+ original_name: e.name,
29
+ size: e.size,
30
+ mime_type: e.type,
31
+ url: URL.createObjectURL(e)
32
+ }));
33
+ t(g ? [...C, ...i] : i[0]);
34
+ }, [
35
+ C,
36
+ g,
37
+ t,
38
+ v
39
+ ]), T = o((e) => {
40
+ e.preventDefault(), e.stopPropagation(), b(!0);
41
+ }, []), E = o((e) => {
42
+ e.preventDefault(), e.stopPropagation(), b(!1);
43
+ }, []), D = o((e) => {
44
+ e.preventDefault(), e.stopPropagation(), b(!1);
45
+ let t = Array.from(e.dataTransfer.files);
46
+ if (_) {
47
+ let e = _.split(",").map((e) => e.trim().toLowerCase());
48
+ w(t.filter((t) => {
49
+ let n = t.name.split("."), r = n.length > 1 ? "." + n.pop()?.toLowerCase() : "";
50
+ return e.some((e) => e === t.type || r && e === r || e.endsWith("/*") && t.type.startsWith(e.replace("/*", "/")));
51
+ }));
52
+ } else w(t);
53
+ }, [_, w]);
54
+ if (d) return e ? /* @__PURE__ */ (0, f.jsx)("div", {
55
+ className: "flex flex-wrap gap-2",
56
+ children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ (0, f.jsx)("span", {
57
+ className: "text-sm truncate max-w-xs",
58
+ children: e.name || e.original_name || "File"
59
+ }, t))
60
+ }) : /* @__PURE__ */ (0, f.jsx)("span", {
61
+ className: "text-sm",
62
+ children: "-"
63
+ });
64
+ let O = (e) => {
65
+ w(Array.from(e.target.files || []));
66
+ }, k = (e) => {
67
+ if (g) {
68
+ let n = C.filter((t, n) => n !== e);
69
+ t(n.length > 0 ? n : null);
70
+ } else t(null);
71
+ }, A = (e) => (e.mime_type || "").startsWith("image/");
72
+ return /* @__PURE__ */ (0, f.jsxs)("div", {
73
+ className: p.className,
74
+ children: [/* @__PURE__ */ (0, f.jsx)("input", {
75
+ ref: m,
76
+ type: "file",
77
+ multiple: g,
78
+ accept: _,
79
+ onChange: O,
80
+ className: "hidden"
81
+ }), /* @__PURE__ */ (0, f.jsxs)("div", {
82
+ className: "space-y-2",
83
+ children: [
84
+ /* @__PURE__ */ (0, f.jsxs)("div", {
85
+ onDragOver: T,
86
+ onDragLeave: E,
87
+ onDrop: D,
88
+ onClick: () => m.current?.click(),
89
+ className: `
90
+ flex flex-col items-center justify-center gap-2 p-6
91
+ border-2 border-dashed rounded-lg cursor-pointer
92
+ transition-colors duration-200
93
+ ${y ? "border-primary bg-primary/5 text-primary" : "border-muted-foreground/25 hover:border-primary/50 text-muted-foreground hover:text-foreground"}
94
+ `,
95
+ role: "button",
96
+ tabIndex: 0,
97
+ onKeyDown: (e) => {
98
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m.current?.click());
99
+ },
100
+ children: [/* @__PURE__ */ (0, f.jsx)(i, { className: `size-8 ${y ? "text-primary" : "text-muted-foreground"}` }), /* @__PURE__ */ (0, f.jsxs)("div", {
101
+ className: "text-center",
102
+ children: [/* @__PURE__ */ (0, f.jsx)("p", {
103
+ className: "text-sm font-medium",
104
+ children: y ? "Drop files here" : "Drag & drop files here"
105
+ }), /* @__PURE__ */ (0, f.jsx)("p", {
106
+ className: "text-xs text-muted-foreground mt-1",
107
+ children: "or click to browse"
108
+ })]
109
+ })]
110
+ }),
111
+ x.length > 0 && /* @__PURE__ */ (0, f.jsx)("div", {
112
+ className: "space-y-0.5",
113
+ children: x.map((e, t) => /* @__PURE__ */ (0, f.jsx)("p", {
114
+ className: "text-xs text-destructive",
115
+ children: e
116
+ }, t))
117
+ }),
118
+ C.length > 0 && /* @__PURE__ */ (0, f.jsx)("div", {
119
+ className: "space-y-1",
120
+ children: C.map((e, t) => /* @__PURE__ */ (0, f.jsxs)("div", {
121
+ className: "flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",
122
+ children: [/* @__PURE__ */ (0, f.jsxs)("div", {
123
+ className: "flex items-center gap-2 flex-1 min-w-0",
124
+ children: [
125
+ A(e) && e.url ? /* @__PURE__ */ (0, f.jsx)("img", {
126
+ src: e.url,
127
+ alt: e.name,
128
+ className: "size-8 object-cover rounded flex-shrink-0"
129
+ }) : A(e) ? /* @__PURE__ */ (0, f.jsx)(r, { className: "size-4 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ (0, f.jsx)(u, { className: "size-4 text-muted-foreground flex-shrink-0" }),
130
+ /* @__PURE__ */ (0, f.jsx)("span", {
131
+ className: "text-sm truncate",
132
+ children: e.name || e.original_name || "File"
133
+ }),
134
+ e.size && /* @__PURE__ */ (0, f.jsxs)("span", {
135
+ className: "text-xs text-muted-foreground",
136
+ children: [
137
+ "(",
138
+ (e.size / 1024).toFixed(1),
139
+ " KB)"
140
+ ]
141
+ })
142
+ ]
143
+ }), /* @__PURE__ */ (0, f.jsx)(l, {
144
+ type: "button",
145
+ variant: "ghost",
146
+ size: "sm",
147
+ onClick: (e) => {
148
+ e.stopPropagation(), k(t);
149
+ },
150
+ className: "h-6 w-6 p-0",
151
+ children: /* @__PURE__ */ (0, f.jsx)(a, { className: "size-3" })
152
+ })]
153
+ }, t))
154
+ })
155
+ ]
156
+ })]
157
+ });
158
+ }
159
+ //#endregion
160
+ export { d as t };
@@ -0,0 +1,13 @@
1
+ import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
2
+ import "react";
3
+ //#region ../fields/src/widgets/FormulaField.tsx
4
+ var n = /* @__PURE__ */ e({ FormulaField: () => i }), r = t();
5
+ function i({ value: e, field: t, ...n }) {
6
+ let i = (t || n.schema)?.return_type || "text", a = "-";
7
+ return e != null && (a = i === "number" || i === "currency" ? typeof e == "number" ? e.toFixed(2) : String(e) : i === "boolean" ? e ? "Yes" : "No" : i === "date" ? new Date(e).toLocaleDateString() : String(e)), /* @__PURE__ */ (0, r.jsx)("span", {
8
+ className: `text-sm font-mono text-gray-700 ${n.className || ""}`,
9
+ children: a
10
+ });
11
+ }
12
+ //#endregion
13
+ export { n as t };
@@ -0,0 +1,156 @@
1
+ import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
2
+ import { t as n } from "./createLucideIcon-CWx7zIL1.js";
3
+ import r from "react";
4
+ import { Button as i, Input as a, Label as o } from "@object-ui/components";
5
+ var s = n("crosshair", [
6
+ ["circle", {
7
+ cx: "12",
8
+ cy: "12",
9
+ r: "10",
10
+ key: "1mglay"
11
+ }],
12
+ ["line", {
13
+ x1: "22",
14
+ x2: "18",
15
+ y1: "12",
16
+ y2: "12",
17
+ key: "l9bcsi"
18
+ }],
19
+ ["line", {
20
+ x1: "6",
21
+ x2: "2",
22
+ y1: "12",
23
+ y2: "12",
24
+ key: "13hhkx"
25
+ }],
26
+ ["line", {
27
+ x1: "12",
28
+ x2: "12",
29
+ y1: "6",
30
+ y2: "2",
31
+ key: "10w3f3"
32
+ }],
33
+ ["line", {
34
+ x1: "12",
35
+ x2: "12",
36
+ y1: "22",
37
+ y2: "18",
38
+ key: "15g9kq"
39
+ }]
40
+ ]), c = n("map-pin", [["path", {
41
+ 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",
42
+ key: "1r0f0z"
43
+ }], ["circle", {
44
+ cx: "12",
45
+ cy: "10",
46
+ r: "3",
47
+ key: "ilqhr7"
48
+ }]]), l = /* @__PURE__ */ e({ GeolocationField: () => d }), u = t();
49
+ function d({ value: e, onChange: t, field: n, readonly: l, ...d }) {
50
+ let [f, p] = r.useState(!1), m = e || {}, h = (e, n) => {
51
+ t({
52
+ ...m,
53
+ [e]: n ? Number(n) : void 0
54
+ });
55
+ }, g = () => {
56
+ if (!navigator.geolocation) {
57
+ console.error("Geolocation is not supported by this browser");
58
+ return;
59
+ }
60
+ p(!0), navigator.geolocation.getCurrentPosition((e) => {
61
+ t({
62
+ latitude: e.coords.latitude,
63
+ longitude: e.coords.longitude,
64
+ accuracy: e.coords.accuracy
65
+ }), p(!1);
66
+ }, (e) => {
67
+ console.error("Error getting location:", e.message), p(!1);
68
+ }, {
69
+ enableHighAccuracy: !0,
70
+ timeout: 5e3,
71
+ maximumAge: 0
72
+ });
73
+ }, _ = (e) => !e.latitude || !e.longitude ? "-" : `${e.latitude.toFixed(6)}, ${e.longitude.toFixed(6)}`, v = () => {
74
+ if (!m.latitude || !m.longitude) return;
75
+ let e = `https://www.google.com/maps?q=${m.latitude},${m.longitude}`;
76
+ window.open(e, "_blank");
77
+ };
78
+ return l ? /* @__PURE__ */ (0, u.jsxs)("div", {
79
+ className: "flex items-center gap-2",
80
+ children: [
81
+ /* @__PURE__ */ (0, u.jsx)(c, { className: "w-4 h-4 text-muted-foreground" }),
82
+ /* @__PURE__ */ (0, u.jsx)("span", {
83
+ className: "text-sm",
84
+ children: _(m)
85
+ }),
86
+ m.latitude && m.longitude && /* @__PURE__ */ (0, u.jsx)(i, {
87
+ type: "button",
88
+ variant: "link",
89
+ size: "sm",
90
+ onClick: v,
91
+ className: "p-0 h-auto",
92
+ children: "View on map"
93
+ })
94
+ ]
95
+ }) : /* @__PURE__ */ (0, u.jsxs)("div", {
96
+ className: "space-y-3",
97
+ children: [
98
+ /* @__PURE__ */ (0, u.jsxs)("div", {
99
+ className: "flex items-center gap-2",
100
+ children: [/* @__PURE__ */ (0, u.jsxs)(i, {
101
+ type: "button",
102
+ variant: "outline",
103
+ size: "sm",
104
+ onClick: g,
105
+ disabled: l || f,
106
+ children: [/* @__PURE__ */ (0, u.jsx)(s, { className: "w-4 h-4 mr-2" }), f ? "Getting location..." : "Use Current Location"]
107
+ }), m.latitude && m.longitude && /* @__PURE__ */ (0, u.jsxs)(i, {
108
+ type: "button",
109
+ variant: "link",
110
+ size: "sm",
111
+ onClick: v,
112
+ children: [/* @__PURE__ */ (0, u.jsx)(c, { className: "w-4 h-4 mr-2" }), "View on map"]
113
+ })]
114
+ }),
115
+ /* @__PURE__ */ (0, u.jsxs)("div", {
116
+ className: "grid grid-cols-2 gap-3",
117
+ children: [/* @__PURE__ */ (0, u.jsxs)("div", { children: [/* @__PURE__ */ (0, u.jsx)(o, {
118
+ htmlFor: "latitude",
119
+ className: "text-xs",
120
+ children: "Latitude"
121
+ }), /* @__PURE__ */ (0, u.jsx)(a, {
122
+ id: "latitude",
123
+ type: "number",
124
+ value: m.latitude ?? "",
125
+ onChange: (e) => h("latitude", e.target.value),
126
+ placeholder: "37.7749",
127
+ disabled: l || d.disabled,
128
+ step: "any",
129
+ className: d.className
130
+ })] }), /* @__PURE__ */ (0, u.jsxs)("div", { children: [/* @__PURE__ */ (0, u.jsx)(o, {
131
+ htmlFor: "longitude",
132
+ className: "text-xs",
133
+ children: "Longitude"
134
+ }), /* @__PURE__ */ (0, u.jsx)(a, {
135
+ id: "longitude",
136
+ type: "number",
137
+ value: m.longitude ?? "",
138
+ onChange: (e) => h("longitude", e.target.value),
139
+ placeholder: "-122.4194",
140
+ disabled: l || d.disabled,
141
+ step: "any"
142
+ })] })]
143
+ }),
144
+ m.accuracy && /* @__PURE__ */ (0, u.jsxs)("p", {
145
+ className: "text-xs text-muted-foreground",
146
+ children: [
147
+ "Accuracy: ±",
148
+ m.accuracy.toFixed(0),
149
+ "m"
150
+ ]
151
+ })
152
+ ]
153
+ });
154
+ }
155
+ //#endregion
156
+ export { l as t };
@@ -0,0 +1,51 @@
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 };
@@ -0,0 +1,77 @@
1
+ import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
2
+ import { t as n } from "./image-Cm7ExMY2.js";
3
+ import { t as r } from "./x-Bwhzfvtg.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 };
@@ -0,0 +1,35 @@
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 };