@object-ui/plugin-detail 3.0.2 → 3.1.0
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 +9 -0
- package/dist/AddressField-C07oUOY6.js +96 -0
- package/dist/AutoNumberField-BxnFqllo.js +8 -0
- package/dist/AvatarField-VThNABzo.js +82 -0
- package/dist/BooleanField-CGHKBzAi.js +37 -0
- package/dist/CodeField-Co_muhRR.js +21 -0
- package/dist/ColorField-DLid_tFz.js +42 -0
- package/dist/CurrencyField-Bw-LqANM.js +43 -0
- package/dist/DateField-BNHAzMB2.js +21 -0
- package/dist/DateTimeField-DjAyn_DQ.js +28 -0
- package/dist/EmailField-xoNcSppb.js +31 -0
- package/dist/FileField-DbNJwjU2.js +133 -0
- package/dist/FormulaField-CJkkwIK8.js +9 -0
- package/dist/GeolocationField-C1AnS6VV.js +123 -0
- package/dist/GridField-DATAHIKf.js +30 -0
- package/dist/ImageField-CEKJpyJp.js +90 -0
- package/dist/LocationField-jDWXjlpx.js +31 -0
- package/dist/LookupField-DQ08L9UQ.js +96 -0
- package/dist/MasterDetailField-Dbk529Ea.js +108 -0
- package/dist/NumberField-BVroN9aV.js +26 -0
- package/dist/ObjectField-CT3l_IHW.js +48 -0
- package/dist/PasswordField-DweVLEE0.js +38 -0
- package/dist/PercentField-ZpWUK97K.js +63 -0
- package/dist/PhoneField-mw-9fqZ_.js +31 -0
- package/dist/QRCodeField-Cbb9ck59.js +77 -0
- package/dist/RatingField-CSqgLS6t.js +47 -0
- package/dist/RichTextField-BpfBOd99.js +38 -0
- package/dist/SelectField-B9Ei-5jl.js +26 -0
- package/dist/SignatureField-DgGpHnQ8.js +85 -0
- package/dist/SliderField-C6HvOHd8.js +30 -0
- package/dist/SummaryField-ugYPYxjP.js +9 -0
- package/dist/TextAreaField-BK3RgzY3.js +39 -0
- package/dist/TextField-Bvzx3atT.js +32 -0
- package/dist/TimeField-Cuz9-Uai.js +21 -0
- package/dist/UrlField-B6XHTV73.js +33 -0
- package/dist/UserField-ooTul2d6.js +49 -0
- package/dist/VectorField-CKg9jdGa.js +25 -0
- package/dist/index-CnlyRfY_.js +59461 -0
- package/dist/index.js +30 -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 +6 -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/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 +4 -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/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 +36 -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 +74 -9
- package/src/DetailView.stories.tsx +76 -0
- package/src/DetailView.tsx +270 -27
- package/src/DiffView.tsx +231 -0
- package/src/FieldChangeItem.tsx +46 -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 +37 -8
- package/src/RelationshipGraph.tsx +286 -0
- package/src/RichTextCommentInput.tsx +348 -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__/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 +66 -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/autoLayout.ts +111 -0
- package/src/index.tsx +46 -0
- package/src/useDetailTranslation.ts +103 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,55 @@
|
|
|
1
1
|
|
|
2
|
-
> @object-ui/plugin-detail@3.0
|
|
2
|
+
> @object-ui/plugin-detail@3.1.0 build /home/runner/work/objectui/objectui/packages/plugin-detail
|
|
3
3
|
> vite build
|
|
4
4
|
|
|
5
5
|
[36mvite v7.3.1 [32mbuilding client environment for production...[36m[39m
|
|
6
6
|
transforming...
|
|
7
|
-
[32m✓[39m
|
|
7
|
+
[32m✓[39m 3770 modules transformed.
|
|
8
8
|
rendering chunks...
|
|
9
9
|
[32m
|
|
10
10
|
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
11
11
|
computing gzip size...
|
|
12
|
-
[32m[36m[vite:dts][32m Declaration files built in
|
|
12
|
+
[32m[36m[vite:dts][32m Declaration files built in 25389ms.
|
|
13
13
|
[39m
|
|
14
|
-
[2mdist/[22m[35mplugin-detail.css
|
|
15
|
-
[2mdist/[22m[
|
|
16
|
-
[2mdist/[22m[
|
|
17
|
-
[2mdist/[22m[
|
|
18
|
-
[
|
|
14
|
+
[2mdist/[22m[35mplugin-detail.css [39m[1m[2m 122.26 kB[22m[1m[22m[2m │ gzip: 20.00 kB[22m
|
|
15
|
+
[2mdist/[22m[36mAutoNumberField-BxnFqllo.js [39m[1m[2m 0.29 kB[22m[1m[22m[2m │ gzip: 0.24 kB[22m
|
|
16
|
+
[2mdist/[22m[36mSummaryField-ugYPYxjP.js [39m[1m[2m 0.49 kB[22m[1m[22m[2m │ gzip: 0.34 kB[22m
|
|
17
|
+
[2mdist/[22m[36mTimeField-Cuz9-Uai.js [39m[1m[2m 0.52 kB[22m[1m[22m[2m │ gzip: 0.33 kB[22m
|
|
18
|
+
[2mdist/[22m[36mFormulaField-CJkkwIK8.js [39m[1m[2m 0.53 kB[22m[1m[22m[2m │ gzip: 0.36 kB[22m
|
|
19
|
+
[2mdist/[22m[36mDateField-BNHAzMB2.js [39m[1m[2m 0.55 kB[22m[1m[22m[2m │ gzip: 0.36 kB[22m
|
|
20
|
+
[2mdist/[22m[36mNumberField-BVroN9aV.js [39m[1m[2m 0.70 kB[22m[1m[22m[2m │ gzip: 0.43 kB[22m
|
|
21
|
+
[2mdist/[22m[36mDateTimeField-DjAyn_DQ.js [39m[1m[2m 0.73 kB[22m[1m[22m[2m │ gzip: 0.40 kB[22m
|
|
22
|
+
[2mdist/[22m[36mCodeField-Co_muhRR.js [39m[1m[2m 0.76 kB[22m[1m[22m[2m │ gzip: 0.45 kB[22m
|
|
23
|
+
[2mdist/[22m[36mVectorField-CKg9jdGa.js [39m[1m[2m 0.80 kB[22m[1m[22m[2m │ gzip: 0.43 kB[22m
|
|
24
|
+
[2mdist/[22m[36mPhoneField-mw-9fqZ_.js [39m[1m[2m 0.82 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
25
|
+
[2mdist/[22m[36mEmailField-xoNcSppb.js [39m[1m[2m 0.83 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
26
|
+
[2mdist/[22m[36mTextField-Bvzx3atT.js [39m[1m[2m 0.84 kB[22m[1m[22m[2m │ gzip: 0.41 kB[22m
|
|
27
|
+
[2mdist/[22m[36mSelectField-B9Ei-5jl.js [39m[1m[2m 0.92 kB[22m[1m[22m[2m │ gzip: 0.48 kB[22m
|
|
28
|
+
[2mdist/[22m[36mLocationField-jDWXjlpx.js [39m[1m[2m 0.97 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m
|
|
29
|
+
[2mdist/[22m[36mUrlField-B6XHTV73.js [39m[1m[2m 1.00 kB[22m[1m[22m[2m │ gzip: 0.51 kB[22m
|
|
30
|
+
[2mdist/[22m[36mSliderField-C6HvOHd8.js [39m[1m[2m 1.03 kB[22m[1m[22m[2m │ gzip: 0.48 kB[22m
|
|
31
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m 1.05 kB[22m[1m[22m[2m │ gzip: 0.57 kB[22m
|
|
32
|
+
[2mdist/[22m[36mTextAreaField-BK3RgzY3.js [39m[1m[2m 1.12 kB[22m[1m[22m[2m │ gzip: 0.58 kB[22m
|
|
33
|
+
[2mdist/[22m[36mBooleanField-CGHKBzAi.js [39m[1m[2m 1.16 kB[22m[1m[22m[2m │ gzip: 0.50 kB[22m
|
|
34
|
+
[2mdist/[22m[36mRichTextField-BpfBOd99.js [39m[1m[2m 1.18 kB[22m[1m[22m[2m │ gzip: 0.58 kB[22m
|
|
35
|
+
[2mdist/[22m[36mPasswordField-DweVLEE0.js [39m[1m[2m 1.24 kB[22m[1m[22m[2m │ gzip: 0.61 kB[22m
|
|
36
|
+
[2mdist/[22m[36mColorField-DLid_tFz.js [39m[1m[2m 1.26 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m
|
|
37
|
+
[2mdist/[22m[36mCurrencyField-Bw-LqANM.js [39m[1m[2m 1.51 kB[22m[1m[22m[2m │ gzip: 0.72 kB[22m
|
|
38
|
+
[2mdist/[22m[36mRatingField-CSqgLS6t.js [39m[1m[2m 1.66 kB[22m[1m[22m[2m │ gzip: 0.65 kB[22m
|
|
39
|
+
[2mdist/[22m[36mObjectField-CT3l_IHW.js [39m[1m[2m 1.68 kB[22m[1m[22m[2m │ gzip: 0.75 kB[22m
|
|
40
|
+
[2mdist/[22m[36mGridField-DATAHIKf.js [39m[1m[2m 1.75 kB[22m[1m[22m[2m │ gzip: 0.68 kB[22m
|
|
41
|
+
[2mdist/[22m[36mPercentField-ZpWUK97K.js [39m[1m[2m 1.94 kB[22m[1m[22m[2m │ gzip: 0.84 kB[22m
|
|
42
|
+
[2mdist/[22m[36mUserField-ooTul2d6.js [39m[1m[2m 2.39 kB[22m[1m[22m[2m │ gzip: 0.90 kB[22m
|
|
43
|
+
[2mdist/[22m[36mQRCodeField-Cbb9ck59.js [39m[1m[2m 2.41 kB[22m[1m[22m[2m │ gzip: 0.91 kB[22m
|
|
44
|
+
[2mdist/[22m[36mAvatarField-VThNABzo.js [39m[1m[2m 2.69 kB[22m[1m[22m[2m │ gzip: 1.06 kB[22m
|
|
45
|
+
[2mdist/[22m[36mImageField-CEKJpyJp.js [39m[1m[2m 2.89 kB[22m[1m[22m[2m │ gzip: 1.14 kB[22m
|
|
46
|
+
[2mdist/[22m[36mSignatureField-DgGpHnQ8.js [39m[1m[2m 3.04 kB[22m[1m[22m[2m │ gzip: 1.10 kB[22m
|
|
47
|
+
[2mdist/[22m[36mAddressField-C07oUOY6.js [39m[1m[2m 3.05 kB[22m[1m[22m[2m │ gzip: 0.75 kB[22m
|
|
48
|
+
[2mdist/[22m[36mMasterDetailField-Dbk529Ea.js [39m[1m[2m 3.48 kB[22m[1m[22m[2m │ gzip: 0.98 kB[22m
|
|
49
|
+
[2mdist/[22m[36mGeolocationField-C1AnS6VV.js [39m[1m[2m 3.80 kB[22m[1m[22m[2m │ gzip: 1.21 kB[22m
|
|
50
|
+
[2mdist/[22m[36mLookupField-DQ08L9UQ.js [39m[1m[2m 4.10 kB[22m[1m[22m[2m │ gzip: 1.38 kB[22m
|
|
51
|
+
[2mdist/[22m[36mFileField-DbNJwjU2.js [39m[1m[2m 5.63 kB[22m[1m[22m[2m │ gzip: 1.95 kB[22m
|
|
52
|
+
[2mdist/[22m[36mindex-CnlyRfY_.js [39m[1m[33m1,937.13 kB[39m[22m[2m │ gzip: 451.14 kB[22m
|
|
53
|
+
[2mdist/[22m[35mplugin-detail.css [39m[1m[2m 122.26 kB[22m[1m[22m[2m │ gzip: 20.00 kB[22m
|
|
54
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[33m1,422.93 kB[39m[22m[2m │ gzip: 389.27 kB[22m
|
|
55
|
+
[32m✓ built in 41.23s[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { L as r, I as c } from "./index-CnlyRfY_.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function p({ value: o, onChange: h, field: u, readonly: i, ...l }) {
|
|
5
|
+
const s = o || {}, d = (e, n) => {
|
|
6
|
+
h({
|
|
7
|
+
...s,
|
|
8
|
+
[e]: n
|
|
9
|
+
});
|
|
10
|
+
}, m = (e) => [
|
|
11
|
+
e.street,
|
|
12
|
+
e.city,
|
|
13
|
+
[e.state, e.zipCode].filter(Boolean).join(" "),
|
|
14
|
+
e.country
|
|
15
|
+
].filter(Boolean).join(", ") || "-";
|
|
16
|
+
return i ? /* @__PURE__ */ t("span", { className: "text-sm", children: m(s) }) : /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
17
|
+
/* @__PURE__ */ a("div", { children: [
|
|
18
|
+
/* @__PURE__ */ t(r, { htmlFor: "street", className: "text-xs", children: "Street Address" }),
|
|
19
|
+
/* @__PURE__ */ t(
|
|
20
|
+
c,
|
|
21
|
+
{
|
|
22
|
+
id: "street",
|
|
23
|
+
type: "text",
|
|
24
|
+
value: s.street || "",
|
|
25
|
+
onChange: (e) => d("street", e.target.value),
|
|
26
|
+
placeholder: "123 Main St",
|
|
27
|
+
disabled: i || l.disabled,
|
|
28
|
+
className: l.className
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
33
|
+
/* @__PURE__ */ a("div", { children: [
|
|
34
|
+
/* @__PURE__ */ t(r, { htmlFor: "city", className: "text-xs", children: "City" }),
|
|
35
|
+
/* @__PURE__ */ t(
|
|
36
|
+
c,
|
|
37
|
+
{
|
|
38
|
+
id: "city",
|
|
39
|
+
type: "text",
|
|
40
|
+
value: s.city || "",
|
|
41
|
+
onChange: (e) => d("city", e.target.value),
|
|
42
|
+
placeholder: "San Francisco",
|
|
43
|
+
disabled: i || l.disabled
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ a("div", { children: [
|
|
48
|
+
/* @__PURE__ */ t(r, { htmlFor: "state", className: "text-xs", children: "State / Province" }),
|
|
49
|
+
/* @__PURE__ */ t(
|
|
50
|
+
c,
|
|
51
|
+
{
|
|
52
|
+
id: "state",
|
|
53
|
+
type: "text",
|
|
54
|
+
value: s.state || "",
|
|
55
|
+
onChange: (e) => d("state", e.target.value),
|
|
56
|
+
placeholder: "CA",
|
|
57
|
+
disabled: i || l.disabled
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] })
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
63
|
+
/* @__PURE__ */ a("div", { children: [
|
|
64
|
+
/* @__PURE__ */ t(r, { htmlFor: "zipCode", className: "text-xs", children: "ZIP / Postal Code" }),
|
|
65
|
+
/* @__PURE__ */ t(
|
|
66
|
+
c,
|
|
67
|
+
{
|
|
68
|
+
id: "zipCode",
|
|
69
|
+
type: "text",
|
|
70
|
+
value: s.zipCode || "",
|
|
71
|
+
onChange: (e) => d("zipCode", e.target.value),
|
|
72
|
+
placeholder: "94102",
|
|
73
|
+
disabled: i || l.disabled
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ a("div", { children: [
|
|
78
|
+
/* @__PURE__ */ t(r, { htmlFor: "country", className: "text-xs", children: "Country" }),
|
|
79
|
+
/* @__PURE__ */ t(
|
|
80
|
+
c,
|
|
81
|
+
{
|
|
82
|
+
id: "country",
|
|
83
|
+
type: "text",
|
|
84
|
+
value: s.country || "",
|
|
85
|
+
onChange: (e) => d("country", e.target.value),
|
|
86
|
+
placeholder: "United States",
|
|
87
|
+
disabled: i || l.disabled
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] })
|
|
91
|
+
] })
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
p as AddressField
|
|
96
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
function l({ value: t, field: r, ...e }) {
|
|
3
|
+
const n = t != null ? String(t) : "-";
|
|
4
|
+
return /* @__PURE__ */ o("span", { className: `text-sm font-mono text-gray-700 ${e.className || ""}`, children: n });
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
l as AutoNumberField
|
|
8
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import { A as h, s as p, q as g, X as A, B as F, U as R } from "./index-CnlyRfY_.js";
|
|
4
|
+
function B({ value: t, onChange: n, field: v, readonly: l, ...c }) {
|
|
5
|
+
const [b, o] = f.useState(!1), d = f.useRef(null), r = v || c.schema, N = (u) => {
|
|
6
|
+
const a = u.target.files?.[0];
|
|
7
|
+
if (!a) return;
|
|
8
|
+
if (!a.type.startsWith("image/")) {
|
|
9
|
+
console.error("Please select an image file");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (a.size > 5 * 1024 * 1024) {
|
|
13
|
+
console.error("File size must be less than 5MB");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const i = new FileReader();
|
|
17
|
+
i.onloadend = () => {
|
|
18
|
+
n(i.result);
|
|
19
|
+
}, i.readAsDataURL(a);
|
|
20
|
+
}, x = () => {
|
|
21
|
+
n("");
|
|
22
|
+
}, m = () => (r?.defaultName || r?.label || "User").split(" ").map((a) => a[0]).join("").toUpperCase().slice(0, 2);
|
|
23
|
+
return l ? /* @__PURE__ */ s(h, { className: "w-16 h-16", children: [
|
|
24
|
+
t && /* @__PURE__ */ e(p, { src: t, alt: r?.label }),
|
|
25
|
+
/* @__PURE__ */ e(g, { children: m() })
|
|
26
|
+
] }) : /* @__PURE__ */ s("div", { className: "flex items-center gap-4", children: [
|
|
27
|
+
/* @__PURE__ */ s(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: "relative",
|
|
31
|
+
onMouseEnter: () => o(!0),
|
|
32
|
+
onMouseLeave: () => o(!1),
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ s(h, { className: "w-16 h-16", children: [
|
|
35
|
+
t && /* @__PURE__ */ e(p, { src: t, alt: r?.label }),
|
|
36
|
+
/* @__PURE__ */ e(g, { children: m() })
|
|
37
|
+
] }),
|
|
38
|
+
!l && b && t && /* @__PURE__ */ e(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
type: "button",
|
|
42
|
+
onClick: x,
|
|
43
|
+
className: "absolute -top-1 -right-1 bg-destructive text-destructive-foreground rounded-full p-1 hover:bg-destructive/90",
|
|
44
|
+
children: /* @__PURE__ */ e(A, { className: "w-3 h-3" })
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: [
|
|
51
|
+
/* @__PURE__ */ e(
|
|
52
|
+
"input",
|
|
53
|
+
{
|
|
54
|
+
ref: d,
|
|
55
|
+
type: "file",
|
|
56
|
+
accept: "image/*",
|
|
57
|
+
onChange: N,
|
|
58
|
+
className: "hidden"
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ s(
|
|
62
|
+
F,
|
|
63
|
+
{
|
|
64
|
+
type: "button",
|
|
65
|
+
variant: "outline",
|
|
66
|
+
size: "sm",
|
|
67
|
+
onClick: () => d.current?.click(),
|
|
68
|
+
disabled: l || c.disabled,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ e(R, { className: "w-4 h-4 mr-2" }),
|
|
71
|
+
t ? "Change" : "Upload",
|
|
72
|
+
" Avatar"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "PNG, JPG up to 5MB" })
|
|
77
|
+
] })
|
|
78
|
+
] });
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
B as AvatarField
|
|
82
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { useId as f } from "react";
|
|
3
|
+
import { C as p, L as l, S as k } from "./index-CnlyRfY_.js";
|
|
4
|
+
function w({ value: t, onChange: n, field: h, readonly: i, ...o }) {
|
|
5
|
+
const d = h || o.schema, m = d?.widget, x = f(), c = d?.name || x, r = d?.label || "Checkbox";
|
|
6
|
+
if (i)
|
|
7
|
+
return /* @__PURE__ */ e("span", { className: "text-sm", children: t ? "Yes" : "No" });
|
|
8
|
+
const { inputType: C, ...s } = o;
|
|
9
|
+
return m === "checkbox" ? /* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
|
|
10
|
+
/* @__PURE__ */ e(
|
|
11
|
+
p,
|
|
12
|
+
{
|
|
13
|
+
...s,
|
|
14
|
+
id: c,
|
|
15
|
+
checked: !!t,
|
|
16
|
+
onCheckedChange: (b) => n(!!b),
|
|
17
|
+
disabled: i || s.disabled
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
/* @__PURE__ */ e(l, { htmlFor: c, children: r })
|
|
21
|
+
] }) : /* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
|
|
22
|
+
/* @__PURE__ */ e(
|
|
23
|
+
k,
|
|
24
|
+
{
|
|
25
|
+
...s,
|
|
26
|
+
id: c,
|
|
27
|
+
checked: !!t,
|
|
28
|
+
onCheckedChange: n,
|
|
29
|
+
disabled: i || s.disabled
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ e(l, { htmlFor: c, children: r })
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
w as BooleanField
|
|
37
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { o as l, T as m } from "./index-CnlyRfY_.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function g({ value: o, onChange: s, field: c, readonly: r, ...e }) {
|
|
5
|
+
const t = c || e.schema, n = t?.language ?? "javascript";
|
|
6
|
+
return r ? /* @__PURE__ */ a("pre", { className: l("text-sm bg-muted p-2 rounded overflow-x-auto border", e.className), children: /* @__PURE__ */ a("code", { children: o || "-" }) }) : /* @__PURE__ */ a(
|
|
7
|
+
m,
|
|
8
|
+
{
|
|
9
|
+
value: o || "",
|
|
10
|
+
onChange: (d) => s(d.target.value),
|
|
11
|
+
placeholder: t?.placeholder || `// Write ${n} code here...`,
|
|
12
|
+
disabled: r || e.disabled,
|
|
13
|
+
className: l("font-mono text-sm", e.className),
|
|
14
|
+
rows: 12,
|
|
15
|
+
spellCheck: !1
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
g as CodeField
|
|
21
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { I as c } from "./index-CnlyRfY_.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function p({ value: e, onChange: l, field: i, readonly: t, ...r }) {
|
|
5
|
+
const o = i || r.schema;
|
|
6
|
+
return t ? /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
7
|
+
/* @__PURE__ */ a(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
className: "w-6 h-6 rounded border border-input",
|
|
11
|
+
style: { backgroundColor: e || "#000000" }
|
|
12
|
+
}
|
|
13
|
+
),
|
|
14
|
+
/* @__PURE__ */ a("span", { className: "text-sm", children: e || "-" })
|
|
15
|
+
] }) : /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
16
|
+
/* @__PURE__ */ a(
|
|
17
|
+
"input",
|
|
18
|
+
{
|
|
19
|
+
type: "color",
|
|
20
|
+
value: e || "#000000",
|
|
21
|
+
onChange: (s) => l(s.target.value),
|
|
22
|
+
disabled: t || r.disabled,
|
|
23
|
+
className: "w-10 h-10 rounded border border-input cursor-pointer"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ a(
|
|
27
|
+
c,
|
|
28
|
+
{
|
|
29
|
+
type: "text",
|
|
30
|
+
value: e || "",
|
|
31
|
+
onChange: (s) => l(s.target.value),
|
|
32
|
+
placeholder: o?.placeholder || "#000000",
|
|
33
|
+
disabled: t || r.disabled,
|
|
34
|
+
className: r.className,
|
|
35
|
+
pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
] });
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
p as ColorField
|
|
42
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { I as f } from "./index-CnlyRfY_.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function h(e, t = "USD") {
|
|
5
|
+
try {
|
|
6
|
+
return new Intl.NumberFormat("en-US", {
|
|
7
|
+
style: "currency",
|
|
8
|
+
currency: t
|
|
9
|
+
}).format(e);
|
|
10
|
+
} catch {
|
|
11
|
+
return `${t} ${e.toFixed(2)}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function b({ value: e, onChange: t, field: u, readonly: o, errorMessage: m, className: d, ...l }) {
|
|
15
|
+
const s = u || l.schema, c = s?.currency || "USD", i = s?.precision ?? 2;
|
|
16
|
+
return o ? e == null ? /* @__PURE__ */ n("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ n("span", { className: "text-sm font-medium tabular-nums", children: h(Number(e), c) }) : /* @__PURE__ */ p("div", { className: "relative", children: [
|
|
17
|
+
/* @__PURE__ */ n("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500", children: c === "USD" ? "$" : c }),
|
|
18
|
+
/* @__PURE__ */ n(
|
|
19
|
+
f,
|
|
20
|
+
{
|
|
21
|
+
...l,
|
|
22
|
+
type: "number",
|
|
23
|
+
value: e ?? "",
|
|
24
|
+
onChange: (r) => {
|
|
25
|
+
const a = r.target.value === "" ? null : parseFloat(r.target.value);
|
|
26
|
+
t(a);
|
|
27
|
+
},
|
|
28
|
+
onBlur: (r) => {
|
|
29
|
+
const a = parseFloat(r.target.value);
|
|
30
|
+
isNaN(a) || t(parseFloat(a.toFixed(i)));
|
|
31
|
+
},
|
|
32
|
+
placeholder: s?.placeholder || "0.00",
|
|
33
|
+
disabled: o || l.disabled,
|
|
34
|
+
className: `pl-8 ${d || ""}`,
|
|
35
|
+
step: Math.pow(10, -i).toFixed(i),
|
|
36
|
+
"aria-invalid": !!m
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
b as CurrencyField
|
|
43
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { I as p } from "./index-CnlyRfY_.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function f({ value: t, onChange: i, field: s, readonly: e, ...n }) {
|
|
5
|
+
if (e)
|
|
6
|
+
return /* @__PURE__ */ a("span", { className: "text-sm", children: t ? new Date(t).toLocaleDateString() : "-" });
|
|
7
|
+
const { inputType: d, ...r } = n;
|
|
8
|
+
return /* @__PURE__ */ a(
|
|
9
|
+
p,
|
|
10
|
+
{
|
|
11
|
+
...r,
|
|
12
|
+
type: "date",
|
|
13
|
+
value: t || "",
|
|
14
|
+
onChange: (o) => i(o.target.value),
|
|
15
|
+
disabled: e || r.disabled
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
f as DateField
|
|
21
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as n, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { I as m } from "./index-CnlyRfY_.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function u({ value: e, onChange: r, field: l, readonly: a, ...s }) {
|
|
5
|
+
if (a) {
|
|
6
|
+
if (!e) return /* @__PURE__ */ n("span", { className: "text-sm", children: "-" });
|
|
7
|
+
const t = new Date(e);
|
|
8
|
+
return /* @__PURE__ */ o("span", { className: "text-sm", children: [
|
|
9
|
+
t.toLocaleDateString(),
|
|
10
|
+
" ",
|
|
11
|
+
t.toLocaleTimeString()
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
const { inputType: p, ...i } = s;
|
|
15
|
+
return /* @__PURE__ */ n(
|
|
16
|
+
m,
|
|
17
|
+
{
|
|
18
|
+
...i,
|
|
19
|
+
type: "datetime-local",
|
|
20
|
+
value: e || "",
|
|
21
|
+
onChange: (t) => r(t.target.value),
|
|
22
|
+
disabled: a || i.disabled
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
u as DateTimeField
|
|
28
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { I as c } from "./index-CnlyRfY_.js";
|
|
3
|
+
import "react";
|
|
4
|
+
function f({ value: e, onChange: l, field: m, readonly: i, errorMessage: n, ...r }) {
|
|
5
|
+
const o = m || r.schema;
|
|
6
|
+
if (i)
|
|
7
|
+
return e ? /* @__PURE__ */ t(
|
|
8
|
+
"a",
|
|
9
|
+
{
|
|
10
|
+
href: `mailto:${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: d, ...a } = r;
|
|
16
|
+
return /* @__PURE__ */ t(
|
|
17
|
+
c,
|
|
18
|
+
{
|
|
19
|
+
...a,
|
|
20
|
+
type: "email",
|
|
21
|
+
value: e || "",
|
|
22
|
+
onChange: (s) => l(s.target.value),
|
|
23
|
+
placeholder: o?.placeholder || "email@example.com",
|
|
24
|
+
disabled: i || a.disabled,
|
|
25
|
+
"aria-invalid": !!n
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
f as EmailField
|
|
31
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as I, useState as k, useCallback as g } from "react";
|
|
3
|
+
import { U as P, p as U, F as $, B as C, X as E } from "./index-CnlyRfY_.js";
|
|
4
|
+
function M({ value: n, onChange: c, field: w, readonly: j, ...b }) {
|
|
5
|
+
const y = I(null), m = w || b.schema, d = m?.multiple || !1, p = m?.accept ? m.accept.join(",") : void 0, u = m?.maxSize, [N, v] = k(!1), [D, A] = k([]), l = n ? Array.isArray(n) ? n : [n] : [], f = g((e) => {
|
|
6
|
+
if (e.length === 0) return;
|
|
7
|
+
const r = [], a = e.filter((s) => {
|
|
8
|
+
if (u && s.size > u) {
|
|
9
|
+
const x = (u / 1048576).toFixed(1);
|
|
10
|
+
return r.push(`"${s.name}" exceeds max size (${x} MB)`), !1;
|
|
11
|
+
}
|
|
12
|
+
return !0;
|
|
13
|
+
});
|
|
14
|
+
if (A(r), a.length === 0) return;
|
|
15
|
+
const i = a.map((s) => ({
|
|
16
|
+
name: s.name,
|
|
17
|
+
original_name: s.name,
|
|
18
|
+
size: s.size,
|
|
19
|
+
mime_type: s.type,
|
|
20
|
+
// In a real implementation, this would upload the file and return a URL
|
|
21
|
+
url: URL.createObjectURL(s)
|
|
22
|
+
}));
|
|
23
|
+
c(d ? [...l, ...i] : i[0]);
|
|
24
|
+
}, [l, d, c, u]), L = g((e) => {
|
|
25
|
+
e.preventDefault(), e.stopPropagation(), v(!0);
|
|
26
|
+
}, []), O = g((e) => {
|
|
27
|
+
e.preventDefault(), e.stopPropagation(), v(!1);
|
|
28
|
+
}, []), _ = g((e) => {
|
|
29
|
+
e.preventDefault(), e.stopPropagation(), v(!1);
|
|
30
|
+
const r = Array.from(e.dataTransfer.files);
|
|
31
|
+
if (p) {
|
|
32
|
+
const a = p.split(",").map((s) => s.trim().toLowerCase()), i = r.filter((s) => {
|
|
33
|
+
const x = s.name.split("."), F = x.length > 1 ? "." + x.pop()?.toLowerCase() : "";
|
|
34
|
+
return a.some(
|
|
35
|
+
(h) => h === s.type || F && h === F || h.endsWith("/*") && s.type.startsWith(h.replace("/*", "/"))
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
f(i);
|
|
39
|
+
} else
|
|
40
|
+
f(r);
|
|
41
|
+
}, [p, f]);
|
|
42
|
+
if (j) {
|
|
43
|
+
if (!n) return /* @__PURE__ */ t("span", { className: "text-sm", children: "-" });
|
|
44
|
+
const e = Array.isArray(n) ? n : [n];
|
|
45
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.map((r, a) => /* @__PURE__ */ t("span", { className: "text-sm truncate max-w-xs", children: r.name || r.original_name || "File" }, a)) });
|
|
46
|
+
}
|
|
47
|
+
const B = (e) => {
|
|
48
|
+
f(Array.from(e.target.files || []));
|
|
49
|
+
}, R = (e) => {
|
|
50
|
+
if (d) {
|
|
51
|
+
const r = l.filter((a, i) => i !== e);
|
|
52
|
+
c(r.length > 0 ? r : null);
|
|
53
|
+
} else
|
|
54
|
+
c(null);
|
|
55
|
+
}, z = (e) => (e.mime_type || "").startsWith("image/");
|
|
56
|
+
return /* @__PURE__ */ o("div", { className: b.className, children: [
|
|
57
|
+
/* @__PURE__ */ t(
|
|
58
|
+
"input",
|
|
59
|
+
{
|
|
60
|
+
ref: y,
|
|
61
|
+
type: "file",
|
|
62
|
+
multiple: d,
|
|
63
|
+
accept: p,
|
|
64
|
+
onChange: B,
|
|
65
|
+
className: "hidden"
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
69
|
+
/* @__PURE__ */ o(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
onDragOver: L,
|
|
73
|
+
onDragLeave: O,
|
|
74
|
+
onDrop: _,
|
|
75
|
+
onClick: () => y.current?.click(),
|
|
76
|
+
className: `
|
|
77
|
+
flex flex-col items-center justify-center gap-2 p-6
|
|
78
|
+
border-2 border-dashed rounded-lg cursor-pointer
|
|
79
|
+
transition-colors duration-200
|
|
80
|
+
${N ? "border-primary bg-primary/5 text-primary" : "border-muted-foreground/25 hover:border-primary/50 text-muted-foreground hover:text-foreground"}
|
|
81
|
+
`,
|
|
82
|
+
role: "button",
|
|
83
|
+
tabIndex: 0,
|
|
84
|
+
onKeyDown: (e) => {
|
|
85
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), y.current?.click());
|
|
86
|
+
},
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ t(P, { className: `size-8 ${N ? "text-primary" : "text-muted-foreground"}` }),
|
|
89
|
+
/* @__PURE__ */ o("div", { className: "text-center", children: [
|
|
90
|
+
/* @__PURE__ */ t("p", { className: "text-sm font-medium", children: N ? "Drop files here" : "Drag & drop files here" }),
|
|
91
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground mt-1", children: "or click to browse" })
|
|
92
|
+
] })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
D.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-0.5", children: D.map((e, r) => /* @__PURE__ */ t("p", { className: "text-xs text-destructive", children: e }, r)) }),
|
|
97
|
+
l.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-1", children: l.map((e, r) => /* @__PURE__ */ o(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
className: "flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
103
|
+
z(e) && e.url ? /* @__PURE__ */ t("img", { src: e.url, alt: e.name, className: "size-8 object-cover rounded flex-shrink-0" }) : z(e) ? /* @__PURE__ */ t(U, { className: "size-4 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ t($, { className: "size-4 text-muted-foreground flex-shrink-0" }),
|
|
104
|
+
/* @__PURE__ */ t("span", { className: "text-sm truncate", children: e.name || e.original_name || "File" }),
|
|
105
|
+
e.size && /* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground", children: [
|
|
106
|
+
"(",
|
|
107
|
+
(e.size / 1024).toFixed(1),
|
|
108
|
+
" KB)"
|
|
109
|
+
] })
|
|
110
|
+
] }),
|
|
111
|
+
/* @__PURE__ */ t(
|
|
112
|
+
C,
|
|
113
|
+
{
|
|
114
|
+
type: "button",
|
|
115
|
+
variant: "ghost",
|
|
116
|
+
size: "sm",
|
|
117
|
+
onClick: (a) => {
|
|
118
|
+
a.stopPropagation(), R(r);
|
|
119
|
+
},
|
|
120
|
+
className: "h-6 w-6 p-0",
|
|
121
|
+
children: /* @__PURE__ */ t(E, { className: "size-3" })
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
r
|
|
127
|
+
)) })
|
|
128
|
+
] })
|
|
129
|
+
] });
|
|
130
|
+
}
|
|
131
|
+
export {
|
|
132
|
+
M as FileField
|
|
133
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
function m({ value: e, field: o, ...r }) {
|
|
3
|
+
const n = (o || r.schema)?.return_type || "text";
|
|
4
|
+
let t = "-";
|
|
5
|
+
return e != null && (n === "number" || n === "currency" ? t = typeof e == "number" ? e.toFixed(2) : String(e) : n === "boolean" ? t = e ? "Yes" : "No" : n === "date" ? t = new Date(e).toLocaleDateString() : t = String(e)), /* @__PURE__ */ i("span", { className: `text-sm font-mono text-gray-700 ${r.className || ""}`, children: t });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
m as FormulaField
|
|
9
|
+
};
|