@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.
Files changed (134) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +21 -1
  3. package/dist/AddressField-LgHnO2Lk.js +98 -0
  4. package/dist/AutoNumberField-xZCrU0eW.js +14 -0
  5. package/dist/{AvatarField-Xuieq0ZI.js → AvatarField-Dy2XGlPz.js} +16 -15
  6. package/dist/{BooleanField-DwfMKknK.js → BooleanField-C0Clfka5.js} +11 -10
  7. package/dist/CodeField-CHUa07B6.js +23 -0
  8. package/dist/ColorField-vxHqEhcS.js +38 -0
  9. package/dist/CurrencyField-DiWjYWDo.js +49 -0
  10. package/dist/DateField-DGaRPM4P.js +22 -0
  11. package/dist/DateTimeField-8QnpsI_h.js +30 -0
  12. package/dist/EmailField-CkVgMbpI.js +26 -0
  13. package/dist/FileField-5UPV7uek.js +149 -0
  14. package/dist/FormulaField-BUgt6-Pi.js +17 -0
  15. package/dist/GeolocationField-D9T_jgG6.js +118 -0
  16. package/dist/GridField-DE_HwiIN.js +49 -0
  17. package/dist/ImageField-Dswnqtzf.js +73 -0
  18. package/dist/LocationField-gjqbE6na.js +36 -0
  19. package/dist/LookupField-BcS3LRKc.js +901 -0
  20. package/dist/{MasterDetailField-B0HTmmD7.js → MasterDetailField-BF6_-X3A.js} +20 -19
  21. package/dist/NumberField-Dj2rYmrS.js +27 -0
  22. package/dist/ObjectField-BymIojwd.js +50 -0
  23. package/dist/{PasswordField-DVTimsc3.js → PasswordField-ED_Xgqz-.js} +8 -7
  24. package/dist/PercentField-D-JKOxKC.js +61 -0
  25. package/dist/PhoneField-DSCaGYq7.js +26 -0
  26. package/dist/QRCodeField-CtcOUapi.js +73 -0
  27. package/dist/{RatingField-rRi_P0N0.js → RatingField-BDnyQFWy.js} +10 -9
  28. package/dist/RichTextField-CH6LVZQA.js +33 -0
  29. package/dist/SelectField-DE4dpkMV.js +36 -0
  30. package/dist/{SignatureField-2CnhcWI0.js → SignatureField-B1wh3f5A.js} +18 -17
  31. package/dist/{SliderField-DEpMVXko.js → SliderField-zoTCKh9n.js} +2 -1
  32. package/dist/SummaryField-BeBVT6VN.js +22 -0
  33. package/dist/TextAreaField-rfUGrRxh.js +37 -0
  34. package/dist/TextField-C_yM7ATQ.js +30 -0
  35. package/dist/TimeField-BcQmBZi9.js +22 -0
  36. package/dist/UrlField-BakaF6NI.js +31 -0
  37. package/dist/UserField-zS7y3eKb.js +76 -0
  38. package/dist/VectorField-CTZ4myDM.js +34 -0
  39. package/dist/index.js +1912 -1728
  40. package/dist/index.umd.cjs +38 -47
  41. package/dist/packages/plugin-detail/src/DetailSection.d.ts.map +1 -1
  42. package/dist/packages/plugin-detail/src/DetailView.d.ts +24 -0
  43. package/dist/packages/plugin-detail/src/DetailView.d.ts.map +1 -1
  44. package/dist/packages/plugin-detail/src/RelatedList.d.ts +8 -0
  45. package/dist/packages/plugin-detail/src/RelatedList.d.ts.map +1 -1
  46. package/dist/packages/plugin-detail/src/useDetailTranslation.d.ts.map +1 -1
  47. package/dist/plugin-detail.css +1 -2
  48. package/dist/rolldown-runtime-DnwLefa7.js +23 -0
  49. package/dist/{src-C56Ly5uG.js → src-DyUKLvMN.js} +18271 -26636
  50. package/dist/{useFieldTranslation-CkxqyB82.js → useFieldTranslation-BRgjC1oq.js} +1 -1
  51. package/package.json +33 -11
  52. package/.turbo/turbo-build.log +0 -64
  53. package/dist/AddressField-CDLSeyNx.js +0 -93
  54. package/dist/AutoNumberField-CtE7suf5.js +0 -14
  55. package/dist/CodeField-CfwgRxx2.js +0 -22
  56. package/dist/ColorField-YKHA7dBD.js +0 -37
  57. package/dist/CurrencyField-tvS3fPAF.js +0 -51
  58. package/dist/DateField-BKqXpkOh.js +0 -21
  59. package/dist/DateTimeField-CR-nJCE7.js +0 -32
  60. package/dist/EmailField-CgvW1Qal.js +0 -28
  61. package/dist/FileField-BVAme2ML.js +0 -151
  62. package/dist/FormulaField-DamJ2VaG.js +0 -14
  63. package/dist/GeolocationField-C99z7ZBM.js +0 -113
  64. package/dist/GridField-C9JbpTx_.js +0 -51
  65. package/dist/ImageField-CDANtgVV.js +0 -75
  66. package/dist/LocationField-ZSyZ0O-h.js +0 -35
  67. package/dist/LookupField-B3hQJt95.js +0 -903
  68. package/dist/LookupField-D00z6gn_.js +0 -2
  69. package/dist/NumberField-DL2QAL7X.js +0 -26
  70. package/dist/ObjectField-JYvUnuRO.js +0 -52
  71. package/dist/PercentField-DjR6BSpw.js +0 -63
  72. package/dist/PhoneField-CX1JL-jp.js +0 -28
  73. package/dist/QRCodeField-CH_1pU6R.js +0 -72
  74. package/dist/RichTextField-CJqLWlrb.js +0 -32
  75. package/dist/SelectField-DGoDoRM_.js +0 -30
  76. package/dist/SelectField-XBVI50AD.js +0 -2
  77. package/dist/SummaryField-7ch9aqAu.js +0 -19
  78. package/dist/TextAreaField-Cmw1oXcw.js +0 -36
  79. package/dist/TextField-OTLa3p51.js +0 -29
  80. package/dist/TimeField-DKPoNWoR.js +0 -21
  81. package/dist/UrlField-CxbmzP9f.js +0 -33
  82. package/dist/UserField-ChvwUkMK.js +0 -78
  83. package/dist/VectorField-BVClL8Vw.js +0 -36
  84. package/src/ActivityTimeline.tsx +0 -184
  85. package/src/CommentAttachment.tsx +0 -194
  86. package/src/CommentInput.tsx +0 -81
  87. package/src/DetailSection.tsx +0 -340
  88. package/src/DetailTabs.tsx +0 -73
  89. package/src/DetailView.stories.tsx +0 -334
  90. package/src/DetailView.tsx +0 -823
  91. package/src/DiffView.tsx +0 -233
  92. package/src/FieldChangeItem.tsx +0 -46
  93. package/src/HeaderHighlight.tsx +0 -88
  94. package/src/InlineCreateRelated.tsx +0 -291
  95. package/src/MentionAutocomplete.tsx +0 -123
  96. package/src/PointInTimeRestore.tsx +0 -261
  97. package/src/ReactionPicker.tsx +0 -106
  98. package/src/RecordActivityTimeline.tsx +0 -433
  99. package/src/RecordChatterPanel.tsx +0 -209
  100. package/src/RecordComments.tsx +0 -217
  101. package/src/RecordNavigationEnhanced.tsx +0 -213
  102. package/src/RelatedList.tsx +0 -413
  103. package/src/RelationshipGraph.tsx +0 -286
  104. package/src/RichTextCommentInput.tsx +0 -350
  105. package/src/SectionGroup.tsx +0 -101
  106. package/src/SubscriptionToggle.tsx +0 -62
  107. package/src/ThreadedReplies.tsx +0 -163
  108. package/src/__tests__/ActivityTimeline.test.tsx +0 -119
  109. package/src/__tests__/ActivityTimelineFiltering.test.tsx +0 -143
  110. package/src/__tests__/CommentInput.test.tsx +0 -57
  111. package/src/__tests__/DetailSection.test.tsx +0 -490
  112. package/src/__tests__/DetailView.test.tsx +0 -694
  113. package/src/__tests__/FieldChangeItem.test.tsx +0 -119
  114. package/src/__tests__/HeaderHighlight.test.tsx +0 -213
  115. package/src/__tests__/MentionAutocomplete.test.tsx +0 -97
  116. package/src/__tests__/ReactionPicker.test.tsx +0 -113
  117. package/src/__tests__/RecordActivityTimeline.test.tsx +0 -395
  118. package/src/__tests__/RecordChatterPanel.test.tsx +0 -265
  119. package/src/__tests__/RecordComments.test.tsx +0 -96
  120. package/src/__tests__/RecordCommentsPinSearch.test.tsx +0 -133
  121. package/src/__tests__/RelatedList.test.tsx +0 -160
  122. package/src/__tests__/SectionGroup.test.tsx +0 -101
  123. package/src/__tests__/SubscriptionToggle.test.tsx +0 -84
  124. package/src/__tests__/ThreadedReplies.test.tsx +0 -212
  125. package/src/__tests__/autoLayout.test.ts +0 -228
  126. package/src/__tests__/phase12-features.test.tsx +0 -583
  127. package/src/__tests__/roadmap-features.test.tsx +0 -478
  128. package/src/autoLayout.ts +0 -128
  129. package/src/index.tsx +0 -149
  130. package/src/useDetailTranslation.ts +0 -183
  131. package/tsconfig.json +0 -18
  132. package/vite.config.ts +0 -57
  133. package/vitest.config.ts +0 -13
  134. package/vitest.setup.ts +0 -1
