dynamic-mui 2.4.1 → 2.5.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.
Files changed (90) hide show
  1. package/dist/{AIForm-DtRl0WdY.mjs → AIForm-Czsvpf7g.mjs} +578 -563
  2. package/dist/AIForm-LoeI18mO.js +43 -0
  3. package/dist/{accordion-BaiGxDcw.js → accordion-8p1FoyfL.js} +1 -1
  4. package/dist/{accordion-xg_TxxYS.mjs → accordion-CQ4Vldth.mjs} +1 -1
  5. package/dist/{addressfield-BvQEHdEk.mjs → addressfield-N7DifI3i.mjs} +52 -40
  6. package/dist/addressfield-T4e_d87q.js +1 -0
  7. package/dist/ai/index.cjs +1 -1
  8. package/dist/ai/index.mjs +1 -1
  9. package/dist/asyncautocomplete-BB_MyjIj.mjs +92 -0
  10. package/dist/asyncautocomplete-CpO6EO3W.js +1 -0
  11. package/dist/{bar-BiIzbOC3.js → bar-BOse0ZkP.js} +1 -1
  12. package/dist/{bar-DNc7TMKj.mjs → bar-CbpJ-MEV.mjs} +1 -1
  13. package/dist/cascadeselect-C30RVgmc.js +1 -0
  14. package/dist/cascadeselect-PzCw6JHX.mjs +66 -0
  15. package/dist/colorpicker-CMhVJNQT.mjs +111 -0
  16. package/dist/{colorpicker-DpLvK1WR.js → colorpicker-DoNrfUY7.js} +1 -1
  17. package/dist/{consentfield-B21l9tGo.js → consentfield-Bp1dXs7L.js} +1 -1
  18. package/dist/{consentfield-CGT98YbR.mjs → consentfield-DIa3sXrr.mjs} +13 -11
  19. package/dist/{datatable-B_6wXh2g.mjs → datatable-CO0Iv6R6.mjs} +1 -1
  20. package/dist/{datatable-Bv0Q37Zy.js → datatable-CyfyY3Wh.js} +1 -1
  21. package/dist/dynamic-mui.cjs +1 -1
  22. package/dist/dynamic-mui.mjs +2 -2
  23. package/dist/editabletable-CCDJ2BPB.js +1 -0
  24. package/dist/{editabletable-YaFqdLvf.mjs → editabletable-C_MA7QEb.mjs} +19 -17
  25. package/dist/{fileupload-ZBi72f1R.mjs → fileupload-DX3dxKFN.mjs} +16 -3
  26. package/dist/{fileupload--KzSGb5a.js → fileupload-WV5shCIK.js} +1 -1
  27. package/dist/{formrepeater-BhUEa4BI.js → formrepeater-Cxu8Dk8P.js} +1 -1
  28. package/dist/{formrepeater-Cwgtvz1c.mjs → formrepeater-D5K8qgAA.mjs} +25 -21
  29. package/dist/{formwizard-CYcgf5jL.mjs → formwizard-B-HCfrnp.mjs} +1 -1
  30. package/dist/{formwizard-BlozHDc_.js → formwizard-HRF3hTyF.js} +1 -1
  31. package/dist/geofield-0k7PkHRa.js +1 -0
  32. package/dist/{geofield-xqZy_DAY.mjs → geofield-DlqMZ_hl.mjs} +28 -24
  33. package/dist/{group-DmLN-b09.mjs → group-BFDXdAfg.mjs} +1 -1
  34. package/dist/{group-Dtju1rHQ.js → group-mONe185y.js} +1 -1
  35. package/dist/{intlphone-CXUQP9Gp.mjs → intlphone-Bbk2UF9T.mjs} +12 -8
  36. package/dist/{intlphone-BeHXAcFi.js → intlphone-zZ0xd-DG.js} +1 -1
  37. package/dist/{keyvaluefield-BZQDG0l5.js → keyvaluefield-B6oRZzic.js} +1 -1
  38. package/dist/{keyvaluefield-BJoEbe4I.mjs → keyvaluefield-BynOkgTq.mjs} +4 -2
  39. package/dist/{line-tIm99vYW.js → line-ChQNdVfl.js} +1 -1
  40. package/dist/{line-B3CAbZOo.mjs → line-DebtzkF3.mjs} +1 -1
  41. package/dist/lineitemlist-CI0LwIUz.js +1 -0
  42. package/dist/{lineitemlist-CBSqoC9g.mjs → lineitemlist-CjFNpqI5.mjs} +23 -19
  43. package/dist/{list-C8QMpJOJ.mjs → list-B5wBsflP.mjs} +1 -1
  44. package/dist/{list-D_cawpPI.js → list-CJFKxKyN.js} +1 -1
  45. package/dist/locationfield-CrOMF7jt.js +1 -0
  46. package/dist/locationfield-DQj3yDCa.mjs +118 -0
  47. package/dist/markdowneditor-Jaz7uTyZ.js +2 -0
  48. package/dist/{markdowneditor-DFOgRmdL.mjs → markdowneditor-emqJhQV7.mjs} +15 -11
  49. package/dist/{matrixfield-nWt6Cug5.js → matrixfield-BPJsawGk.js} +1 -1
  50. package/dist/{matrixfield-0lnuaEks.mjs → matrixfield-j5mf9lh5.mjs} +34 -30
  51. package/dist/{mixChart-ISf3Kbr-.mjs → mixChart-Doq4lt7Z.mjs} +2 -2
  52. package/dist/mixChart-rgyMCdnp.js +1 -0
  53. package/dist/{multitextbox-DmAWV163.mjs → multitextbox-CyZiTd_E.mjs} +1 -1
  54. package/dist/{multitextbox-oEgl2F8-.js → multitextbox-DQbcEqkM.js} +1 -1
  55. package/dist/{npsscale-CdTEwERY.mjs → npsscale-BIkJMD4Z.mjs} +7 -3
  56. package/dist/{npsscale-DW4sxcLz.js → npsscale-oUUyPdxP.js} +1 -1
  57. package/dist/{numberstepper-cDosevJb.js → numberstepper-DRIvgtcH.js} +1 -1
  58. package/dist/{numberstepper-BwQ5coLc.mjs → numberstepper-thjufBMI.mjs} +6 -2
  59. package/dist/{pie-CBRckgd4.mjs → pie-4SHUYmRs.mjs} +1 -1
  60. package/dist/{pie-gAfuDR1F.js → pie-COA-uozf.js} +1 -1
  61. package/dist/richtexteditor-BSV7hG6d.js +1 -0
  62. package/dist/{richtexteditor-xrbv8PXZ.mjs → richtexteditor-CvZ3Y7X1.mjs} +4 -2
  63. package/dist/{signature-FM6L60nk.js → signature-6QvVbfkT.js} +2 -2
  64. package/dist/{signature-CP_lA_Yh.mjs → signature-DeDxnc8U.mjs} +4 -2
  65. package/dist/{stepper-CjGNFyBz.js → stepper-CDsErlLH.js} +1 -1
  66. package/dist/{stepper-BprezTzX.mjs → stepper-Sx3SWXTM.mjs} +1 -1
  67. package/dist/{summaryfield-5mJRwVZ4.mjs → summaryfield-CAJjGmE2.mjs} +1 -1
  68. package/dist/{summaryfield-C3xmqZQp.js → summaryfield-DxzQ3g6Z.js} +1 -1
  69. package/dist/{tabs-B4P59kHX.js → tabs-CnDP2ngC.js} +1 -1
  70. package/dist/{tabs-By-Mm8vm.mjs → tabs-CvHNZU5o.mjs} +1 -1
  71. package/dist/tagsinput-DZcLPuX1.js +1 -0
  72. package/dist/tagsinput-bWU3Mem0.mjs +58 -0
  73. package/package.json +11 -11
  74. package/dist/AIForm-Dv8ahXyE.js +0 -43
  75. package/dist/addressfield-vVizrbZP.js +0 -1
  76. package/dist/asyncautocomplete-AmSRs7PY.mjs +0 -89
  77. package/dist/asyncautocomplete-Dtmxh4l1.js +0 -1
  78. package/dist/cascadeselect-BlznIKS6.mjs +0 -64
  79. package/dist/cascadeselect-DqLtG-W9.js +0 -1
  80. package/dist/colorpicker-hP3b7teC.mjs +0 -98
  81. package/dist/editabletable-D3c3DJxX.js +0 -1
  82. package/dist/geofield-BynrTSVm.js +0 -1
  83. package/dist/lineitemlist-RqStjYB-.js +0 -1
  84. package/dist/locationfield-BiLy-c09.js +0 -1
  85. package/dist/locationfield-KBbu-98L.mjs +0 -119
  86. package/dist/markdowneditor-Dy7Q01FM.js +0 -2
  87. package/dist/mixChart-C3o184UT.js +0 -1
  88. package/dist/richtexteditor-DI-h5Efn.js +0 -1
  89. package/dist/tagsinput-BwM3NYK_.js +0 -1
  90. package/dist/tagsinput-Ce4EWy4i.mjs +0 -58
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),r=require("@mui/material"),a=require("./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
+ "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-LoeI18mO.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 "./AIForm-DtRl0WdY.mjs";
4
+ import { F as A } from "./AIForm-Czsvpf7g.mjs";
5
5
  import { v as h } from "./v4-BysszJq8.mjs";
6
6
  function j({ attributes: r = {}, patch: c, onChange: i }) {
7
7
  const { MuiAttributes: n = {}, label: e = "Accordion", subFields: t = [] } = r, d = m.useMemo(() => h(), []);
@@ -1,9 +1,9 @@
1
1
  import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
2
  import S, { useCallback as A } from "react";
3
- import r from "@mui/material/Grid";
4
- import i from "@mui/material/TextField";
5
- import g from "@mui/material/MenuItem";
6
- import { j as E, m as P, k as I } from "./AIForm-DtRl0WdY.mjs";
3
+ import s from "@mui/material/Grid";
4
+ import o from "@mui/material/TextField";
5
+ import I from "@mui/material/MenuItem";
6
+ import { j as g, m as E, k as P } from "./AIForm-Czsvpf7g.mjs";
7
7
  const N = [
8
8
  { value: "US", label: "United States" },
9
9
  { value: "CA", label: "Canada" },
@@ -42,9 +42,9 @@ function D({ attributes: n = {}, rules: h = {}, onChange: c }) {
42
42
  const {
43
43
  id: b = "",
44
44
  MuiAttributes: v = {},
45
- countries: o,
45
+ countries: i,
46
46
  labels: y = {}
47
- } = n, x = Array.isArray(o) && o.length ? o : N, l = { ...U, ...y }, d = h?.validation?.some(
47
+ } = n, x = Array.isArray(i) && i.length ? i : N, l = { ...U, ...y }, d = h?.validation?.some(
48
48
  (t) => t.rule === "mandatory" || t.rule === "mandatoryselect"
49
49
  ) || !1, [a, p] = S.useState(() => ({
50
50
  street1: "",
@@ -55,7 +55,7 @@ function D({ attributes: n = {}, rules: h = {}, onChange: c }) {
55
55
  country: "",
56
56
  ...n?.value || {}
57
57
  }));
58
- E(() => {
58
+ g(() => {
59
59
  p({
60
60
  street1: "",
61
61
  street2: "",
@@ -66,83 +66,95 @@ function D({ attributes: n = {}, rules: h = {}, onChange: c }) {
66
66
  ...n?.value || {}
67
67
  });
68
68
  }, [n?.value]);
69
- const s = A(
69
+ const r = A(
70
70
  (t) => (C) => {
71
71
  const m = { ...a, [t]: C.target.value };
72
72
  p(m), c?.({ id: b, value: m });
73
73
  },
74
74
  [a, b, c]
75
- ), u = P(I, v?.sx);
76
- return /* @__PURE__ */ f(r, { container: !0, spacing: 2, ...v, children: [
77
- /* @__PURE__ */ e(r, { size: { xs: 12 }, children: /* @__PURE__ */ e(
78
- i,
75
+ ), u = E(P, v?.sx);
76
+ return /* @__PURE__ */ f(s, { container: !0, spacing: 2, ...v, children: [
77
+ /* @__PURE__ */ e(s, { size: { xs: 12 }, children: /* @__PURE__ */ e(
78
+ o,
79
79
  {
80
80
  fullWidth: !0,
81
81
  label: l.street1,
82
82
  required: d,
83
83
  value: a.street1 || "",
84
- onChange: s("street1"),
85
- inputProps: { "aria-label": l.street1 },
86
- sx: u
84
+ onChange: r("street1"),
85
+ sx: u,
86
+ slotProps: {
87
+ htmlInput: { "aria-label": l.street1 }
88
+ }
87
89
  }
88
90
  ) }),
89
- /* @__PURE__ */ e(r, { size: { xs: 12 }, children: /* @__PURE__ */ e(
90
- i,
91
+ /* @__PURE__ */ e(s, { size: { xs: 12 }, children: /* @__PURE__ */ e(
92
+ o,
91
93
  {
92
94
  fullWidth: !0,
93
95
  label: l.street2,
94
96
  value: a.street2 || "",
95
- onChange: s("street2"),
96
- inputProps: { "aria-label": l.street2 },
97
- sx: u
97
+ onChange: r("street2"),
98
+ sx: u,
99
+ slotProps: {
100
+ htmlInput: { "aria-label": l.street2 }
101
+ }
98
102
  }
99
103
  ) }),
100
- /* @__PURE__ */ e(r, { size: { xs: 12, sm: 6, md: 5 }, children: /* @__PURE__ */ e(
101
- i,
104
+ /* @__PURE__ */ e(s, { size: { xs: 12, sm: 6, md: 5 }, children: /* @__PURE__ */ e(
105
+ o,
102
106
  {
103
107
  fullWidth: !0,
104
108
  label: l.city,
105
109
  required: d,
106
110
  value: a.city || "",
107
- onChange: s("city"),
108
- inputProps: { "aria-label": l.city },
109
- sx: u
111
+ onChange: r("city"),
112
+ sx: u,
113
+ slotProps: {
114
+ htmlInput: { "aria-label": l.city }
115
+ }
110
116
  }
111
117
  ) }),
112
- /* @__PURE__ */ e(r, { size: { xs: 12, sm: 6, md: 4 }, children: /* @__PURE__ */ e(
113
- i,
118
+ /* @__PURE__ */ e(s, { size: { xs: 12, sm: 6, md: 4 }, children: /* @__PURE__ */ e(
119
+ o,
114
120
  {
115
121
  fullWidth: !0,
116
122
  label: l.state,
117
123
  value: a.state || "",
118
- onChange: s("state"),
119
- inputProps: { "aria-label": l.state },
120
- sx: u
124
+ onChange: r("state"),
125
+ sx: u,
126
+ slotProps: {
127
+ htmlInput: { "aria-label": l.state }
128
+ }
121
129
  }
122
130
  ) }),
123
- /* @__PURE__ */ e(r, { size: { xs: 12, sm: 6, md: 3 }, children: /* @__PURE__ */ e(
124
- i,
131
+ /* @__PURE__ */ e(s, { size: { xs: 12, sm: 6, md: 3 }, children: /* @__PURE__ */ e(
132
+ o,
125
133
  {
126
134
  fullWidth: !0,
127
135
  label: l.postalCode,
128
136
  value: a.postalCode || "",
129
- onChange: s("postalCode"),
130
- inputProps: { "aria-label": l.postalCode },
131
- sx: u
137
+ onChange: r("postalCode"),
138
+ sx: u,
139
+ slotProps: {
140
+ htmlInput: { "aria-label": l.postalCode }
141
+ }
132
142
  }
133
143
  ) }),
134
- /* @__PURE__ */ e(r, { size: { xs: 12, sm: 6 }, children: /* @__PURE__ */ e(
135
- i,
144
+ /* @__PURE__ */ e(s, { size: { xs: 12, sm: 6 }, children: /* @__PURE__ */ e(
145
+ o,
136
146
  {
137
147
  select: !0,
138
148
  fullWidth: !0,
139
149
  label: l.country,
140
150
  required: d,
141
151
  value: a.country || "",
142
- onChange: s("country"),
143
- SelectProps: { inputProps: { "aria-label": l.country } },
152
+ onChange: r("country"),
144
153
  sx: u,
145
- children: x.map((t) => /* @__PURE__ */ e(g, { value: t.value, children: t.label }, t.value))
154
+ slotProps: {
155
+ select: { inputProps: { "aria-label": l.country } }
156
+ },
157
+ children: x.map((t) => /* @__PURE__ */ e(I, { value: t.value, children: t.label }, t.value))
146
158
  }
147
159
  ) })
148
160
  ] });
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),s=require("@mui/material/Grid"),n=require("@mui/material/TextField"),j=require("@mui/material/MenuItem"),c=require("./AIForm-LoeI18mO.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"}],I={street1:"Street address",street2:"Apt, suite, etc. (optional)",city:"City",state:"State / Province",postalCode:"Postal code",country:"Country"};function f({attributes:i={},rules:y={},onChange:b}){const{id:v="",MuiAttributes:x={},countries:o,labels:C={}}=i,S=Array.isArray(o)&&o.length?o:g,l={...I,...C},d=y?.validation?.some(t=>t.rule==="mandatory"||t.rule==="mandatoryselect")||!1,[a,p]=m.useState(()=>({street1:"",street2:"",city:"",state:"",postalCode:"",country:"",...i?.value||{}}));c.useUpdateEffect(()=>{p({street1:"",street2:"",city:"",state:"",postalCode:"",country:"",...i?.value||{}})},[i?.value]);const r=m.useCallback(t=>A=>{const h={...a,[t]:A.target.value};p(h),b?.({id:v,value:h})},[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"),sx:u,slotProps:{htmlInput:{"aria-label":l.street1}}})}),e.jsx(s,{size:{xs:12},children:e.jsx(n,{fullWidth:!0,label:l.street2,value:a.street2||"",onChange:r("street2"),sx:u,slotProps:{htmlInput:{"aria-label":l.street2}}})}),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"),sx:u,slotProps:{htmlInput:{"aria-label":l.city}}})}),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"),sx:u,slotProps:{htmlInput:{"aria-label":l.state}}})}),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"),sx:u,slotProps:{htmlInput:{"aria-label":l.postalCode}}})}),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"),sx:u,slotProps:{select:{inputProps:{"aria-label":l.country}}},children:S.map(t=>e.jsx(j,{value:t.value,children:t.label},t.value))})})]})}exports.default=f;
package/dist/ai/index.cjs CHANGED
@@ -1 +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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../AIForm-LoeI18mO.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;
package/dist/ai/index.mjs CHANGED
@@ -1,4 +1,4 @@
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";
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-Czsvpf7g.mjs";
2
2
  export {
3
3
  a as AIFill,
4
4
  i as AIForm,
@@ -0,0 +1,92 @@
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-Czsvpf7g.mjs";
7
+ function Q({ attributes: r = {}, rules: v = {}, onChange: A }) {
8
+ const {
9
+ MuiAttributes: C = {},
10
+ id: x = "",
11
+ label: O = "Search",
12
+ placeholder: P = "",
13
+ minChars: S = 1,
14
+ debounceMs: j = 300,
15
+ labelKey: q = "label",
16
+ valueKey: p = "value",
17
+ loadOptions: m,
18
+ optionsUrl: u
19
+ } = r, [T, d] = f(r.value ?? null), [b, l] = f([]), [h, o] = f(!1), s = y(0), t = y(null);
20
+ V(() => {
21
+ d(r.value ?? null);
22
+ }, [r.value]), K(() => () => {
23
+ t.current && clearTimeout(t.current);
24
+ }, []);
25
+ const E = async (e) => {
26
+ if (typeof m == "function")
27
+ return m(e);
28
+ if (u) {
29
+ const n = `${u}${u.includes("?") ? "&" : "?"}q=${encodeURIComponent(e)}`, g = await (await fetch(n)).json();
30
+ return Array.isArray(g) ? g : [];
31
+ }
32
+ return [];
33
+ }, I = (e) => {
34
+ const n = ++s.current;
35
+ o(!0), E(e).then((a) => {
36
+ n === s.current && (l(Array.isArray(a) ? a : []), o(!1));
37
+ }).catch(() => {
38
+ n === s.current && (l([]), o(!1));
39
+ });
40
+ }, R = (e, n) => {
41
+ if (t.current && clearTimeout(t.current), !n || n.length < S) {
42
+ s.current++, o(!1), l([]);
43
+ return;
44
+ }
45
+ t.current = setTimeout(() => {
46
+ I(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
+ }, i = (e) => typeof e == "string" ? e : e?.[q] ?? "", $ = !!v?.validation?.some((e) => e.rule === "mandatory");
55
+ return /* @__PURE__ */ c(
56
+ M,
57
+ {
58
+ value: T,
59
+ onChange: U,
60
+ onInputChange: R,
61
+ options: b,
62
+ loading: h,
63
+ filterOptions: (e) => e,
64
+ getOptionLabel: i,
65
+ renderOption: (e, n) => /* @__PURE__ */ L("li", { ...e, key: (n && n[p]) ?? i(n) }, i(n)),
66
+ ...C,
67
+ renderInput: (e) => /* @__PURE__ */ c(
68
+ _,
69
+ {
70
+ ...e,
71
+ label: O,
72
+ placeholder: P,
73
+ required: $,
74
+ sx: w,
75
+ slotProps: {
76
+ ...e.slotProps,
77
+ input: {
78
+ ...e.slotProps.input,
79
+ endAdornment: /* @__PURE__ */ k(F, { children: [
80
+ h ? /* @__PURE__ */ c(z, { color: "inherit", size: 20 }) : null,
81
+ e.slotProps.input.endAdornment
82
+ ] })
83
+ }
84
+ }
85
+ }
86
+ )
87
+ }
88
+ );
89
+ }
90
+ export {
91
+ Q as default
92
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("react"),U=require("@mui/material/Autocomplete"),$=require("@mui/material/TextField"),K=require("@mui/material/CircularProgress"),y=require("./AIForm-LoeI18mO.js");function L({attributes:u={},rules:v={},onChange:A}){const{MuiAttributes:q={},id:S="",label:x="Search",placeholder:j="",minChars:C=1,debounceMs:O=300,labelKey:P="label",valueKey:d="value",loadOptions:p,optionsUrl:c}=u,[R,h]=n.useState(u.value??null),[b,i]=n.useState([]),[m,s]=n.useState(!1),l=n.useRef(0),r=n.useRef(null);y.useUpdateEffect(()=>{h(u.value??null)},[u.value]),n.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const T=async e=>{if(typeof p=="function")return p(e);if(c){const t=`${c}${c.includes("?")?"&":"?"}q=${encodeURIComponent(e)}`,g=await(await fetch(t)).json();return Array.isArray(g)?g:[]}return[]},I=e=>{const t=++l.current;s(!0),T(e).then(f=>{t===l.current&&(i(Array.isArray(f)?f:[]),s(!1))}).catch(()=>{t===l.current&&(i([]),s(!1))})},E=(e,t)=>{if(r.current&&clearTimeout(r.current),!t||t.length<C){l.current++,s(!1),i([]);return}r.current=setTimeout(()=>{I(t)},O)},F=(e,t)=>{h(t),A?.({id:S,value:t!=null?t?.[d]??t:t,option:t})},a=e=>typeof e=="string"?e:e?.[P]??"",M=!!v?.validation?.some(e=>e.rule==="mandatory");return o.jsx(U,{value:R,onChange:F,onInputChange:E,options:b,loading:m,filterOptions:e=>e,getOptionLabel:a,renderOption:(e,t)=>n.createElement("li",{...e,key:(t&&t[d])??a(t)},a(t)),...q,renderInput:e=>o.jsx($,{...e,label:x,placeholder:j,required:M,sx:y.premiumInputSx,slotProps:{...e.slotProps,input:{...e.slotProps.input,endAdornment:o.jsxs(o.Fragment,{children:[m?o.jsx(K,{color:"inherit",size:20}):null,e.slotProps.input.endAdornment]})}}})})}exports.default=L;
@@ -1 +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;
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-LoeI18mO.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;
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import i, { Suspense as s } from "react";
3
3
  import n from "@mui/material/Box";
4
4
  import f from "@mui/material/CircularProgress";
5
- import { i as m } from "./AIForm-DtRl0WdY.mjs";
5
+ import { i as m } from "./AIForm-Czsvpf7g.mjs";
6
6
  const c = i.lazy(
7
7
  () => import("@mui/x-charts/BarChart").then((t) => ({ default: t.BarChart }))
8
8
  );
@@ -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"),S=require("@mui/material/MenuItem"),i=require("./AIForm-LoeI18mO.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:o,optionsMap:c,options:d,label:x="",placeholder:v="",MuiAttributes:y={}}=t,g=e?.validation?.some(l=>l.rule==="mandatory"||l.rule==="mandatoryselect")||!1,[p,h]=f.useState(()=>b(c,o,d)),[r,m]=f.useState(()=>t?.value??"");i.useUpdateEffect(()=>{m(t?.value??"")},[t?.value]),i.useUpdateEffect(()=>{const l=b(c,o,d);h(l),r!==""&&r!=null&&!l.some(n=>n.value===r)&&(m(""),a?.({id:u,value:"",option:null}))},[o,c,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,...y,sx:i.mergeSx(i.premiumInputSx,y?.sx),slotProps:{select:{displayEmpty:!0,inputProps:{"aria-label":x||"cascade-select"}}},children:[v?s.jsx(S,{value:"",children:s.jsx("em",{children:v})}):null,p.map(l=>s.jsx(S,{value:l.value,children:l.label},String(l.value)))]})}exports.default=I;
@@ -0,0 +1,66 @@
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 y from "@mui/material/MenuItem";
5
+ import { j as S, m as I, k as O } from "./AIForm-Czsvpf7g.mjs";
6
+ const P = (t) => Array.isArray(t) ? t.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 = (t, e, a) => {
9
+ const r = t && e != null && e !== "" ? t[e] : void 0;
10
+ return P(r ?? a ?? []);
11
+ };
12
+ function U({ attributes: t = {}, rules: e = {}, onChange: a }) {
13
+ const {
14
+ id: r = "",
15
+ parentValue: u,
16
+ optionsMap: o,
17
+ options: i,
18
+ label: v = "",
19
+ placeholder: c = "",
20
+ MuiAttributes: f = {}
21
+ } = t, b = e?.validation?.some(
22
+ (l) => l.rule === "mandatory" || l.rule === "mandatoryselect"
23
+ ) || !1, [m, g] = x.useState(
24
+ () => h(o, u, i)
25
+ ), [s, d] = x.useState(() => t?.value ?? "");
26
+ S(() => {
27
+ d(t?.value ?? "");
28
+ }, [t?.value]), S(() => {
29
+ const l = h(o, u, i);
30
+ g(l), s !== "" && s != null && !l.some((n) => n.value === s) && (d(""), a?.({ id: r, value: "", option: null }));
31
+ }, [u, 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), a?.({ id: r, value: n, option: M });
36
+ },
37
+ [m, r, a]
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: s ?? "",
48
+ onChange: j,
49
+ ...f,
50
+ sx: I(O, f?.sx),
51
+ slotProps: {
52
+ select: {
53
+ displayEmpty: !0,
54
+ inputProps: { "aria-label": v || "cascade-select" }
55
+ }
56
+ },
57
+ children: [
58
+ c ? /* @__PURE__ */ p(y, { value: "", children: /* @__PURE__ */ p("em", { children: c }) }) : null,
59
+ m.map((l) => /* @__PURE__ */ p(y, { value: l.value, children: l.label }, String(l.value)))
60
+ ]
61
+ }
62
+ );
63
+ }
64
+ export {
65
+ U as default
66
+ };
@@ -0,0 +1,111 @@
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import $ from "react";
3
+ import c from "@mui/material/Box";
4
+ import u from "@mui/material/Stack";
5
+ import A from "@mui/material/TextField";
6
+ import I from "@mui/material/FormControl";
7
+ import F 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-Czsvpf7g.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__ */ m(I, { required: y, component: "fieldset", fullWidth: !0, children: [
30
+ r && /* @__PURE__ */ e(F, { component: "legend", children: r }),
31
+ /* @__PURE__ */ m(
32
+ u,
33
+ {
34
+ direction: "row",
35
+ spacing: 1.5,
36
+ sx: {
37
+ alignItems: "center",
38
+ mt: r ? 1 : 0
39
+ },
40
+ children: [
41
+ /* @__PURE__ */ e(c, { sx: { ...{
42
+ width: 44,
43
+ height: 44,
44
+ borderRadius: "10px",
45
+ border: (o) => `1px solid ${l(o.palette.text.primary, 0.2)}`,
46
+ boxShadow: (o) => `0 2px 8px ${l(o.palette.common.black, 0.12)}`,
47
+ cursor: "pointer",
48
+ flexShrink: 0,
49
+ position: "relative",
50
+ overflow: "hidden"
51
+ }, backgroundColor: a }, children: /* @__PURE__ */ e(
52
+ "input",
53
+ {
54
+ type: "color",
55
+ "aria-label": r ? `${r} colour` : "colour",
56
+ value: a,
57
+ onChange: k,
58
+ ...v,
59
+ style: {
60
+ position: "absolute",
61
+ inset: 0,
62
+ width: "100%",
63
+ height: "100%",
64
+ opacity: 0,
65
+ border: "none",
66
+ padding: 0,
67
+ cursor: "pointer"
68
+ }
69
+ }
70
+ ) }),
71
+ /* @__PURE__ */ e(
72
+ A,
73
+ {
74
+ id: p || void 0,
75
+ value: a,
76
+ onChange: C,
77
+ size: "small",
78
+ label: "Hex",
79
+ sx: x(j, x({ maxWidth: 160 }, w)),
80
+ slotProps: {
81
+ htmlInput: { "aria-label": "hex value" }
82
+ }
83
+ }
84
+ )
85
+ ]
86
+ }
87
+ ),
88
+ 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(
89
+ c,
90
+ {
91
+ role: "button",
92
+ "aria-label": `preset ${o}`,
93
+ onClick: () => S(o),
94
+ sx: {
95
+ width: 26,
96
+ height: 26,
97
+ borderRadius: "8px",
98
+ backgroundColor: o,
99
+ cursor: "pointer",
100
+ flexShrink: 0,
101
+ border: (i) => a === o ? `2px solid ${i.palette.primary.main}` : `1px solid ${l(i.palette.text.primary, 0.2)}`,
102
+ boxShadow: (i) => `0 1px 4px ${l(i.palette.common.black, 0.12)}`
103
+ }
104
+ },
105
+ o
106
+ )) })
107
+ ] });
108
+ }
109
+ export {
110
+ q as default
111
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),k=require("react"),p=require("@mui/material/Box"),x=require("@mui/material/Stack"),C=require("@mui/material/TextField"),$=require("@mui/material/FormControl"),A=require("@mui/material/FormLabel"),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;
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"),i=require("@mui/material/styles"),n=require("./AIForm-LoeI18mO.js"),h="#000000";function I({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 ${i.alpha(e.palette.text.primary,.2)}`,boxShadow:e=>`0 2px 8px ${i.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,sx:{alignItems:"center",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",sx:n.mergeSx(n.premiumInputSx,n.mergeSx({maxWidth:160},y)),slotProps:{htmlInput:{"aria-label":"hex value"}}})]}),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:l=>a===e?`2px solid ${l.palette.primary.main}`:`1px solid ${i.alpha(l.palette.text.primary,.2)}`,boxShadow:l=>`0 1px 4px ${i.alpha(l.palette.common.black,.12)}`}},e))})]})}exports.default=I;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),M=require("@mui/material/Box"),w=require("@mui/material/Checkbox"),R=require("@mui/material/FormControl"),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
+ "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-LoeI18mO.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,slotProps:{input:{"aria-label":"consent-agree"}}})}),m&&t.jsx(I,{children:m})]})}exports.default=V;
@@ -6,21 +6,21 @@ 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 { j as P, m as f, l as U, n as W } from "./AIForm-DtRl0WdY.mjs";
10
- function Z({ attributes: a = {}, rules: n = {}, onChange: h }) {
9
+ import { j as P, m as f, l as U, n as W } from "./AIForm-Czsvpf7g.mjs";
10
+ function Z({ attributes: l = {}, rules: n = {}, onChange: h }) {
11
11
  const {
12
12
  MuiAttributes: g = {},
13
13
  id: x = "",
14
14
  text: S = "",
15
15
  label: c = "I agree to the terms",
16
16
  requireScroll: i = !0
17
- } = a, [C, d] = s.useState(!!a.value), [b, v] = s.useState(!i), [k, T] = s.useState(!1), [m, y] = s.useState("");
17
+ } = l, [C, d] = s.useState(!!l.value), [b, v] = s.useState(!i), [k, T] = s.useState(!1), [m, y] = s.useState("");
18
18
  P(() => {
19
- d(!!a.value);
20
- }, [a.value]);
21
- const l = n?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1, H = (e) => {
19
+ d(!!l.value);
20
+ }, [l.value]);
21
+ const a = n?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1, H = (e) => {
22
22
  let r = !0, t = "";
23
- return l && !e && (r = !1, t = n?.validation?.find(
23
+ return a && !e && (r = !1, t = n?.validation?.find(
24
24
  (u) => u.rule === "mandatory" || u.rule === "mandatoryselect"
25
25
  )?.message || "Required"), { isValid: r, message: t };
26
26
  }, q = (e) => {
@@ -31,11 +31,11 @@ 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 && !b, { sx: L, ...j } = g, w = l ? /* @__PURE__ */ p("span", { children: [
34
+ }, F = i && !b, { sx: L, ...j } = g, w = a ? /* @__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
- return /* @__PURE__ */ p(V, { required: l, error: k, component: "fieldset", fullWidth: !0, children: [
38
+ return /* @__PURE__ */ p(V, { required: a, error: k, component: "fieldset", fullWidth: !0, children: [
39
39
  /* @__PURE__ */ o(
40
40
  M,
41
41
  {
@@ -64,8 +64,10 @@ function Z({ attributes: a = {}, rules: n = {}, onChange: h }) {
64
64
  checked: C,
65
65
  disabled: F,
66
66
  onChange: E,
67
- required: l,
68
- inputProps: { "aria-label": "consent-agree" }
67
+ required: a,
68
+ slotProps: {
69
+ input: { "aria-label": "consent-agree" }
70
+ }
69
71
  }
70
72
  )
71
73
  }
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import e, { Suspense as n } from "react";
3
3
  import s from "@mui/material/Box";
4
4
  import c from "@mui/material/CircularProgress";
5
- import { i as l } from "./AIForm-DtRl0WdY.mjs";
5
+ import { i as l } from "./AIForm-Czsvpf7g.mjs";
6
6
  const m = e.lazy(
7
7
  () => import("@mui/x-data-grid").then((r) => ({ default: r.DataGrid }))
8
8
  );
@@ -1 +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
+ "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-LoeI18mO.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;