@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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
|
|
2
|
+
import { t } from "./jsx-runtime-CXSCp6pT.js";
|
|
3
|
+
import { useEffect as n, useState as r } from "react";
|
|
4
|
+
import { EmptyValue as i, Textarea as a, cn as o } from "@object-ui/components";
|
|
5
|
+
//#region ../fields/src/widgets/ObjectField.tsx
|
|
6
|
+
var s = /* @__PURE__ */ e({ ObjectField: () => l }), c = t();
|
|
7
|
+
function l({ value: e, onChange: t, field: s, readonly: l, ...u }) {
|
|
8
|
+
let d = s || u.schema, [f, p] = r(() => e == null ? "" : JSON.stringify(e, null, 2)), [m, h] = r(null);
|
|
9
|
+
return n(() => {
|
|
10
|
+
try {
|
|
11
|
+
if (e == null) {
|
|
12
|
+
p("");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
let t = f ? JSON.parse(f) : null;
|
|
16
|
+
JSON.stringify(t) !== JSON.stringify(e) && p(JSON.stringify(e, null, 2));
|
|
17
|
+
} catch {
|
|
18
|
+
p(JSON.stringify(e, null, 2));
|
|
19
|
+
}
|
|
20
|
+
}, [e, f]), l ? e ? /* @__PURE__ */ (0, c.jsx)("pre", {
|
|
21
|
+
className: o("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", u.className),
|
|
22
|
+
children: JSON.stringify(e, null, 2)
|
|
23
|
+
}) : /* @__PURE__ */ (0, c.jsx)(i, {}) : /* @__PURE__ */ (0, c.jsxs)("div", {
|
|
24
|
+
className: "space-y-1",
|
|
25
|
+
children: [/* @__PURE__ */ (0, c.jsx)(a, {
|
|
26
|
+
value: f,
|
|
27
|
+
onChange: (e) => {
|
|
28
|
+
let n = e.target.value;
|
|
29
|
+
if (p(n), h(null), !n.trim()) {
|
|
30
|
+
t(null);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
t(JSON.parse(n));
|
|
35
|
+
} catch {
|
|
36
|
+
h("Invalid JSON");
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
placeholder: d?.placeholder || "{\n \"key\": \"value\"\n}",
|
|
40
|
+
disabled: l || u.disabled,
|
|
41
|
+
className: o("font-mono text-xs", m ? "border-red-500 focus-visible:ring-red-500" : "", u.className),
|
|
42
|
+
rows: 6
|
|
43
|
+
}), m && /* @__PURE__ */ (0, c.jsx)("p", {
|
|
44
|
+
className: "text-xs text-red-500",
|
|
45
|
+
children: m
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { s as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
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";
|
|
3
4
|
import { useState as r } from "react";
|
|
4
5
|
import { Button as i, Input as a } from "@object-ui/components";
|
|
5
6
|
var o = n("eye-off", [
|
|
@@ -0,0 +1,61 @@
|
|
|
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, Slider as i } from "@object-ui/components";
|
|
5
|
+
//#region ../fields/src/widgets/PercentField.tsx
|
|
6
|
+
var a = /* @__PURE__ */ e({ PercentField: () => s }), o = t();
|
|
7
|
+
function s({ value: e, onChange: t, field: a, readonly: s, errorMessage: c, className: l, ...u }) {
|
|
8
|
+
let d = a || u.schema, f = d?.precision ?? 2;
|
|
9
|
+
if (s) return e == null ? /* @__PURE__ */ (0, o.jsx)(n, {}) : /* @__PURE__ */ (0, o.jsxs)("span", {
|
|
10
|
+
className: "text-sm font-medium tabular-nums",
|
|
11
|
+
children: [(e * 100).toFixed(f), "%"]
|
|
12
|
+
});
|
|
13
|
+
let p = e == null ? "" : e * 100, m = e == null ? 0 : e * 100, h = (e) => {
|
|
14
|
+
if (e.target.value === "") {
|
|
15
|
+
t(null);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
let n = parseFloat(e.target.value);
|
|
19
|
+
t(isNaN(n) ? null : n / 100);
|
|
20
|
+
}, g = (e) => {
|
|
21
|
+
if (s || u.disabled) return;
|
|
22
|
+
if (!Array.isArray(e) || e.length === 0) {
|
|
23
|
+
t(null);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
let n = e[0];
|
|
27
|
+
t(typeof n == "number" ? n / 100 : null);
|
|
28
|
+
}, _ = 10 ** -f;
|
|
29
|
+
return /* @__PURE__ */ (0, o.jsxs)("div", {
|
|
30
|
+
className: "space-y-2",
|
|
31
|
+
children: [/* @__PURE__ */ (0, o.jsxs)("div", {
|
|
32
|
+
className: "relative",
|
|
33
|
+
children: [/* @__PURE__ */ (0, o.jsx)(r, {
|
|
34
|
+
...u,
|
|
35
|
+
type: "number",
|
|
36
|
+
value: p,
|
|
37
|
+
onChange: h,
|
|
38
|
+
placeholder: d?.placeholder || "0",
|
|
39
|
+
disabled: s || u.disabled,
|
|
40
|
+
className: `pr-8 ${l || ""}`,
|
|
41
|
+
step: (10 ** -f).toFixed(f),
|
|
42
|
+
"aria-invalid": !!c
|
|
43
|
+
}), /* @__PURE__ */ (0, o.jsx)("span", {
|
|
44
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
|
|
45
|
+
children: "%"
|
|
46
|
+
})]
|
|
47
|
+
}), /* @__PURE__ */ (0, o.jsx)(i, {
|
|
48
|
+
value: [m],
|
|
49
|
+
onValueChange: g,
|
|
50
|
+
min: 0,
|
|
51
|
+
max: 100,
|
|
52
|
+
step: _,
|
|
53
|
+
disabled: s || u.disabled,
|
|
54
|
+
className: "w-full",
|
|
55
|
+
"aria-label": "Percentage",
|
|
56
|
+
"data-testid": "percent-slider"
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { a as n, s as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
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/PhoneField.tsx
|
|
6
|
+
var i = /* @__PURE__ */ e({ PhoneField: () => o }), a = t();
|
|
7
|
+
function o({ value: e, onChange: t, field: i, readonly: o, errorMessage: s, ...c }) {
|
|
8
|
+
let l = i || c.schema;
|
|
9
|
+
if (o) return e ? /* @__PURE__ */ (0, a.jsx)("a", {
|
|
10
|
+
href: `tel:${e}`,
|
|
11
|
+
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
12
|
+
children: e
|
|
13
|
+
}) : /* @__PURE__ */ (0, a.jsx)(n, {});
|
|
14
|
+
let { inputType: u, ...d } = c;
|
|
15
|
+
return /* @__PURE__ */ (0, a.jsx)(r, {
|
|
16
|
+
...d,
|
|
17
|
+
type: "tel",
|
|
18
|
+
value: e || "",
|
|
19
|
+
onChange: (e) => t(e.target.value),
|
|
20
|
+
placeholder: l?.placeholder || "(555) 123-4567",
|
|
21
|
+
disabled: o || d.disabled,
|
|
22
|
+
"aria-invalid": !!s
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { i as n, o as t };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
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";
|
|
3
4
|
import r from "react";
|
|
4
|
-
import { Button as i,
|
|
5
|
-
var
|
|
5
|
+
import { Button as i, EmptyValue as a, Input as o } from "@object-ui/components";
|
|
6
|
+
var s = n("copy", [["rect", {
|
|
6
7
|
width: "14",
|
|
7
8
|
height: "14",
|
|
8
9
|
x: "8",
|
|
@@ -13,7 +14,7 @@ var o = n("copy", [["rect", {
|
|
|
13
14
|
}], ["path", {
|
|
14
15
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
15
16
|
key: "zix9uf"
|
|
16
|
-
}]]),
|
|
17
|
+
}]]), c = n("qr-code", [
|
|
17
18
|
["rect", {
|
|
18
19
|
width: "5",
|
|
19
20
|
height: "5",
|
|
@@ -74,62 +75,62 @@ var o = n("copy", [["rect", {
|
|
|
74
75
|
d: "M12 21v-1",
|
|
75
76
|
key: "1880an"
|
|
76
77
|
}]
|
|
77
|
-
]),
|
|
78
|
-
function
|
|
79
|
-
let [
|
|
80
|
-
return
|
|
78
|
+
]), l = /* @__PURE__ */ e({ QRCodeField: () => d }), u = t();
|
|
79
|
+
function d({ value: e, onChange: t, field: n, readonly: l, ...d }) {
|
|
80
|
+
let [f, p] = r.useState(!1), m = n || d.schema;
|
|
81
|
+
return l ? /* @__PURE__ */ (0, u.jsxs)("div", {
|
|
81
82
|
className: "flex items-center gap-3",
|
|
82
|
-
children: [/* @__PURE__ */ (0,
|
|
83
|
+
children: [/* @__PURE__ */ (0, u.jsx)("span", {
|
|
83
84
|
className: "text-sm flex-1 truncate",
|
|
84
|
-
children: e ||
|
|
85
|
-
}), e && /* @__PURE__ */ (0,
|
|
85
|
+
children: e || /* @__PURE__ */ (0, u.jsx)(a, {})
|
|
86
|
+
}), e && /* @__PURE__ */ (0, u.jsxs)(i, {
|
|
86
87
|
type: "button",
|
|
87
88
|
variant: "outline",
|
|
88
89
|
size: "sm",
|
|
89
|
-
onClick: () =>
|
|
90
|
+
onClick: () => p(!f),
|
|
90
91
|
children: [
|
|
91
|
-
/* @__PURE__ */ (0,
|
|
92
|
-
|
|
92
|
+
/* @__PURE__ */ (0, u.jsx)(c, { className: "w-4 h-4 mr-2" }),
|
|
93
|
+
f ? "Hide" : "Show",
|
|
93
94
|
" QR"
|
|
94
95
|
]
|
|
95
96
|
})]
|
|
96
|
-
}) : /* @__PURE__ */ (0,
|
|
97
|
+
}) : /* @__PURE__ */ (0, u.jsxs)("div", {
|
|
97
98
|
className: "space-y-3",
|
|
98
99
|
children: [
|
|
99
|
-
/* @__PURE__ */ (0,
|
|
100
|
+
/* @__PURE__ */ (0, u.jsxs)("div", {
|
|
100
101
|
className: "flex items-center gap-2",
|
|
101
|
-
children: [/* @__PURE__ */ (0,
|
|
102
|
+
children: [/* @__PURE__ */ (0, u.jsx)(o, {
|
|
102
103
|
type: "text",
|
|
103
104
|
value: e || "",
|
|
104
105
|
onChange: (e) => t(e.target.value),
|
|
105
|
-
placeholder:
|
|
106
|
-
disabled:
|
|
107
|
-
className:
|
|
108
|
-
}), e && /* @__PURE__ */ (0,
|
|
106
|
+
placeholder: m?.placeholder || "Enter text for QR code",
|
|
107
|
+
disabled: l || d.disabled,
|
|
108
|
+
className: d.className
|
|
109
|
+
}), e && /* @__PURE__ */ (0, u.jsxs)(u.Fragment, { children: [/* @__PURE__ */ (0, u.jsx)(i, {
|
|
109
110
|
type: "button",
|
|
110
111
|
variant: "outline",
|
|
111
112
|
size: "sm",
|
|
112
113
|
onClick: () => {
|
|
113
114
|
e && navigator.clipboard.writeText(e);
|
|
114
115
|
},
|
|
115
|
-
children: /* @__PURE__ */ (0,
|
|
116
|
-
}), /* @__PURE__ */ (0,
|
|
116
|
+
children: /* @__PURE__ */ (0, u.jsx)(s, { className: "w-4 h-4" })
|
|
117
|
+
}), /* @__PURE__ */ (0, u.jsx)(i, {
|
|
117
118
|
type: "button",
|
|
118
119
|
variant: "outline",
|
|
119
120
|
size: "sm",
|
|
120
|
-
onClick: () =>
|
|
121
|
-
children: /* @__PURE__ */ (0,
|
|
121
|
+
onClick: () => p(!f),
|
|
122
|
+
children: /* @__PURE__ */ (0, u.jsx)(c, { className: "w-4 h-4" })
|
|
122
123
|
})] })]
|
|
123
124
|
}),
|
|
124
|
-
|
|
125
|
+
f && e && /* @__PURE__ */ (0, u.jsx)("div", {
|
|
125
126
|
className: "border rounded p-4 bg-white flex justify-center",
|
|
126
|
-
children: /* @__PURE__ */ (0,
|
|
127
|
+
children: /* @__PURE__ */ (0, u.jsx)("img", {
|
|
127
128
|
src: ((e) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(e)}`)(e),
|
|
128
129
|
alt: "QR Code",
|
|
129
130
|
className: "w-48 h-48"
|
|
130
131
|
})
|
|
131
132
|
}),
|
|
132
|
-
e && /* @__PURE__ */ (0,
|
|
133
|
+
e && /* @__PURE__ */ (0, u.jsxs)("p", {
|
|
133
134
|
className: "text-xs text-muted-foreground",
|
|
134
135
|
children: [
|
|
135
136
|
"QR code contains: ",
|
|
@@ -141,4 +142,4 @@ function u({ value: e, onChange: t, field: n, readonly: c, ...u }) {
|
|
|
141
142
|
});
|
|
142
143
|
}
|
|
143
144
|
//#endregion
|
|
144
|
-
export {
|
|
145
|
+
export { s as n, l as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
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";
|
|
3
4
|
import r from "react";
|
|
4
5
|
import { cn as i } from "@object-ui/components";
|
|
5
6
|
var a = n("star", [["path", {
|
|
@@ -0,0 +1,33 @@
|
|
|
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, Textarea as r } from "@object-ui/components";
|
|
5
|
+
//#region ../fields/src/widgets/RichTextField.tsx
|
|
6
|
+
var i = /* @__PURE__ */ e({ RichTextField: () => o }), a = t();
|
|
7
|
+
function o({ value: e, onChange: t, field: i, readonly: o, errorMessage: s, ...c }) {
|
|
8
|
+
if (o) return /* @__PURE__ */ (0, a.jsx)("div", {
|
|
9
|
+
className: "text-sm prose prose-sm max-w-none",
|
|
10
|
+
children: e || /* @__PURE__ */ (0, a.jsx)(n, {})
|
|
11
|
+
});
|
|
12
|
+
let l = i || c.schema, u = l?.rows || 8;
|
|
13
|
+
return /* @__PURE__ */ (0, a.jsxs)("div", {
|
|
14
|
+
className: "space-y-2",
|
|
15
|
+
children: [/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
16
|
+
className: "flex items-center justify-between text-xs text-gray-500",
|
|
17
|
+
children: [/* @__PURE__ */ (0, a.jsxs)("span", { children: ["Format: ", l?.format || "markdown"] }), /* @__PURE__ */ (0, a.jsx)("span", {
|
|
18
|
+
className: "italic",
|
|
19
|
+
children: "Rich text editor (basic)"
|
|
20
|
+
})]
|
|
21
|
+
}), /* @__PURE__ */ (0, a.jsx)(r, {
|
|
22
|
+
value: e || "",
|
|
23
|
+
onChange: (e) => t(e.target.value),
|
|
24
|
+
placeholder: l?.placeholder || "Enter text...",
|
|
25
|
+
disabled: o || c.disabled,
|
|
26
|
+
rows: u,
|
|
27
|
+
className: `font-mono text-sm ${c.className || ""}`,
|
|
28
|
+
"aria-invalid": !!s
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { i 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 { t as n } from "./useFieldTranslation-CfXaJRC4.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { EmptyValue as r, Select as i, SelectContent as a, SelectItem as o, SelectTrigger as s, SelectValue as c } from "@object-ui/components";
|
|
6
|
+
//#region ../fields/src/widgets/SelectField.tsx
|
|
7
|
+
var l = /* @__PURE__ */ e({ SelectField: () => d }), u = t();
|
|
8
|
+
function d({ value: e, onChange: t, field: l, readonly: d, ...f }) {
|
|
9
|
+
let p = l || f.schema, m = p?.options || [], { t: h } = n();
|
|
10
|
+
if (d) {
|
|
11
|
+
let t = m.find((t) => t.value === e)?.label || e;
|
|
12
|
+
return t ? /* @__PURE__ */ (0, u.jsx)("span", {
|
|
13
|
+
className: "text-sm",
|
|
14
|
+
children: t
|
|
15
|
+
}) : /* @__PURE__ */ (0, u.jsx)(r, {});
|
|
16
|
+
}
|
|
17
|
+
return /* @__PURE__ */ (0, u.jsxs)(i, {
|
|
18
|
+
...f,
|
|
19
|
+
value: e,
|
|
20
|
+
onValueChange: t,
|
|
21
|
+
disabled: d || f.disabled,
|
|
22
|
+
children: [/* @__PURE__ */ (0, u.jsx)(s, {
|
|
23
|
+
className: f.className,
|
|
24
|
+
id: f.id,
|
|
25
|
+
children: /* @__PURE__ */ (0, u.jsx)(c, { placeholder: p?.placeholder || h("common.selectOption") })
|
|
26
|
+
}), /* @__PURE__ */ (0, u.jsx)(a, {
|
|
27
|
+
position: "popper",
|
|
28
|
+
children: m.map((e) => /* @__PURE__ */ (0, u.jsx)(o, {
|
|
29
|
+
value: e.value,
|
|
30
|
+
children: e.label
|
|
31
|
+
}, e.value))
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { l as n, d as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
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";
|
|
3
4
|
import r, { useEffect as i, useRef as a } from "react";
|
|
4
5
|
import { Button as o } from "@object-ui/components";
|
|
5
6
|
var s = n("eraser", [["path", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
|
|
2
|
+
import { t } from "./jsx-runtime-CXSCp6pT.js";
|
|
2
3
|
import "react";
|
|
3
4
|
import { Slider as n } from "@object-ui/components";
|
|
4
5
|
//#region ../fields/src/widgets/SliderField.tsx
|
|
@@ -0,0 +1,22 @@
|
|
|
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 } from "@object-ui/components";
|
|
5
|
+
//#region ../fields/src/widgets/SummaryField.tsx
|
|
6
|
+
var r = /* @__PURE__ */ e({ SummaryField: () => a }), i = t();
|
|
7
|
+
function a({ value: e, field: t, ...r }) {
|
|
8
|
+
let a = (t || r.schema)?.summary_type || "count";
|
|
9
|
+
if (e == null) return /* @__PURE__ */ (0, i.jsx)(n, { className: r.className });
|
|
10
|
+
let o;
|
|
11
|
+
return o = a === "count" ? String(e) : [
|
|
12
|
+
"sum",
|
|
13
|
+
"avg",
|
|
14
|
+
"min",
|
|
15
|
+
"max"
|
|
16
|
+
].includes(a) && typeof e == "number" ? e.toFixed(2) : String(e), /* @__PURE__ */ (0, i.jsx)("span", {
|
|
17
|
+
className: `text-sm font-medium tabular-nums text-gray-700 ${r.className || ""}`,
|
|
18
|
+
children: o
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { r as t };
|
|
@@ -0,0 +1,37 @@
|
|
|
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, Textarea as r } from "@object-ui/components";
|
|
5
|
+
//#region ../fields/src/widgets/TextAreaField.tsx
|
|
6
|
+
var i = /* @__PURE__ */ e({ TextAreaField: () => o }), a = t();
|
|
7
|
+
function o({ value: e, onChange: t, field: i, readonly: o, errorMessage: s, ...c }) {
|
|
8
|
+
if (o) return /* @__PURE__ */ (0, a.jsx)("div", {
|
|
9
|
+
className: "text-sm whitespace-pre-wrap",
|
|
10
|
+
children: e || /* @__PURE__ */ (0, a.jsx)(n, {})
|
|
11
|
+
});
|
|
12
|
+
let l = i || c.schema, u = l?.rows || 4, d = l?.max_length, { inputType: f, ...p } = c;
|
|
13
|
+
return /* @__PURE__ */ (0, a.jsxs)("div", {
|
|
14
|
+
className: "relative",
|
|
15
|
+
children: [/* @__PURE__ */ (0, a.jsx)(r, {
|
|
16
|
+
...p,
|
|
17
|
+
value: e || "",
|
|
18
|
+
onChange: (e) => t(e.target.value),
|
|
19
|
+
placeholder: l?.placeholder,
|
|
20
|
+
disabled: o || p.disabled,
|
|
21
|
+
rows: u,
|
|
22
|
+
maxLength: d,
|
|
23
|
+
"aria-invalid": !!s
|
|
24
|
+
}), d && /* @__PURE__ */ (0, a.jsxs)("div", {
|
|
25
|
+
className: "absolute bottom-2 right-2 text-xs text-gray-400",
|
|
26
|
+
"aria-live": "polite",
|
|
27
|
+
"aria-label": `Character count: ${(e || "").length} of ${d}`,
|
|
28
|
+
children: [
|
|
29
|
+
(e || "").length,
|
|
30
|
+
"/",
|
|
31
|
+
d
|
|
32
|
+
]
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { i as n, o as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
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, Textarea as i } from "@object-ui/components";
|
|
5
|
+
//#region ../fields/src/widgets/TextField.tsx
|
|
6
|
+
var a = /* @__PURE__ */ e({ TextField: () => s }), o = t();
|
|
7
|
+
function s({ value: e, onChange: t, field: a, readonly: s, ...c }) {
|
|
8
|
+
let l = a || c.schema;
|
|
9
|
+
if (s) return /* @__PURE__ */ (0, o.jsx)("span", {
|
|
10
|
+
className: "text-sm",
|
|
11
|
+
children: e || /* @__PURE__ */ (0, o.jsx)(n, {})
|
|
12
|
+
});
|
|
13
|
+
let u = l?.rows, { inputType: d, ...f } = c;
|
|
14
|
+
return u && u > 1 ? /* @__PURE__ */ (0, o.jsx)(i, {
|
|
15
|
+
...f,
|
|
16
|
+
value: e || "",
|
|
17
|
+
onChange: (e) => t(e.target.value),
|
|
18
|
+
placeholder: l?.placeholder,
|
|
19
|
+
disabled: s || f.disabled
|
|
20
|
+
}) : /* @__PURE__ */ (0, o.jsx)(r, {
|
|
21
|
+
...f,
|
|
22
|
+
type: l?.type === "password" ? "password" : "text",
|
|
23
|
+
value: e || "",
|
|
24
|
+
onChange: (e) => t(e.target.value),
|
|
25
|
+
placeholder: l?.placeholder,
|
|
26
|
+
disabled: s || f.disabled
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { a as n, s as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
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/TimeField.tsx
|
|
6
|
+
var i = /* @__PURE__ */ e({ TimeField: () => o }), a = t();
|
|
7
|
+
function o({ value: e, onChange: t, field: i, readonly: o, ...s }) {
|
|
8
|
+
if (o) return /* @__PURE__ */ (0, a.jsx)("span", {
|
|
9
|
+
className: "text-sm",
|
|
10
|
+
children: e || /* @__PURE__ */ (0, a.jsx)(n, {})
|
|
11
|
+
});
|
|
12
|
+
let { inputType: c, ...l } = s;
|
|
13
|
+
return /* @__PURE__ */ (0, a.jsx)(r, {
|
|
14
|
+
...l,
|
|
15
|
+
type: "time",
|
|
16
|
+
value: e || "",
|
|
17
|
+
onChange: (e) => t(e.target.value),
|
|
18
|
+
disabled: o || l.disabled
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { i as n, o as t };
|
|
@@ -0,0 +1,31 @@
|
|
|
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/UrlField.tsx
|
|
6
|
+
var i = /* @__PURE__ */ e({ UrlField: () => o }), a = t();
|
|
7
|
+
function o({ value: e, onChange: t, field: i, readonly: o, errorMessage: s, ...c }) {
|
|
8
|
+
let l = i || c.schema;
|
|
9
|
+
if (o) return e ? e.startsWith("http://") || e.startsWith("https://") ? /* @__PURE__ */ (0, a.jsx)("a", {
|
|
10
|
+
href: e,
|
|
11
|
+
target: "_blank",
|
|
12
|
+
rel: "noopener noreferrer",
|
|
13
|
+
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
14
|
+
children: e
|
|
15
|
+
}) : /* @__PURE__ */ (0, a.jsx)("span", {
|
|
16
|
+
className: "text-sm",
|
|
17
|
+
children: e
|
|
18
|
+
}) : /* @__PURE__ */ (0, a.jsx)(n, {});
|
|
19
|
+
let { inputType: u, ...d } = c;
|
|
20
|
+
return /* @__PURE__ */ (0, a.jsx)(r, {
|
|
21
|
+
...d,
|
|
22
|
+
type: "url",
|
|
23
|
+
value: e || "",
|
|
24
|
+
onChange: (e) => t(e.target.value),
|
|
25
|
+
placeholder: l?.placeholder || "https://example.com",
|
|
26
|
+
disabled: o || d.disabled,
|
|
27
|
+
"aria-invalid": !!s
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { i as n, o as t };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
|
|
2
|
+
import { t } from "./jsx-runtime-CXSCp6pT.js";
|
|
3
|
+
import { t as n } from "./x-98xe-fYG.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { Avatar as r, AvatarFallback as i, Badge as a, EmptyValue as o } from "@object-ui/components";
|
|
6
|
+
//#region ../fields/src/widgets/UserField.tsx
|
|
7
|
+
var s = /* @__PURE__ */ e({ UserField: () => l }), c = t();
|
|
8
|
+
function l({ value: e, onChange: t, field: s, readonly: l, ...u }) {
|
|
9
|
+
let d = (s || u.schema)?.multiple || !1;
|
|
10
|
+
if (l) {
|
|
11
|
+
if (!e) return /* @__PURE__ */ (0, c.jsx)(o, {});
|
|
12
|
+
let t = Array.isArray(e) ? e : [e];
|
|
13
|
+
return /* @__PURE__ */ (0, c.jsxs)("div", {
|
|
14
|
+
className: "flex -space-x-2",
|
|
15
|
+
children: [t.slice(0, 3).map((e, t) => {
|
|
16
|
+
let n = e.name || e.username || "User";
|
|
17
|
+
return /* @__PURE__ */ (0, c.jsx)(r, {
|
|
18
|
+
className: "size-8 border-2 border-white",
|
|
19
|
+
title: n,
|
|
20
|
+
children: /* @__PURE__ */ (0, c.jsx)(i, {
|
|
21
|
+
className: "bg-blue-500 text-white text-xs",
|
|
22
|
+
children: n.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
|
|
23
|
+
})
|
|
24
|
+
}, t);
|
|
25
|
+
}), t.length > 3 && /* @__PURE__ */ (0, c.jsx)(r, {
|
|
26
|
+
className: "size-8 border-2 border-white",
|
|
27
|
+
children: /* @__PURE__ */ (0, c.jsxs)(i, {
|
|
28
|
+
className: "bg-gray-200 text-gray-600 text-xs",
|
|
29
|
+
children: ["+", t.length - 3]
|
|
30
|
+
})
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
let f = e ? Array.isArray(e) ? e : [e] : [], p = (e) => {
|
|
35
|
+
if (d) {
|
|
36
|
+
let n = f.filter((t, n) => n !== e);
|
|
37
|
+
t(n.length > 0 ? n : null);
|
|
38
|
+
} else t(null);
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ (0, c.jsxs)("div", {
|
|
41
|
+
className: u.className,
|
|
42
|
+
children: [f.length > 0 && /* @__PURE__ */ (0, c.jsx)("div", {
|
|
43
|
+
className: "flex flex-wrap gap-2 mb-2",
|
|
44
|
+
children: f.map((e, t) => {
|
|
45
|
+
let o = e.name || e.username || "User";
|
|
46
|
+
return /* @__PURE__ */ (0, c.jsxs)(a, {
|
|
47
|
+
variant: "outline",
|
|
48
|
+
className: "gap-2 pr-1",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ (0, c.jsx)(r, {
|
|
51
|
+
className: "size-5",
|
|
52
|
+
children: /* @__PURE__ */ (0, c.jsx)(i, {
|
|
53
|
+
className: "bg-blue-500 text-white text-xs",
|
|
54
|
+
children: o.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ (0, c.jsx)("span", {
|
|
58
|
+
className: "text-sm",
|
|
59
|
+
children: o
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ (0, c.jsx)("button", {
|
|
62
|
+
type: "button",
|
|
63
|
+
onClick: () => p(t),
|
|
64
|
+
className: "ml-1 rounded-full hover:bg-gray-200 p-0.5",
|
|
65
|
+
children: /* @__PURE__ */ (0, c.jsx)(n, { className: "size-3" })
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
}, t);
|
|
69
|
+
})
|
|
70
|
+
}), /* @__PURE__ */ (0, c.jsx)("div", {
|
|
71
|
+
className: "text-sm text-gray-500 italic",
|
|
72
|
+
children: "User selection component requires integration with user management system"
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { s as t };
|
|
@@ -0,0 +1,34 @@
|
|
|
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 } from "@object-ui/components";
|
|
5
|
+
//#region ../fields/src/widgets/VectorField.tsx
|
|
6
|
+
var r = /* @__PURE__ */ e({ VectorField: () => a }), i = t();
|
|
7
|
+
function a({ value: e, field: t, ...r }) {
|
|
8
|
+
let a = (t || r.schema)?.dimensions || (Array.isArray(e) ? e.length : 0);
|
|
9
|
+
if (!e || !Array.isArray(e)) return /* @__PURE__ */ (0, i.jsx)(n, {});
|
|
10
|
+
let o = e.slice(0, 3).map((e) => {
|
|
11
|
+
let t = Number(e);
|
|
12
|
+
return isNaN(t) ? "0" : t.toFixed(4);
|
|
13
|
+
}).join(", ");
|
|
14
|
+
return /* @__PURE__ */ (0, i.jsxs)("div", {
|
|
15
|
+
className: `text-sm ${r.className || ""}`,
|
|
16
|
+
children: [/* @__PURE__ */ (0, i.jsxs)("span", {
|
|
17
|
+
className: "font-mono text-gray-700",
|
|
18
|
+
children: [
|
|
19
|
+
"[",
|
|
20
|
+
o,
|
|
21
|
+
"...]"
|
|
22
|
+
]
|
|
23
|
+
}), /* @__PURE__ */ (0, i.jsxs)("span", {
|
|
24
|
+
className: "text-gray-500 ml-2",
|
|
25
|
+
children: [
|
|
26
|
+
"(",
|
|
27
|
+
a,
|
|
28
|
+
"D)"
|
|
29
|
+
]
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { r as t };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as e } from "./jsx-runtime-
|
|
1
|
+
import { t as e } from "./jsx-runtime-CXSCp6pT.js";
|
|
2
2
|
import t, { Suspense as n } from "react";
|
|
3
3
|
import { ComponentRegistry as r } from "@object-ui/core";
|
|
4
4
|
import { Skeleton as i } from "@object-ui/components";
|
|
5
5
|
//#region src/index.tsx
|
|
6
|
-
var a = e(), o = t.lazy(() => import("./AgGridImpl-
|
|
6
|
+
var a = e(), o = t.lazy(() => import("./AgGridImpl-DJWnS8p3.js")), s = t.lazy(() => import("./ObjectAgGridImpl-yiHlXYgp.js")), c = ({ schema: e }) => /* @__PURE__ */ (0, a.jsx)(n, {
|
|
7
7
|
fallback: /* @__PURE__ */ (0, a.jsx)(i, { className: "w-full h-[500px]" }),
|
|
8
8
|
children: /* @__PURE__ */ (0, a.jsx)(o, {
|
|
9
9
|
rowData: e.rowData,
|