@object-ui/plugin-detail 3.0.3 → 3.1.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.
- package/.turbo/turbo-build.log +45 -8
- package/CHANGELOG.md +11 -0
- package/dist/AddressField-B1iVr404.js +96 -0
- package/dist/AutoNumberField-BxnFqllo.js +8 -0
- package/dist/AvatarField-Duw4xOLZ.js +82 -0
- package/dist/BooleanField-CZ4axVeq.js +37 -0
- package/dist/CodeField-BSz-mk2v.js +21 -0
- package/dist/ColorField-B522ad8m.js +42 -0
- package/dist/CurrencyField-Cwr3_pow.js +43 -0
- package/dist/DateField-DCo6dxud.js +21 -0
- package/dist/DateTimeField-BWfBuANO.js +28 -0
- package/dist/EmailField-CpwbdVCU.js +31 -0
- package/dist/FileField-DVAUAJ8e.js +133 -0
- package/dist/FormulaField-CJkkwIK8.js +9 -0
- package/dist/GeolocationField-DNCKitgo.js +123 -0
- package/dist/GridField-DSblZNfp.js +30 -0
- package/dist/ImageField-DBAlnMon.js +90 -0
- package/dist/LocationField-DsHsXA6R.js +31 -0
- package/dist/LookupField-CsT0QQz2.js +96 -0
- package/dist/MasterDetailField-Db8b7Gqs.js +108 -0
- package/dist/NumberField-0IGp7lcA.js +26 -0
- package/dist/ObjectField-BLApgJtS.js +48 -0
- package/dist/PasswordField-pHKyNlmo.js +38 -0
- package/dist/PercentField-CwgKmlIb.js +63 -0
- package/dist/PhoneField-lKtbYOdN.js +31 -0
- package/dist/QRCodeField-BTTasT3w.js +77 -0
- package/dist/RatingField-De2X-l44.js +47 -0
- package/dist/RichTextField-B5QnvUOr.js +38 -0
- package/dist/SelectField-C9AZRHWu.js +26 -0
- package/dist/SignatureField-BgcEmYzd.js +85 -0
- package/dist/SliderField-BzrttVOY.js +30 -0
- package/dist/SummaryField-ugYPYxjP.js +9 -0
- package/dist/TextAreaField-DSE_CaU6.js +39 -0
- package/dist/TextField-DFQ4T9PR.js +32 -0
- package/dist/TimeField-F0cfmsps.js +21 -0
- package/dist/UrlField-DLXrFIH-.js +33 -0
- package/dist/UserField-PXMmxJY9.js +49 -0
- package/dist/VectorField-CKg9jdGa.js +25 -0
- package/dist/index-qQ1C-yUR.js +59976 -0
- package/dist/index.js +32 -55026
- package/dist/index.umd.cjs +41 -30
- package/dist/plugin-detail.css +1 -1
- package/dist/src/ActivityTimeline.d.ts +20 -0
- package/dist/src/ActivityTimeline.d.ts.map +1 -0
- package/dist/src/CommentAttachment.d.ts +25 -0
- package/dist/src/CommentAttachment.d.ts.map +1 -0
- package/dist/src/CommentInput.d.ts +24 -0
- package/dist/src/CommentInput.d.ts.map +1 -0
- package/dist/src/DetailSection.d.ts +8 -0
- package/dist/src/DetailSection.d.ts.map +1 -1
- package/dist/src/DetailView.d.ts +4 -0
- package/dist/src/DetailView.d.ts.map +1 -1
- package/dist/src/DetailView.stories.d.ts +8 -0
- package/dist/src/DetailView.stories.d.ts.map +1 -1
- package/dist/src/DiffView.d.ts +24 -0
- package/dist/src/DiffView.d.ts.map +1 -0
- package/dist/src/FieldChangeItem.d.ts +21 -0
- package/dist/src/FieldChangeItem.d.ts.map +1 -0
- package/dist/src/HeaderHighlight.d.ts +18 -0
- package/dist/src/HeaderHighlight.d.ts.map +1 -0
- package/dist/src/InlineCreateRelated.d.ts +32 -0
- package/dist/src/InlineCreateRelated.d.ts.map +1 -0
- package/dist/src/MentionAutocomplete.d.ts +43 -0
- package/dist/src/MentionAutocomplete.d.ts.map +1 -0
- package/dist/src/PointInTimeRestore.d.ts +28 -0
- package/dist/src/PointInTimeRestore.d.ts.map +1 -0
- package/dist/src/ReactionPicker.d.ts +25 -0
- package/dist/src/ReactionPicker.d.ts.map +1 -0
- package/dist/src/RecordActivityTimeline.d.ts +49 -0
- package/dist/src/RecordActivityTimeline.d.ts.map +1 -0
- package/dist/src/RecordChatterPanel.d.ts +48 -0
- package/dist/src/RecordChatterPanel.d.ts.map +1 -0
- package/dist/src/RecordComments.d.ts +20 -0
- package/dist/src/RecordComments.d.ts.map +1 -0
- package/dist/src/RecordNavigationEnhanced.d.ts +18 -0
- package/dist/src/RecordNavigationEnhanced.d.ts.map +1 -0
- package/dist/src/RelatedList.d.ts +20 -0
- package/dist/src/RelatedList.d.ts.map +1 -1
- package/dist/src/RelationshipGraph.d.ts +23 -0
- package/dist/src/RelationshipGraph.d.ts.map +1 -0
- package/dist/src/RichTextCommentInput.d.ts +24 -0
- package/dist/src/RichTextCommentInput.d.ts.map +1 -0
- package/dist/src/SectionGroup.d.ts +21 -0
- package/dist/src/SectionGroup.d.ts.map +1 -0
- package/dist/src/SubscriptionToggle.d.ts +22 -0
- package/dist/src/SubscriptionToggle.d.ts.map +1 -0
- package/dist/src/ThreadedReplies.d.ts +26 -0
- package/dist/src/ThreadedReplies.d.ts.map +1 -0
- package/dist/src/autoLayout.d.ts +34 -0
- package/dist/src/autoLayout.d.ts.map +1 -0
- package/dist/src/index.d.ts +40 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/useDetailTranslation.d.ts +34 -0
- package/dist/src/useDetailTranslation.d.ts.map +1 -0
- package/package.json +8 -7
- package/src/ActivityTimeline.tsx +184 -0
- package/src/CommentAttachment.tsx +192 -0
- package/src/CommentInput.tsx +81 -0
- package/src/DetailSection.tsx +81 -10
- package/src/DetailView.stories.tsx +76 -0
- package/src/DetailView.tsx +519 -66
- package/src/DiffView.tsx +231 -0
- package/src/FieldChangeItem.tsx +46 -0
- package/src/HeaderHighlight.tsx +67 -0
- package/src/InlineCreateRelated.tsx +291 -0
- package/src/MentionAutocomplete.tsx +123 -0
- package/src/PointInTimeRestore.tsx +261 -0
- package/src/ReactionPicker.tsx +106 -0
- package/src/RecordActivityTimeline.tsx +429 -0
- package/src/RecordChatterPanel.tsx +202 -0
- package/src/RecordComments.tsx +215 -0
- package/src/RecordNavigationEnhanced.tsx +211 -0
- package/src/RelatedList.tsx +314 -19
- package/src/RelationshipGraph.tsx +286 -0
- package/src/RichTextCommentInput.tsx +348 -0
- package/src/SectionGroup.tsx +101 -0
- package/src/SubscriptionToggle.tsx +60 -0
- package/src/ThreadedReplies.tsx +161 -0
- package/src/__tests__/ActivityTimeline.test.tsx +119 -0
- package/src/__tests__/ActivityTimelineFiltering.test.tsx +143 -0
- package/src/__tests__/CommentInput.test.tsx +57 -0
- package/src/__tests__/DetailSection.test.tsx +320 -0
- package/src/__tests__/DetailView.test.tsx +415 -1
- package/src/__tests__/FieldChangeItem.test.tsx +119 -0
- package/src/__tests__/HeaderHighlight.test.tsx +68 -0
- package/src/__tests__/MentionAutocomplete.test.tsx +97 -0
- package/src/__tests__/ReactionPicker.test.tsx +113 -0
- package/src/__tests__/RecordActivityTimeline.test.tsx +395 -0
- package/src/__tests__/RecordChatterPanel.test.tsx +227 -0
- package/src/__tests__/RecordComments.test.tsx +96 -0
- package/src/__tests__/RecordCommentsPinSearch.test.tsx +133 -0
- package/src/__tests__/RelatedList.test.tsx +160 -0
- package/src/__tests__/SectionGroup.test.tsx +101 -0
- package/src/__tests__/SubscriptionToggle.test.tsx +84 -0
- package/src/__tests__/ThreadedReplies.test.tsx +212 -0
- package/src/__tests__/autoLayout.test.ts +184 -0
- package/src/__tests__/phase12-features.test.tsx +583 -0
- package/src/__tests__/roadmap-features.test.tsx +478 -0
- package/src/autoLayout.ts +111 -0
- package/src/index.tsx +50 -0
- package/src/useDetailTranslation.ts +114 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { I as d } from "./index-qQ1C-yUR.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function f({ value: e, onChange: o, field: a, readonly: r, errorMessage: l, ...n }) {
|
|
5
|
+
const s = a || n.schema;
|
|
6
|
+
if (r)
|
|
7
|
+
return e ? /* @__PURE__ */ t(
|
|
8
|
+
"a",
|
|
9
|
+
{
|
|
10
|
+
href: `tel:${e}`,
|
|
11
|
+
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
12
|
+
children: e
|
|
13
|
+
}
|
|
14
|
+
) : /* @__PURE__ */ t("span", { className: "text-sm", children: "-" });
|
|
15
|
+
const { inputType: m, ...i } = n;
|
|
16
|
+
return /* @__PURE__ */ t(
|
|
17
|
+
d,
|
|
18
|
+
{
|
|
19
|
+
...i,
|
|
20
|
+
type: "tel",
|
|
21
|
+
value: e || "",
|
|
22
|
+
onChange: (c) => o(c.target.value),
|
|
23
|
+
placeholder: s?.placeholder || "(555) 123-4567",
|
|
24
|
+
disabled: r || i.disabled,
|
|
25
|
+
"aria-invalid": !!l
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
f as PhoneField
|
|
31
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsxs as s, jsx as t, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { B as n, Q as d, I as u, v as N } from "./index-qQ1C-yUR.js";
|
|
4
|
+
function b({ value: e, onChange: l, field: m, readonly: i, ...r }) {
|
|
5
|
+
const [a, o] = g.useState(!1), h = m || r.schema, p = (c) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(c)}`, f = () => {
|
|
6
|
+
e && navigator.clipboard.writeText(e);
|
|
7
|
+
};
|
|
8
|
+
return i ? /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
|
|
9
|
+
/* @__PURE__ */ t("span", { className: "text-sm flex-1 truncate", children: e || "-" }),
|
|
10
|
+
e && /* @__PURE__ */ s(
|
|
11
|
+
n,
|
|
12
|
+
{
|
|
13
|
+
type: "button",
|
|
14
|
+
variant: "outline",
|
|
15
|
+
size: "sm",
|
|
16
|
+
onClick: () => o(!a),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ t(d, { className: "w-4 h-4 mr-2" }),
|
|
19
|
+
a ? "Hide" : "Show",
|
|
20
|
+
" QR"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
] }) : /* @__PURE__ */ s("div", { className: "space-y-3", children: [
|
|
25
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
26
|
+
/* @__PURE__ */ t(
|
|
27
|
+
u,
|
|
28
|
+
{
|
|
29
|
+
type: "text",
|
|
30
|
+
value: e || "",
|
|
31
|
+
onChange: (c) => l(c.target.value),
|
|
32
|
+
placeholder: h?.placeholder || "Enter text for QR code",
|
|
33
|
+
disabled: i || r.disabled,
|
|
34
|
+
className: r.className
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
e && /* @__PURE__ */ s(x, { children: [
|
|
38
|
+
/* @__PURE__ */ t(
|
|
39
|
+
n,
|
|
40
|
+
{
|
|
41
|
+
type: "button",
|
|
42
|
+
variant: "outline",
|
|
43
|
+
size: "sm",
|
|
44
|
+
onClick: f,
|
|
45
|
+
children: /* @__PURE__ */ t(N, { className: "w-4 h-4" })
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ t(
|
|
49
|
+
n,
|
|
50
|
+
{
|
|
51
|
+
type: "button",
|
|
52
|
+
variant: "outline",
|
|
53
|
+
size: "sm",
|
|
54
|
+
onClick: () => o(!a),
|
|
55
|
+
children: /* @__PURE__ */ t(d, { className: "w-4 h-4" })
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] })
|
|
59
|
+
] }),
|
|
60
|
+
a && e && /* @__PURE__ */ t("div", { className: "border rounded p-4 bg-white flex justify-center", children: /* @__PURE__ */ t(
|
|
61
|
+
"img",
|
|
62
|
+
{
|
|
63
|
+
src: p(e),
|
|
64
|
+
alt: "QR Code",
|
|
65
|
+
className: "w-48 h-48"
|
|
66
|
+
}
|
|
67
|
+
) }),
|
|
68
|
+
e && /* @__PURE__ */ s("p", { className: "text-xs text-muted-foreground", children: [
|
|
69
|
+
"QR code contains: ",
|
|
70
|
+
e.length,
|
|
71
|
+
" characters"
|
|
72
|
+
] })
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
b as QRCodeField
|
|
77
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import y from "react";
|
|
3
|
+
import { r as c, o as m } from "./index-qQ1C-yUR.js";
|
|
4
|
+
function b({ value: d, onChange: f, field: x, readonly: n, className: s, ...a }) {
|
|
5
|
+
const t = (x || a.schema)?.max ?? 5, l = d ?? 0, [u, i] = y.useState(null), g = u !== null ? u : l;
|
|
6
|
+
return n ? /* @__PURE__ */ o("div", { className: m("flex items-center gap-1", s), children: [
|
|
7
|
+
Array.from({ length: t }, (h, e) => /* @__PURE__ */ r(
|
|
8
|
+
c,
|
|
9
|
+
{
|
|
10
|
+
className: `w-5 h-5 ${e < l ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground"}`
|
|
11
|
+
},
|
|
12
|
+
e
|
|
13
|
+
)),
|
|
14
|
+
/* @__PURE__ */ o("span", { className: "ml-2 text-sm text-muted-foreground", children: [
|
|
15
|
+
l,
|
|
16
|
+
" / ",
|
|
17
|
+
t
|
|
18
|
+
] })
|
|
19
|
+
] }) : /* @__PURE__ */ o("div", { className: m("flex items-center gap-1", s), children: [
|
|
20
|
+
Array.from({ length: t }, (h, e) => /* @__PURE__ */ r(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
type: "button",
|
|
24
|
+
onClick: () => f(e + 1),
|
|
25
|
+
onMouseEnter: () => i(e + 1),
|
|
26
|
+
onMouseLeave: () => i(null),
|
|
27
|
+
className: "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",
|
|
28
|
+
disabled: n || a.disabled,
|
|
29
|
+
children: /* @__PURE__ */ r(
|
|
30
|
+
c,
|
|
31
|
+
{
|
|
32
|
+
className: `w-5 h-5 transition-colors ${e < g ? "fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500" : "text-muted-foreground hover:text-yellow-400"}`
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
},
|
|
36
|
+
e
|
|
37
|
+
)),
|
|
38
|
+
/* @__PURE__ */ o("span", { className: "ml-2 text-sm text-muted-foreground", children: [
|
|
39
|
+
l,
|
|
40
|
+
" / ",
|
|
41
|
+
t
|
|
42
|
+
] })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
b as RatingField
|
|
47
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { T as x } from "./index-qQ1C-yUR.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function N({ value: r, onChange: c, field: n, readonly: i, errorMessage: o, ...e }) {
|
|
5
|
+
if (i)
|
|
6
|
+
return /* @__PURE__ */ a(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
className: "text-sm prose prose-sm max-w-none",
|
|
10
|
+
children: r || "-"
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
const t = n || e.schema, l = t?.rows || 8, m = t?.format || "markdown";
|
|
14
|
+
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
15
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-between text-xs text-gray-500", children: [
|
|
16
|
+
/* @__PURE__ */ s("span", { children: [
|
|
17
|
+
"Format: ",
|
|
18
|
+
m
|
|
19
|
+
] }),
|
|
20
|
+
/* @__PURE__ */ a("span", { className: "italic", children: "Rich text editor (basic)" })
|
|
21
|
+
] }),
|
|
22
|
+
/* @__PURE__ */ a(
|
|
23
|
+
x,
|
|
24
|
+
{
|
|
25
|
+
value: r || "",
|
|
26
|
+
onChange: (d) => c(d.target.value),
|
|
27
|
+
placeholder: t?.placeholder || "Enter text...",
|
|
28
|
+
disabled: i || e.disabled,
|
|
29
|
+
rows: l,
|
|
30
|
+
className: `font-mono text-sm ${e.className || ""}`,
|
|
31
|
+
"aria-invalid": !!o
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
N as RichTextField
|
|
38
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { a as m, b as h, c as u, d as S, e as f } from "./index-qQ1C-yUR.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function x({ value: t, onChange: s, field: o, readonly: c, ...e }) {
|
|
5
|
+
const i = o || e.schema, n = i?.options || [];
|
|
6
|
+
if (c) {
|
|
7
|
+
const l = n.find((d) => d.value === t);
|
|
8
|
+
return /* @__PURE__ */ a("span", { className: "text-sm", children: l?.label || t || "-" });
|
|
9
|
+
}
|
|
10
|
+
return /* @__PURE__ */ r(
|
|
11
|
+
m,
|
|
12
|
+
{
|
|
13
|
+
...e,
|
|
14
|
+
value: t,
|
|
15
|
+
onValueChange: s,
|
|
16
|
+
disabled: c || e.disabled,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ a(h, { className: e.className, id: e.id, children: /* @__PURE__ */ a(u, { placeholder: i?.placeholder || "Select an option" }) }),
|
|
19
|
+
/* @__PURE__ */ a(S, { position: "popper", children: n.map((l) => /* @__PURE__ */ a(f, { value: l.value, children: l.label }, l.value)) })
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
x as SelectField
|
|
26
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import v, { useRef as b, useEffect as S } from "react";
|
|
3
|
+
import { B as C, u as R } from "./index-qQ1C-yUR.js";
|
|
4
|
+
function E({ value: c, onChange: g, readonly: i }) {
|
|
5
|
+
const r = b(null), [h, m] = v.useState(!1), [p, a] = v.useState(!c);
|
|
6
|
+
S(() => {
|
|
7
|
+
if (c && r.current) {
|
|
8
|
+
const e = r.current.getContext("2d");
|
|
9
|
+
if (e) {
|
|
10
|
+
const n = new Image();
|
|
11
|
+
n.onload = () => {
|
|
12
|
+
e.drawImage(n, 0, 0), a(!1);
|
|
13
|
+
}, n.src = c;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}, [c]);
|
|
17
|
+
const x = (t) => {
|
|
18
|
+
if (i) return;
|
|
19
|
+
m(!0), a(!1);
|
|
20
|
+
const e = r.current;
|
|
21
|
+
if (!e) return;
|
|
22
|
+
const n = e.getContext("2d");
|
|
23
|
+
if (!n) return;
|
|
24
|
+
const s = e.getBoundingClientRect(), l = "touches" in t ? t.touches[0].clientX - s.left : t.clientX - s.left, d = "touches" in t ? t.touches[0].clientY - s.top : t.clientY - s.top;
|
|
25
|
+
n.beginPath(), n.moveTo(l, d);
|
|
26
|
+
}, w = (t) => {
|
|
27
|
+
if (!h || i) return;
|
|
28
|
+
const e = r.current;
|
|
29
|
+
if (!e) return;
|
|
30
|
+
const n = e.getContext("2d");
|
|
31
|
+
if (!n) return;
|
|
32
|
+
const s = e.getBoundingClientRect(), l = "touches" in t ? t.touches[0].clientX - s.left : t.clientX - s.left, d = "touches" in t ? t.touches[0].clientY - s.top : t.clientY - s.top;
|
|
33
|
+
n.lineTo(l, d), n.strokeStyle = "#000", n.lineWidth = 2, n.lineCap = "round", n.lineJoin = "round", n.stroke();
|
|
34
|
+
}, u = () => {
|
|
35
|
+
if (!h) return;
|
|
36
|
+
m(!1);
|
|
37
|
+
const t = r.current;
|
|
38
|
+
if (!t) return;
|
|
39
|
+
const e = t.toDataURL("image/png");
|
|
40
|
+
g(e);
|
|
41
|
+
}, N = () => {
|
|
42
|
+
const t = r.current;
|
|
43
|
+
if (!t) return;
|
|
44
|
+
const e = t.getContext("2d");
|
|
45
|
+
e && (e.clearRect(0, 0, t.width, t.height), a(!0), g(""));
|
|
46
|
+
};
|
|
47
|
+
return i && c ? /* @__PURE__ */ o("div", { className: "border rounded p-2 bg-white", children: /* @__PURE__ */ o("img", { src: c, alt: "Signature", loading: "lazy", className: "max-w-full h-auto" }) }) : i && !c ? /* @__PURE__ */ o("span", { className: "text-sm text-muted-foreground", children: "No signature" }) : /* @__PURE__ */ f("div", { className: "space-y-2", children: [
|
|
48
|
+
/* @__PURE__ */ o("div", { className: "border rounded bg-white", children: /* @__PURE__ */ o(
|
|
49
|
+
"canvas",
|
|
50
|
+
{
|
|
51
|
+
ref: r,
|
|
52
|
+
width: 400,
|
|
53
|
+
height: 200,
|
|
54
|
+
className: "w-full touch-none cursor-crosshair",
|
|
55
|
+
onMouseDown: x,
|
|
56
|
+
onMouseMove: w,
|
|
57
|
+
onMouseUp: u,
|
|
58
|
+
onMouseLeave: u,
|
|
59
|
+
onTouchStart: x,
|
|
60
|
+
onTouchMove: w,
|
|
61
|
+
onTouchEnd: u
|
|
62
|
+
}
|
|
63
|
+
) }),
|
|
64
|
+
/* @__PURE__ */ f("div", { className: "flex justify-between items-center", children: [
|
|
65
|
+
/* @__PURE__ */ o("p", { className: "text-xs text-muted-foreground", children: p ? "Sign above" : "Signature captured" }),
|
|
66
|
+
/* @__PURE__ */ f(
|
|
67
|
+
C,
|
|
68
|
+
{
|
|
69
|
+
type: "button",
|
|
70
|
+
variant: "outline",
|
|
71
|
+
size: "sm",
|
|
72
|
+
onClick: N,
|
|
73
|
+
disabled: i || p,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ o(R, { className: "w-4 h-4 mr-2" }),
|
|
76
|
+
"Clear"
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
E as SignatureField
|
|
85
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { f as x } from "./index-qQ1C-yUR.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function u({ value: s, onChange: l, field: r, readonly: n, ...t }) {
|
|
5
|
+
const i = r || t.schema, e = i?.min ?? 0, c = i?.max ?? 100, d = i?.step ?? 1;
|
|
6
|
+
return n ? /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
7
|
+
/* @__PURE__ */ a("span", { className: "text-sm font-medium", children: s ?? e }),
|
|
8
|
+
/* @__PURE__ */ m("span", { className: "text-xs text-muted-foreground", children: [
|
|
9
|
+
"/ ",
|
|
10
|
+
c
|
|
11
|
+
] })
|
|
12
|
+
] }) : /* @__PURE__ */ m("div", { className: "flex items-center gap-4", children: [
|
|
13
|
+
/* @__PURE__ */ a(
|
|
14
|
+
x,
|
|
15
|
+
{
|
|
16
|
+
value: [s ?? e],
|
|
17
|
+
onValueChange: (o) => l(o[0]),
|
|
18
|
+
min: e,
|
|
19
|
+
max: c,
|
|
20
|
+
step: d,
|
|
21
|
+
disabled: n || t.disabled,
|
|
22
|
+
className: t.className
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ a("span", { className: "text-sm font-medium w-12 text-right", children: s ?? e })
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
u as SliderField
|
|
30
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
function u({ value: m, field: n, ...e }) {
|
|
3
|
+
const s = (n || e.schema)?.summary_type || "count";
|
|
4
|
+
let t = "-";
|
|
5
|
+
return m != null && (s === "count" ? t = String(m) : ["sum", "avg", "min", "max"].includes(s) ? t = typeof m == "number" ? m.toFixed(2) : String(m) : t = String(m)), /* @__PURE__ */ i("span", { className: `text-sm font-medium tabular-nums text-gray-700 ${e.className || ""}`, children: t });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
u as SummaryField
|
|
9
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as l, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { T as x } from "./index-qQ1C-yUR.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function u({ value: e, onChange: n, field: c, readonly: r, errorMessage: d, ...i }) {
|
|
5
|
+
if (r)
|
|
6
|
+
return /* @__PURE__ */ l("div", { className: "text-sm whitespace-pre-wrap", children: e || "-" });
|
|
7
|
+
const a = c || i.schema, h = a?.rows || 4, t = a?.max_length, { inputType: p, ...s } = i;
|
|
8
|
+
return /* @__PURE__ */ o("div", { className: "relative", children: [
|
|
9
|
+
/* @__PURE__ */ l(
|
|
10
|
+
x,
|
|
11
|
+
{
|
|
12
|
+
...s,
|
|
13
|
+
value: e || "",
|
|
14
|
+
onChange: (m) => n(m.target.value),
|
|
15
|
+
placeholder: a?.placeholder,
|
|
16
|
+
disabled: r || s.disabled,
|
|
17
|
+
rows: h,
|
|
18
|
+
maxLength: t,
|
|
19
|
+
"aria-invalid": !!d
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
t && /* @__PURE__ */ o(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: "absolute bottom-2 right-2 text-xs text-gray-400",
|
|
26
|
+
"aria-live": "polite",
|
|
27
|
+
"aria-label": `Character count: ${(e || "").length} of ${t}`,
|
|
28
|
+
children: [
|
|
29
|
+
(e || "").length,
|
|
30
|
+
"/",
|
|
31
|
+
t
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
u as TextAreaField
|
|
39
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { T as n, I as c } from "./index-qQ1C-yUR.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function x({ value: a, onChange: d, field: i, readonly: r, ...l }) {
|
|
5
|
+
const e = i || l.schema;
|
|
6
|
+
if (r)
|
|
7
|
+
return /* @__PURE__ */ o("span", { className: "text-sm", children: a || "-" });
|
|
8
|
+
const p = e?.rows, { inputType: m, ...t } = l;
|
|
9
|
+
return p && p > 1 ? /* @__PURE__ */ o(
|
|
10
|
+
n,
|
|
11
|
+
{
|
|
12
|
+
...t,
|
|
13
|
+
value: a || "",
|
|
14
|
+
onChange: (s) => d(s.target.value),
|
|
15
|
+
placeholder: e?.placeholder,
|
|
16
|
+
disabled: r || t.disabled
|
|
17
|
+
}
|
|
18
|
+
) : /* @__PURE__ */ o(
|
|
19
|
+
c,
|
|
20
|
+
{
|
|
21
|
+
...t,
|
|
22
|
+
type: e?.type === "password" ? "password" : "text",
|
|
23
|
+
value: a || "",
|
|
24
|
+
onChange: (s) => d(s.target.value),
|
|
25
|
+
placeholder: e?.placeholder,
|
|
26
|
+
disabled: r || t.disabled
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
x as TextField
|
|
32
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { I as p } from "./index-qQ1C-yUR.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function f({ value: e, onChange: m, field: s, readonly: t, ...n }) {
|
|
5
|
+
if (t)
|
|
6
|
+
return /* @__PURE__ */ r("span", { className: "text-sm", children: e || "-" });
|
|
7
|
+
const { inputType: a, ...i } = n;
|
|
8
|
+
return /* @__PURE__ */ r(
|
|
9
|
+
p,
|
|
10
|
+
{
|
|
11
|
+
...i,
|
|
12
|
+
type: "time",
|
|
13
|
+
value: e || "",
|
|
14
|
+
onChange: (o) => m(o.target.value),
|
|
15
|
+
disabled: t || i.disabled
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
f as TimeField
|
|
21
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { I as c } from "./index-qQ1C-yUR.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function x({ value: t, onChange: a, field: l, readonly: r, errorMessage: o, ...s }) {
|
|
5
|
+
const p = l || s.schema;
|
|
6
|
+
if (r)
|
|
7
|
+
return t ? t.startsWith("http://") || t.startsWith("https://") ? /* @__PURE__ */ e(
|
|
8
|
+
"a",
|
|
9
|
+
{
|
|
10
|
+
href: t,
|
|
11
|
+
target: "_blank",
|
|
12
|
+
rel: "noopener noreferrer",
|
|
13
|
+
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
14
|
+
children: t
|
|
15
|
+
}
|
|
16
|
+
) : /* @__PURE__ */ e("span", { className: "text-sm", children: t }) : /* @__PURE__ */ e("span", { className: "text-sm", children: "-" });
|
|
17
|
+
const { inputType: h, ...i } = s;
|
|
18
|
+
return /* @__PURE__ */ e(
|
|
19
|
+
c,
|
|
20
|
+
{
|
|
21
|
+
...i,
|
|
22
|
+
type: "url",
|
|
23
|
+
value: t || "",
|
|
24
|
+
onChange: (n) => a(n.target.value),
|
|
25
|
+
placeholder: p?.placeholder || "https://example.com",
|
|
26
|
+
disabled: r || i.disabled,
|
|
27
|
+
"aria-invalid": !!o
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
x as UrlField
|
|
33
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { A as m, q as o, h as b, X as f } from "./index-qQ1C-yUR.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function j({ value: s, onChange: d, field: p, readonly: x, ...h }) {
|
|
5
|
+
const g = (p || h.schema)?.multiple || !1;
|
|
6
|
+
if (x) {
|
|
7
|
+
if (!s) return /* @__PURE__ */ e("span", { className: "text-sm", children: "-" });
|
|
8
|
+
const t = Array.isArray(s) ? s : [s];
|
|
9
|
+
return /* @__PURE__ */ l("div", { className: "flex -space-x-2", children: [
|
|
10
|
+
t.slice(0, 3).map((r, i) => {
|
|
11
|
+
const a = r.name || r.username || "User", c = a.split(" ").map((N) => N[0]).join("").toUpperCase().slice(0, 2);
|
|
12
|
+
return /* @__PURE__ */ e(m, { className: "size-8 border-2 border-white", title: a, children: /* @__PURE__ */ e(o, { className: "bg-blue-500 text-white text-xs", children: c }) }, i);
|
|
13
|
+
}),
|
|
14
|
+
t.length > 3 && /* @__PURE__ */ e(m, { className: "size-8 border-2 border-white", children: /* @__PURE__ */ l(o, { className: "bg-gray-200 text-gray-600 text-xs", children: [
|
|
15
|
+
"+",
|
|
16
|
+
t.length - 3
|
|
17
|
+
] }) })
|
|
18
|
+
] });
|
|
19
|
+
}
|
|
20
|
+
const n = s ? Array.isArray(s) ? s : [s] : [], u = (t) => {
|
|
21
|
+
if (g) {
|
|
22
|
+
const r = n.filter((i, a) => a !== t);
|
|
23
|
+
d(r.length > 0 ? r : null);
|
|
24
|
+
} else
|
|
25
|
+
d(null);
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ l("div", { className: h.className, children: [
|
|
28
|
+
n.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2 mb-2", children: n.map((t, r) => {
|
|
29
|
+
const i = t.name || t.username || "User", a = i.split(" ").map((c) => c[0]).join("").toUpperCase().slice(0, 2);
|
|
30
|
+
return /* @__PURE__ */ l(b, { variant: "outline", className: "gap-2 pr-1", children: [
|
|
31
|
+
/* @__PURE__ */ e(m, { className: "size-5", children: /* @__PURE__ */ e(o, { className: "bg-blue-500 text-white text-xs", children: a }) }),
|
|
32
|
+
/* @__PURE__ */ e("span", { className: "text-sm", children: i }),
|
|
33
|
+
/* @__PURE__ */ e(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
onClick: () => u(r),
|
|
38
|
+
className: "ml-1 rounded-full hover:bg-gray-200 p-0.5",
|
|
39
|
+
children: /* @__PURE__ */ e(f, { className: "size-3" })
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
] }, r);
|
|
43
|
+
}) }),
|
|
44
|
+
/* @__PURE__ */ e("div", { className: "text-sm text-gray-500 italic", children: "User selection component requires integration with user management system" })
|
|
45
|
+
] });
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
j as UserField
|
|
49
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as m, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
function l({ value: s, field: n, ...r }) {
|
|
3
|
+
const i = (n || r.schema)?.dimensions || (Array.isArray(s) ? s.length : 0);
|
|
4
|
+
if (!s || !Array.isArray(s))
|
|
5
|
+
return /* @__PURE__ */ m("span", { className: "text-sm text-gray-500", children: "-" });
|
|
6
|
+
const a = s.slice(0, 3).map((c) => {
|
|
7
|
+
const t = Number(c);
|
|
8
|
+
return isNaN(t) ? "0" : t.toFixed(4);
|
|
9
|
+
}).join(", ");
|
|
10
|
+
return /* @__PURE__ */ e("div", { className: `text-sm ${r.className || ""}`, children: [
|
|
11
|
+
/* @__PURE__ */ e("span", { className: "font-mono text-gray-700", children: [
|
|
12
|
+
"[",
|
|
13
|
+
a,
|
|
14
|
+
"...]"
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ e("span", { className: "text-gray-500 ml-2", children: [
|
|
17
|
+
"(",
|
|
18
|
+
i,
|
|
19
|
+
"D)"
|
|
20
|
+
] })
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
l as VectorField
|
|
25
|
+
};
|