dynamic-mui 2.5.3 → 2.6.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 (252) hide show
  1. package/dist/accordion-BSh2h2a_.js +1 -0
  2. package/dist/accordion-Cqu-4mCj.mjs +22 -0
  3. package/dist/addressfield-BYisUY6y.mjs +242 -0
  4. package/dist/addressfield-CRd4lfdV.js +1 -0
  5. package/dist/ai/index.cjs +1 -1
  6. package/dist/ai/index.mjs +1 -14
  7. package/dist/ai/react/AIForm.d.ts +2 -1
  8. package/dist/ai/react/AIFormGenerator.d.ts +1 -1
  9. package/dist/ai/react/AISchemaReview.d.ts +1 -1
  10. package/dist/ai/react/AITextAssist.d.ts +1 -1
  11. package/dist/ai/react/AIVisionImport.d.ts +2 -1
  12. package/dist/ai-CXI0Rnu8.js +29 -0
  13. package/dist/ai-D6hkfd_f.mjs +4533 -0
  14. package/dist/asyncautocomplete-B1fK0nUW.js +1 -0
  15. package/dist/asyncautocomplete-D4oCW2B0.mjs +72 -0
  16. package/dist/bar-CgYZxXHl.js +1 -0
  17. package/dist/bar-LVtZP6Ui.mjs +4 -0
  18. package/dist/cascadeselect-CYzYzmqv.js +1 -0
  19. package/dist/cascadeselect-s-LY4P0l.mjs +66 -0
  20. package/dist/chartControl-IQafKpDk.mjs +29 -0
  21. package/dist/chartControl-ifHiG3nr.js +1 -0
  22. package/dist/collection-Ccj0OayP.js +1 -0
  23. package/dist/collection-DGq2rxDx.mjs +1692 -0
  24. package/dist/colorpicker-TDpxW59g.mjs +110 -0
  25. package/dist/colorpicker-q2FYP06A.js +1 -0
  26. package/dist/components/DynamicComponent.d.ts +2 -1
  27. package/dist/components/FormGenerator.d.ts +1 -1
  28. package/dist/components/charts/Bar/bar.d.ts +6 -2
  29. package/dist/components/charts/Line/line.d.ts +6 -2
  30. package/dist/components/charts/Mixchart/mixChart.d.ts +2 -1
  31. package/dist/components/charts/Pie/pie.d.ts +6 -2
  32. package/dist/components/charts/chartControl.d.ts +15 -0
  33. package/dist/components/controls/Accordion/accordion.d.ts +2 -1
  34. package/dist/components/controls/AddressField/addressfield.d.ts +2 -1
  35. package/dist/components/controls/Alert/alert.d.ts +1 -1
  36. package/dist/components/controls/AsyncAutocomplete/asyncautocomplete.d.ts +1 -1
  37. package/dist/components/controls/Autocomplete/autocomplete.d.ts +1 -1
  38. package/dist/components/controls/Button/button.d.ts +1 -1
  39. package/dist/components/controls/CascadeSelect/cascadeselect.d.ts +2 -1
  40. package/dist/components/controls/CheckBox/checkbox.d.ts +2 -2
  41. package/dist/components/controls/CheckBox/toggleInput.d.ts +25 -0
  42. package/dist/components/controls/Chip/chip.d.ts +1 -1
  43. package/dist/components/controls/ChipSelect/chipselect.d.ts +2 -1
  44. package/dist/components/controls/Collection/CollectionList.d.ts +1 -1
  45. package/dist/components/controls/Collection/ItemDialog.d.ts +1 -1
  46. package/dist/components/controls/Collection/collection.d.ts +1 -1
  47. package/dist/components/controls/Collection/parts.d.ts +6 -6
  48. package/dist/components/controls/ColorPicker/colorpicker.d.ts +2 -1
  49. package/dist/components/controls/Computed/computed.d.ts +1 -1
  50. package/dist/components/controls/ConsentField/consentfield.d.ts +2 -1
  51. package/dist/components/controls/CurrencyField/currencyfield.d.ts +1 -1
  52. package/dist/components/controls/DataTable/datatable.d.ts +2 -1
  53. package/dist/components/controls/DateRangePicker/daterangepicker.d.ts +1 -1
  54. package/dist/components/controls/DateTime/datetime.d.ts +15 -1
  55. package/dist/components/controls/DateTimePicker/datetimepicker.d.ts +6 -2
  56. package/dist/components/controls/Divider/divider.d.ts +1 -1
  57. package/dist/components/controls/EditableTable/editabletable.d.ts +1 -1
  58. package/dist/components/controls/FileUpload/fileupload.d.ts +1 -1
  59. package/dist/components/controls/FormRepeater/formrepeater.d.ts +1 -1
  60. package/dist/components/controls/FormWizard/formwizard.d.ts +1 -1
  61. package/dist/components/controls/GeoField/geofield.d.ts +1 -1
  62. package/dist/components/controls/Group/group.d.ts +2 -1
  63. package/dist/components/controls/Hyperlink/hyperlink.d.ts +1 -1
  64. package/dist/components/controls/ImageList/imagelist.d.ts +1 -1
  65. package/dist/components/controls/IntlPhone/intlphone.d.ts +2 -1
  66. package/dist/components/controls/KeyValueField/keyvaluefield.d.ts +2 -1
  67. package/dist/components/controls/LineItemList/lineitemlist.d.ts +1 -1
  68. package/dist/components/controls/List/list.d.ts +1 -1
  69. package/dist/components/controls/LocationField/locationfield.d.ts +1 -1
  70. package/dist/components/controls/MarkdownEditor/markdowneditor.d.ts +2 -1
  71. package/dist/components/controls/MatrixField/matrixfield.d.ts +2 -1
  72. package/dist/components/controls/MultiTextbox/multitextbox.d.ts +1 -1
  73. package/dist/components/controls/NpsScale/npsscale.d.ts +2 -1
  74. package/dist/components/controls/NumberField/numberfield.d.ts +2 -1
  75. package/dist/components/controls/NumberStepper/numberstepper.d.ts +1 -1
  76. package/dist/components/controls/OtpField/otpfield.d.ts +2 -1
  77. package/dist/components/controls/PasswordField/passwordfield.d.ts +2 -1
  78. package/dist/components/controls/PhoneField/phonefield.d.ts +1 -1
  79. package/dist/components/controls/Radio/radio.d.ts +2 -1
  80. package/dist/components/controls/Rating/rating.d.ts +2 -1
  81. package/dist/components/controls/RichTextEditor/richtexteditor.d.ts +2 -1
  82. package/dist/components/controls/Select/select.d.ts +2 -1
  83. package/dist/components/controls/Signature/signature.d.ts +1 -1
  84. package/dist/components/controls/Slider/slider.d.ts +1 -1
  85. package/dist/components/controls/Stepper/stepper.d.ts +1 -1
  86. package/dist/components/controls/SummaryField/summaryfield.d.ts +2 -1
  87. package/dist/components/controls/Switch/switch.d.ts +1 -1
  88. package/dist/components/controls/Tabs/tabs.d.ts +2 -1
  89. package/dist/components/controls/TagsInput/tagsinput.d.ts +1 -1
  90. package/dist/components/controls/TextField/textfield.d.ts +1 -1
  91. package/dist/components/controls/TextField/useTextInput.d.ts +18 -0
  92. package/dist/components/controls/TimePicker/timepicker.d.ts +6 -2
  93. package/dist/components/controls/ToggleButtons/togglebuttons.d.ts +1 -1
  94. package/dist/components/controls/Typography/typography.d.ts +1 -1
  95. package/dist/components/controls/index.d.ts +24 -9
  96. package/dist/consentfield-C0qlg4CV.js +1 -0
  97. package/dist/consentfield-D3eHFCZf.mjs +68 -0
  98. package/dist/datatable-CMjaTDPM.js +1 -0
  99. package/dist/datatable-lZIwHx6a.mjs +29 -0
  100. package/dist/dynamic-mui.cjs +1 -1
  101. package/dist/dynamic-mui.d.ts +1 -1
  102. package/dist/dynamic-mui.mjs +264 -204
  103. package/dist/editabletable-B3Cl38Qm.js +1 -0
  104. package/dist/editabletable-BEnZM9qt.mjs +117 -0
  105. package/dist/fileupload-BLH0wrc2.mjs +191 -0
  106. package/dist/fileupload-D0TsC9DF.js +1 -0
  107. package/dist/formrepeater-BEFYw5ly.js +1 -0
  108. package/dist/formrepeater-BvW1lZ2k.mjs +82 -0
  109. package/dist/formwizard-BWdnCsJz.js +1 -0
  110. package/dist/formwizard-I6M99opg.mjs +82 -0
  111. package/dist/geofield-CcbP9EtG.mjs +116 -0
  112. package/dist/geofield-HXXeV9Bm.js +1 -0
  113. package/dist/group-BCGjUNL2.mjs +30 -0
  114. package/dist/group-saCPFLuL.js +1 -0
  115. package/dist/imagelist-CNe1Dp_M.mjs +23 -0
  116. package/dist/imagelist-Wm5Qa6wA.js +1 -0
  117. package/dist/index.d.ts +1 -0
  118. package/dist/intlphone-Bj5nEUMa.mjs +341 -0
  119. package/dist/intlphone-D1V7m6MV.js +1 -0
  120. package/dist/keyvaluefield-ArJ4QM5z.js +1 -0
  121. package/dist/keyvaluefield-C-a0MGDM.mjs +128 -0
  122. package/dist/line-BGSi1tvf.js +1 -0
  123. package/dist/line-cK6taoCA.mjs +4 -0
  124. package/dist/lineitemlist-bmk7fEf9.mjs +169 -0
  125. package/dist/lineitemlist-mulPt3cO.js +1 -0
  126. package/dist/list-5wGZK7wa.js +1 -0
  127. package/dist/list-CIFEhaTq.mjs +20 -0
  128. package/dist/locationfield-DtWkxnX-.js +1 -0
  129. package/dist/locationfield-SPonkbMU.mjs +90 -0
  130. package/dist/markdowneditor-C0KQgAWY.js +2 -0
  131. package/dist/markdowneditor-C3l0_zuX.mjs +82 -0
  132. package/dist/matrixfield-BZ_3KcSk.js +1 -0
  133. package/dist/matrixfield-DQHet7LH.mjs +119 -0
  134. package/dist/mixChart-CSq7pQqJ.mjs +49 -0
  135. package/dist/mixChart-DoehYa8V.js +1 -0
  136. package/dist/muiX-BHOKpogF.mjs +12 -0
  137. package/dist/muiX-CG_D1XQ2.js +1 -0
  138. package/dist/multitextbox-Bsr8mHo5.mjs +96 -0
  139. package/dist/multitextbox-CkhPGI9i.js +1 -0
  140. package/dist/npsscale-BgU-fVZ4.mjs +111 -0
  141. package/dist/npsscale-CFtQ5Dkk.js +1 -0
  142. package/dist/numberstepper-B4ZS7GY_.js +1 -0
  143. package/dist/numberstepper-c0raw-fV.mjs +111 -0
  144. package/dist/pie-CueMspFX.js +1 -0
  145. package/dist/pie-DFO89j-z.mjs +4 -0
  146. package/dist/richtexteditor-B8NFysnM.js +1 -0
  147. package/dist/richtexteditor-aF2uky8O.mjs +178 -0
  148. package/dist/rolldown-runtime-5iZMYShA.js +1 -0
  149. package/dist/s3Upload-C3-wcrua.js +1 -0
  150. package/dist/s3Upload-HtE088XA.mjs +39 -0
  151. package/dist/signature-DjYfiNzq.js +3 -0
  152. package/dist/signature-HiL8FJ6C.mjs +1116 -0
  153. package/dist/stepper-BQB-Zpl2.js +1 -0
  154. package/dist/stepper-C8VaX9xu.mjs +166 -0
  155. package/dist/summaryfield-BN-NhzA6.mjs +65 -0
  156. package/dist/summaryfield-BqpfzvHe.js +1 -0
  157. package/dist/tabs-BBBpbfqk.js +1 -0
  158. package/dist/tabs-DvIbQ1qg.mjs +50 -0
  159. package/dist/tagsinput-CXmsu8K9.mjs +49 -0
  160. package/dist/tagsinput-CYoOBbY1.js +1 -0
  161. package/dist/useSyncedState-CzAO4D1o.mjs +17 -0
  162. package/dist/useSyncedState-DYNKkpDv.js +1 -0
  163. package/dist/useTextInput-Cm0_Ps2V.js +1 -0
  164. package/dist/useTextInput-Dr-ncTE8.mjs +1683 -0
  165. package/dist/useUpdateEffect-CNBo9hj8.js +1 -0
  166. package/dist/useUpdateEffect-CXAhttj7.mjs +14 -0
  167. package/dist/util/helper.d.ts +18 -1
  168. package/dist/util/muiVersion.d.ts +13 -0
  169. package/dist/util/stepperComponents.d.ts +1 -1
  170. package/dist/util/useSyncedState.d.ts +22 -0
  171. package/dist/util/validation.d.ts +40 -0
  172. package/dist/v4-Dyp-SQ1c.js +1 -0
  173. package/dist/v4-YCkfo8OR.mjs +27 -0
  174. package/dist/validation-B7DPZ218.js +7 -0
  175. package/dist/validation-BRcYhhsT.mjs +4991 -0
  176. package/package.json +35 -35
  177. package/dist/AIForm-D204ogdw.js +0 -44
  178. package/dist/AIForm-IafSvW2_.mjs +0 -12281
  179. package/dist/accordion-DA8VpkJ_.mjs +0 -23
  180. package/dist/accordion-yIxiSIl4.js +0 -1
  181. package/dist/addressfield-DCzPapIx.mjs +0 -164
  182. package/dist/addressfield-EFiWgeWB.js +0 -1
  183. package/dist/asyncautocomplete-5-8SXotM.mjs +0 -92
  184. package/dist/asyncautocomplete-BmHm-S4u.js +0 -1
  185. package/dist/bar-BvwjqB4v.mjs +0 -21
  186. package/dist/bar-DRjoPCtv.js +0 -1
  187. package/dist/cascadeselect-BEaoupK6.js +0 -1
  188. package/dist/cascadeselect-CzSf78Pg.mjs +0 -66
  189. package/dist/collection-CthMZ0Go.js +0 -1
  190. package/dist/collection-n9eBOioi.mjs +0 -1157
  191. package/dist/colorpicker-Bm9M38_c.mjs +0 -111
  192. package/dist/colorpicker-DHkdM8Q2.js +0 -1
  193. package/dist/consentfield-B2-UFm5n.mjs +0 -80
  194. package/dist/consentfield-DV8Gz0k9.js +0 -1
  195. package/dist/datatable-BVZFBd-8.mjs +0 -21
  196. package/dist/datatable-DnnyVWJm.js +0 -1
  197. package/dist/editabletable-B_JS4UZ9.js +0 -1
  198. package/dist/editabletable-BwvIvAt7.mjs +0 -128
  199. package/dist/fileupload-BHT7K0YT.mjs +0 -185
  200. package/dist/fileupload-CugVG3o3.js +0 -1
  201. package/dist/formrepeater-CaJMPo3Q.mjs +0 -75
  202. package/dist/formrepeater-DiKPaOfi.js +0 -1
  203. package/dist/formwizard-BzvdbvBY.js +0 -1
  204. package/dist/formwizard-C9fOIHQv.mjs +0 -83
  205. package/dist/geofield-BM4b5Zwx.js +0 -1
  206. package/dist/geofield-DYXx9K9o.mjs +0 -108
  207. package/dist/group-D5fMqJTx.mjs +0 -23
  208. package/dist/group-mwS8FSGJ.js +0 -1
  209. package/dist/imagelist-Bn9QhIv7.js +0 -1
  210. package/dist/imagelist-rqmJajHt.mjs +0 -18
  211. package/dist/intlphone-BQYytFWy.js +0 -1
  212. package/dist/intlphone-DHDwdBbm.mjs +0 -144
  213. package/dist/keyvaluefield-DM0eSfPF.mjs +0 -127
  214. package/dist/keyvaluefield-DXyuqDba.js +0 -1
  215. package/dist/line-Dst2QjuI.mjs +0 -21
  216. package/dist/line-hM3OgPH7.js +0 -1
  217. package/dist/lineitemlist-89hrdS0p.mjs +0 -170
  218. package/dist/lineitemlist-DfEjbNCH.js +0 -1
  219. package/dist/list-B8S2MrOx.js +0 -1
  220. package/dist/list-C97cCc78.mjs +0 -20
  221. package/dist/locationfield-BEMe22_x.mjs +0 -118
  222. package/dist/locationfield-DlgLvvdU.js +0 -1
  223. package/dist/markdowneditor-JoiWE-qO.js +0 -2
  224. package/dist/markdowneditor-K4TAKJ3s.mjs +0 -94
  225. package/dist/matrixfield-D4sHu6rU.mjs +0 -121
  226. package/dist/matrixfield-szah6uOP.js +0 -1
  227. package/dist/mixChart-Doq4lt7Z.mjs +0 -75
  228. package/dist/mixChart-rgyMCdnp.js +0 -1
  229. package/dist/multitextbox-CBChuyw9.js +0 -1
  230. package/dist/multitextbox-Cnrwie5U.mjs +0 -78
  231. package/dist/npsscale-Cc2eD9Nk.js +0 -1
  232. package/dist/npsscale-DgQPa1eH.mjs +0 -91
  233. package/dist/numberstepper-BcuSZHwZ.js +0 -1
  234. package/dist/numberstepper-BqINnIm7.mjs +0 -132
  235. package/dist/pie-B6dXjc4o.mjs +0 -21
  236. package/dist/pie-a_dhmBUq.js +0 -1
  237. package/dist/richtexteditor-Bs5-VQj3.js +0 -1
  238. package/dist/richtexteditor-CveBdsmJ.mjs +0 -143
  239. package/dist/s3Upload-B0JeoLkS.js +0 -1
  240. package/dist/s3Upload-dpioZ2c8.mjs +0 -51
  241. package/dist/signature-BRWAWqeA.mjs +0 -1227
  242. package/dist/signature-Bj9GDrvy.js +0 -2
  243. package/dist/stepper-B9sSsbQD.js +0 -1
  244. package/dist/stepper-DTMAP67o.mjs +0 -140
  245. package/dist/summaryfield-JKL3ZLl2.js +0 -1
  246. package/dist/summaryfield-xhr0Q4RL.mjs +0 -96
  247. package/dist/tabs-ClkmKlV8.mjs +0 -39
  248. package/dist/tabs-DmEP_QW0.js +0 -1
  249. package/dist/tagsinput-B0yVrYgB.mjs +0 -58
  250. package/dist/tagsinput-COKkxIxg.js +0 -1
  251. package/dist/v4-BysszJq8.mjs +0 -30
  252. package/dist/v4-CqdK_b8Y.js +0 -1
