dynamic-mui 2.2.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +142 -5
  2. package/dist/accordion-Bf0VwGuE.js +1 -0
  3. package/dist/accordion-DEd2a2Ps.mjs +23 -0
  4. package/dist/addressfield-Dfd9ilpe.js +1 -0
  5. package/dist/addressfield-FjNJCCuC.mjs +152 -0
  6. package/dist/asyncautocomplete-9O6nwGP_.js +1 -0
  7. package/dist/asyncautocomplete-B8qI_lz9.mjs +89 -0
  8. package/dist/bar-BzO7tvYJ.mjs +20 -0
  9. package/dist/bar-DEVxyUVS.js +1 -0
  10. package/dist/cascadeselect-D8sVXV1g.mjs +64 -0
  11. package/dist/cascadeselect-DeoPn4_V.js +1 -0
  12. package/dist/colorpicker-BcnqB34i.js +1 -0
  13. package/dist/colorpicker-DcyceL6g.mjs +98 -0
  14. package/dist/components/DynamicComponent.d.ts +2 -0
  15. package/dist/components/FormGenerator.d.ts +99 -10
  16. package/dist/components/controls/index.d.ts +45 -79
  17. package/dist/consentfield-B_qBOIuX.mjs +78 -0
  18. package/dist/consentfield-CR69IP1l.js +1 -0
  19. package/dist/datatable-BIQznwQe.mjs +20 -0
  20. package/dist/datatable-BWlcUP0M.js +1 -0
  21. package/dist/dynamic-mui.cjs +1 -0
  22. package/dist/dynamic-mui.mjs +32 -0
  23. package/dist/editabletable-BdywdA42.js +1 -0
  24. package/dist/editabletable-D6_U9op8.mjs +126 -0
  25. package/dist/fileupload-CugTpR-B.mjs +172 -0
  26. package/dist/fileupload-YzpAUgok.js +1 -0
  27. package/dist/formrepeater-B_2UOIBm.js +1 -0
  28. package/dist/formrepeater-Cxawn2sQ.mjs +71 -0
  29. package/dist/formwizard-CCBY6s19.js +1 -0
  30. package/dist/formwizard-Cfd5IPkE.mjs +83 -0
  31. package/dist/geofield-CJm8hivf.js +1 -0
  32. package/dist/geofield-k2V0hglK.mjs +104 -0
  33. package/dist/group-D40b3E1V.mjs +23 -0
  34. package/dist/group-IFZTzo-g.js +1 -0
  35. package/dist/imagelist-Bn9QhIv7.js +1 -0
  36. package/dist/imagelist-rqmJajHt.mjs +18 -0
  37. package/dist/index-Bh6BLrzq.mjs +12226 -0
  38. package/dist/index-eJceCjKS.js +43 -0
  39. package/dist/index.d.ts +9 -1
  40. package/dist/intlphone-BbTprmmA.mjs +140 -0
  41. package/dist/intlphone-CmiRFHv-.js +1 -0
  42. package/dist/keyvaluefield-CoOmou7m.js +1 -0
  43. package/dist/keyvaluefield-zD6Kf4D0.mjs +125 -0
  44. package/dist/line-B-DwR1hm.mjs +20 -0
  45. package/dist/line-BkymZu31.js +1 -0
  46. package/dist/lineitemlist-BRsW0O7Z.js +1 -0
  47. package/dist/lineitemlist-BZbAId8H.mjs +166 -0
  48. package/dist/list-BhTzYFrR.mjs +20 -0
  49. package/dist/list-DWf2NWix.js +1 -0
  50. package/dist/locationfield-BZpGC10B.mjs +119 -0
  51. package/dist/locationfield-DC_2IN-B.js +1 -0
  52. package/dist/markdowneditor-B5F4okCW.mjs +90 -0
  53. package/dist/markdowneditor-Coi3sksx.js +2 -0
  54. package/dist/matrixfield-CUo7zFWC.mjs +117 -0
  55. package/dist/matrixfield-DAjfXU96.js +1 -0
  56. package/dist/mixChart-C3o184UT.js +1 -0
  57. package/dist/mixChart-ISf3Kbr-.mjs +75 -0
  58. package/dist/multitextbox-Cq7vt1-g.js +1 -0
  59. package/dist/multitextbox-CsNOrHZP.mjs +78 -0
  60. package/dist/npsscale-BWpMrK_O.js +1 -0
  61. package/dist/npsscale-Cb8NxADb.mjs +87 -0
  62. package/dist/numberstepper-BqQeBbR9.js +1 -0
  63. package/dist/numberstepper-DLk_r1HM.mjs +128 -0
  64. package/dist/pie-CJSL8Sv5.js +1 -0
  65. package/dist/pie-CL29dlh5.mjs +20 -0
  66. package/dist/richtexteditor-BUrvVR_T.js +1 -0
  67. package/dist/richtexteditor-pQIK2f-6.mjs +141 -0
  68. package/dist/s3Upload-B0JeoLkS.js +1 -0
  69. package/dist/s3Upload-dpioZ2c8.mjs +51 -0
  70. package/dist/signature-CFv0jhVN.mjs +1225 -0
  71. package/dist/signature-G-XCOszC.js +2 -0
  72. package/dist/stepper-Bc9NlbU7.js +1 -0
  73. package/dist/stepper-U0kv127E.mjs +140 -0
  74. package/dist/summaryfield-B_bePxLk.js +1 -0
  75. package/dist/summaryfield-QcpYr9Xt.mjs +96 -0
  76. package/dist/tabs-Cs9eNEbR.js +1 -0
  77. package/dist/tabs-DCLyTKVm.mjs +39 -0
  78. package/dist/tagsinput-D1VP8Bjq.mjs +58 -0
  79. package/dist/tagsinput-DlopThdw.js +1 -0
  80. package/dist/util/dayjsSetup.d.ts +2 -0
  81. package/dist/util/registry.d.ts +29 -0
  82. package/dist/util/resolvers.d.ts +45 -0
  83. package/dist/util/useFormEngine.d.ts +74 -0
  84. package/dist/util/validateSchema.d.ts +23 -0
  85. package/dist/v4-BysszJq8.mjs +30 -0
  86. package/dist/v4-CqdK_b8Y.js +1 -0
  87. package/package.json +38 -12
  88. package/dist/AxisSharedComponents-BbsKw1BT.js +0 -3
  89. package/dist/AxisSharedComponents-xLtpOLH_.mjs +0 -605
  90. package/dist/ChartsAxis-CANvBdY9.mjs +0 -47
  91. package/dist/ChartsAxis-EZ7m_KrU.js +0 -1
  92. package/dist/ChartsGrid-BCRTvNTr.js +0 -3
  93. package/dist/ChartsGrid-C_HT7qpL.mjs +0 -381
  94. package/dist/ChartsWrapper-CM7EDyAK.js +0 -5
  95. package/dist/ChartsWrapper-CO5_Z6BD.mjs +0 -1878
  96. package/dist/ChartsXAxis-CPmuCRhq.mjs +0 -487
  97. package/dist/ChartsXAxis-DFFY1sPg.js +0 -3
  98. package/dist/ChartsYAxis-DLUMr9vG.mjs +0 -392
  99. package/dist/ChartsYAxis-fpevi1sP.js +0 -1
  100. package/dist/XmlShapeDeserializer-3yQdm0b0.mjs +0 -237
  101. package/dist/XmlShapeDeserializer-XKJAoqLc.js +0 -1
  102. package/dist/clampAngle-BvZjnf53.mjs +0 -11
  103. package/dist/clampAngle-DpAsDoeT.js +0 -1
  104. package/dist/createSelector-B-9FwV16.mjs +0 -430
  105. package/dist/createSelector-f0oqn8Lr.js +0 -7
  106. package/dist/date-utils-CFUUt6NL.js +0 -4
  107. package/dist/date-utils-pGzaKb0p.mjs +0 -477
  108. package/dist/dynamic-mui.cjs.js +0 -1
  109. package/dist/dynamic-mui.es.js +0 -22
  110. package/dist/index--8Zky9Oh.js +0 -299
  111. package/dist/index-6WTs1Xy_.js +0 -1
  112. package/dist/index-B1R1akM2.js +0 -1
  113. package/dist/index-BW8_rRff.js +0 -7
  114. package/dist/index-BXFVK_GX.js +0 -1
  115. package/dist/index-B_KNUTjy.js +0 -1
  116. package/dist/index-BhaKvHkU.mjs +0 -62051
  117. package/dist/index-Bif92ima.js +0 -1
  118. package/dist/index-BnZOu8CL.js +0 -1
  119. package/dist/index-CDxpgRlR.mjs +0 -7
  120. package/dist/index-CThMfvtJ.mjs +0 -2555
  121. package/dist/index-CVqLvm8B.js +0 -1
  122. package/dist/index-CodJBIn6.mjs +0 -1665
  123. package/dist/index-Cr6Wp_S-.mjs +0 -3141
  124. package/dist/index-CslPwsrf.mjs +0 -4
  125. package/dist/index-CuV0MQzZ.mjs +0 -1173
  126. package/dist/index-DA0XouZs.mjs +0 -153
  127. package/dist/index-DKS5Sz9e.js +0 -14
  128. package/dist/index-DSkYYZuW.mjs +0 -4
  129. package/dist/index-DU78_FiA.js +0 -1
  130. package/dist/index-D_mYhgJ0.js +0 -10
  131. package/dist/index-DcWfyXJp.mjs +0 -92
  132. package/dist/index-Dlimbnxj.mjs +0 -2965
  133. package/dist/index-MllWgTJ5.mjs +0 -9372
  134. package/dist/index-in5z9hUb.js +0 -133
  135. package/dist/index-qUW7FnZ-.mjs +0 -20540
  136. package/dist/index.browser-BSu11T_q.mjs +0 -363
  137. package/dist/index.browser-By7-GABP.js +0 -4
  138. package/dist/isDeepEqual-BHfPvf9U.mjs +0 -393
  139. package/dist/isDeepEqual-CqxZGVRk.js +0 -1
  140. package/dist/loadCognitoIdentity-DtYTy-DW.js +0 -1
  141. package/dist/loadCognitoIdentity-DzdR91GB.mjs +0 -872
  142. package/dist/loadSts-Cic6UToN.mjs +0 -593
  143. package/dist/loadSts-csbFP6zX.js +0 -1
  144. package/dist/main.d.ts +0 -1
  145. package/dist/noAuth-B8ui2kBg.mjs +0 -71
  146. package/dist/noAuth-JPA2o4dt.js +0 -1
  147. package/dist/playground/AIContext.d.ts +0 -18
  148. package/dist/playground/AIPanel.d.ts +0 -10
  149. package/dist/playground/Builder.d.ts +0 -1
  150. package/dist/playground/Canvas.d.ts +0 -9
  151. package/dist/playground/DemoGallery.d.ts +0 -6
  152. package/dist/playground/PropertiesEditor.d.ts +0 -10
  153. package/dist/playground/Sidebar.d.ts +0 -9
  154. package/dist/playground/demoForms.d.ts +0 -3
  155. package/dist/playground/demoRecipes.d.ts +0 -15
  156. package/dist/playground/demoVariants.d.ts +0 -11
  157. package/dist/playground/documentation.d.ts +0 -6
  158. package/dist/playground/templates.d.ts +0 -7
  159. package/dist/playground/testData.d.ts +0 -2
  160. package/dist/test/setup.d.ts +0 -0
  161. package/dist/theme/theme.d.ts +0 -6
  162. package/dist/useAxis-DSbfEtO7.js +0 -3
  163. package/dist/useAxis-SiNBMMWq.mjs +0 -3010
  164. package/dist/useChartContainerProps-Bl3hO-r1.mjs +0 -5418
  165. package/dist/useChartContainerProps-C_C_PZoi.js +0 -12
  166. package/dist/useItemHighlightedGetter-9CIwqsGj.js +0 -1
  167. package/dist/useItemHighlightedGetter-CTISrNdV.mjs +0 -88
