dynamic-mui 2.3.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.
- package/dist/{accordion-lvbD_BpX.js → accordion-Bf0VwGuE.js} +1 -1
- package/dist/{accordion-DqBdGRim.mjs → accordion-DEd2a2Ps.mjs} +1 -1
- package/dist/{addressfield-DDG15fqJ.js → addressfield-Dfd9ilpe.js} +1 -1
- package/dist/{addressfield-CGX3UppE.mjs → addressfield-FjNJCCuC.mjs} +1 -1
- package/dist/{asyncautocomplete-w9q_1DWt.js → asyncautocomplete-9O6nwGP_.js} +1 -1
- package/dist/{asyncautocomplete-BAfBR9P7.mjs → asyncautocomplete-B8qI_lz9.mjs} +1 -1
- package/dist/{cascadeselect-C3QVfoig.mjs → cascadeselect-D8sVXV1g.mjs} +1 -1
- package/dist/{cascadeselect-DzbhK9en.js → cascadeselect-DeoPn4_V.js} +1 -1
- package/dist/{colorpicker-5qmEq7ZI.js → colorpicker-BcnqB34i.js} +1 -1
- package/dist/{colorpicker-DhNZulJY.mjs → colorpicker-DcyceL6g.mjs} +1 -1
- package/dist/{consentfield-CBQUR4J5.mjs → consentfield-B_qBOIuX.mjs} +1 -1
- package/dist/{consentfield-B7Rm8d3U.js → consentfield-CR69IP1l.js} +1 -1
- package/dist/dynamic-mui.cjs +1 -1
- package/dist/dynamic-mui.mjs +1 -1
- package/dist/{editabletable-DCoRmsEO.js → editabletable-BdywdA42.js} +1 -1
- package/dist/{editabletable-DRlBV8lk.mjs → editabletable-D6_U9op8.mjs} +1 -1
- package/dist/{fileupload-ByBv1UjT.mjs → fileupload-CugTpR-B.mjs} +1 -1
- package/dist/{fileupload-Cze3Oc_2.js → fileupload-YzpAUgok.js} +1 -1
- package/dist/{formrepeater-BxJzXoHx.js → formrepeater-B_2UOIBm.js} +1 -1
- package/dist/{formrepeater-BBkKGLFJ.mjs → formrepeater-Cxawn2sQ.mjs} +1 -1
- package/dist/{formwizard-BDZE1UDD.js → formwizard-CCBY6s19.js} +1 -1
- package/dist/{formwizard-D2u1bMvK.mjs → formwizard-Cfd5IPkE.mjs} +1 -1
- package/dist/{geofield-Bw3p4NLJ.js → geofield-CJm8hivf.js} +1 -1
- package/dist/{geofield-8WTeZk0Z.mjs → geofield-k2V0hglK.mjs} +1 -1
- package/dist/{group-B2mSylHd.mjs → group-D40b3E1V.mjs} +1 -1
- package/dist/{group-BlfO3ZZf.js → group-IFZTzo-g.js} +1 -1
- package/dist/{index-CddjLTWF.mjs → index-Bh6BLrzq.mjs} +4697 -4970
- package/dist/index-eJceCjKS.js +43 -0
- package/dist/{intlphone-DtQZ12xk.mjs → intlphone-BbTprmmA.mjs} +1 -1
- package/dist/{intlphone-B_Xn98pU.js → intlphone-CmiRFHv-.js} +1 -1
- package/dist/{keyvaluefield-DyKCGd32.js → keyvaluefield-CoOmou7m.js} +1 -1
- package/dist/{keyvaluefield-B_1NeGuP.mjs → keyvaluefield-zD6Kf4D0.mjs} +1 -1
- package/dist/{lineitemlist-DGo8UOZC.js → lineitemlist-BRsW0O7Z.js} +1 -1
- package/dist/{lineitemlist-vGKzJlQx.mjs → lineitemlist-BZbAId8H.mjs} +1 -1
- package/dist/{list-7uNWrepS.mjs → list-BhTzYFrR.mjs} +1 -1
- package/dist/{list-C0FgmtQw.js → list-DWf2NWix.js} +1 -1
- package/dist/{locationfield-CeUgxLkQ.mjs → locationfield-BZpGC10B.mjs} +1 -1
- package/dist/{locationfield-Duyw1ZEz.js → locationfield-DC_2IN-B.js} +1 -1
- package/dist/{markdowneditor-B1y-hfny.mjs → markdowneditor-B5F4okCW.mjs} +1 -1
- package/dist/{markdowneditor-Db0Un1_Z.js → markdowneditor-Coi3sksx.js} +1 -1
- package/dist/{matrixfield-C7Sc-YpI.mjs → matrixfield-CUo7zFWC.mjs} +1 -1
- package/dist/{matrixfield-CckODuPn.js → matrixfield-DAjfXU96.js} +1 -1
- package/dist/{multitextbox-BYazIAeG.js → multitextbox-Cq7vt1-g.js} +1 -1
- package/dist/{multitextbox-ide2lvJ6.mjs → multitextbox-CsNOrHZP.mjs} +1 -1
- package/dist/{npsscale-C2e88qk_.js → npsscale-BWpMrK_O.js} +1 -1
- package/dist/{npsscale-lndz7GEq.mjs → npsscale-Cb8NxADb.mjs} +1 -1
- package/dist/{numberstepper-DyRjQM_K.js → numberstepper-BqQeBbR9.js} +1 -1
- package/dist/{numberstepper-DitbcvV9.mjs → numberstepper-DLk_r1HM.mjs} +1 -1
- package/dist/{richtexteditor-CVg-MnKp.js → richtexteditor-BUrvVR_T.js} +1 -1
- package/dist/{richtexteditor-DsC1XC7h.mjs → richtexteditor-pQIK2f-6.mjs} +1 -1
- package/dist/{signature-14OrZriO.mjs → signature-CFv0jhVN.mjs} +1 -1
- package/dist/{signature-D582X6tB.js → signature-G-XCOszC.js} +1 -1
- package/dist/{stepper-B-FpcZvT.js → stepper-Bc9NlbU7.js} +1 -1
- package/dist/{stepper-CDfEy_C6.mjs → stepper-U0kv127E.mjs} +1 -1
- package/dist/{summaryfield-B08ZmVHh.js → summaryfield-B_bePxLk.js} +1 -1
- package/dist/{summaryfield-CTpPlZBG.mjs → summaryfield-QcpYr9Xt.mjs} +1 -1
- package/dist/{tabs-BIliqFOs.js → tabs-Cs9eNEbR.js} +1 -1
- package/dist/{tabs-DDeJCFt8.mjs → tabs-DCLyTKVm.mjs} +1 -1
- package/dist/{tagsinput-D-q6rRZS.mjs → tagsinput-D1VP8Bjq.mjs} +1 -1
- package/dist/{tagsinput-qh_lhdFb.js → tagsinput-DlopThdw.js} +1 -1
- package/dist/util/dayjsSetup.d.ts +2 -0
- package/package.json +3 -2
- package/dist/index-D08GIfqF.js +0 -43
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),r=require("@mui/material"),a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),r=require("@mui/material"),a=require("./index-eJceCjKS.js"),l=require("./v4-CqdK_b8Y.js");function x({attributes:n={},patch:o,onChange:c}){const{MuiAttributes:i={},label:t="Accordion",subFields:s=[]}=n,d=u.useMemo(()=>l.v4(),[]);return e.jsxs(r.Accordion,{...i,children:[e.jsx(r.AccordionSummary,{expandIcon:e.jsx(r.Icon,{children:"expand_more"}),children:e.jsx(r.Typography,{children:t})}),e.jsx(r.AccordionDetails,{children:e.jsx(a.FormGenerator,{guid:d,data:s,patch:o,onChange:c})})]})}exports.default=x;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
3
|
import { Accordion as s, AccordionSummary as l, Typography as p, Icon as u, AccordionDetails as f } from "@mui/material";
|
|
4
|
-
import { F as A } from "./index-
|
|
4
|
+
import { F as A } from "./index-Bh6BLrzq.mjs";
|
|
5
5
|
import { v as h } from "./v4-BysszJq8.mjs";
|
|
6
6
|
function j({ attributes: r = {}, patch: c, onChange: i }) {
|
|
7
7
|
const { MuiAttributes: n = {}, label: e = "Accordion", subFields: t = [] } = r, d = m.useMemo(() => h(), []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),s=require("@mui/material/Grid"),n=require("@mui/material/TextField"),A=require("@mui/material/MenuItem"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("react"),s=require("@mui/material/Grid"),n=require("@mui/material/TextField"),A=require("@mui/material/MenuItem"),c=require("./index-eJceCjKS.js"),g=[{value:"US",label:"United States"},{value:"CA",label:"Canada"},{value:"MX",label:"Mexico"},{value:"GB",label:"United Kingdom"},{value:"IE",label:"Ireland"},{value:"FR",label:"France"},{value:"DE",label:"Germany"},{value:"ES",label:"Spain"},{value:"IT",label:"Italy"},{value:"NL",label:"Netherlands"},{value:"BE",label:"Belgium"},{value:"CH",label:"Switzerland"},{value:"SE",label:"Sweden"},{value:"NO",label:"Norway"},{value:"DK",label:"Denmark"},{value:"PT",label:"Portugal"},{value:"AU",label:"Australia"},{value:"NZ",label:"New Zealand"},{value:"IN",label:"India"},{value:"CN",label:"China"},{value:"JP",label:"Japan"},{value:"SG",label:"Singapore"},{value:"AE",label:"United Arab Emirates"},{value:"BR",label:"Brazil"},{value:"ZA",label:"South Africa"}],f={street1:"Street address",street2:"Apt, suite, etc. (optional)",city:"City",state:"State / Province",postalCode:"Postal code",country:"Country"};function P({attributes:i={},rules:m={},onChange:b}){const{id:v="",MuiAttributes:x={},countries:o,labels:C={}}=i,S=Array.isArray(o)&&o.length?o:g,l={...f,...C},d=m?.validation?.some(t=>t.rule==="mandatory"||t.rule==="mandatoryselect")||!1,[a,p]=h.useState(()=>({street1:"",street2:"",city:"",state:"",postalCode:"",country:"",...i?.value||{}}));c.useUpdateEffect(()=>{p({street1:"",street2:"",city:"",state:"",postalCode:"",country:"",...i?.value||{}})},[i?.value]);const r=h.useCallback(t=>j=>{const y={...a,[t]:j.target.value};p(y),b?.({id:v,value:y})},[a,v,b]),u=c.mergeSx(c.premiumInputSx,x?.sx);return e.jsxs(s,{container:!0,spacing:2,...x,children:[e.jsx(s,{size:{xs:12},children:e.jsx(n,{fullWidth:!0,label:l.street1,required:d,value:a.street1||"",onChange:r("street1"),inputProps:{"aria-label":l.street1},sx:u})}),e.jsx(s,{size:{xs:12},children:e.jsx(n,{fullWidth:!0,label:l.street2,value:a.street2||"",onChange:r("street2"),inputProps:{"aria-label":l.street2},sx:u})}),e.jsx(s,{size:{xs:12,sm:6,md:5},children:e.jsx(n,{fullWidth:!0,label:l.city,required:d,value:a.city||"",onChange:r("city"),inputProps:{"aria-label":l.city},sx:u})}),e.jsx(s,{size:{xs:12,sm:6,md:4},children:e.jsx(n,{fullWidth:!0,label:l.state,value:a.state||"",onChange:r("state"),inputProps:{"aria-label":l.state},sx:u})}),e.jsx(s,{size:{xs:12,sm:6,md:3},children:e.jsx(n,{fullWidth:!0,label:l.postalCode,value:a.postalCode||"",onChange:r("postalCode"),inputProps:{"aria-label":l.postalCode},sx:u})}),e.jsx(s,{size:{xs:12,sm:6},children:e.jsx(n,{select:!0,fullWidth:!0,label:l.country,required:d,value:a.country||"",onChange:r("country"),SelectProps:{inputProps:{"aria-label":l.country}},sx:u,children:S.map(t=>e.jsx(A,{value:t.value,children:t.label},t.value))})})]})}exports.default=P;
|
|
@@ -3,7 +3,7 @@ import S, { useCallback as A } from "react";
|
|
|
3
3
|
import r from "@mui/material/Grid";
|
|
4
4
|
import i from "@mui/material/TextField";
|
|
5
5
|
import g from "@mui/material/MenuItem";
|
|
6
|
-
import { u as E, m as P, a as I } from "./index-
|
|
6
|
+
import { u as E, m as P, a as I } from "./index-Bh6BLrzq.mjs";
|
|
7
7
|
const N = [
|
|
8
8
|
{ value: "US", label: "United States" },
|
|
9
9
|
{ value: "CA", label: "Canada" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),t=require("react"),$=require("@mui/material/Autocomplete"),F=require("@mui/material/TextField"),K=require("@mui/material/CircularProgress"),y=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),t=require("react"),$=require("@mui/material/Autocomplete"),F=require("@mui/material/TextField"),K=require("@mui/material/CircularProgress"),y=require("./index-eJceCjKS.js");function L({attributes:o={},rules:v={},onChange:q}){const{MuiAttributes:A={},id:x="",label:S="Search",placeholder:j="",minChars:C=1,debounceMs:O=300,labelKey:I="label",valueKey:d="value",loadOptions:p,optionsUrl:a}=o,[R,h]=t.useState(o.value??null),[b,i]=t.useState([]),[m,s]=t.useState(!1),c=t.useRef(0),r=t.useRef(null);y.useUpdateEffect(()=>{h(o.value??null)},[o.value]),t.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const P=async e=>{if(typeof p=="function")return p(e);if(a){const n=`${a}${a.includes("?")?"&":"?"}q=${encodeURIComponent(e)}`,g=await(await fetch(n)).json();return Array.isArray(g)?g:[]}return[]},T=e=>{const n=++c.current;s(!0),P(e).then(f=>{n===c.current&&(i(Array.isArray(f)?f:[]),s(!1))}).catch(()=>{n===c.current&&(i([]),s(!1))})},E=(e,n)=>{if(r.current&&clearTimeout(r.current),!n||n.length<C){c.current++,s(!1),i([]);return}r.current=setTimeout(()=>{T(n)},O)},M=(e,n)=>{h(n),q?.({id:x,value:n!=null?n?.[d]??n:n,option:n})},l=e=>typeof e=="string"?e:e?.[I]??"",U=!!v?.validation?.some(e=>e.rule==="mandatory");return u.jsx($,{value:R,onChange:M,onInputChange:E,options:b,loading:m,filterOptions:e=>e,getOptionLabel:l,renderOption:(e,n)=>t.createElement("li",{...e,key:(n&&n[d])??l(n)},l(n)),...A,renderInput:e=>u.jsx(F,{...e,label:S,placeholder:j,required:U,sx:y.premiumInputSx,InputProps:{...e.InputProps,endAdornment:u.jsxs(u.Fragment,{children:[m?u.jsx(K,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})}})})}exports.default=L;
|
|
@@ -3,7 +3,7 @@ import { useState as f, useRef as y, useEffect as L, createElement as M } from "
|
|
|
3
3
|
import _ from "@mui/material/Autocomplete";
|
|
4
4
|
import k from "@mui/material/TextField";
|
|
5
5
|
import z from "@mui/material/CircularProgress";
|
|
6
|
-
import { u as V, a as w } from "./index-
|
|
6
|
+
import { u as V, a as w } from "./index-Bh6BLrzq.mjs";
|
|
7
7
|
function Q({ attributes: t = {}, rules: v = {}, onChange: A }) {
|
|
8
8
|
const {
|
|
9
9
|
MuiAttributes: C = {},
|
|
@@ -2,7 +2,7 @@ import { jsxs as C, jsx as p } from "react/jsx-runtime";
|
|
|
2
2
|
import x, { useCallback as E } from "react";
|
|
3
3
|
import I from "@mui/material/TextField";
|
|
4
4
|
import S from "@mui/material/MenuItem";
|
|
5
|
-
import { u as y, m as O, a as P } from "./index-
|
|
5
|
+
import { u as y, m as O, a as P } from "./index-Bh6BLrzq.mjs";
|
|
6
6
|
const R = (a) => Array.isArray(a) ? a.map(
|
|
7
7
|
(e) => e != null && typeof e == "object" ? { value: e.value, label: e.label ?? e.title ?? String(e.value) } : { value: e, label: String(e) }
|
|
8
8
|
) : [], h = (a, e, t) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("react"),A=require("@mui/material/TextField"),y=require("@mui/material/MenuItem"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("react"),A=require("@mui/material/TextField"),y=require("@mui/material/MenuItem"),i=require("./index-eJceCjKS.js"),E=t=>Array.isArray(t)?t.map(e=>e!=null&&typeof e=="object"?{value:e.value,label:e.label??e.title??String(e.value)}:{value:e,label:String(e)}):[],b=(t,e,a)=>{const u=t&&e!=null&&e!==""?t[e]:void 0;return E(u??a??[])};function O({attributes:t={},rules:e={},onChange:a}){const{id:u="",parentValue:c,optionsMap:o,options:d,label:x="",placeholder:v="",MuiAttributes:S={}}=t,g=e?.validation?.some(l=>l.rule==="mandatory"||l.rule==="mandatoryselect")||!1,[p,h]=f.useState(()=>b(o,c,d)),[r,m]=f.useState(()=>t?.value??"");i.useUpdateEffect(()=>{m(t?.value??"")},[t?.value]),i.useUpdateEffect(()=>{const l=b(o,c,d);h(l),r!==""&&r!=null&&!l.some(n=>n.value===r)&&(m(""),a?.({id:u,value:"",option:null}))},[c,o,d]);const j=f.useCallback(l=>{const n=l.target.value,q=p.find(M=>M.value===n)??null;m(n),a?.({id:u,value:n,option:q})},[p,u,a]);return s.jsxs(A,{select:!0,fullWidth:!0,label:x,placeholder:v,required:g,value:r??"",onChange:j,SelectProps:{displayEmpty:!0,inputProps:{"aria-label":x||"cascade-select"}},...S,sx:i.mergeSx(i.premiumInputSx,S?.sx),children:[v?s.jsx(y,{value:"",children:s.jsx("em",{children:v})}):null,p.map(l=>s.jsx(y,{value:l.value,children:l.label},String(l.value)))]})}exports.default=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),k=require("react"),p=require("@mui/material/Box"),x=require("@mui/material/Stack"),C=require("@mui/material/TextField"),$=require("@mui/material/FormControl"),A=require("@mui/material/FormLabel"),n=require("@mui/material/styles"),l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),k=require("react"),p=require("@mui/material/Box"),x=require("@mui/material/Stack"),C=require("@mui/material/TextField"),$=require("@mui/material/FormControl"),A=require("@mui/material/FormLabel"),n=require("@mui/material/styles"),l=require("./index-eJceCjKS.js"),h="#000000";function R({attributes:t={},rules:m={},onChange:b}){const{id:u="",label:o,presets:s=[],MuiAttributes:g={}}=t,{sx:y,...f}=g,[a,d]=k.useState(t.value||h);l.useUpdateEffect(()=>{d(t.value||h)},[t.value]);const v=m?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,c=e=>{d(e),b?.({id:u,value:e})},S=e=>{c(e.target.value)},w=e=>{c(e.target.value)},j=e=>{c(e)},q={width:44,height:44,borderRadius:"10px",border:e=>`1px solid ${n.alpha(e.palette.text.primary,.2)}`,boxShadow:e=>`0 2px 8px ${n.alpha(e.palette.common.black,.12)}`,cursor:"pointer",flexShrink:0,position:"relative",overflow:"hidden"};return r.jsxs($,{required:v,component:"fieldset",fullWidth:!0,children:[o&&r.jsx(A,{component:"legend",children:o}),r.jsxs(x,{direction:"row",spacing:1.5,alignItems:"center",sx:{mt:o?1:0},children:[r.jsx(p,{sx:{...q,backgroundColor:a},children:r.jsx("input",{type:"color","aria-label":o?`${o} colour`:"colour",value:a,onChange:S,...f,style:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,border:"none",padding:0,cursor:"pointer"}})}),r.jsx(C,{id:u||void 0,value:a,onChange:w,size:"small",label:"Hex",inputProps:{"aria-label":"hex value"},sx:l.mergeSx(l.premiumInputSx,l.mergeSx({maxWidth:160},y))})]}),Array.isArray(s)&&s.length>0&&r.jsx(x,{direction:"row",spacing:1,sx:{mt:1.5,flexWrap:"wrap",rowGap:1},children:s.map(e=>r.jsx(p,{role:"button","aria-label":`preset ${e}`,onClick:()=>j(e),sx:{width:26,height:26,borderRadius:"8px",backgroundColor:e,cursor:"pointer",flexShrink:0,border:i=>a===e?`2px solid ${i.palette.primary.main}`:`1px solid ${n.alpha(i.palette.text.primary,.2)}`,boxShadow:i=>`0 1px 4px ${n.alpha(i.palette.common.black,.12)}`}},e))})]})}exports.default=R;
|
|
@@ -6,7 +6,7 @@ import A from "@mui/material/TextField";
|
|
|
6
6
|
import F from "@mui/material/FormControl";
|
|
7
7
|
import I from "@mui/material/FormLabel";
|
|
8
8
|
import { alpha as l } from "@mui/material/styles";
|
|
9
|
-
import { u as R, m as x, a as B } from "./index-
|
|
9
|
+
import { u as R, m as x, a as B } from "./index-Bh6BLrzq.mjs";
|
|
10
10
|
const h = "#000000";
|
|
11
11
|
function q({ attributes: t = {}, rules: f = {}, onChange: b }) {
|
|
12
12
|
const { id: p = "", label: r, presets: n = [], MuiAttributes: g = {} } = t, { sx: w, ...v } = g, [a, d] = $.useState(
|
|
@@ -6,7 +6,7 @@ import V from "@mui/material/FormControl";
|
|
|
6
6
|
import A from "@mui/material/FormControlLabel";
|
|
7
7
|
import B from "@mui/material/FormHelperText";
|
|
8
8
|
import { alpha as I } from "@mui/material/styles";
|
|
9
|
-
import { u as P, m as f, b as U, c as W } from "./index-
|
|
9
|
+
import { u as P, m as f, b as U, c as W } from "./index-Bh6BLrzq.mjs";
|
|
10
10
|
function Z({ attributes: a = {}, rules: n = {}, onChange: h }) {
|
|
11
11
|
const {
|
|
12
12
|
MuiAttributes: g = {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),M=require("@mui/material/Box"),w=require("@mui/material/Checkbox"),R=require("@mui/material/FormControl"),P=require("@mui/material/FormControlLabel"),V=require("@mui/material/FormHelperText"),A=require("@mui/material/styles"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),M=require("@mui/material/Box"),w=require("@mui/material/Checkbox"),R=require("@mui/material/FormControl"),P=require("@mui/material/FormControlLabel"),V=require("@mui/material/FormHelperText"),A=require("@mui/material/styles"),o=require("./index-eJceCjKS.js");function B({attributes:l={},rules:c={},onChange:h}){const{MuiAttributes:g={},id:p="",text:f="",label:i="I agree to the terms",requireScroll:u=!0}=l,[S,d]=a.useState(!!l.value),[q,b]=a.useState(!u),[C,j]=a.useState(!1),[m,v]=a.useState("");o.useUpdateEffect(()=>{d(!!l.value)},[l.value]);const n=c?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,y=e=>{let r=!0,s="";return n&&!e&&(r=!1,s=c?.validation?.find(x=>x.rule==="mandatory"||x.rule==="mandatoryselect")?.message||"Required"),{isValid:r,message:s}},T=e=>{const r=e.currentTarget;r.scrollTop+r.clientHeight>=r.scrollHeight-4&&b(!0)},k=e=>{const r=e.target.checked;d(r);const s=y(r);j(!s.isValid),v(s.message),h?.({id:p,value:r})},H=u&&!q,{sx:E,...F}=g,L=n?t.jsxs("span",{children:[i,t.jsx("span",{"aria-hidden":"true",style:{color:"#d32f2f",marginLeft:2},children:"*"})]}):i;return t.jsxs(R,{required:n,error:C,component:"fieldset",fullWidth:!0,children:[t.jsx(M,{"data-testid":"consent-terms",onScroll:T,sx:o.mergeSx(o.premiumSurfaceSx,{maxHeight:200,overflow:"auto",p:2,mb:1,whiteSpace:"pre-wrap",backgroundColor:e=>A.alpha(e.palette.background.paper,1)}),children:f}),t.jsx(P,{...F,sx:o.mergeSx(o.premiumControlLabelSx,E),label:L,control:t.jsx(w,{checked:S,disabled:H,onChange:k,required:n,inputProps:{"aria-label":"consent-agree"}})}),m&&t.jsx(V,{children:m})]})}exports.default=B;
|
package/dist/dynamic-mui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-eJceCjKS.js");exports.AIFill=e.AIFill;exports.AIForm=e.AIForm;exports.AIFormGenerator=e.AIFormGenerator;exports.AISchemaReview=e.AISchemaReview;exports.AITextAssist=e.AITextAssist;exports.AIVisionImport=e.AIVisionImport;exports.ClearFormData=e.ClearFormData;exports.Controls=e.Controls_default;exports.DynamicComponent=e.DynamicComponent;exports.FormData=e.FormData;exports.FormGenerator=e.FormGenerator;exports.MuiConfig=e.mui;exports.createAIClient=e.createAIClient;exports.defineForm=e.defineForm;exports.formFieldsToSimple=e.formFieldsToSimple;exports.getRegisteredControl=e.getRegisteredControl;exports.hasRegisteredControl=e.hasRegisteredControl;exports.registerControl=e.registerControl;exports.registerControls=e.registerControls;exports.registeredControlTypes=e.registeredControlTypes;exports.simpleFieldsToFormFields=e.simpleFieldsToFormFields;exports.slug=e.slug;exports.unregisterControl=e.unregisterControl;exports.useAIAssist=e.useAIAssist;exports.useForm=e.useForm;exports.useFormEngine=e.useFormEngine;exports.validateSchema=e.validateSchema;exports.yupResolver=e.yupResolver;exports.zodResolver=e.zodResolver;
|
package/dist/dynamic-mui.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as a, k as o, l as r, o as t, q as i, r as l, s as n, C as m, D as F, e as C, F as A, h as g, t as I, v as d, w as p, x as u, y as v, z as R, B as c, E as f, G as h, H as y, I as D, J as T, K as x, L as G, M as S, N as w, O as z } from "./index-
|
|
1
|
+
import { A as a, k as o, l as r, o as t, q as i, r as l, s as n, C as m, D as F, e as C, F as A, h as g, t as I, v as d, w as p, x as u, y as v, z as R, B as c, E as f, G as h, H as y, I as D, J as T, K as x, L as G, M as S, N as w, O as z } from "./index-Bh6BLrzq.mjs";
|
|
2
2
|
export {
|
|
3
3
|
a as AIFill,
|
|
4
4
|
o as AIForm,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),w=require("react"),A=require("@mui/material/Table"),S=require("@mui/material/TableBody"),a=require("@mui/material/TableCell"),z=require("@mui/material/TableContainer"),I=require("@mui/material/TableHead"),j=require("@mui/material/TableRow"),W=require("@mui/material/TextField"),B=require("@mui/material/IconButton"),F=require("@mui/material/Button"),M=require("@mui/material/FormControl"),P=require("@mui/material/FormLabel"),E=require("@mui/material/Paper"),L=require("@mui/icons-material/Add"),H=require("@mui/icons-material/Close"),d=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),w=require("react"),A=require("@mui/material/Table"),S=require("@mui/material/TableBody"),a=require("@mui/material/TableCell"),z=require("@mui/material/TableContainer"),I=require("@mui/material/TableHead"),j=require("@mui/material/TableRow"),W=require("@mui/material/TextField"),B=require("@mui/material/IconButton"),F=require("@mui/material/Button"),M=require("@mui/material/FormControl"),P=require("@mui/material/FormLabel"),E=require("@mui/material/Paper"),L=require("@mui/icons-material/Add"),H=require("@mui/icons-material/Close"),d=require("./index-eJceCjKS.js");function f(o){return Array.isArray(o)?o.map(c=>({...c||{}})):[]}function O({attributes:o={},onChange:c}){const{MuiAttributes:g={},id:p="",columns:x=[],addLabel:q="Add row",label:m}=o,{sx:v,...y}=g,h=Array.isArray(x)?x:[],[l,i]=w.useState(()=>f(o.value));d.useUpdateEffect(()=>{i(f(o.value))},[o.value]);const u=r=>{c?.({id:p,value:r})},C=(r,n,t)=>{const s=l.map((b,k)=>k===r?{...b,[n]:t}:b);i(s),u(s)},R=()=>{const r=[...l,{}];i(r),u(r)},T=r=>{const n=l.filter((t,s)=>s!==r);i(n),u(n)};return e.jsxs(M,{component:"fieldset",fullWidth:!0,children:[m&&e.jsx(P,{component:"legend",sx:{mb:1},children:m}),e.jsx(z,{component:E,variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:e.jsxs(A,{size:"small",children:[e.jsx(I,{children:e.jsxs(j,{sx:{backgroundColor:"action.hover"},children:[h.map(r=>e.jsx(a,{sx:{fontWeight:600},children:r.label},r.key)),e.jsx(a,{align:"right",sx:{width:48}})]})}),e.jsx(S,{children:l.map((r,n)=>e.jsxs(j,{sx:{transition:"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{backgroundColor:"action.hover"}},children:[h.map(t=>e.jsx(a,{children:e.jsx(W,{...y,type:t.type==="number"?"number":"text",value:r[t.key]??"",onChange:s=>C(n,t.key,s.target.value),inputProps:{"aria-label":`${t.label} row ${n+1}`},size:"small",variant:"standard",fullWidth:!0,sx:d.mergeSx(d.premiumInputSx,v)})},t.key)),e.jsx(a,{align:"right",children:e.jsx(B,{"aria-label":`Remove row ${n+1}`,onClick:()=>T(n),size:"small",sx:{borderRadius:2,color:"text.secondary","&:hover":{color:"error.main"}},children:e.jsx(H,{fontSize:"small"})})})]},n))})]})}),e.jsx(F,{onClick:R,startIcon:e.jsx(L,{}),size:"small",variant:"text",sx:{alignSelf:"flex-start",mt:1,borderRadius:2,textTransform:"none",fontWeight:600},children:q})]})}exports.default=O;
|
|
@@ -14,7 +14,7 @@ import L from "@mui/material/FormLabel";
|
|
|
14
14
|
import M from "@mui/material/Paper";
|
|
15
15
|
import P from "@mui/icons-material/Add";
|
|
16
16
|
import H from "@mui/icons-material/Close";
|
|
17
|
-
import { u as U, m as _, a as q } from "./index-
|
|
17
|
+
import { u as U, m as _, a as q } from "./index-Bh6BLrzq.mjs";
|
|
18
18
|
function x(n) {
|
|
19
19
|
return Array.isArray(n) ? n.map((d) => ({ ...d || {} })) : [];
|
|
20
20
|
}
|
|
@@ -7,7 +7,7 @@ import H from "@mui/material/CircularProgress";
|
|
|
7
7
|
import J from "@mui/icons-material/CloudUpload";
|
|
8
8
|
import K from "@mui/icons-material/Close";
|
|
9
9
|
import N from "@mui/icons-material/InsertDriveFile";
|
|
10
|
-
import { u as Q, m as V, b as W } from "./index-
|
|
10
|
+
import { u as Q, m as V, b as W } from "./index-Bh6BLrzq.mjs";
|
|
11
11
|
import { u as X } from "./s3Upload-dpioZ2c8.mjs";
|
|
12
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
13
|
const a = new FileReader();
|
|
@@ -1 +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-
|
|
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;
|
|
@@ -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("./index-
|
|
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;
|
|
@@ -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
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-
|
|
4
|
+
import { e as M, F as W } from "./index-Bh6BLrzq.mjs";
|
|
5
5
|
import { v as k } from "./v4-BysszJq8.mjs";
|
|
6
6
|
function H({ attributes: h = {}, rules: v = {}, onChange: o }) {
|
|
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("./index-
|
|
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;
|
|
@@ -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, d as N } from "./index-
|
|
4
|
+
import { P as c, F as E, m as M, d as N } from "./index-Bh6BLrzq.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 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-
|
|
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;
|
|
@@ -4,7 +4,7 @@ import s from "@mui/material/Box";
|
|
|
4
4
|
import L from "@mui/material/Link";
|
|
5
5
|
import f from "@mui/material/TextField";
|
|
6
6
|
import k from "@mui/material/Typography";
|
|
7
|
-
import { u as C, m as b, a as F, b as j } from "./index-
|
|
7
|
+
import { u as C, m as b, a as F, b as j } from "./index-Bh6BLrzq.mjs";
|
|
8
8
|
const h = (t) => {
|
|
9
9
|
if (t && typeof t == "object")
|
|
10
10
|
return {
|
|
@@ -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 "./index-
|
|
4
|
+
import { F as c } from "./index-Bh6BLrzq.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 +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-
|
|
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;
|