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 +0,0 @@
|
|
|
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"),j=require("@mui/material/MenuItem"),c=require("./AIForm-Dv8ahXyE.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=>A=>{const y={...a,[t]:A.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(j,{value:t.value,children:t.label},t.value))})})]})}exports.default=P;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { jsx as c, jsxs as k, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import { useState as f, useRef as y, useEffect as K, createElement as L } from "react";
|
|
3
|
-
import M from "@mui/material/Autocomplete";
|
|
4
|
-
import _ from "@mui/material/TextField";
|
|
5
|
-
import z from "@mui/material/CircularProgress";
|
|
6
|
-
import { j as V, k as w } from "./AIForm-DtRl0WdY.mjs";
|
|
7
|
-
function Q({ attributes: t = {}, rules: v = {}, onChange: A }) {
|
|
8
|
-
const {
|
|
9
|
-
MuiAttributes: C = {},
|
|
10
|
-
id: x = "",
|
|
11
|
-
label: I = "Search",
|
|
12
|
-
placeholder: O = "",
|
|
13
|
-
minChars: S = 1,
|
|
14
|
-
debounceMs: j = 300,
|
|
15
|
-
labelKey: q = "label",
|
|
16
|
-
valueKey: p = "value",
|
|
17
|
-
loadOptions: m,
|
|
18
|
-
optionsUrl: s
|
|
19
|
-
} = t, [P, d] = f(t.value ?? null), [T, a] = f([]), [h, o] = f(!1), u = y(0), r = y(null);
|
|
20
|
-
V(() => {
|
|
21
|
-
d(t.value ?? null);
|
|
22
|
-
}, [t.value]), K(() => () => {
|
|
23
|
-
r.current && clearTimeout(r.current);
|
|
24
|
-
}, []);
|
|
25
|
-
const b = async (e) => {
|
|
26
|
-
if (typeof m == "function")
|
|
27
|
-
return m(e);
|
|
28
|
-
if (s) {
|
|
29
|
-
const n = `${s}${s.includes("?") ? "&" : "?"}q=${encodeURIComponent(e)}`, g = await (await fetch(n)).json();
|
|
30
|
-
return Array.isArray(g) ? g : [];
|
|
31
|
-
}
|
|
32
|
-
return [];
|
|
33
|
-
}, E = (e) => {
|
|
34
|
-
const n = ++u.current;
|
|
35
|
-
o(!0), b(e).then((i) => {
|
|
36
|
-
n === u.current && (a(Array.isArray(i) ? i : []), o(!1));
|
|
37
|
-
}).catch(() => {
|
|
38
|
-
n === u.current && (a([]), o(!1));
|
|
39
|
-
});
|
|
40
|
-
}, R = (e, n) => {
|
|
41
|
-
if (r.current && clearTimeout(r.current), !n || n.length < S) {
|
|
42
|
-
u.current++, o(!1), a([]);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
r.current = setTimeout(() => {
|
|
46
|
-
E(n);
|
|
47
|
-
}, j);
|
|
48
|
-
}, U = (e, n) => {
|
|
49
|
-
d(n), A?.({
|
|
50
|
-
id: x,
|
|
51
|
-
value: n != null ? n?.[p] ?? n : n,
|
|
52
|
-
option: n
|
|
53
|
-
});
|
|
54
|
-
}, l = (e) => typeof e == "string" ? e : e?.[q] ?? "", $ = !!v?.validation?.some((e) => e.rule === "mandatory");
|
|
55
|
-
return /* @__PURE__ */ c(
|
|
56
|
-
M,
|
|
57
|
-
{
|
|
58
|
-
value: P,
|
|
59
|
-
onChange: U,
|
|
60
|
-
onInputChange: R,
|
|
61
|
-
options: T,
|
|
62
|
-
loading: h,
|
|
63
|
-
filterOptions: (e) => e,
|
|
64
|
-
getOptionLabel: l,
|
|
65
|
-
renderOption: (e, n) => /* @__PURE__ */ L("li", { ...e, key: (n && n[p]) ?? l(n) }, l(n)),
|
|
66
|
-
...C,
|
|
67
|
-
renderInput: (e) => /* @__PURE__ */ c(
|
|
68
|
-
_,
|
|
69
|
-
{
|
|
70
|
-
...e,
|
|
71
|
-
label: I,
|
|
72
|
-
placeholder: O,
|
|
73
|
-
required: $,
|
|
74
|
-
sx: w,
|
|
75
|
-
InputProps: {
|
|
76
|
-
...e.InputProps,
|
|
77
|
-
endAdornment: /* @__PURE__ */ k(F, { children: [
|
|
78
|
-
h ? /* @__PURE__ */ c(z, { color: "inherit", size: 20 }) : null,
|
|
79
|
-
e.InputProps.endAdornment
|
|
80
|
-
] })
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
export {
|
|
88
|
-
Q as default
|
|
89
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),t=require("react"),U=require("@mui/material/Autocomplete"),$=require("@mui/material/TextField"),K=require("@mui/material/CircularProgress"),y=require("./AIForm-Dv8ahXyE.js");function L({attributes:o={},rules:v={},onChange:A}){const{MuiAttributes:q={},id:S="",label:x="Search",placeholder:j="",minChars:C=1,debounceMs:I=300,labelKey:O="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)},I)},F=(e,n)=>{h(n),A?.({id:S,value:n!=null?n?.[d]??n:n,option:n})},l=e=>typeof e=="string"?e:e?.[O]??"",M=!!v?.validation?.some(e=>e.rule==="mandatory");return u.jsx(U,{value:R,onChange:F,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)),...q,renderInput:e=>u.jsx($,{...e,label:x,placeholder:j,required:M,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;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { jsxs as k, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import x, { useCallback as C } from "react";
|
|
3
|
-
import E from "@mui/material/TextField";
|
|
4
|
-
import S from "@mui/material/MenuItem";
|
|
5
|
-
import { j as y, m as I, k as O } from "./AIForm-DtRl0WdY.mjs";
|
|
6
|
-
const P = (a) => Array.isArray(a) ? a.map(
|
|
7
|
-
(e) => e != null && typeof e == "object" ? { value: e.value, label: e.label ?? e.title ?? String(e.value) } : { value: e, label: String(e) }
|
|
8
|
-
) : [], h = (a, e, t) => {
|
|
9
|
-
const r = a && e != null && e !== "" ? a[e] : void 0;
|
|
10
|
-
return P(r ?? t ?? []);
|
|
11
|
-
};
|
|
12
|
-
function U({ attributes: a = {}, rules: e = {}, onChange: t }) {
|
|
13
|
-
const {
|
|
14
|
-
id: r = "",
|
|
15
|
-
parentValue: s,
|
|
16
|
-
optionsMap: o,
|
|
17
|
-
options: i,
|
|
18
|
-
label: v = "",
|
|
19
|
-
placeholder: c = "",
|
|
20
|
-
MuiAttributes: f = {}
|
|
21
|
-
} = a, b = e?.validation?.some(
|
|
22
|
-
(l) => l.rule === "mandatory" || l.rule === "mandatoryselect"
|
|
23
|
-
) || !1, [m, g] = x.useState(
|
|
24
|
-
() => h(o, s, i)
|
|
25
|
-
), [u, d] = x.useState(() => a?.value ?? "");
|
|
26
|
-
y(() => {
|
|
27
|
-
d(a?.value ?? "");
|
|
28
|
-
}, [a?.value]), y(() => {
|
|
29
|
-
const l = h(o, s, i);
|
|
30
|
-
g(l), u !== "" && u != null && !l.some((n) => n.value === u) && (d(""), t?.({ id: r, value: "", option: null }));
|
|
31
|
-
}, [s, o, i]);
|
|
32
|
-
const j = C(
|
|
33
|
-
(l) => {
|
|
34
|
-
const n = l.target.value, M = m.find((A) => A.value === n) ?? null;
|
|
35
|
-
d(n), t?.({ id: r, value: n, option: M });
|
|
36
|
-
},
|
|
37
|
-
[m, r, t]
|
|
38
|
-
);
|
|
39
|
-
return /* @__PURE__ */ k(
|
|
40
|
-
E,
|
|
41
|
-
{
|
|
42
|
-
select: !0,
|
|
43
|
-
fullWidth: !0,
|
|
44
|
-
label: v,
|
|
45
|
-
placeholder: c,
|
|
46
|
-
required: b,
|
|
47
|
-
value: u ?? "",
|
|
48
|
-
onChange: j,
|
|
49
|
-
SelectProps: {
|
|
50
|
-
displayEmpty: !0,
|
|
51
|
-
inputProps: { "aria-label": v || "cascade-select" }
|
|
52
|
-
},
|
|
53
|
-
...f,
|
|
54
|
-
sx: I(O, f?.sx),
|
|
55
|
-
children: [
|
|
56
|
-
c ? /* @__PURE__ */ p(S, { value: "", children: /* @__PURE__ */ p("em", { children: c }) }) : null,
|
|
57
|
-
m.map((l) => /* @__PURE__ */ p(S, { value: l.value, children: l.label }, String(l.value)))
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
export {
|
|
63
|
-
U as default
|
|
64
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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("./AIForm-Dv8ahXyE.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 I({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=I;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import $ from "react";
|
|
3
|
-
import m from "@mui/material/Box";
|
|
4
|
-
import u from "@mui/material/Stack";
|
|
5
|
-
import A from "@mui/material/TextField";
|
|
6
|
-
import F from "@mui/material/FormControl";
|
|
7
|
-
import I from "@mui/material/FormLabel";
|
|
8
|
-
import { alpha as l } from "@mui/material/styles";
|
|
9
|
-
import { j as R, m as x, k as j } from "./AIForm-DtRl0WdY.mjs";
|
|
10
|
-
const h = "#000000";
|
|
11
|
-
function q({ attributes: t = {}, rules: f = {}, onChange: b }) {
|
|
12
|
-
const { id: p = "", label: r, presets: n = [], MuiAttributes: g = {} } = t, { sx: w, ...v } = g, [a, d] = $.useState(
|
|
13
|
-
t.value || h
|
|
14
|
-
);
|
|
15
|
-
R(() => {
|
|
16
|
-
d(t.value || h);
|
|
17
|
-
}, [t.value]);
|
|
18
|
-
const y = f?.validation?.some(
|
|
19
|
-
(o) => o.rule === "mandatory" || o.rule === "mandatoryselect"
|
|
20
|
-
) || !1, s = (o) => {
|
|
21
|
-
d(o), b?.({ id: p, value: o });
|
|
22
|
-
}, k = (o) => {
|
|
23
|
-
s(o.target.value);
|
|
24
|
-
}, C = (o) => {
|
|
25
|
-
s(o.target.value);
|
|
26
|
-
}, S = (o) => {
|
|
27
|
-
s(o);
|
|
28
|
-
};
|
|
29
|
-
return /* @__PURE__ */ c(F, { required: y, component: "fieldset", fullWidth: !0, children: [
|
|
30
|
-
r && /* @__PURE__ */ e(I, { component: "legend", children: r }),
|
|
31
|
-
/* @__PURE__ */ c(u, { direction: "row", spacing: 1.5, alignItems: "center", sx: { mt: r ? 1 : 0 }, children: [
|
|
32
|
-
/* @__PURE__ */ e(m, { sx: { ...{
|
|
33
|
-
width: 44,
|
|
34
|
-
height: 44,
|
|
35
|
-
borderRadius: "10px",
|
|
36
|
-
border: (o) => `1px solid ${l(o.palette.text.primary, 0.2)}`,
|
|
37
|
-
boxShadow: (o) => `0 2px 8px ${l(o.palette.common.black, 0.12)}`,
|
|
38
|
-
cursor: "pointer",
|
|
39
|
-
flexShrink: 0,
|
|
40
|
-
position: "relative",
|
|
41
|
-
overflow: "hidden"
|
|
42
|
-
}, backgroundColor: a }, children: /* @__PURE__ */ e(
|
|
43
|
-
"input",
|
|
44
|
-
{
|
|
45
|
-
type: "color",
|
|
46
|
-
"aria-label": r ? `${r} colour` : "colour",
|
|
47
|
-
value: a,
|
|
48
|
-
onChange: k,
|
|
49
|
-
...v,
|
|
50
|
-
style: {
|
|
51
|
-
position: "absolute",
|
|
52
|
-
inset: 0,
|
|
53
|
-
width: "100%",
|
|
54
|
-
height: "100%",
|
|
55
|
-
opacity: 0,
|
|
56
|
-
border: "none",
|
|
57
|
-
padding: 0,
|
|
58
|
-
cursor: "pointer"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
) }),
|
|
62
|
-
/* @__PURE__ */ e(
|
|
63
|
-
A,
|
|
64
|
-
{
|
|
65
|
-
id: p || void 0,
|
|
66
|
-
value: a,
|
|
67
|
-
onChange: C,
|
|
68
|
-
size: "small",
|
|
69
|
-
label: "Hex",
|
|
70
|
-
inputProps: { "aria-label": "hex value" },
|
|
71
|
-
sx: x(j, x({ maxWidth: 160 }, w))
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
] }),
|
|
75
|
-
Array.isArray(n) && n.length > 0 && /* @__PURE__ */ e(u, { direction: "row", spacing: 1, sx: { mt: 1.5, flexWrap: "wrap", rowGap: 1 }, children: n.map((o) => /* @__PURE__ */ e(
|
|
76
|
-
m,
|
|
77
|
-
{
|
|
78
|
-
role: "button",
|
|
79
|
-
"aria-label": `preset ${o}`,
|
|
80
|
-
onClick: () => S(o),
|
|
81
|
-
sx: {
|
|
82
|
-
width: 26,
|
|
83
|
-
height: 26,
|
|
84
|
-
borderRadius: "8px",
|
|
85
|
-
backgroundColor: o,
|
|
86
|
-
cursor: "pointer",
|
|
87
|
-
flexShrink: 0,
|
|
88
|
-
border: (i) => a === o ? `2px solid ${i.palette.primary.main}` : `1px solid ${l(i.palette.text.primary, 0.2)}`,
|
|
89
|
-
boxShadow: (i) => `0 1px 4px ${l(i.palette.common.black, 0.12)}`
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
o
|
|
93
|
-
)) })
|
|
94
|
-
] });
|
|
95
|
-
}
|
|
96
|
-
export {
|
|
97
|
-
q as default
|
|
98
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),k=require("react"),w=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"),F=require("@mui/material/TextField"),W=require("@mui/material/IconButton"),B=require("@mui/material/Button"),M=require("@mui/material/FormControl"),P=require("@mui/material/FormLabel"),$=require("@mui/material/Paper"),E=require("@mui/icons-material/Add"),L=require("@mui/icons-material/Close"),d=require("./AIForm-Dv8ahXyE.js");function f(o){return Array.isArray(o)?o.map(c=>({...c||{}})):[]}function H({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]=k.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,T)=>T===r?{...b,[n]:t}:b);i(s),u(s)},A=()=>{const r=[...l,{}];i(r),u(r)},R=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:$,variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:e.jsxs(w,{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(F,{...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(W,{"aria-label":`Remove row ${n+1}`,onClick:()=>R(n),size:"small",sx:{borderRadius:2,color:"text.secondary","&:hover":{color:"error.main"}},children:e.jsx(L,{fontSize:"small"})})})]},n))})]})}),e.jsx(B,{onClick:A,startIcon:e.jsx(E,{}),size:"small",variant:"text",sx:{alignSelf:"flex-start",mt:1,borderRadius:2,textTransform:"none",fontWeight:600},children:q})]})}exports.default=H;
|
|
@@ -1 +0,0 @@
|
|
|
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("./AIForm-Dv8ahXyE.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;
|
|
@@ -1 +0,0 @@
|
|
|
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-Dv8ahXyE.js");function k(r,o){if(Array.isArray(r)&&r.length>0){const d=r[0],c=Object.keys(d).find(l=>l!=="fee");if(c)return c.replace(/\d+$/,"")}return o}function I(r,o){return Array.isArray(r)&&r.length>0?r.map((d,c)=>{const{fee:l=0,...f}=d,u=Object.keys(f)[0]||`${o}${c+1}`;return{key:u,description:String(f[u]??""),fee:Number(l)||0}}):[{key:`${o}1`,description:"",fee:0}]}function W(r){return r.map(o=>({fee:o.fee,[o.key]:o.description}))}function F({attributes:r={},rules:o={},onChange:d}){const{id:c="",keyPrefix:l="item",showRowBadge:f=!0,readOnly:u=!1,showActions:v=!0,MuiAttributes:j={}}=r,w=v&&!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(r.value,l),[s,p]=g.useState(()=>I(r.value,m));T.useUpdateEffect(()=>{const e=k(r.value,l),n=I(r.value,e);JSON.stringify(n)!==JSON.stringify(s)&&p(n)},[r.value]),g.useEffect(()=>{d&&d({id:c,value:W(s)})},[s,c]);const $=()=>{const e=s.length+1;p([...s,{key:`${m}${e}`,description:"",fee:0}])},R=e=>{const t=s.filter((x,y)=>y!==e).map((x,y)=>({...x,key:`${m}${y+1}`}));p(t)},q=(e,n)=>{const t=[...s];t[e]={...t[e],description:n},p(t)},O=(e,n)=>{const t=[...s];t[e]={...t[e],fee:Number(n)||0},p(t)};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:t=>q(n,t.target.value),InputProps:{readOnly:u},...A}),i.jsx(a.TextField,{size:"small",label:"Fee",type:"number",sx:{minWidth:120},required:h,value:e.fee,onChange:t=>O(n,t.target.value),InputProps:{readOnly:u,startAdornment:i.jsx(a.InputAdornment,{position:"start",children:"$"})},inputProps:{min:0,step:.01},onWheel:t=>t.target.blur(),...B}),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 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),B=require("react"),c=require("./AIForm-Dv8ahXyE.js"),C=require("@mui/material/TextField"),L=require("@mui/material/Button"),v=require("@mui/material/Box"),R=require("@mui/material");function U({attributes:l={},rules:m={},onChange:a,submitTick:h,messages:S}){const{id:d="",MuiAttributes:n={},InputProps:F={},format:g="",buttonText:P="Update Location",buttonIcon:b="location_on",buttonDisplay:w="both",MuiButtonAttributes:q={},disabled:y=!1}=l,[i,u]=B.useState({value:l.value!==void 0?l.value:"",helperText:n.helperText||"",error:!1});B.useEffect(()=>{l.value!==void 0&&l.value!==i.value&&u(e=>({...e,value:l.value}))},[l.value]);const A=e=>g?c.numeral(e).format(g):e,p=e=>{const{validation:t}=m;if(t)for(let o=0;o<t.length;o+=1){const r=t[o],j=c.Validation[r.rule];if(!(typeof j=="function"?j(e,r.value):!0)){const _=r.rule==="mandatory"?S?.required||"This field is required":"";return{isValid:!1,message:r.message||_}}}return{isValid:!0,message:""}};c.useUpdateEffect(()=>{if(h){const e=p(i.value);u(t=>({...t,helperText:e.message,error:!e.isValid}))}},[h]);const M=e=>{const{value:t}=e.target,o=p(t);u({value:t,helperText:o.message,error:!o.isValid})},k=e=>{const{value:t}=e.target,o=A(t),r=p(o);u({value:o,helperText:r.message,error:!r.isValid}),typeof a=="function"&&a({id:d,value:o})},z=()=>{a&&a({id:d,value:i.value,option:"location_update_request"})},D=()=>{const e=w,t=s.jsx(R.Icon,{children:b});switch(e){case"icon":return t;case"text":return s.jsx(s.Fragment,{children:P});default:return s.jsxs(s.Fragment,{children:[t,s.jsx(v,{component:"span",sx:{ml:.5},children:P})]})}},E=m?.validation?.some(e=>e.rule==="mandatory")||!1,f=!!n?.slotProps,x={...n};let I,T;if(f){const e=n.slotProps&&n.slotProps.input||{};T={...n.slotProps||{},input:{...e}},delete x.slotProps}else I={...n.inputProps||{}},delete x.inputProps;const O=n.variant||"outlined",V=n.size||"medium",W=V==="small"?O==="outlined"?40:48:56;return s.jsxs(v,{sx:{display:"flex",gap:1,alignItems:"flex-start",width:"100%"},children:[s.jsx(v,{sx:{flex:1,minWidth:0},children:s.jsx(C,{fullWidth:!0,...x,id:d,required:E,inputProps:f?void 0:I,slotProps:f?T:void 0,InputProps:c.getInputProps(F),onChange:M,onBlur:k,value:i.value,error:i.error,helperText:i.helperText,disabled:y})}),s.jsx(L,{variant:"outlined",color:"primary",size:V==="small"?"small":"medium",onClick:z,disabled:y,...q,sx:{whiteSpace:"nowrap",minWidth:"auto",height:W,flexShrink:0,...q?.sx},children:D()})]})}exports.default=U;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { jsxs as S, jsx as i, Fragment as q } from "react/jsx-runtime";
|
|
2
|
-
import w from "react";
|
|
3
|
-
import { j as O, t as U, V as H, v as R } from "./AIForm-DtRl0WdY.mjs";
|
|
4
|
-
import G from "@mui/material/TextField";
|
|
5
|
-
import J from "@mui/material/Button";
|
|
6
|
-
import m from "@mui/material/Box";
|
|
7
|
-
import { Icon as K } from "@mui/material";
|
|
8
|
-
function oe({ attributes: l = {}, rules: v = {}, onChange: r, submitTick: h, messages: F }) {
|
|
9
|
-
const {
|
|
10
|
-
id: d = "",
|
|
11
|
-
MuiAttributes: s = {},
|
|
12
|
-
InputProps: b = {},
|
|
13
|
-
format: x = "",
|
|
14
|
-
buttonText: g = "Update Location",
|
|
15
|
-
buttonIcon: j = "location_on",
|
|
16
|
-
buttonDisplay: k = "both",
|
|
17
|
-
MuiButtonAttributes: P = {},
|
|
18
|
-
disabled: V = !1
|
|
19
|
-
} = l, [a, u] = w.useState({
|
|
20
|
-
value: l.value !== void 0 ? l.value : "",
|
|
21
|
-
helperText: s.helperText || "",
|
|
22
|
-
error: !1
|
|
23
|
-
});
|
|
24
|
-
w.useEffect(() => {
|
|
25
|
-
l.value !== void 0 && l.value !== a.value && u((e) => ({ ...e, value: l.value }));
|
|
26
|
-
}, [l.value]);
|
|
27
|
-
const z = (e) => x ? R(e).format(x) : e, c = (e) => {
|
|
28
|
-
const { validation: t } = v;
|
|
29
|
-
if (t)
|
|
30
|
-
for (let o = 0; o < t.length; o += 1) {
|
|
31
|
-
const n = t[o], B = H[n.rule];
|
|
32
|
-
if (!(typeof B == "function" ? B(e, n.value) : !0)) {
|
|
33
|
-
const L = n.rule === "mandatory" ? F?.required || "This field is required" : "";
|
|
34
|
-
return { isValid: !1, message: n.message || L };
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return { isValid: !0, message: "" };
|
|
38
|
-
};
|
|
39
|
-
O(() => {
|
|
40
|
-
if (h) {
|
|
41
|
-
const e = c(a.value);
|
|
42
|
-
u((t) => ({ ...t, helperText: e.message, error: !e.isValid }));
|
|
43
|
-
}
|
|
44
|
-
}, [h]);
|
|
45
|
-
const A = (e) => {
|
|
46
|
-
const { value: t } = e.target, o = c(t);
|
|
47
|
-
u({ value: t, helperText: o.message, error: !o.isValid });
|
|
48
|
-
}, D = (e) => {
|
|
49
|
-
const { value: t } = e.target, o = z(t), n = c(o);
|
|
50
|
-
u({ value: o, helperText: n.message, error: !n.isValid }), typeof r == "function" && r({ id: d, value: o });
|
|
51
|
-
}, E = () => {
|
|
52
|
-
r && r({ id: d, value: a.value, option: "location_update_request" });
|
|
53
|
-
}, M = () => {
|
|
54
|
-
const e = k, t = /* @__PURE__ */ i(K, { children: j });
|
|
55
|
-
switch (e) {
|
|
56
|
-
case "icon":
|
|
57
|
-
return t;
|
|
58
|
-
case "text":
|
|
59
|
-
return /* @__PURE__ */ i(q, { children: g });
|
|
60
|
-
default:
|
|
61
|
-
return /* @__PURE__ */ S(q, { children: [
|
|
62
|
-
t,
|
|
63
|
-
/* @__PURE__ */ i(m, { component: "span", sx: { ml: 0.5 }, children: g })
|
|
64
|
-
] });
|
|
65
|
-
}
|
|
66
|
-
}, W = v?.validation?.some((e) => e.rule === "mandatory") || !1, p = !!s?.slotProps, f = { ...s };
|
|
67
|
-
let I, T;
|
|
68
|
-
if (p) {
|
|
69
|
-
const e = s.slotProps && s.slotProps.input || {};
|
|
70
|
-
T = {
|
|
71
|
-
...s.slotProps || {},
|
|
72
|
-
input: { ...e }
|
|
73
|
-
}, delete f.slotProps;
|
|
74
|
-
} else
|
|
75
|
-
I = { ...s.inputProps || {} }, delete f.inputProps;
|
|
76
|
-
const _ = s.variant || "outlined", y = s.size || "medium", C = y === "small" ? _ === "outlined" ? 40 : 48 : 56;
|
|
77
|
-
return /* @__PURE__ */ S(m, { sx: { display: "flex", gap: 1, alignItems: "flex-start", width: "100%" }, children: [
|
|
78
|
-
/* @__PURE__ */ i(m, { sx: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ i(
|
|
79
|
-
G,
|
|
80
|
-
{
|
|
81
|
-
fullWidth: !0,
|
|
82
|
-
...f,
|
|
83
|
-
id: d,
|
|
84
|
-
required: W,
|
|
85
|
-
inputProps: p ? void 0 : I,
|
|
86
|
-
slotProps: p ? T : void 0,
|
|
87
|
-
InputProps: U(b),
|
|
88
|
-
onChange: A,
|
|
89
|
-
onBlur: D,
|
|
90
|
-
value: a.value,
|
|
91
|
-
error: a.error,
|
|
92
|
-
helperText: a.helperText,
|
|
93
|
-
disabled: V
|
|
94
|
-
}
|
|
95
|
-
) }),
|
|
96
|
-
/* @__PURE__ */ i(
|
|
97
|
-
J,
|
|
98
|
-
{
|
|
99
|
-
variant: "outlined",
|
|
100
|
-
color: "primary",
|
|
101
|
-
size: y === "small" ? "small" : "medium",
|
|
102
|
-
onClick: E,
|
|
103
|
-
disabled: V,
|
|
104
|
-
...P,
|
|
105
|
-
sx: {
|
|
106
|
-
whiteSpace: "nowrap",
|
|
107
|
-
minWidth: "auto",
|
|
108
|
-
height: C,
|
|
109
|
-
flexShrink: 0,
|
|
110
|
-
...P?.sx
|
|
111
|
-
},
|
|
112
|
-
children: M()
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
] });
|
|
116
|
-
}
|
|
117
|
-
export {
|
|
118
|
-
oe as default
|
|
119
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),p=require("react"),v=require("@mui/material/Box"),w=require("@mui/material/Stack"),j=require("@mui/material/Button"),q=require("@mui/material/TextField"),y=require("@mui/material/FormControl"),k=require("@mui/material/FormLabel"),S=require("@mui/material/styles"),l=require("./AIForm-Dv8ahXyE.js");function C(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function M(t){let e=C(t||"");return e=e.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),e=e.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),e=e.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),e=e.replace(/(?:^-\s+.*(?:\n|$))+/gm,s=>`<ul>${s.trimEnd().split(`
|
|
2
|
-
`).map(i=>i.replace(/^-\s+(.*)$/,"<li>$1</li>")).join("")}</ul>`),e=e.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,'<a href="$2">$1</a>'),e=e.replace(/`([^`]+)`/g,"<code>$1</code>"),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\*([^*]+)\*/g,"<em>$1</em>"),e=e.split(/\n{2,}/).map(s=>{const n=s.trim();return n?/^<(h1|h2|h3|ul|pre)/.test(n)?n:`<p>${n.replace(/\n/g,"<br />")}</p>`:""}).join(""),e}function R({attributes:t={},rules:e={},onChange:s}){const{id:n="",label:i,rows:a=6,MuiAttributes:g={}}=t,{sx:h,...x}=g,[u,c]=p.useState(t.value||""),[d,f]=p.useState(!1);l.useUpdateEffect(()=>{c(t.value||"")},[t.value]);const $=e?.validation?.some(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")||!1,b=r=>{const m=r.target.value;c(m),s?.({id:n,value:m})};return o.jsxs(y,{required:$,component:"fieldset",fullWidth:!0,children:[o.jsxs(w,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:1},children:[i?o.jsx(k,{component:"legend",children:i}):o.jsx("span",{}),o.jsx(j,{size:"small",variant:"outlined",onClick:()=>f(r=>!r),sx:{borderRadius:"10px",textTransform:"none"},children:d?"Write":"Preview"})]}),d?o.jsx(v,{"data-testid":"markdown-preview",dangerouslySetInnerHTML:{__html:M(u)},sx:{minHeight:r=>r.spacing(a*3),p:2,borderRadius:"10px",border:r=>`1px solid ${S.alpha(r.palette.text.primary,.12)}`,backgroundColor:r=>r.palette.background.paper,"& :first-of-type":{mt:0},"& :last-child":{mb:0}}}):o.jsx(q,{id:n||void 0,value:u,onChange:b,multiline:!0,minRows:a,fullWidth:!0,placeholder:"Write markdown…",inputProps:{"aria-label":i||"markdown editor"},...x,sx:l.mergeSx(l.premiumInputSx,h)})]})}exports.default=R;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var m=Object.create;var x=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var M=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of f(r))!A.call(t,i)&&i!==e&&x(t,i,{get:()=>r[i],enumerable:!(n=p(r,i))||n.enumerable});return t};var o=(t,r,e)=>(e=t!=null?m(b(t)):{},M(r||!t||!t.__esModule?x(e,"default",{value:t,enumerable:!0}):e,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("react"),u=require("@mui/material/Box"),y=require("@mui/material/CircularProgress"),P=c.lazy(async()=>{const[{ChartContainer:t},{LinePlot:r},{BarPlot:e},{ChartsXAxis:n},{ChartsYAxis:i},{axisClasses:a}]=await Promise.all([import("@mui/x-charts/ChartContainer"),import("@mui/x-charts/LineChart"),import("@mui/x-charts/BarChart"),import("@mui/x-charts/ChartsXAxis"),import("@mui/x-charts/ChartsYAxis"),import("@mui/x-charts/ChartsAxis")]);return{default:({MuiChartContainerAttributes:h={},MuiChartXAxisAttributes:C={},MuiChartYAxisAttributes:j={},MuiChartSX:d={}})=>s.jsxs(t,{sx:{[`.${a.left} .${a.label}`]:{transform:"translate(-25px, 0)"},[`.${a.right} .${a.label}`]:{transform:"translate(30px, 0)"},...d},...h,children:[s.jsx(e,{}),s.jsx(r,{}),s.jsx(n,{...C}),s.jsx(i,{...j})]})}});function g({attributes:t={}}){const{id:r,MuiBoxAttributes:e={},MuiChartContainerAttributes:n={},MuiChartXAxisAttributes:i={},MuiChartYAxisAttributes:a={},MuiChartSX:l={}}=t;return s.jsx(u,{sx:{width:"100%",maxWidth:600},...e,children:s.jsx(c.Suspense,{fallback:s.jsx(u,{sx:{display:"flex",justifyContent:"center",p:2},children:s.jsx(y,{})}),children:s.jsx(P,{MuiChartContainerAttributes:n,MuiChartXAxisAttributes:i,MuiChartYAxisAttributes:a,MuiChartSX:l})})},r)}exports.default=g;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),m=require("react"),p=require("@mui/material/Box"),h=require("@mui/material/Paper"),x=require("@mui/material/Divider"),g=require("@mui/material/IconButton"),j=require("@mui/material/Tooltip"),M=require("@mui/material/FormLabel"),q=require("@mui/material/FormControl"),S=require("@mui/icons-material/FormatBold"),R=require("@mui/icons-material/FormatItalic"),y=require("@mui/icons-material/FormatUnderlined"),E=require("@mui/icons-material/FormatListBulleted"),C=require("@mui/icons-material/FormatListNumbered"),L=require("@mui/icons-material/Link"),v=require("@mui/icons-material/FormatClear"),n=require("@mui/material/styles"),o=require("./AIForm-Dv8ahXyE.js"),U=[{command:"bold",label:"Bold",icon:r.jsx(S,{fontSize:"small"})},{command:"italic",label:"Italic",icon:r.jsx(R,{fontSize:"small"})},{command:"underline",label:"Underline",icon:r.jsx(y,{fontSize:"small"})},{command:"insertUnorderedList",label:"Bulleted list",icon:r.jsx(E,{fontSize:"small"})},{command:"insertOrderedList",label:"Numbered list",icon:r.jsx(C,{fontSize:"small"})},{command:"createLink",label:"Insert link",icon:r.jsx(L,{fontSize:"small"}),prompt:!0},{command:"removeFormat",label:"Clear formatting",icon:r.jsx(v,{fontSize:"small"})}];function F({attributes:a={},onChange:u}){const{id:i="",label:s,minHeight:b=160,MuiAttributes:d={}}=a,l=m.useRef(null);m.useEffect(()=>{const e=l.current;if(!e)return;const t=a.value??"";e.innerHTML!==t&&(e.innerHTML=t)},[a.value]);const f=e=>{l.current?.focus();try{if(e.prompt){const t=window.prompt("Enter a URL");t&&document.execCommand(e.command,!1,t)}else document.execCommand(e.command)}catch{}l.current&&u?.({id:i,value:l.current.innerHTML})},I=e=>{u?.({id:i,value:e.currentTarget.innerHTML})};return r.jsxs(q,{fullWidth:!0,children:[s&&r.jsx(M,{sx:{mb:.75,fontWeight:500},component:"legend",children:s}),r.jsxs(h,{variant:"outlined",sx:e=>({borderRadius:`${o.PREMIUM_RADIUS+2}px`,borderColor:n.alpha(e.palette.text.primary,.12),overflow:"hidden",transition:`box-shadow .2s ${o.PREMIUM_EASING}, border-color .2s ${o.PREMIUM_EASING}`,"&:hover":{borderColor:n.alpha(e.palette.primary.main,.5),boxShadow:`0 2px 10px ${n.alpha(e.palette.common.black,.06)}`},"&:focus-within":{borderColor:e.palette.primary.main,boxShadow:`0 0 0 3px ${n.alpha(e.palette.primary.main,.16)}`}}),children:[r.jsx(p,{sx:e=>({display:"flex",flexWrap:"wrap",alignItems:"center",gap:.25,px:.75,py:.5,backgroundColor:n.alpha(e.palette.text.primary,.03)}),children:U.map((e,t)=>r.jsxs(m.Fragment,{children:[(t===3||t===5)&&r.jsx(x,{orientation:"vertical",flexItem:!0,sx:{mx:.25,my:.5}}),r.jsx(j,{title:e.label,children:r.jsx(g,{size:"small","aria-label":e.label,onMouseDown:c=>c.preventDefault(),onClick:()=>f(e),sx:c=>({borderRadius:`${o.PREMIUM_RADIUS-2}px`,transition:`background-color .18s ${o.PREMIUM_EASING}, transform .18s ${o.PREMIUM_EASING}`,"&:hover":{backgroundColor:n.alpha(c.palette.primary.main,.1),transform:"translateY(-1px)"}}),children:e.icon})})]},e.command))}),r.jsx(x,{}),r.jsx(p,{id:i,ref:l,role:"textbox","aria-multiline":"true","aria-label":s||"rich text",contentEditable:!0,suppressContentEditableWarning:!0,onInput:I,...d,sx:e=>({minHeight:b,px:1.75,py:1.25,outline:"none",lineHeight:1.6,color:e.palette.text.primary,backgroundColor:e.palette.background.paper,"& p":{margin:"0 0 0.5em"},"& ul, & ol":{paddingLeft:"1.5em",margin:"0 0 0.5em"},"& a":{color:e.palette.primary.main},...d.sx||{}})})]})]})}exports.default=F;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),u=require("react"),I=require("@mui/material/Autocomplete"),R=require("@mui/material/TextField"),$=require("@mui/material/Chip"),a=require("./AIForm-Dv8ahXyE.js"),p=(e,o)=>Array.isArray(e)?e.map(t=>String(t)).filter(t=>t!==""):e==null||e===""?[]:String(e).split(new RegExp(`[${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},]`)).map(t=>t.trim()).filter(t=>t!=="");function k({attributes:e={},rules:o={},onChange:d}){const{MuiAttributes:m={},id:t="",options:q=[],separator:l=";",label:v="",placeholder:T=""}=e,{sx:A,...M}=m,[g,i]=u.useState(()=>p(e.value,l)),[j,f]=u.useState(!1);u.useEffect(()=>{i(p(e.value,l))},[]),a.useUpdateEffect(()=>{i(p(e.value,l))},[e.value]);const x=o?.validation?.some(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")||!1,y=x&&j&&g.length===0,C=y?o?.validation?.find(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")?.message||"Required":"",E=(r,c)=>{const n=c.map(s=>String(s).trim()).filter(s=>s!=="");i(n),f(!0),d?.({id:t,value:n,option:n})};return h.jsx(I,{freeSolo:!0,multiple:!0,id:t,options:q,value:g,onChange:E,onBlur:()=>f(!0),renderTags:(r,c)=>r.map((n,s)=>{const S=c({index:s});return u.createElement($,{label:n,...S,key:S.key,sx:a.premiumChipSx})}),renderInput:r=>h.jsx(R,{...r,label:v,placeholder:T,required:x,error:y,helperText:C,sx:a.mergeSx(a.premiumInputSx,A)}),...M})}exports.default=k;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
-
import { useState as y, useEffect as k, createElement as I } from "react";
|
|
3
|
-
import $ from "@mui/material/Autocomplete";
|
|
4
|
-
import j from "@mui/material/TextField";
|
|
5
|
-
import q from "@mui/material/Chip";
|
|
6
|
-
import { j as R, m as B, p as F, k as P } from "./AIForm-DtRl0WdY.mjs";
|
|
7
|
-
const i = (e, a) => Array.isArray(e) ? e.map((t) => String(t)).filter((t) => t !== "") : e == null || e === "" ? [] : String(e).split(new RegExp(`[${a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")},]`)).map((t) => t.trim()).filter((t) => t !== "");
|
|
8
|
-
function K({ attributes: e = {}, rules: a = {}, onChange: m }) {
|
|
9
|
-
const {
|
|
10
|
-
MuiAttributes: p = {},
|
|
11
|
-
id: t = "",
|
|
12
|
-
options: S = [],
|
|
13
|
-
separator: s = ";",
|
|
14
|
-
label: v = "",
|
|
15
|
-
placeholder: T = ""
|
|
16
|
-
} = e, { sx: C, ...A } = p, [c, l] = y(() => i(e.value, s)), [E, d] = y(!1);
|
|
17
|
-
k(() => {
|
|
18
|
-
l(i(e.value, s));
|
|
19
|
-
}, []), R(() => {
|
|
20
|
-
l(i(e.value, s));
|
|
21
|
-
}, [e.value]);
|
|
22
|
-
const f = a?.validation?.some((r) => r.rule === "mandatory" || r.rule === "mandatoryselect") || !1, g = f && E && c.length === 0, M = g ? a?.validation?.find((r) => r.rule === "mandatory" || r.rule === "mandatoryselect")?.message || "Required" : "";
|
|
23
|
-
return /* @__PURE__ */ x(
|
|
24
|
-
$,
|
|
25
|
-
{
|
|
26
|
-
freeSolo: !0,
|
|
27
|
-
multiple: !0,
|
|
28
|
-
id: t,
|
|
29
|
-
options: S,
|
|
30
|
-
value: c,
|
|
31
|
-
onChange: (r, u) => {
|
|
32
|
-
const n = u.map((o) => String(o).trim()).filter((o) => o !== "");
|
|
33
|
-
l(n), d(!0), m?.({ id: t, value: n, option: n });
|
|
34
|
-
},
|
|
35
|
-
onBlur: () => d(!0),
|
|
36
|
-
renderTags: (r, u) => r.map((n, o) => {
|
|
37
|
-
const h = u({ index: o });
|
|
38
|
-
return /* @__PURE__ */ I(q, { label: n, ...h, key: h.key, sx: F });
|
|
39
|
-
}),
|
|
40
|
-
renderInput: (r) => /* @__PURE__ */ x(
|
|
41
|
-
j,
|
|
42
|
-
{
|
|
43
|
-
...r,
|
|
44
|
-
label: v,
|
|
45
|
-
placeholder: T,
|
|
46
|
-
required: f,
|
|
47
|
-
error: g,
|
|
48
|
-
helperText: M,
|
|
49
|
-
sx: B(P, C)
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
...A
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
export {
|
|
57
|
-
K as default
|
|
58
|
-
};
|