@object-ui/plugin-aggrid 3.3.0 → 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +20 -0
  3. package/dist/AddressField-CP-8JJvR.js +98 -0
  4. package/dist/{AgGridImpl-DBqxIsko.js → AgGridImpl-DJWnS8p3.js} +1 -1
  5. package/dist/AutoNumberField-DCL2eUJj.js +14 -0
  6. package/dist/{AvatarField-C5b9biGa.js → AvatarField-CpFxJRdO.js} +4 -3
  7. package/dist/{BooleanField-DRzAZhSq.js → BooleanField-Chphr8cB.js} +2 -1
  8. package/dist/CodeField-BWngVIw1.js +23 -0
  9. package/dist/ColorField-GygyYArR.js +38 -0
  10. package/dist/CurrencyField-O8Pn59RO.js +49 -0
  11. package/dist/DateField-u6U8wmvI.js +22 -0
  12. package/dist/DateTimeField-D1z1Ovvy.js +30 -0
  13. package/dist/EmailField-IOcDmGjJ.js +26 -0
  14. package/dist/FileField-D3mZIrJ1.js +158 -0
  15. package/dist/FormulaField-MuyWzQx0.js +17 -0
  16. package/dist/GeolocationField-BfhC7QLw.js +161 -0
  17. package/dist/GridField-gN34gk4b.js +49 -0
  18. package/dist/ImageField-BZfSFwmJ.js +75 -0
  19. package/dist/LocationField-B-zwfw3h.js +36 -0
  20. package/dist/{LookupField-DoOmbbZF.js → LookupField-Cms1Cu_l.js} +347 -349
  21. package/dist/{MasterDetailField-BnSPGAtS.js → MasterDetailField-DGUmvg2f.js} +5 -4
  22. package/dist/NumberField-BV5sKwZ7.js +27 -0
  23. package/dist/{ObjectAgGridImpl-DrI0aa8t.js → ObjectAgGridImpl-yiHlXYgp.js} +5804 -5804
  24. package/dist/ObjectField-DJ5s3ciA.js +50 -0
  25. package/dist/{PasswordField-k5JeKk9f.js → PasswordField-BJboeBJY.js} +3 -2
  26. package/dist/PercentField-DO3be_bL.js +61 -0
  27. package/dist/PhoneField-CT6XcO6O.js +26 -0
  28. package/dist/{QRCodeField-BIrSW1Zr.js → QRCodeField-COLyc5iQ.js} +31 -30
  29. package/dist/{RatingField-5iMhn2GL.js → RatingField-B2momIna.js} +3 -2
  30. package/dist/RichTextField-C7qzDPJy.js +33 -0
  31. package/dist/SelectField-oo6vnNhQ.js +36 -0
  32. package/dist/{SignatureField-BAMvNrE6.js → SignatureField-DUgoK09r.js} +3 -2
  33. package/dist/{SliderField-C9IhmjbF.js → SliderField-DrggtBSX.js} +2 -1
  34. package/dist/SummaryField-DuMsFoY5.js +22 -0
  35. package/dist/TextAreaField-CLzzmPce.js +37 -0
  36. package/dist/TextField-CZE7SzK4.js +30 -0
  37. package/dist/TimeField-Bha4cayv.js +22 -0
  38. package/dist/UrlField-Dff4WLlN.js +31 -0
  39. package/dist/UserField-eT5njHwQ.js +77 -0
  40. package/dist/VectorField-BHe8lDOH.js +34 -0
  41. package/dist/{image-DlUdeTgT.js → image-DmzU2ETO.js} +1 -1
  42. package/dist/index.js +2 -2
  43. package/dist/index.umd.cjs +77 -77
  44. package/dist/{jsx-runtime-CGDkM_Jn.js → jsx-runtime-CXSCp6pT.js} +30 -39
  45. package/dist/{plus-BwEV_Q5_.js → plus-bvZ2f9T_.js} +1 -1
  46. package/dist/rolldown-runtime-CkxV0rQ3.js +14 -0
  47. package/dist/{upload-DPiohvXv.js → upload-BdzwEMeV.js} +1 -1
  48. package/dist/{useFieldTranslation-C69OtouR.js → useFieldTranslation-CfXaJRC4.js} +2 -2
  49. package/dist/{x-BFq2GeQ5.js → x-98xe-fYG.js} +1 -1
  50. package/package.json +34 -11
  51. package/.turbo/turbo-build.log +0 -71
  52. package/OBJECT_AGGRID_CN.md +0 -483
  53. package/QUICKSTART.md +0 -186
  54. package/dist/AddressField-DKqaE9pD.js +0 -93
  55. package/dist/AutoNumberField-0RU2dNKe.js +0 -13
  56. package/dist/CodeField-RWhnDMyL.js +0 -22
  57. package/dist/ColorField-B-YAFXdz.js +0 -37
  58. package/dist/CurrencyField-Bu80a-sI.js +0 -51
  59. package/dist/DateField-CV-NpLbM.js +0 -21
  60. package/dist/DateTimeField--YTsgTjw.js +0 -32
  61. package/dist/EmailField-B-3fWJsH.js +0 -28
  62. package/dist/FileField-BcGMvBnI.js +0 -160
  63. package/dist/FormulaField-MQXJZOep.js +0 -13
  64. package/dist/GeolocationField-D3BrmwqV.js +0 -156
  65. package/dist/GridField-DHsGo9l2.js +0 -51
  66. package/dist/ImageField-BBqwJEkk.js +0 -77
  67. package/dist/LocationField-DSvhU9Dz.js +0 -35
  68. package/dist/LookupField-KfYQlgUd.js +0 -2
  69. package/dist/NumberField-Kz4_o5DE.js +0 -26
  70. package/dist/ObjectField-C1qkl6s4.js +0 -52
  71. package/dist/PercentField-Dmipqv0I.js +0 -63
  72. package/dist/PhoneField-Dn4h6V9H.js +0 -28
  73. package/dist/RichTextField-CN5BRd_7.js +0 -32
  74. package/dist/SelectField-Bjk_S2zT.js +0 -31
  75. package/dist/SelectField-CcWvzp9g.js +0 -2
  76. package/dist/SummaryField-R9RENAZv.js +0 -18
  77. package/dist/TextAreaField-BY63Nr6-.js +0 -36
  78. package/dist/TextField-SIw8aMzf.js +0 -29
  79. package/dist/TimeField-xxziHPjE.js +0 -21
  80. package/dist/UrlField-Ihk3_ff5.js +0 -33
  81. package/dist/UserField-BHl6mmIH.js +0 -79
  82. package/dist/VectorField-Ci167cxr.js +0 -35
  83. package/src/AgGridImpl.tsx +0 -405
  84. package/src/ObjectAgGridImpl.tsx +0 -509
  85. package/src/VirtualScrolling.ts +0 -74
  86. package/src/ag-grid.d.ts +0 -10
  87. package/src/field-renderers.test.tsx +0 -383
  88. package/src/field-renderers.tsx +0 -224
  89. package/src/index.test.ts +0 -139
  90. package/src/index.tsx +0 -514
  91. package/src/object-aggrid.test.ts +0 -99
  92. package/src/object-aggrid.types.ts +0 -123
  93. package/src/types.ts +0 -184
  94. package/tsconfig.json +0 -17
  95. package/vite.config.ts +0 -64
  96. /package/dist/{createLucideIcon-BjfZYZey.js → createLucideIcon-C_5JZ35b.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @object-ui/plugin-aggrid
2
2
 
3
+ ## 3.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - @object-ui/types@3.3.2
8
+ - @object-ui/core@3.3.2
9
+ - @object-ui/react@3.3.2
10
+ - @object-ui/components@3.3.2
11
+ - @object-ui/fields@3.3.2
12
+ - @object-ui/data-objectstack@3.3.2
13
+
14
+ ## 3.3.1
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [b429568]
19
+ - @object-ui/components@3.3.1
20
+ - @object-ui/fields@3.3.1
21
+ - @object-ui/types@3.3.1
22
+ - @object-ui/core@3.3.1
23
+ - @object-ui/react@3.3.1
24
+ - @object-ui/data-objectstack@3.3.1
25
+
3
26
  ## 3.3.0
4
27
 
5
28
  ### Patch Changes
package/README.md CHANGED
@@ -715,6 +715,26 @@ const schema = {
715
715
  // Renders as: [color swatch] #FF5733
716
716
  ```
717
717
 
718
+ <!-- release-metadata:v3.3.0 -->
719
+
720
+ ## Compatibility
721
+
722
+ - **React:** 18.x or 19.x
723
+ - **Node.js:** ≥ 18
724
+ - **TypeScript:** ≥ 5.0 (strict mode)
725
+ - **`@objectstack/spec`:** ^3.3.0
726
+ - **`@objectstack/client`:** ^3.3.0
727
+ - **Tailwind CSS:** ≥ 3.4 (for packages with UI)
728
+
729
+ ## Links
730
+
731
+ - 📚 [Documentation](https://www.objectui.org/docs/plugins/plugin-aggrid)
732
+ - 📦 [npm package](https://www.npmjs.com/package/@object-ui/plugin-aggrid)
733
+ - 📝 [Changelog](./CHANGELOG.md)
734
+ - 🐛 [Report an issue](https://github.com/objectstack-ai/objectui/issues)
735
+ - 🤝 [Contributing Guide](https://github.com/objectstack-ai/objectui/blob/main/CONTRIBUTING.md)
736
+ - 🗺️ [Roadmap](https://github.com/objectstack-ai/objectui/blob/main/ROADMAP.md)
737
+
718
738
  ## License
719
739
 
720
740
 
@@ -0,0 +1,98 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n, Input as r, Label as i } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/AddressField.tsx
6
+ var a = /* @__PURE__ */ e({ AddressField: () => s }), o = t();
7
+ function s({ value: e, onChange: t, field: a, readonly: s, ...c }) {
8
+ let l = e || {}, u = (e, n) => {
9
+ t({
10
+ ...l,
11
+ [e]: n
12
+ });
13
+ }, d = (e) => [
14
+ e.street,
15
+ e.city,
16
+ [e.state, e.zipCode].filter(Boolean).join(" "),
17
+ e.country
18
+ ].filter(Boolean).join(", ");
19
+ if (s) {
20
+ let e = d(l);
21
+ return e ? /* @__PURE__ */ (0, o.jsx)("span", {
22
+ className: "text-sm",
23
+ children: e
24
+ }) : /* @__PURE__ */ (0, o.jsx)(n, {});
25
+ }
26
+ return /* @__PURE__ */ (0, o.jsxs)("div", {
27
+ className: "space-y-3",
28
+ children: [
29
+ /* @__PURE__ */ (0, o.jsxs)("div", { children: [/* @__PURE__ */ (0, o.jsx)(i, {
30
+ htmlFor: "street",
31
+ className: "text-xs",
32
+ children: "Street Address"
33
+ }), /* @__PURE__ */ (0, o.jsx)(r, {
34
+ id: "street",
35
+ type: "text",
36
+ value: l.street || "",
37
+ onChange: (e) => u("street", e.target.value),
38
+ placeholder: "123 Main St",
39
+ disabled: s || c.disabled,
40
+ className: c.className
41
+ })] }),
42
+ /* @__PURE__ */ (0, o.jsxs)("div", {
43
+ className: "grid grid-cols-2 gap-3",
44
+ children: [/* @__PURE__ */ (0, o.jsxs)("div", { children: [/* @__PURE__ */ (0, o.jsx)(i, {
45
+ htmlFor: "city",
46
+ className: "text-xs",
47
+ children: "City"
48
+ }), /* @__PURE__ */ (0, o.jsx)(r, {
49
+ id: "city",
50
+ type: "text",
51
+ value: l.city || "",
52
+ onChange: (e) => u("city", e.target.value),
53
+ placeholder: "San Francisco",
54
+ disabled: s || c.disabled
55
+ })] }), /* @__PURE__ */ (0, o.jsxs)("div", { children: [/* @__PURE__ */ (0, o.jsx)(i, {
56
+ htmlFor: "state",
57
+ className: "text-xs",
58
+ children: "State / Province"
59
+ }), /* @__PURE__ */ (0, o.jsx)(r, {
60
+ id: "state",
61
+ type: "text",
62
+ value: l.state || "",
63
+ onChange: (e) => u("state", e.target.value),
64
+ placeholder: "CA",
65
+ disabled: s || c.disabled
66
+ })] })]
67
+ }),
68
+ /* @__PURE__ */ (0, o.jsxs)("div", {
69
+ className: "grid grid-cols-2 gap-3",
70
+ children: [/* @__PURE__ */ (0, o.jsxs)("div", { children: [/* @__PURE__ */ (0, o.jsx)(i, {
71
+ htmlFor: "zipCode",
72
+ className: "text-xs",
73
+ children: "ZIP / Postal Code"
74
+ }), /* @__PURE__ */ (0, o.jsx)(r, {
75
+ id: "zipCode",
76
+ type: "text",
77
+ value: l.zipCode || "",
78
+ onChange: (e) => u("zipCode", e.target.value),
79
+ placeholder: "94102",
80
+ disabled: s || c.disabled
81
+ })] }), /* @__PURE__ */ (0, o.jsxs)("div", { children: [/* @__PURE__ */ (0, o.jsx)(i, {
82
+ htmlFor: "country",
83
+ className: "text-xs",
84
+ children: "Country"
85
+ }), /* @__PURE__ */ (0, o.jsx)(r, {
86
+ id: "country",
87
+ type: "text",
88
+ value: l.country || "",
89
+ onChange: (e) => u("country", e.target.value),
90
+ placeholder: "United States",
91
+ disabled: s || c.disabled
92
+ })] })]
93
+ })
94
+ ]
95
+ });
96
+ }
97
+ //#endregion
98
+ export { a as t };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./jsx-runtime-CGDkM_Jn.js";
1
+ import { t as e } from "./jsx-runtime-CXSCp6pT.js";
2
2
  import { useCallback as t, useMemo as n, useRef as r } from "react";
3
3
  import { AgGridReact as i } from "ag-grid-react";
4
4
  //#region src/AgGridImpl.tsx
@@ -0,0 +1,14 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/AutoNumberField.tsx
6
+ var r = /* @__PURE__ */ e({ AutoNumberField: () => a }), i = t();
7
+ function a({ value: e, field: t, ...r }) {
8
+ return e == null ? /* @__PURE__ */ (0, i.jsx)(n, { className: r.className }) : /* @__PURE__ */ (0, i.jsx)("span", {
9
+ className: `text-sm font-mono text-gray-700 ${r.className || ""}`,
10
+ children: String(e)
11
+ });
12
+ }
13
+ //#endregion
14
+ export { r as t };
@@ -1,6 +1,7 @@
1
- import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
2
- import { t as n } from "./upload-DPiohvXv.js";
3
- import { t as r } from "./x-BFq2GeQ5.js";
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import { t as n } from "./upload-BdzwEMeV.js";
4
+ import { t as r } from "./x-98xe-fYG.js";
4
5
  import i from "react";
5
6
  import { Avatar as a, AvatarFallback as o, AvatarImage as s, Button as c } from "@object-ui/components";
6
7
  //#region ../fields/src/widgets/AvatarField.tsx
@@ -1,4 +1,5 @@
1
- import { r as e, t } from "./jsx-runtime-CGDkM_Jn.js";
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
2
3
  import { useId as n } from "react";
3
4
  import { Checkbox as r, Label as i, Switch as a } from "@object-ui/components";
4
5
  //#region ../fields/src/widgets/BooleanField.tsx
@@ -0,0 +1,23 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n, Textarea as r, cn as i } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/CodeField.tsx
6
+ var a = /* @__PURE__ */ e({ CodeField: () => s }), o = t();
7
+ function s({ value: e, onChange: t, field: a, readonly: s, ...c }) {
8
+ let l = a || c.schema, u = l?.language ?? "javascript";
9
+ return s ? /* @__PURE__ */ (0, o.jsx)("pre", {
10
+ className: i("text-sm bg-muted p-2 rounded overflow-x-auto border", c.className),
11
+ children: /* @__PURE__ */ (0, o.jsx)("code", { children: e || /* @__PURE__ */ (0, o.jsx)(n, {}) })
12
+ }) : /* @__PURE__ */ (0, o.jsx)(r, {
13
+ value: e || "",
14
+ onChange: (e) => t(e.target.value),
15
+ placeholder: l?.placeholder || `// Write ${u} code here...`,
16
+ disabled: s || c.disabled,
17
+ className: i("font-mono text-sm", c.className),
18
+ rows: 12,
19
+ spellCheck: !1
20
+ });
21
+ }
22
+ //#endregion
23
+ export { a as n, s as t };
@@ -0,0 +1,38 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n, Input as r } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/ColorField.tsx
6
+ var i = /* @__PURE__ */ e({ ColorField: () => o }), a = t();
7
+ function o({ value: e, onChange: t, field: i, readonly: o, ...s }) {
8
+ let c = i || s.schema;
9
+ return o ? /* @__PURE__ */ (0, a.jsxs)("div", {
10
+ className: "flex items-center gap-2",
11
+ children: [/* @__PURE__ */ (0, a.jsx)("div", {
12
+ className: "w-6 h-6 rounded border border-input",
13
+ style: { backgroundColor: e || "#000000" }
14
+ }), /* @__PURE__ */ (0, a.jsx)("span", {
15
+ className: "text-sm",
16
+ children: e || /* @__PURE__ */ (0, a.jsx)(n, {})
17
+ })]
18
+ }) : /* @__PURE__ */ (0, a.jsxs)("div", {
19
+ className: "flex items-center gap-2",
20
+ children: [/* @__PURE__ */ (0, a.jsx)("input", {
21
+ type: "color",
22
+ value: e || "#000000",
23
+ onChange: (e) => t(e.target.value),
24
+ disabled: o || s.disabled,
25
+ className: "w-10 h-10 rounded border border-input cursor-pointer"
26
+ }), /* @__PURE__ */ (0, a.jsx)(r, {
27
+ type: "text",
28
+ value: e || "",
29
+ onChange: (e) => t(e.target.value),
30
+ placeholder: c?.placeholder || "#000000",
31
+ disabled: o || s.disabled,
32
+ className: s.className,
33
+ pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
34
+ })]
35
+ });
36
+ }
37
+ //#endregion
38
+ export { i as n, o as t };
@@ -0,0 +1,49 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n, Input as r } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/CurrencyField.tsx
6
+ var i = /* @__PURE__ */ e({ CurrencyField: () => s }), a = t();
7
+ function o(e, t = "USD") {
8
+ try {
9
+ return new Intl.NumberFormat("en-US", {
10
+ style: "currency",
11
+ currency: t
12
+ }).format(e);
13
+ } catch {
14
+ return `${t} ${e.toFixed(2)}`;
15
+ }
16
+ }
17
+ function s({ value: e, onChange: t, field: i, readonly: s, errorMessage: c, className: l, ...u }) {
18
+ let d = i || u.schema, f = d?.currency || "USD", p = d?.precision ?? 2;
19
+ if (s) return e == null ? /* @__PURE__ */ (0, a.jsx)(n, {}) : /* @__PURE__ */ (0, a.jsx)("span", {
20
+ className: "text-sm font-medium tabular-nums",
21
+ children: o(Number(e), f)
22
+ });
23
+ let m = (e) => {
24
+ let n = parseFloat(e.target.value);
25
+ isNaN(n) || t(parseFloat(n.toFixed(p)));
26
+ };
27
+ return /* @__PURE__ */ (0, a.jsxs)("div", {
28
+ className: "relative",
29
+ children: [/* @__PURE__ */ (0, a.jsx)("span", {
30
+ className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
31
+ children: f === "USD" ? "$" : f
32
+ }), /* @__PURE__ */ (0, a.jsx)(r, {
33
+ ...u,
34
+ type: "number",
35
+ value: e ?? "",
36
+ onChange: (e) => {
37
+ t(e.target.value === "" ? null : parseFloat(e.target.value));
38
+ },
39
+ onBlur: m,
40
+ placeholder: d?.placeholder || "0.00",
41
+ disabled: s || u.disabled,
42
+ className: `pl-8 ${l || ""}`,
43
+ step: (10 ** -p).toFixed(p),
44
+ "aria-invalid": !!c
45
+ })]
46
+ });
47
+ }
48
+ //#endregion
49
+ export { i as n, s as t };
@@ -0,0 +1,22 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n, Input as r } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/DateField.tsx
6
+ var i = /* @__PURE__ */ e({ DateField: () => o }), a = t();
7
+ function o({ value: e, onChange: t, field: i, readonly: o, ...s }) {
8
+ if (o) return e ? /* @__PURE__ */ (0, a.jsx)("span", {
9
+ className: "text-sm",
10
+ children: new Date(e).toLocaleDateString()
11
+ }) : /* @__PURE__ */ (0, a.jsx)(n, {});
12
+ let { inputType: c, ...l } = s;
13
+ return /* @__PURE__ */ (0, a.jsx)(r, {
14
+ ...l,
15
+ type: "date",
16
+ value: e || "",
17
+ onChange: (e) => t(e.target.value),
18
+ disabled: o || l.disabled
19
+ });
20
+ }
21
+ //#endregion
22
+ export { i as n, o as t };
@@ -0,0 +1,30 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n, Input as r } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/DateTimeField.tsx
6
+ var i = /* @__PURE__ */ e({ DateTimeField: () => o }), a = t();
7
+ function o({ value: e, onChange: t, field: i, readonly: o, ...s }) {
8
+ if (o) {
9
+ if (!e) return /* @__PURE__ */ (0, a.jsx)(n, {});
10
+ let t = new Date(e);
11
+ return /* @__PURE__ */ (0, a.jsxs)("span", {
12
+ className: "text-sm",
13
+ children: [
14
+ t.toLocaleDateString(),
15
+ " ",
16
+ t.toLocaleTimeString()
17
+ ]
18
+ });
19
+ }
20
+ let { inputType: c, ...l } = s;
21
+ return /* @__PURE__ */ (0, a.jsx)(r, {
22
+ ...l,
23
+ type: "datetime-local",
24
+ value: e || "",
25
+ onChange: (e) => t(e.target.value),
26
+ disabled: o || l.disabled
27
+ });
28
+ }
29
+ //#endregion
30
+ export { i as n, o as t };
@@ -0,0 +1,26 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n, Input as r } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/EmailField.tsx
6
+ var i = /* @__PURE__ */ e({ EmailField: () => o }), a = t();
7
+ function o({ value: e, onChange: t, field: i, readonly: o, errorMessage: s, ...c }) {
8
+ let l = i || c.schema;
9
+ if (o) return e ? /* @__PURE__ */ (0, a.jsx)("a", {
10
+ href: `mailto:${e}`,
11
+ className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
12
+ children: e
13
+ }) : /* @__PURE__ */ (0, a.jsx)(n, {});
14
+ let { inputType: u, ...d } = c;
15
+ return /* @__PURE__ */ (0, a.jsx)(r, {
16
+ ...d,
17
+ type: "email",
18
+ value: e || "",
19
+ onChange: (e) => t(e.target.value),
20
+ placeholder: l?.placeholder || "email@example.com",
21
+ disabled: o || d.disabled,
22
+ "aria-invalid": !!s
23
+ });
24
+ }
25
+ //#endregion
26
+ export { i as n, o as t };
@@ -0,0 +1,158 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import { t as n } from "./createLucideIcon-C_5JZ35b.js";
4
+ import { t as r } from "./image-DmzU2ETO.js";
5
+ import { t as i } from "./upload-BdzwEMeV.js";
6
+ import { t as a } from "./x-98xe-fYG.js";
7
+ import { useCallback as o, useRef as s, useState as c } from "react";
8
+ import { Button as l, EmptyValue as u } from "@object-ui/components";
9
+ var d = n("file", [["path", {
10
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
11
+ key: "1oefj6"
12
+ }], ["path", {
13
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
14
+ key: "wfsgrz"
15
+ }]]), f = /* @__PURE__ */ e({ FileField: () => m }), p = t();
16
+ function m({ value: e, onChange: t, field: n, readonly: f, ...m }) {
17
+ let h = s(null), g = n || m.schema, _ = g?.multiple || !1, v = g?.accept ? g.accept.join(",") : void 0, y = g?.maxSize, [b, x] = c(!1), [S, C] = c([]), w = e ? Array.isArray(e) ? e : [e] : [], T = o((e) => {
18
+ if (e.length === 0) return;
19
+ let n = [], r = e.filter((e) => {
20
+ if (y && e.size > y) {
21
+ let t = (y / (1024 * 1024)).toFixed(1);
22
+ return n.push(`"${e.name}" exceeds max size (${t} MB)`), !1;
23
+ }
24
+ return !0;
25
+ });
26
+ if (C(n), r.length === 0) return;
27
+ let i = r.map((e) => ({
28
+ name: e.name,
29
+ original_name: e.name,
30
+ size: e.size,
31
+ mime_type: e.type,
32
+ url: URL.createObjectURL(e)
33
+ }));
34
+ t(_ ? [...w, ...i] : i[0]);
35
+ }, [
36
+ w,
37
+ _,
38
+ t,
39
+ y
40
+ ]), E = o((e) => {
41
+ e.preventDefault(), e.stopPropagation(), x(!0);
42
+ }, []), D = o((e) => {
43
+ e.preventDefault(), e.stopPropagation(), x(!1);
44
+ }, []), O = o((e) => {
45
+ e.preventDefault(), e.stopPropagation(), x(!1);
46
+ let t = Array.from(e.dataTransfer.files);
47
+ if (v) {
48
+ let e = v.split(",").map((e) => e.trim().toLowerCase());
49
+ T(t.filter((t) => {
50
+ let n = t.name.split("."), r = n.length > 1 ? "." + n.pop()?.toLowerCase() : "";
51
+ return e.some((e) => e === t.type || r && e === r || e.endsWith("/*") && t.type.startsWith(e.replace("/*", "/")));
52
+ }));
53
+ } else T(t);
54
+ }, [v, T]);
55
+ if (f) return e ? /* @__PURE__ */ (0, p.jsx)("div", {
56
+ className: "flex flex-wrap gap-2",
57
+ children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ (0, p.jsx)("span", {
58
+ className: "text-sm truncate max-w-xs",
59
+ children: e.name || e.original_name || "File"
60
+ }, t))
61
+ }) : /* @__PURE__ */ (0, p.jsx)(u, {});
62
+ let k = (e) => {
63
+ T(Array.from(e.target.files || []));
64
+ }, A = (e) => {
65
+ if (_) {
66
+ let n = w.filter((t, n) => n !== e);
67
+ t(n.length > 0 ? n : null);
68
+ } else t(null);
69
+ }, j = (e) => (e.mime_type || "").startsWith("image/");
70
+ return /* @__PURE__ */ (0, p.jsxs)("div", {
71
+ className: m.className,
72
+ children: [/* @__PURE__ */ (0, p.jsx)("input", {
73
+ ref: h,
74
+ type: "file",
75
+ multiple: _,
76
+ accept: v,
77
+ onChange: k,
78
+ className: "hidden"
79
+ }), /* @__PURE__ */ (0, p.jsxs)("div", {
80
+ className: "space-y-2",
81
+ children: [
82
+ /* @__PURE__ */ (0, p.jsxs)("div", {
83
+ onDragOver: E,
84
+ onDragLeave: D,
85
+ onDrop: O,
86
+ onClick: () => h.current?.click(),
87
+ className: `
88
+ flex flex-col items-center justify-center gap-2 p-6
89
+ border-2 border-dashed rounded-lg cursor-pointer
90
+ transition-colors duration-200
91
+ ${b ? "border-primary bg-primary/5 text-primary" : "border-muted-foreground/25 hover:border-primary/50 text-muted-foreground hover:text-foreground"}
92
+ `,
93
+ role: "button",
94
+ tabIndex: 0,
95
+ onKeyDown: (e) => {
96
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), h.current?.click());
97
+ },
98
+ children: [/* @__PURE__ */ (0, p.jsx)(i, { className: `size-8 ${b ? "text-primary" : "text-muted-foreground"}` }), /* @__PURE__ */ (0, p.jsxs)("div", {
99
+ className: "text-center",
100
+ children: [/* @__PURE__ */ (0, p.jsx)("p", {
101
+ className: "text-sm font-medium",
102
+ children: b ? "Drop files here" : "Drag & drop files here"
103
+ }), /* @__PURE__ */ (0, p.jsx)("p", {
104
+ className: "text-xs text-muted-foreground mt-1",
105
+ children: "or click to browse"
106
+ })]
107
+ })]
108
+ }),
109
+ S.length > 0 && /* @__PURE__ */ (0, p.jsx)("div", {
110
+ className: "space-y-0.5",
111
+ children: S.map((e, t) => /* @__PURE__ */ (0, p.jsx)("p", {
112
+ className: "text-xs text-destructive",
113
+ children: e
114
+ }, t))
115
+ }),
116
+ w.length > 0 && /* @__PURE__ */ (0, p.jsx)("div", {
117
+ className: "space-y-1",
118
+ children: w.map((e, t) => /* @__PURE__ */ (0, p.jsxs)("div", {
119
+ className: "flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",
120
+ children: [/* @__PURE__ */ (0, p.jsxs)("div", {
121
+ className: "flex items-center gap-2 flex-1 min-w-0",
122
+ children: [
123
+ j(e) && e.url ? /* @__PURE__ */ (0, p.jsx)("img", {
124
+ src: e.url,
125
+ alt: e.name,
126
+ className: "size-8 object-cover rounded flex-shrink-0"
127
+ }) : j(e) ? /* @__PURE__ */ (0, p.jsx)(r, { className: "size-4 text-muted-foreground flex-shrink-0" }) : /* @__PURE__ */ (0, p.jsx)(d, { className: "size-4 text-muted-foreground flex-shrink-0" }),
128
+ /* @__PURE__ */ (0, p.jsx)("span", {
129
+ className: "text-sm truncate",
130
+ children: e.name || e.original_name || "File"
131
+ }),
132
+ e.size && /* @__PURE__ */ (0, p.jsxs)("span", {
133
+ className: "text-xs text-muted-foreground",
134
+ children: [
135
+ "(",
136
+ (e.size / 1024).toFixed(1),
137
+ " KB)"
138
+ ]
139
+ })
140
+ ]
141
+ }), /* @__PURE__ */ (0, p.jsx)(l, {
142
+ type: "button",
143
+ variant: "ghost",
144
+ size: "sm",
145
+ onClick: (e) => {
146
+ e.stopPropagation(), A(t);
147
+ },
148
+ className: "h-6 w-6 p-0",
149
+ children: /* @__PURE__ */ (0, p.jsx)(a, { className: "size-3" })
150
+ })]
151
+ }, t))
152
+ })
153
+ ]
154
+ })]
155
+ });
156
+ }
157
+ //#endregion
158
+ export { f as t };
@@ -0,0 +1,17 @@
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import "react";
4
+ import { EmptyValue as n } from "@object-ui/components";
5
+ //#region ../fields/src/widgets/FormulaField.tsx
6
+ var r = /* @__PURE__ */ e({ FormulaField: () => a }), i = t();
7
+ function a({ value: e, field: t, ...r }) {
8
+ let a = (t || r.schema)?.return_type || "text";
9
+ if (e == null) return /* @__PURE__ */ (0, i.jsx)(n, { className: r.className });
10
+ let o;
11
+ return o = a === "number" || a === "currency" ? typeof e == "number" ? e.toFixed(2) : String(e) : a === "boolean" ? e ? "Yes" : "No" : a === "date" ? new Date(e).toLocaleDateString() : String(e), /* @__PURE__ */ (0, i.jsx)("span", {
12
+ className: `text-sm font-mono text-gray-700 ${r.className || ""}`,
13
+ children: o
14
+ });
15
+ }
16
+ //#endregion
17
+ export { r as t };