@object-ui/plugin-detail 3.1.2 → 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 (102) hide show
  1. package/.turbo/turbo-build.log +53 -47
  2. package/CHANGELOG.md +20 -0
  3. package/dist/AddressField-DBkEyMcG.js +93 -0
  4. package/dist/AutoNumberField-Baa191z-.js +14 -0
  5. package/dist/AvatarField-YGj51ozd.js +80 -0
  6. package/dist/BooleanField-CaA898Tk.js +40 -0
  7. package/dist/CodeField-BU51nl1L.js +22 -0
  8. package/dist/ColorField-Cnf6ZM7c.js +37 -0
  9. package/dist/CurrencyField-Wg-XOId2.js +51 -0
  10. package/dist/DateField-Cth1ky_m.js +21 -0
  11. package/dist/DateTimeField-B0m6FhHL.js +32 -0
  12. package/dist/EmailField-Do7qT_L_.js +28 -0
  13. package/dist/FileField-aRJAdbQb.js +151 -0
  14. package/dist/FormulaField-DTMkagFx.js +14 -0
  15. package/dist/GeolocationField-RqpHWTEv.js +113 -0
  16. package/dist/GridField-D4IH0cpo.js +51 -0
  17. package/dist/ImageField-BYCFajjr.js +75 -0
  18. package/dist/LocationField-Bi_ew9sd.js +35 -0
  19. package/dist/LookupField-BjwlDPtt.js +902 -0
  20. package/dist/MasterDetailField-I1A9oEGC.js +94 -0
  21. package/dist/NumberField-D_NucQlp.js +26 -0
  22. package/dist/ObjectField-CG-LaM65.js +52 -0
  23. package/dist/PasswordField-DBtluGJ1.js +35 -0
  24. package/dist/PercentField-B6sO_J3i.js +63 -0
  25. package/dist/PhoneField-CcQAWwR6.js +28 -0
  26. package/dist/QRCodeField-CEjWs-J5.js +72 -0
  27. package/dist/RatingField-B_Mnr63i.js +39 -0
  28. package/dist/RichTextField-qOEJl5Ai.js +32 -0
  29. package/dist/SelectField-C8hWu3gm.js +30 -0
  30. package/dist/SignatureField-CddhEK9u.js +92 -0
  31. package/dist/SliderField-Df5hMzNc.js +34 -0
  32. package/dist/SummaryField-DgiFm-Cr.js +19 -0
  33. package/dist/TextAreaField-DuriTqsD.js +36 -0
  34. package/dist/TextField-CGNSl7RU.js +29 -0
  35. package/dist/TimeField-YO58ctFg.js +21 -0
  36. package/dist/UrlField-1-BMM1jn.js +33 -0
  37. package/dist/UserField-B6GqxP_S.js +78 -0
  38. package/dist/VectorField-BkEjbSt0.js +36 -0
  39. package/dist/index.js +4092 -33
  40. package/dist/index.umd.cjs +88 -81
  41. package/dist/plugin-detail.css +3 -1
  42. package/dist/src/DetailSection.d.ts +10 -0
  43. package/dist/src/DetailSection.d.ts.map +1 -1
  44. package/dist/src/HeaderHighlight.d.ts +2 -0
  45. package/dist/src/HeaderHighlight.d.ts.map +1 -1
  46. package/dist/src/RecordChatterPanel.d.ts +2 -0
  47. package/dist/src/RecordChatterPanel.d.ts.map +1 -1
  48. package/dist/src/autoLayout.d.ts +10 -3
  49. package/dist/src/autoLayout.d.ts.map +1 -1
  50. package/dist/src/index.d.ts +1 -1
  51. package/dist/src/index.d.ts.map +1 -1
  52. package/dist/src-CXr1-vVl.js +77662 -0
  53. package/package.json +10 -10
  54. package/src/DetailSection.tsx +40 -1
  55. package/src/DetailView.tsx +1 -1
  56. package/src/HeaderHighlight.tsx +22 -1
  57. package/src/RecordChatterPanel.tsx +6 -1
  58. package/src/RelatedList.tsx +1 -1
  59. package/src/__tests__/DetailSection.test.tsx +61 -0
  60. package/src/__tests__/HeaderHighlight.test.tsx +145 -0
  61. package/src/__tests__/RecordChatterPanel.test.tsx +38 -0
  62. package/src/__tests__/RelatedList.test.tsx +3 -3
  63. package/src/__tests__/autoLayout.test.ts +44 -0
  64. package/src/autoLayout.ts +25 -8
  65. package/src/index.tsx +1 -1
  66. package/dist/AddressField-QBIlXCFl.js +0 -96
  67. package/dist/AutoNumberField-BxnFqllo.js +0 -8
  68. package/dist/AvatarField-BEZuQTAH.js +0 -82
  69. package/dist/BooleanField-doa93aFX.js +0 -37
  70. package/dist/CodeField-jVV-hIXg.js +0 -21
  71. package/dist/ColorField-B53qKQGW.js +0 -42
  72. package/dist/CurrencyField-og0NJ2ax.js +0 -43
  73. package/dist/DateField-BFx64AtG.js +0 -21
  74. package/dist/DateTimeField-Cxs2Rx2f.js +0 -28
  75. package/dist/EmailField-BfcpzRe7.js +0 -31
  76. package/dist/FileField-KarqvhYm.js +0 -133
  77. package/dist/FormulaField-CJkkwIK8.js +0 -9
  78. package/dist/GeolocationField-B5SKZaqn.js +0 -123
  79. package/dist/GridField-DOotrUTo.js +0 -30
  80. package/dist/ImageField-Ddotp4u-.js +0 -90
  81. package/dist/LocationField-tOkQaPIM.js +0 -31
  82. package/dist/LookupField-DF36GvIP.js +0 -96
  83. package/dist/MasterDetailField-CpHw3nTE.js +0 -108
  84. package/dist/NumberField-CzBb2a28.js +0 -26
  85. package/dist/ObjectField-BoL-JqE4.js +0 -48
  86. package/dist/PasswordField-DrTzkYgj.js +0 -38
  87. package/dist/PercentField-B9ZUQ3zE.js +0 -63
  88. package/dist/PhoneField-Bf9lhpdu.js +0 -31
  89. package/dist/QRCodeField-PzMpdBKd.js +0 -77
  90. package/dist/RatingField-CeBMFe8o.js +0 -47
  91. package/dist/RichTextField-Ch7CHSQ0.js +0 -38
  92. package/dist/SelectField-f5Nbi02x.js +0 -26
  93. package/dist/SignatureField-CpxTX2tR.js +0 -85
  94. package/dist/SliderField-BoZtzgcr.js +0 -30
  95. package/dist/SummaryField-ugYPYxjP.js +0 -9
  96. package/dist/TextAreaField-rT1DLnV2.js +0 -39
  97. package/dist/TextField-CflRxusu.js +0 -32
  98. package/dist/TimeField-DeVeCpRu.js +0 -21
  99. package/dist/UrlField-UWKfhP9T.js +0 -33
  100. package/dist/UserField-Cp2zQDjz.js +0 -49
  101. package/dist/VectorField-CKg9jdGa.js +0 -25
  102. package/dist/index-V_WBvcaA.js +0 -100249
