dynamic-mui 2.3.1 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +22 -0
  2. package/dist/{index-Bh6BLrzq.mjs → AIForm-DtRl0WdY.mjs} +4213 -4371
  3. package/dist/AIForm-Dv8ahXyE.js +43 -0
  4. package/dist/accordion-BaiGxDcw.js +1 -0
  5. package/dist/{accordion-DEd2a2Ps.mjs → accordion-xg_TxxYS.mjs} +1 -1
  6. package/dist/{addressfield-FjNJCCuC.mjs → addressfield-BvQEHdEk.mjs} +1 -1
  7. package/dist/addressfield-vVizrbZP.js +1 -0
  8. package/dist/ai/index.cjs +1 -0
  9. package/dist/ai/index.mjs +14 -0
  10. package/dist/{asyncautocomplete-B8qI_lz9.mjs → asyncautocomplete-AmSRs7PY.mjs} +19 -19
  11. package/dist/asyncautocomplete-Dtmxh4l1.js +1 -0
  12. package/dist/bar-BiIzbOC3.js +1 -0
  13. package/dist/bar-DNc7TMKj.mjs +21 -0
  14. package/dist/{cascadeselect-D8sVXV1g.mjs → cascadeselect-BlznIKS6.mjs} +16 -16
  15. package/dist/cascadeselect-DqLtG-W9.js +1 -0
  16. package/dist/colorpicker-DpLvK1WR.js +1 -0
  17. package/dist/{colorpicker-DcyceL6g.mjs → colorpicker-hP3b7teC.mjs} +2 -2
  18. package/dist/consentfield-B21l9tGo.js +1 -0
  19. package/dist/{consentfield-B_qBOIuX.mjs → consentfield-CGT98YbR.mjs} +8 -8
  20. package/dist/datatable-B_6wXh2g.mjs +21 -0
  21. package/dist/datatable-Bv0Q37Zy.js +1 -0
  22. package/dist/dynamic-mui.cjs +1 -1
  23. package/dist/dynamic-mui.d.ts +2 -0
  24. package/dist/dynamic-mui.mjs +207 -30
  25. package/dist/editabletable-D3c3DJxX.js +1 -0
  26. package/dist/{editabletable-D6_U9op8.mjs → editabletable-YaFqdLvf.mjs} +13 -13
  27. package/dist/fileupload--KzSGb5a.js +1 -0
  28. package/dist/{fileupload-CugTpR-B.mjs → fileupload-ZBi72f1R.mjs} +11 -11
  29. package/dist/formrepeater-BhUEa4BI.js +1 -0
  30. package/dist/{formrepeater-Cxawn2sQ.mjs → formrepeater-Cwgtvz1c.mjs} +8 -8
  31. package/dist/formwizard-BlozHDc_.js +1 -0
  32. package/dist/{formwizard-Cfd5IPkE.mjs → formwizard-CYcgf5jL.mjs} +1 -1
  33. package/dist/geofield-BynrTSVm.js +1 -0
  34. package/dist/{geofield-k2V0hglK.mjs → geofield-xqZy_DAY.mjs} +12 -12
  35. package/dist/{group-D40b3E1V.mjs → group-DmLN-b09.mjs} +1 -1
  36. package/dist/group-Dtju1rHQ.js +1 -0
  37. package/dist/index.d.ts +2 -0
  38. package/dist/intlphone-BeHXAcFi.js +1 -0
  39. package/dist/{intlphone-BbTprmmA.mjs → intlphone-CXUQP9Gp.mjs} +5 -5
  40. package/dist/{keyvaluefield-zD6Kf4D0.mjs → keyvaluefield-BJoEbe4I.mjs} +13 -13
  41. package/dist/keyvaluefield-BZQDG0l5.js +1 -0
  42. package/dist/line-B3CAbZOo.mjs +21 -0
  43. package/dist/line-tIm99vYW.js +1 -0
  44. package/dist/{lineitemlist-BZbAId8H.mjs → lineitemlist-CBSqoC9g.mjs} +7 -7
  45. package/dist/lineitemlist-RqStjYB-.js +1 -0
  46. package/dist/{list-BhTzYFrR.mjs → list-C8QMpJOJ.mjs} +2 -2
  47. package/dist/list-D_cawpPI.js +1 -0
  48. package/dist/locationfield-BiLy-c09.js +1 -0
  49. package/dist/{locationfield-BZpGC10B.mjs → locationfield-KBbu-98L.mjs} +19 -19
  50. package/dist/{markdowneditor-B5F4okCW.mjs → markdowneditor-DFOgRmdL.mjs} +1 -1
  51. package/dist/markdowneditor-Dy7Q01FM.js +2 -0
  52. package/dist/{matrixfield-CUo7zFWC.mjs → matrixfield-0lnuaEks.mjs} +7 -7
  53. package/dist/matrixfield-nWt6Cug5.js +1 -0
  54. package/dist/{multitextbox-CsNOrHZP.mjs → multitextbox-DmAWV163.mjs} +23 -23
  55. package/dist/multitextbox-oEgl2F8-.js +1 -0
  56. package/dist/{npsscale-Cb8NxADb.mjs → npsscale-CdTEwERY.mjs} +12 -12
  57. package/dist/npsscale-DW4sxcLz.js +1 -0
  58. package/dist/{numberstepper-DLk_r1HM.mjs → numberstepper-BwQ5coLc.mjs} +8 -8
  59. package/dist/numberstepper-cDosevJb.js +1 -0
  60. package/dist/pie-CBRckgd4.mjs +21 -0
  61. package/dist/pie-gAfuDR1F.js +1 -0
  62. package/dist/richtexteditor-DI-h5Efn.js +1 -0
  63. package/dist/{richtexteditor-pQIK2f-6.mjs → richtexteditor-xrbv8PXZ.mjs} +1 -1
  64. package/dist/{signature-CFv0jhVN.mjs → signature-CP_lA_Yh.mjs} +1 -1
  65. package/dist/{signature-G-XCOszC.js → signature-FM6L60nk.js} +2 -2
  66. package/dist/{stepper-U0kv127E.mjs → stepper-BprezTzX.mjs} +4 -4
  67. package/dist/stepper-CjGNFyBz.js +1 -0
  68. package/dist/{summaryfield-QcpYr9Xt.mjs → summaryfield-5mJRwVZ4.mjs} +5 -5
  69. package/dist/summaryfield-C3xmqZQp.js +1 -0
  70. package/dist/tabs-B4P59kHX.js +1 -0
  71. package/dist/{tabs-DCLyTKVm.mjs → tabs-By-Mm8vm.mjs} +1 -1
  72. package/dist/tagsinput-BwM3NYK_.js +1 -0
  73. package/dist/{tagsinput-D1VP8Bjq.mjs → tagsinput-Ce4EWy4i.mjs} +10 -10
  74. package/dist/util/muiX.d.ts +45 -0
  75. package/package.json +6 -1
  76. package/dist/accordion-Bf0VwGuE.js +0 -1
  77. package/dist/addressfield-Dfd9ilpe.js +0 -1
  78. package/dist/asyncautocomplete-9O6nwGP_.js +0 -1
  79. package/dist/bar-BzO7tvYJ.mjs +0 -20
  80. package/dist/bar-DEVxyUVS.js +0 -1
  81. package/dist/cascadeselect-DeoPn4_V.js +0 -1
  82. package/dist/colorpicker-BcnqB34i.js +0 -1
  83. package/dist/consentfield-CR69IP1l.js +0 -1
  84. package/dist/datatable-BIQznwQe.mjs +0 -20
  85. package/dist/datatable-BWlcUP0M.js +0 -1
  86. package/dist/editabletable-BdywdA42.js +0 -1
  87. package/dist/fileupload-YzpAUgok.js +0 -1
  88. package/dist/formrepeater-B_2UOIBm.js +0 -1
  89. package/dist/formwizard-CCBY6s19.js +0 -1
  90. package/dist/geofield-CJm8hivf.js +0 -1
  91. package/dist/group-IFZTzo-g.js +0 -1
  92. package/dist/index-eJceCjKS.js +0 -43
  93. package/dist/intlphone-CmiRFHv-.js +0 -1
  94. package/dist/keyvaluefield-CoOmou7m.js +0 -1
  95. package/dist/line-B-DwR1hm.mjs +0 -20
  96. package/dist/line-BkymZu31.js +0 -1
  97. package/dist/lineitemlist-BRsW0O7Z.js +0 -1
  98. package/dist/list-DWf2NWix.js +0 -1
  99. package/dist/locationfield-DC_2IN-B.js +0 -1
  100. package/dist/markdowneditor-Coi3sksx.js +0 -2
  101. package/dist/matrixfield-DAjfXU96.js +0 -1
  102. package/dist/multitextbox-Cq7vt1-g.js +0 -1
  103. package/dist/npsscale-BWpMrK_O.js +0 -1
  104. package/dist/numberstepper-BqQeBbR9.js +0 -1
  105. package/dist/pie-CJSL8Sv5.js +0 -1
  106. package/dist/pie-CL29dlh5.mjs +0 -20
  107. package/dist/richtexteditor-BUrvVR_T.js +0 -1
  108. package/dist/stepper-Bc9NlbU7.js +0 -1
  109. package/dist/summaryfield-B_bePxLk.js +0 -1
  110. package/dist/tabs-Cs9eNEbR.js +0 -1
  111. package/dist/tagsinput-DlopThdw.js +0 -1
