@object-ui/plugin-aggrid 3.3.0 → 3.3.1

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 (96) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +20 -0
  3. package/dist/AddressField-CP-8JJvR.js +98 -0
  4. package/dist/{AgGridImpl-DBqxIsko.js → AgGridImpl-DJWnS8p3.js} +1 -1
  5. package/dist/AutoNumberField-DCL2eUJj.js +14 -0
  6. package/dist/{AvatarField-C5b9biGa.js → AvatarField-CpFxJRdO.js} +4 -3
  7. package/dist/{BooleanField-DRzAZhSq.js → BooleanField-Chphr8cB.js} +2 -1
  8. package/dist/CodeField-BWngVIw1.js +23 -0
  9. package/dist/ColorField-GygyYArR.js +38 -0
  10. package/dist/CurrencyField-O8Pn59RO.js +49 -0
  11. package/dist/DateField-u6U8wmvI.js +22 -0
  12. package/dist/DateTimeField-D1z1Ovvy.js +30 -0
  13. package/dist/EmailField-IOcDmGjJ.js +26 -0
  14. package/dist/FileField-D3mZIrJ1.js +158 -0
  15. package/dist/FormulaField-MuyWzQx0.js +17 -0
  16. package/dist/GeolocationField-BfhC7QLw.js +161 -0
  17. package/dist/GridField-gN34gk4b.js +49 -0
  18. package/dist/ImageField-BZfSFwmJ.js +75 -0
  19. package/dist/LocationField-B-zwfw3h.js +36 -0
  20. package/dist/{LookupField-DoOmbbZF.js → LookupField-Cms1Cu_l.js} +347 -349
  21. package/dist/{MasterDetailField-BnSPGAtS.js → MasterDetailField-DGUmvg2f.js} +5 -4
  22. package/dist/NumberField-BV5sKwZ7.js +27 -0
  23. package/dist/{ObjectAgGridImpl-DrI0aa8t.js → ObjectAgGridImpl-yiHlXYgp.js} +5804 -5804
  24. package/dist/ObjectField-DJ5s3ciA.js +50 -0
  25. package/dist/{PasswordField-k5JeKk9f.js → PasswordField-BJboeBJY.js} +3 -2
  26. package/dist/PercentField-DO3be_bL.js +61 -0
  27. package/dist/PhoneField-CT6XcO6O.js +26 -0
  28. package/dist/{QRCodeField-BIrSW1Zr.js → QRCodeField-COLyc5iQ.js} +31 -30
  29. package/dist/{RatingField-5iMhn2GL.js → RatingField-B2momIna.js} +3 -2
  30. package/dist/RichTextField-C7qzDPJy.js +33 -0
  31. package/dist/SelectField-oo6vnNhQ.js +36 -0
  32. package/dist/{SignatureField-BAMvNrE6.js → SignatureField-DUgoK09r.js} +3 -2
  33. package/dist/{SliderField-C9IhmjbF.js → SliderField-DrggtBSX.js} +2 -1
  34. package/dist/SummaryField-DuMsFoY5.js +22 -0
  35. package/dist/TextAreaField-CLzzmPce.js +37 -0
  36. package/dist/TextField-CZE7SzK4.js +30 -0
  37. package/dist/TimeField-Bha4cayv.js +22 -0
  38. package/dist/UrlField-Dff4WLlN.js +31 -0
  39. package/dist/UserField-eT5njHwQ.js +77 -0
  40. package/dist/VectorField-BHe8lDOH.js +34 -0
  41. package/dist/{image-DlUdeTgT.js → image-DmzU2ETO.js} +1 -1
  42. package/dist/index.js +2 -2
  43. package/dist/index.umd.cjs +77 -77
  44. package/dist/{jsx-runtime-CGDkM_Jn.js → jsx-runtime-CXSCp6pT.js} +30 -39
  45. package/dist/{plus-BwEV_Q5_.js → plus-bvZ2f9T_.js} +1 -1
  46. package/dist/rolldown-runtime-CkxV0rQ3.js +14 -0
  47. package/dist/{upload-DPiohvXv.js → upload-BdzwEMeV.js} +1 -1
  48. package/dist/{useFieldTranslation-C69OtouR.js → useFieldTranslation-CfXaJRC4.js} +2 -2
  49. package/dist/{x-BFq2GeQ5.js → x-98xe-fYG.js} +1 -1
  50. package/package.json +34 -11
  51. package/.turbo/turbo-build.log +0 -71
  52. package/OBJECT_AGGRID_CN.md +0 -483
  53. package/QUICKSTART.md +0 -186
  54. package/dist/AddressField-DKqaE9pD.js +0 -93
  55. package/dist/AutoNumberField-0RU2dNKe.js +0 -13
  56. package/dist/CodeField-RWhnDMyL.js +0 -22
  57. package/dist/ColorField-B-YAFXdz.js +0 -37
  58. package/dist/CurrencyField-Bu80a-sI.js +0 -51
  59. package/dist/DateField-CV-NpLbM.js +0 -21
  60. package/dist/DateTimeField--YTsgTjw.js +0 -32
  61. package/dist/EmailField-B-3fWJsH.js +0 -28
  62. package/dist/FileField-BcGMvBnI.js +0 -160
  63. package/dist/FormulaField-MQXJZOep.js +0 -13
  64. package/dist/GeolocationField-D3BrmwqV.js +0 -156
  65. package/dist/GridField-DHsGo9l2.js +0 -51
  66. package/dist/ImageField-BBqwJEkk.js +0 -77
  67. package/dist/LocationField-DSvhU9Dz.js +0 -35
  68. package/dist/LookupField-KfYQlgUd.js +0 -2
  69. package/dist/NumberField-Kz4_o5DE.js +0 -26
  70. package/dist/ObjectField-C1qkl6s4.js +0 -52
  71. package/dist/PercentField-Dmipqv0I.js +0 -63
  72. package/dist/PhoneField-Dn4h6V9H.js +0 -28
  73. package/dist/RichTextField-CN5BRd_7.js +0 -32
  74. package/dist/SelectField-Bjk_S2zT.js +0 -31
  75. package/dist/SelectField-CcWvzp9g.js +0 -2
  76. package/dist/SummaryField-R9RENAZv.js +0 -18
  77. package/dist/TextAreaField-BY63Nr6-.js +0 -36
  78. package/dist/TextField-SIw8aMzf.js +0 -29
  79. package/dist/TimeField-xxziHPjE.js +0 -21
  80. package/dist/UrlField-Ihk3_ff5.js +0 -33
  81. package/dist/UserField-BHl6mmIH.js +0 -79
  82. package/dist/VectorField-Ci167cxr.js +0 -35
  83. package/src/AgGridImpl.tsx +0 -405
  84. package/src/ObjectAgGridImpl.tsx +0 -509
  85. package/src/VirtualScrolling.ts +0 -74
  86. package/src/ag-grid.d.ts +0 -10
  87. package/src/field-renderers.test.tsx +0 -383
  88. package/src/field-renderers.tsx +0 -224
  89. package/src/index.test.ts +0 -139
  90. package/src/index.tsx +0 -514
  91. package/src/object-aggrid.test.ts +0 -99
  92. package/src/object-aggrid.types.ts +0 -123
  93. package/src/types.ts +0 -184
  94. package/tsconfig.json +0 -17
  95. package/vite.config.ts +0 -64
  96. /package/dist/{createLucideIcon-BjfZYZey.js → createLucideIcon-C_5JZ35b.js} +0 -0
