dynamic-mui 2.4.1 → 2.5.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.
- package/README.md +61 -0
- package/dist/{AIForm-DtRl0WdY.mjs → AIForm-BVJ7qhP5.mjs} +2984 -2778
- package/dist/AIForm-D8_6RVmA.js +44 -0
- package/dist/{accordion-BaiGxDcw.js → accordion-B3fSXKqC.js} +1 -1
- package/dist/{accordion-xg_TxxYS.mjs → accordion-BxTjyh5y.mjs} +1 -1
- package/dist/{addressfield-BvQEHdEk.mjs → addressfield-C9VaV9xw.mjs} +52 -40
- package/dist/addressfield-Cv8zK_sb.js +1 -0
- package/dist/ai/index.cjs +1 -1
- package/dist/ai/index.mjs +1 -1
- package/dist/asyncautocomplete-BveFRqpV.mjs +92 -0
- package/dist/asyncautocomplete-CoOb7mtv.js +1 -0
- package/dist/{bar-DNc7TMKj.mjs → bar-BfMaIpfo.mjs} +1 -1
- package/dist/{bar-BiIzbOC3.js → bar-CE_D8esp.js} +1 -1
- package/dist/cascadeselect-C53hT-C-.mjs +66 -0
- package/dist/cascadeselect-CWECmehh.js +1 -0
- package/dist/collection-Cf87KWZM.js +1 -0
- package/dist/collection-HUYkt74J.mjs +1140 -0
- package/dist/colorpicker-BRQPl_IL.mjs +111 -0
- package/dist/{colorpicker-DpLvK1WR.js → colorpicker-zE3r16Gc.js} +1 -1
- package/dist/components/controls/Collection/CollectionList.d.ts +22 -0
- package/dist/components/controls/Collection/ItemDialog.d.ts +20 -0
- package/dist/components/controls/Collection/collection.d.ts +9 -0
- package/dist/components/controls/Collection/parts.d.ts +39 -0
- package/dist/components/controls/Collection/tree.d.ts +18 -0
- package/dist/components/controls/Collection/ui.d.ts +49 -0
- package/dist/components/controls/index.d.ts +1 -0
- package/dist/{consentfield-B21l9tGo.js → consentfield-CEddOmCa.js} +1 -1
- package/dist/{consentfield-CGT98YbR.mjs → consentfield-Cylid9il.mjs} +13 -11
- package/dist/{datatable-Bv0Q37Zy.js → datatable-3MUZQhnx.js} +1 -1
- package/dist/{datatable-B_6wXh2g.mjs → datatable-BWimO7zD.mjs} +1 -1
- package/dist/dynamic-mui.cjs +1 -1
- package/dist/dynamic-mui.mjs +2 -2
- package/dist/editabletable--ow4E3bB.js +1 -0
- package/dist/{editabletable-YaFqdLvf.mjs → editabletable-CVJ14zrm.mjs} +19 -17
- package/dist/{fileupload--KzSGb5a.js → fileupload-B7f6VOb0.js} +1 -1
- package/dist/{fileupload-ZBi72f1R.mjs → fileupload-DHiYLdJ5.mjs} +16 -3
- package/dist/{formrepeater-Cwgtvz1c.mjs → formrepeater-BGZGTcVb.mjs} +25 -21
- package/dist/{formrepeater-BhUEa4BI.js → formrepeater-CvWeLug8.js} +1 -1
- package/dist/{formwizard-CYcgf5jL.mjs → formwizard-BeJK5mqc.mjs} +1 -1
- package/dist/{formwizard-BlozHDc_.js → formwizard-DrHKFPfN.js} +1 -1
- package/dist/{geofield-xqZy_DAY.mjs → geofield-Bchfb6__.mjs} +28 -24
- package/dist/geofield-thoXisie.js +1 -0
- package/dist/{group-Dtju1rHQ.js → group-B3QBe0YI.js} +1 -1
- package/dist/{group-DmLN-b09.mjs → group-DUnv46e_.mjs} +1 -1
- package/dist/{intlphone-CXUQP9Gp.mjs → intlphone-BY59PVDg.mjs} +12 -8
- package/dist/{intlphone-BeHXAcFi.js → intlphone-CMXEolsT.js} +1 -1
- package/dist/{keyvaluefield-BJoEbe4I.mjs → keyvaluefield-BAYbTkCY.mjs} +4 -2
- package/dist/{keyvaluefield-BZQDG0l5.js → keyvaluefield-FBaHQ8Ak.js} +1 -1
- package/dist/{line-tIm99vYW.js → line-Bk15u06y.js} +1 -1
- package/dist/{line-B3CAbZOo.mjs → line-Bzbkzk7f.mjs} +1 -1
- package/dist/lineitemlist-8NL2THwe.js +1 -0
- package/dist/{lineitemlist-CBSqoC9g.mjs → lineitemlist-PsoQ4LU4.mjs} +23 -19
- package/dist/{list-C8QMpJOJ.mjs → list-BGzVPlgh.mjs} +1 -1
- package/dist/{list-D_cawpPI.js → list-BmGiSIoi.js} +1 -1
- package/dist/locationfield-BG76gNbD.js +1 -0
- package/dist/locationfield-CupDmXsM.mjs +118 -0
- package/dist/{markdowneditor-DFOgRmdL.mjs → markdowneditor-4StkbrKV.mjs} +15 -11
- package/dist/markdowneditor-vDHguMtU.js +2 -0
- package/dist/{matrixfield-0lnuaEks.mjs → matrixfield-CeROIIAj.mjs} +34 -30
- package/dist/{matrixfield-nWt6Cug5.js → matrixfield-Vptf0zNH.js} +1 -1
- package/dist/{mixChart-ISf3Kbr-.mjs → mixChart-Doq4lt7Z.mjs} +2 -2
- package/dist/mixChart-rgyMCdnp.js +1 -0
- package/dist/{multitextbox-DmAWV163.mjs → multitextbox-DeVv6uzi.mjs} +1 -1
- package/dist/{multitextbox-oEgl2F8-.js → multitextbox-DtSydHcv.js} +1 -1
- package/dist/{npsscale-CdTEwERY.mjs → npsscale-Cd7PoCJS.mjs} +7 -3
- package/dist/{npsscale-DW4sxcLz.js → npsscale-Dwp2T0DQ.js} +1 -1
- package/dist/{numberstepper-BwQ5coLc.mjs → numberstepper-BFNTu3Ii.mjs} +6 -2
- package/dist/{numberstepper-cDosevJb.js → numberstepper-DBKq7hUm.js} +1 -1
- package/dist/{pie-gAfuDR1F.js → pie-CE4QV82D.js} +1 -1
- package/dist/{pie-CBRckgd4.mjs → pie-DKRRH37e.mjs} +1 -1
- package/dist/richtexteditor-B6lK2iIt.js +1 -0
- package/dist/{richtexteditor-xrbv8PXZ.mjs → richtexteditor-DdIfi0-T.mjs} +4 -2
- package/dist/schema.d.ts +10 -2
- package/dist/{signature-FM6L60nk.js → signature-B_drsWTj.js} +2 -2
- package/dist/{signature-CP_lA_Yh.mjs → signature-D9B8bFqg.mjs} +4 -2
- package/dist/{stepper-CjGNFyBz.js → stepper-CO6XiIaw.js} +1 -1
- package/dist/{stepper-BprezTzX.mjs → stepper-D6e9yWIr.mjs} +1 -1
- package/dist/{summaryfield-5mJRwVZ4.mjs → summaryfield-BIA2gc1w.mjs} +1 -1
- package/dist/{summaryfield-C3xmqZQp.js → summaryfield-CR3aNMZU.js} +1 -1
- package/dist/{tabs-B4P59kHX.js → tabs-B4ZbZQvt.js} +1 -1
- package/dist/{tabs-By-Mm8vm.mjs → tabs-PgOpdVX1.mjs} +1 -1
- package/dist/tagsinput-DtNb1IuV.js +1 -0
- package/dist/tagsinput-G_M0DbpI.mjs +58 -0
- package/dist/types.d.ts +188 -0
- package/dist/util/collection.d.ts +82 -0
- package/package.json +11 -11
- package/dist/AIForm-Dv8ahXyE.js +0 -43
- package/dist/addressfield-vVizrbZP.js +0 -1
- package/dist/asyncautocomplete-AmSRs7PY.mjs +0 -89
- package/dist/asyncautocomplete-Dtmxh4l1.js +0 -1
- package/dist/cascadeselect-BlznIKS6.mjs +0 -64
- package/dist/cascadeselect-DqLtG-W9.js +0 -1
- package/dist/colorpicker-hP3b7teC.mjs +0 -98
- package/dist/editabletable-D3c3DJxX.js +0 -1
- package/dist/geofield-BynrTSVm.js +0 -1
- package/dist/lineitemlist-RqStjYB-.js +0 -1
- package/dist/locationfield-BiLy-c09.js +0 -1
- package/dist/locationfield-KBbu-98L.mjs +0 -119
- package/dist/markdowneditor-Dy7Q01FM.js +0 -2
- package/dist/mixChart-C3o184UT.js +0 -1
- package/dist/richtexteditor-DI-h5Efn.js +0 -1
- package/dist/tagsinput-BwM3NYK_.js +0 -1
- package/dist/tagsinput-Ce4EWy4i.mjs +0 -58
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as _, useState as $, useRef as G, useCallback as y } from "react";
|
|
3
|
-
import { Box as
|
|
4
|
-
import { q as
|
|
3
|
+
import { Box as R, TextField as S, InputAdornment as T, Icon as A, Accordion as j, AccordionSummary as q, Typography as z, AccordionDetails as D } from "@mui/material";
|
|
4
|
+
import { q as M, F as P } from "./AIForm-BVJ7qhP5.mjs";
|
|
5
5
|
import { v as W } from "./v4-BysszJq8.mjs";
|
|
6
6
|
function H({ attributes: h = {}, rules: v = {}, onChange: o }) {
|
|
7
7
|
const {
|
|
@@ -15,20 +15,20 @@ function H({ attributes: h = {}, rules: v = {}, onChange: o }) {
|
|
|
15
15
|
if (Array.isArray(i) && i.length > 0) return i.length;
|
|
16
16
|
const r = Number(h.count);
|
|
17
17
|
return !isNaN(r) && r >= n ? r : n;
|
|
18
|
-
}, []), [u, C] = $(N),
|
|
18
|
+
}, []), [u, C] = $(N), l = G([]), c = y((r) => (l.current[r] || (l.current[r] = W()), l.current[r]), []), x = y((r) => {
|
|
19
19
|
if (!o) return;
|
|
20
|
-
const t = Array.from({ length: r }, (
|
|
21
|
-
const p = `${s}-group-${
|
|
22
|
-
return
|
|
20
|
+
const t = Array.from({ length: r }, (d, m) => {
|
|
21
|
+
const p = `${s}-group-${c(m)}`;
|
|
22
|
+
return M(p) ?? {};
|
|
23
23
|
});
|
|
24
24
|
o({ id: s, value: t });
|
|
25
|
-
}, [s,
|
|
25
|
+
}, [s, c, o]), I = (r) => {
|
|
26
26
|
let t = parseInt(r, 10);
|
|
27
27
|
(isNaN(t) || t < n) && (t = n), a !== void 0 && t > a && (t = a), C(t), setTimeout(() => x(t), 0);
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */ f(
|
|
29
|
+
return /* @__PURE__ */ f(R, { sx: { width: "100%" }, children: [
|
|
30
30
|
/* @__PURE__ */ e(
|
|
31
|
-
|
|
31
|
+
S,
|
|
32
32
|
{
|
|
33
33
|
type: "number",
|
|
34
34
|
size: "small",
|
|
@@ -36,25 +36,29 @@ function H({ attributes: h = {}, rules: v = {}, onChange: o }) {
|
|
|
36
36
|
value: u,
|
|
37
37
|
onChange: (r) => I(r.target.value),
|
|
38
38
|
required: F,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
sx: { mb: 2, minWidth: 200 },
|
|
40
|
+
slotProps: {
|
|
41
|
+
input: {
|
|
42
|
+
startAdornment: /* @__PURE__ */ e(T, { position: "start", children: /* @__PURE__ */ e(A, { fontSize: "small", children: "format_list_numbered" }) })
|
|
43
|
+
},
|
|
44
|
+
htmlInput: { min: n, ...a !== void 0 ? { max: a } : {} }
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
),
|
|
46
48
|
Array.from({ length: u }, (r, t) => {
|
|
47
|
-
const
|
|
48
|
-
return /* @__PURE__ */ f(
|
|
49
|
-
/* @__PURE__ */ e(
|
|
49
|
+
const d = `${s}-group-${c(t)}`, m = Array.isArray(i) ? i[t] : void 0;
|
|
50
|
+
return /* @__PURE__ */ f(j, { defaultExpanded: t === 0, sx: { mb: 1 }, children: [
|
|
51
|
+
/* @__PURE__ */ e(q, { expandIcon: /* @__PURE__ */ e(A, { children: "expand_more" }), children: /* @__PURE__ */ f(z, { sx: {
|
|
52
|
+
fontWeight: 600
|
|
53
|
+
}, children: [
|
|
50
54
|
g,
|
|
51
55
|
" ",
|
|
52
56
|
t + 1
|
|
53
57
|
] }) }),
|
|
54
|
-
/* @__PURE__ */ e(
|
|
55
|
-
|
|
58
|
+
/* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
|
|
59
|
+
P,
|
|
56
60
|
{
|
|
57
|
-
guid:
|
|
61
|
+
guid: d,
|
|
58
62
|
data: b,
|
|
59
63
|
patch: m ?? {},
|
|
60
64
|
onChange: (p) => {
|
|
@@ -62,7 +66,7 @@ function H({ attributes: h = {}, rules: v = {}, onChange: o }) {
|
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
) })
|
|
65
|
-
] },
|
|
69
|
+
] }, d);
|
|
66
70
|
})
|
|
67
71
|
] });
|
|
68
72
|
}
|
|
@@ -1 +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("./AIForm-
|
|
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("./AIForm-D8_6RVmA.js"),C=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:A=[],value:a}=f,v=j?.validation?.some(e=>e.rule==="mandatory")||!1,F=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,I]=i.useState(F),d=i.useRef([]),m=i.useCallback(e=>(d.current[e]||(d.current[e]=C.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]),q=e=>{let r=parseInt(e,10);(isNaN(r)||r<s)&&(r=s),u!==void 0&&r>u&&(r=u),I(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=>q(e.target.value),required:v,sx:{mb:2,minWidth:200},slotProps:{input:{startAdornment:t.jsx(n.InputAdornment,{position:"start",children:t.jsx(n.Icon,{fontSize:"small",children:"format_list_numbered"})})},htmlInput:{min:s,...u!==void 0?{max:u}:{}}}}),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,{sx:{fontWeight:600},children:[g," ",r+1]})}),t.jsx(n.AccordionDetails,{children:t.jsx(b.FormGenerator,{guid:p,data:A,patch:x??{},onChange:h=>{y(l),o&&o(h)}})})]},p)})]})}exports.default=N;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useState as G, useRef as w, useMemo as B, useCallback as S } from "react";
|
|
3
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, o as N } from "./AIForm-
|
|
4
|
+
import { P as c, F as E, m as M, o as N } from "./AIForm-BVJ7qhP5.mjs";
|
|
5
5
|
import { v as P } from "./v4-BysszJq8.mjs";
|
|
6
6
|
function T({ attributes: $ = {}, onChange: n }) {
|
|
7
7
|
const {
|
|
@@ -1 +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("./AIForm-
|
|
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("./AIForm-D8_6RVmA.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),I=e>=o,R=e<=0,m=`${h}-step-${e}`,A=a.useCallback(()=>{p(t=>Math.max(t-1,0))},[]),g=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]),b=(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:m,data:r[e].fields??[],patch:v,persistOnUnmount:!0,apiRef:u,onChange:t=>{l?.(t)}},m)}),s.jsxs(n.Box,{sx:{display:"flex",justifyContent:"space-between",gap:2},children:[s.jsx(n.Button,{variant:"outlined",onClick:A,disabled:R,sx:i.mergeSx(b),children:"Back"}),s.jsx(n.Button,{variant:"contained",onClick:g,sx:i.mergeSx(b),children:I?j:"Next"})]})]})}exports.default=B;
|
|
@@ -2,9 +2,9 @@ import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import S from "react";
|
|
3
3
|
import s from "@mui/material/Box";
|
|
4
4
|
import k from "@mui/material/Link";
|
|
5
|
-
import
|
|
5
|
+
import h from "@mui/material/TextField";
|
|
6
6
|
import L from "@mui/material/Typography";
|
|
7
|
-
import { j, m as
|
|
7
|
+
import { j, m as f, k as C, l as F } from "./AIForm-BVJ7qhP5.mjs";
|
|
8
8
|
const b = (t) => {
|
|
9
9
|
if (t && typeof t == "object")
|
|
10
10
|
return {
|
|
@@ -17,61 +17,65 @@ const b = (t) => {
|
|
|
17
17
|
}
|
|
18
18
|
return { lat: "", lng: "" };
|
|
19
19
|
};
|
|
20
|
-
function
|
|
20
|
+
function v({ attributes: t = {}, onChange: i }) {
|
|
21
21
|
const {
|
|
22
22
|
id: a = "",
|
|
23
23
|
label: m = "",
|
|
24
24
|
showMap: x = !1,
|
|
25
25
|
MuiAttributes: p = {}
|
|
26
|
-
} = t, [
|
|
26
|
+
} = t, [e, g] = S.useState(() => b(t.value));
|
|
27
27
|
j(() => {
|
|
28
28
|
g(b(t.value));
|
|
29
29
|
}, [t.value]);
|
|
30
|
-
const y = (
|
|
30
|
+
const y = (l) => {
|
|
31
31
|
i?.({
|
|
32
32
|
id: a,
|
|
33
|
-
value: { lat:
|
|
34
|
-
option: `${
|
|
33
|
+
value: { lat: l.lat, lng: l.lng },
|
|
34
|
+
option: `${l.lat},${l.lng}`
|
|
35
35
|
});
|
|
36
|
-
}, c = (
|
|
37
|
-
const n = { ...
|
|
36
|
+
}, c = (l) => (o) => {
|
|
37
|
+
const n = { ...e, [l]: o.target.value };
|
|
38
38
|
g(n), y(n);
|
|
39
|
-
}, $ =
|
|
40
|
-
const
|
|
41
|
-
return `https://www.openstreetmap.org/export/embed.html?bbox=${`${o - n},${
|
|
39
|
+
}, $ = e.lat !== "" && e.lng !== "", d = f(C, p.sx), w = () => {
|
|
40
|
+
const l = parseFloat(e.lat), o = parseFloat(e.lng), n = 0.01;
|
|
41
|
+
return `https://www.openstreetmap.org/export/embed.html?bbox=${`${o - n},${l - n},${o + n},${l + n}`}&marker=${l},${o}`;
|
|
42
42
|
};
|
|
43
43
|
return /* @__PURE__ */ u(s, { id: a, children: [
|
|
44
44
|
m ? /* @__PURE__ */ r(L, { variant: "body2", sx: { mb: 0.75, fontWeight: 500 }, children: m }) : null,
|
|
45
45
|
/* @__PURE__ */ u(s, { sx: { display: "flex", gap: 1.5, flexWrap: "wrap" }, children: [
|
|
46
46
|
/* @__PURE__ */ r(
|
|
47
|
-
|
|
47
|
+
h,
|
|
48
48
|
{
|
|
49
49
|
type: "number",
|
|
50
50
|
...p,
|
|
51
51
|
label: "Latitude",
|
|
52
|
-
value:
|
|
52
|
+
value: e.lat,
|
|
53
53
|
onChange: c("lat"),
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
sx: d,
|
|
55
|
+
slotProps: {
|
|
56
|
+
htmlInput: { "aria-label": "Latitude", step: "any" }
|
|
57
|
+
}
|
|
56
58
|
}
|
|
57
59
|
),
|
|
58
60
|
/* @__PURE__ */ r(
|
|
59
|
-
|
|
61
|
+
h,
|
|
60
62
|
{
|
|
61
63
|
type: "number",
|
|
62
64
|
...p,
|
|
63
65
|
label: "Longitude",
|
|
64
|
-
value:
|
|
66
|
+
value: e.lng,
|
|
65
67
|
onChange: c("lng"),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
sx: d,
|
|
69
|
+
slotProps: {
|
|
70
|
+
htmlInput: { "aria-label": "Longitude", step: "any" }
|
|
71
|
+
}
|
|
68
72
|
}
|
|
69
73
|
)
|
|
70
74
|
] }),
|
|
71
75
|
/* @__PURE__ */ r(s, { sx: { mt: 1 }, children: /* @__PURE__ */ r(
|
|
72
76
|
k,
|
|
73
77
|
{
|
|
74
|
-
href: `https://www.google.com/maps?q=${
|
|
78
|
+
href: `https://www.google.com/maps?q=${e.lat},${e.lng}`,
|
|
75
79
|
target: "_blank",
|
|
76
80
|
rel: "noreferrer",
|
|
77
81
|
variant: "body2",
|
|
@@ -81,8 +85,8 @@ function A({ attributes: t = {}, onChange: i }) {
|
|
|
81
85
|
x && $ ? /* @__PURE__ */ r(
|
|
82
86
|
s,
|
|
83
87
|
{
|
|
84
|
-
sx:
|
|
85
|
-
...F(
|
|
88
|
+
sx: f((l) => ({
|
|
89
|
+
...F(l),
|
|
86
90
|
mt: 1.5
|
|
87
91
|
})),
|
|
88
92
|
children: /* @__PURE__ */ r(
|
|
@@ -100,5 +104,5 @@ function A({ attributes: t = {}, onChange: i }) {
|
|
|
100
104
|
] });
|
|
101
105
|
}
|
|
102
106
|
export {
|
|
103
|
-
|
|
107
|
+
v as default
|
|
104
108
|
};
|
|
@@ -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"),x=require("@mui/material/TextField"),w=require("@mui/material/Typography"),o=require("./AIForm-D8_6RVmA.js"),h=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:b=!1,MuiAttributes:p={}}=t,[n,u]=S.useState(()=>h(t.value));o.useUpdateEffect(()=>{u(h(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!=="",m=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(x,{type:"number",...p,label:"Latitude",value:n.lat,onChange:d("lat"),sx:m,slotProps:{htmlInput:{"aria-label":"Latitude",step:"any"}}}),l.jsx(x,{type:"number",...p,label:"Longitude",value:n.lng,onChange:d("lng"),sx:m,slotProps:{htmlInput:{"aria-label":"Longitude",step:"any"}}})]}),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"})}),b&&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;
|
|
@@ -1 +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("./AIForm-
|
|
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("./AIForm-D8_6RVmA.js"),d=require("./v4-CqdK_b8Y.js");function x({attributes:o={},patch:s,onChange:i}){const{MuiAttributes:r={},label:u="Group",subFields:n=[]}=o,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:s,onChange:i})})]})}exports.default=x;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import n from "react";
|
|
3
3
|
import { Paper as p, Typography as l, Box as f } from "@mui/material";
|
|
4
|
-
import { F as c } from "./AIForm-
|
|
4
|
+
import { F as c } from "./AIForm-BVJ7qhP5.mjs";
|
|
5
5
|
import { v as d } from "./v4-BysszJq8.mjs";
|
|
6
6
|
function F({ attributes: o = {}, patch: e, onChange: i }) {
|
|
7
7
|
const { MuiAttributes: r = {}, label: s = "Group", subFields: a = [] } = o, m = n.useMemo(() => d(), []);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as m, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import x from "react";
|
|
3
|
-
import { j as k, m as I, k as A, r as G } from "./AIForm-
|
|
3
|
+
import { j as k, m as I, k as A, r as G } from "./AIForm-BVJ7qhP5.mjs";
|
|
4
4
|
import v from "@mui/material/Stack";
|
|
5
5
|
import N from "@mui/material/TextField";
|
|
6
6
|
import F from "@mui/material/MenuItem";
|
|
@@ -84,7 +84,9 @@ function H({ attributes: e = {}, rules: r = {}, onChange: f }) {
|
|
|
84
84
|
};
|
|
85
85
|
return /* @__PURE__ */ m(K, { component: "fieldset", fullWidth: !0, children: [
|
|
86
86
|
t && /* @__PURE__ */ c(w, { component: "legend", required: y, sx: { mb: 1 }, children: t }),
|
|
87
|
-
/* @__PURE__ */ m(v, { direction: "row", spacing: 1,
|
|
87
|
+
/* @__PURE__ */ m(v, { direction: "row", spacing: 1, sx: {
|
|
88
|
+
alignItems: "flex-start"
|
|
89
|
+
}, children: [
|
|
88
90
|
/* @__PURE__ */ c(
|
|
89
91
|
N,
|
|
90
92
|
{
|
|
@@ -94,17 +96,19 @@ function H({ attributes: e = {}, rules: r = {}, onChange: f }) {
|
|
|
94
96
|
size: "small",
|
|
95
97
|
label: "Country",
|
|
96
98
|
"aria-label": "Country dial code",
|
|
97
|
-
SelectProps: {
|
|
98
|
-
renderValue: (a) => {
|
|
99
|
-
const l = n.find((i) => i.code === a) || n[0];
|
|
100
|
-
return `${l.flag} ${l.dial}`;
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
99
|
sx: I(A, {
|
|
104
100
|
minWidth: 120,
|
|
105
101
|
flexShrink: 0,
|
|
106
102
|
...s
|
|
107
103
|
}),
|
|
104
|
+
slotProps: {
|
|
105
|
+
select: {
|
|
106
|
+
renderValue: (a) => {
|
|
107
|
+
const l = n.find((i) => i.code === a) || n[0];
|
|
108
|
+
return `${l.flag} ${l.dial}`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
108
112
|
children: n.map((a) => /* @__PURE__ */ m(F, { value: a.code, children: [
|
|
109
113
|
a.flag,
|
|
110
114
|
" ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),C=require("react"),t=require("./AIForm-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),C=require("react"),t=require("./AIForm-D8_6RVmA.js"),U=require("@mui/material/Stack"),I=require("@mui/material/TextField"),M=require("@mui/material/MenuItem"),T=require("@mui/material/FormControl"),j=require("@mui/material/FormLabel"),n=[{code:"US",name:"United States",dial:"+1",flag:"🇺🇸"},{code:"GB",name:"United Kingdom",dial:"+44",flag:"🇬🇧"},{code:"IN",name:"India",dial:"+91",flag:"🇮🇳"},{code:"CA",name:"Canada",dial:"+1",flag:"🇨🇦"},{code:"AU",name:"Australia",dial:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dial:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dial:"+33",flag:"🇫🇷"},{code:"IT",name:"Italy",dial:"+39",flag:"🇮🇹"},{code:"ES",name:"Spain",dial:"+34",flag:"🇪🇸"},{code:"BR",name:"Brazil",dial:"+55",flag:"🇧🇷"},{code:"MX",name:"Mexico",dial:"+52",flag:"🇲🇽"},{code:"JP",name:"Japan",dial:"+81",flag:"🇯🇵"},{code:"CN",name:"China",dial:"+86",flag:"🇨🇳"},{code:"RU",name:"Russia",dial:"+7",flag:"🇷🇺"},{code:"ZA",name:"South Africa",dial:"+27",flag:"🇿🇦"},{code:"NG",name:"Nigeria",dial:"+234",flag:"🇳🇬"},{code:"KE",name:"Kenya",dial:"+254",flag:"🇰🇪"},{code:"AE",name:"United Arab Emirates",dial:"+971",flag:"🇦🇪"},{code:"SA",name:"Saudi Arabia",dial:"+966",flag:"🇸🇦"},{code:"SG",name:"Singapore",dial:"+65",flag:"🇸🇬"},{code:"MY",name:"Malaysia",dial:"+60",flag:"🇲🇾"},{code:"ID",name:"Indonesia",dial:"+62",flag:"🇮🇩"},{code:"PH",name:"Philippines",dial:"+63",flag:"🇵🇭"},{code:"TH",name:"Thailand",dial:"+66",flag:"🇹🇭"},{code:"VN",name:"Vietnam",dial:"+84",flag:"🇻🇳"},{code:"KR",name:"South Korea",dial:"+82",flag:"🇰🇷"},{code:"NZ",name:"New Zealand",dial:"+64",flag:"🇳🇿"},{code:"IE",name:"Ireland",dial:"+353",flag:"🇮🇪"},{code:"NL",name:"Netherlands",dial:"+31",flag:"🇳🇱"},{code:"SE",name:"Sweden",dial:"+46",flag:"🇸🇪"},{code:"NO",name:"Norway",dial:"+47",flag:"🇳🇴"},{code:"DK",name:"Denmark",dial:"+45",flag:"🇩🇰"},{code:"CH",name:"Switzerland",dial:"+41",flag:"🇨🇭"},{code:"PL",name:"Poland",dial:"+48",flag:"🇵🇱"},{code:"PT",name:"Portugal",dial:"+351",flag:"🇵🇹"},{code:"GR",name:"Greece",dial:"+30",flag:"🇬🇷"},{code:"TR",name:"Turkey",dial:"+90",flag:"🇹🇷"},{code:"EG",name:"Egypt",dial:"+20",flag:"🇪🇬"},{code:"AR",name:"Argentina",dial:"+54",flag:"🇦🇷"},{code:"CL",name:"Chile",dial:"+56",flag:"🇨🇱"}];function A(a,m){if(typeof a=="string"&&a.trim()){const d=[...n].sort((i,c)=>c.dial.length-i.dial.length).find(i=>a.startsWith(i.dial));if(d)return{code:d.code,number:a.slice(d.dial.length).trim()}}return{code:m,number:""}}function v({attributes:a={},rules:m={},onChange:s}){const{id:d="",defaultCountry:i="US",label:c,MuiAttributes:N={}}=a,{sx:u,...P}=N,f=n.some(e=>e.code===i)?i:"US",g=A(a.value,f),[h,S]=C.useState(g.code),[p,x]=C.useState(g.number);t.useUpdateEffect(()=>{const e=A(a.value,f);S(e.code),x(e.number)},[a.value]);const b=m?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,y=(e,l)=>{const r=n.find(q=>q.code===e)||n[0];s?.({id:d,value:`${r.dial} ${l}`.trim(),option:{country:r.code,dial:r.dial,number:l}})},E=e=>{const l=e.target.value;S(l),y(l,p)},R=e=>{x(e.value),y(h,e.value)};return o.jsxs(T,{component:"fieldset",fullWidth:!0,children:[c&&o.jsx(j,{component:"legend",required:b,sx:{mb:1},children:c}),o.jsxs(U,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[o.jsx(I,{select:!0,value:h,onChange:E,size:"small",label:"Country","aria-label":"Country dial code",sx:t.mergeSx(t.premiumInputSx,{minWidth:120,flexShrink:0,...u}),slotProps:{select:{renderValue:e=>{const l=n.find(r=>r.code===e)||n[0];return`${l.flag} ${l.dial}`}}},children:n.map(e=>o.jsxs(M,{value:e.code,children:[e.flag," ",e.name," (",e.dial,")"]},e.code))}),o.jsx(t.PatternFormat,{customInput:I,format:"### ### ####",mask:"_",value:p,onValueChange:R,fullWidth:!0,required:b,label:"Phone number",id:d,name:"intlphone",...P,sx:t.mergeSx(t.premiumInputSx,u)})]})]})}exports.default=v;
|
|
@@ -9,7 +9,7 @@ import q from "@mui/material/FormLabel";
|
|
|
9
9
|
import w from "@mui/material/FormHelperText";
|
|
10
10
|
import B from "@mui/icons-material/Add";
|
|
11
11
|
import K from "@mui/icons-material/Close";
|
|
12
|
-
import { j as V, m as b, k as A } from "./AIForm-
|
|
12
|
+
import { j as V, m as b, k as A } from "./AIForm-BVJ7qhP5.mjs";
|
|
13
13
|
function C(t) {
|
|
14
14
|
return Array.isArray(t) ? t.map((r) => ({
|
|
15
15
|
key: r?.key ?? "",
|
|
@@ -54,7 +54,9 @@ function Z({ attributes: t = {}, rules: r = {}, onChange: n }) {
|
|
|
54
54
|
{
|
|
55
55
|
direction: "row",
|
|
56
56
|
spacing: 1,
|
|
57
|
-
|
|
57
|
+
sx: {
|
|
58
|
+
alignItems: "center"
|
|
59
|
+
},
|
|
58
60
|
children: [
|
|
59
61
|
/* @__PURE__ */ a(
|
|
60
62
|
v,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),F=require("react"),v=require("@mui/material/Stack"),j=require("@mui/material/TextField"),z=require("@mui/material/IconButton"),M=require("@mui/material/Button"),T=require("@mui/material/FormControl"),W=require("@mui/material/FormLabel"),E=require("@mui/material/FormHelperText"),L=require("@mui/icons-material/Add"),w=require("@mui/icons-material/Close"),i=require("./AIForm-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),F=require("react"),v=require("@mui/material/Stack"),j=require("@mui/material/TextField"),z=require("@mui/material/IconButton"),M=require("@mui/material/Button"),T=require("@mui/material/FormControl"),W=require("@mui/material/FormLabel"),E=require("@mui/material/FormHelperText"),L=require("@mui/icons-material/Add"),w=require("@mui/icons-material/Close"),i=require("./AIForm-D8_6RVmA.js");function k(t){return Array.isArray(t)?t.map(r=>({key:r?.key??"",value:r?.value??""})):t&&typeof t=="object"?Object.keys(t).map(r=>({key:r,value:String(t[r]??"")})):[]}function B(t){const r={};return t.forEach(l=>{l.key!==""&&(r[l.key]=l.value)}),r}function K({attributes:t={},rules:r={},onChange:l}){const{MuiAttributes:q={},id:b="",keyLabel:S="Key",valueLabel:A="Value",label:m}=t,{sx:x,...y}=q,[a,u]=F.useState(()=>k(t.value)),f=r?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1;i.useUpdateEffect(()=>{u(k(t.value))},[t.value]);const d=e=>{l?.({id:b,value:B(e),option:e})},h=(e,o,s)=>{const c=a.map((g,R)=>R===e?{...g,[o]:s}:g);u(c),d(c)},C=()=>{const e=[...a,{key:"",value:""}];u(e),d(e)},I=e=>{const o=a.filter((s,c)=>c!==e);u(o),d(o)},p=f&&a.filter(e=>e.key!=="").length===0;return n.jsxs(T,{component:"fieldset",error:p,fullWidth:!0,children:[m&&n.jsx(W,{component:"legend",required:f,sx:{mb:1},children:m}),n.jsx(v,{spacing:1.25,children:a.map((e,o)=>n.jsxs(v,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[n.jsx(j,{...y,label:S,value:e.key,onChange:s=>h(o,"key",s.target.value),size:"small",fullWidth:!0,sx:i.mergeSx(i.premiumInputSx,x)}),n.jsx(j,{...y,label:A,value:e.value,onChange:s=>h(o,"value",s.target.value),size:"small",fullWidth:!0,sx:i.mergeSx(i.premiumInputSx,x)}),n.jsx(z,{"aria-label":`Remove ${e.key||"row"}`,onClick:()=>I(o),size:"small",sx:{borderRadius:2,color:"text.secondary","&:hover":{color:"error.main"}},children:n.jsx(w,{fontSize:"small"})})]},o))}),n.jsx(M,{onClick:C,startIcon:n.jsx(L,{}),size:"small",variant:"text",sx:{alignSelf:"flex-start",mt:1,borderRadius:2,textTransform:"none",fontWeight:600},children:"Add"}),p&&n.jsx(E,{children:r?.validation?.find(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")?.message||"At least one entry is required"})]})}exports.default=K;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var c=Object.create;var u=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var x=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l(t))!d.call(e,i)&&i!==r&&u(e,i,{get:()=>t[i],enumerable:!(n=a(t,i))||n.enumerable});return e};var f=(e,t,r)=>(r=e!=null?c(h(e)):{},x(t||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),j=require("@mui/material/Box"),C=require("@mui/material/CircularProgress"),y=require("./AIForm-
|
|
1
|
+
"use strict";var c=Object.create;var u=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var x=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l(t))!d.call(e,i)&&i!==r&&u(e,i,{get:()=>t[i],enumerable:!(n=a(t,i))||n.enumerable});return e};var f=(e,t,r)=>(r=e!=null?c(h(e)):{},x(t||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),j=require("@mui/material/Box"),C=require("@mui/material/CircularProgress"),y=require("./AIForm-D8_6RVmA.js"),g=o.lazy(()=>import("@mui/x-charts/LineChart").then(e=>({default:e.LineChart})));function p({attributes:e={}}){const{MuiChartAttributes:t={},id:r=""}=e,n=y.getMuiX("LineChart")||g;return s.jsx(o.Suspense,{fallback:s.jsx(j,{sx:{display:"flex",justifyContent:"center",p:2},children:s.jsx(C,{})}),children:s.jsx(n,{height:300,...t},r)})}exports.default=p;
|
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import n, { Suspense as a } from "react";
|
|
3
3
|
import s from "@mui/material/Box";
|
|
4
4
|
import f from "@mui/material/CircularProgress";
|
|
5
|
-
import { i as m } from "./AIForm-
|
|
5
|
+
import { i as m } from "./AIForm-BVJ7qhP5.mjs";
|
|
6
6
|
const c = n.lazy(
|
|
7
7
|
() => import("@mui/x-charts/LineChart").then((r) => ({ default: r.LineChart }))
|
|
8
8
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),g=require("react"),a=require("@mui/material"),T=require("./AIForm-D8_6RVmA.js");function k(t,o){if(Array.isArray(t)&&t.length>0){const l=t[0],c=Object.keys(l).find(d=>d!=="fee");if(c)return c.replace(/\d+$/,"")}return o}function v(t,o){return Array.isArray(t)&&t.length>0?t.map((l,c)=>{const{fee:d=0,...f}=l,u=Object.keys(f)[0]||`${o}${c+1}`;return{key:u,description:String(f[u]??""),fee:Number(d)||0}}):[{key:`${o}1`,description:"",fee:0}]}function W(t){return t.map(o=>({fee:o.fee,[o.key]:o.description}))}function F({attributes:t={},rules:o={},onChange:l}){const{id:c="",keyPrefix:d="item",showRowBadge:f=!0,readOnly:u=!1,showActions:I=!0,MuiAttributes:j={}}=t,w=I&&!u,{row:P={},rowBadge:b={},description:A={},fee:B={},addButton:S={},removeButton:C={}}=j,h=o?.validation?.some(e=>e.rule==="mandatory")||!1,m=k(t.value,d),[s,p]=g.useState(()=>v(t.value,m));T.useUpdateEffect(()=>{const e=k(t.value,d),n=v(t.value,e);JSON.stringify(n)!==JSON.stringify(s)&&p(n)},[t.value]),g.useEffect(()=>{l&&l({id:c,value:W(s)})},[s,c]);const $=()=>{const e=s.length+1;p([...s,{key:`${m}${e}`,description:"",fee:0}])},R=e=>{const r=s.filter((x,y)=>y!==e).map((x,y)=>({...x,key:`${m}${y+1}`}));p(r)},q=(e,n)=>{const r=[...s];r[e]={...r[e],description:n},p(r)},O=(e,n)=>{const r=[...s];r[e]={...r[e],fee:Number(n)||0},p(r)};return i.jsx(a.Stack,{spacing:1.5,sx:{width:"100%"},children:s.map((e,n)=>i.jsxs(a.Box,{sx:{display:"flex",gap:1,alignItems:"flex-start",p:1.5,border:"1px solid",borderColor:"divider",borderRadius:1,backgroundColor:"background.paper"},...P,children:[f&&i.jsx(a.Typography,{variant:"caption",sx:{minWidth:24,height:24,borderRadius:"50%",backgroundColor:"primary.main",color:"primary.contrastText",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,flexShrink:0,mt:.75},...b,children:n+1}),i.jsx(a.TextField,{fullWidth:!0,size:"small",label:"Description",required:h,error:h&&!e.description,helperText:h&&!e.description?"Required":"",value:e.description,onChange:r=>q(n,r.target.value),...A,slotProps:{input:{readOnly:u}}}),i.jsx(a.TextField,{size:"small",label:"Fee",type:"number",sx:{minWidth:120},required:h,value:e.fee,onChange:r=>O(n,r.target.value),onWheel:r=>r.target.blur(),...B,slotProps:{input:{readOnly:u,startAdornment:i.jsx(a.InputAdornment,{position:"start",children:"$"})},htmlInput:{min:0,step:.01}}}),w&&(n===s.length-1?i.jsx(a.Button,{variant:"contained",color:"primary",onClick:$,sx:{minWidth:40,px:1,height:40,flexShrink:0},title:"Add row",...S,children:i.jsx(a.Icon,{children:"add"})}):i.jsx(a.IconButton,{color:"error",onClick:()=>R(n),sx:{height:40,flexShrink:0},title:"Remove row",...C,children:i.jsx(a.Icon,{children:"delete"})}))]},e.key))})}exports.default=F;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as s, jsxs as O } from "react/jsx-runtime";
|
|
2
2
|
import { useState as N, useEffect as T } from "react";
|
|
3
3
|
import { Stack as q, Box as z, Typography as E, TextField as g, InputAdornment as F, Button as D, Icon as x, IconButton as J } from "@mui/material";
|
|
4
|
-
import { j as L } from "./AIForm-
|
|
4
|
+
import { j as L } from "./AIForm-BVJ7qhP5.mjs";
|
|
5
5
|
function k(r, o) {
|
|
6
6
|
if (Array.isArray(r) && r.length > 0) {
|
|
7
|
-
const c = r[0], a = Object.keys(c).find((
|
|
7
|
+
const c = r[0], a = Object.keys(c).find((l) => l !== "fee");
|
|
8
8
|
if (a)
|
|
9
9
|
return a.replace(/\d+$/, "");
|
|
10
10
|
}
|
|
@@ -12,11 +12,11 @@ function k(r, o) {
|
|
|
12
12
|
}
|
|
13
13
|
function v(r, o) {
|
|
14
14
|
return Array.isArray(r) && r.length > 0 ? r.map((c, a) => {
|
|
15
|
-
const { fee:
|
|
15
|
+
const { fee: l = 0, ...f } = c, d = Object.keys(f)[0] || `${o}${a + 1}`;
|
|
16
16
|
return {
|
|
17
|
-
key:
|
|
18
|
-
description: String(f[
|
|
19
|
-
fee: Number(
|
|
17
|
+
key: d,
|
|
18
|
+
description: String(f[d] ?? ""),
|
|
19
|
+
fee: Number(l) || 0
|
|
20
20
|
};
|
|
21
21
|
}) : [{ key: `${o}1`, description: "", fee: 0 }];
|
|
22
22
|
}
|
|
@@ -29,24 +29,24 @@ function M(r) {
|
|
|
29
29
|
function H({ attributes: r = {}, rules: o = {}, onChange: c }) {
|
|
30
30
|
const {
|
|
31
31
|
id: a = "",
|
|
32
|
-
keyPrefix:
|
|
32
|
+
keyPrefix: l = "item",
|
|
33
33
|
/** Set to false to hide the row number badge. Defaults to true. */
|
|
34
34
|
showRowBadge: f = !0,
|
|
35
35
|
/** Set to true to render the Description/Fee fields as read-only and hide the Add/Remove buttons. */
|
|
36
|
-
readOnly:
|
|
36
|
+
readOnly: d = !1,
|
|
37
37
|
/** Set to false to hide the Add/Remove buttons while keeping fields editable. Defaults to true. */
|
|
38
38
|
showActions: w = !0,
|
|
39
39
|
MuiAttributes: I = {}
|
|
40
|
-
} = r, P = w && !
|
|
40
|
+
} = r, P = w && !d, {
|
|
41
41
|
row: b = {},
|
|
42
42
|
rowBadge: A = {},
|
|
43
43
|
description: B = {},
|
|
44
44
|
fee: C = {},
|
|
45
45
|
addButton: $ = {},
|
|
46
46
|
removeButton: S = {}
|
|
47
|
-
} = I, u = o?.validation?.some((e) => e.rule === "mandatory") || !1, h = k(r.value,
|
|
47
|
+
} = I, u = o?.validation?.some((e) => e.rule === "mandatory") || !1, h = k(r.value, l), [i, p] = N(() => v(r.value, h));
|
|
48
48
|
L(() => {
|
|
49
|
-
const e = k(r.value,
|
|
49
|
+
const e = k(r.value, l), n = v(r.value, e);
|
|
50
50
|
JSON.stringify(n) !== JSON.stringify(i) && p(n);
|
|
51
51
|
}, [r.value]), T(() => {
|
|
52
52
|
c && c({ id: a, value: M(i) });
|
|
@@ -111,8 +111,10 @@ function H({ attributes: r = {}, rules: o = {}, onChange: c }) {
|
|
|
111
111
|
helperText: u && !e.description ? "Required" : "",
|
|
112
112
|
value: e.description,
|
|
113
113
|
onChange: (t) => W(n, t.target.value),
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
...B,
|
|
115
|
+
slotProps: {
|
|
116
|
+
input: { readOnly: d }
|
|
117
|
+
}
|
|
116
118
|
}
|
|
117
119
|
),
|
|
118
120
|
/* @__PURE__ */ s(
|
|
@@ -125,13 +127,15 @@ function H({ attributes: r = {}, rules: o = {}, onChange: c }) {
|
|
|
125
127
|
required: u,
|
|
126
128
|
value: e.fee,
|
|
127
129
|
onChange: (t) => K(n, t.target.value),
|
|
128
|
-
InputProps: {
|
|
129
|
-
readOnly: l,
|
|
130
|
-
startAdornment: /* @__PURE__ */ s(F, { position: "start", children: "$" })
|
|
131
|
-
},
|
|
132
|
-
inputProps: { min: 0, step: 0.01 },
|
|
133
130
|
onWheel: (t) => t.target.blur(),
|
|
134
|
-
...C
|
|
131
|
+
...C,
|
|
132
|
+
slotProps: {
|
|
133
|
+
input: {
|
|
134
|
+
readOnly: d,
|
|
135
|
+
startAdornment: /* @__PURE__ */ s(F, { position: "start", children: "$" })
|
|
136
|
+
},
|
|
137
|
+
htmlInput: { min: 0, step: 0.01 }
|
|
138
|
+
}
|
|
135
139
|
}
|
|
136
140
|
),
|
|
137
141
|
P && (n === i.length - 1 ? /* @__PURE__ */ s(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { List as a, ListItem as u, ListItemIcon as x, Icon as L, ListItemText as p } from "@mui/material";
|
|
3
|
-
import { m as d, l } from "./AIForm-
|
|
3
|
+
import { m as d, l } from "./AIForm-BVJ7qhP5.mjs";
|
|
4
4
|
function A({ attributes: i = {} }) {
|
|
5
5
|
const { MuiAttributes: e = {}, items: s = [] } = i, { sx: o, ...n } = e;
|
|
6
6
|
return /* @__PURE__ */ r(a, { ...n, sx: d(l, o), children: (Array.isArray(s) ? s : []).map((t, c) => /* @__PURE__ */ m(u, { ...t.MuiListItemAttributes, children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("@mui/material"),i=require("./AIForm-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("@mui/material"),i=require("./AIForm-D8_6RVmA.js");function x({attributes:n={}}){const{MuiAttributes:c={},items:s=[]}=n,{sx:u,...o}=c;return r.jsx(e.List,{...o,sx:i.mergeSx(i.premiumSurfaceSx,u),children:(Array.isArray(s)?s:[]).map((t,a)=>r.jsxs(e.ListItem,{...t.MuiListItemAttributes,children:[t.icon&&r.jsx(e.ListItemIcon,{children:r.jsx(e.Icon,{children:t.icon})}),r.jsx(e.ListItemText,{primary:t.primary,secondary:t.secondary,...t.MuiListItemTextAttributes})]},a))})}exports.default=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),V=require("react"),d=require("./AIForm-D8_6RVmA.js"),C=require("@mui/material/TextField"),H=require("@mui/material/Button"),m=require("@mui/material/Box"),L=require("@mui/material");function R({attributes:l={},rules:h={},onChange:i,submitTick:v,messages:B}){const{id:p="",MuiAttributes:s={},InputProps:F={},format:x="",buttonText:g="Update Location",buttonIcon:S="location_on",buttonDisplay:b="both",MuiButtonAttributes:P={},disabled:I=!1}=l,[a,u]=V.useState({value:l.value!==void 0?l.value:"",helperText:s.helperText||"",error:!1});V.useEffect(()=>{l.value!==void 0&&l.value!==a.value&&u(e=>({...e,value:l.value}))},[l.value]);const w=e=>x?d.numeral(e).format(x):e,f=e=>{const{validation:t}=h;if(t)for(let n=0;n<t.length;n+=1){const r=t[n],j=d.Validation[r.rule];if(!(typeof j=="function"?j(e,r.value):!0)){const _=r.rule==="mandatory"?B?.required||"This field is required":"";return{isValid:!1,message:r.message||_}}}return{isValid:!0,message:""}};d.useUpdateEffect(()=>{if(v){const e=f(a.value);u(t=>({...t,helperText:e.message,error:!e.isValid}))}},[v]);const A=e=>{const{value:t}=e.target,n=f(t);u({value:t,helperText:n.message,error:!n.isValid})},M=e=>{const{value:t}=e.target,n=w(t),r=f(n);u({value:n,helperText:r.message,error:!r.isValid}),typeof i=="function"&&i({id:p,value:n})},k=()=>{i&&i({id:p,value:a.value,option:"location_update_request"})},z=()=>{const e=b,t=o.jsx(L.Icon,{children:S});switch(e){case"icon":return t;case"text":return o.jsx(o.Fragment,{children:g});default:return o.jsxs(o.Fragment,{children:[t,o.jsx(m,{component:"span",sx:{ml:.5},children:g})]})}},D=h?.validation?.some(e=>e.rule==="mandatory")||!1,c={...s},q=s.inputProps||s.slotProps?.htmlInput||{},y={...s.InputProps||s.slotProps?.input||{},...d.getInputProps(F)},E={...s.slotProps||{},input:y,htmlInput:q};delete c.slotProps,delete c.inputProps,delete c.InputProps;const O=s.variant||"outlined",T=s.size||"medium",W=T==="small"?O==="outlined"?40:48:56;return o.jsxs(m,{sx:{display:"flex",gap:1,alignItems:"flex-start",width:"100%"},children:[o.jsx(m,{sx:{flex:1,minWidth:0},children:o.jsx(C,{fullWidth:!0,...c,id:p,required:D,slotProps:E,inputProps:q,InputProps:y,onChange:A,onBlur:M,value:a.value,error:a.error,helperText:a.helperText,disabled:I})}),o.jsx(H,{variant:"outlined",color:"primary",size:T==="small"?"small":"medium",onClick:k,disabled:I,...P,sx:{whiteSpace:"nowrap",minWidth:"auto",height:W,flexShrink:0,...P?.sx},children:z()})]})}exports.default=R;
|