@@ -0,0 +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("./AIForm-Dv8ahXyE.js"),l=require("./v4-CqdK_b8Y.js");function m({attributes:o={},patch:c,onChange:n}){const{MuiAttributes:i={},label:t="Accordion",subFields:s=[]}=o,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:c,onChange:n})})]})}exports.default=m;
@@ -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-Bh6BLrzq.mjs";
4
+ import { F as A } from "./AIForm-DtRl0WdY.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(), []);
@@ -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-Bh6BLrzq.mjs";
6
+ import { j as E, m as P, k as I } from "./AIForm-DtRl0WdY.mjs";
7
7
  const N = [
8
8
  { value: "US", label: "United States" },
9
9
  { value: "CA", label: "Canada" },
@@ -0,0 +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"),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;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../AIForm-Dv8ahXyE.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.createAIClient=e.createAIClient;exports.formFieldsToSimple=e.formFieldsToSimple;exports.simpleFieldsToFormFields=e.simpleFieldsToFormFields;exports.slug=e.slug;exports.useAIAssist=e.useAIAssist;
@@ -0,0 +1,14 @@
1
+ import { A as a, a as i, b as o, c as A, d as r, e as l, f as m, g as I, s as t, h as F, u as d } from "../AIForm-DtRl0WdY.mjs";
2
+ export {
3
+ a as AIFill,
4
+ i as AIForm,
5
+ o as AIFormGenerator,
6
+ A as AISchemaReview,
7
+ r as AITextAssist,
8
+ l as AIVisionImport,
9
+ m as createAIClient,
10
+ I as formFieldsToSimple,
11
+ t as simpleFieldsToFormFields,
12
+ F as slug,
13
+ d as useAIAssist
14
+ };
@@ -1,9 +1,9 @@
1
- import { jsx as c, jsxs as F, Fragment as K } from "react/jsx-runtime";
2
- import { useState as f, useRef as y, useEffect as L, createElement as M } from "react";
3
- import _ from "@mui/material/Autocomplete";
4
- import k from "@mui/material/TextField";
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
5
  import z from "@mui/material/CircularProgress";
6
- import { u as V, a as w } from "./index-Bh6BLrzq.mjs";
6
+ import { j as V, k as w } from "./AIForm-DtRl0WdY.mjs";
7
7
  function Q({ attributes: t = {}, rules: v = {}, onChange: A }) {
8
8
  const {
9
9
  MuiAttributes: C = {},
@@ -11,18 +11,18 @@ function Q({ attributes: t = {}, rules: v = {}, onChange: A }) {
11
11
  label: I = "Search",
12
12
  placeholder: O = "",
13
13
  minChars: S = 1,
14
- debounceMs: q = 300,
15
- labelKey: P = "label",
14
+ debounceMs: j = 300,
15
+ labelKey: q = "label",
16
16
  valueKey: p = "value",
17
17
  loadOptions: m,
18
18
  optionsUrl: s
19
- } = t, [T, d] = f(t.value ?? null), [b, a] = f([]), [h, o] = f(!1), u = y(0), r = y(null);
19
+ } = t, [P, d] = f(t.value ?? null), [T, a] = f([]), [h, o] = f(!1), u = y(0), r = y(null);
20
20
  V(() => {
21
21
  d(t.value ?? null);
22
- }, [t.value]), L(() => () => {
22
+ }, [t.value]), K(() => () => {
23
23
  r.current && clearTimeout(r.current);
24
24
  }, []);
25
- const j = async (e) => {
25
+ const b = async (e) => {
26
26
  if (typeof m == "function")
27
27
  return m(e);
28
28
  if (s) {
@@ -32,7 +32,7 @@ function Q({ attributes: t = {}, rules: v = {}, onChange: A }) {
32
32
  return [];
33
33
  }, E = (e) => {
34
34
  const n = ++u.current;
35
- o(!0), j(e).then((i) => {
35
+ o(!0), b(e).then((i) => {
36
36
  n === u.current && (a(Array.isArray(i) ? i : []), o(!1));
37
37
  }).catch(() => {
38
38
  n === u.current && (a([]), o(!1));
@@ -44,28 +44,28 @@ function Q({ attributes: t = {}, rules: v = {}, onChange: A }) {
44
44
  }
45
45
  r.current = setTimeout(() => {
46
46
  E(n);
47
- }, q);
47
+ }, j);
48
48
  }, U = (e, n) => {
49
49
  d(n), A?.({
50
50
  id: x,
51
51
  value: n != null ? n?.[p] ?? n : n,
52
52
  option: n
53
53
  });
54
- }, l = (e) => typeof e == "string" ? e : e?.[P] ?? "", $ = !!v?.validation?.some((e) => e.rule === "mandatory");
54
+ }, l = (e) => typeof e == "string" ? e : e?.[q] ?? "", $ = !!v?.validation?.some((e) => e.rule === "mandatory");
55
55
  return /* @__PURE__ */ c(
56
- _,
56
+ M,
57
57
  {
58
- value: T,
58
+ value: P,
59
59
  onChange: U,
60
60
  onInputChange: R,
61
- options: b,
61
+ options: T,
62
62
  loading: h,
63
63
  filterOptions: (e) => e,
64
64
  getOptionLabel: l,
65
- renderOption: (e, n) => /* @__PURE__ */ M("li", { ...e, key: (n && n[p]) ?? l(n) }, l(n)),
65
+ renderOption: (e, n) => /* @__PURE__ */ L("li", { ...e, key: (n && n[p]) ?? l(n) }, l(n)),
66
66
  ...C,
67
67
  renderInput: (e) => /* @__PURE__ */ c(
68
- k,
68
+ _,
69
69
  {
70
70
  ...e,
71
71
  label: I,
@@ -74,7 +74,7 @@ function Q({ attributes: t = {}, rules: v = {}, onChange: A }) {
74
74
  sx: w,
75
75
  InputProps: {
76
76
  ...e.InputProps,
77
- endAdornment: /* @__PURE__ */ F(K, { children: [
77
+ endAdornment: /* @__PURE__ */ k(F, { children: [
78
78
  h ? /* @__PURE__ */ c(z, { color: "inherit", size: 20 }) : null,
79
79
  e.InputProps.endAdornment
80
80
  ] })
@@ -0,0 +1 @@
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;
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.create;var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var x=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!d.call(t,s)&&s!==r&&a(t,s,{get:()=>e[s],enumerable:!(i=c(e,s))||i.enumerable});return t};var f=(t,e,r)=>(r=t!=null?o(h(t)):{},x(e||!t||!t.__esModule?a(r,"default",{value:t,enumerable:!0}):r,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("react"),j=require("@mui/material/Box"),C=require("@mui/material/CircularProgress"),y=require("./AIForm-Dv8ahXyE.js"),g=u.lazy(()=>import("@mui/x-charts/BarChart").then(t=>({default:t.BarChart})));function p({attributes:t={}}){const{MuiChartAttributes:e={},id:r=""}=t,i=y.getMuiX("BarChart")||g;return n.jsx(u.Suspense,{fallback:n.jsx(j,{sx:{display:"flex",justifyContent:"center",p:2},children:n.jsx(C,{})}),children:n.jsx(i,{height:300,...e},r)})}exports.default=p;
@@ -0,0 +1,21 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import i, { Suspense as s } from "react";
3
+ import n from "@mui/material/Box";
4
+ import f from "@mui/material/CircularProgress";
5
+ import { i as m } from "./AIForm-DtRl0WdY.mjs";
6
+ const c = i.lazy(
7
+ () => import("@mui/x-charts/BarChart").then((t) => ({ default: t.BarChart }))
8
+ );
9
+ function d({ attributes: t = {} }) {
10
+ const { MuiChartAttributes: a = {}, id: o = "" } = t, e = m("BarChart") || c;
11
+ return /* @__PURE__ */ r(
12
+ s,
13
+ {
14
+ fallback: /* @__PURE__ */ r(n, { sx: { display: "flex", justifyContent: "center", p: 2 }, children: /* @__PURE__ */ r(f, {}) }),
15
+ children: /* @__PURE__ */ r(e, { height: 300, ...a }, o)
16
+ }
17
+ );
18
+ }
19
+ export {
20
+ d as default
21
+ };
@@ -1,13 +1,13 @@
1
- import { jsxs as C, jsx as p } from "react/jsx-runtime";
2
- import x, { useCallback as E } from "react";
3
- import I from "@mui/material/TextField";
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
4
  import S from "@mui/material/MenuItem";
5
- import { u as y, m as O, a as P } from "./index-Bh6BLrzq.mjs";
6
- const R = (a) => Array.isArray(a) ? a.map(
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
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) => {
9
9
  const r = a && e != null && e !== "" ? a[e] : void 0;
10
- return R(r ?? t ?? []);
10
+ return P(r ?? t ?? []);
11
11
  };
12
12
  function U({ attributes: a = {}, rules: e = {}, onChange: t }) {
13
13
  const {
@@ -22,36 +22,36 @@ function U({ attributes: a = {}, rules: e = {}, onChange: t }) {
22
22
  (l) => l.rule === "mandatory" || l.rule === "mandatoryselect"
23
23
  ) || !1, [m, g] = x.useState(
24
24
  () => h(o, s, i)
25
- ), [n, d] = x.useState(() => a?.value ?? "");
25
+ ), [u, d] = x.useState(() => a?.value ?? "");
26
26
  y(() => {
27
27
  d(a?.value ?? "");
28
28
  }, [a?.value]), y(() => {
29
29
  const l = h(o, s, i);
30
- g(l), n !== "" && n != null && !l.some((u) => u.value === n) && (d(""), t?.({ id: r, value: "", option: null }));
30
+ g(l), u !== "" && u != null && !l.some((n) => n.value === u) && (d(""), t?.({ id: r, value: "", option: null }));
31
31
  }, [s, o, i]);
32
- const M = E(
32
+ const j = C(
33
33
  (l) => {
34
- const u = l.target.value, j = m.find((A) => A.value === u) ?? null;
35
- d(u), t?.({ id: r, value: u, option: j });
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
36
  },
37
37
  [m, r, t]
38
38
  );
39
- return /* @__PURE__ */ C(
40
- I,
39
+ return /* @__PURE__ */ k(
40
+ E,
41
41
  {
42
42
  select: !0,
43
43
  fullWidth: !0,
44
44
  label: v,
45
45
  placeholder: c,
46
46
  required: b,
47
- value: n ?? "",
48
- onChange: M,
47
+ value: u ?? "",
48
+ onChange: j,
49
49
  SelectProps: {
50
50
  displayEmpty: !0,
51
51
  inputProps: { "aria-label": v || "cascade-select" }
52
52
  },
53
53
  ...f,
54
- sx: O(P, f?.sx),
54
+ sx: I(O, f?.sx),
55
55
  children: [
56
56
  c ? /* @__PURE__ */ p(S, { value: "", children: /* @__PURE__ */ p("em", { children: c }) }) : null,
57
57
  m.map((l) => /* @__PURE__ */ p(S, { value: l.value, children: l.label }, String(l.value)))
@@ -0,0 +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("./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;
@@ -0,0 +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"),l=require("@mui/material/styles"),n=require("./AIForm-Dv8ahXyE.js"),h="#000000";function F({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);n.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 ${l.alpha(e.palette.text.primary,.2)}`,boxShadow:e=>`0 2px 8px ${l.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:n.mergeSx(n.premiumInputSx,n.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 ${l.alpha(i.palette.text.primary,.2)}`,boxShadow:i=>`0 1px 4px ${l.alpha(i.palette.common.black,.12)}`}},e))})]})}exports.default=F;
@@ -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-Bh6BLrzq.mjs";
9
+ import { j as R, m as x, k as j } from "./AIForm-DtRl0WdY.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(
@@ -68,7 +68,7 @@ function q({ attributes: t = {}, rules: f = {}, onChange: b }) {
68
68
  size: "small",
69
69
  label: "Hex",
70
70
  inputProps: { "aria-label": "hex value" },
71
- sx: x(B, x({ maxWidth: 160 }, w))
71
+ sx: x(j, x({ maxWidth: 160 }, w))
72
72
  }
73
73
  )
74
74
  ] }),
@@ -0,0 +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"),A=require("@mui/material/FormControlLabel"),I=require("@mui/material/FormHelperText"),P=require("@mui/material/styles"),s=require("./AIForm-Dv8ahXyE.js");function V({attributes:l={},rules:c={},onChange:x}){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("");s.useUpdateEffect(()=>{d(!!l.value)},[l.value]);const n=c?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,y=e=>{let r=!0,o="";return n&&!e&&(r=!1,o=c?.validation?.find(h=>h.rule==="mandatory"||h.rule==="mandatoryselect")?.message||"Required"),{isValid:r,message:o}},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 o=y(r);j(!o.isValid),v(o.message),x?.({id:p,value:r})},F=u&&!q,{sx:H,...E}=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:s.mergeSx(s.premiumSurfaceSx,{maxHeight:200,overflow:"auto",p:2,mb:1,whiteSpace:"pre-wrap",backgroundColor:e=>P.alpha(e.palette.background.paper,1)}),children:f}),t.jsx(A,{...E,sx:s.mergeSx(s.premiumControlLabelSx,H),label:L,control:t.jsx(w,{checked:S,disabled:F,onChange:k,required:n,inputProps:{"aria-label":"consent-agree"}})}),m&&t.jsx(I,{children:m})]})}exports.default=V;
@@ -1,12 +1,12 @@
1
1
  import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
2
  import s from "react";
3
- import j from "@mui/material/Box";
3
+ import M from "@mui/material/Box";
4
4
  import R from "@mui/material/Checkbox";
5
5
  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-Bh6BLrzq.mjs";
9
+ import { j as P, m as f, l as U, n as W } from "./AIForm-DtRl0WdY.mjs";
10
10
  function Z({ attributes: a = {}, rules: n = {}, onChange: h }) {
11
11
  const {
12
12
  MuiAttributes: g = {},
@@ -14,7 +14,7 @@ function Z({ attributes: a = {}, rules: n = {}, onChange: h }) {
14
14
  text: S = "",
15
15
  label: c = "I agree to the terms",
16
16
  requireScroll: i = !0
17
- } = a, [b, d] = s.useState(!!a.value), [C, v] = s.useState(!i), [k, T] = s.useState(!1), [m, y] = s.useState("");
17
+ } = a, [C, d] = s.useState(!!a.value), [b, v] = s.useState(!i), [k, T] = s.useState(!1), [m, y] = s.useState("");
18
18
  P(() => {
19
19
  d(!!a.value);
20
20
  }, [a.value]);
@@ -31,13 +31,13 @@ function Z({ attributes: a = {}, rules: n = {}, onChange: h }) {
31
31
  d(r);
32
32
  const t = H(r);
33
33
  T(!t.isValid), y(t.message), h?.({ id: x, value: r });
34
- }, F = i && !C, { sx: L, ...w } = g, M = l ? /* @__PURE__ */ p("span", { children: [
34
+ }, F = i && !b, { sx: L, ...j } = g, w = l ? /* @__PURE__ */ p("span", { children: [
35
35
  c,
36
36
  /* @__PURE__ */ o("span", { "aria-hidden": "true", style: { color: "#d32f2f", marginLeft: 2 }, children: "*" })
37
37
  ] }) : c;
38
38
  return /* @__PURE__ */ p(V, { required: l, error: k, component: "fieldset", fullWidth: !0, children: [
39
39
  /* @__PURE__ */ o(
40
- j,
40
+ M,
41
41
  {
42
42
  "data-testid": "consent-terms",
43
43
  onScroll: q,
@@ -55,13 +55,13 @@ function Z({ attributes: a = {}, rules: n = {}, onChange: h }) {
55
55
  /* @__PURE__ */ o(
56
56
  A,
57
57
  {
58
- ...w,
58
+ ...j,
59
59
  sx: f(W, L),
60
- label: M,
60
+ label: w,
61
61
  control: /* @__PURE__ */ o(
62
62
  R,
63
63
  {
64
- checked: b,
64
+ checked: C,
65
65
  disabled: F,
66
66
  onChange: E,
67
67
  required: l,
@@ -0,0 +1,21 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import e, { Suspense as n } from "react";
3
+ import s from "@mui/material/Box";
4
+ import c from "@mui/material/CircularProgress";
5
+ import { i as l } from "./AIForm-DtRl0WdY.mjs";
6
+ const m = e.lazy(
7
+ () => import("@mui/x-data-grid").then((r) => ({ default: r.DataGrid }))
8
+ );
9
+ function D({ attributes: r = {} }) {
10
+ const { MuiAttributes: a = {}, container: i = {} } = r, o = l("DataGrid") || m;
11
+ return /* @__PURE__ */ t("div", { ...i, children: /* @__PURE__ */ t(
12
+ n,
13
+ {
14
+ fallback: /* @__PURE__ */ t(s, { sx: { display: "flex", justifyContent: "center", p: 2 }, children: /* @__PURE__ */ t(c, {}) }),
15
+ children: /* @__PURE__ */ t(o, { rows: [], columns: [], ...a })
16
+ }
17
+ ) });
18
+ }
19
+ export {
20
+ D as default
21
+ };
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.create;var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var j=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l(t))!x.call(e,i)&&i!==r&&a(e,i,{get:()=>t[i],enumerable:!(n=u(t,i))||n.enumerable});return e};var f=(e,t,r)=>(r=e!=null?c(d(e)):{},j(t||!e||!e.__esModule?a(r,"default",{value:e,enumerable:!0}):r,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),y=require("@mui/material/Box"),b=require("@mui/material/CircularProgress"),m=require("./AIForm-Dv8ahXyE.js"),p=o.lazy(()=>import("@mui/x-data-grid").then(e=>({default:e.DataGrid})));function q({attributes:e={}}){const{MuiAttributes:t={},container:r={}}=e,n=m.getMuiX("DataGrid")||p;return s.jsx("div",{...r,children:s.jsx(o.Suspense,{fallback:s.jsx(y,{sx:{display:"flex",justifyContent:"center",p:2},children:s.jsx(b,{})}),children:s.jsx(n,{rows:[],columns:[],...t})})})}exports.default=q;
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./AIForm-Dv8ahXyE.js"),g=require("react");function U(e){return r=>{const i=e.safeParse(r);return!i||i.success?[]:(i.error?.issues||i.error?.errors||[]).map(p=>({id:String(p?.path?.[0]??""),message:p?.message||"Invalid value",rule:p?.code||"zod"})).filter(p=>p.id)}}function H(e){return r=>{try{return e.validateSync(r,{abortEarly:!1}),[]}catch(i){return(i?.inner?.length?i.inner:i?[i]:[]).map(p=>({id:String(p?.path??""),message:p?.message||"Invalid value",rule:p?.type||"yup"})).filter(p=>p.id)}}}const R=["mandatory","mandatoryselect"],I=(e,r)=>{const i=[];return(e||[]).forEach(h=>{if(i.push(h),Array.isArray(h.subforms)&&h.subforms.length){const p=h?.id||h?.props?.id,u=p?r[p]:void 0;h.subforms.forEach(a=>{(Array.isArray(u)?u.includes(a.conditionValue):a.conditionValue===u)&&i.push(...I(a.data||[],r))})}}),i},E=e=>e?.id||e?.props?.id||"",W=(e,r)=>!e?.visibleWhen||o.evaluateRule(e.visibleWhen,r),J=(e,r)=>e?.optionsMap&&e?.dependsOn?e.optionsMap[r[e.dependsOn]]||[]:e?.props?.options;function K(e,r={}){const{resolver:i}=r,h=r.messages?.required||"This field is required",p=g.useMemo(()=>{const t={...r.initialValues||{}};return I(e,t).forEach(s=>{const f=E(s),d=s?.props?.value;f&&t[f]===void 0&&d!==void 0&&(t[f]=d)}),t},[]),[u,a]=g.useState(p),[l,C]=g.useState([]),v=g.useRef(p),A=g.useCallback(t=>{const s={...t};return I(e,s).forEach(d=>{const n=E(d);if(n&&d.visibleWhen&&!o.evaluateRule(d.visibleWhen,s)&&delete s[n],n&&d.optionsMap&&d.dependsOn){const b=(d.optionsMap[s[d.dependsOn]]||[]).map(y=>typeof y=="string"?y:y?.value),F=s[n];F!=null&&F!==""&&!b.includes(F)&&delete s[n]}}),(e||[]).forEach(d=>{if(!Array.isArray(d.subforms)||!d.subforms.length)return;const n=E(d),c=n?s[n]:void 0,b=new Set,F=new Set;d.subforms.forEach(y=>{const M=Array.isArray(c)?c.includes(y.conditionValue):y.conditionValue===c;(y.data||[]).forEach(O=>{const m=E(O);m&&(M?b:F).add(m)})}),F.forEach(y=>{b.has(y)||delete s[y]})}),I(e,s).forEach(d=>{const n=E(d);n&&d.formula&&(s[n]=o.computeFormula(d.formula,s))}),s},[e]),L=g.useCallback((t,s)=>{a(f=>A({...f,[t]:s}))},[A]),_=g.useCallback(t=>{a(s=>A({...s,...t||{}}))},[A]),w=g.useCallback(t=>{const s=I(e,t),f=[],d=new Set;if(s.forEach(n=>{const c=E(n);c&&!W(n,t)&&d.add(c)}),s.forEach(n=>{const c=E(n);if(!c||d.has(c))return;const b=[...n?.rules?.validation||[]],F=b.some(m=>R.includes(m.rule));if(n.requiredWhen&&!F&&o.evaluateRule(n.requiredWhen,t)&&b.push({rule:"mandatory",message:n.requiredMessage||h}),!b.length)return;const y=t[c],M=y==null?"":String(y),O=b.some(m=>R.includes(m.rule));b.forEach(m=>{const $=o.CROSS_FIELD_VALIDATORS[m.rule];if($){if(!M&&!O)return;const q=t[m.field??m.value],B=q==null?"":String(q);$(M,B)||f.push({id:c,rule:m.rule,message:m.message});return}const V=o.Validation[m.rule];if(typeof V!="function")return;const k=R.includes(m.rule);if(!M&&!k)return;V(k?y:M,m.value)||f.push({id:c,rule:m.rule,message:m.message||(k?h:"")})})}),i){let n=[];try{n=i(t)||[]}catch{n=[]}n.forEach(c=>{c&&c.id&&!d.has(c.id)&&f.push({id:c.id,rule:c.rule||"schema",message:c.message})})}return f},[e,i,h]),G=g.useCallback(()=>{const t=w(u);return C(t),t},[w,u]),z=g.useCallback(t=>{const s=w(u);return C(s),s.length===0&&t&&t({...u}),s},[w,u]),P=g.useCallback(()=>{a({...v.current}),C([])},[]),S=g.useMemo(()=>{const t=new Map;return l.forEach(s=>{s.id&&!t.has(s.id)&&t.set(s.id,s.message)}),I(e,u).map(s=>{const f=E(s),n=(s?.rules?.validation||[]).some(b=>R.includes(b.rule))||!!(s.requiredWhen&&o.evaluateRule(s.requiredWhen,u)),c=s.formula?o.computeFormula(s.formula,u):u[f];return{id:f,field:s,value:c,visible:W(s,u),disabled:!!(s.disabledWhen&&o.evaluateRule(s.disabledWhen,u)),required:n,options:J(s,u),error:t.get(f)}})},[e,u,l]),Y=g.useMemo(()=>S.filter(t=>t.visible),[S]),j=g.useCallback(t=>S.find(s=>s.id===t),[S]),N=g.useMemo(()=>!o.isEqual(u,v.current),[u]);return{values:u,errors:l,fields:S,visibleFields:Y,getFieldState:j,setValue:L,setValues:_,validate:G,isValid:l.length===0,isDirty:N,reset:P,submit:z}}const Q=new Set(["typography","divider","alert","image","imagelist","hyperlink","button"]),D=e=>e?.id||e?.props?.id,T=(e,r=new Set)=>((e||[]).forEach(i=>{const h=D(i);h&&r.add(h),Array.isArray(i?.subforms)&&i.subforms.forEach(p=>T(p?.data||[],r))}),r),X=e=>{if(!e||typeof e!="object")return[];if(typeof e.field=="string")return[e.field];const r=e.all||e.any||e.none;return Array.isArray(r)?r.flatMap(X):[]},Z=e=>(Array.isArray(e)?e:[]).map(r=>typeof r=="string"?r:r?.value);function x(e){const r=[],i=T(e),h=p=>{const u=new Set;(p||[]).forEach(a=>{const l=D(a),C=a?.type;if(!l&&!Q.has(C)&&r.push({level:"warning",code:"missing-id",message:`A "${C||"field"}" has no id; its value can't be captured.`}),l&&(u.has(l)&&r.push({level:"error",code:"duplicate-id",field:l,message:`Duplicate field id "${l}" among siblings — their values will collide.`}),u.add(l)),a?.dependsOn&&!a?.optionsMap&&r.push({level:"warning",code:"depends-without-options",field:l,message:`"${l}" has \`dependsOn\` but no \`optionsMap\`, so its options never change.`}),a?.optionsMap&&!a?.dependsOn&&r.push({level:"warning",code:"options-without-depends",field:l,message:`"${l}" has \`optionsMap\` but no \`dependsOn\`, so it can't pick a branch.`}),a?.dependsOn&&!i.has(a.dependsOn)&&r.push({level:"error",code:"unknown-depends-target",field:l,message:`"${l}" dependsOn "${a.dependsOn}", which is not a field in this schema.`}),["visibleWhen","disabledWhen","requiredWhen"].forEach(v=>{X(a?.[v]).forEach(A=>{i.has(A)||r.push({level:"error",code:"unknown-rule-field",field:l,message:`"${l}" ${v} references field "${A}", which does not exist.`})})}),(a?.rules?.validation||[]).forEach(v=>{v?.field&&/Field$/.test(v?.rule||"")&&!i.has(v.field)&&r.push({level:"error",code:"unknown-cross-field",field:l,message:`"${l}" rule "${v.rule}" compares against "${v.field}", which does not exist.`})}),Array.isArray(a?.subforms)&&a.subforms.length){const v=Z(a?.props?.options);v.length&&a.subforms.forEach(A=>{A?.conditionValue!==void 0&&!v.includes(A.conditionValue)&&r.push({level:"warning",code:"subform-condition-not-an-option",field:l,message:`"${l}" has a subform for value "${A.conditionValue}", which isn't one of its options.`})}),a.subforms.forEach(A=>h(A?.data||[]))}})};return h(e),r}function ee(e){return e}exports.AIFill=o.AIFill;exports.AIForm=o.AIForm;exports.AIFormGenerator=o.AIFormGenerator;exports.AISchemaReview=o.AISchemaReview;exports.AITextAssist=o.AITextAssist;exports.AIVisionImport=o.AIVisionImport;exports.ClearFormData=o.ClearFormData;exports.Controls=o.Controls_default;exports.DynamicComponent=o.DynamicComponent;exports.FormData=o.FormData;exports.FormGenerator=o.FormGenerator;exports.MuiConfig=o.mui;exports.configureMuiX=o.configureMuiX;exports.createAIClient=o.createAIClient;exports.formFieldsToSimple=o.formFieldsToSimple;exports.getMuiX=o.getMuiX;exports.getRegisteredControl=o.getRegisteredControl;exports.hasRegisteredControl=o.hasRegisteredControl;exports.registerControl=o.registerControl;exports.registerControls=o.registerControls;exports.registeredControlTypes=o.registeredControlTypes;exports.resetMuiX=o.resetMuiX;exports.simpleFieldsToFormFields=o.simpleFieldsToFormFields;exports.slug=o.slug;exports.unregisterControl=o.unregisterControl;exports.useAIAssist=o.useAIAssist;exports.useForm=o.useForm;exports.defineForm=ee;exports.useFormEngine=K;exports.validateSchema=x;exports.yupResolver=H;exports.zodResolver=U;
@@ -0,0 +1,2 @@
1
+ export * from './index'
2
+ export {}