@@ -0,0 +1,151 @@
1
+ import { $ as e, Z as t, et as n, hn as r, jt as i, kt as a } from "./src-CXr1-vVl.js";
2
+ import { useCallback as o, useRef as s, useState as c } from "react";
3
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
+ //#region ../fields/src/widgets/FileField.tsx
5
+ var d = /* @__PURE__ */ r({ FileField: () => f });
6
+ function f({ value: r, onChange: d, field: f, readonly: p, ...m }) {
7
+ let h = s(null), g = f || m.schema, _ = g?.multiple || !1, v = g?.accept ? g.accept.join(",") : void 0, y = g?.maxSize, [b, x] = c(!1), [S, C] = c([]), w = r ? Array.isArray(r) ? r : [r] : [], T = o((e) => {
8
+ if (e.length === 0) return;
9
+ let t = [], n = e.filter((e) => {
10
+ if (y && e.size > y) {
11
+ let n = (y / (1024 * 1024)).toFixed(1);
12
+ return t.push(`"${e.name}" exceeds max size (${n} MB)`), !1;
13
+ }
14
+ return !0;
15
+ });
16
+ if (C(t), n.length === 0) return;
17
+ let r = n.map((e) => ({
18
+ name: e.name,
19
+ original_name: e.name,
20
+ size: e.size,
21
+ mime_type: e.type,
22
+ url: URL.createObjectURL(e)
23
+ }));
24
+ d(_ ? [...w, ...r] : r[0]);
25
+ }, [
26
+ w,
27
+ _,
28
+ d,
29
+ y
30
+ ]), E = o((e) => {
31
+ e.preventDefault(), e.stopPropagation(), x(!0);
32
+ }, []), D = o((e) => {
33
+ e.preventDefault(), e.stopPropagation(), x(!1);
34
+ }, []), O = o((e) => {
35
+ e.preventDefault(), e.stopPropagation(), x(!1);
36
+ let t = Array.from(e.dataTransfer.files);
37
+ if (v) {
38
+ let e = v.split(",").map((e) => e.trim().toLowerCase());
39
+ T(t.filter((t) => {
40
+ let n = t.name.split("."), r = n.length > 1 ? "." + n.pop()?.toLowerCase() : "";
41
+ return e.some((e) => e === t.type || r && e === r || e.endsWith("/*") && t.type.startsWith(e.replace("/*", "/")));
42
+ }));
43
+ } else T(t);
44
+ }, [v, T]);
45
+ if (p) return r ? /* @__PURE__ */ l("div", {
46
+ className: "flex flex-wrap gap-2",
47
+ children: (Array.isArray(r) ? r : [r]).map((e, t) => /* @__PURE__ */ l("span", {
48
+ className: "text-sm truncate max-w-xs",
49
+ children: e.name || e.original_name || "File"
50
+ }, t))
51
+ }) : /* @__PURE__ */ l("span", {
52
+ className: "text-sm",
53
+ children: "-"
54
+ });
55
+ let k = (e) => {
56
+ T(Array.from(e.target.files || []));
57
+ }, A = (e) => {
58
+ if (_) {
59
+ let t = w.filter((t, n) => n !== e);
60
+ d(t.length > 0 ? t : null);
61
+ } else d(null);
62
+ }, j = (e) => (e.mime_type || "").startsWith("image/");
63
+ return /* @__PURE__ */ u("div", {
64
+ className: m.className,
65
+ children: [/* @__PURE__ */ l("input", {
66
+ ref: h,
67
+ type: "file",
68
+ multiple: _,
69
+ accept: v,
70
+ onChange: k,
71
+ className: "hidden"
72
+ }), /* @__PURE__ */ u("div", {
73
+ className: "space-y-2",
74
+ children: [
75
+ /* @__PURE__ */ u("div", {
76
+ onDragOver: E,
77
+ onDragLeave: D,
78
+ onDrop: O,
79
+ onClick: () => h.current?.click(),
80
+ className: `
81
+ flex flex-col items-center justify-center gap-2 p-6
82
+ border-2 border-dashed rounded-lg cursor-pointer
83
+ transition-colors duration-200
84
+ ${b ? "border-primary bg-primary/5 text-primary" : "border-muted-foreground/25 hover:border-primary/50 text-muted-foreground hover:text-foreground"}
85
+ `,
86
+ role: "button",
87
+ tabIndex: 0,
88
+ onKeyDown: (e) => {
89
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), h.current?.click());
90
+ },
91
+ children: [/* @__PURE__ */ l(n, { className: `size-8 ${b ? "text-primary" : "text-muted-foreground"}` }), /* @__PURE__ */ u("div", {
92
+ className: "text-center",
93
+ children: [/* @__PURE__ */ l("p", {
94
+ className: "text-sm font-medium",
95
+ children: b ? "Drop files here" : "Drag & drop files here"
96
+ }), /* @__PURE__ */ l("p", {
97
+ className: "text-xs text-muted-foreground mt-1",
98
+ children: "or click to browse"
99
+ })]
100
+ })]
101
+ }),
102
+ S.length > 0 && /* @__PURE__ */ l("div", {
103
+ className: "space-y-0.5",
104
+ children: S.map((e, t) => /* @__PURE__ */ l("p", {
105
+ className: "text-xs text-destructive",
106
+ children: e
107
+ }, t))
108
+ }),
109
+ w.length > 0 && /* @__PURE__ */ l("div", {
110
+ className: "space-y-1",
111
+ children: w.map((n, r) => /* @__PURE__ */ u("div", {
112
+ className: "flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",
113
+ children: [/* @__PURE__ */ u("div", {
114
+ className: "flex items-center gap-2 flex-1 min-w-0",
115
+ children: [
116
+ j(n) && n.url ? /* @__PURE__ */ l("img", {
117
+ src: n.url,
118
+ alt: n.name,
119
+ className: "size-8 object-cover rounded flex-shrink-0"
120
+ }) : j(n) ? /* @__PURE__ */ l(a, { className: "size-4 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ l(i, { className: "size-4 text-muted-foreground flex-shrink-0" }),
121
+ /* @__PURE__ */ l("span", {
122
+ className: "text-sm truncate",
123
+ children: n.name || n.original_name || "File"
124
+ }),
125
+ n.size && /* @__PURE__ */ u("span", {
126
+ className: "text-xs text-muted-foreground",
127
+ children: [
128
+ "(",
129
+ (n.size / 1024).toFixed(1),
130
+ " KB)"
131
+ ]
132
+ })
133
+ ]
134
+ }), /* @__PURE__ */ l(t, {
135
+ type: "button",
136
+ variant: "ghost",
137
+ size: "sm",
138
+ onClick: (e) => {
139
+ e.stopPropagation(), A(r);
140
+ },
141
+ className: "h-6 w-6 p-0",
142
+ children: /* @__PURE__ */ l(e, { className: "size-3" })
143
+ })]
144
+ }, r))
145
+ })
146
+ ]
147
+ })]
148
+ });
149
+ }
150
+ //#endregion
151
+ export { d as t };
@@ -0,0 +1,14 @@
1
+ import { hn as e } from "./src-CXr1-vVl.js";
2
+ import "react";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ //#region ../fields/src/widgets/FormulaField.tsx
5
+ var n = /* @__PURE__ */ e({ FormulaField: () => r });
6
+ function r({ value: e, field: n, ...r }) {
7
+ let i = (n || r.schema)?.return_type || "text", a = "-";
8
+ 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__ */ t("span", {
9
+ className: `text-sm font-mono text-gray-700 ${r.className || ""}`,
10
+ children: a
11
+ });
12
+ }
13
+ //#endregion
14
+ export { n as t };
@@ -0,0 +1,113 @@
1
+ import { Bt as e, Ct as t, D as n, O as r, Z as i, hn as a } from "./src-CXr1-vVl.js";
2
+ import o from "react";
3
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
4
+ //#region ../fields/src/widgets/GeolocationField.tsx
5
+ var l = /* @__PURE__ */ a({ GeolocationField: () => u });
6
+ function u({ value: a, onChange: l, field: u, readonly: d, ...f }) {
7
+ let [p, m] = o.useState(!1), h = a || {}, g = (e, t) => {
8
+ l({
9
+ ...h,
10
+ [e]: t ? Number(t) : void 0
11
+ });
12
+ }, _ = () => {
13
+ if (!navigator.geolocation) {
14
+ console.error("Geolocation is not supported by this browser");
15
+ return;
16
+ }
17
+ m(!0), navigator.geolocation.getCurrentPosition((e) => {
18
+ l({
19
+ latitude: e.coords.latitude,
20
+ longitude: e.coords.longitude,
21
+ accuracy: e.coords.accuracy
22
+ }), m(!1);
23
+ }, (e) => {
24
+ console.error("Error getting location:", e.message), m(!1);
25
+ }, {
26
+ enableHighAccuracy: !0,
27
+ timeout: 5e3,
28
+ maximumAge: 0
29
+ });
30
+ }, v = (e) => !e.latitude || !e.longitude ? "-" : `${e.latitude.toFixed(6)}, ${e.longitude.toFixed(6)}`, y = () => {
31
+ if (!h.latitude || !h.longitude) return;
32
+ let e = `https://www.google.com/maps?q=${h.latitude},${h.longitude}`;
33
+ window.open(e, "_blank");
34
+ };
35
+ return d ? /* @__PURE__ */ c("div", {
36
+ className: "flex items-center gap-2",
37
+ children: [
38
+ /* @__PURE__ */ s(t, { className: "w-4 h-4 text-muted-foreground" }),
39
+ /* @__PURE__ */ s("span", {
40
+ className: "text-sm",
41
+ children: v(h)
42
+ }),
43
+ h.latitude && h.longitude && /* @__PURE__ */ s(i, {
44
+ type: "button",
45
+ variant: "link",
46
+ size: "sm",
47
+ onClick: y,
48
+ className: "p-0 h-auto",
49
+ children: "View on map"
50
+ })
51
+ ]
52
+ }) : /* @__PURE__ */ c("div", {
53
+ className: "space-y-3",
54
+ children: [
55
+ /* @__PURE__ */ c("div", {
56
+ className: "flex items-center gap-2",
57
+ children: [/* @__PURE__ */ c(i, {
58
+ type: "button",
59
+ variant: "outline",
60
+ size: "sm",
61
+ onClick: _,
62
+ disabled: d || p,
63
+ children: [/* @__PURE__ */ s(e, { className: "w-4 h-4 mr-2" }), p ? "Getting location..." : "Use Current Location"]
64
+ }), h.latitude && h.longitude && /* @__PURE__ */ c(i, {
65
+ type: "button",
66
+ variant: "link",
67
+ size: "sm",
68
+ onClick: y,
69
+ children: [/* @__PURE__ */ s(t, { className: "w-4 h-4 mr-2" }), "View on map"]
70
+ })]
71
+ }),
72
+ /* @__PURE__ */ c("div", {
73
+ className: "grid grid-cols-2 gap-3",
74
+ children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s(r, {
75
+ htmlFor: "latitude",
76
+ className: "text-xs",
77
+ children: "Latitude"
78
+ }), /* @__PURE__ */ s(n, {
79
+ id: "latitude",
80
+ type: "number",
81
+ value: h.latitude ?? "",
82
+ onChange: (e) => g("latitude", e.target.value),
83
+ placeholder: "37.7749",
84
+ disabled: d || f.disabled,
85
+ step: "any",
86
+ className: f.className
87
+ })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s(r, {
88
+ htmlFor: "longitude",
89
+ className: "text-xs",
90
+ children: "Longitude"
91
+ }), /* @__PURE__ */ s(n, {
92
+ id: "longitude",
93
+ type: "number",
94
+ value: h.longitude ?? "",
95
+ onChange: (e) => g("longitude", e.target.value),
96
+ placeholder: "-122.4194",
97
+ disabled: d || f.disabled,
98
+ step: "any"
99
+ })] })]
100
+ }),
101
+ h.accuracy && /* @__PURE__ */ c("p", {
102
+ className: "text-xs text-muted-foreground",
103
+ children: [
104
+ "Accuracy: ±",
105
+ h.accuracy.toFixed(0),
106
+ "m"
107
+ ]
108
+ })
109
+ ]
110
+ });
111
+ }
112
+ //#endregion
113
+ export { l as t };
@@ -0,0 +1,51 @@
1
+ import { hn as e, un as t } from "./src-CXr1-vVl.js";
2
+ import "react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ //#region ../fields/src/widgets/GridField.tsx
5
+ var i = /* @__PURE__ */ e({ GridField: () => a });
6
+ function a({ value: e, field: i, readonly: a, ...o }) {
7
+ let s = (i || o.schema)?.columns || [];
8
+ return !e || !Array.isArray(e) ? /* @__PURE__ */ n("span", {
9
+ className: "text-sm text-muted-foreground",
10
+ children: "-"
11
+ }) : a ? /* @__PURE__ */ n("div", {
12
+ className: t("text-sm", o.className),
13
+ children: /* @__PURE__ */ r("span", {
14
+ className: "text-foreground",
15
+ children: [e.length, " rows"]
16
+ })
17
+ }) : /* @__PURE__ */ r("div", {
18
+ className: t("border border-border rounded-lg overflow-hidden", o.className),
19
+ children: [/* @__PURE__ */ n("div", {
20
+ className: "overflow-auto max-h-60",
21
+ children: /* @__PURE__ */ r("table", {
22
+ className: "w-full text-sm",
23
+ children: [/* @__PURE__ */ n("thead", {
24
+ className: "bg-muted border-b border-border",
25
+ children: /* @__PURE__ */ n("tr", { children: s.map((e, t) => /* @__PURE__ */ n("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__ */ n("tbody", {
30
+ className: "divide-y divide-border",
31
+ children: e.slice(0, 5).map((e, t) => /* @__PURE__ */ n("tr", {
32
+ className: "hover:bg-muted/50 transition-colors",
33
+ children: s.map((t, r) => /* @__PURE__ */ n("td", {
34
+ className: "px-3 py-2 text-foreground",
35
+ children: e[t.name] == null ? "-" : String(e[t.name])
36
+ }, r))
37
+ }, t))
38
+ })]
39
+ })
40
+ }), e.length > 5 && /* @__PURE__ */ r("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 { i as t };
@@ -0,0 +1,75 @@
1
+ import { $ as e, Z as t, hn as n, kt as r } from "./src-CXr1-vVl.js";
2
+ import { useRef as i } from "react";
3
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
+ //#region ../fields/src/widgets/ImageField.tsx
5
+ var s = /* @__PURE__ */ n({ ImageField: () => c });
6
+ function c({ value: n, onChange: s, field: c, readonly: l, ...u }) {
7
+ let d = i(null), f = c || u.schema, p = f?.multiple || !1, m = f?.accept ? f.accept.join(",") : "image/*";
8
+ if (l) return n ? /* @__PURE__ */ a("div", {
9
+ className: "flex flex-wrap gap-2",
10
+ children: (Array.isArray(n) ? n : [n]).map((e, t) => /* @__PURE__ */ a("img", {
11
+ src: e.url || "",
12
+ alt: e.name || `Image ${t + 1}`,
13
+ className: "size-20 rounded-md object-cover border border-gray-200"
14
+ }, t))
15
+ }) : /* @__PURE__ */ a("span", {
16
+ className: "text-sm",
17
+ children: "-"
18
+ });
19
+ let h = n ? Array.isArray(n) ? n : [n] : [], g = (e) => {
20
+ let t = Array.from(e.target.files || []);
21
+ if (t.length === 0) return;
22
+ let n = t.map((e) => ({
23
+ name: e.name,
24
+ original_name: e.name,
25
+ size: e.size,
26
+ mime_type: e.type,
27
+ url: URL.createObjectURL(e)
28
+ }));
29
+ s(p ? [...h, ...n] : n[0]);
30
+ }, _ = (e) => {
31
+ if (p) {
32
+ let t = h.filter((t, n) => n !== e);
33
+ s(t.length > 0 ? t : null);
34
+ } else s(null);
35
+ };
36
+ return /* @__PURE__ */ o("div", {
37
+ className: u.className,
38
+ children: [/* @__PURE__ */ a("input", {
39
+ ref: d,
40
+ type: "file",
41
+ multiple: p,
42
+ accept: m,
43
+ onChange: g,
44
+ className: "hidden"
45
+ }), /* @__PURE__ */ o("div", {
46
+ className: "space-y-2",
47
+ children: [h.length > 0 && /* @__PURE__ */ a("div", {
48
+ className: "grid grid-cols-4 gap-2",
49
+ children: h.map((n, r) => /* @__PURE__ */ o("div", {
50
+ className: "relative group",
51
+ children: [/* @__PURE__ */ a("img", {
52
+ src: n.url || "",
53
+ alt: n.name || `Image ${r + 1}`,
54
+ className: "size-20 rounded-md object-cover border border-gray-200"
55
+ }), /* @__PURE__ */ a(t, {
56
+ type: "button",
57
+ variant: "destructive",
58
+ size: "sm",
59
+ onClick: () => _(r),
60
+ className: "absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",
61
+ children: /* @__PURE__ */ a(e, { className: "size-3" })
62
+ })]
63
+ }, r))
64
+ }), /* @__PURE__ */ o(t, {
65
+ type: "button",
66
+ variant: "outline",
67
+ onClick: () => d.current?.click(),
68
+ className: "w-full",
69
+ children: [/* @__PURE__ */ a(r, { className: "size-4 mr-2" }), h.length > 0 ? "Add More Images" : "Upload Image"]
70
+ })]
71
+ })]
72
+ });
73
+ }
74
+ //#endregion
75
+ export { s as t };
@@ -0,0 +1,35 @@
1
+ import { D as e, hn as t } from "./src-CXr1-vVl.js";
2
+ import "react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region ../fields/src/widgets/LocationField.tsx
5
+ var r = /* @__PURE__ */ t({ LocationField: () => i });
6
+ function i({ value: t, onChange: r, field: i, readonly: a, ...o }) {
7
+ let s = i || o.schema, c = t && typeof t == "object" ? `${t.latitude || 0}, ${t.longitude || 0}` : "";
8
+ return a ? /* @__PURE__ */ n("span", {
9
+ className: "text-sm",
10
+ children: c || "-"
11
+ }) : /* @__PURE__ */ n(e, {
12
+ type: "text",
13
+ value: c,
14
+ onChange: (e) => {
15
+ let t = e.target.value;
16
+ if (!t.trim()) {
17
+ r(null);
18
+ return;
19
+ }
20
+ let n = t.split(",").map((e) => e.trim());
21
+ if (n.length === 2) {
22
+ let e = parseFloat(n[0]), t = parseFloat(n[1]);
23
+ !isNaN(e) && !isNaN(t) && r({
24
+ latitude: e,
25
+ longitude: t
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 };