@object-ui/plugin-detail 3.1.3 → 3.1.4

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 (79) hide show
  1. package/.turbo/turbo-build.log +53 -49
  2. package/CHANGELOG.md +10 -0
  3. package/dist/AddressField-DBkEyMcG.js +93 -0
  4. package/dist/AutoNumberField-Baa191z-.js +14 -0
  5. package/dist/AvatarField-YGj51ozd.js +80 -0
  6. package/dist/BooleanField-CaA898Tk.js +40 -0
  7. package/dist/CodeField-BU51nl1L.js +22 -0
  8. package/dist/ColorField-Cnf6ZM7c.js +37 -0
  9. package/dist/CurrencyField-Wg-XOId2.js +51 -0
  10. package/dist/DateField-Cth1ky_m.js +21 -0
  11. package/dist/DateTimeField-B0m6FhHL.js +32 -0
  12. package/dist/EmailField-Do7qT_L_.js +28 -0
  13. package/dist/FileField-aRJAdbQb.js +151 -0
  14. package/dist/FormulaField-DTMkagFx.js +14 -0
  15. package/dist/GeolocationField-RqpHWTEv.js +113 -0
  16. package/dist/GridField-D4IH0cpo.js +51 -0
  17. package/dist/ImageField-BYCFajjr.js +75 -0
  18. package/dist/LocationField-Bi_ew9sd.js +35 -0
  19. package/dist/LookupField-BjwlDPtt.js +902 -0
  20. package/dist/MasterDetailField-I1A9oEGC.js +94 -0
  21. package/dist/NumberField-D_NucQlp.js +26 -0
  22. package/dist/ObjectField-CG-LaM65.js +52 -0
  23. package/dist/PasswordField-DBtluGJ1.js +35 -0
  24. package/dist/PercentField-B6sO_J3i.js +63 -0
  25. package/dist/PhoneField-CcQAWwR6.js +28 -0
  26. package/dist/QRCodeField-CEjWs-J5.js +72 -0
  27. package/dist/RatingField-B_Mnr63i.js +39 -0
  28. package/dist/RichTextField-qOEJl5Ai.js +32 -0
  29. package/dist/SelectField-C8hWu3gm.js +30 -0
  30. package/dist/SignatureField-CddhEK9u.js +92 -0
  31. package/dist/SliderField-Df5hMzNc.js +34 -0
  32. package/dist/SummaryField-DgiFm-Cr.js +19 -0
  33. package/dist/TextAreaField-DuriTqsD.js +36 -0
  34. package/dist/TextField-CGNSl7RU.js +29 -0
  35. package/dist/TimeField-YO58ctFg.js +21 -0
  36. package/dist/UrlField-1-BMM1jn.js +33 -0
  37. package/dist/UserField-B6GqxP_S.js +78 -0
  38. package/dist/VectorField-BkEjbSt0.js +36 -0
  39. package/dist/index.js +4092 -33
  40. package/dist/index.umd.cjs +85 -76
  41. package/dist/plugin-detail.css +3 -1
  42. package/dist/src-CXr1-vVl.js +77662 -0
  43. package/package.json +9 -9
  44. package/dist/AddressField-BtiTrEpf.js +0 -96
  45. package/dist/AutoNumberField-BxnFqllo.js +0 -8
  46. package/dist/AvatarField-CwlnWNSf.js +0 -82
  47. package/dist/BooleanField-DpMXU2ya.js +0 -37
  48. package/dist/CodeField-gwmcFihg.js +0 -21
  49. package/dist/ColorField-CWmF_zoW.js +0 -42
  50. package/dist/CurrencyField-BF3tYAgm.js +0 -43
  51. package/dist/DateField-a6Ka9ph2.js +0 -21
  52. package/dist/DateTimeField-C4wWOEiw.js +0 -28
  53. package/dist/EmailField-DJqiQ4sp.js +0 -31
  54. package/dist/FileField-ChjjCydz.js +0 -133
  55. package/dist/FormulaField-CJkkwIK8.js +0 -9
  56. package/dist/GeolocationField-BnkeUBek.js +0 -123
  57. package/dist/GridField-DoHqc2ON.js +0 -30
  58. package/dist/ImageField-Ld7SHA8N.js +0 -90
  59. package/dist/LocationField-Bgu-vMAE.js +0 -31
  60. package/dist/MasterDetailField-Bp5WBTzU.js +0 -108
  61. package/dist/NumberField-uBqVZ-gt.js +0 -26
  62. package/dist/ObjectField-BH1Md9gH.js +0 -48
  63. package/dist/PasswordField-D8GZjY7d.js +0 -38
  64. package/dist/PercentField-DyK8vg8M.js +0 -63
  65. package/dist/PhoneField-B3qJyLP0.js +0 -31
  66. package/dist/QRCodeField-CGiRTCZq.js +0 -77
  67. package/dist/RatingField-CWVaJNyf.js +0 -47
  68. package/dist/RichTextField-CusveP9T.js +0 -38
  69. package/dist/SelectField-UdDfsEZo.js +0 -26
  70. package/dist/SignatureField-DFvPKbuI.js +0 -85
  71. package/dist/SliderField-C-HvGV9e.js +0 -30
  72. package/dist/SummaryField-ugYPYxjP.js +0 -9
  73. package/dist/TextAreaField-C5KygUT3.js +0 -39
  74. package/dist/TextField-oUjuqQ1x.js +0 -32
  75. package/dist/TimeField-SsQ6rfk5.js +0 -21
  76. package/dist/UrlField-kd48Ip95.js +0 -33
  77. package/dist/UserField-BOjE_CAz.js +0 -49
  78. package/dist/VectorField-CKg9jdGa.js +0 -25
  79. package/dist/index-D2t9pLAg.js +0 -99948