@@ -1,4 +1,4 @@
1
- import { dn as e } from "./src-C56Ly5uG.js";
1
+ import { on as e } from "./src-DyUKLvMN.js";
2
2
  var t = e({
3
3
  "common.selectOption": "Select an option",
4
4
  "common.select": "Select...",
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-detail",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "DetailView plugin for Object UI - comprehensive detail page with sections, tabs, and related lists",
7
- "homepage": "https://www.objectui.org",
7
+ "homepage": "https://www.objectui.org/docs/plugins/plugin-detail",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "https://github.com/objectstack-ai/objectui.git",
10
+ "url": "git+https://github.com/objectstack-ai/objectui.git",
11
11
  "directory": "packages/plugin-detail"
12
12
  },
13
13
  "bugs": {
@@ -25,11 +25,11 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "lucide-react": "^1.8.0",
28
- "@object-ui/components": "3.3.0",
29
- "@object-ui/core": "3.3.0",
30
- "@object-ui/fields": "3.3.0",
31
- "@object-ui/react": "3.3.0",
32
- "@object-ui/types": "3.3.0"
28
+ "@object-ui/components": "3.3.1",
29
+ "@object-ui/core": "3.3.1",
30
+ "@object-ui/fields": "3.3.1",
31
+ "@object-ui/react": "3.3.1",
32
+ "@object-ui/types": "3.3.1"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^18.0.0 || ^19.0.0",
@@ -39,11 +39,33 @@
39
39
  "@types/react": "19.2.14",
40
40
  "@types/react-dom": "19.2.3",
41
41
  "@vitejs/plugin-react": "^6.0.1",
42
- "typescript": "^6.0.2",
43
- "vite": "^8.0.8",
42
+ "typescript": "^6.0.3",
43
+ "vite": "^8.0.9",
44
44
  "vite-plugin-dts": "^4.5.4",
45
- "vitest": "^4.1.4"
45
+ "vitest": "^4.1.5"
46
46
  },
47
+ "keywords": [
48
+ "objectui",
49
+ "sdui",
50
+ "schema-driven-ui",
51
+ "react",
52
+ "tailwind",
53
+ "shadcn",
54
+ "objectstack",
55
+ "plugin",
56
+ "detail-view",
57
+ "record-view"
58
+ ],
59
+ "author": "ObjectStack Team <team@objectstack.ai>",
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "files": [
64
+ "dist",
65
+ "README.md",
66
+ "CHANGELOG.md",
67
+ "LICENSE"
68
+ ],
47
69
  "scripts": {
48
70
  "build": "vite build",
49
71
  "test": "vitest run",
@@ -1,64 +0,0 @@
1
-
2
- > @object-ui/plugin-detail@3.3.0 build /home/runner/work/objectui/objectui/packages/plugin-detail
3
- > vite build
4
-
5
- vite v8.0.8 building client environment for production...
6
- 
7
- rendering chunks...
8
- 
9
- [vite:dts] Start generate declaration files...
10
- [vite:dts] Declaration files built in 23359ms.
11
- 
12
- computing gzip size...
13
- dist/plugin-detail.css 127.21 kB │ gzip: 20.74 kB
14
- dist/LookupField-D00z6gn_.js 0.08 kB │ gzip: 0.08 kB
15
- dist/SelectField-XBVI50AD.js 0.08 kB │ gzip: 0.08 kB
16
- dist/useFieldTranslation-CkxqyB82.js 0.25 kB │ gzip: 0.17 kB
17
- dist/AutoNumberField-CtE7suf5.js 0.45 kB │ gzip: 0.32 kB
18
- dist/TimeField-DKPoNWoR.js 0.58 kB │ gzip: 0.37 kB
19
- dist/DateField-BKqXpkOh.js 0.61 kB │ gzip: 0.39 kB
20
- dist/SummaryField-7ch9aqAu.js 0.63 kB │ gzip: 0.43 kB
21
- dist/FormulaField-DamJ2VaG.js 0.67 kB │ gzip: 0.43 kB
22
- dist/NumberField-DL2QAL7X.js 0.73 kB │ gzip: 0.46 kB
23
- dist/DateTimeField-CR-nJCE7.js 0.80 kB │ gzip: 0.44 kB
24
- dist/CodeField-CfwgRxx2.js 0.82 kB │ gzip: 0.49 kB
25
- dist/PhoneField-CX1JL-jp.js 0.83 kB │ gzip: 0.50 kB
26
- dist/EmailField-CgvW1Qal.js 0.84 kB │ gzip: 0.49 kB
27
- dist/TextField-OTLa3p51.js 0.86 kB │ gzip: 0.45 kB
28
- dist/VectorField-BVClL8Vw.js 0.94 kB │ gzip: 0.51 kB
29
- dist/SelectField-DGoDoRM_.js 0.98 kB │ gzip: 0.54 kB
30
- dist/LocationField-ZSyZ0O-h.js 0.99 kB │ gzip: 0.56 kB
31
- dist/UrlField-CxbmzP9f.js 1.00 kB │ gzip: 0.54 kB
32
- dist/SliderField-DEpMVXko.js 1.06 kB │ gzip: 0.52 kB
33
- dist/TextAreaField-Cmw1oXcw.js 1.08 kB │ gzip: 0.60 kB
34
- dist/RichTextField-CJqLWlrb.js 1.14 kB │ gzip: 0.60 kB
35
- dist/PasswordField-DVTimsc3.js 1.15 kB │ gzip: 0.65 kB
36
- dist/BooleanField-DwfMKknK.js 1.16 kB │ gzip: 0.53 kB
37
- dist/ColorField-YKHA7dBD.js 1.22 kB │ gzip: 0.56 kB
38
- dist/CurrencyField-tvS3fPAF.js 1.50 kB │ gzip: 0.77 kB
39
- dist/RatingField-rRi_P0N0.js 1.60 kB │ gzip: 0.68 kB
40
- dist/ObjectField-JYvUnuRO.js 1.60 kB │ gzip: 0.79 kB
41
- dist/PercentField-DjR6BSpw.js 1.80 kB │ gzip: 0.85 kB
42
- dist/GridField-C9JbpTx_.js 1.87 kB │ gzip: 0.73 kB
43
- dist/QRCodeField-CH_1pU6R.js 2.20 kB │ gzip: 0.93 kB
44
- dist/AvatarField-Xuieq0ZI.js 2.45 kB │ gzip: 1.10 kB
45
- dist/UserField-ChvwUkMK.js 2.49 kB │ gzip: 0.95 kB
46
- dist/ImageField-CDANtgVV.js 2.50 kB │ gzip: 1.09 kB
47
- dist/AddressField-CDLSeyNx.js 2.72 kB │ gzip: 0.79 kB
48
- dist/SignatureField-2CnhcWI0.js 2.88 kB │ gzip: 1.14 kB
49
- dist/MasterDetailField-B0HTmmD7.js 2.97 kB │ gzip: 0.99 kB
50
- dist/GeolocationField-C99z7ZBM.js 3.39 kB │ gzip: 1.23 kB
51
- dist/FileField-BVAme2ML.js 5.24 kB │ gzip: 1.93 kB
52
- dist/LookupField-B3hQJt95.js 31.03 kB │ gzip: 8.44 kB
53
- dist/index.js 140.20 kB │ gzip: 30.99 kB
54
- dist/src-C56Ly5uG.js 2,006.50 kB │ gzip: 473.45 kB
55
-
56
- [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugin `vite:dts`. See https://rolldown.rs/options/checks#plugintimings for more details.
57
- 
58
- 
59
- rendering chunks...
60
- computing gzip size...
61
- dist/plugin-detail.css 127.21 kB │ gzip: 20.74 kB
62
- dist/index.umd.cjs 2,791.64 kB │ gzip: 752.95 kB
63
-
64
- ✓ built in 31.94s
@@ -1,93 +0,0 @@
1
- import { D as e, O as t, gn 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/AddressField.tsx
5
- var a = /* @__PURE__ */ n({ AddressField: () => o });
6
- function o({ value: n, onChange: a, field: o, readonly: s, ...c }) {
7
- let l = n || {}, u = (e, t) => {
8
- a({
9
- ...l,
10
- [e]: t
11
- });
12
- };
13
- return s ? /* @__PURE__ */ r("span", {
14
- className: "text-sm",
15
- children: ((e) => [
16
- e.street,
17
- e.city,
18
- [e.state, e.zipCode].filter(Boolean).join(" "),
19
- e.country
20
- ].filter(Boolean).join(", ") || "-")(l)
21
- }) : /* @__PURE__ */ i("div", {
22
- className: "space-y-3",
23
- children: [
24
- /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r(t, {
25
- htmlFor: "street",
26
- className: "text-xs",
27
- children: "Street Address"
28
- }), /* @__PURE__ */ r(e, {
29
- id: "street",
30
- type: "text",
31
- value: l.street || "",
32
- onChange: (e) => u("street", e.target.value),
33
- placeholder: "123 Main St",
34
- disabled: s || c.disabled,
35
- className: c.className
36
- })] }),
37
- /* @__PURE__ */ i("div", {
38
- className: "grid grid-cols-2 gap-3",
39
- children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r(t, {
40
- htmlFor: "city",
41
- className: "text-xs",
42
- children: "City"
43
- }), /* @__PURE__ */ r(e, {
44
- id: "city",
45
- type: "text",
46
- value: l.city || "",
47
- onChange: (e) => u("city", e.target.value),
48
- placeholder: "San Francisco",
49
- disabled: s || c.disabled
50
- })] }), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r(t, {
51
- htmlFor: "state",
52
- className: "text-xs",
53
- children: "State / Province"
54
- }), /* @__PURE__ */ r(e, {
55
- id: "state",
56
- type: "text",
57
- value: l.state || "",
58
- onChange: (e) => u("state", e.target.value),
59
- placeholder: "CA",
60
- disabled: s || c.disabled
61
- })] })]
62
- }),
63
- /* @__PURE__ */ i("div", {
64
- className: "grid grid-cols-2 gap-3",
65
- children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r(t, {
66
- htmlFor: "zipCode",
67
- className: "text-xs",
68
- children: "ZIP / Postal Code"
69
- }), /* @__PURE__ */ r(e, {
70
- id: "zipCode",
71
- type: "text",
72
- value: l.zipCode || "",
73
- onChange: (e) => u("zipCode", e.target.value),
74
- placeholder: "94102",
75
- disabled: s || c.disabled
76
- })] }), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r(t, {
77
- htmlFor: "country",
78
- className: "text-xs",
79
- children: "Country"
80
- }), /* @__PURE__ */ r(e, {
81
- id: "country",
82
- type: "text",
83
- value: l.country || "",
84
- onChange: (e) => u("country", e.target.value),
85
- placeholder: "United States",
86
- disabled: s || c.disabled
87
- })] })]
88
- })
89
- ]
90
- });
91
- }
92
- //#endregion
93
- export { a as t };
@@ -1,14 +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/AutoNumberField.tsx
5
- var n = /* @__PURE__ */ e({ AutoNumberField: () => r });
6
- function r({ value: e, field: n, ...r }) {
7
- let i = e == null ? "-" : String(e);
8
- return /* @__PURE__ */ t("span", {
9
- className: `text-sm font-mono text-gray-700 ${r.className || ""}`,
10
- children: i
11
- });
12
- }
13
- //#endregion
14
- export { n as t };
@@ -1,22 +0,0 @@
1
- import { gn as e, t, un as n } from "./src-C56Ly5uG.js";
2
- import "react";
3
- import { jsx as r } from "react/jsx-runtime";
4
- //#region ../fields/src/widgets/CodeField.tsx
5
- var i = /* @__PURE__ */ e({ CodeField: () => a });
6
- function a({ value: e, onChange: i, field: a, readonly: o, ...s }) {
7
- let c = a || s.schema, l = c?.language ?? "javascript";
8
- return o ? /* @__PURE__ */ r("pre", {
9
- className: n("text-sm bg-muted p-2 rounded overflow-x-auto border", s.className),
10
- children: /* @__PURE__ */ r("code", { children: e || "-" })
11
- }) : /* @__PURE__ */ r(t, {
12
- value: e || "",
13
- onChange: (e) => i(e.target.value),
14
- placeholder: c?.placeholder || `// Write ${l} code here...`,
15
- disabled: o || s.disabled,
16
- className: n("font-mono text-sm", s.className),
17
- rows: 12,
18
- spellCheck: !1
19
- });
20
- }
21
- //#endregion
22
- export { i as t };
@@ -1,37 +0,0 @@
1
- import { D as e, gn as 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/ColorField.tsx
5
- var i = /* @__PURE__ */ t({ ColorField: () => a });
6
- function a({ value: t, onChange: i, field: a, readonly: o, ...s }) {
7
- let c = a || s.schema;
8
- return o ? /* @__PURE__ */ r("div", {
9
- className: "flex items-center gap-2",
10
- children: [/* @__PURE__ */ n("div", {
11
- className: "w-6 h-6 rounded border border-input",
12
- style: { backgroundColor: t || "#000000" }
13
- }), /* @__PURE__ */ n("span", {
14
- className: "text-sm",
15
- children: t || "-"
16
- })]
17
- }) : /* @__PURE__ */ r("div", {
18
- className: "flex items-center gap-2",
19
- children: [/* @__PURE__ */ n("input", {
20
- type: "color",
21
- value: t || "#000000",
22
- onChange: (e) => i(e.target.value),
23
- disabled: o || s.disabled,
24
- className: "w-10 h-10 rounded border border-input cursor-pointer"
25
- }), /* @__PURE__ */ n(e, {
26
- type: "text",
27
- value: t || "",
28
- onChange: (e) => i(e.target.value),
29
- placeholder: c?.placeholder || "#000000",
30
- disabled: o || s.disabled,
31
- className: s.className,
32
- pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
33
- })]
34
- });
35
- }
36
- //#endregion
37
- export { i as t };
@@ -1,51 +0,0 @@
1
- import { D as e, gn as 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/CurrencyField.tsx
5
- var i = /* @__PURE__ */ t({ CurrencyField: () => o });
6
- function a(e, t = "USD") {
7
- try {
8
- return new Intl.NumberFormat("en-US", {
9
- style: "currency",
10
- currency: t
11
- }).format(e);
12
- } catch {
13
- return `${t} ${e.toFixed(2)}`;
14
- }
15
- }
16
- function o({ value: t, onChange: i, field: o, readonly: s, errorMessage: c, className: l, ...u }) {
17
- let d = o || u.schema, f = d?.currency || "USD", p = d?.precision ?? 2;
18
- if (s) return t == null ? /* @__PURE__ */ n("span", {
19
- className: "text-sm",
20
- children: "-"
21
- }) : /* @__PURE__ */ n("span", {
22
- className: "text-sm font-medium tabular-nums",
23
- children: a(Number(t), f)
24
- });
25
- let m = (e) => {
26
- let t = parseFloat(e.target.value);
27
- isNaN(t) || i(parseFloat(t.toFixed(p)));
28
- };
29
- return /* @__PURE__ */ r("div", {
30
- className: "relative",
31
- children: [/* @__PURE__ */ n("span", {
32
- className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
33
- children: f === "USD" ? "$" : f
34
- }), /* @__PURE__ */ n(e, {
35
- ...u,
36
- type: "number",
37
- value: t ?? "",
38
- onChange: (e) => {
39
- i(e.target.value === "" ? null : parseFloat(e.target.value));
40
- },
41
- onBlur: m,
42
- placeholder: d?.placeholder || "0.00",
43
- disabled: s || u.disabled,
44
- className: `pl-8 ${l || ""}`,
45
- step: (10 ** -p).toFixed(p),
46
- "aria-invalid": !!c
47
- })]
48
- });
49
- }
50
- //#endregion
51
- 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/DateField.tsx
5
- var r = /* @__PURE__ */ t({ DateField: () => 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 ? new Date(t).toLocaleDateString() : "-"
10
- });
11
- let { inputType: s, ...c } = o;
12
- return /* @__PURE__ */ n(e, {
13
- ...c,
14
- type: "date",
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,32 +0,0 @@
1
- import { D as e, gn as 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/DateTimeField.tsx
5
- var i = /* @__PURE__ */ t({ DateTimeField: () => a });
6
- function a({ value: t, onChange: i, field: a, readonly: o, ...s }) {
7
- if (o) {
8
- if (!t) return /* @__PURE__ */ n("span", {
9
- className: "text-sm",
10
- children: "-"
11
- });
12
- let e = new Date(t);
13
- return /* @__PURE__ */ r("span", {
14
- className: "text-sm",
15
- children: [
16
- e.toLocaleDateString(),
17
- " ",
18
- e.toLocaleTimeString()
19
- ]
20
- });
21
- }
22
- let { inputType: c, ...l } = s;
23
- return /* @__PURE__ */ n(e, {
24
- ...l,
25
- type: "datetime-local",
26
- value: t || "",
27
- onChange: (e) => i(e.target.value),
28
- disabled: o || l.disabled
29
- });
30
- }
31
- //#endregion
32
- export { i 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/EmailField.tsx
5
- var r = /* @__PURE__ */ t({ EmailField: () => 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: `mailto:${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: "email",
20
- value: t || "",
21
- onChange: (e) => r(e.target.value),
22
- placeholder: c?.placeholder || "email@example.com",
23
- disabled: a || u.disabled,
24
- "aria-invalid": !!o
25
- });
26
- }
27
- //#endregion
28
- export { r as t };
@@ -1,151 +0,0 @@
1
- import { $ as e, Z as t, et as n, gn as r, jt as i, kt as a } from "./src-C56Ly5uG.js";
2
- import { useCallback as o, useRef as s, useState as c } from "react";
3
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
- //#region ../fields/src/widgets/FileField.tsx
5
- var d = /* @__PURE__ */ r({ FileField: () => f });
6
- function f({ value: r, onChange: d, field: f, readonly: p, ...m }) {
7
- let h = s(null), g = f || m.schema, _ = g?.multiple || !1, v = g?.accept ? g.accept.join(",") : void 0, y = g?.maxSize, [b, x] = c(!1), [S, C] = c([]), w = r ? Array.isArray(r) ? r : [r] : [], T = o((e) => {
8
- if (e.length === 0) return;
9
- let t = [], n = e.filter((e) => {
10
- if (y && e.size > y) {
11
- let n = (y / (1024 * 1024)).toFixed(1);
12
- return t.push(`"${e.name}" exceeds max size (${n} MB)`), !1;
13
- }
14
- return !0;
15
- });
16
- if (C(t), n.length === 0) return;
17
- let r = n.map((e) => ({
18
- name: e.name,
19
- original_name: e.name,
20
- size: e.size,
21
- mime_type: e.type,
22
- url: URL.createObjectURL(e)
23
- }));
24
- d(_ ? [...w, ...r] : r[0]);
25
- }, [
26
- w,
27
- _,
28
- d,
29
- y
30
- ]), E = o((e) => {
31
- e.preventDefault(), e.stopPropagation(), x(!0);
32
- }, []), D = o((e) => {
33
- e.preventDefault(), e.stopPropagation(), x(!1);
34
- }, []), O = o((e) => {
35
- e.preventDefault(), e.stopPropagation(), x(!1);
36
- let t = Array.from(e.dataTransfer.files);
37
- if (v) {
38
- let e = v.split(",").map((e) => e.trim().toLowerCase());
39
- T(t.filter((t) => {
40
- let n = t.name.split("."), r = n.length > 1 ? "." + n.pop()?.toLowerCase() : "";
41
- return e.some((e) => e === t.type || r && e === r || e.endsWith("/*") && t.type.startsWith(e.replace("/*", "/")));
42
- }));
43
- } else T(t);
44
- }, [v, T]);
45
- if (p) return r ? /* @__PURE__ */ l("div", {
46
- className: "flex flex-wrap gap-2",
47
- children: (Array.isArray(r) ? r : [r]).map((e, t) => /* @__PURE__ */ l("span", {
48
- className: "text-sm truncate max-w-xs",
49
- children: e.name || e.original_name || "File"
50
- }, t))
51
- }) : /* @__PURE__ */ l("span", {
52
- className: "text-sm",
53
- children: "-"
54
- });
55
- let k = (e) => {
56
- T(Array.from(e.target.files || []));
57
- }, A = (e) => {
58
- if (_) {
59
- let t = w.filter((t, n) => n !== e);
60
- d(t.length > 0 ? t : null);
61
- } else d(null);
62
- }, j = (e) => (e.mime_type || "").startsWith("image/");
63
- return /* @__PURE__ */ u("div", {
64
- className: m.className,
65
- children: [/* @__PURE__ */ l("input", {
66
- ref: h,
67
- type: "file",
68
- multiple: _,
69
- accept: v,
70
- onChange: k,
71
- className: "hidden"
72
- }), /* @__PURE__ */ u("div", {
73
- className: "space-y-2",
74
- children: [
75
- /* @__PURE__ */ u("div", {
76
- onDragOver: E,
77
- onDragLeave: D,
78
- onDrop: O,
79
- onClick: () => h.current?.click(),
80
- className: `
81
- flex flex-col items-center justify-center gap-2 p-6
82
- border-2 border-dashed rounded-lg cursor-pointer
83
- transition-colors duration-200
84
- ${b ? "border-primary bg-primary/5 text-primary" : "border-muted-foreground/25 hover:border-primary/50 text-muted-foreground hover:text-foreground"}
85
- `,
86
- role: "button",
87
- tabIndex: 0,
88
- onKeyDown: (e) => {
89
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), h.current?.click());
90
- },
91
- children: [/* @__PURE__ */ l(n, { className: `size-8 ${b ? "text-primary" : "text-muted-foreground"}` }), /* @__PURE__ */ u("div", {
92
- className: "text-center",
93
- children: [/* @__PURE__ */ l("p", {
94
- className: "text-sm font-medium",
95
- children: b ? "Drop files here" : "Drag & drop files here"
96
- }), /* @__PURE__ */ l("p", {
97
- className: "text-xs text-muted-foreground mt-1",
98
- children: "or click to browse"
99
- })]
100
- })]
101
- }),
102
- S.length > 0 && /* @__PURE__ */ l("div", {
103
- className: "space-y-0.5",
104
- children: S.map((e, t) => /* @__PURE__ */ l("p", {
105
- className: "text-xs text-destructive",
106
- children: e
107
- }, t))
108
- }),
109
- w.length > 0 && /* @__PURE__ */ l("div", {
110
- className: "space-y-1",
111
- children: w.map((n, r) => /* @__PURE__ */ u("div", {
112
- className: "flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",
113
- children: [/* @__PURE__ */ u("div", {
114
- className: "flex items-center gap-2 flex-1 min-w-0",
115
- children: [
116
- j(n) && n.url ? /* @__PURE__ */ l("img", {
117
- src: n.url,
118
- alt: n.name,
119
- className: "size-8 object-cover rounded flex-shrink-0"
120
- }) : j(n) ? /* @__PURE__ */ l(a, { className: "size-4 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ l(i, { className: "size-4 text-muted-foreground flex-shrink-0" }),
121
- /* @__PURE__ */ l("span", {
122
- className: "text-sm truncate",
123
- children: n.name || n.original_name || "File"
124
- }),
125
- n.size && /* @__PURE__ */ u("span", {
126
- className: "text-xs text-muted-foreground",
127
- children: [
128
- "(",
129
- (n.size / 1024).toFixed(1),
130
- " KB)"
131
- ]
132
- })
133
- ]
134
- }), /* @__PURE__ */ l(t, {
135
- type: "button",
136
- variant: "ghost",
137
- size: "sm",
138
- onClick: (e) => {
139
- e.stopPropagation(), A(r);
140
- },
141
- className: "h-6 w-6 p-0",
142
- children: /* @__PURE__ */ l(e, { className: "size-3" })
143
- })]
144
- }, r))
145
- })
146
- ]
147
- })]
148
- });
149
- }
150
- //#endregion
151
- export { d as t };
@@ -1,14 +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/FormulaField.tsx
5
- var n = /* @__PURE__ */ e({ FormulaField: () => r });
6
- function r({ value: e, field: n, ...r }) {
7
- let i = (n || r.schema)?.return_type || "text", a = "-";
8
- return e != null && (a = i === "number" || i === "currency" ? typeof e == "number" ? e.toFixed(2) : String(e) : i === "boolean" ? e ? "Yes" : "No" : i === "date" ? new Date(e).toLocaleDateString() : String(e)), /* @__PURE__ */ t("span", {
9
- className: `text-sm font-mono text-gray-700 ${r.className || ""}`,
10
- children: a
11
- });
12
- }
13
- //#endregion
14
- export { n as t };