@object-ui/plugin-detail 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.
- package/CHANGELOG.md +11 -0
- package/README.md +21 -1
- package/dist/AddressField-LgHnO2Lk.js +98 -0
- package/dist/AutoNumberField-xZCrU0eW.js +14 -0
- package/dist/{AvatarField-Xuieq0ZI.js → AvatarField-Dy2XGlPz.js} +16 -15
- package/dist/{BooleanField-DwfMKknK.js → BooleanField-C0Clfka5.js} +11 -10
- package/dist/CodeField-CHUa07B6.js +23 -0
- package/dist/ColorField-vxHqEhcS.js +38 -0
- package/dist/CurrencyField-DiWjYWDo.js +49 -0
- package/dist/DateField-DGaRPM4P.js +22 -0
- package/dist/DateTimeField-8QnpsI_h.js +30 -0
- package/dist/EmailField-CkVgMbpI.js +26 -0
- package/dist/FileField-5UPV7uek.js +149 -0
- package/dist/FormulaField-BUgt6-Pi.js +17 -0
- package/dist/GeolocationField-D9T_jgG6.js +118 -0
- package/dist/GridField-DE_HwiIN.js +49 -0
- package/dist/ImageField-Dswnqtzf.js +73 -0
- package/dist/LocationField-gjqbE6na.js +36 -0
- package/dist/LookupField-BcS3LRKc.js +901 -0
- package/dist/{MasterDetailField-B0HTmmD7.js → MasterDetailField-BF6_-X3A.js} +20 -19
- package/dist/NumberField-Dj2rYmrS.js +27 -0
- package/dist/ObjectField-BymIojwd.js +50 -0
- package/dist/{PasswordField-DVTimsc3.js → PasswordField-ED_Xgqz-.js} +8 -7
- package/dist/PercentField-D-JKOxKC.js +61 -0
- package/dist/PhoneField-DSCaGYq7.js +26 -0
- package/dist/QRCodeField-CtcOUapi.js +73 -0
- package/dist/{RatingField-rRi_P0N0.js → RatingField-BDnyQFWy.js} +10 -9
- package/dist/RichTextField-CH6LVZQA.js +33 -0
- package/dist/SelectField-DE4dpkMV.js +36 -0
- package/dist/{SignatureField-2CnhcWI0.js → SignatureField-B1wh3f5A.js} +18 -17
- package/dist/{SliderField-DEpMVXko.js → SliderField-zoTCKh9n.js} +2 -1
- package/dist/SummaryField-BeBVT6VN.js +22 -0
- package/dist/TextAreaField-rfUGrRxh.js +37 -0
- package/dist/TextField-C_yM7ATQ.js +30 -0
- package/dist/TimeField-BcQmBZi9.js +22 -0
- package/dist/UrlField-BakaF6NI.js +31 -0
- package/dist/UserField-zS7y3eKb.js +76 -0
- package/dist/VectorField-CTZ4myDM.js +34 -0
- package/dist/index.js +1912 -1728
- package/dist/index.umd.cjs +38 -47
- package/dist/packages/plugin-detail/src/DetailSection.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/DetailView.d.ts +24 -0
- package/dist/packages/plugin-detail/src/DetailView.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/RelatedList.d.ts +8 -0
- package/dist/packages/plugin-detail/src/RelatedList.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/useDetailTranslation.d.ts.map +1 -1
- package/dist/plugin-detail.css +1 -2
- package/dist/rolldown-runtime-DnwLefa7.js +23 -0
- package/dist/{src-C56Ly5uG.js → src-DyUKLvMN.js} +18271 -26636
- package/dist/{useFieldTranslation-CkxqyB82.js → useFieldTranslation-BRgjC1oq.js} +1 -1
- package/package.json +33 -11
- package/.turbo/turbo-build.log +0 -64
- package/dist/AddressField-CDLSeyNx.js +0 -93
- package/dist/AutoNumberField-CtE7suf5.js +0 -14
- package/dist/CodeField-CfwgRxx2.js +0 -22
- package/dist/ColorField-YKHA7dBD.js +0 -37
- package/dist/CurrencyField-tvS3fPAF.js +0 -51
- package/dist/DateField-BKqXpkOh.js +0 -21
- package/dist/DateTimeField-CR-nJCE7.js +0 -32
- package/dist/EmailField-CgvW1Qal.js +0 -28
- package/dist/FileField-BVAme2ML.js +0 -151
- package/dist/FormulaField-DamJ2VaG.js +0 -14
- package/dist/GeolocationField-C99z7ZBM.js +0 -113
- package/dist/GridField-C9JbpTx_.js +0 -51
- package/dist/ImageField-CDANtgVV.js +0 -75
- package/dist/LocationField-ZSyZ0O-h.js +0 -35
- package/dist/LookupField-B3hQJt95.js +0 -903
- package/dist/LookupField-D00z6gn_.js +0 -2
- package/dist/NumberField-DL2QAL7X.js +0 -26
- package/dist/ObjectField-JYvUnuRO.js +0 -52
- package/dist/PercentField-DjR6BSpw.js +0 -63
- package/dist/PhoneField-CX1JL-jp.js +0 -28
- package/dist/QRCodeField-CH_1pU6R.js +0 -72
- package/dist/RichTextField-CJqLWlrb.js +0 -32
- package/dist/SelectField-DGoDoRM_.js +0 -30
- package/dist/SelectField-XBVI50AD.js +0 -2
- package/dist/SummaryField-7ch9aqAu.js +0 -19
- package/dist/TextAreaField-Cmw1oXcw.js +0 -36
- package/dist/TextField-OTLa3p51.js +0 -29
- package/dist/TimeField-DKPoNWoR.js +0 -21
- package/dist/UrlField-CxbmzP9f.js +0 -33
- package/dist/UserField-ChvwUkMK.js +0 -78
- package/dist/VectorField-BVClL8Vw.js +0 -36
- package/src/ActivityTimeline.tsx +0 -184
- package/src/CommentAttachment.tsx +0 -194
- package/src/CommentInput.tsx +0 -81
- package/src/DetailSection.tsx +0 -340
- package/src/DetailTabs.tsx +0 -73
- package/src/DetailView.stories.tsx +0 -334
- package/src/DetailView.tsx +0 -823
- package/src/DiffView.tsx +0 -233
- package/src/FieldChangeItem.tsx +0 -46
- package/src/HeaderHighlight.tsx +0 -88
- package/src/InlineCreateRelated.tsx +0 -291
- package/src/MentionAutocomplete.tsx +0 -123
- package/src/PointInTimeRestore.tsx +0 -261
- package/src/ReactionPicker.tsx +0 -106
- package/src/RecordActivityTimeline.tsx +0 -433
- package/src/RecordChatterPanel.tsx +0 -209
- package/src/RecordComments.tsx +0 -217
- package/src/RecordNavigationEnhanced.tsx +0 -213
- package/src/RelatedList.tsx +0 -413
- package/src/RelationshipGraph.tsx +0 -286
- package/src/RichTextCommentInput.tsx +0 -350
- package/src/SectionGroup.tsx +0 -101
- package/src/SubscriptionToggle.tsx +0 -62
- package/src/ThreadedReplies.tsx +0 -163
- package/src/__tests__/ActivityTimeline.test.tsx +0 -119
- package/src/__tests__/ActivityTimelineFiltering.test.tsx +0 -143
- package/src/__tests__/CommentInput.test.tsx +0 -57
- package/src/__tests__/DetailSection.test.tsx +0 -490
- package/src/__tests__/DetailView.test.tsx +0 -694
- package/src/__tests__/FieldChangeItem.test.tsx +0 -119
- package/src/__tests__/HeaderHighlight.test.tsx +0 -213
- package/src/__tests__/MentionAutocomplete.test.tsx +0 -97
- package/src/__tests__/ReactionPicker.test.tsx +0 -113
- package/src/__tests__/RecordActivityTimeline.test.tsx +0 -395
- package/src/__tests__/RecordChatterPanel.test.tsx +0 -265
- package/src/__tests__/RecordComments.test.tsx +0 -96
- package/src/__tests__/RecordCommentsPinSearch.test.tsx +0 -133
- package/src/__tests__/RelatedList.test.tsx +0 -160
- package/src/__tests__/SectionGroup.test.tsx +0 -101
- package/src/__tests__/SubscriptionToggle.test.tsx +0 -84
- package/src/__tests__/ThreadedReplies.test.tsx +0 -212
- package/src/__tests__/autoLayout.test.ts +0 -228
- package/src/__tests__/phase12-features.test.tsx +0 -583
- package/src/__tests__/roadmap-features.test.tsx +0 -478
- package/src/autoLayout.ts +0 -128
- package/src/index.tsx +0 -149
- package/src/useDetailTranslation.ts +0 -183
- package/tsconfig.json +0 -18
- package/vite.config.ts +0 -57
- package/vitest.config.ts +0 -13
- package/vitest.setup.ts +0 -1
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { D as e, gn as t } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/NumberField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ t({ NumberField: () => i });
|
|
6
|
-
function i({ value: t, onChange: r, field: i, readonly: a, ...o }) {
|
|
7
|
-
if (a) return /* @__PURE__ */ n("span", {
|
|
8
|
-
className: "text-sm",
|
|
9
|
-
children: t ?? "-"
|
|
10
|
-
});
|
|
11
|
-
let s = i || o.schema, c = s?.precision, { inputType: l, ...u } = o;
|
|
12
|
-
return /* @__PURE__ */ n(e, {
|
|
13
|
-
...u,
|
|
14
|
-
type: "number",
|
|
15
|
-
value: t ?? "",
|
|
16
|
-
onChange: (e) => {
|
|
17
|
-
let t = e.target.value;
|
|
18
|
-
r(t === "" ? null : Number(t));
|
|
19
|
-
},
|
|
20
|
-
placeholder: s?.placeholder,
|
|
21
|
-
disabled: a || u.disabled,
|
|
22
|
-
step: c ? 10 ** -c : "any"
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { r as t };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { gn as e, t, un as n } from "./src-C56Ly5uG.js";
|
|
2
|
-
import { useEffect as r, useState as i } from "react";
|
|
3
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/ObjectField.tsx
|
|
5
|
-
var s = /* @__PURE__ */ e({ ObjectField: () => c });
|
|
6
|
-
function c({ value: e, onChange: s, field: c, readonly: l, ...u }) {
|
|
7
|
-
let d = c || u.schema, [f, p] = i(() => e == null ? "" : JSON.stringify(e, null, 2)), [m, h] = i(null);
|
|
8
|
-
return r(() => {
|
|
9
|
-
try {
|
|
10
|
-
if (e == null) {
|
|
11
|
-
p("");
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
let t = f ? JSON.parse(f) : null;
|
|
15
|
-
JSON.stringify(t) !== JSON.stringify(e) && p(JSON.stringify(e, null, 2));
|
|
16
|
-
} catch {
|
|
17
|
-
p(JSON.stringify(e, null, 2));
|
|
18
|
-
}
|
|
19
|
-
}, [e, f]), l ? e ? /* @__PURE__ */ a("pre", {
|
|
20
|
-
className: n("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", u.className),
|
|
21
|
-
children: JSON.stringify(e, null, 2)
|
|
22
|
-
}) : /* @__PURE__ */ a("span", {
|
|
23
|
-
className: "text-sm",
|
|
24
|
-
children: "-"
|
|
25
|
-
}) : /* @__PURE__ */ o("div", {
|
|
26
|
-
className: "space-y-1",
|
|
27
|
-
children: [/* @__PURE__ */ a(t, {
|
|
28
|
-
value: f,
|
|
29
|
-
onChange: (e) => {
|
|
30
|
-
let t = e.target.value;
|
|
31
|
-
if (p(t), h(null), !t.trim()) {
|
|
32
|
-
s(null);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
s(JSON.parse(t));
|
|
37
|
-
} catch {
|
|
38
|
-
h("Invalid JSON");
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
placeholder: d?.placeholder || "{\n \"key\": \"value\"\n}",
|
|
42
|
-
disabled: l || u.disabled,
|
|
43
|
-
className: n("font-mono text-xs", m ? "border-red-500 focus-visible:ring-red-500" : "", u.className),
|
|
44
|
-
rows: 6
|
|
45
|
-
}), m && /* @__PURE__ */ a("p", {
|
|
46
|
-
className: "text-xs text-red-500",
|
|
47
|
-
children: m
|
|
48
|
-
})]
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
export { s as t };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { D as e, gn as t, p as n } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/PercentField.tsx
|
|
5
|
-
var a = /* @__PURE__ */ t({ PercentField: () => o });
|
|
6
|
-
function o({ value: t, onChange: a, field: o, readonly: s, errorMessage: c, className: l, ...u }) {
|
|
7
|
-
let d = o || u.schema, f = d?.precision ?? 2;
|
|
8
|
-
if (s) return t == null ? /* @__PURE__ */ r("span", {
|
|
9
|
-
className: "text-sm",
|
|
10
|
-
children: "-"
|
|
11
|
-
}) : /* @__PURE__ */ i("span", {
|
|
12
|
-
className: "text-sm font-medium tabular-nums",
|
|
13
|
-
children: [(t * 100).toFixed(f), "%"]
|
|
14
|
-
});
|
|
15
|
-
let p = t == null ? "" : t * 100, m = t == null ? 0 : t * 100, h = (e) => {
|
|
16
|
-
if (e.target.value === "") {
|
|
17
|
-
a(null);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
let t = parseFloat(e.target.value);
|
|
21
|
-
a(isNaN(t) ? null : t / 100);
|
|
22
|
-
}, g = (e) => {
|
|
23
|
-
if (s || u.disabled) return;
|
|
24
|
-
if (!Array.isArray(e) || e.length === 0) {
|
|
25
|
-
a(null);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
let t = e[0];
|
|
29
|
-
a(typeof t == "number" ? t / 100 : null);
|
|
30
|
-
}, _ = 10 ** -f;
|
|
31
|
-
return /* @__PURE__ */ i("div", {
|
|
32
|
-
className: "space-y-2",
|
|
33
|
-
children: [/* @__PURE__ */ i("div", {
|
|
34
|
-
className: "relative",
|
|
35
|
-
children: [/* @__PURE__ */ r(e, {
|
|
36
|
-
...u,
|
|
37
|
-
type: "number",
|
|
38
|
-
value: p,
|
|
39
|
-
onChange: h,
|
|
40
|
-
placeholder: d?.placeholder || "0",
|
|
41
|
-
disabled: s || u.disabled,
|
|
42
|
-
className: `pr-8 ${l || ""}`,
|
|
43
|
-
step: (10 ** -f).toFixed(f),
|
|
44
|
-
"aria-invalid": !!c
|
|
45
|
-
}), /* @__PURE__ */ r("span", {
|
|
46
|
-
className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
|
|
47
|
-
children: "%"
|
|
48
|
-
})]
|
|
49
|
-
}), /* @__PURE__ */ r(n, {
|
|
50
|
-
value: [m],
|
|
51
|
-
onValueChange: g,
|
|
52
|
-
min: 0,
|
|
53
|
-
max: 100,
|
|
54
|
-
step: _,
|
|
55
|
-
disabled: s || u.disabled,
|
|
56
|
-
className: "w-full",
|
|
57
|
-
"aria-label": "Percentage",
|
|
58
|
-
"data-testid": "percent-slider"
|
|
59
|
-
})]
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { a as t };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { D as e, gn as t } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/PhoneField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ t({ PhoneField: () => i });
|
|
6
|
-
function i({ value: t, onChange: r, field: i, readonly: a, errorMessage: o, ...s }) {
|
|
7
|
-
let c = i || s.schema;
|
|
8
|
-
if (a) return t ? /* @__PURE__ */ n("a", {
|
|
9
|
-
href: `tel:${t}`,
|
|
10
|
-
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
11
|
-
children: t
|
|
12
|
-
}) : /* @__PURE__ */ n("span", {
|
|
13
|
-
className: "text-sm",
|
|
14
|
-
children: "-"
|
|
15
|
-
});
|
|
16
|
-
let { inputType: l, ...u } = s;
|
|
17
|
-
return /* @__PURE__ */ n(e, {
|
|
18
|
-
...u,
|
|
19
|
-
type: "tel",
|
|
20
|
-
value: t || "",
|
|
21
|
-
onChange: (e) => r(e.target.value),
|
|
22
|
-
placeholder: c?.placeholder || "(555) 123-4567",
|
|
23
|
-
disabled: a || u.disabled,
|
|
24
|
-
"aria-invalid": !!o
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
export { r as t };
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { D as e, Vt as t, Z as n, gn as r, mt as i } from "./src-C56Ly5uG.js";
|
|
2
|
-
import a from "react";
|
|
3
|
-
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/QRCodeField.tsx
|
|
5
|
-
var l = /* @__PURE__ */ r({ QRCodeField: () => u });
|
|
6
|
-
function u({ value: r, onChange: l, field: u, readonly: d, ...f }) {
|
|
7
|
-
let [p, m] = a.useState(!1), h = u || f.schema;
|
|
8
|
-
return d ? /* @__PURE__ */ c("div", {
|
|
9
|
-
className: "flex items-center gap-3",
|
|
10
|
-
children: [/* @__PURE__ */ s("span", {
|
|
11
|
-
className: "text-sm flex-1 truncate",
|
|
12
|
-
children: r || "-"
|
|
13
|
-
}), r && /* @__PURE__ */ c(n, {
|
|
14
|
-
type: "button",
|
|
15
|
-
variant: "outline",
|
|
16
|
-
size: "sm",
|
|
17
|
-
onClick: () => m(!p),
|
|
18
|
-
children: [
|
|
19
|
-
/* @__PURE__ */ s(i, { className: "w-4 h-4 mr-2" }),
|
|
20
|
-
p ? "Hide" : "Show",
|
|
21
|
-
" QR"
|
|
22
|
-
]
|
|
23
|
-
})]
|
|
24
|
-
}) : /* @__PURE__ */ c("div", {
|
|
25
|
-
className: "space-y-3",
|
|
26
|
-
children: [
|
|
27
|
-
/* @__PURE__ */ c("div", {
|
|
28
|
-
className: "flex items-center gap-2",
|
|
29
|
-
children: [/* @__PURE__ */ s(e, {
|
|
30
|
-
type: "text",
|
|
31
|
-
value: r || "",
|
|
32
|
-
onChange: (e) => l(e.target.value),
|
|
33
|
-
placeholder: h?.placeholder || "Enter text for QR code",
|
|
34
|
-
disabled: d || f.disabled,
|
|
35
|
-
className: f.className
|
|
36
|
-
}), r && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(n, {
|
|
37
|
-
type: "button",
|
|
38
|
-
variant: "outline",
|
|
39
|
-
size: "sm",
|
|
40
|
-
onClick: () => {
|
|
41
|
-
r && navigator.clipboard.writeText(r);
|
|
42
|
-
},
|
|
43
|
-
children: /* @__PURE__ */ s(t, { className: "w-4 h-4" })
|
|
44
|
-
}), /* @__PURE__ */ s(n, {
|
|
45
|
-
type: "button",
|
|
46
|
-
variant: "outline",
|
|
47
|
-
size: "sm",
|
|
48
|
-
onClick: () => m(!p),
|
|
49
|
-
children: /* @__PURE__ */ s(i, { className: "w-4 h-4" })
|
|
50
|
-
})] })]
|
|
51
|
-
}),
|
|
52
|
-
p && r && /* @__PURE__ */ s("div", {
|
|
53
|
-
className: "border rounded p-4 bg-white flex justify-center",
|
|
54
|
-
children: /* @__PURE__ */ s("img", {
|
|
55
|
-
src: ((e) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(e)}`)(r),
|
|
56
|
-
alt: "QR Code",
|
|
57
|
-
className: "w-48 h-48"
|
|
58
|
-
})
|
|
59
|
-
}),
|
|
60
|
-
r && /* @__PURE__ */ c("p", {
|
|
61
|
-
className: "text-xs text-muted-foreground",
|
|
62
|
-
children: [
|
|
63
|
-
"QR code contains: ",
|
|
64
|
-
r.length,
|
|
65
|
-
" characters"
|
|
66
|
-
]
|
|
67
|
-
})
|
|
68
|
-
]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
export { l as t };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { gn as e, t } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/RichTextField.tsx
|
|
5
|
-
var i = /* @__PURE__ */ e({ RichTextField: () => a });
|
|
6
|
-
function a({ value: e, onChange: i, field: a, readonly: o, errorMessage: s, ...c }) {
|
|
7
|
-
if (o) return /* @__PURE__ */ n("div", {
|
|
8
|
-
className: "text-sm prose prose-sm max-w-none",
|
|
9
|
-
children: e || "-"
|
|
10
|
-
});
|
|
11
|
-
let l = a || c.schema, u = l?.rows || 8;
|
|
12
|
-
return /* @__PURE__ */ r("div", {
|
|
13
|
-
className: "space-y-2",
|
|
14
|
-
children: [/* @__PURE__ */ r("div", {
|
|
15
|
-
className: "flex items-center justify-between text-xs text-gray-500",
|
|
16
|
-
children: [/* @__PURE__ */ r("span", { children: ["Format: ", l?.format || "markdown"] }), /* @__PURE__ */ n("span", {
|
|
17
|
-
className: "italic",
|
|
18
|
-
children: "Rich text editor (basic)"
|
|
19
|
-
})]
|
|
20
|
-
}), /* @__PURE__ */ n(t, {
|
|
21
|
-
value: e || "",
|
|
22
|
-
onChange: (e) => i(e.target.value),
|
|
23
|
-
placeholder: l?.placeholder || "Enter text...",
|
|
24
|
-
disabled: o || c.disabled,
|
|
25
|
-
rows: u,
|
|
26
|
-
className: `font-mono text-sm ${c.className || ""}`,
|
|
27
|
-
"aria-invalid": !!s
|
|
28
|
-
})]
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { i as t };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { C as e, S as t, b as n, x as r, y as i } from "./src-C56Ly5uG.js";
|
|
2
|
-
import { t as a } from "./useFieldTranslation-CkxqyB82.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
-
//#region ../fields/src/widgets/SelectField.tsx
|
|
6
|
-
function c({ value: c, onChange: l, field: u, readonly: d, ...f }) {
|
|
7
|
-
let p = u || f.schema, m = p?.options || [], { t: h } = a();
|
|
8
|
-
return d ? /* @__PURE__ */ o("span", {
|
|
9
|
-
className: "text-sm",
|
|
10
|
-
children: m.find((e) => e.value === c)?.label || c || "-"
|
|
11
|
-
}) : /* @__PURE__ */ s(i, {
|
|
12
|
-
...f,
|
|
13
|
-
value: c,
|
|
14
|
-
onValueChange: l,
|
|
15
|
-
disabled: d || f.disabled,
|
|
16
|
-
children: [/* @__PURE__ */ o(t, {
|
|
17
|
-
className: f.className,
|
|
18
|
-
id: f.id,
|
|
19
|
-
children: /* @__PURE__ */ o(e, { placeholder: p?.placeholder || h("common.selectOption") })
|
|
20
|
-
}), /* @__PURE__ */ o(n, {
|
|
21
|
-
position: "popper",
|
|
22
|
-
children: m.map((e) => /* @__PURE__ */ o(r, {
|
|
23
|
-
value: e.value,
|
|
24
|
-
children: e.label
|
|
25
|
-
}, e.value))
|
|
26
|
-
})]
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { c as t };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { gn as e } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/SummaryField.tsx
|
|
5
|
-
var n = /* @__PURE__ */ e({ SummaryField: () => r });
|
|
6
|
-
function r({ value: e, field: n, ...r }) {
|
|
7
|
-
let i = (n || r.schema)?.summary_type || "count", a = "-";
|
|
8
|
-
return e != null && (a = i === "count" ? String(e) : [
|
|
9
|
-
"sum",
|
|
10
|
-
"avg",
|
|
11
|
-
"min",
|
|
12
|
-
"max"
|
|
13
|
-
].includes(i) && typeof e == "number" ? e.toFixed(2) : String(e)), /* @__PURE__ */ t("span", {
|
|
14
|
-
className: `text-sm font-medium tabular-nums text-gray-700 ${r.className || ""}`,
|
|
15
|
-
children: a
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
export { n as t };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { gn as e, t } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/TextAreaField.tsx
|
|
5
|
-
var i = /* @__PURE__ */ e({ TextAreaField: () => a });
|
|
6
|
-
function a({ value: e, onChange: i, field: a, readonly: o, errorMessage: s, ...c }) {
|
|
7
|
-
if (o) return /* @__PURE__ */ n("div", {
|
|
8
|
-
className: "text-sm whitespace-pre-wrap",
|
|
9
|
-
children: e || "-"
|
|
10
|
-
});
|
|
11
|
-
let l = a || c.schema, u = l?.rows || 4, d = l?.max_length, { inputType: f, ...p } = c;
|
|
12
|
-
return /* @__PURE__ */ r("div", {
|
|
13
|
-
className: "relative",
|
|
14
|
-
children: [/* @__PURE__ */ n(t, {
|
|
15
|
-
...p,
|
|
16
|
-
value: e || "",
|
|
17
|
-
onChange: (e) => i(e.target.value),
|
|
18
|
-
placeholder: l?.placeholder,
|
|
19
|
-
disabled: o || p.disabled,
|
|
20
|
-
rows: u,
|
|
21
|
-
maxLength: d,
|
|
22
|
-
"aria-invalid": !!s
|
|
23
|
-
}), d && /* @__PURE__ */ r("div", {
|
|
24
|
-
className: "absolute bottom-2 right-2 text-xs text-gray-400",
|
|
25
|
-
"aria-live": "polite",
|
|
26
|
-
"aria-label": `Character count: ${(e || "").length} of ${d}`,
|
|
27
|
-
children: [
|
|
28
|
-
(e || "").length,
|
|
29
|
-
"/",
|
|
30
|
-
d
|
|
31
|
-
]
|
|
32
|
-
})]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { i as t };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { D as e, gn as t, t as n } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/TextField.tsx
|
|
5
|
-
var i = /* @__PURE__ */ t({ TextField: () => a });
|
|
6
|
-
function a({ value: t, onChange: i, field: a, readonly: o, ...s }) {
|
|
7
|
-
let c = a || s.schema;
|
|
8
|
-
if (o) return /* @__PURE__ */ r("span", {
|
|
9
|
-
className: "text-sm",
|
|
10
|
-
children: t || "-"
|
|
11
|
-
});
|
|
12
|
-
let l = c?.rows, { inputType: u, ...d } = s;
|
|
13
|
-
return l && l > 1 ? /* @__PURE__ */ r(n, {
|
|
14
|
-
...d,
|
|
15
|
-
value: t || "",
|
|
16
|
-
onChange: (e) => i(e.target.value),
|
|
17
|
-
placeholder: c?.placeholder,
|
|
18
|
-
disabled: o || d.disabled
|
|
19
|
-
}) : /* @__PURE__ */ r(e, {
|
|
20
|
-
...d,
|
|
21
|
-
type: c?.type === "password" ? "password" : "text",
|
|
22
|
-
value: t || "",
|
|
23
|
-
onChange: (e) => i(e.target.value),
|
|
24
|
-
placeholder: c?.placeholder,
|
|
25
|
-
disabled: o || d.disabled
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { i as t };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { D as e, gn as t } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/TimeField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ t({ TimeField: () => i });
|
|
6
|
-
function i({ value: t, onChange: r, field: i, readonly: a, ...o }) {
|
|
7
|
-
if (a) return /* @__PURE__ */ n("span", {
|
|
8
|
-
className: "text-sm",
|
|
9
|
-
children: t || "-"
|
|
10
|
-
});
|
|
11
|
-
let { inputType: s, ...c } = o;
|
|
12
|
-
return /* @__PURE__ */ n(e, {
|
|
13
|
-
...c,
|
|
14
|
-
type: "time",
|
|
15
|
-
value: t || "",
|
|
16
|
-
onChange: (e) => r(e.target.value),
|
|
17
|
-
disabled: a || c.disabled
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { r as t };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { D as e, gn as t } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/UrlField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ t({ UrlField: () => i });
|
|
6
|
-
function i({ value: t, onChange: r, field: i, readonly: a, errorMessage: o, ...s }) {
|
|
7
|
-
let c = i || s.schema;
|
|
8
|
-
if (a) return t ? t.startsWith("http://") || t.startsWith("https://") ? /* @__PURE__ */ n("a", {
|
|
9
|
-
href: t,
|
|
10
|
-
target: "_blank",
|
|
11
|
-
rel: "noopener noreferrer",
|
|
12
|
-
className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
|
|
13
|
-
children: t
|
|
14
|
-
}) : /* @__PURE__ */ n("span", {
|
|
15
|
-
className: "text-sm",
|
|
16
|
-
children: t
|
|
17
|
-
}) : /* @__PURE__ */ n("span", {
|
|
18
|
-
className: "text-sm",
|
|
19
|
-
children: "-"
|
|
20
|
-
});
|
|
21
|
-
let { inputType: l, ...u } = s;
|
|
22
|
-
return /* @__PURE__ */ n(e, {
|
|
23
|
-
...u,
|
|
24
|
-
type: "url",
|
|
25
|
-
value: t || "",
|
|
26
|
-
onChange: (e) => r(e.target.value),
|
|
27
|
-
placeholder: c?.placeholder || "https://example.com",
|
|
28
|
-
disabled: a || u.disabled,
|
|
29
|
-
"aria-invalid": !!o
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { r as t };
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { $ as e, J as t, Y as n, gn as r, q as i } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/UserField.tsx
|
|
5
|
-
var s = /* @__PURE__ */ r({ UserField: () => c });
|
|
6
|
-
function c({ value: r, onChange: s, field: c, readonly: l, ...u }) {
|
|
7
|
-
let d = (c || u.schema)?.multiple || !1;
|
|
8
|
-
if (l) {
|
|
9
|
-
if (!r) return /* @__PURE__ */ a("span", {
|
|
10
|
-
className: "text-sm",
|
|
11
|
-
children: "-"
|
|
12
|
-
});
|
|
13
|
-
let e = Array.isArray(r) ? r : [r];
|
|
14
|
-
return /* @__PURE__ */ o("div", {
|
|
15
|
-
className: "flex -space-x-2",
|
|
16
|
-
children: [e.slice(0, 3).map((e, r) => {
|
|
17
|
-
let i = e.name || e.username || "User";
|
|
18
|
-
return /* @__PURE__ */ a(t, {
|
|
19
|
-
className: "size-8 border-2 border-white",
|
|
20
|
-
title: i,
|
|
21
|
-
children: /* @__PURE__ */ a(n, {
|
|
22
|
-
className: "bg-blue-500 text-white text-xs",
|
|
23
|
-
children: i.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
|
|
24
|
-
})
|
|
25
|
-
}, r);
|
|
26
|
-
}), e.length > 3 && /* @__PURE__ */ a(t, {
|
|
27
|
-
className: "size-8 border-2 border-white",
|
|
28
|
-
children: /* @__PURE__ */ o(n, {
|
|
29
|
-
className: "bg-gray-200 text-gray-600 text-xs",
|
|
30
|
-
children: ["+", e.length - 3]
|
|
31
|
-
})
|
|
32
|
-
})]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
let f = r ? Array.isArray(r) ? r : [r] : [], p = (e) => {
|
|
36
|
-
if (d) {
|
|
37
|
-
let t = f.filter((t, n) => n !== e);
|
|
38
|
-
s(t.length > 0 ? t : null);
|
|
39
|
-
} else s(null);
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ o("div", {
|
|
42
|
-
className: u.className,
|
|
43
|
-
children: [f.length > 0 && /* @__PURE__ */ a("div", {
|
|
44
|
-
className: "flex flex-wrap gap-2 mb-2",
|
|
45
|
-
children: f.map((r, s) => {
|
|
46
|
-
let c = r.name || r.username || "User";
|
|
47
|
-
return /* @__PURE__ */ o(i, {
|
|
48
|
-
variant: "outline",
|
|
49
|
-
className: "gap-2 pr-1",
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ a(t, {
|
|
52
|
-
className: "size-5",
|
|
53
|
-
children: /* @__PURE__ */ a(n, {
|
|
54
|
-
className: "bg-blue-500 text-white text-xs",
|
|
55
|
-
children: c.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
|
|
56
|
-
})
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ a("span", {
|
|
59
|
-
className: "text-sm",
|
|
60
|
-
children: c
|
|
61
|
-
}),
|
|
62
|
-
/* @__PURE__ */ a("button", {
|
|
63
|
-
type: "button",
|
|
64
|
-
onClick: () => p(s),
|
|
65
|
-
className: "ml-1 rounded-full hover:bg-gray-200 p-0.5",
|
|
66
|
-
children: /* @__PURE__ */ a(e, { className: "size-3" })
|
|
67
|
-
})
|
|
68
|
-
]
|
|
69
|
-
}, s);
|
|
70
|
-
})
|
|
71
|
-
}), /* @__PURE__ */ a("div", {
|
|
72
|
-
className: "text-sm text-gray-500 italic",
|
|
73
|
-
children: "User selection component requires integration with user management system"
|
|
74
|
-
})]
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
|
-
export { s as t };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { gn as e } from "./src-C56Ly5uG.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
-
//#region ../fields/src/widgets/VectorField.tsx
|
|
5
|
-
var r = /* @__PURE__ */ e({ VectorField: () => i });
|
|
6
|
-
function i({ value: e, field: r, ...i }) {
|
|
7
|
-
let a = (r || i.schema)?.dimensions || (Array.isArray(e) ? e.length : 0);
|
|
8
|
-
if (!e || !Array.isArray(e)) return /* @__PURE__ */ t("span", {
|
|
9
|
-
className: "text-sm text-gray-500",
|
|
10
|
-
children: "-"
|
|
11
|
-
});
|
|
12
|
-
let o = e.slice(0, 3).map((e) => {
|
|
13
|
-
let t = Number(e);
|
|
14
|
-
return isNaN(t) ? "0" : t.toFixed(4);
|
|
15
|
-
}).join(", ");
|
|
16
|
-
return /* @__PURE__ */ n("div", {
|
|
17
|
-
className: `text-sm ${i.className || ""}`,
|
|
18
|
-
children: [/* @__PURE__ */ n("span", {
|
|
19
|
-
className: "font-mono text-gray-700",
|
|
20
|
-
children: [
|
|
21
|
-
"[",
|
|
22
|
-
o,
|
|
23
|
-
"...]"
|
|
24
|
-
]
|
|
25
|
-
}), /* @__PURE__ */ n("span", {
|
|
26
|
-
className: "text-gray-500 ml-2",
|
|
27
|
-
children: [
|
|
28
|
-
"(",
|
|
29
|
-
a,
|
|
30
|
-
"D)"
|
|
31
|
-
]
|
|
32
|
-
})]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { r as t };
|