@@ -0,0 +1,191 @@
1
+ import { r as e } from "./validation-BRcYhhsT.mjs";
2
+ import { B as t, W as n } from "./ai-D6hkfd_f.mjs";
3
+ import { n as r } from "./useSyncedState-CzAO4D1o.mjs";
4
+ import { t as i } from "./s3Upload-HtE088XA.mjs";
5
+ import { useRef as a, useState as o } from "react";
6
+ import s from "@mui/material/Typography";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ import u from "@mui/material/Box";
9
+ import d from "@mui/material/IconButton";
10
+ import f from "@mui/material/CircularProgress";
11
+ import p from "@mui/icons-material/CloudUpload";
12
+ import m from "@mui/icons-material/Close";
13
+ import h from "@mui/icons-material/InsertDriveFile";
14
+ // src/components/controls/FileUpload/fileupload.tsx
15
+ var g = (e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : [], _ = (e) => /^data:image\//i.test(e) || /\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(e), v = (e) => new Promise((t, n) => {
16
+ let r = new FileReader();
17
+ r.onload = () => t(r.result || ""), r.onerror = () => n(r.error), r.readAsDataURL(e);
18
+ });
19
+ function y({ attributes: y = {}, rules: b = {}, onChange: x }) {
20
+ let { id: S = "", multiple: C = !1, accept: w = "", bucket: T = "", region: E = "", identityPoolId: D = "", path: O = "", maxSizeMB: k = 0, label: A = "Upload file", MuiAttributes: j = {} } = y, M = a(null), [N, P] = r(() => g(y.value), [y.value]), [F, I] = o(!1), [L, R] = o(!1), [z, B] = o(""), V = e(b), H = (e, t) => {
21
+ x?.({
22
+ id: S,
23
+ value: C ? e : e[0] ?? "",
24
+ option: t
25
+ });
26
+ }, U = async (e) => {
27
+ let t = Array.from(e);
28
+ if (!t.length) return;
29
+ B(""), R(!0);
30
+ let n = [], r = [];
31
+ try {
32
+ for (let e of t) {
33
+ if (k && e.size > k * 1024 * 1024) {
34
+ B(`"${e.name}" exceeds the ${k}MB limit.`);
35
+ continue;
36
+ }
37
+ let t = await v(e), a = await i(t, e.name, T, E, D, O);
38
+ n.push(a), r.push(e);
39
+ }
40
+ } catch (e) {
41
+ console.error("FileUpload failed", e), B("Upload failed. Please try again.");
42
+ } finally {
43
+ R(!1);
44
+ }
45
+ if (!n.length) return;
46
+ let a = C ? [...N, ...n] : n.slice(0, 1);
47
+ P(a), H(a, r);
48
+ }, W = (e) => {
49
+ e.target.files && U(e.target.files), e.target.value = "";
50
+ }, G = (e) => {
51
+ e.preventDefault(), I(!1), e.dataTransfer?.files?.length && U(e.dataTransfer.files);
52
+ }, K = (e) => {
53
+ let t = N.filter((t, n) => n !== e);
54
+ P(t), H(t);
55
+ };
56
+ return /* @__PURE__ */ l(u, {
57
+ sx: {
58
+ width: "100%",
59
+ ...j.sx
60
+ },
61
+ children: [
62
+ /* @__PURE__ */ l(s, {
63
+ variant: "subtitle2",
64
+ gutterBottom: !0,
65
+ sx: { display: "flex" },
66
+ children: [A, V && /* @__PURE__ */ c(u, {
67
+ component: "span",
68
+ sx: {
69
+ color: "error.main",
70
+ ml: .5
71
+ },
72
+ children: "*"
73
+ })]
74
+ }),
75
+ /* @__PURE__ */ c("input", {
76
+ ref: M,
77
+ type: "file",
78
+ hidden: !0,
79
+ multiple: C,
80
+ accept: w || void 0,
81
+ onChange: W
82
+ }),
83
+ /* @__PURE__ */ l(u, {
84
+ role: "button",
85
+ "aria-label": A,
86
+ onClick: () => M.current?.click(),
87
+ onDragOver: (e) => {
88
+ e.preventDefault(), I(!0);
89
+ },
90
+ onDragLeave: () => I(!1),
91
+ onDrop: G,
92
+ sx: {
93
+ border: "2px dashed",
94
+ borderColor: F ? "primary.main" : "divider",
95
+ borderRadius: "12px",
96
+ p: 3,
97
+ textAlign: "center",
98
+ cursor: "pointer",
99
+ transition: "all .2s",
100
+ bgcolor: F ? "action.hover" : "background.paper",
101
+ "&:hover": {
102
+ borderColor: "primary.main",
103
+ bgcolor: "action.hover"
104
+ }
105
+ },
106
+ children: [
107
+ L ? /* @__PURE__ */ c(f, { size: 28 }) : /* @__PURE__ */ c(p, { sx: {
108
+ fontSize: 40,
109
+ color: "primary.main"
110
+ } }),
111
+ /* @__PURE__ */ l(s, {
112
+ variant: "body2",
113
+ sx: { mt: 1 },
114
+ children: [
115
+ "Drag & drop ",
116
+ C ? "files" : "a file",
117
+ " here, or click to browse"
118
+ ]
119
+ }),
120
+ w && /* @__PURE__ */ l(s, {
121
+ variant: "caption",
122
+ sx: { color: "text.secondary" },
123
+ children: ["Accepted: ", w]
124
+ })
125
+ ]
126
+ }),
127
+ z && /* @__PURE__ */ c(s, {
128
+ variant: "caption",
129
+ sx: {
130
+ color: "error.main",
131
+ display: "block",
132
+ mt: 1
133
+ },
134
+ children: z
135
+ }),
136
+ N.length > 0 && /* @__PURE__ */ c(u, {
137
+ sx: t(n, {
138
+ mt: 1.5,
139
+ p: 1
140
+ }),
141
+ children: N.map((e, t) => /* @__PURE__ */ l(u, {
142
+ sx: {
143
+ display: "flex",
144
+ alignItems: "center",
145
+ gap: 1.5,
146
+ p: 1,
147
+ borderRadius: "8px",
148
+ transition: "background-color .18s",
149
+ "&:hover": { bgcolor: "action.hover" }
150
+ },
151
+ children: [
152
+ _(e) ? /* @__PURE__ */ c(u, {
153
+ component: "img",
154
+ src: e,
155
+ alt: `upload-${t}`,
156
+ sx: {
157
+ width: 40,
158
+ height: 40,
159
+ objectFit: "cover",
160
+ borderRadius: "8px",
161
+ flexShrink: 0
162
+ }
163
+ }) : /* @__PURE__ */ c(h, {
164
+ color: "action",
165
+ sx: { flexShrink: 0 }
166
+ }),
167
+ /* @__PURE__ */ c(s, {
168
+ variant: "body2",
169
+ sx: {
170
+ flexGrow: 1,
171
+ overflow: "hidden",
172
+ textOverflow: "ellipsis",
173
+ whiteSpace: "nowrap"
174
+ },
175
+ children: e.split("/").pop()?.split("?")[0] || e
176
+ }),
177
+ /* @__PURE__ */ c(d, {
178
+ size: "small",
179
+ "aria-label": "remove",
180
+ onClick: (e) => {
181
+ e.stopPropagation(), K(t);
182
+ },
183
+ children: /* @__PURE__ */ c(m, { fontSize: "small" })
184
+ })
185
+ ]
186
+ }, `${e}-${t}`))
187
+ })
188
+ ]
189
+ });
190
+ }
191
+ export { y as default };
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-5iZMYShA.js"),t=require("./ai-CXI0Rnu8.js"),n=require("./validation-B7DPZ218.js"),r=require("./useSyncedState-DYNKkpDv.js"),i=require("./s3Upload-C3-wcrua.js");let a=require("react"),o=require("@mui/material/Typography");o=e.n(o);let s=require("react/jsx-runtime"),c=require("@mui/material/Box");c=e.n(c);let l=require("@mui/material/IconButton");l=e.n(l);let u=require("@mui/material/CircularProgress");u=e.n(u);let d=require("@mui/icons-material/CloudUpload");d=e.n(d);let f=require("@mui/icons-material/Close");f=e.n(f);let p=require("@mui/icons-material/InsertDriveFile");p=e.n(p);var m=e=>e?Array.isArray(e)?e.filter(Boolean):[e]:[],h=e=>/^data:image\//i.test(e)||/\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(e),g=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result||``),r.onerror=()=>n(r.error),r.readAsDataURL(e)});function _({attributes:e={},rules:_={},onChange:v}){let{id:y=``,multiple:b=!1,accept:x=``,bucket:S=``,region:C=``,identityPoolId:w=``,path:T=``,maxSizeMB:E=0,label:D=`Upload file`,MuiAttributes:O={}}=e,k=(0,a.useRef)(null),[A,j]=r.n(()=>m(e.value),[e.value]),[M,N]=(0,a.useState)(!1),[P,F]=(0,a.useState)(!1),[I,L]=(0,a.useState)(``),R=n.r(_),z=(e,t)=>{v?.({id:y,value:b?e:e[0]??``,option:t})},B=async e=>{let t=Array.from(e);if(!t.length)return;L(``),F(!0);let n=[],r=[];try{for(let e of t){if(E&&e.size>E*1024*1024){L(`"${e.name}" exceeds the ${E}MB limit.`);continue}let t=await g(e),a=await i.t(t,e.name,S,C,w,T);n.push(a),r.push(e)}}catch(e){console.error(`FileUpload failed`,e),L(`Upload failed. Please try again.`)}finally{F(!1)}if(!n.length)return;let a=b?[...A,...n]:n.slice(0,1);j(a),z(a,r)},V=e=>{e.target.files&&B(e.target.files),e.target.value=``},H=e=>{e.preventDefault(),N(!1),e.dataTransfer?.files?.length&&B(e.dataTransfer.files)},U=e=>{let t=A.filter((t,n)=>n!==e);j(t),z(t)};return(0,s.jsxs)(c.default,{sx:{width:`100%`,...O.sx},children:[(0,s.jsxs)(o.default,{variant:`subtitle2`,gutterBottom:!0,sx:{display:`flex`},children:[D,R&&(0,s.jsx)(c.default,{component:`span`,sx:{color:`error.main`,ml:.5},children:`*`})]}),(0,s.jsx)(`input`,{ref:k,type:`file`,hidden:!0,multiple:b,accept:x||void 0,onChange:V}),(0,s.jsxs)(c.default,{role:`button`,"aria-label":D,onClick:()=>k.current?.click(),onDragOver:e=>{e.preventDefault(),N(!0)},onDragLeave:()=>N(!1),onDrop:H,sx:{border:`2px dashed`,borderColor:M?`primary.main`:`divider`,borderRadius:`12px`,p:3,textAlign:`center`,cursor:`pointer`,transition:`all .2s`,bgcolor:M?`action.hover`:`background.paper`,"&:hover":{borderColor:`primary.main`,bgcolor:`action.hover`}},children:[P?(0,s.jsx)(u.default,{size:28}):(0,s.jsx)(d.default,{sx:{fontSize:40,color:`primary.main`}}),(0,s.jsxs)(o.default,{variant:`body2`,sx:{mt:1},children:[`Drag & drop `,b?`files`:`a file`,` here, or click to browse`]}),x&&(0,s.jsxs)(o.default,{variant:`caption`,sx:{color:`text.secondary`},children:[`Accepted: `,x]})]}),I&&(0,s.jsx)(o.default,{variant:`caption`,sx:{color:`error.main`,display:`block`,mt:1},children:I}),A.length>0&&(0,s.jsx)(c.default,{sx:t.B(t.W,{mt:1.5,p:1}),children:A.map((e,t)=>(0,s.jsxs)(c.default,{sx:{display:`flex`,alignItems:`center`,gap:1.5,p:1,borderRadius:`8px`,transition:`background-color .18s`,"&:hover":{bgcolor:`action.hover`}},children:[h(e)?(0,s.jsx)(c.default,{component:`img`,src:e,alt:`upload-${t}`,sx:{width:40,height:40,objectFit:`cover`,borderRadius:`8px`,flexShrink:0}}):(0,s.jsx)(p.default,{color:`action`,sx:{flexShrink:0}}),(0,s.jsx)(o.default,{variant:`body2`,sx:{flexGrow:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.split(`/`).pop()?.split(`?`)[0]||e}),(0,s.jsx)(l.default,{size:`small`,"aria-label":`remove`,onClick:e=>{e.stopPropagation(),U(t)},children:(0,s.jsx)(f.default,{fontSize:`small`})})]},`${e}-${t}`))})]})}exports.default=_;
@@ -0,0 +1 @@
1
+ const e=require("./ai-CXI0Rnu8.js"),t=require("./v4-Dyp-SQ1c.js"),n=require("./validation-B7DPZ218.js");let r=require("react"),i=require("@mui/material"),a=require("react/jsx-runtime");function o({attributes:o={},rules:s={},onChange:c}){let{id:l=``,label:u=`Group`,min:d=1,max:f,subFields:p=[],value:m}=o,h=n.r(s),g=(0,r.useMemo)(()=>{if(Array.isArray(m)&&m.length>0)return m.length;let e=Number(o.count);return!isNaN(e)&&e>=d?e:d},[]),[_,v]=(0,r.useState)(g),y=(0,r.useRef)([]),b=(0,r.useCallback)(e=>(y.current[e]||(y.current[e]=t.t()),y.current[e]),[]),x=(0,r.useCallback)(t=>{if(!c)return;let n=Array.from({length:t},(t,n)=>{let r=`${l}-group-${b(n)}`;return e.p(r)??{}});c({id:l,value:n})},[l,b,c]),S=e=>{let t=parseInt(e,10);(isNaN(t)||t<d)&&(t=d),f!==void 0&&t>f&&(t=f),v(t),setTimeout(()=>x(t),0)};return(0,a.jsxs)(i.Box,{sx:{width:`100%`},children:[(0,a.jsx)(i.TextField,{type:`number`,size:`small`,label:`Number of ${u}s`,value:_,onChange:e=>S(e.target.value),required:h,sx:{mb:2,minWidth:200},slotProps:{input:{startAdornment:(0,a.jsx)(i.InputAdornment,{position:`start`,children:(0,a.jsx)(i.Icon,{fontSize:`small`,children:`format_list_numbered`})})},htmlInput:{min:d,...f===void 0?{}:{max:f}}}}),Array.from({length:_},(t,n)=>{let r=`${l}-group-${b(n)}`,o=Array.isArray(m)?m[n]:void 0;return(0,a.jsxs)(i.Accordion,{defaultExpanded:n===0,sx:{mb:1},children:[(0,a.jsx)(i.AccordionSummary,{expandIcon:(0,a.jsx)(i.Icon,{children:`expand_more`}),children:(0,a.jsxs)(i.Typography,{sx:{fontWeight:600},children:[u,` `,n+1]})}),(0,a.jsx)(i.AccordionDetails,{children:(0,a.jsx)(e.m,{guid:r,data:p,patch:o??{},onChange:()=>x(_)})})]},r)})]})}exports.default=o;
@@ -0,0 +1,82 @@
1
+ import { r as e } from "./validation-BRcYhhsT.mjs";
2
+ import { m as t, p as n } from "./ai-D6hkfd_f.mjs";
3
+ import { t as r } from "./v4-YCkfo8OR.mjs";
4
+ import { useCallback as i, useMemo as a, useRef as o, useState as s } from "react";
5
+ import { Accordion as c, AccordionDetails as l, AccordionSummary as u, Box as d, Icon as f, InputAdornment as p, TextField as m, Typography as h } from "@mui/material";
6
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
7
+ // src/components/controls/FormRepeater/formrepeater.tsx
8
+ function v({ attributes: v = {}, rules: y = {}, onChange: b }) {
9
+ let { id: x = "", label: S = "Group", min: C = 1, max: w, subFields: T = [], value: E } = v, D = e(y), O = a(() => {
10
+ if (Array.isArray(E) && E.length > 0) return E.length;
11
+ let e = Number(v.count);
12
+ return !isNaN(e) && e >= C ? e : C;
13
+ }, []), [k, A] = s(O), j = o([]), M = i((e) => (j.current[e] || (j.current[e] = r()), j.current[e]), []), N = i((e) => {
14
+ if (!b) return;
15
+ let t = Array.from({ length: e }, (e, t) => {
16
+ let r = `${x}-group-${M(t)}`;
17
+ return n(r) ?? {};
18
+ });
19
+ b({
20
+ id: x,
21
+ value: t
22
+ });
23
+ }, [
24
+ x,
25
+ M,
26
+ b
27
+ ]), P = (e) => {
28
+ let t = parseInt(e, 10);
29
+ (isNaN(t) || t < C) && (t = C), w !== void 0 && t > w && (t = w), A(t), setTimeout(() => N(t), 0);
30
+ };
31
+ return /* @__PURE__ */ _(d, {
32
+ sx: { width: "100%" },
33
+ children: [/* @__PURE__ */ g(m, {
34
+ type: "number",
35
+ size: "small",
36
+ label: `Number of ${S}s`,
37
+ value: k,
38
+ onChange: (e) => P(e.target.value),
39
+ required: D,
40
+ sx: {
41
+ mb: 2,
42
+ minWidth: 200
43
+ },
44
+ slotProps: {
45
+ input: { startAdornment: /* @__PURE__ */ g(p, {
46
+ position: "start",
47
+ children: /* @__PURE__ */ g(f, {
48
+ fontSize: "small",
49
+ children: "format_list_numbered"
50
+ })
51
+ }) },
52
+ htmlInput: {
53
+ min: C,
54
+ ...w === void 0 ? {} : { max: w }
55
+ }
56
+ }
57
+ }), Array.from({ length: k }, (e, n) => {
58
+ let r = `${x}-group-${M(n)}`, i = Array.isArray(E) ? E[n] : void 0;
59
+ return /* @__PURE__ */ _(c, {
60
+ defaultExpanded: n === 0,
61
+ sx: { mb: 1 },
62
+ children: [/* @__PURE__ */ g(u, {
63
+ expandIcon: /* @__PURE__ */ g(f, { children: "expand_more" }),
64
+ children: /* @__PURE__ */ _(h, {
65
+ sx: { fontWeight: 600 },
66
+ children: [
67
+ S,
68
+ " ",
69
+ n + 1
70
+ ]
71
+ })
72
+ }), /* @__PURE__ */ g(l, { children: /* @__PURE__ */ g(t, {
73
+ guid: r,
74
+ data: T,
75
+ patch: i ?? {},
76
+ onChange: () => N(k)
77
+ }) })]
78
+ }, r);
79
+ })]
80
+ });
81
+ }
82
+ export { v as default };
@@ -0,0 +1 @@
1
+ const e=require("./ai-CXI0Rnu8.js"),t=require("./v4-Dyp-SQ1c.js");let n=require("react"),r=require("@mui/material"),i=require("react/jsx-runtime");function a({attributes:a={},onChange:o}){let{id:s=``,guid:c,steps:l=[],patch:u={},finishLabel:d=`Finish`,validateSteps:f=!1,MuiAttributes:p={}}=a,[m,h]=(0,n.useState)(0),g=(0,n.useRef)(null),_=(0,n.useMemo)(()=>c||`${s}-${t.t()}`,[]),v=Array.isArray(l)?l:[],y=Math.max(v.length-1,0),b=m>=y,x=m<=0,S=`${_}-step-${m}`,C=(0,n.useCallback)(()=>{h(e=>Math.max(e-1,0))},[]),w=(0,n.useCallback)(()=>{f&&g.current&&!g.current.validate()||(m>=y?o?.({id:s,value:`complete`,option:m}):h(e=>Math.min(e+1,y)))},[m,y,s,o,f]),T=(t=>({borderRadius:`18px`,textTransform:`none`,fontWeight:600,px:3,transition:`box-shadow .18s ${e.z}, transform .18s ${e.z}`,"&:hover":{transform:`translateY(-1px)`,boxShadow:`0 4px 12px ${t.palette.primary.main}22`}}));return(0,i.jsxs)(r.Box,{sx:{width:`100%`},...p,children:[(0,i.jsx)(r.Stepper,{activeStep:m,alternativeLabel:!0,sx:{mb:3,"& .MuiStepLabel-label":{fontWeight:500},"& .MuiStepIcon-root.Mui-active":{transition:`color .2s ${e.z}`}},children:v.map((e,t)=>(0,i.jsx)(r.Step,{children:(0,i.jsx)(r.StepLabel,{children:e?.label??`Step ${t+1}`})},`${_}-label-${t}`))}),(0,i.jsx)(r.Box,{sx:{mb:3},children:v[m]&&(0,i.jsx)(e.m,{guid:S,data:v[m].fields??[],patch:u,persistOnUnmount:!0,apiRef:g,onChange:e=>{o?.(e)}},S)}),(0,i.jsxs)(r.Box,{sx:{display:`flex`,justifyContent:`space-between`,gap:2},children:[(0,i.jsx)(r.Button,{variant:`outlined`,onClick:C,disabled:x,sx:e.B(T),children:`Back`}),(0,i.jsx)(r.Button,{variant:`contained`,onClick:w,sx:e.B(T),children:b?d:`Next`})]})]})}exports.default=a;
@@ -0,0 +1,82 @@
1
+ import { B as e, m as t, z as n } from "./ai-D6hkfd_f.mjs";
2
+ import { t as r } from "./v4-YCkfo8OR.mjs";
3
+ import { useCallback as i, useMemo as a, useRef as o, useState as s } from "react";
4
+ import { Box as c, Button as l, Step as u, StepLabel as d, Stepper as f } from "@mui/material";
5
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
6
+ // src/components/controls/FormWizard/formwizard.tsx
7
+ function h({ attributes: h = {}, onChange: g }) {
8
+ let { id: _ = "", guid: v, steps: y = [], patch: b = {}, finishLabel: x = "Finish", validateSteps: S = !1, MuiAttributes: C = {} } = h, [w, T] = s(0), E = o(null), D = a(() => v || `${_}-${r()}`, []), O = Array.isArray(y) ? y : [], k = Math.max(O.length - 1, 0), A = w >= k, j = w <= 0, M = `${D}-step-${w}`, N = i(() => {
9
+ T((e) => Math.max(e - 1, 0));
10
+ }, []), P = i(() => {
11
+ S && E.current && !E.current.validate() || (w >= k ? g?.({
12
+ id: _,
13
+ value: "complete",
14
+ option: w
15
+ }) : T((e) => Math.min(e + 1, k)));
16
+ }, [
17
+ w,
18
+ k,
19
+ _,
20
+ g,
21
+ S
22
+ ]), F = ((e) => ({
23
+ borderRadius: "18px",
24
+ textTransform: "none",
25
+ fontWeight: 600,
26
+ px: 3,
27
+ transition: `box-shadow .18s ${n}, transform .18s ${n}`,
28
+ "&:hover": {
29
+ transform: "translateY(-1px)",
30
+ boxShadow: `0 4px 12px ${e.palette.primary.main}22`
31
+ }
32
+ }));
33
+ return /* @__PURE__ */ m(c, {
34
+ sx: { width: "100%" },
35
+ ...C,
36
+ children: [
37
+ /* @__PURE__ */ p(f, {
38
+ activeStep: w,
39
+ alternativeLabel: !0,
40
+ sx: {
41
+ mb: 3,
42
+ "& .MuiStepLabel-label": { fontWeight: 500 },
43
+ "& .MuiStepIcon-root.Mui-active": { transition: `color .2s ${n}` }
44
+ },
45
+ children: O.map((e, t) => /* @__PURE__ */ p(u, { children: /* @__PURE__ */ p(d, { children: e?.label ?? `Step ${t + 1}` }) }, `${D}-label-${t}`))
46
+ }),
47
+ /* @__PURE__ */ p(c, {
48
+ sx: { mb: 3 },
49
+ children: O[w] && /* @__PURE__ */ p(t, {
50
+ guid: M,
51
+ data: O[w].fields ?? [],
52
+ patch: b,
53
+ persistOnUnmount: !0,
54
+ apiRef: E,
55
+ onChange: (e) => {
56
+ g?.(e);
57
+ }
58
+ }, M)
59
+ }),
60
+ /* @__PURE__ */ m(c, {
61
+ sx: {
62
+ display: "flex",
63
+ justifyContent: "space-between",
64
+ gap: 2
65
+ },
66
+ children: [/* @__PURE__ */ p(l, {
67
+ variant: "outlined",
68
+ onClick: N,
69
+ disabled: j,
70
+ sx: e(F),
71
+ children: "Back"
72
+ }), /* @__PURE__ */ p(l, {
73
+ variant: "contained",
74
+ onClick: P,
75
+ sx: e(F),
76
+ children: A ? x : "Next"
77
+ })]
78
+ })
79
+ ]
80
+ });
81
+ }
82
+ export { h as default };
@@ -0,0 +1,116 @@
1
+ import { B as e, U as t, W as n } from "./ai-D6hkfd_f.mjs";
2
+ import { n as r } from "./useSyncedState-CzAO4D1o.mjs";
3
+ import i from "@mui/material/Typography";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import s from "@mui/material/TextField";
6
+ import c from "@mui/material/Box";
7
+ import l from "@mui/material/Link";
8
+ // src/components/controls/GeoField/geofield.tsx
9
+ var u = (e) => {
10
+ if (e && typeof e == "object") return {
11
+ lat: e.lat !== void 0 && e.lat !== null ? String(e.lat) : "",
12
+ lng: e.lng !== void 0 && e.lng !== null ? String(e.lng) : ""
13
+ };
14
+ if (typeof e == "string" && e.includes(",")) {
15
+ let [t = "", n = ""] = e.split(",");
16
+ return {
17
+ lat: t.trim(),
18
+ lng: n.trim()
19
+ };
20
+ }
21
+ return {
22
+ lat: "",
23
+ lng: ""
24
+ };
25
+ };
26
+ function d({ attributes: d = {}, onChange: f }) {
27
+ let { id: p = "", label: m = "", showMap: h = !1, MuiAttributes: g = {} } = d, [_, v] = r(() => u(d.value), [d.value]), y = (e) => {
28
+ f?.({
29
+ id: p,
30
+ value: {
31
+ lat: e.lat,
32
+ lng: e.lng
33
+ },
34
+ option: `${e.lat},${e.lng}`
35
+ });
36
+ }, b = (e) => (t) => {
37
+ let n = {
38
+ ..._,
39
+ [e]: t.target.value
40
+ };
41
+ v(n), y(n);
42
+ }, x = _.lat !== "" && _.lng !== "", S = e(t, g.sx), C = () => {
43
+ let e = parseFloat(_.lat), t = parseFloat(_.lng), n = .01;
44
+ return `https://www.openstreetmap.org/export/embed.html?bbox=${`${t - n},${e - n},${t + n},${e + n}`}&marker=${e},${t}`;
45
+ };
46
+ return /* @__PURE__ */ o(c, {
47
+ id: p,
48
+ children: [
49
+ m ? /* @__PURE__ */ a(i, {
50
+ variant: "body2",
51
+ sx: {
52
+ mb: .75,
53
+ fontWeight: 500
54
+ },
55
+ children: m
56
+ }) : null,
57
+ /* @__PURE__ */ o(c, {
58
+ sx: {
59
+ display: "flex",
60
+ gap: 1.5,
61
+ flexWrap: "wrap"
62
+ },
63
+ children: [/* @__PURE__ */ a(s, {
64
+ type: "number",
65
+ ...g,
66
+ label: "Latitude",
67
+ value: _.lat,
68
+ onChange: b("lat"),
69
+ sx: S,
70
+ slotProps: { htmlInput: {
71
+ "aria-label": "Latitude",
72
+ step: "any"
73
+ } }
74
+ }), /* @__PURE__ */ a(s, {
75
+ type: "number",
76
+ ...g,
77
+ label: "Longitude",
78
+ value: _.lng,
79
+ onChange: b("lng"),
80
+ sx: S,
81
+ slotProps: { htmlInput: {
82
+ "aria-label": "Longitude",
83
+ step: "any"
84
+ } }
85
+ })]
86
+ }),
87
+ /* @__PURE__ */ a(c, {
88
+ sx: { mt: 1 },
89
+ children: /* @__PURE__ */ a(l, {
90
+ href: `https://www.google.com/maps?q=${_.lat},${_.lng}`,
91
+ target: "_blank",
92
+ rel: "noreferrer",
93
+ variant: "body2",
94
+ children: "Open in Maps"
95
+ })
96
+ }),
97
+ h && x ? /* @__PURE__ */ a(c, {
98
+ sx: e((e) => ({
99
+ ...n(e),
100
+ mt: 1.5
101
+ })),
102
+ children: /* @__PURE__ */ a("iframe", {
103
+ title: "map",
104
+ width: "100%",
105
+ height: "240",
106
+ style: {
107
+ border: 0,
108
+ display: "block"
109
+ },
110
+ src: C()
111
+ })
112
+ }) : null
113
+ ]
114
+ });
115
+ }
116
+ export { d as default };
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-5iZMYShA.js"),t=require("./ai-CXI0Rnu8.js"),n=require("./useSyncedState-DYNKkpDv.js");let r=require("@mui/material/Typography");r=e.n(r);let i=require("react/jsx-runtime"),a=require("@mui/material/TextField");a=e.n(a);let o=require("@mui/material/Box");o=e.n(o);let s=require("@mui/material/Link");s=e.n(s);var c=e=>{if(e&&typeof e==`object`)return{lat:e.lat!==void 0&&e.lat!==null?String(e.lat):``,lng:e.lng!==void 0&&e.lng!==null?String(e.lng):``};if(typeof e==`string`&&e.includes(`,`)){let[t=``,n=``]=e.split(`,`);return{lat:t.trim(),lng:n.trim()}}return{lat:``,lng:``}};function l({attributes:e={},onChange:l}){let{id:u=``,label:d=``,showMap:f=!1,MuiAttributes:p={}}=e,[m,h]=n.n(()=>c(e.value),[e.value]),g=e=>{l?.({id:u,value:{lat:e.lat,lng:e.lng},option:`${e.lat},${e.lng}`})},_=e=>t=>{let n={...m,[e]:t.target.value};h(n),g(n)},v=m.lat!==``&&m.lng!==``,y=t.B(t.U,p.sx),b=()=>{let e=parseFloat(m.lat),t=parseFloat(m.lng),n=.01;return`https://www.openstreetmap.org/export/embed.html?bbox=${`${t-n},${e-n},${t+n},${e+n}`}&marker=${e},${t}`};return(0,i.jsxs)(o.default,{id:u,children:[d?(0,i.jsx)(r.default,{variant:`body2`,sx:{mb:.75,fontWeight:500},children:d}):null,(0,i.jsxs)(o.default,{sx:{display:`flex`,gap:1.5,flexWrap:`wrap`},children:[(0,i.jsx)(a.default,{type:`number`,...p,label:`Latitude`,value:m.lat,onChange:_(`lat`),sx:y,slotProps:{htmlInput:{"aria-label":`Latitude`,step:`any`}}}),(0,i.jsx)(a.default,{type:`number`,...p,label:`Longitude`,value:m.lng,onChange:_(`lng`),sx:y,slotProps:{htmlInput:{"aria-label":`Longitude`,step:`any`}}})]}),(0,i.jsx)(o.default,{sx:{mt:1},children:(0,i.jsx)(s.default,{href:`https://www.google.com/maps?q=${m.lat},${m.lng}`,target:`_blank`,rel:`noreferrer`,variant:`body2`,children:`Open in Maps`})}),f&&v?(0,i.jsx)(o.default,{sx:t.B(e=>({...t.W(e),mt:1.5})),children:(0,i.jsx)(`iframe`,{title:`map`,width:`100%`,height:`240`,style:{border:0,display:`block`},src:b()})}):null]})}exports.default=l;
@@ -0,0 +1,30 @@
1
+ import { m as e } from "./ai-D6hkfd_f.mjs";
2
+ import { t } from "./v4-YCkfo8OR.mjs";
3
+ import n from "react";
4
+ import { Box as r, Paper as i, Typography as a } from "@mui/material";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ // src/components/controls/Group/group.tsx
7
+ function c({ attributes: c = {}, patch: l, onChange: u }) {
8
+ let { MuiAttributes: d = {}, label: f = "Group", subFields: p = [] } = c, m = n.useMemo(() => t(), []);
9
+ return /* @__PURE__ */ s(i, {
10
+ elevation: 1,
11
+ sx: {
12
+ p: 2,
13
+ mb: 2,
14
+ ...d.sx
15
+ },
16
+ ...d,
17
+ children: [/* @__PURE__ */ o(a, {
18
+ variant: "subtitle1",
19
+ gutterBottom: !0,
20
+ sx: { fontWeight: 600 },
21
+ children: f
22
+ }), /* @__PURE__ */ o(r, { children: /* @__PURE__ */ o(e, {
23
+ guid: m,
24
+ data: p,
25
+ patch: l,
26
+ onChange: u
27
+ }) })]
28
+ });
29
+ }
30
+ export { c as default };
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-5iZMYShA.js"),t=require("./ai-CXI0Rnu8.js"),n=require("./v4-Dyp-SQ1c.js");let r=require("react");r=e.n(r);let i=require("@mui/material"),a=require("react/jsx-runtime");function o({attributes:e={},patch:o,onChange:s}){let{MuiAttributes:c={},label:l=`Group`,subFields:u=[]}=e,d=r.default.useMemo(()=>n.t(),[]);return(0,a.jsxs)(i.Paper,{elevation:1,sx:{p:2,mb:2,...c.sx},...c,children:[(0,a.jsx)(i.Typography,{variant:`subtitle1`,gutterBottom:!0,sx:{fontWeight:600},children:l}),(0,a.jsx)(i.Box,{children:(0,a.jsx)(t.m,{guid:d,data:u,patch:o,onChange:s})})]})}exports.default=o;
@@ -0,0 +1,23 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import t from "@mui/material/ImageList";
3
+ import n from "@mui/material/ImageListItem";
4
+ // src/components/controls/ImageList/imagelist.tsx
5
+ function r({ attributes: r = {} }) {
6
+ let { MuiAttributes: i = {}, items: a = [], width: o = 500, height: s = 450, cols: c = 3, rowHeight: l = 164 } = r;
7
+ return /* @__PURE__ */ e(t, {
8
+ sx: {
9
+ width: o,
10
+ height: s
11
+ },
12
+ cols: c,
13
+ rowHeight: l,
14
+ ...i,
15
+ children: (Array.isArray(a) ? a : []).map((t) => /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("img", {
16
+ srcSet: `${t.img}?w=${l}&h=${l}&fit=crop&auto=format&dpr=2 2x`,
17
+ src: `${t.img}?w=${l}&h=${l}&fit=crop&auto=format`,
18
+ alt: t.title,
19
+ loading: "lazy"
20
+ }) }, t.img))
21
+ });
22
+ }
23
+ export { r as default };
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-5iZMYShA.js");let t=require("react/jsx-runtime"),n=require("@mui/material/ImageList");n=e.n(n);let r=require("@mui/material/ImageListItem");r=e.n(r);function i({attributes:e={}}){let{MuiAttributes:i={},items:a=[],width:o=500,height:s=450,cols:c=3,rowHeight:l=164}=e;return(0,t.jsx)(n.default,{sx:{width:o,height:s},cols:c,rowHeight:l,...i,children:(Array.isArray(a)?a:[]).map(e=>(0,t.jsx)(r.default,{children:(0,t.jsx)(`img`,{srcSet:`${e.img}?w=${l}&h=${l}&fit=crop&auto=format&dpr=2 2x`,src:`${e.img}?w=${l}&h=${l}&fit=crop&auto=format`,alt:e.title,loading:`lazy`})},e.img))})}exports.default=i;
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export type { FormApi, FormMessages, FormGeneratorProps, SubmitButtonConfig, Asy
3
3
  export { default as DynamicComponent } from './components/DynamicComponent';
4
4
  export { default as Controls } from './components/controls';
5
5
  export { default as MuiConfig } from './config/mui';
6
+ export { migrateFormData, migrateFormField } from './util/helper';
6
7
  export { registerControl, registerControls, unregisterControl, getRegisteredControl, hasRegisteredControl, registeredControlTypes, } from './util/registry';
7
8
  export type { ControlComponent } from './util/registry';
8
9
  export { zodResolver, yupResolver } from './util/resolvers';