dynamic-mui 2.1.0 → 2.3.0
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 +355 -37
- package/dist/accordion-DqBdGRim.mjs +23 -0
- package/dist/accordion-lvbD_BpX.js +1 -0
- package/dist/addressfield-CGX3UppE.mjs +152 -0
- package/dist/addressfield-DDG15fqJ.js +1 -0
- package/dist/asyncautocomplete-BAfBR9P7.mjs +89 -0
- package/dist/asyncautocomplete-w9q_1DWt.js +1 -0
- package/dist/bar-BzO7tvYJ.mjs +20 -0
- package/dist/bar-DEVxyUVS.js +1 -0
- package/dist/cascadeselect-C3QVfoig.mjs +64 -0
- package/dist/cascadeselect-DzbhK9en.js +1 -0
- package/dist/colorpicker-5qmEq7ZI.js +1 -0
- package/dist/colorpicker-DhNZulJY.mjs +98 -0
- package/dist/components/DynamicComponent.d.ts +2 -0
- package/dist/components/FormGenerator.d.ts +123 -2
- package/dist/components/controls/AsyncAutocomplete/asyncautocomplete.d.ts +9 -0
- package/dist/components/controls/CheckBox/checkbox.d.ts +1 -1
- package/dist/components/controls/ChipSelect/chipselect.d.ts +1 -1
- package/dist/components/controls/EditableTable/editabletable.d.ts +2 -0
- package/dist/components/controls/IntlPhone/intlphone.d.ts +2 -0
- package/dist/components/controls/LocationField/locationfield.d.ts +1 -1
- package/dist/components/controls/MultiTextbox/multitextbox.d.ts +1 -1
- package/dist/components/controls/NpsScale/npsscale.d.ts +3 -0
- package/dist/components/controls/NumberField/numberfield.d.ts +1 -1
- package/dist/components/controls/PasswordField/passwordfield.d.ts +1 -1
- package/dist/components/controls/Radio/radio.d.ts +1 -1
- package/dist/components/controls/RichTextEditor/richtexteditor.d.ts +3 -0
- package/dist/components/controls/Select/select.d.ts +1 -1
- package/dist/components/controls/Switch/switch.d.ts +1 -1
- package/dist/components/controls/TextField/textfield.d.ts +1 -1
- package/dist/components/controls/index.d.ts +45 -69
- package/dist/consentfield-B7Rm8d3U.js +1 -0
- package/dist/consentfield-CBQUR4J5.mjs +78 -0
- package/dist/datatable-BIQznwQe.mjs +20 -0
- package/dist/datatable-BWlcUP0M.js +1 -0
- package/dist/dynamic-mui.cjs +1 -0
- package/dist/dynamic-mui.mjs +32 -0
- package/dist/editabletable-DCoRmsEO.js +1 -0
- package/dist/editabletable-DRlBV8lk.mjs +126 -0
- package/dist/fileupload-ByBv1UjT.mjs +172 -0
- package/dist/fileupload-Cze3Oc_2.js +1 -0
- package/dist/formrepeater-BBkKGLFJ.mjs +71 -0
- package/dist/formrepeater-BxJzXoHx.js +1 -0
- package/dist/formwizard-BDZE1UDD.js +1 -0
- package/dist/formwizard-D2u1bMvK.mjs +83 -0
- package/dist/geofield-8WTeZk0Z.mjs +104 -0
- package/dist/geofield-Bw3p4NLJ.js +1 -0
- package/dist/group-B2mSylHd.mjs +23 -0
- package/dist/group-BlfO3ZZf.js +1 -0
- package/dist/imagelist-Bn9QhIv7.js +1 -0
- package/dist/imagelist-rqmJajHt.mjs +18 -0
- package/dist/index-CddjLTWF.mjs +12499 -0
- package/dist/index-D08GIfqF.js +43 -0
- package/dist/index.d.ts +11 -1
- package/dist/intlphone-B_Xn98pU.js +1 -0
- package/dist/intlphone-DtQZ12xk.mjs +140 -0
- package/dist/keyvaluefield-B_1NeGuP.mjs +125 -0
- package/dist/keyvaluefield-DyKCGd32.js +1 -0
- package/dist/line-B-DwR1hm.mjs +20 -0
- package/dist/line-BkymZu31.js +1 -0
- package/dist/lineitemlist-DGo8UOZC.js +1 -0
- package/dist/lineitemlist-vGKzJlQx.mjs +166 -0
- package/dist/list-7uNWrepS.mjs +20 -0
- package/dist/list-C0FgmtQw.js +1 -0
- package/dist/locationfield-CeUgxLkQ.mjs +119 -0
- package/dist/locationfield-Duyw1ZEz.js +1 -0
- package/dist/markdowneditor-B1y-hfny.mjs +90 -0
- package/dist/markdowneditor-Db0Un1_Z.js +2 -0
- package/dist/matrixfield-C7Sc-YpI.mjs +117 -0
- package/dist/matrixfield-CckODuPn.js +1 -0
- package/dist/mixChart-C3o184UT.js +1 -0
- package/dist/mixChart-ISf3Kbr-.mjs +75 -0
- package/dist/multitextbox-BYazIAeG.js +1 -0
- package/dist/multitextbox-ide2lvJ6.mjs +78 -0
- package/dist/npsscale-C2e88qk_.js +1 -0
- package/dist/npsscale-lndz7GEq.mjs +87 -0
- package/dist/numberstepper-DitbcvV9.mjs +128 -0
- package/dist/numberstepper-DyRjQM_K.js +1 -0
- package/dist/pie-CJSL8Sv5.js +1 -0
- package/dist/pie-CL29dlh5.mjs +20 -0
- package/dist/richtexteditor-CVg-MnKp.js +1 -0
- package/dist/richtexteditor-DsC1XC7h.mjs +141 -0
- package/dist/s3Upload-B0JeoLkS.js +1 -0
- package/dist/s3Upload-dpioZ2c8.mjs +51 -0
- package/dist/schema.d.ts +404 -0
- package/dist/signature-14OrZriO.mjs +1225 -0
- package/dist/signature-D582X6tB.js +2 -0
- package/dist/stepper-B-FpcZvT.js +1 -0
- package/dist/stepper-CDfEy_C6.mjs +140 -0
- package/dist/summaryfield-B08ZmVHh.js +1 -0
- package/dist/summaryfield-CTpPlZBG.mjs +96 -0
- package/dist/tabs-BIliqFOs.js +1 -0
- package/dist/tabs-DDeJCFt8.mjs +39 -0
- package/dist/tagsinput-D-q6rRZS.mjs +58 -0
- package/dist/tagsinput-qh_lhdFb.js +1 -0
- package/dist/types.d.ts +16 -0
- package/dist/util/registry.d.ts +29 -0
- package/dist/util/resolvers.d.ts +45 -0
- package/dist/util/useFormEngine.d.ts +74 -0
- package/dist/util/validateSchema.d.ts +23 -0
- package/dist/v4-BysszJq8.mjs +30 -0
- package/dist/v4-CqdK_b8Y.js +1 -0
- package/package.json +36 -11
- package/dist/XmlShapeDeserializer-3yQdm0b0.mjs +0 -237
- package/dist/XmlShapeDeserializer-XKJAoqLc.js +0 -1
- package/dist/date-utils-CFUUt6NL.js +0 -4
- package/dist/date-utils-pGzaKb0p.mjs +0 -477
- package/dist/dynamic-mui.cjs.js +0 -469
- package/dist/dynamic-mui.es.js +0 -102550
- package/dist/index-BW8_rRff.js +0 -7
- package/dist/index-BXFVK_GX.js +0 -1
- package/dist/index-CVqLvm8B.js +0 -1
- package/dist/index-Cr6Wp_S-.mjs +0 -3141
- package/dist/index-DA0XouZs.mjs +0 -153
- package/dist/index-DKS5Sz9e.js +0 -14
- package/dist/index-DcWfyXJp.mjs +0 -92
- package/dist/index-MllWgTJ5.mjs +0 -9372
- package/dist/index.browser-BSu11T_q.mjs +0 -363
- package/dist/index.browser-By7-GABP.js +0 -4
- package/dist/loadCognitoIdentity-DtYTy-DW.js +0 -1
- package/dist/loadCognitoIdentity-DzdR91GB.mjs +0 -872
- package/dist/loadSts-Cic6UToN.mjs +0 -593
- package/dist/loadSts-csbFP6zX.js +0 -1
- package/dist/main.d.ts +0 -1
- package/dist/noAuth-B8ui2kBg.mjs +0 -71
- package/dist/noAuth-JPA2o4dt.js +0 -1
- package/dist/playground/AIContext.d.ts +0 -18
- package/dist/playground/AIPanel.d.ts +0 -10
- package/dist/playground/Builder.d.ts +0 -1
- package/dist/playground/Canvas.d.ts +0 -9
- package/dist/playground/PropertiesEditor.d.ts +0 -10
- package/dist/playground/Sidebar.d.ts +0 -1
- package/dist/playground/documentation.d.ts +0 -6
- package/dist/playground/templates.d.ts +0 -7
- package/dist/playground/testData.d.ts +0 -2
- package/dist/test/setup.d.ts +0 -0
- package/dist/theme/theme.d.ts +0 -1
|
@@ -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-CddjLTWF.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 t=require("react/jsx-runtime"),i=require("react"),n=require("@mui/material"),b=require("./index-D08GIfqF.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 @@
|
|
|
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-D08GIfqF.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-CddjLTWF.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,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-CddjLTWF.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 @@
|
|
|
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-D08GIfqF.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,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-CddjLTWF.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-D08GIfqF.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
|
+
};
|