@@ -0,0 +1,161 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import { t as n } from "./createLucideIcon-C_5JZ35b.js";
4
+ import r from "react";
5
+ import { Button as i, EmptyValue as a, Input as o, Label as s } from "@object-ui/components";
6
+ var c = n("crosshair", [
7
+ ["circle", {
8
+ cx: "12",
9
+ cy: "12",
10
+ r: "10",
11
+ key: "1mglay"
12
+ }],
13
+ ["line", {
14
+ x1: "22",
15
+ x2: "18",
16
+ y1: "12",
17
+ y2: "12",
18
+ key: "l9bcsi"
19
+ }],
20
+ ["line", {
21
+ x1: "6",
22
+ x2: "2",
23
+ y1: "12",
24
+ y2: "12",
25
+ key: "13hhkx"
26
+ }],
27
+ ["line", {
28
+ x1: "12",
29
+ x2: "12",
30
+ y1: "6",
31
+ y2: "2",
32
+ key: "10w3f3"
33
+ }],
34
+ ["line", {
35
+ x1: "12",
36
+ x2: "12",
37
+ y1: "22",
38
+ y2: "18",
39
+ key: "15g9kq"
40
+ }]
41
+ ]), l = n("map-pin", [["path", {
42
+ 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",
43
+ key: "1r0f0z"
44
+ }], ["circle", {
45
+ cx: "12",
46
+ cy: "10",
47
+ r: "3",
48
+ key: "ilqhr7"
49
+ }]]), u = /* @__PURE__ */ e({ GeolocationField: () => f }), d = t();
50
+ function f({ value: e, onChange: t, field: n, readonly: u, ...f }) {
51
+ let [p, m] = r.useState(!1), h = e || {}, g = (e, n) => {
52
+ t({
53
+ ...h,
54
+ [e]: n ? Number(n) : void 0
55
+ });
56
+ }, _ = () => {
57
+ if (!navigator.geolocation) {
58
+ console.error("Geolocation is not supported by this browser");
59
+ return;
60
+ }
61
+ m(!0), navigator.geolocation.getCurrentPosition((e) => {
62
+ t({
63
+ latitude: e.coords.latitude,
64
+ longitude: e.coords.longitude,
65
+ accuracy: e.coords.accuracy
66
+ }), m(!1);
67
+ }, (e) => {
68
+ console.error("Error getting location:", e.message), m(!1);
69
+ }, {
70
+ enableHighAccuracy: !0,
71
+ timeout: 5e3,
72
+ maximumAge: 0
73
+ });
74
+ }, v = (e) => !e.latitude || !e.longitude ? "" : `${e.latitude.toFixed(6)}, ${e.longitude.toFixed(6)}`, y = () => {
75
+ if (!h.latitude || !h.longitude) return;
76
+ let e = `https://www.google.com/maps?q=${h.latitude},${h.longitude}`;
77
+ window.open(e, "_blank");
78
+ };
79
+ if (u) {
80
+ let e = v(h);
81
+ return /* @__PURE__ */ (0, d.jsxs)("div", {
82
+ className: "flex items-center gap-2",
83
+ children: [
84
+ /* @__PURE__ */ (0, d.jsx)(l, { className: "w-4 h-4 text-muted-foreground" }),
85
+ e ? /* @__PURE__ */ (0, d.jsx)("span", {
86
+ className: "text-sm",
87
+ children: e
88
+ }) : /* @__PURE__ */ (0, d.jsx)(a, {}),
89
+ h.latitude && h.longitude && /* @__PURE__ */ (0, d.jsx)(i, {
90
+ type: "button",
91
+ variant: "link",
92
+ size: "sm",
93
+ onClick: y,
94
+ className: "p-0 h-auto",
95
+ children: "View on map"
96
+ })
97
+ ]
98
+ });
99
+ }
100
+ return /* @__PURE__ */ (0, d.jsxs)("div", {
101
+ className: "space-y-3",
102
+ children: [
103
+ /* @__PURE__ */ (0, d.jsxs)("div", {
104
+ className: "flex items-center gap-2",
105
+ children: [/* @__PURE__ */ (0, d.jsxs)(i, {
106
+ type: "button",
107
+ variant: "outline",
108
+ size: "sm",
109
+ onClick: _,
110
+ disabled: u || p,
111
+ children: [/* @__PURE__ */ (0, d.jsx)(c, { className: "w-4 h-4 mr-2" }), p ? "Getting location..." : "Use Current Location"]
112
+ }), h.latitude && h.longitude && /* @__PURE__ */ (0, d.jsxs)(i, {
113
+ type: "button",
114
+ variant: "link",
115
+ size: "sm",
116
+ onClick: y,
117
+ children: [/* @__PURE__ */ (0, d.jsx)(l, { className: "w-4 h-4 mr-2" }), "View on map"]
118
+ })]
119
+ }),
120
+ /* @__PURE__ */ (0, d.jsxs)("div", {
121
+ className: "grid grid-cols-2 gap-3",
122
+ children: [/* @__PURE__ */ (0, d.jsxs)("div", { children: [/* @__PURE__ */ (0, d.jsx)(s, {
123
+ htmlFor: "latitude",
124
+ className: "text-xs",
125
+ children: "Latitude"
126
+ }), /* @__PURE__ */ (0, d.jsx)(o, {
127
+ id: "latitude",
128
+ type: "number",
129
+ value: h.latitude ?? "",
130
+ onChange: (e) => g("latitude", e.target.value),
131
+ placeholder: "37.7749",
132
+ disabled: u || f.disabled,
133
+ step: "any",
134
+ className: f.className
135
+ })] }), /* @__PURE__ */ (0, d.jsxs)("div", { children: [/* @__PURE__ */ (0, d.jsx)(s, {
136
+ htmlFor: "longitude",
137
+ className: "text-xs",
138
+ children: "Longitude"
139
+ }), /* @__PURE__ */ (0, d.jsx)(o, {
140
+ id: "longitude",
141
+ type: "number",
142
+ value: h.longitude ?? "",
143
+ onChange: (e) => g("longitude", e.target.value),
144
+ placeholder: "-122.4194",
145
+ disabled: u || f.disabled,
146
+ step: "any"
147
+ })] })]
148
+ }),
149
+ h.accuracy && /* @__PURE__ */ (0, d.jsxs)("p", {
150
+ className: "text-xs text-muted-foreground",
151
+ children: [
152
+ "Accuracy: ±",
153
+ h.accuracy.toFixed(0),
154
+ "m"
155
+ ]
156
+ })
157
+ ]
158
+ });
159
+ }
160
+ //#endregion
161
+ export { u as t };
@@ -0,0 +1,49 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n, cn as r } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/GridField.tsx
6
+ var i = /* @__PURE__ */ e({ GridField: () => o }), a = t();
7
+ function o({ value: e, field: t, readonly: i, ...o }) {
8
+ let s = (t || o.schema)?.columns || [];
9
+ return !e || !Array.isArray(e) ? /* @__PURE__ */ (0, a.jsx)(n, {}) : i ? /* @__PURE__ */ (0, a.jsx)("div", {
10
+ className: r("text-sm", o.className),
11
+ children: /* @__PURE__ */ (0, a.jsxs)("span", {
12
+ className: "text-foreground",
13
+ children: [e.length, " rows"]
14
+ })
15
+ }) : /* @__PURE__ */ (0, a.jsxs)("div", {
16
+ className: r("border border-border rounded-lg overflow-hidden", o.className),
17
+ children: [/* @__PURE__ */ (0, a.jsx)("div", {
18
+ className: "overflow-auto max-h-60",
19
+ children: /* @__PURE__ */ (0, a.jsxs)("table", {
20
+ className: "w-full text-sm",
21
+ children: [/* @__PURE__ */ (0, a.jsx)("thead", {
22
+ className: "bg-muted border-b border-border",
23
+ children: /* @__PURE__ */ (0, a.jsx)("tr", { children: s.map((e, t) => /* @__PURE__ */ (0, a.jsx)("th", {
24
+ className: "px-3 py-2 text-left text-xs font-medium text-muted-foreground",
25
+ children: e.label || e.name
26
+ }, t)) })
27
+ }), /* @__PURE__ */ (0, a.jsx)("tbody", {
28
+ className: "divide-y divide-border",
29
+ children: e.slice(0, 5).map((e, t) => /* @__PURE__ */ (0, a.jsx)("tr", {
30
+ className: "hover:bg-muted/50 transition-colors",
31
+ children: s.map((t, r) => /* @__PURE__ */ (0, a.jsx)("td", {
32
+ className: "px-3 py-2 text-foreground",
33
+ children: e[t.name] == null ? /* @__PURE__ */ (0, a.jsx)(n, {}) : String(e[t.name])
34
+ }, r))
35
+ }, t))
36
+ })]
37
+ })
38
+ }), e.length > 5 && /* @__PURE__ */ (0, a.jsxs)("div", {
39
+ className: "bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border",
40
+ children: [
41
+ "Showing 5 of ",
42
+ e.length,
43
+ " rows"
44
+ ]
45
+ })]
46
+ });
47
+ }
48
+ //#endregion
49
+ export { i as t };
@@ -0,0 +1,75 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import { t as n } from "./image-DmzU2ETO.js";
4
+ import { t as r } from "./x-98xe-fYG.js";
5
+ import { useRef as i } from "react";
6
+ import { Button as a, EmptyValue as o } from "@object-ui/components";
7
+ //#region ../fields/src/widgets/ImageField.tsx
8
+ var s = /* @__PURE__ */ e({ ImageField: () => l }), c = t();
9
+ function l({ value: e, onChange: t, field: s, readonly: l, ...u }) {
10
+ let d = i(null), f = s || u.schema, p = f?.multiple || !1, m = f?.accept ? f.accept.join(",") : "image/*";
11
+ if (l) return e ? /* @__PURE__ */ (0, c.jsx)("div", {
12
+ className: "flex flex-wrap gap-2",
13
+ children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ (0, c.jsx)("img", {
14
+ src: e.url || "",
15
+ alt: e.name || `Image ${t + 1}`,
16
+ className: "size-20 rounded-md object-cover border border-gray-200"
17
+ }, t))
18
+ }) : /* @__PURE__ */ (0, c.jsx)(o, {});
19
+ let h = e ? Array.isArray(e) ? e : [e] : [], g = (e) => {
20
+ let n = Array.from(e.target.files || []);
21
+ if (n.length === 0) return;
22
+ let r = n.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
+ t(p ? [...h, ...r] : r[0]);
30
+ }, _ = (e) => {
31
+ if (p) {
32
+ let n = h.filter((t, n) => n !== e);
33
+ t(n.length > 0 ? n : null);
34
+ } else t(null);
35
+ };
36
+ return /* @__PURE__ */ (0, c.jsxs)("div", {
37
+ className: u.className,
38
+ children: [/* @__PURE__ */ (0, c.jsx)("input", {
39
+ ref: d,
40
+ type: "file",
41
+ multiple: p,
42
+ accept: m,
43
+ onChange: g,
44
+ className: "hidden"
45
+ }), /* @__PURE__ */ (0, c.jsxs)("div", {
46
+ className: "space-y-2",
47
+ children: [h.length > 0 && /* @__PURE__ */ (0, c.jsx)("div", {
48
+ className: "grid grid-cols-4 gap-2",
49
+ children: h.map((e, t) => /* @__PURE__ */ (0, c.jsxs)("div", {
50
+ className: "relative group",
51
+ children: [/* @__PURE__ */ (0, c.jsx)("img", {
52
+ src: e.url || "",
53
+ alt: e.name || `Image ${t + 1}`,
54
+ className: "size-20 rounded-md object-cover border border-gray-200"
55
+ }), /* @__PURE__ */ (0, c.jsx)(a, {
56
+ type: "button",
57
+ variant: "destructive",
58
+ size: "sm",
59
+ onClick: () => _(t),
60
+ className: "absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",
61
+ children: /* @__PURE__ */ (0, c.jsx)(r, { className: "size-3" })
62
+ })]
63
+ }, t))
64
+ }), /* @__PURE__ */ (0, c.jsxs)(a, {
65
+ type: "button",
66
+ variant: "outline",
67
+ onClick: () => d.current?.click(),
68
+ className: "w-full",
69
+ children: [/* @__PURE__ */ (0, c.jsx)(n, { className: "size-4 mr-2" }), h.length > 0 ? "Add More Images" : "Upload Image"]
70
+ })]
71
+ })]
72
+ });
73
+ }
74
+ //#endregion
75
+ export { s as n, l as t };
@@ -0,0 +1,36 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n, Input as r } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/LocationField.tsx
6
+ var i = /* @__PURE__ */ e({ LocationField: () => o }), a = t();
7
+ function o({ value: e, onChange: t, field: i, readonly: o, ...s }) {
8
+ let c = i || s.schema, l = e && typeof e == "object" ? `${e.latitude || 0}, ${e.longitude || 0}` : "";
9
+ return o ? /* @__PURE__ */ (0, a.jsx)("span", {
10
+ className: "text-sm",
11
+ children: l || /* @__PURE__ */ (0, a.jsx)(n, {})
12
+ }) : /* @__PURE__ */ (0, a.jsx)(r, {
13
+ type: "text",
14
+ value: l,
15
+ onChange: (e) => {
16
+ let n = e.target.value;
17
+ if (!n.trim()) {
18
+ t(null);
19
+ return;
20
+ }
21
+ let r = n.split(",").map((e) => e.trim());
22
+ if (r.length === 2) {
23
+ let e = parseFloat(r[0]), n = parseFloat(r[1]);
24
+ !isNaN(e) && !isNaN(n) && t({
25
+ latitude: e,
26
+ longitude: n
27
+ });
28
+ }
29
+ },
30
+ placeholder: c?.placeholder || "latitude, longitude",
31
+ disabled: o || s.disabled,
32
+ className: s.className
33
+ });
34
+ }
35
+ //#endregion
36
+ export { i as t };