@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,52 @@
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 };
@@ -0,0 +1,60 @@
1
+ import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
2
+ import { t as n } from "./createLucideIcon-CWx7zIL1.js";
3
+ import { useState as r } from "react";
4
+ import { Button as i, Input as a } from "@object-ui/components";
5
+ var o = n("eye-off", [
6
+ ["path", {
7
+ d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
8
+ key: "ct8e1f"
9
+ }],
10
+ ["path", {
11
+ d: "M14.084 14.158a3 3 0 0 1-4.242-4.242",
12
+ key: "151rxh"
13
+ }],
14
+ ["path", {
15
+ d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
16
+ key: "13bj9a"
17
+ }],
18
+ ["path", {
19
+ d: "m2 2 20 20",
20
+ key: "1ooewy"
21
+ }]
22
+ ]), s = n("eye", [["path", {
23
+ d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
24
+ key: "1nclc0"
25
+ }], ["circle", {
26
+ cx: "12",
27
+ cy: "12",
28
+ r: "3",
29
+ key: "1v7zrd"
30
+ }]]), c = /* @__PURE__ */ e({ PasswordField: () => u }), l = t();
31
+ function u({ value: e, onChange: t, field: n, readonly: c, className: u, ...d }) {
32
+ let [f, p] = r(!1), m = n || d.schema;
33
+ if (c) return /* @__PURE__ */ (0, l.jsx)("span", {
34
+ className: "text-sm",
35
+ children: "••••••••"
36
+ });
37
+ let { inputType: h, ...g } = d;
38
+ return /* @__PURE__ */ (0, l.jsxs)("div", {
39
+ className: "relative",
40
+ children: [/* @__PURE__ */ (0, l.jsx)(a, {
41
+ ...g,
42
+ type: f ? "text" : "password",
43
+ value: e || "",
44
+ onChange: (e) => t(e.target.value),
45
+ placeholder: m?.placeholder,
46
+ disabled: c || g.disabled,
47
+ className: `pr-10 ${u || ""}`
48
+ }), /* @__PURE__ */ (0, l.jsx)(i, {
49
+ type: "button",
50
+ variant: "ghost",
51
+ size: "sm",
52
+ className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
53
+ onClick: () => p(!f),
54
+ tabIndex: -1,
55
+ children: f ? /* @__PURE__ */ (0, l.jsx)(o, { className: "size-4 text-gray-500" }) : /* @__PURE__ */ (0, l.jsx)(s, { className: "size-4 text-gray-500" })
56
+ })]
57
+ });
58
+ }
59
+ //#endregion
60
+ export { c as n, u as t };
@@ -0,0 +1,63 @@
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 };
@@ -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/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 };
@@ -0,0 +1,144 @@
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 } from "@object-ui/components";
5
+ var o = n("copy", [["rect", {
6
+ width: "14",
7
+ height: "14",
8
+ x: "8",
9
+ y: "8",
10
+ rx: "2",
11
+ ry: "2",
12
+ key: "17jyea"
13
+ }], ["path", {
14
+ d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
15
+ key: "zix9uf"
16
+ }]]), s = n("qr-code", [
17
+ ["rect", {
18
+ width: "5",
19
+ height: "5",
20
+ x: "3",
21
+ y: "3",
22
+ rx: "1",
23
+ key: "1tu5fj"
24
+ }],
25
+ ["rect", {
26
+ width: "5",
27
+ height: "5",
28
+ x: "16",
29
+ y: "3",
30
+ rx: "1",
31
+ key: "1v8r4q"
32
+ }],
33
+ ["rect", {
34
+ width: "5",
35
+ height: "5",
36
+ x: "3",
37
+ y: "16",
38
+ rx: "1",
39
+ key: "1x03jg"
40
+ }],
41
+ ["path", {
42
+ d: "M21 16h-3a2 2 0 0 0-2 2v3",
43
+ key: "177gqh"
44
+ }],
45
+ ["path", {
46
+ d: "M21 21v.01",
47
+ key: "ents32"
48
+ }],
49
+ ["path", {
50
+ d: "M12 7v3a2 2 0 0 1-2 2H7",
51
+ key: "8crl2c"
52
+ }],
53
+ ["path", {
54
+ d: "M3 12h.01",
55
+ key: "nlz23k"
56
+ }],
57
+ ["path", {
58
+ d: "M12 3h.01",
59
+ key: "n36tog"
60
+ }],
61
+ ["path", {
62
+ d: "M12 16v.01",
63
+ key: "133mhm"
64
+ }],
65
+ ["path", {
66
+ d: "M16 12h1",
67
+ key: "1slzba"
68
+ }],
69
+ ["path", {
70
+ d: "M21 12v.01",
71
+ key: "1lwtk9"
72
+ }],
73
+ ["path", {
74
+ d: "M12 21v-1",
75
+ key: "1880an"
76
+ }]
77
+ ]), c = /* @__PURE__ */ e({ QRCodeField: () => u }), l = t();
78
+ function u({ value: e, onChange: t, field: n, readonly: c, ...u }) {
79
+ let [d, f] = r.useState(!1), p = n || u.schema;
80
+ return c ? /* @__PURE__ */ (0, l.jsxs)("div", {
81
+ className: "flex items-center gap-3",
82
+ children: [/* @__PURE__ */ (0, l.jsx)("span", {
83
+ className: "text-sm flex-1 truncate",
84
+ children: e || "-"
85
+ }), e && /* @__PURE__ */ (0, l.jsxs)(i, {
86
+ type: "button",
87
+ variant: "outline",
88
+ size: "sm",
89
+ onClick: () => f(!d),
90
+ children: [
91
+ /* @__PURE__ */ (0, l.jsx)(s, { className: "w-4 h-4 mr-2" }),
92
+ d ? "Hide" : "Show",
93
+ " QR"
94
+ ]
95
+ })]
96
+ }) : /* @__PURE__ */ (0, l.jsxs)("div", {
97
+ className: "space-y-3",
98
+ children: [
99
+ /* @__PURE__ */ (0, l.jsxs)("div", {
100
+ className: "flex items-center gap-2",
101
+ children: [/* @__PURE__ */ (0, l.jsx)(a, {
102
+ type: "text",
103
+ value: e || "",
104
+ onChange: (e) => t(e.target.value),
105
+ placeholder: p?.placeholder || "Enter text for QR code",
106
+ disabled: c || u.disabled,
107
+ className: u.className
108
+ }), e && /* @__PURE__ */ (0, l.jsxs)(l.Fragment, { children: [/* @__PURE__ */ (0, l.jsx)(i, {
109
+ type: "button",
110
+ variant: "outline",
111
+ size: "sm",
112
+ onClick: () => {
113
+ e && navigator.clipboard.writeText(e);
114
+ },
115
+ children: /* @__PURE__ */ (0, l.jsx)(o, { className: "w-4 h-4" })
116
+ }), /* @__PURE__ */ (0, l.jsx)(i, {
117
+ type: "button",
118
+ variant: "outline",
119
+ size: "sm",
120
+ onClick: () => f(!d),
121
+ children: /* @__PURE__ */ (0, l.jsx)(s, { className: "w-4 h-4" })
122
+ })] })]
123
+ }),
124
+ d && e && /* @__PURE__ */ (0, l.jsx)("div", {
125
+ className: "border rounded p-4 bg-white flex justify-center",
126
+ children: /* @__PURE__ */ (0, l.jsx)("img", {
127
+ src: ((e) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(e)}`)(e),
128
+ alt: "QR Code",
129
+ className: "w-48 h-48"
130
+ })
131
+ }),
132
+ e && /* @__PURE__ */ (0, l.jsxs)("p", {
133
+ className: "text-xs text-muted-foreground",
134
+ children: [
135
+ "QR code contains: ",
136
+ e.length,
137
+ " characters"
138
+ ]
139
+ })
140
+ ]
141
+ });
142
+ }
143
+ //#endregion
144
+ export { o as n, c as t };
@@ -0,0 +1,42 @@
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 { cn as i } from "@object-ui/components";
5
+ var a = n("star", [["path", {
6
+ d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",
7
+ key: "r04s7s"
8
+ }]]), o = /* @__PURE__ */ e({ RatingField: () => c }), s = t();
9
+ function c({ value: e, onChange: t, field: n, readonly: o, className: c, ...l }) {
10
+ let u = (n || l.schema)?.max ?? 5, d = e ?? 0, [f, p] = r.useState(null), m = f === null ? d : f;
11
+ return o ? /* @__PURE__ */ (0, s.jsxs)("div", {
12
+ className: i("flex items-center gap-1", c),
13
+ children: [Array.from({ length: u }, (e, t) => /* @__PURE__ */ (0, s.jsx)(a, { className: `w-5 h-5 ${t < d ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground"}` }, t)), /* @__PURE__ */ (0, s.jsxs)("span", {
14
+ className: "ml-2 text-sm text-muted-foreground",
15
+ children: [
16
+ d,
17
+ " / ",
18
+ u
19
+ ]
20
+ })]
21
+ }) : /* @__PURE__ */ (0, s.jsxs)("div", {
22
+ className: i("flex items-center gap-1", c),
23
+ children: [Array.from({ length: u }, (e, n) => /* @__PURE__ */ (0, s.jsx)("button", {
24
+ type: "button",
25
+ onClick: () => t(n + 1),
26
+ onMouseEnter: () => p(n + 1),
27
+ onMouseLeave: () => p(null),
28
+ className: "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",
29
+ disabled: o || l.disabled,
30
+ children: /* @__PURE__ */ (0, s.jsx)(a, { className: `w-5 h-5 transition-colors ${n < m ? "fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500" : "text-muted-foreground hover:text-yellow-400"}` })
31
+ }, n)), /* @__PURE__ */ (0, s.jsxs)("span", {
32
+ className: "ml-2 text-sm text-muted-foreground",
33
+ children: [
34
+ d,
35
+ " / ",
36
+ u
37
+ ]
38
+ })]
39
+ });
40
+ }
41
+ //#endregion
42
+ export { o as n, c as t };
@@ -0,0 +1,32 @@
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 };
@@ -0,0 +1,30 @@
1
+ import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
2
+ import "react";
3
+ import { Select as n, SelectContent as r, SelectItem as i, SelectTrigger as a, SelectValue as o } from "@object-ui/components";
4
+ //#region ../fields/src/widgets/SelectField.tsx
5
+ var s = /* @__PURE__ */ e({ SelectField: () => l }), c = t();
6
+ function l({ value: e, onChange: t, field: s, readonly: l, ...u }) {
7
+ let d = s || u.schema, f = d?.options || [];
8
+ return l ? /* @__PURE__ */ (0, c.jsx)("span", {
9
+ className: "text-sm",
10
+ children: f.find((t) => t.value === e)?.label || e || "-"
11
+ }) : /* @__PURE__ */ (0, c.jsxs)(n, {
12
+ ...u,
13
+ value: e,
14
+ onValueChange: t,
15
+ disabled: l || u.disabled,
16
+ children: [/* @__PURE__ */ (0, c.jsx)(a, {
17
+ className: u.className,
18
+ id: u.id,
19
+ children: /* @__PURE__ */ (0, c.jsx)(o, { placeholder: d?.placeholder || "Select an option" })
20
+ }), /* @__PURE__ */ (0, c.jsx)(r, {
21
+ position: "popper",
22
+ children: f.map((e) => /* @__PURE__ */ (0, c.jsx)(i, {
23
+ value: e.value,
24
+ children: e.label
25
+ }, e.value))
26
+ })]
27
+ });
28
+ }
29
+ //#endregion
30
+ export { s as n, l as t };
@@ -0,0 +1,98 @@
1
+ import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
2
+ import { t as n } from "./createLucideIcon-CWx7zIL1.js";
3
+ import r, { useEffect as i, useRef as a } from "react";
4
+ import { Button as o } from "@object-ui/components";
5
+ var s = n("eraser", [["path", {
6
+ d: "M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",
7
+ key: "g5wo59"
8
+ }], ["path", {
9
+ d: "m5.082 11.09 8.828 8.828",
10
+ key: "1wx5vj"
11
+ }]]), c = /* @__PURE__ */ e({ SignatureField: () => u }), l = t();
12
+ function u({ value: e, onChange: t, readonly: n }) {
13
+ let c = a(null), [u, d] = r.useState(!1), [f, p] = r.useState(!e);
14
+ i(() => {
15
+ if (e && c.current) {
16
+ let t = c.current.getContext("2d");
17
+ if (t) {
18
+ let n = new Image();
19
+ n.onload = () => {
20
+ t.drawImage(n, 0, 0), p(!1);
21
+ }, n.src = e;
22
+ }
23
+ }
24
+ }, [e]);
25
+ let m = (e) => {
26
+ if (n) return;
27
+ d(!0), p(!1);
28
+ let t = c.current;
29
+ if (!t) return;
30
+ let r = t.getContext("2d");
31
+ if (!r) return;
32
+ let i = t.getBoundingClientRect(), a = "touches" in e ? e.touches[0].clientX - i.left : e.clientX - i.left, o = "touches" in e ? e.touches[0].clientY - i.top : e.clientY - i.top;
33
+ r.beginPath(), r.moveTo(a, o);
34
+ }, h = (e) => {
35
+ if (!u || n) return;
36
+ let t = c.current;
37
+ if (!t) return;
38
+ let r = t.getContext("2d");
39
+ if (!r) return;
40
+ let i = t.getBoundingClientRect(), a = "touches" in e ? e.touches[0].clientX - i.left : e.clientX - i.left, o = "touches" in e ? e.touches[0].clientY - i.top : e.clientY - i.top;
41
+ r.lineTo(a, o), r.strokeStyle = "#000", r.lineWidth = 2, r.lineCap = "round", r.lineJoin = "round", r.stroke();
42
+ }, g = () => {
43
+ if (!u) return;
44
+ d(!1);
45
+ let e = c.current;
46
+ e && t(e.toDataURL("image/png"));
47
+ };
48
+ return n && e ? /* @__PURE__ */ (0, l.jsx)("div", {
49
+ className: "border rounded p-2 bg-white",
50
+ children: /* @__PURE__ */ (0, l.jsx)("img", {
51
+ src: e,
52
+ alt: "Signature",
53
+ loading: "lazy",
54
+ className: "max-w-full h-auto"
55
+ })
56
+ }) : n && !e ? /* @__PURE__ */ (0, l.jsx)("span", {
57
+ className: "text-sm text-muted-foreground",
58
+ children: "No signature"
59
+ }) : /* @__PURE__ */ (0, l.jsxs)("div", {
60
+ className: "space-y-2",
61
+ children: [/* @__PURE__ */ (0, l.jsx)("div", {
62
+ className: "border rounded bg-white",
63
+ children: /* @__PURE__ */ (0, l.jsx)("canvas", {
64
+ ref: c,
65
+ width: 400,
66
+ height: 200,
67
+ className: "w-full touch-none cursor-crosshair",
68
+ onMouseDown: m,
69
+ onMouseMove: h,
70
+ onMouseUp: g,
71
+ onMouseLeave: g,
72
+ onTouchStart: m,
73
+ onTouchMove: h,
74
+ onTouchEnd: g
75
+ })
76
+ }), /* @__PURE__ */ (0, l.jsxs)("div", {
77
+ className: "flex justify-between items-center",
78
+ children: [/* @__PURE__ */ (0, l.jsx)("p", {
79
+ className: "text-xs text-muted-foreground",
80
+ children: f ? "Sign above" : "Signature captured"
81
+ }), /* @__PURE__ */ (0, l.jsxs)(o, {
82
+ type: "button",
83
+ variant: "outline",
84
+ size: "sm",
85
+ onClick: () => {
86
+ let e = c.current;
87
+ if (!e) return;
88
+ let n = e.getContext("2d");
89
+ n && (n.clearRect(0, 0, e.width, e.height), p(!0), t(""));
90
+ },
91
+ disabled: n || f,
92
+ children: [/* @__PURE__ */ (0, l.jsx)(s, { className: "w-4 h-4 mr-2" }), "Clear"]
93
+ })]
94
+ })]
95
+ });
96
+ }
97
+ //#endregion
98
+ export { c as t };
@@ -0,0 +1,34 @@
1
+ import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
2
+ import "react";
3
+ import { Slider as n } from "@object-ui/components";
4
+ //#region ../fields/src/widgets/SliderField.tsx
5
+ var r = /* @__PURE__ */ e({ SliderField: () => a }), i = t();
6
+ function a({ value: e, onChange: t, field: r, readonly: a, ...o }) {
7
+ let s = r || o.schema, c = s?.min ?? 0, l = s?.max ?? 100, u = s?.step ?? 1;
8
+ return a ? /* @__PURE__ */ (0, i.jsxs)("div", {
9
+ className: "flex items-center gap-2",
10
+ children: [/* @__PURE__ */ (0, i.jsx)("span", {
11
+ className: "text-sm font-medium",
12
+ children: e ?? c
13
+ }), /* @__PURE__ */ (0, i.jsxs)("span", {
14
+ className: "text-xs text-muted-foreground",
15
+ children: ["/ ", l]
16
+ })]
17
+ }) : /* @__PURE__ */ (0, i.jsxs)("div", {
18
+ className: "flex items-center gap-4",
19
+ children: [/* @__PURE__ */ (0, i.jsx)(n, {
20
+ value: [e ?? c],
21
+ onValueChange: (e) => t(e[0]),
22
+ min: c,
23
+ max: l,
24
+ step: u,
25
+ disabled: a || o.disabled,
26
+ className: o.className
27
+ }), /* @__PURE__ */ (0, i.jsx)("span", {
28
+ className: "text-sm font-medium w-12 text-right",
29
+ children: e ?? c
30
+ })]
31
+ });
32
+ }
33
+ //#endregion
34
+ export { r as n, a as t };
@@ -0,0 +1,18 @@
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 };
@@ -0,0 +1,36 @@
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 };
@@ -0,0 +1,29 @@
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 };