@object-ui/plugin-aggrid 3.3.0 → 3.3.2
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/CHANGELOG.md +23 -0
- package/README.md +20 -0
- package/dist/AddressField-CP-8JJvR.js +98 -0
- package/dist/{AgGridImpl-DBqxIsko.js → AgGridImpl-DJWnS8p3.js} +1 -1
- package/dist/AutoNumberField-DCL2eUJj.js +14 -0
- package/dist/{AvatarField-C5b9biGa.js → AvatarField-CpFxJRdO.js} +4 -3
- package/dist/{BooleanField-DRzAZhSq.js → BooleanField-Chphr8cB.js} +2 -1
- package/dist/CodeField-BWngVIw1.js +23 -0
- package/dist/ColorField-GygyYArR.js +38 -0
- package/dist/CurrencyField-O8Pn59RO.js +49 -0
- package/dist/DateField-u6U8wmvI.js +22 -0
- package/dist/DateTimeField-D1z1Ovvy.js +30 -0
- package/dist/EmailField-IOcDmGjJ.js +26 -0
- package/dist/FileField-D3mZIrJ1.js +158 -0
- package/dist/FormulaField-MuyWzQx0.js +17 -0
- package/dist/GeolocationField-BfhC7QLw.js +161 -0
- package/dist/GridField-gN34gk4b.js +49 -0
- package/dist/ImageField-BZfSFwmJ.js +75 -0
- package/dist/LocationField-B-zwfw3h.js +36 -0
- package/dist/{LookupField-DoOmbbZF.js → LookupField-Cms1Cu_l.js} +347 -349
- package/dist/{MasterDetailField-BnSPGAtS.js → MasterDetailField-DGUmvg2f.js} +5 -4
- package/dist/NumberField-BV5sKwZ7.js +27 -0
- package/dist/{ObjectAgGridImpl-DrI0aa8t.js → ObjectAgGridImpl-yiHlXYgp.js} +5804 -5804
- package/dist/ObjectField-DJ5s3ciA.js +50 -0
- package/dist/{PasswordField-k5JeKk9f.js → PasswordField-BJboeBJY.js} +3 -2
- package/dist/PercentField-DO3be_bL.js +61 -0
- package/dist/PhoneField-CT6XcO6O.js +26 -0
- package/dist/{QRCodeField-BIrSW1Zr.js → QRCodeField-COLyc5iQ.js} +31 -30
- package/dist/{RatingField-5iMhn2GL.js → RatingField-B2momIna.js} +3 -2
- package/dist/RichTextField-C7qzDPJy.js +33 -0
- package/dist/SelectField-oo6vnNhQ.js +36 -0
- package/dist/{SignatureField-BAMvNrE6.js → SignatureField-DUgoK09r.js} +3 -2
- package/dist/{SliderField-C9IhmjbF.js → SliderField-DrggtBSX.js} +2 -1
- package/dist/SummaryField-DuMsFoY5.js +22 -0
- package/dist/TextAreaField-CLzzmPce.js +37 -0
- package/dist/TextField-CZE7SzK4.js +30 -0
- package/dist/TimeField-Bha4cayv.js +22 -0
- package/dist/UrlField-Dff4WLlN.js +31 -0
- package/dist/UserField-eT5njHwQ.js +77 -0
- package/dist/VectorField-BHe8lDOH.js +34 -0
- package/dist/{image-DlUdeTgT.js → image-DmzU2ETO.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +77 -77
- package/dist/{jsx-runtime-CGDkM_Jn.js → jsx-runtime-CXSCp6pT.js} +30 -39
- package/dist/{plus-BwEV_Q5_.js → plus-bvZ2f9T_.js} +1 -1
- package/dist/rolldown-runtime-CkxV0rQ3.js +14 -0
- package/dist/{upload-DPiohvXv.js → upload-BdzwEMeV.js} +1 -1
- package/dist/{useFieldTranslation-C69OtouR.js → useFieldTranslation-CfXaJRC4.js} +2 -2
- package/dist/{x-BFq2GeQ5.js → x-98xe-fYG.js} +1 -1
- package/package.json +34 -11
- package/.turbo/turbo-build.log +0 -71
- package/OBJECT_AGGRID_CN.md +0 -483
- package/QUICKSTART.md +0 -186
- package/dist/AddressField-DKqaE9pD.js +0 -93
- package/dist/AutoNumberField-0RU2dNKe.js +0 -13
- package/dist/CodeField-RWhnDMyL.js +0 -22
- package/dist/ColorField-B-YAFXdz.js +0 -37
- package/dist/CurrencyField-Bu80a-sI.js +0 -51
- package/dist/DateField-CV-NpLbM.js +0 -21
- package/dist/DateTimeField--YTsgTjw.js +0 -32
- package/dist/EmailField-B-3fWJsH.js +0 -28
- package/dist/FileField-BcGMvBnI.js +0 -160
- package/dist/FormulaField-MQXJZOep.js +0 -13
- package/dist/GeolocationField-D3BrmwqV.js +0 -156
- package/dist/GridField-DHsGo9l2.js +0 -51
- package/dist/ImageField-BBqwJEkk.js +0 -77
- package/dist/LocationField-DSvhU9Dz.js +0 -35
- package/dist/LookupField-KfYQlgUd.js +0 -2
- package/dist/NumberField-Kz4_o5DE.js +0 -26
- package/dist/ObjectField-C1qkl6s4.js +0 -52
- package/dist/PercentField-Dmipqv0I.js +0 -63
- package/dist/PhoneField-Dn4h6V9H.js +0 -28
- package/dist/RichTextField-CN5BRd_7.js +0 -32
- package/dist/SelectField-Bjk_S2zT.js +0 -31
- package/dist/SelectField-CcWvzp9g.js +0 -2
- package/dist/SummaryField-R9RENAZv.js +0 -18
- package/dist/TextAreaField-BY63Nr6-.js +0 -36
- package/dist/TextField-SIw8aMzf.js +0 -29
- package/dist/TimeField-xxziHPjE.js +0 -21
- package/dist/UrlField-Ihk3_ff5.js +0 -33
- package/dist/UserField-BHl6mmIH.js +0 -79
- package/dist/VectorField-Ci167cxr.js +0 -35
- package/src/AgGridImpl.tsx +0 -405
- package/src/ObjectAgGridImpl.tsx +0 -509
- package/src/VirtualScrolling.ts +0 -74
- package/src/ag-grid.d.ts +0 -10
- package/src/field-renderers.test.tsx +0 -383
- package/src/field-renderers.tsx +0 -224
- package/src/index.test.ts +0 -139
- package/src/index.tsx +0 -514
- package/src/object-aggrid.test.ts +0 -99
- package/src/object-aggrid.types.ts +0 -123
- package/src/types.ts +0 -184
- package/tsconfig.json +0 -17
- package/vite.config.ts +0 -64
- /package/dist/{createLucideIcon-BjfZYZey.js → createLucideIcon-C_5JZ35b.js} +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Input as n, Label as r } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/AddressField.tsx
|
|
5
|
-
var i = /* @__PURE__ */ e({ AddressField: () => o }), a = t();
|
|
6
|
-
function o({ value: e, onChange: t, field: i, readonly: o, ...s }) {
|
|
7
|
-
let c = e || {}, l = (e, n) => {
|
|
8
|
-
t({
|
|
9
|
-
...c,
|
|
10
|
-
[e]: n
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
return o ? /* @__PURE__ */ (0, a.jsx)("span", {
|
|
14
|
-
className: "text-sm",
|
|
15
|
-
children: ((e) => [
|
|
16
|
-
e.street,
|
|
17
|
-
e.city,
|
|
18
|
-
[e.state, e.zipCode].filter(Boolean).join(" "),
|
|
19
|
-
e.country
|
|
20
|
-
].filter(Boolean).join(", ") || "-")(c)
|
|
21
|
-
}) : /* @__PURE__ */ (0, a.jsxs)("div", {
|
|
22
|
-
className: "space-y-3",
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ (0, a.jsxs)("div", { children: [/* @__PURE__ */ (0, a.jsx)(r, {
|
|
25
|
-
htmlFor: "street",
|
|
26
|
-
className: "text-xs",
|
|
27
|
-
children: "Street Address"
|
|
28
|
-
}), /* @__PURE__ */ (0, a.jsx)(n, {
|
|
29
|
-
id: "street",
|
|
30
|
-
type: "text",
|
|
31
|
-
value: c.street || "",
|
|
32
|
-
onChange: (e) => l("street", e.target.value),
|
|
33
|
-
placeholder: "123 Main St",
|
|
34
|
-
disabled: o || s.disabled,
|
|
35
|
-
className: s.className
|
|
36
|
-
})] }),
|
|
37
|
-
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
38
|
-
className: "grid grid-cols-2 gap-3",
|
|
39
|
-
children: [/* @__PURE__ */ (0, a.jsxs)("div", { children: [/* @__PURE__ */ (0, a.jsx)(r, {
|
|
40
|
-
htmlFor: "city",
|
|
41
|
-
className: "text-xs",
|
|
42
|
-
children: "City"
|
|
43
|
-
}), /* @__PURE__ */ (0, a.jsx)(n, {
|
|
44
|
-
id: "city",
|
|
45
|
-
type: "text",
|
|
46
|
-
value: c.city || "",
|
|
47
|
-
onChange: (e) => l("city", e.target.value),
|
|
48
|
-
placeholder: "San Francisco",
|
|
49
|
-
disabled: o || s.disabled
|
|
50
|
-
})] }), /* @__PURE__ */ (0, a.jsxs)("div", { children: [/* @__PURE__ */ (0, a.jsx)(r, {
|
|
51
|
-
htmlFor: "state",
|
|
52
|
-
className: "text-xs",
|
|
53
|
-
children: "State / Province"
|
|
54
|
-
}), /* @__PURE__ */ (0, a.jsx)(n, {
|
|
55
|
-
id: "state",
|
|
56
|
-
type: "text",
|
|
57
|
-
value: c.state || "",
|
|
58
|
-
onChange: (e) => l("state", e.target.value),
|
|
59
|
-
placeholder: "CA",
|
|
60
|
-
disabled: o || s.disabled
|
|
61
|
-
})] })]
|
|
62
|
-
}),
|
|
63
|
-
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
64
|
-
className: "grid grid-cols-2 gap-3",
|
|
65
|
-
children: [/* @__PURE__ */ (0, a.jsxs)("div", { children: [/* @__PURE__ */ (0, a.jsx)(r, {
|
|
66
|
-
htmlFor: "zipCode",
|
|
67
|
-
className: "text-xs",
|
|
68
|
-
children: "ZIP / Postal Code"
|
|
69
|
-
}), /* @__PURE__ */ (0, a.jsx)(n, {
|
|
70
|
-
id: "zipCode",
|
|
71
|
-
type: "text",
|
|
72
|
-
value: c.zipCode || "",
|
|
73
|
-
onChange: (e) => l("zipCode", e.target.value),
|
|
74
|
-
placeholder: "94102",
|
|
75
|
-
disabled: o || s.disabled
|
|
76
|
-
})] }), /* @__PURE__ */ (0, a.jsxs)("div", { children: [/* @__PURE__ */ (0, a.jsx)(r, {
|
|
77
|
-
htmlFor: "country",
|
|
78
|
-
className: "text-xs",
|
|
79
|
-
children: "Country"
|
|
80
|
-
}), /* @__PURE__ */ (0, a.jsx)(n, {
|
|
81
|
-
id: "country",
|
|
82
|
-
type: "text",
|
|
83
|
-
value: c.country || "",
|
|
84
|
-
onChange: (e) => l("country", e.target.value),
|
|
85
|
-
placeholder: "United States",
|
|
86
|
-
disabled: o || s.disabled
|
|
87
|
-
})] })]
|
|
88
|
-
})
|
|
89
|
-
]
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
export { i as t };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
//#region ../fields/src/widgets/AutoNumberField.tsx
|
|
4
|
-
var n = /* @__PURE__ */ e({ AutoNumberField: () => i }), r = t();
|
|
5
|
-
function i({ value: e, field: t, ...n }) {
|
|
6
|
-
let i = e == null ? "-" : String(e);
|
|
7
|
-
return /* @__PURE__ */ (0, r.jsx)("span", {
|
|
8
|
-
className: `text-sm font-mono text-gray-700 ${n.className || ""}`,
|
|
9
|
-
children: i
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { n as t };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { Textarea as n, cn as r } from "@object-ui/components";
|
|
4
|
-
//#region ../fields/src/widgets/CodeField.tsx
|
|
5
|
-
var i = /* @__PURE__ */ e({ CodeField: () => o }), a = t();
|
|
6
|
-
function o({ value: e, onChange: t, field: i, readonly: o, ...s }) {
|
|
7
|
-
let c = i || s.schema, l = c?.language ?? "javascript";
|
|
8
|
-
return o ? /* @__PURE__ */ (0, a.jsx)("pre", {
|
|
9
|
-
className: r("text-sm bg-muted p-2 rounded overflow-x-auto border", s.className),
|
|
10
|
-
children: /* @__PURE__ */ (0, a.jsx)("code", { children: e || "-" })
|
|
11
|
-
}) : /* @__PURE__ */ (0, a.jsx)(n, {
|
|
12
|
-
value: e || "",
|
|
13
|
-
onChange: (e) => t(e.target.value),
|
|
14
|
-
placeholder: c?.placeholder || `// Write ${l} code here...`,
|
|
15
|
-
disabled: o || s.disabled,
|
|
16
|
-
className: r("font-mono text-sm", s.className),
|
|
17
|
-
rows: 12,
|
|
18
|
-
spellCheck: !1
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
export { i as n, o as t };
|
|
@@ -1,37 +0,0 @@
|
|
|
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 };
|
|
@@ -1,51 +0,0 @@
|
|
|
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 };
|
|
@@ -1,21 +0,0 @@
|
|
|
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 };
|
|
@@ -1,32 +0,0 @@
|
|
|
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 };
|
|
@@ -1,28 +0,0 @@
|
|
|
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 };
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import { t as n } from "./createLucideIcon-BjfZYZey.js";
|
|
3
|
-
import { t as r } from "./image-DlUdeTgT.js";
|
|
4
|
-
import { t as i } from "./upload-DPiohvXv.js";
|
|
5
|
-
import { t as a } from "./x-BFq2GeQ5.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 };
|
|
@@ -1,13 +0,0 @@
|
|
|
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 };
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
|
|
2
|
-
import { t as n } from "./createLucideIcon-BjfZYZey.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 };
|