@@ -1,123 +0,0 @@
1
- import { jsxs as a, jsx as i } from "react/jsx-runtime";
2
- import v from "react";
3
- import { M as g, B as s, o as N, L as h, I as p } from "./index-D2t9pLAg.js";
4
- function F({ value: x, onChange: r, field: y, readonly: o, ...n }) {
5
- const [d, l] = v.useState(!1), t = x || {}, c = (e, m) => {
6
- r({
7
- ...t,
8
- [e]: m ? Number(m) : void 0
9
- });
10
- }, f = () => {
11
- if (!navigator.geolocation) {
12
- console.error("Geolocation is not supported by this browser");
13
- return;
14
- }
15
- l(!0), navigator.geolocation.getCurrentPosition(
16
- (e) => {
17
- r({
18
- latitude: e.coords.latitude,
19
- longitude: e.coords.longitude,
20
- accuracy: e.coords.accuracy
21
- }), l(!1);
22
- },
23
- (e) => {
24
- console.error("Error getting location:", e.message), l(!1);
25
- },
26
- {
27
- enableHighAccuracy: !0,
28
- timeout: 5e3,
29
- maximumAge: 0
30
- }
31
- );
32
- }, b = (e) => !e.latitude || !e.longitude ? "-" : `${e.latitude.toFixed(6)}, ${e.longitude.toFixed(6)}`, u = () => {
33
- if (!t.latitude || !t.longitude) return;
34
- const e = `https://www.google.com/maps?q=${t.latitude},${t.longitude}`;
35
- window.open(e, "_blank");
36
- };
37
- return o ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
38
- /* @__PURE__ */ i(g, { className: "w-4 h-4 text-muted-foreground" }),
39
- /* @__PURE__ */ i("span", { className: "text-sm", children: b(t) }),
40
- t.latitude && t.longitude && /* @__PURE__ */ i(
41
- s,
42
- {
43
- type: "button",
44
- variant: "link",
45
- size: "sm",
46
- onClick: u,
47
- className: "p-0 h-auto",
48
- children: "View on map"
49
- }
50
- )
51
- ] }) : /* @__PURE__ */ a("div", { className: "space-y-3", children: [
52
- /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
53
- /* @__PURE__ */ a(
54
- s,
55
- {
56
- type: "button",
57
- variant: "outline",
58
- size: "sm",
59
- onClick: f,
60
- disabled: o || d,
61
- children: [
62
- /* @__PURE__ */ i(N, { className: "w-4 h-4 mr-2" }),
63
- d ? "Getting location..." : "Use Current Location"
64
- ]
65
- }
66
- ),
67
- t.latitude && t.longitude && /* @__PURE__ */ a(
68
- s,
69
- {
70
- type: "button",
71
- variant: "link",
72
- size: "sm",
73
- onClick: u,
74
- children: [
75
- /* @__PURE__ */ i(g, { className: "w-4 h-4 mr-2" }),
76
- "View on map"
77
- ]
78
- }
79
- )
80
- ] }),
81
- /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-3", children: [
82
- /* @__PURE__ */ a("div", { children: [
83
- /* @__PURE__ */ i(h, { htmlFor: "latitude", className: "text-xs", children: "Latitude" }),
84
- /* @__PURE__ */ i(
85
- p,
86
- {
87
- id: "latitude",
88
- type: "number",
89
- value: t.latitude ?? "",
90
- onChange: (e) => c("latitude", e.target.value),
91
- placeholder: "37.7749",
92
- disabled: o || n.disabled,
93
- step: "any",
94
- className: n.className
95
- }
96
- )
97
- ] }),
98
- /* @__PURE__ */ a("div", { children: [
99
- /* @__PURE__ */ i(h, { htmlFor: "longitude", className: "text-xs", children: "Longitude" }),
100
- /* @__PURE__ */ i(
101
- p,
102
- {
103
- id: "longitude",
104
- type: "number",
105
- value: t.longitude ?? "",
106
- onChange: (e) => c("longitude", e.target.value),
107
- placeholder: "-122.4194",
108
- disabled: o || n.disabled,
109
- step: "any"
110
- }
111
- )
112
- ] })
113
- ] }),
114
- t.accuracy && /* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground", children: [
115
- "Accuracy: ±",
116
- t.accuracy.toFixed(0),
117
- "m"
118
- ] })
119
- ] });
120
- }
121
- export {
122
- F as GeolocationField
123
- };
@@ -1,30 +0,0 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { i as a } from "./index-D2t9pLAg.js";
3
- import "react";
4
- function f({ value: r, field: l, readonly: m, ...s }) {
5
- const i = (l || s.schema)?.columns || [];
6
- return !r || !Array.isArray(r) ? /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "-" }) : m ? /* @__PURE__ */ e("div", { className: a("text-sm", s.className), children: /* @__PURE__ */ t("span", { className: "text-foreground", children: [
7
- r.length,
8
- " rows"
9
- ] }) }) : /* @__PURE__ */ t("div", { className: a("border border-border rounded-lg overflow-hidden", s.className), children: [
10
- /* @__PURE__ */ e("div", { className: "overflow-auto max-h-60", children: /* @__PURE__ */ t("table", { className: "w-full text-sm", children: [
11
- /* @__PURE__ */ e("thead", { className: "bg-muted border-b border-border", children: /* @__PURE__ */ e("tr", { children: i.map((d, n) => /* @__PURE__ */ e(
12
- "th",
13
- {
14
- className: "px-3 py-2 text-left text-xs font-medium text-muted-foreground",
15
- children: d.label || d.name
16
- },
17
- n
18
- )) }) }),
19
- /* @__PURE__ */ e("tbody", { className: "divide-y divide-border", children: r.slice(0, 5).map((d, n) => /* @__PURE__ */ e("tr", { className: "hover:bg-muted/50 transition-colors", children: i.map((o, c) => /* @__PURE__ */ e("td", { className: "px-3 py-2 text-foreground", children: d[o.name] != null ? String(d[o.name]) : "-" }, c)) }, n)) })
20
- ] }) }),
21
- r.length > 5 && /* @__PURE__ */ t("div", { className: "bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border", children: [
22
- "Showing 5 of ",
23
- r.length,
24
- " rows"
25
- ] })
26
- ] });
27
- }
28
- export {
29
- f as GridField
30
- };
@@ -1,90 +0,0 @@
1
- import { jsx as a, jsxs as l } from "react/jsx-runtime";
2
- import { useRef as b } from "react";
3
- import { B as g, X as j, k as z } from "./index-D2t9pLAg.js";
4
- function R({ value: s, onChange: n, field: u, readonly: h, ...d }) {
5
- const p = b(null), m = u || d.schema, o = m?.multiple || !1, f = m?.accept ? m.accept.join(",") : "image/*";
6
- if (h) {
7
- if (!s) return /* @__PURE__ */ a("span", { className: "text-sm", children: "-" });
8
- const r = Array.isArray(s) ? s : [s];
9
- return /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: r.map((e, c) => /* @__PURE__ */ a(
10
- "img",
11
- {
12
- src: e.url || "",
13
- alt: e.name || `Image ${c + 1}`,
14
- className: "size-20 rounded-md object-cover border border-gray-200"
15
- },
16
- c
17
- )) });
18
- }
19
- const i = s ? Array.isArray(s) ? s : [s] : [], y = (r) => {
20
- const e = Array.from(r.target.files || []);
21
- if (e.length === 0) return;
22
- const c = e.map((t) => ({
23
- name: t.name,
24
- original_name: t.name,
25
- size: t.size,
26
- mime_type: t.type,
27
- // In a real implementation, this would upload the image and return a URL
28
- url: URL.createObjectURL(t)
29
- }));
30
- n(o ? [...i, ...c] : c[0]);
31
- }, N = (r) => {
32
- if (o) {
33
- const e = i.filter((c, t) => t !== r);
34
- n(e.length > 0 ? e : null);
35
- } else
36
- n(null);
37
- };
38
- return /* @__PURE__ */ l("div", { className: d.className, children: [
39
- /* @__PURE__ */ a(
40
- "input",
41
- {
42
- ref: p,
43
- type: "file",
44
- multiple: o,
45
- accept: f,
46
- onChange: y,
47
- className: "hidden"
48
- }
49
- ),
50
- /* @__PURE__ */ l("div", { className: "space-y-2", children: [
51
- i.length > 0 && /* @__PURE__ */ a("div", { className: "grid grid-cols-4 gap-2", children: i.map((r, e) => /* @__PURE__ */ l("div", { className: "relative group", children: [
52
- /* @__PURE__ */ a(
53
- "img",
54
- {
55
- src: r.url || "",
56
- alt: r.name || `Image ${e + 1}`,
57
- className: "size-20 rounded-md object-cover border border-gray-200"
58
- }
59
- ),
60
- /* @__PURE__ */ a(
61
- g,
62
- {
63
- type: "button",
64
- variant: "destructive",
65
- size: "sm",
66
- onClick: () => N(e),
67
- className: "absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",
68
- children: /* @__PURE__ */ a(j, { className: "size-3" })
69
- }
70
- )
71
- ] }, e)) }),
72
- /* @__PURE__ */ l(
73
- g,
74
- {
75
- type: "button",
76
- variant: "outline",
77
- onClick: () => p.current?.click(),
78
- className: "w-full",
79
- children: [
80
- /* @__PURE__ */ a(z, { className: "size-4 mr-2" }),
81
- i.length > 0 ? "Add More Images" : "Upload Image"
82
- ]
83
- }
84
- )
85
- ] })
86
- ] });
87
- }
88
- export {
89
- R as ImageField
90
- };
@@ -1,31 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { I as u } from "./index-D2t9pLAg.js";
3
- import "react";
4
- function x({ value: t, onChange: i, field: d, readonly: n, ...a }) {
5
- const m = d || a.schema, s = t && typeof t == "object" ? `${t.latitude || 0}, ${t.longitude || 0}` : "";
6
- return n ? /* @__PURE__ */ r("span", { className: "text-sm", children: s || "-" }) : /* @__PURE__ */ r(
7
- u,
8
- {
9
- type: "text",
10
- value: s,
11
- onChange: (p) => {
12
- const o = p.target.value;
13
- if (!o.trim()) {
14
- i(null);
15
- return;
16
- }
17
- const l = o.split(",").map((e) => e.trim());
18
- if (l.length === 2) {
19
- const e = parseFloat(l[0]), c = parseFloat(l[1]);
20
- !isNaN(e) && !isNaN(c) && i({ latitude: e, longitude: c });
21
- }
22
- },
23
- placeholder: m?.placeholder || "latitude, longitude",
24
- disabled: n || a.disabled,
25
- className: a.className
26
- }
27
- );
28
- }
29
- export {
30
- x as LocationField
31
- };
@@ -1,108 +0,0 @@
1
- import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
- import { B as d, h as c, i as o, j as f, X as g, P as v } from "./index-D2t9pLAg.js";
3
- import "react";
4
- function k({
5
- value: m,
6
- onChange: n,
7
- field: h,
8
- readonly: u,
9
- className: r,
10
- ...l
11
- }) {
12
- const a = m || [], b = h || l.schema, x = () => {
13
- const e = {
14
- id: `new-${Date.now()}`,
15
- label: "New Related Record"
16
- };
17
- n([...a, e]);
18
- }, p = (e) => {
19
- n(a.filter((N) => N.id !== e));
20
- }, i = (e) => {
21
- console.log("View detail:", e);
22
- };
23
- return u ? /* @__PURE__ */ t("div", { className: o("space-y-2", r), children: [
24
- a.length === 0 ? /* @__PURE__ */ s("span", { className: "text-sm text-muted-foreground", children: "No related records" }) : a.map((e) => /* @__PURE__ */ t(
25
- "div",
26
- {
27
- className: "flex items-center justify-between p-2 border rounded hover:bg-muted/50",
28
- children: [
29
- /* @__PURE__ */ s("span", { className: "text-sm", children: e.label }),
30
- /* @__PURE__ */ s(
31
- d,
32
- {
33
- type: "button",
34
- variant: "ghost",
35
- size: "sm",
36
- onClick: () => i(e),
37
- children: /* @__PURE__ */ s(c, { className: "w-4 h-4" })
38
- }
39
- )
40
- ]
41
- },
42
- e.id
43
- )),
44
- /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: [
45
- a.length,
46
- " ",
47
- a.length === 1 ? "record" : "records"
48
- ] })
49
- ] }) : /* @__PURE__ */ t("div", { className: o("space-y-3", r), children: [
50
- /* @__PURE__ */ t("div", { className: "space-y-2", children: [
51
- a.map((e) => /* @__PURE__ */ t(
52
- "div",
53
- {
54
- className: "flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",
55
- children: [
56
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2 flex-1", children: [
57
- /* @__PURE__ */ s(f, { variant: "outline", children: e.id }),
58
- /* @__PURE__ */ s("span", { className: "text-sm flex-1", children: e.label })
59
- ] }),
60
- /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
61
- /* @__PURE__ */ s(
62
- d,
63
- {
64
- type: "button",
65
- variant: "ghost",
66
- size: "sm",
67
- onClick: () => i(e),
68
- children: /* @__PURE__ */ s(c, { className: "w-4 h-4" })
69
- }
70
- ),
71
- /* @__PURE__ */ s(
72
- d,
73
- {
74
- type: "button",
75
- variant: "ghost",
76
- size: "sm",
77
- onClick: () => p(e.id),
78
- disabled: l.disabled,
79
- children: /* @__PURE__ */ s(g, { className: "w-4 h-4" })
80
- }
81
- )
82
- ] })
83
- ]
84
- },
85
- e.id
86
- )),
87
- a.length === 0 && /* @__PURE__ */ s("div", { className: "text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20", children: "No related records" })
88
- ] }),
89
- /* @__PURE__ */ t(
90
- d,
91
- {
92
- type: "button",
93
- variant: "outline",
94
- className: "w-full",
95
- onClick: x,
96
- disabled: l.disabled,
97
- children: [
98
- /* @__PURE__ */ s(v, { className: "w-4 h-4 mr-2" }),
99
- "Add ",
100
- b?.label || "Record"
101
- ]
102
- }
103
- )
104
- ] });
105
- }
106
- export {
107
- k as MasterDetailField
108
- };
@@ -1,26 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { I as c } from "./index-D2t9pLAg.js";
3
- import "react";
4
- function f({ value: e, onChange: p, field: l, readonly: t, ...n }) {
5
- if (t)
6
- return /* @__PURE__ */ a("span", { className: "text-sm", children: e ?? "-" });
7
- const r = l || n.schema, o = r?.precision, { inputType: u, ...s } = n;
8
- return /* @__PURE__ */ a(
9
- c,
10
- {
11
- ...s,
12
- type: "number",
13
- value: e ?? "",
14
- onChange: (m) => {
15
- const i = m.target.value;
16
- p(i === "" ? null : Number(i));
17
- },
18
- placeholder: r?.placeholder,
19
- disabled: t || s.disabled,
20
- step: o ? Math.pow(10, -o) : "any"
21
- }
22
- );
23
- }
24
- export {
25
- f as NumberField
26
- };
@@ -1,48 +0,0 @@
1
- import { jsx as s, jsxs as x } from "react/jsx-runtime";
2
- import { useState as g, useEffect as S } from "react";
3
- import { i as m, T as y } from "./index-D2t9pLAg.js";
4
- function j({ value: r, onChange: c, field: u, readonly: o, ...t }) {
5
- const N = u || t.schema, h = () => r == null ? "" : JSON.stringify(r, null, 2), [e, n] = g(h), [i, d] = g(null);
6
- return S(() => {
7
- try {
8
- if (r == null) {
9
- n("");
10
- return;
11
- }
12
- const l = e ? JSON.parse(e) : null;
13
- JSON.stringify(l) !== JSON.stringify(r) && n(JSON.stringify(r, null, 2));
14
- } catch {
15
- n(JSON.stringify(r, null, 2));
16
- }
17
- }, [r, e]), o ? r ? /* @__PURE__ */ s("pre", { className: m("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", t.className), children: JSON.stringify(r, null, 2) }) : /* @__PURE__ */ s("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ x("div", { className: "space-y-1", children: [
18
- /* @__PURE__ */ s(
19
- y,
20
- {
21
- value: e,
22
- onChange: (l) => {
23
- const a = l.target.value;
24
- if (n(a), d(null), !a.trim()) {
25
- c(null);
26
- return;
27
- }
28
- try {
29
- const f = JSON.parse(a);
30
- c(f);
31
- } catch {
32
- d("Invalid JSON");
33
- }
34
- },
35
- placeholder: N?.placeholder || `{
36
- "key": "value"
37
- }`,
38
- disabled: o || t.disabled,
39
- className: m("font-mono text-xs", i ? "border-red-500 focus-visible:ring-red-500" : "", t.className),
40
- rows: 6
41
- }
42
- ),
43
- i && /* @__PURE__ */ s("p", { className: "text-xs text-red-500", children: i })
44
- ] });
45
- }
46
- export {
47
- j as ObjectField
48
- };
@@ -1,38 +0,0 @@
1
- import { jsx as s, jsxs as m } from "react/jsx-runtime";
2
- import { useState as h } from "react";
3
- import { I as u, B as f, E as g, g as x } from "./index-D2t9pLAg.js";
4
- function N({ value: o, onChange: l, field: n, readonly: a, className: i, ...t }) {
5
- const [e, c] = h(!1), p = n || t.schema;
6
- if (a)
7
- return /* @__PURE__ */ s("span", { className: "text-sm", children: "••••••••" });
8
- const { inputType: y, ...r } = t;
9
- return /* @__PURE__ */ m("div", { className: "relative", children: [
10
- /* @__PURE__ */ s(
11
- u,
12
- {
13
- ...r,
14
- type: e ? "text" : "password",
15
- value: o || "",
16
- onChange: (d) => l(d.target.value),
17
- placeholder: p?.placeholder,
18
- disabled: a || r.disabled,
19
- className: `pr-10 ${i || ""}`
20
- }
21
- ),
22
- /* @__PURE__ */ s(
23
- f,
24
- {
25
- type: "button",
26
- variant: "ghost",
27
- size: "sm",
28
- className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
29
- onClick: () => c(!e),
30
- tabIndex: -1,
31
- children: e ? /* @__PURE__ */ s(g, { className: "size-4 text-gray-500" }) : /* @__PURE__ */ s(x, { className: "size-4 text-gray-500" })
32
- }
33
- )
34
- ] });
35
- }
36
- export {
37
- N as PasswordField
38
- };
@@ -1,63 +0,0 @@
1
- import { jsx as i, jsxs as d } from "react/jsx-runtime";
2
- import { I as g, f as y } from "./index-D2t9pLAg.js";
3
- import "react";
4
- function S({ value: e, onChange: s, field: o, readonly: n, errorMessage: u, className: p, ...a }) {
5
- const m = o || a.schema, r = m?.precision ?? 2;
6
- if (n)
7
- return e == null ? /* @__PURE__ */ i("span", { className: "text-sm", children: "-" }) : /* @__PURE__ */ d("span", { className: "text-sm font-medium tabular-nums", children: [
8
- (e * 100).toFixed(r),
9
- "%"
10
- ] });
11
- const h = e != null ? e * 100 : "", f = e != null ? e * 100 : 0, x = (t) => {
12
- if (t.target.value === "") {
13
- s(null);
14
- return;
15
- }
16
- const l = parseFloat(t.target.value), c = isNaN(l) ? null : l / 100;
17
- s(c);
18
- }, b = (t) => {
19
- if (n || a.disabled) return;
20
- if (!Array.isArray(t) || t.length === 0) {
21
- s(null);
22
- return;
23
- }
24
- const l = t[0], c = typeof l == "number" ? l / 100 : null;
25
- s(c);
26
- }, N = Math.pow(10, -r);
27
- return /* @__PURE__ */ d("div", { className: "space-y-2", children: [
28
- /* @__PURE__ */ d("div", { className: "relative", children: [
29
- /* @__PURE__ */ i(
30
- g,
31
- {
32
- ...a,
33
- type: "number",
34
- value: h,
35
- onChange: x,
36
- placeholder: m?.placeholder || "0",
37
- disabled: n || a.disabled,
38
- className: `pr-8 ${p || ""}`,
39
- step: Math.pow(10, -r).toFixed(r),
40
- "aria-invalid": !!u
41
- }
42
- ),
43
- /* @__PURE__ */ i("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500", children: "%" })
44
- ] }),
45
- /* @__PURE__ */ i(
46
- y,
47
- {
48
- value: [f],
49
- onValueChange: b,
50
- min: 0,
51
- max: 100,
52
- step: N,
53
- disabled: n || a.disabled,
54
- className: "w-full",
55
- "aria-label": "Percentage",
56
- "data-testid": "percent-slider"
57
- }
58
- )
59
- ] });
60
- }
61
- export {
62
- S as PercentField
63
- };
@@ -1,31 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { I as d } from "./index-D2t9pLAg.js";
3
- import "react";
4
- function f({ value: e, onChange: o, field: a, readonly: r, errorMessage: l, ...n }) {
5
- const s = a || n.schema;
6
- if (r)
7
- return e ? /* @__PURE__ */ t(
8
- "a",
9
- {
10
- href: `tel:${e}`,
11
- className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
12
- children: e
13
- }
14
- ) : /* @__PURE__ */ t("span", { className: "text-sm", children: "-" });
15
- const { inputType: m, ...i } = n;
16
- return /* @__PURE__ */ t(
17
- d,
18
- {
19
- ...i,
20
- type: "tel",
21
- value: e || "",
22
- onChange: (c) => o(c.target.value),
23
- placeholder: s?.placeholder || "(555) 123-4567",
24
- disabled: r || i.disabled,
25
- "aria-invalid": !!l
26
- }
27
- );
28
- }
29
- export {
30
- f as PhoneField
31
- };
@@ -1,77 +0,0 @@
1
- import { jsxs as s, jsx as t, Fragment as x } from "react/jsx-runtime";
2
- import g from "react";
3
- import { B as n, Q as d, I as u, q as N } from "./index-D2t9pLAg.js";
4
- function b({ value: e, onChange: l, field: m, readonly: i, ...r }) {
5
- const [a, o] = g.useState(!1), h = m || r.schema, p = (c) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(c)}`, f = () => {
6
- e && navigator.clipboard.writeText(e);
7
- };
8
- return i ? /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
9
- /* @__PURE__ */ t("span", { className: "text-sm flex-1 truncate", children: e || "-" }),
10
- e && /* @__PURE__ */ s(
11
- n,
12
- {
13
- type: "button",
14
- variant: "outline",
15
- size: "sm",
16
- onClick: () => o(!a),
17
- children: [
18
- /* @__PURE__ */ t(d, { className: "w-4 h-4 mr-2" }),
19
- a ? "Hide" : "Show",
20
- " QR"
21
- ]
22
- }
23
- )
24
- ] }) : /* @__PURE__ */ s("div", { className: "space-y-3", children: [
25
- /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
26
- /* @__PURE__ */ t(
27
- u,
28
- {
29
- type: "text",
30
- value: e || "",
31
- onChange: (c) => l(c.target.value),
32
- placeholder: h?.placeholder || "Enter text for QR code",
33
- disabled: i || r.disabled,
34
- className: r.className
35
- }
36
- ),
37
- e && /* @__PURE__ */ s(x, { children: [
38
- /* @__PURE__ */ t(
39
- n,
40
- {
41
- type: "button",
42
- variant: "outline",
43
- size: "sm",
44
- onClick: f,
45
- children: /* @__PURE__ */ t(N, { className: "w-4 h-4" })
46
- }
47
- ),
48
- /* @__PURE__ */ t(
49
- n,
50
- {
51
- type: "button",
52
- variant: "outline",
53
- size: "sm",
54
- onClick: () => o(!a),
55
- children: /* @__PURE__ */ t(d, { className: "w-4 h-4" })
56
- }
57
- )
58
- ] })
59
- ] }),
60
- a && e && /* @__PURE__ */ t("div", { className: "border rounded p-4 bg-white flex justify-center", children: /* @__PURE__ */ t(
61
- "img",
62
- {
63
- src: p(e),
64
- alt: "QR Code",
65
- className: "w-48 h-48"
66
- }
67
- ) }),
68
- e && /* @__PURE__ */ s("p", { className: "text-xs text-muted-foreground", children: [
69
- "QR code contains: ",
70
- e.length,
71
- " characters"
72
- ] })
73
- ] });
74
- }
75
- export {
76
- b as QRCodeField
77
- };