@@ -0,0 +1,172 @@
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import { useRef as _, useState as m } from "react";
3
+ import s from "@mui/material/Box";
4
+ import c from "@mui/material/Typography";
5
+ import q from "@mui/material/IconButton";
6
+ import H from "@mui/material/CircularProgress";
7
+ import J from "@mui/icons-material/CloudUpload";
8
+ import K from "@mui/icons-material/Close";
9
+ import N from "@mui/icons-material/InsertDriveFile";
10
+ import { u as Q, m as V, b as W } from "./index-Bh6BLrzq.mjs";
11
+ import { u as X } from "./s3Upload-dpioZ2c8.mjs";
12
+ const R = (r) => r ? Array.isArray(r) ? r.filter(Boolean) : [r] : [], Y = (r) => /^data:image\//i.test(r) || /\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(r), Z = (r) => new Promise((u, g) => {
13
+ const a = new FileReader();
14
+ a.onload = () => u(a.result || ""), a.onerror = () => g(a.error), a.readAsDataURL(r);
15
+ });
16
+ function de({ attributes: r = {}, rules: u = {}, onChange: g }) {
17
+ const {
18
+ id: a = "",
19
+ multiple: p = !1,
20
+ accept: h = "",
21
+ bucket: z = "",
22
+ region: B = "",
23
+ identityPoolId: F = "",
24
+ path: $ = "",
25
+ maxSizeMB: x = 0,
26
+ label: w = "Upload file",
27
+ MuiAttributes: P = {}
28
+ } = r, D = _(null), [d, v] = m(R(r.value)), [S, b] = m(!1), [j, U] = m(!1), [k, y] = m(""), L = u?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1;
29
+ Q(() => {
30
+ v(R(r.value));
31
+ }, [r.value]);
32
+ const C = (e, o) => {
33
+ g?.({ id: a, value: p ? e : e[0] ?? "", option: o });
34
+ }, I = async (e) => {
35
+ const o = Array.from(e);
36
+ if (!o.length) return;
37
+ y(""), U(!0);
38
+ const i = [], f = [];
39
+ try {
40
+ for (const n of o) {
41
+ if (x && n.size > x * 1024 * 1024) {
42
+ y(`"${n.name}" exceeds the ${x}MB limit.`);
43
+ continue;
44
+ }
45
+ const O = await Z(n), G = await X(O, n.name, z, B, F, $);
46
+ i.push(G), f.push(n);
47
+ }
48
+ } catch (n) {
49
+ console.error("FileUpload failed", n), y("Upload failed. Please try again.");
50
+ } finally {
51
+ U(!1);
52
+ }
53
+ if (!i.length) return;
54
+ const A = p ? [...d, ...i] : i.slice(0, 1);
55
+ v(A), C(A, f);
56
+ }, M = (e) => {
57
+ e.target.files && I(e.target.files), e.target.value = "";
58
+ }, T = (e) => {
59
+ e.preventDefault(), b(!1), e.dataTransfer?.files?.length && I(e.dataTransfer.files);
60
+ }, E = (e) => {
61
+ const o = d.filter((i, f) => f !== e);
62
+ v(o), C(o);
63
+ };
64
+ return /* @__PURE__ */ l(s, { sx: { width: "100%", ...P.sx }, children: [
65
+ /* @__PURE__ */ l(c, { variant: "subtitle2", gutterBottom: !0, sx: { display: "flex" }, children: [
66
+ w,
67
+ L && /* @__PURE__ */ t(s, { component: "span", sx: { color: "error.main", ml: 0.5 }, children: "*" })
68
+ ] }),
69
+ /* @__PURE__ */ t(
70
+ "input",
71
+ {
72
+ ref: D,
73
+ type: "file",
74
+ hidden: !0,
75
+ multiple: p,
76
+ accept: h || void 0,
77
+ onChange: M
78
+ }
79
+ ),
80
+ /* @__PURE__ */ l(
81
+ s,
82
+ {
83
+ role: "button",
84
+ "aria-label": w,
85
+ onClick: () => D.current?.click(),
86
+ onDragOver: (e) => {
87
+ e.preventDefault(), b(!0);
88
+ },
89
+ onDragLeave: () => b(!1),
90
+ onDrop: T,
91
+ sx: {
92
+ border: "2px dashed",
93
+ borderColor: S ? "primary.main" : "divider",
94
+ borderRadius: "12px",
95
+ p: 3,
96
+ textAlign: "center",
97
+ cursor: "pointer",
98
+ transition: "all .2s",
99
+ bgcolor: S ? "action.hover" : "background.paper",
100
+ "&:hover": { borderColor: "primary.main", bgcolor: "action.hover" }
101
+ },
102
+ children: [
103
+ j ? /* @__PURE__ */ t(H, { size: 28 }) : /* @__PURE__ */ t(J, { sx: { fontSize: 40, color: "primary.main" } }),
104
+ /* @__PURE__ */ l(c, { variant: "body2", sx: { mt: 1 }, children: [
105
+ "Drag & drop ",
106
+ p ? "files" : "a file",
107
+ " here, or click to browse"
108
+ ] }),
109
+ h && /* @__PURE__ */ l(c, { variant: "caption", color: "text.secondary", children: [
110
+ "Accepted: ",
111
+ h
112
+ ] })
113
+ ]
114
+ }
115
+ ),
116
+ k && /* @__PURE__ */ t(c, { variant: "caption", color: "error.main", sx: { display: "block", mt: 1 }, children: k }),
117
+ d.length > 0 && /* @__PURE__ */ t(s, { sx: V(W, { mt: 1.5, p: 1 }), children: d.map((e, o) => /* @__PURE__ */ l(
118
+ s,
119
+ {
120
+ sx: {
121
+ display: "flex",
122
+ alignItems: "center",
123
+ gap: 1.5,
124
+ p: 1,
125
+ borderRadius: "8px",
126
+ transition: "background-color .18s",
127
+ "&:hover": { bgcolor: "action.hover" }
128
+ },
129
+ children: [
130
+ Y(e) ? /* @__PURE__ */ t(
131
+ s,
132
+ {
133
+ component: "img",
134
+ src: e,
135
+ alt: `upload-${o}`,
136
+ sx: {
137
+ width: 40,
138
+ height: 40,
139
+ objectFit: "cover",
140
+ borderRadius: "8px",
141
+ flexShrink: 0
142
+ }
143
+ }
144
+ ) : /* @__PURE__ */ t(N, { color: "action", sx: { flexShrink: 0 } }),
145
+ /* @__PURE__ */ t(
146
+ c,
147
+ {
148
+ variant: "body2",
149
+ sx: { flexGrow: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
150
+ children: e.split("/").pop()?.split("?")[0] || e
151
+ }
152
+ ),
153
+ /* @__PURE__ */ t(
154
+ q,
155
+ {
156
+ size: "small",
157
+ "aria-label": "remove",
158
+ onClick: (i) => {
159
+ i.stopPropagation(), E(o);
160
+ },
161
+ children: /* @__PURE__ */ t(K, { fontSize: "small" })
162
+ }
163
+ )
164
+ ]
165
+ },
166
+ `${e}-${o}`
167
+ )) })
168
+ ] });
169
+ }
170
+ export {
171
+ de as default
172
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),i=require("@mui/material/Box"),c=require("@mui/material/Typography"),G=require("@mui/material/IconButton"),_=require("@mui/material/CircularProgress"),H=require("@mui/icons-material/CloudUpload"),J=require("@mui/icons-material/Close"),K=require("@mui/icons-material/InsertDriveFile"),b=require("./index-eJceCjKS.js"),N=require("./s3Upload-B0JeoLkS.js"),C=o=>o?Array.isArray(o)?o.filter(Boolean):[o]:[],Q=o=>/^data:image\//i.test(o)||/\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(o),V=o=>new Promise((f,x)=>{const s=new FileReader;s.onload=()=>f(s.result||""),s.onerror=()=>x(s.error),s.readAsDataURL(o)});function W({attributes:o={},rules:f={},onChange:x}){const{id:s="",multiple:d=!1,accept:g="",bucket:I="",region:A="",identityPoolId:z="",path:B="",maxSizeMB:h=0,label:j="Upload file",MuiAttributes:F={}}=o,S=l.useRef(null),[p,m]=l.useState(C(o.value)),[w,v]=l.useState(!1),[P,U]=l.useState(!1),[q,y]=l.useState(""),$=f?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1;b.useUpdateEffect(()=>{m(C(o.value))},[o.value]);const D=(e,t)=>{x?.({id:s,value:d?e:e[0]??"",option:t})},k=async e=>{const t=Array.from(e);if(!t.length)return;y(""),U(!0);const a=[],u=[];try{for(const n of t){if(h&&n.size>h*1024*1024){y(`"${n.name}" exceeds the ${h}MB limit.`);continue}const O=await V(n),E=await N.uploadToS3(O,n.name,I,A,z,B);a.push(E),u.push(n)}}catch(n){console.error("FileUpload failed",n),y("Upload failed. Please try again.")}finally{U(!1)}if(!a.length)return;const R=d?[...p,...a]:a.slice(0,1);m(R),D(R,u)},M=e=>{e.target.files&&k(e.target.files),e.target.value=""},T=e=>{e.preventDefault(),v(!1),e.dataTransfer?.files?.length&&k(e.dataTransfer.files)},L=e=>{const t=p.filter((a,u)=>u!==e);m(t),D(t)};return r.jsxs(i,{sx:{width:"100%",...F.sx},children:[r.jsxs(c,{variant:"subtitle2",gutterBottom:!0,sx:{display:"flex"},children:[j,$&&r.jsx(i,{component:"span",sx:{color:"error.main",ml:.5},children:"*"})]}),r.jsx("input",{ref:S,type:"file",hidden:!0,multiple:d,accept:g||void 0,onChange:M}),r.jsxs(i,{role:"button","aria-label":j,onClick:()=>S.current?.click(),onDragOver:e=>{e.preventDefault(),v(!0)},onDragLeave:()=>v(!1),onDrop:T,sx:{border:"2px dashed",borderColor:w?"primary.main":"divider",borderRadius:"12px",p:3,textAlign:"center",cursor:"pointer",transition:"all .2s",bgcolor:w?"action.hover":"background.paper","&:hover":{borderColor:"primary.main",bgcolor:"action.hover"}},children:[P?r.jsx(_,{size:28}):r.jsx(H,{sx:{fontSize:40,color:"primary.main"}}),r.jsxs(c,{variant:"body2",sx:{mt:1},children:["Drag & drop ",d?"files":"a file"," here, or click to browse"]}),g&&r.jsxs(c,{variant:"caption",color:"text.secondary",children:["Accepted: ",g]})]}),q&&r.jsx(c,{variant:"caption",color:"error.main",sx:{display:"block",mt:1},children:q}),p.length>0&&r.jsx(i,{sx:b.mergeSx(b.premiumSurfaceSx,{mt:1.5,p:1}),children:p.map((e,t)=>r.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1.5,p:1,borderRadius:"8px",transition:"background-color .18s","&:hover":{bgcolor:"action.hover"}},children:[Q(e)?r.jsx(i,{component:"img",src:e,alt:`upload-${t}`,sx:{width:40,height:40,objectFit:"cover",borderRadius:"8px",flexShrink:0}}):r.jsx(K,{color:"action",sx:{flexShrink:0}}),r.jsx(c,{variant:"body2",sx:{flexGrow:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.split("/").pop()?.split("?")[0]||e}),r.jsx(G,{size:"small","aria-label":"remove",onClick:a=>{a.stopPropagation(),L(t)},children:r.jsx(J,{fontSize:"small"})})]},`${e}-${t}`))})]})}exports.default=W;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),n=require("@mui/material"),b=require("./index-eJceCjKS.js"),I=require("./v4-CqdK_b8Y.js");function N({attributes:f={},rules:j={},onChange:o}){const{id:c="",label:g="Group",min:s=1,max:u,subFields:v=[],value:a}=f,A=j?.validation?.some(e=>e.rule==="mandatory")||!1,q=i.useMemo(()=>{if(Array.isArray(a)&&a.length>0)return a.length;const e=Number(f.count);return!isNaN(e)&&e>=s?e:s},[]),[l,C]=i.useState(q),d=i.useRef([]),m=i.useCallback(e=>(d.current[e]||(d.current[e]=I.v4()),d.current[e]),[]),y=i.useCallback(e=>{if(!o)return;const r=Array.from({length:e},(p,x)=>{const h=`${c}-group-${m(x)}`;return b.FormData(h)??{}});o({id:c,value:r})},[c,m,o]),F=e=>{let r=parseInt(e,10);(isNaN(r)||r<s)&&(r=s),u!==void 0&&r>u&&(r=u),C(r),setTimeout(()=>y(r),0)};return t.jsxs(n.Box,{sx:{width:"100%"},children:[t.jsx(n.TextField,{type:"number",size:"small",label:`Number of ${g}s`,value:l,onChange:e=>F(e.target.value),required:A,inputProps:{min:s,...u!==void 0?{max:u}:{}},InputProps:{startAdornment:t.jsx(n.InputAdornment,{position:"start",children:t.jsx(n.Icon,{fontSize:"small",children:"format_list_numbered"})})},sx:{mb:2,minWidth:200}}),Array.from({length:l},(e,r)=>{const p=`${c}-group-${m(r)}`,x=Array.isArray(a)?a[r]:void 0;return t.jsxs(n.Accordion,{defaultExpanded:r===0,sx:{mb:1},children:[t.jsx(n.AccordionSummary,{expandIcon:t.jsx(n.Icon,{children:"expand_more"}),children:t.jsxs(n.Typography,{fontWeight:600,children:[g," ",r+1]})}),t.jsx(n.AccordionDetails,{children:t.jsx(b.FormGenerator,{guid:p,data:v,patch:x??{},onChange:h=>{y(l),o&&o(h)}})})]},p)})]})}exports.default=N;
@@ -0,0 +1,71 @@
1
+ import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
+ import { useMemo as _, useState as $, useRef as G, useCallback as y } from "react";
3
+ import { Box as P, TextField as R, InputAdornment as S, Icon as A, Accordion as T, AccordionSummary as j, Typography as z, AccordionDetails as D } from "@mui/material";
4
+ import { e as M, F as W } from "./index-Bh6BLrzq.mjs";
5
+ import { v as k } from "./v4-BysszJq8.mjs";
6
+ function H({ attributes: h = {}, rules: v = {}, onChange: o }) {
7
+ const {
8
+ id: s = "",
9
+ label: g = "Group",
10
+ min: n = 1,
11
+ max: a,
12
+ subFields: b = [],
13
+ value: i
14
+ } = h, F = v?.validation?.some((r) => r.rule === "mandatory") || !1, N = _(() => {
15
+ if (Array.isArray(i) && i.length > 0) return i.length;
16
+ const r = Number(h.count);
17
+ return !isNaN(r) && r >= n ? r : n;
18
+ }, []), [u, C] = $(N), c = G([]), d = y((r) => (c.current[r] || (c.current[r] = k()), c.current[r]), []), x = y((r) => {
19
+ if (!o) return;
20
+ const t = Array.from({ length: r }, (l, m) => {
21
+ const p = `${s}-group-${d(m)}`;
22
+ return M(p) ?? {};
23
+ });
24
+ o({ id: s, value: t });
25
+ }, [s, d, o]), I = (r) => {
26
+ let t = parseInt(r, 10);
27
+ (isNaN(t) || t < n) && (t = n), a !== void 0 && t > a && (t = a), C(t), setTimeout(() => x(t), 0);
28
+ };
29
+ return /* @__PURE__ */ f(P, { sx: { width: "100%" }, children: [
30
+ /* @__PURE__ */ e(
31
+ R,
32
+ {
33
+ type: "number",
34
+ size: "small",
35
+ label: `Number of ${g}s`,
36
+ value: u,
37
+ onChange: (r) => I(r.target.value),
38
+ required: F,
39
+ inputProps: { min: n, ...a !== void 0 ? { max: a } : {} },
40
+ InputProps: {
41
+ startAdornment: /* @__PURE__ */ e(S, { position: "start", children: /* @__PURE__ */ e(A, { fontSize: "small", children: "format_list_numbered" }) })
42
+ },
43
+ sx: { mb: 2, minWidth: 200 }
44
+ }
45
+ ),
46
+ Array.from({ length: u }, (r, t) => {
47
+ const l = `${s}-group-${d(t)}`, m = Array.isArray(i) ? i[t] : void 0;
48
+ return /* @__PURE__ */ f(T, { defaultExpanded: t === 0, sx: { mb: 1 }, children: [
49
+ /* @__PURE__ */ e(j, { expandIcon: /* @__PURE__ */ e(A, { children: "expand_more" }), children: /* @__PURE__ */ f(z, { fontWeight: 600, children: [
50
+ g,
51
+ " ",
52
+ t + 1
53
+ ] }) }),
54
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
55
+ W,
56
+ {
57
+ guid: l,
58
+ data: b,
59
+ patch: m ?? {},
60
+ onChange: (p) => {
61
+ x(u), o && o(p);
62
+ }
63
+ }
64
+ ) })
65
+ ] }, l);
66
+ })
67
+ ] });
68
+ }
69
+ export {
70
+ H as default
71
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),n=require("@mui/material"),i=require("./index-eJceCjKS.js"),y=require("./v4-CqdK_b8Y.js");function B({attributes:f={},onChange:l}){const{id:c="",guid:M,steps:x=[],patch:v={},finishLabel:j="Finish",validateSteps:d=!1,MuiAttributes:$={}}=f,[e,p]=a.useState(0),u=a.useRef(null),h=a.useMemo(()=>M||`${c}-${y.v4()}`,[]),r=Array.isArray(x)?x:[],o=Math.max(r.length-1,0),R=e>=o,I=e<=0,b=`${h}-step-${e}`,g=a.useCallback(()=>{p(t=>Math.max(t-1,0))},[]),A=a.useCallback(()=>{if(!(d&&u.current&&!u.current.validate())){if(e>=o){l?.({id:c,value:"complete",option:e});return}p(t=>Math.min(t+1,o))}},[e,o,c,l,d]),m=(t=>({borderRadius:`${i.PREMIUM_RADIUS+8}px`,textTransform:"none",fontWeight:600,px:3,transition:`box-shadow .18s ${i.PREMIUM_EASING}, transform .18s ${i.PREMIUM_EASING}`,"&:hover":{transform:"translateY(-1px)",boxShadow:`0 4px 12px ${t.palette.primary.main}22`}}));return s.jsxs(n.Box,{sx:{width:"100%"},...$,children:[s.jsx(n.Stepper,{activeStep:e,alternativeLabel:!0,sx:{mb:3,"& .MuiStepLabel-label":{fontWeight:500},"& .MuiStepIcon-root.Mui-active":{transition:`color .2s ${i.PREMIUM_EASING}`}},children:r.map((t,S)=>s.jsx(n.Step,{children:s.jsx(n.StepLabel,{children:t?.label??`Step ${S+1}`})},`${h}-label-${S}`))}),s.jsx(n.Box,{sx:{mb:3},children:r[e]&&s.jsx(i.FormGenerator,{guid:b,data:r[e].fields??[],patch:v,persistOnUnmount:!0,apiRef:u,onChange:t=>{l?.(t)}},b)}),s.jsxs(n.Box,{sx:{display:"flex",justifyContent:"space-between",gap:2},children:[s.jsx(n.Button,{variant:"outlined",onClick:g,disabled:I,sx:i.mergeSx(m),children:"Back"}),s.jsx(n.Button,{variant:"contained",onClick:A,sx:i.mergeSx(m),children:R?j:"Next"})]})]})}exports.default=B;
@@ -0,0 +1,83 @@
1
+ import { jsxs as b, jsx as a } from "react/jsx-runtime";
2
+ import { useState as G, useRef as w, useMemo as B, useCallback as S } from "react";
3
+ import { Box as l, Stepper as U, Step as j, StepLabel as C, Button as v } from "@mui/material";
4
+ import { P as c, F as E, m as M, d as N } from "./index-Bh6BLrzq.mjs";
5
+ import { v as P } from "./v4-BysszJq8.mjs";
6
+ function T({ attributes: $ = {}, onChange: n }) {
7
+ const {
8
+ id: r = "",
9
+ guid: A,
10
+ steps: p = [],
11
+ patch: R = {},
12
+ finishLabel: g = "Finish",
13
+ // Opt-in: block Next / Finish until the current step passes validation
14
+ // (invalid fields are highlighted). Defaults to the old free navigation.
15
+ validateSteps: d = !1,
16
+ MuiAttributes: I = {}
17
+ } = $, [t, u] = G(0), o = w(null), m = B(() => A || `${r}-${P()}`, []), s = Array.isArray(p) ? p : [], i = Math.max(s.length - 1, 0), L = t >= i, k = t <= 0, x = `${m}-step-${t}`, y = S(() => {
18
+ u((e) => Math.max(e - 1, 0));
19
+ }, []), F = S(() => {
20
+ if (!(d && o.current && !o.current.validate())) {
21
+ if (t >= i) {
22
+ n?.({ id: r, value: "complete", option: t });
23
+ return;
24
+ }
25
+ u((e) => Math.min(e + 1, i));
26
+ }
27
+ }, [t, i, r, n, d]), f = ((e) => ({
28
+ borderRadius: `${N + 8}px`,
29
+ textTransform: "none",
30
+ fontWeight: 600,
31
+ px: 3,
32
+ transition: `box-shadow .18s ${c}, transform .18s ${c}`,
33
+ "&:hover": {
34
+ transform: "translateY(-1px)",
35
+ boxShadow: `0 4px 12px ${e.palette.primary.main}22`
36
+ }
37
+ }));
38
+ return /* @__PURE__ */ b(l, { sx: { width: "100%" }, ...I, children: [
39
+ /* @__PURE__ */ a(
40
+ U,
41
+ {
42
+ activeStep: t,
43
+ alternativeLabel: !0,
44
+ sx: {
45
+ mb: 3,
46
+ "& .MuiStepLabel-label": { fontWeight: 500 },
47
+ "& .MuiStepIcon-root.Mui-active": { transition: `color .2s ${c}` }
48
+ },
49
+ children: s.map((e, h) => /* @__PURE__ */ a(j, { children: /* @__PURE__ */ a(C, { children: e?.label ?? `Step ${h + 1}` }) }, `${m}-label-${h}`))
50
+ }
51
+ ),
52
+ /* @__PURE__ */ a(l, { sx: { mb: 3 }, children: s[t] && /* @__PURE__ */ a(
53
+ E,
54
+ {
55
+ guid: x,
56
+ data: s[t].fields ?? [],
57
+ patch: R,
58
+ persistOnUnmount: !0,
59
+ apiRef: o,
60
+ onChange: (e) => {
61
+ n?.(e);
62
+ }
63
+ },
64
+ x
65
+ ) }),
66
+ /* @__PURE__ */ b(l, { sx: { display: "flex", justifyContent: "space-between", gap: 2 }, children: [
67
+ /* @__PURE__ */ a(
68
+ v,
69
+ {
70
+ variant: "outlined",
71
+ onClick: y,
72
+ disabled: k,
73
+ sx: M(f),
74
+ children: "Back"
75
+ }
76
+ ),
77
+ /* @__PURE__ */ a(v, { variant: "contained", onClick: F, sx: M(f), children: L ? g : "Next" })
78
+ ] })
79
+ ] });
80
+ }
81
+ export {
82
+ T as default
83
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),S=require("react"),i=require("@mui/material/Box"),$=require("@mui/material/Link"),m=require("@mui/material/TextField"),w=require("@mui/material/Typography"),o=require("./index-eJceCjKS.js"),b=t=>{if(t&&typeof t=="object")return{lat:t.lat!==void 0&&t.lat!==null?String(t.lat):"",lng:t.lng!==void 0&&t.lng!==null?String(t.lng):""};if(typeof t=="string"&&t.includes(",")){const[c="",a=""]=t.split(",");return{lat:c.trim(),lng:a.trim()}}return{lat:"",lng:""}};function q({attributes:t={},onChange:c}){const{id:a="",label:g="",showMap:h=!1,MuiAttributes:p={}}=t,[n,u]=S.useState(()=>b(t.value));o.useUpdateEffect(()=>{u(b(t.value))},[t.value]);const f=e=>{c?.({id:a,value:{lat:e.lat,lng:e.lng},option:`${e.lat},${e.lng}`})},d=e=>s=>{const r={...n,[e]:s.target.value};u(r),f(r)},y=n.lat!==""&&n.lng!=="",x=o.mergeSx(o.premiumInputSx,p.sx),j=()=>{const e=parseFloat(n.lat),s=parseFloat(n.lng),r=.01;return`https://www.openstreetmap.org/export/embed.html?bbox=${`${s-r},${e-r},${s+r},${e+r}`}&marker=${e},${s}`};return l.jsxs(i,{id:a,children:[g?l.jsx(w,{variant:"body2",sx:{mb:.75,fontWeight:500},children:g}):null,l.jsxs(i,{sx:{display:"flex",gap:1.5,flexWrap:"wrap"},children:[l.jsx(m,{type:"number",...p,label:"Latitude",value:n.lat,onChange:d("lat"),inputProps:{"aria-label":"Latitude",step:"any"},sx:x}),l.jsx(m,{type:"number",...p,label:"Longitude",value:n.lng,onChange:d("lng"),inputProps:{"aria-label":"Longitude",step:"any"},sx:x})]}),l.jsx(i,{sx:{mt:1},children:l.jsx($,{href:`https://www.google.com/maps?q=${n.lat},${n.lng}`,target:"_blank",rel:"noreferrer",variant:"body2",children:"Open in Maps"})}),h&&y?l.jsx(i,{sx:o.mergeSx(e=>({...o.premiumSurfaceSx(e),mt:1.5})),children:l.jsx("iframe",{title:"map",width:"100%",height:"240",style:{border:0,display:"block"},src:j()})}):null]})}exports.default=q;
@@ -0,0 +1,104 @@
1
+ import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
+ import S from "react";
3
+ import s from "@mui/material/Box";
4
+ import L from "@mui/material/Link";
5
+ import f from "@mui/material/TextField";
6
+ import k from "@mui/material/Typography";
7
+ import { u as C, m as b, a as F, b as j } from "./index-Bh6BLrzq.mjs";
8
+ const h = (t) => {
9
+ if (t && typeof t == "object")
10
+ return {
11
+ lat: t.lat !== void 0 && t.lat !== null ? String(t.lat) : "",
12
+ lng: t.lng !== void 0 && t.lng !== null ? String(t.lng) : ""
13
+ };
14
+ if (typeof t == "string" && t.includes(",")) {
15
+ const [i = "", a = ""] = t.split(",");
16
+ return { lat: i.trim(), lng: a.trim() };
17
+ }
18
+ return { lat: "", lng: "" };
19
+ };
20
+ function A({ attributes: t = {}, onChange: i }) {
21
+ const {
22
+ id: a = "",
23
+ label: m = "",
24
+ showMap: x = !1,
25
+ MuiAttributes: p = {}
26
+ } = t, [l, g] = S.useState(() => h(t.value));
27
+ C(() => {
28
+ g(h(t.value));
29
+ }, [t.value]);
30
+ const y = (e) => {
31
+ i?.({
32
+ id: a,
33
+ value: { lat: e.lat, lng: e.lng },
34
+ option: `${e.lat},${e.lng}`
35
+ });
36
+ }, c = (e) => (o) => {
37
+ const n = { ...l, [e]: o.target.value };
38
+ g(n), y(n);
39
+ }, $ = l.lat !== "" && l.lng !== "", d = b(F, p.sx), w = () => {
40
+ const e = parseFloat(l.lat), o = parseFloat(l.lng), n = 0.01;
41
+ return `https://www.openstreetmap.org/export/embed.html?bbox=${`${o - n},${e - n},${o + n},${e + n}`}&marker=${e},${o}`;
42
+ };
43
+ return /* @__PURE__ */ u(s, { id: a, children: [
44
+ m ? /* @__PURE__ */ r(k, { variant: "body2", sx: { mb: 0.75, fontWeight: 500 }, children: m }) : null,
45
+ /* @__PURE__ */ u(s, { sx: { display: "flex", gap: 1.5, flexWrap: "wrap" }, children: [
46
+ /* @__PURE__ */ r(
47
+ f,
48
+ {
49
+ type: "number",
50
+ ...p,
51
+ label: "Latitude",
52
+ value: l.lat,
53
+ onChange: c("lat"),
54
+ inputProps: { "aria-label": "Latitude", step: "any" },
55
+ sx: d
56
+ }
57
+ ),
58
+ /* @__PURE__ */ r(
59
+ f,
60
+ {
61
+ type: "number",
62
+ ...p,
63
+ label: "Longitude",
64
+ value: l.lng,
65
+ onChange: c("lng"),
66
+ inputProps: { "aria-label": "Longitude", step: "any" },
67
+ sx: d
68
+ }
69
+ )
70
+ ] }),
71
+ /* @__PURE__ */ r(s, { sx: { mt: 1 }, children: /* @__PURE__ */ r(
72
+ L,
73
+ {
74
+ href: `https://www.google.com/maps?q=${l.lat},${l.lng}`,
75
+ target: "_blank",
76
+ rel: "noreferrer",
77
+ variant: "body2",
78
+ children: "Open in Maps"
79
+ }
80
+ ) }),
81
+ x && $ ? /* @__PURE__ */ r(
82
+ s,
83
+ {
84
+ sx: b((e) => ({
85
+ ...j(e),
86
+ mt: 1.5
87
+ })),
88
+ children: /* @__PURE__ */ r(
89
+ "iframe",
90
+ {
91
+ title: "map",
92
+ width: "100%",
93
+ height: "240",
94
+ style: { border: 0, display: "block" },
95
+ src: w()
96
+ }
97
+ )
98
+ }
99
+ ) : null
100
+ ] });
101
+ }
102
+ export {
103
+ A as default
104
+ };
@@ -0,0 +1,23 @@
1
+ import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
+ import n from "react";
3
+ import { Paper as p, Typography as l, Box as f } from "@mui/material";
4
+ import { F as c } from "./index-Bh6BLrzq.mjs";
5
+ import { v as d } from "./v4-BysszJq8.mjs";
6
+ function F({ attributes: o = {}, patch: e, onChange: i }) {
7
+ const { MuiAttributes: r = {}, label: s = "Group", subFields: a = [] } = o, m = n.useMemo(() => d(), []);
8
+ return /* @__PURE__ */ u(p, { elevation: 1, sx: { p: 2, mb: 2, ...r.sx }, ...r, children: [
9
+ /* @__PURE__ */ t(l, { variant: "subtitle1", gutterBottom: !0, sx: { fontWeight: 600 }, children: s }),
10
+ /* @__PURE__ */ t(f, { children: /* @__PURE__ */ t(
11
+ c,
12
+ {
13
+ guid: m,
14
+ data: a,
15
+ patch: e,
16
+ onChange: i
17
+ }
18
+ ) })
19
+ ] });
20
+ }
21
+ export {
22
+ F as default
23
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),t=require("@mui/material"),l=require("./index-eJceCjKS.js"),d=require("./v4-CqdK_b8Y.js");function x({attributes:i={},patch:o,onChange:s}){const{MuiAttributes:r={},label:u="Group",subFields:n=[]}=i,a=c.useMemo(()=>d.v4(),[]);return e.jsxs(t.Paper,{elevation:1,sx:{p:2,mb:2,...r.sx},...r,children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,sx:{fontWeight:600},children:u}),e.jsx(t.Box,{children:e.jsx(l.FormGenerator,{guid:a,data:n,patch:o,onChange:s})})]})}exports.default=x;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("@mui/material/ImageList"),g=require("@mui/material/ImageListItem");function l({attributes:s={}}){const{MuiAttributes:o={},items:e=[],width:a=500,height:c=450,cols:u=3,rowHeight:t=164}=s;return i.jsx(n,{sx:{width:a,height:c},cols:u,rowHeight:t,...o,children:(Array.isArray(e)?e:[]).map(r=>i.jsx(g,{children:i.jsx("img",{srcSet:`${r.img}?w=${t}&h=${t}&fit=crop&auto=format&dpr=2 2x`,src:`${r.img}?w=${t}&h=${t}&fit=crop&auto=format`,alt:r.title,loading:"lazy"})},r.img))})}exports.default=l;
@@ -0,0 +1,18 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import c from "@mui/material/ImageList";
3
+ import f from "@mui/material/ImageListItem";
4
+ function n({ attributes: m = {} }) {
5
+ const { MuiAttributes: a = {}, items: o = [], width: s = 500, height: e = 450, cols: g = 3, rowHeight: t = 164 } = m;
6
+ return /* @__PURE__ */ i(c, { sx: { width: s, height: e }, cols: g, rowHeight: t, ...a, children: (Array.isArray(o) ? o : []).map((r) => /* @__PURE__ */ i(f, { children: /* @__PURE__ */ i(
7
+ "img",
8
+ {
9
+ srcSet: `${r.img}?w=${t}&h=${t}&fit=crop&auto=format&dpr=2 2x`,
10
+ src: `${r.img}?w=${t}&h=${t}&fit=crop&auto=format`,
11
+ alt: r.title,
12
+ loading: "lazy"
13
+ }
14
+ ) }, r.img)) });
15
+ }
16
+ export {
17
+ n as default
18
+ };