dynamic-mui 2.5.3 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion-DB151BNT.mjs +22 -0
- package/dist/accordion-YWjUldL8.js +1 -0
- package/dist/addressfield-CpvOajVo.mjs +242 -0
- package/dist/addressfield-CwKjfnTq.js +1 -0
- package/dist/ai/index.cjs +1 -1
- package/dist/ai/index.mjs +1 -14
- package/dist/ai/react/AIForm.d.ts +2 -1
- package/dist/ai/react/AIFormGenerator.d.ts +1 -1
- package/dist/ai/react/AISchemaReview.d.ts +1 -1
- package/dist/ai/react/AITextAssist.d.ts +1 -1
- package/dist/ai/react/AIVisionImport.d.ts +2 -1
- package/dist/ai-BFpA3uHx.js +29 -0
- package/dist/ai-UvDYQ30b.mjs +4533 -0
- package/dist/asyncautocomplete-DQLDdmVl.js +1 -0
- package/dist/asyncautocomplete-mwra2KKJ.mjs +72 -0
- package/dist/bar-CgYZxXHl.js +1 -0
- package/dist/bar-LVtZP6Ui.mjs +4 -0
- package/dist/cascadeselect-BJzHZA9-.js +1 -0
- package/dist/cascadeselect-Cl4OHq-L.mjs +66 -0
- package/dist/chartControl-IQafKpDk.mjs +29 -0
- package/dist/chartControl-ifHiG3nr.js +1 -0
- package/dist/collection-DPJTrAiB.mjs +1692 -0
- package/dist/collection-Dd_Ojgwl.js +1 -0
- package/dist/colorpicker-9AUe21p1.mjs +110 -0
- package/dist/colorpicker-DgKTLBmU.js +1 -0
- package/dist/components/DynamicComponent.d.ts +2 -1
- package/dist/components/FormGenerator.d.ts +1 -1
- package/dist/components/charts/Bar/bar.d.ts +6 -2
- package/dist/components/charts/Line/line.d.ts +6 -2
- package/dist/components/charts/Mixchart/mixChart.d.ts +2 -1
- package/dist/components/charts/Pie/pie.d.ts +6 -2
- package/dist/components/charts/chartControl.d.ts +15 -0
- package/dist/components/controls/Accordion/accordion.d.ts +2 -1
- package/dist/components/controls/AddressField/addressfield.d.ts +2 -1
- package/dist/components/controls/Alert/alert.d.ts +1 -1
- package/dist/components/controls/AsyncAutocomplete/asyncautocomplete.d.ts +1 -1
- package/dist/components/controls/Autocomplete/autocomplete.d.ts +1 -1
- package/dist/components/controls/Button/button.d.ts +1 -1
- package/dist/components/controls/CascadeSelect/cascadeselect.d.ts +2 -1
- package/dist/components/controls/CheckBox/checkbox.d.ts +2 -2
- package/dist/components/controls/CheckBox/toggleInput.d.ts +25 -0
- package/dist/components/controls/Chip/chip.d.ts +1 -1
- package/dist/components/controls/ChipSelect/chipselect.d.ts +2 -1
- package/dist/components/controls/Collection/CollectionList.d.ts +1 -1
- package/dist/components/controls/Collection/ItemDialog.d.ts +1 -1
- package/dist/components/controls/Collection/collection.d.ts +1 -1
- package/dist/components/controls/Collection/parts.d.ts +6 -6
- package/dist/components/controls/ColorPicker/colorpicker.d.ts +2 -1
- package/dist/components/controls/Computed/computed.d.ts +1 -1
- package/dist/components/controls/ConsentField/consentfield.d.ts +2 -1
- package/dist/components/controls/CurrencyField/currencyfield.d.ts +1 -1
- package/dist/components/controls/DataTable/datatable.d.ts +2 -1
- package/dist/components/controls/DateRangePicker/daterangepicker.d.ts +1 -1
- package/dist/components/controls/DateTime/datetime.d.ts +15 -1
- package/dist/components/controls/DateTimePicker/datetimepicker.d.ts +6 -2
- package/dist/components/controls/Divider/divider.d.ts +1 -1
- package/dist/components/controls/EditableTable/editabletable.d.ts +1 -1
- package/dist/components/controls/FileUpload/fileupload.d.ts +1 -1
- package/dist/components/controls/FormRepeater/formrepeater.d.ts +1 -1
- package/dist/components/controls/FormWizard/formwizard.d.ts +1 -1
- package/dist/components/controls/GeoField/geofield.d.ts +1 -1
- package/dist/components/controls/Group/group.d.ts +2 -1
- package/dist/components/controls/Hyperlink/hyperlink.d.ts +1 -1
- package/dist/components/controls/ImageList/imagelist.d.ts +1 -1
- package/dist/components/controls/IntlPhone/intlphone.d.ts +2 -1
- package/dist/components/controls/KeyValueField/keyvaluefield.d.ts +2 -1
- package/dist/components/controls/LineItemList/lineitemlist.d.ts +1 -1
- package/dist/components/controls/List/list.d.ts +1 -1
- package/dist/components/controls/LocationField/locationfield.d.ts +1 -1
- package/dist/components/controls/MarkdownEditor/markdowneditor.d.ts +2 -1
- package/dist/components/controls/MatrixField/matrixfield.d.ts +2 -1
- package/dist/components/controls/MultiTextbox/multitextbox.d.ts +1 -1
- package/dist/components/controls/NpsScale/npsscale.d.ts +2 -1
- package/dist/components/controls/NumberField/numberfield.d.ts +2 -1
- package/dist/components/controls/NumberStepper/numberstepper.d.ts +1 -1
- package/dist/components/controls/OtpField/otpfield.d.ts +2 -1
- package/dist/components/controls/PasswordField/passwordfield.d.ts +2 -1
- package/dist/components/controls/PhoneField/phonefield.d.ts +1 -1
- package/dist/components/controls/Radio/radio.d.ts +2 -1
- package/dist/components/controls/Rating/rating.d.ts +2 -1
- package/dist/components/controls/RichTextEditor/richtexteditor.d.ts +2 -1
- package/dist/components/controls/Select/select.d.ts +2 -1
- package/dist/components/controls/Signature/signature.d.ts +1 -1
- package/dist/components/controls/Slider/slider.d.ts +1 -1
- package/dist/components/controls/Stepper/stepper.d.ts +1 -1
- package/dist/components/controls/SummaryField/summaryfield.d.ts +2 -1
- package/dist/components/controls/Switch/switch.d.ts +1 -1
- package/dist/components/controls/Tabs/tabs.d.ts +2 -1
- package/dist/components/controls/TagsInput/tagsinput.d.ts +1 -1
- package/dist/components/controls/TextField/textfield.d.ts +1 -1
- package/dist/components/controls/TextField/useTextInput.d.ts +18 -0
- package/dist/components/controls/TimePicker/timepicker.d.ts +6 -2
- package/dist/components/controls/ToggleButtons/togglebuttons.d.ts +1 -1
- package/dist/components/controls/Typography/typography.d.ts +1 -1
- package/dist/components/controls/index.d.ts +24 -9
- package/dist/consentfield-CFm1IDa5.mjs +68 -0
- package/dist/consentfield-z8W0Yfx8.js +1 -0
- package/dist/datatable-CMjaTDPM.js +1 -0
- package/dist/datatable-lZIwHx6a.mjs +29 -0
- package/dist/dynamic-mui.cjs +1 -1
- package/dist/dynamic-mui.d.ts +1 -1
- package/dist/dynamic-mui.mjs +264 -204
- package/dist/editabletable-B3Df4Jys.mjs +117 -0
- package/dist/editabletable-r0RwM1rO.js +1 -0
- package/dist/fileupload-Cr-Mz7oH.js +1 -0
- package/dist/fileupload-D2fXyMIu.mjs +191 -0
- package/dist/formrepeater-BP-RBrQv.js +1 -0
- package/dist/formrepeater-BrYTYCzc.mjs +82 -0
- package/dist/formwizard-CQ2z6fUX.mjs +82 -0
- package/dist/formwizard-DR7fa59M.js +1 -0
- package/dist/geofield-CxVFA0og.mjs +116 -0
- package/dist/geofield-DtN-d2Bq.js +1 -0
- package/dist/group-CiohorzN.mjs +30 -0
- package/dist/group-HQL7UqHt.js +1 -0
- package/dist/imagelist-CNe1Dp_M.mjs +23 -0
- package/dist/imagelist-Wm5Qa6wA.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/intlphone-DwsiSfSt.js +1 -0
- package/dist/intlphone-LGE-cB6X.mjs +341 -0
- package/dist/keyvaluefield-B7NlE0AT.js +1 -0
- package/dist/keyvaluefield-Cd4NQf6d.mjs +128 -0
- package/dist/line-BGSi1tvf.js +1 -0
- package/dist/line-cK6taoCA.mjs +4 -0
- package/dist/lineitemlist-bmk7fEf9.mjs +169 -0
- package/dist/lineitemlist-mulPt3cO.js +1 -0
- package/dist/list-D5qW-7Xg.js +1 -0
- package/dist/list-xPNiijgm.mjs +20 -0
- package/dist/locationfield-DtWkxnX-.js +1 -0
- package/dist/locationfield-SPonkbMU.mjs +90 -0
- package/dist/markdowneditor-6lJQ5cEn.mjs +82 -0
- package/dist/markdowneditor-nPP0t2eK.js +2 -0
- package/dist/matrixfield-CUYoJCwi.js +1 -0
- package/dist/matrixfield-Jm9Yx0EP.mjs +119 -0
- package/dist/mixChart-CSq7pQqJ.mjs +49 -0
- package/dist/mixChart-DoehYa8V.js +1 -0
- package/dist/muiX-BHOKpogF.mjs +12 -0
- package/dist/muiX-CG_D1XQ2.js +1 -0
- package/dist/multitextbox-D-JUSnT7.js +1 -0
- package/dist/multitextbox-gUt8BmfQ.mjs +96 -0
- package/dist/npsscale-D_VtbpJi.js +1 -0
- package/dist/npsscale-LWe7yCxB.mjs +111 -0
- package/dist/numberstepper-BXXlSKT_.js +1 -0
- package/dist/numberstepper-K_JfJJtg.mjs +111 -0
- package/dist/pie-CueMspFX.js +1 -0
- package/dist/pie-DFO89j-z.mjs +4 -0
- package/dist/richtexteditor-BHM-8xe3.js +1 -0
- package/dist/richtexteditor-gmObNHZ7.mjs +178 -0
- package/dist/rolldown-runtime-5iZMYShA.js +1 -0
- package/dist/s3Upload-C3-wcrua.js +1 -0
- package/dist/s3Upload-HtE088XA.mjs +39 -0
- package/dist/signature-DjYfiNzq.js +3 -0
- package/dist/signature-HiL8FJ6C.mjs +1116 -0
- package/dist/stepper-cpOj2wWz.mjs +166 -0
- package/dist/stepper-zEfhqmbA.js +1 -0
- package/dist/summaryfield-BzrdvTVy.js +1 -0
- package/dist/summaryfield-DIQfJjjo.mjs +65 -0
- package/dist/tabs-DvPu-zDC.mjs +50 -0
- package/dist/tabs-xdkLXUCp.js +1 -0
- package/dist/tagsinput-B33m6GJ_.js +1 -0
- package/dist/tagsinput-CTBGuv0M.mjs +49 -0
- package/dist/useSyncedState-CzAO4D1o.mjs +17 -0
- package/dist/useSyncedState-DYNKkpDv.js +1 -0
- package/dist/useTextInput-Cm0_Ps2V.js +1 -0
- package/dist/useTextInput-Dr-ncTE8.mjs +1683 -0
- package/dist/useUpdateEffect-CNBo9hj8.js +1 -0
- package/dist/useUpdateEffect-CXAhttj7.mjs +14 -0
- package/dist/util/helper.d.ts +18 -1
- package/dist/util/muiVersion.d.ts +13 -0
- package/dist/util/stepperComponents.d.ts +1 -1
- package/dist/util/useSyncedState.d.ts +22 -0
- package/dist/util/validation.d.ts +40 -0
- package/dist/v4-Dyp-SQ1c.js +1 -0
- package/dist/v4-YCkfo8OR.mjs +27 -0
- package/dist/validation-B7DPZ218.js +7 -0
- package/dist/validation-BRcYhhsT.mjs +4991 -0
- package/package.json +35 -35
- package/dist/AIForm-D204ogdw.js +0 -44
- package/dist/AIForm-IafSvW2_.mjs +0 -12281
- package/dist/accordion-DA8VpkJ_.mjs +0 -23
- package/dist/accordion-yIxiSIl4.js +0 -1
- package/dist/addressfield-DCzPapIx.mjs +0 -164
- package/dist/addressfield-EFiWgeWB.js +0 -1
- package/dist/asyncautocomplete-5-8SXotM.mjs +0 -92
- package/dist/asyncautocomplete-BmHm-S4u.js +0 -1
- package/dist/bar-BvwjqB4v.mjs +0 -21
- package/dist/bar-DRjoPCtv.js +0 -1
- package/dist/cascadeselect-BEaoupK6.js +0 -1
- package/dist/cascadeselect-CzSf78Pg.mjs +0 -66
- package/dist/collection-CthMZ0Go.js +0 -1
- package/dist/collection-n9eBOioi.mjs +0 -1157
- package/dist/colorpicker-Bm9M38_c.mjs +0 -111
- package/dist/colorpicker-DHkdM8Q2.js +0 -1
- package/dist/consentfield-B2-UFm5n.mjs +0 -80
- package/dist/consentfield-DV8Gz0k9.js +0 -1
- package/dist/datatable-BVZFBd-8.mjs +0 -21
- package/dist/datatable-DnnyVWJm.js +0 -1
- package/dist/editabletable-B_JS4UZ9.js +0 -1
- package/dist/editabletable-BwvIvAt7.mjs +0 -128
- package/dist/fileupload-BHT7K0YT.mjs +0 -185
- package/dist/fileupload-CugVG3o3.js +0 -1
- package/dist/formrepeater-CaJMPo3Q.mjs +0 -75
- package/dist/formrepeater-DiKPaOfi.js +0 -1
- package/dist/formwizard-BzvdbvBY.js +0 -1
- package/dist/formwizard-C9fOIHQv.mjs +0 -83
- package/dist/geofield-BM4b5Zwx.js +0 -1
- package/dist/geofield-DYXx9K9o.mjs +0 -108
- package/dist/group-D5fMqJTx.mjs +0 -23
- package/dist/group-mwS8FSGJ.js +0 -1
- package/dist/imagelist-Bn9QhIv7.js +0 -1
- package/dist/imagelist-rqmJajHt.mjs +0 -18
- package/dist/intlphone-BQYytFWy.js +0 -1
- package/dist/intlphone-DHDwdBbm.mjs +0 -144
- package/dist/keyvaluefield-DM0eSfPF.mjs +0 -127
- package/dist/keyvaluefield-DXyuqDba.js +0 -1
- package/dist/line-Dst2QjuI.mjs +0 -21
- package/dist/line-hM3OgPH7.js +0 -1
- package/dist/lineitemlist-89hrdS0p.mjs +0 -170
- package/dist/lineitemlist-DfEjbNCH.js +0 -1
- package/dist/list-B8S2MrOx.js +0 -1
- package/dist/list-C97cCc78.mjs +0 -20
- package/dist/locationfield-BEMe22_x.mjs +0 -118
- package/dist/locationfield-DlgLvvdU.js +0 -1
- package/dist/markdowneditor-JoiWE-qO.js +0 -2
- package/dist/markdowneditor-K4TAKJ3s.mjs +0 -94
- package/dist/matrixfield-D4sHu6rU.mjs +0 -121
- package/dist/matrixfield-szah6uOP.js +0 -1
- package/dist/mixChart-Doq4lt7Z.mjs +0 -75
- package/dist/mixChart-rgyMCdnp.js +0 -1
- package/dist/multitextbox-CBChuyw9.js +0 -1
- package/dist/multitextbox-Cnrwie5U.mjs +0 -78
- package/dist/npsscale-Cc2eD9Nk.js +0 -1
- package/dist/npsscale-DgQPa1eH.mjs +0 -91
- package/dist/numberstepper-BcuSZHwZ.js +0 -1
- package/dist/numberstepper-BqINnIm7.mjs +0 -132
- package/dist/pie-B6dXjc4o.mjs +0 -21
- package/dist/pie-a_dhmBUq.js +0 -1
- package/dist/richtexteditor-Bs5-VQj3.js +0 -1
- package/dist/richtexteditor-CveBdsmJ.mjs +0 -143
- package/dist/s3Upload-B0JeoLkS.js +0 -1
- package/dist/s3Upload-dpioZ2c8.mjs +0 -51
- package/dist/signature-BRWAWqeA.mjs +0 -1227
- package/dist/signature-Bj9GDrvy.js +0 -2
- package/dist/stepper-B9sSsbQD.js +0 -1
- package/dist/stepper-DTMAP67o.mjs +0 -140
- package/dist/summaryfield-JKL3ZLl2.js +0 -1
- package/dist/summaryfield-xhr0Q4RL.mjs +0 -96
- package/dist/tabs-ClkmKlV8.mjs +0 -39
- package/dist/tabs-DmEP_QW0.js +0 -1
- package/dist/tagsinput-B0yVrYgB.mjs +0 -58
- package/dist/tagsinput-COKkxIxg.js +0 -1
- package/dist/v4-BysszJq8.mjs +0 -30
- package/dist/v4-CqdK_b8Y.js +0 -1
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { jsx as s, jsxs as O } from "react/jsx-runtime";
|
|
2
|
-
import { useState as N, useEffect as T } from "react";
|
|
3
|
-
import { Stack as q, Box as z, Typography as E, TextField as g, InputAdornment as F, Button as D, Icon as x, IconButton as J } from "@mui/material";
|
|
4
|
-
import { j as L } from "./AIForm-IafSvW2_.mjs";
|
|
5
|
-
function k(r, o) {
|
|
6
|
-
if (Array.isArray(r) && r.length > 0) {
|
|
7
|
-
const c = r[0], a = Object.keys(c).find((l) => l !== "fee");
|
|
8
|
-
if (a)
|
|
9
|
-
return a.replace(/\d+$/, "");
|
|
10
|
-
}
|
|
11
|
-
return o;
|
|
12
|
-
}
|
|
13
|
-
function v(r, o) {
|
|
14
|
-
return Array.isArray(r) && r.length > 0 ? r.map((c, a) => {
|
|
15
|
-
const { fee: l = 0, ...f } = c, d = Object.keys(f)[0] || `${o}${a + 1}`;
|
|
16
|
-
return {
|
|
17
|
-
key: d,
|
|
18
|
-
description: String(f[d] ?? ""),
|
|
19
|
-
fee: Number(l) || 0
|
|
20
|
-
};
|
|
21
|
-
}) : [{ key: `${o}1`, description: "", fee: 0 }];
|
|
22
|
-
}
|
|
23
|
-
function M(r) {
|
|
24
|
-
return r.map((o) => ({
|
|
25
|
-
fee: o.fee,
|
|
26
|
-
[o.key]: o.description
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
function H({ attributes: r = {}, rules: o = {}, onChange: c }) {
|
|
30
|
-
const {
|
|
31
|
-
id: a = "",
|
|
32
|
-
keyPrefix: l = "item",
|
|
33
|
-
/** Set to false to hide the row number badge. Defaults to true. */
|
|
34
|
-
showRowBadge: f = !0,
|
|
35
|
-
/** Set to true to render the Description/Fee fields as read-only and hide the Add/Remove buttons. */
|
|
36
|
-
readOnly: d = !1,
|
|
37
|
-
/** Set to false to hide the Add/Remove buttons while keeping fields editable. Defaults to true. */
|
|
38
|
-
showActions: w = !0,
|
|
39
|
-
MuiAttributes: I = {}
|
|
40
|
-
} = r, P = w && !d, {
|
|
41
|
-
row: b = {},
|
|
42
|
-
rowBadge: A = {},
|
|
43
|
-
description: B = {},
|
|
44
|
-
fee: C = {},
|
|
45
|
-
addButton: $ = {},
|
|
46
|
-
removeButton: S = {}
|
|
47
|
-
} = I, u = o?.validation?.some((e) => e.rule === "mandatory") || !1, h = k(r.value, l), [i, p] = N(() => v(r.value, h));
|
|
48
|
-
L(() => {
|
|
49
|
-
const e = k(r.value, l), n = v(r.value, e);
|
|
50
|
-
JSON.stringify(n) !== JSON.stringify(i) && p(n);
|
|
51
|
-
}, [r.value]), T(() => {
|
|
52
|
-
c && c({ id: a, value: M(i) });
|
|
53
|
-
}, [i, a]);
|
|
54
|
-
const j = () => {
|
|
55
|
-
const e = i.length + 1;
|
|
56
|
-
p([...i, { key: `${h}${e}`, description: "", fee: 0 }]);
|
|
57
|
-
}, R = (e) => {
|
|
58
|
-
const t = i.filter((y, m) => m !== e).map((y, m) => ({ ...y, key: `${h}${m + 1}` }));
|
|
59
|
-
p(t);
|
|
60
|
-
}, W = (e, n) => {
|
|
61
|
-
const t = [...i];
|
|
62
|
-
t[e] = { ...t[e], description: n }, p(t);
|
|
63
|
-
}, K = (e, n) => {
|
|
64
|
-
const t = [...i];
|
|
65
|
-
t[e] = { ...t[e], fee: Number(n) || 0 }, p(t);
|
|
66
|
-
};
|
|
67
|
-
return /* @__PURE__ */ s(q, { spacing: 1.5, sx: { width: "100%" }, children: i.map((e, n) => /* @__PURE__ */ O(
|
|
68
|
-
z,
|
|
69
|
-
{
|
|
70
|
-
sx: {
|
|
71
|
-
display: "flex",
|
|
72
|
-
gap: 1,
|
|
73
|
-
alignItems: "flex-start",
|
|
74
|
-
p: 1.5,
|
|
75
|
-
border: "1px solid",
|
|
76
|
-
borderColor: "divider",
|
|
77
|
-
borderRadius: 1,
|
|
78
|
-
backgroundColor: "background.paper"
|
|
79
|
-
},
|
|
80
|
-
...b,
|
|
81
|
-
children: [
|
|
82
|
-
f && /* @__PURE__ */ s(
|
|
83
|
-
E,
|
|
84
|
-
{
|
|
85
|
-
variant: "caption",
|
|
86
|
-
sx: {
|
|
87
|
-
minWidth: 24,
|
|
88
|
-
height: 24,
|
|
89
|
-
borderRadius: "50%",
|
|
90
|
-
backgroundColor: "primary.main",
|
|
91
|
-
color: "primary.contrastText",
|
|
92
|
-
display: "flex",
|
|
93
|
-
alignItems: "center",
|
|
94
|
-
justifyContent: "center",
|
|
95
|
-
fontWeight: 700,
|
|
96
|
-
flexShrink: 0,
|
|
97
|
-
mt: 0.75
|
|
98
|
-
},
|
|
99
|
-
...A,
|
|
100
|
-
children: n + 1
|
|
101
|
-
}
|
|
102
|
-
),
|
|
103
|
-
/* @__PURE__ */ s(
|
|
104
|
-
g,
|
|
105
|
-
{
|
|
106
|
-
fullWidth: !0,
|
|
107
|
-
size: "small",
|
|
108
|
-
label: "Description",
|
|
109
|
-
required: u,
|
|
110
|
-
error: u && !e.description,
|
|
111
|
-
helperText: u && !e.description ? "Required" : "",
|
|
112
|
-
value: e.description,
|
|
113
|
-
onChange: (t) => W(n, t.target.value),
|
|
114
|
-
...B,
|
|
115
|
-
slotProps: {
|
|
116
|
-
input: { readOnly: d }
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
/* @__PURE__ */ s(
|
|
121
|
-
g,
|
|
122
|
-
{
|
|
123
|
-
size: "small",
|
|
124
|
-
label: "Fee",
|
|
125
|
-
type: "number",
|
|
126
|
-
sx: { minWidth: 120 },
|
|
127
|
-
required: u,
|
|
128
|
-
value: e.fee,
|
|
129
|
-
onChange: (t) => K(n, t.target.value),
|
|
130
|
-
onWheel: (t) => t.target.blur(),
|
|
131
|
-
...C,
|
|
132
|
-
slotProps: {
|
|
133
|
-
input: {
|
|
134
|
-
readOnly: d,
|
|
135
|
-
startAdornment: /* @__PURE__ */ s(F, { position: "start", children: "$" })
|
|
136
|
-
},
|
|
137
|
-
htmlInput: { min: 0, step: 0.01 }
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
),
|
|
141
|
-
P && (n === i.length - 1 ? /* @__PURE__ */ s(
|
|
142
|
-
D,
|
|
143
|
-
{
|
|
144
|
-
variant: "contained",
|
|
145
|
-
color: "primary",
|
|
146
|
-
onClick: j,
|
|
147
|
-
sx: { minWidth: 40, px: 1, height: 40, flexShrink: 0 },
|
|
148
|
-
title: "Add row",
|
|
149
|
-
...$,
|
|
150
|
-
children: /* @__PURE__ */ s(x, { children: "add" })
|
|
151
|
-
}
|
|
152
|
-
) : /* @__PURE__ */ s(
|
|
153
|
-
J,
|
|
154
|
-
{
|
|
155
|
-
color: "error",
|
|
156
|
-
onClick: () => R(n),
|
|
157
|
-
sx: { height: 40, flexShrink: 0 },
|
|
158
|
-
title: "Remove row",
|
|
159
|
-
...S,
|
|
160
|
-
children: /* @__PURE__ */ s(x, { children: "delete" })
|
|
161
|
-
}
|
|
162
|
-
))
|
|
163
|
-
]
|
|
164
|
-
},
|
|
165
|
-
e.key
|
|
166
|
-
)) });
|
|
167
|
-
}
|
|
168
|
-
export {
|
|
169
|
-
H as default
|
|
170
|
-
};
|
|
@@ -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-D204ogdw.js");function k(t,o){if(Array.isArray(t)&&t.length>0){const l=t[0],c=Object.keys(l).find(d=>d!=="fee");if(c)return c.replace(/\d+$/,"")}return o}function v(t,o){return Array.isArray(t)&&t.length>0?t.map((l,c)=>{const{fee:d=0,...f}=l,u=Object.keys(f)[0]||`${o}${c+1}`;return{key:u,description:String(f[u]??""),fee:Number(d)||0}}):[{key:`${o}1`,description:"",fee:0}]}function W(t){return t.map(o=>({fee:o.fee,[o.key]:o.description}))}function F({attributes:t={},rules:o={},onChange:l}){const{id:c="",keyPrefix:d="item",showRowBadge:f=!0,readOnly:u=!1,showActions:I=!0,MuiAttributes:j={}}=t,w=I&&!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(t.value,d),[s,p]=g.useState(()=>v(t.value,m));T.useUpdateEffect(()=>{const e=k(t.value,d),n=v(t.value,e);JSON.stringify(n)!==JSON.stringify(s)&&p(n)},[t.value]),g.useEffect(()=>{l&&l({id:c,value:W(s)})},[s,c]);const $=()=>{const e=s.length+1;p([...s,{key:`${m}${e}`,description:"",fee:0}])},R=e=>{const r=s.filter((x,y)=>y!==e).map((x,y)=>({...x,key:`${m}${y+1}`}));p(r)},q=(e,n)=>{const r=[...s];r[e]={...r[e],description:n},p(r)},O=(e,n)=>{const r=[...s];r[e]={...r[e],fee:Number(n)||0},p(r)};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:r=>q(n,r.target.value),...A,slotProps:{input:{readOnly:u}}}),i.jsx(a.TextField,{size:"small",label:"Fee",type:"number",sx:{minWidth:120},required:h,value:e.fee,onChange:r=>O(n,r.target.value),onWheel:r=>r.target.blur(),...B,slotProps:{input:{readOnly:u,startAdornment:i.jsx(a.InputAdornment,{position:"start",children:"$"})},htmlInput:{min:0,step:.01}}}),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;
|
package/dist/list-B8S2MrOx.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("@mui/material"),i=require("./AIForm-D204ogdw.js");function x({attributes:n={}}){const{MuiAttributes:c={},items:s=[]}=n,{sx:u,...o}=c;return r.jsx(e.List,{...o,sx:i.mergeSx(i.premiumSurfaceSx,u),children:(Array.isArray(s)?s:[]).map((t,a)=>r.jsxs(e.ListItem,{...t.MuiListItemAttributes,children:[t.icon&&r.jsx(e.ListItemIcon,{children:r.jsx(e.Icon,{children:t.icon})}),r.jsx(e.ListItemText,{primary:t.primary,secondary:t.secondary,...t.MuiListItemTextAttributes})]},a))})}exports.default=x;
|
package/dist/list-C97cCc78.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import { List as a, ListItem as u, ListItemIcon as x, Icon as L, ListItemText as p } from "@mui/material";
|
|
3
|
-
import { m as d, l } from "./AIForm-IafSvW2_.mjs";
|
|
4
|
-
function A({ attributes: i = {} }) {
|
|
5
|
-
const { MuiAttributes: e = {}, items: s = [] } = i, { sx: o, ...n } = e;
|
|
6
|
-
return /* @__PURE__ */ r(a, { ...n, sx: d(l, o), children: (Array.isArray(s) ? s : []).map((t, c) => /* @__PURE__ */ m(u, { ...t.MuiListItemAttributes, children: [
|
|
7
|
-
t.icon && /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(L, { children: t.icon }) }),
|
|
8
|
-
/* @__PURE__ */ r(
|
|
9
|
-
p,
|
|
10
|
-
{
|
|
11
|
-
primary: t.primary,
|
|
12
|
-
secondary: t.secondary,
|
|
13
|
-
...t.MuiListItemTextAttributes
|
|
14
|
-
}
|
|
15
|
-
)
|
|
16
|
-
] }, c)) });
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
A as default
|
|
20
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { jsxs as B, jsx as s, Fragment as q } from "react/jsx-runtime";
|
|
2
|
-
import w from "react";
|
|
3
|
-
import { j as L, t as O, V as U, v as R } from "./AIForm-IafSvW2_.mjs";
|
|
4
|
-
import G from "@mui/material/TextField";
|
|
5
|
-
import J from "@mui/material/Button";
|
|
6
|
-
import f from "@mui/material/Box";
|
|
7
|
-
import { Icon as K } from "@mui/material";
|
|
8
|
-
function ot({ attributes: l = {}, rules: m = {}, onChange: i, submitTick: h, messages: F }) {
|
|
9
|
-
const {
|
|
10
|
-
id: c = "",
|
|
11
|
-
MuiAttributes: a = {},
|
|
12
|
-
InputProps: S = {},
|
|
13
|
-
format: v = "",
|
|
14
|
-
buttonText: x = "Update Location",
|
|
15
|
-
buttonIcon: b = "location_on",
|
|
16
|
-
buttonDisplay: j = "both",
|
|
17
|
-
MuiButtonAttributes: g = {},
|
|
18
|
-
disabled: P = !1
|
|
19
|
-
} = l, [r, u] = w.useState({
|
|
20
|
-
value: l.value !== void 0 ? l.value : "",
|
|
21
|
-
helperText: a.helperText || "",
|
|
22
|
-
error: !1
|
|
23
|
-
});
|
|
24
|
-
w.useEffect(() => {
|
|
25
|
-
l.value !== void 0 && l.value !== r.value && u((t) => ({ ...t, value: l.value }));
|
|
26
|
-
}, [l.value]);
|
|
27
|
-
const k = (t) => v ? R(t).format(v) : t, p = (t) => {
|
|
28
|
-
const { validation: e } = m;
|
|
29
|
-
if (e)
|
|
30
|
-
for (let o = 0; o < e.length; o += 1) {
|
|
31
|
-
const n = e[o], y = U[n.rule];
|
|
32
|
-
if (!(typeof y == "function" ? y(t, n.value) : !0)) {
|
|
33
|
-
const H = n.rule === "mandatory" ? F?.required || "This field is required" : "";
|
|
34
|
-
return { isValid: !1, message: n.message || H };
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return { isValid: !0, message: "" };
|
|
38
|
-
};
|
|
39
|
-
L(() => {
|
|
40
|
-
if (h) {
|
|
41
|
-
const t = p(r.value);
|
|
42
|
-
u((e) => ({ ...e, helperText: t.message, error: !t.isValid }));
|
|
43
|
-
}
|
|
44
|
-
}, [h]);
|
|
45
|
-
const z = (t) => {
|
|
46
|
-
const { value: e } = t.target, o = p(e);
|
|
47
|
-
u({ value: e, helperText: o.message, error: !o.isValid });
|
|
48
|
-
}, A = (t) => {
|
|
49
|
-
const { value: e } = t.target, o = k(e), n = p(o);
|
|
50
|
-
u({ value: o, helperText: n.message, error: !n.isValid }), typeof i == "function" && i({ id: c, value: o });
|
|
51
|
-
}, D = () => {
|
|
52
|
-
i && i({ id: c, value: r.value, option: "location_update_request" });
|
|
53
|
-
}, E = () => {
|
|
54
|
-
const t = j, e = /* @__PURE__ */ s(K, { children: b });
|
|
55
|
-
switch (t) {
|
|
56
|
-
case "icon":
|
|
57
|
-
return e;
|
|
58
|
-
case "text":
|
|
59
|
-
return /* @__PURE__ */ s(q, { children: x });
|
|
60
|
-
default:
|
|
61
|
-
return /* @__PURE__ */ B(q, { children: [
|
|
62
|
-
e,
|
|
63
|
-
/* @__PURE__ */ s(f, { component: "span", sx: { ml: 0.5 }, children: x })
|
|
64
|
-
] });
|
|
65
|
-
}
|
|
66
|
-
}, M = m?.validation?.some((t) => t.rule === "mandatory") || !1, d = { ...a }, I = a.inputProps || a.slotProps?.htmlInput || {}, V = {
|
|
67
|
-
...a.InputProps || a.slotProps?.input || {},
|
|
68
|
-
...O(S)
|
|
69
|
-
}, W = {
|
|
70
|
-
...a.slotProps || {},
|
|
71
|
-
input: V,
|
|
72
|
-
htmlInput: I
|
|
73
|
-
};
|
|
74
|
-
delete d.slotProps, delete d.inputProps, delete d.InputProps;
|
|
75
|
-
const _ = a.variant || "outlined", T = a.size || "medium", C = T === "small" ? _ === "outlined" ? 40 : 48 : 56;
|
|
76
|
-
return /* @__PURE__ */ B(f, { sx: { display: "flex", gap: 1, alignItems: "flex-start", width: "100%" }, children: [
|
|
77
|
-
/* @__PURE__ */ s(f, { sx: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ s(
|
|
78
|
-
G,
|
|
79
|
-
{
|
|
80
|
-
fullWidth: !0,
|
|
81
|
-
...d,
|
|
82
|
-
id: c,
|
|
83
|
-
required: M,
|
|
84
|
-
slotProps: W,
|
|
85
|
-
inputProps: I,
|
|
86
|
-
InputProps: V,
|
|
87
|
-
onChange: z,
|
|
88
|
-
onBlur: A,
|
|
89
|
-
value: r.value,
|
|
90
|
-
error: r.error,
|
|
91
|
-
helperText: r.helperText,
|
|
92
|
-
disabled: P
|
|
93
|
-
}
|
|
94
|
-
) }),
|
|
95
|
-
/* @__PURE__ */ s(
|
|
96
|
-
J,
|
|
97
|
-
{
|
|
98
|
-
variant: "outlined",
|
|
99
|
-
color: "primary",
|
|
100
|
-
size: T === "small" ? "small" : "medium",
|
|
101
|
-
onClick: D,
|
|
102
|
-
disabled: P,
|
|
103
|
-
...g,
|
|
104
|
-
sx: {
|
|
105
|
-
whiteSpace: "nowrap",
|
|
106
|
-
minWidth: "auto",
|
|
107
|
-
height: C,
|
|
108
|
-
flexShrink: 0,
|
|
109
|
-
...g?.sx
|
|
110
|
-
},
|
|
111
|
-
children: E()
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
] });
|
|
115
|
-
}
|
|
116
|
-
export {
|
|
117
|
-
ot as default
|
|
118
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),V=require("react"),d=require("./AIForm-D204ogdw.js"),C=require("@mui/material/TextField"),H=require("@mui/material/Button"),m=require("@mui/material/Box"),L=require("@mui/material");function R({attributes:l={},rules:h={},onChange:i,submitTick:v,messages:B}){const{id:p="",MuiAttributes:s={},InputProps:F={},format:x="",buttonText:g="Update Location",buttonIcon:S="location_on",buttonDisplay:b="both",MuiButtonAttributes:P={},disabled:I=!1}=l,[a,u]=V.useState({value:l.value!==void 0?l.value:"",helperText:s.helperText||"",error:!1});V.useEffect(()=>{l.value!==void 0&&l.value!==a.value&&u(e=>({...e,value:l.value}))},[l.value]);const w=e=>x?d.numeral(e).format(x):e,f=e=>{const{validation:t}=h;if(t)for(let n=0;n<t.length;n+=1){const r=t[n],j=d.Validation[r.rule];if(!(typeof j=="function"?j(e,r.value):!0)){const _=r.rule==="mandatory"?B?.required||"This field is required":"";return{isValid:!1,message:r.message||_}}}return{isValid:!0,message:""}};d.useUpdateEffect(()=>{if(v){const e=f(a.value);u(t=>({...t,helperText:e.message,error:!e.isValid}))}},[v]);const A=e=>{const{value:t}=e.target,n=f(t);u({value:t,helperText:n.message,error:!n.isValid})},M=e=>{const{value:t}=e.target,n=w(t),r=f(n);u({value:n,helperText:r.message,error:!r.isValid}),typeof i=="function"&&i({id:p,value:n})},k=()=>{i&&i({id:p,value:a.value,option:"location_update_request"})},z=()=>{const e=b,t=o.jsx(L.Icon,{children:S});switch(e){case"icon":return t;case"text":return o.jsx(o.Fragment,{children:g});default:return o.jsxs(o.Fragment,{children:[t,o.jsx(m,{component:"span",sx:{ml:.5},children:g})]})}},D=h?.validation?.some(e=>e.rule==="mandatory")||!1,c={...s},q=s.inputProps||s.slotProps?.htmlInput||{},y={...s.InputProps||s.slotProps?.input||{},...d.getInputProps(F)},E={...s.slotProps||{},input:y,htmlInput:q};delete c.slotProps,delete c.inputProps,delete c.InputProps;const O=s.variant||"outlined",T=s.size||"medium",W=T==="small"?O==="outlined"?40:48:56;return o.jsxs(m,{sx:{display:"flex",gap:1,alignItems:"flex-start",width:"100%"},children:[o.jsx(m,{sx:{flex:1,minWidth:0},children:o.jsx(C,{fullWidth:!0,...c,id:p,required:D,slotProps:E,inputProps:q,InputProps:y,onChange:A,onBlur:M,value:a.value,error:a.error,helperText:a.helperText,disabled:I})}),o.jsx(H,{variant:"outlined",color:"primary",size:T==="small"?"small":"medium",onClick:k,disabled:I,...P,sx:{whiteSpace:"nowrap",minWidth:"auto",height:W,flexShrink:0,...P?.sx},children:z()})]})}exports.default=R;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=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"),a=require("./AIForm-D204ogdw.js");function C(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function M(r){let e=C(r||"");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,o=>`<ul>${o.trimEnd().split(`
|
|
2
|
-
`).map(s=>s.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(o=>{const n=o.trim();return n?/^<(h1|h2|h3|ul|pre)/.test(n)?n:`<p>${n.replace(/\n/g,"<br />")}</p>`:""}).join(""),e}function I({attributes:r={},rules:e={},onChange:o}){const{id:n="",label:s,rows:i=6,MuiAttributes:g={}}=r,{sx:h,...x}=g,[u,c]=p.useState(r.value||""),[d,f]=p.useState(!1);a.useUpdateEffect(()=>{c(r.value||"")},[r.value]);const $=e?.validation?.some(t=>t.rule==="mandatory"||t.rule==="mandatoryselect")||!1,b=t=>{const m=t.target.value;c(m),o?.({id:n,value:m})};return l.jsxs(y,{required:$,component:"fieldset",fullWidth:!0,children:[l.jsxs(w,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",mb:1},children:[s?l.jsx(k,{component:"legend",children:s}):l.jsx("span",{}),l.jsx(j,{size:"small",variant:"outlined",onClick:()=>f(t=>!t),sx:{borderRadius:"10px",textTransform:"none"},children:d?"Write":"Preview"})]}),d?l.jsx(v,{"data-testid":"markdown-preview",dangerouslySetInnerHTML:{__html:M(u)},sx:{minHeight:t=>t.spacing(i*3),p:2,borderRadius:"10px",border:t=>`1px solid ${S.alpha(t.palette.text.primary,.12)}`,backgroundColor:t=>t.palette.background.paper,"& :first-of-type":{mt:0},"& :last-child":{mb:0}}}):l.jsx(q,{id:n||void 0,value:u,onChange:b,multiline:!0,minRows:i,fullWidth:!0,placeholder:"Write markdown…",...x,sx:a.mergeSx(a.premiumInputSx,h),slotProps:{htmlInput:{"aria-label":s||"markdown editor"}}})]})}exports.default=I;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { jsxs as d, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import u from "react";
|
|
3
|
-
import w from "@mui/material/Box";
|
|
4
|
-
import v from "@mui/material/Stack";
|
|
5
|
-
import b from "@mui/material/Button";
|
|
6
|
-
import k from "@mui/material/TextField";
|
|
7
|
-
import y from "@mui/material/FormControl";
|
|
8
|
-
import C from "@mui/material/FormLabel";
|
|
9
|
-
import { alpha as S } from "@mui/material/styles";
|
|
10
|
-
import { j, m as M, k as H } from "./AIForm-IafSvW2_.mjs";
|
|
11
|
-
function I(t) {
|
|
12
|
-
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
13
|
-
}
|
|
14
|
-
function R(t) {
|
|
15
|
-
let e = I(t || "");
|
|
16
|
-
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, (a) => `<ul>${a.trimEnd().split(`
|
|
17
|
-
`).map((n) => n.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((a) => {
|
|
18
|
-
const o = a.trim();
|
|
19
|
-
return o ? /^<(h1|h2|h3|ul|pre)/.test(o) ? o : `<p>${o.replace(/\n/g, "<br />")}</p>` : "";
|
|
20
|
-
}).join(""), e;
|
|
21
|
-
}
|
|
22
|
-
function U({ attributes: t = {}, rules: e = {}, onChange: a }) {
|
|
23
|
-
const { id: o = "", label: n, rows: i = 6, MuiAttributes: h = {} } = t, { sx: f, ...g } = h, [m, s] = u.useState(t.value || ""), [p, x] = u.useState(!1);
|
|
24
|
-
j(() => {
|
|
25
|
-
s(t.value || "");
|
|
26
|
-
}, [t.value]);
|
|
27
|
-
const $ = e?.validation?.some(
|
|
28
|
-
(r) => r.rule === "mandatory" || r.rule === "mandatoryselect"
|
|
29
|
-
) || !1;
|
|
30
|
-
return /* @__PURE__ */ d(y, { required: $, component: "fieldset", fullWidth: !0, children: [
|
|
31
|
-
/* @__PURE__ */ d(
|
|
32
|
-
v,
|
|
33
|
-
{
|
|
34
|
-
direction: "row",
|
|
35
|
-
sx: {
|
|
36
|
-
justifyContent: "space-between",
|
|
37
|
-
alignItems: "center",
|
|
38
|
-
mb: 1
|
|
39
|
-
},
|
|
40
|
-
children: [
|
|
41
|
-
n ? /* @__PURE__ */ l(C, { component: "legend", children: n }) : /* @__PURE__ */ l("span", {}),
|
|
42
|
-
/* @__PURE__ */ l(
|
|
43
|
-
b,
|
|
44
|
-
{
|
|
45
|
-
size: "small",
|
|
46
|
-
variant: "outlined",
|
|
47
|
-
onClick: () => x((r) => !r),
|
|
48
|
-
sx: { borderRadius: "10px", textTransform: "none" },
|
|
49
|
-
children: p ? "Write" : "Preview"
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
p ? /* @__PURE__ */ l(
|
|
56
|
-
w,
|
|
57
|
-
{
|
|
58
|
-
"data-testid": "markdown-preview",
|
|
59
|
-
dangerouslySetInnerHTML: { __html: R(m) },
|
|
60
|
-
sx: {
|
|
61
|
-
minHeight: (r) => r.spacing(i * 3),
|
|
62
|
-
p: 2,
|
|
63
|
-
borderRadius: "10px",
|
|
64
|
-
border: (r) => `1px solid ${S(r.palette.text.primary, 0.12)}`,
|
|
65
|
-
backgroundColor: (r) => r.palette.background.paper,
|
|
66
|
-
"& :first-of-type": { mt: 0 },
|
|
67
|
-
"& :last-child": { mb: 0 }
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
) : /* @__PURE__ */ l(
|
|
71
|
-
k,
|
|
72
|
-
{
|
|
73
|
-
id: o || void 0,
|
|
74
|
-
value: m,
|
|
75
|
-
onChange: (r) => {
|
|
76
|
-
const c = r.target.value;
|
|
77
|
-
s(c), a?.({ id: o, value: c });
|
|
78
|
-
},
|
|
79
|
-
multiline: !0,
|
|
80
|
-
minRows: i,
|
|
81
|
-
fullWidth: !0,
|
|
82
|
-
placeholder: "Write markdown…",
|
|
83
|
-
...g,
|
|
84
|
-
sx: M(H, f),
|
|
85
|
-
slotProps: {
|
|
86
|
-
htmlInput: { "aria-label": n || "markdown editor" }
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
] });
|
|
91
|
-
}
|
|
92
|
-
export {
|
|
93
|
-
U as default
|
|
94
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import s from "react";
|
|
3
|
-
import w from "@mui/material/Table";
|
|
4
|
-
import B from "@mui/material/TableBody";
|
|
5
|
-
import u from "@mui/material/TableCell";
|
|
6
|
-
import L from "@mui/material/TableContainer";
|
|
7
|
-
import U from "@mui/material/TableHead";
|
|
8
|
-
import M from "@mui/material/TableRow";
|
|
9
|
-
import D from "@mui/material/Radio";
|
|
10
|
-
import G from "@mui/material/Checkbox";
|
|
11
|
-
import J from "@mui/material/FormControl";
|
|
12
|
-
import K from "@mui/material/FormLabel";
|
|
13
|
-
import N from "@mui/material/FormHelperText";
|
|
14
|
-
import { alpha as R } from "@mui/material/styles";
|
|
15
|
-
import { j as O, m as Q, l as V } from "./AIForm-IafSvW2_.mjs";
|
|
16
|
-
const X = (o) => (o || []).map(
|
|
17
|
-
(t) => typeof t == "string" ? { id: t, label: t } : { id: String(t.id), label: t.label ?? String(t.id) }
|
|
18
|
-
), Y = (o) => (o || []).map(
|
|
19
|
-
(t) => typeof t == "string" ? { value: t, label: t } : { value: String(t.value), label: t.label ?? String(t.value) }
|
|
20
|
-
);
|
|
21
|
-
function ce({ attributes: o = {}, rules: t = {}, onChange: $ }) {
|
|
22
|
-
const {
|
|
23
|
-
MuiAttributes: F = {},
|
|
24
|
-
id: h = "",
|
|
25
|
-
rows: b = [],
|
|
26
|
-
columns: g = [],
|
|
27
|
-
multiple: c = !1,
|
|
28
|
-
label: v = ""
|
|
29
|
-
} = o, x = s.useMemo(() => X(b), [b]), y = s.useMemo(() => Y(g), [g]), [n, S] = s.useState(o.value || {}), [C, W] = s.useState(!1), [T, z] = s.useState("");
|
|
30
|
-
O(() => {
|
|
31
|
-
S(o.value || {});
|
|
32
|
-
}, [o.value]);
|
|
33
|
-
const p = t?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1, j = (e) => {
|
|
34
|
-
let r = !0, l = "";
|
|
35
|
-
return p && (x.every((m) => {
|
|
36
|
-
const i = e[m.id];
|
|
37
|
-
return c ? Array.isArray(i) && i.length > 0 : i != null && i !== "";
|
|
38
|
-
}) || (r = !1, l = t?.validation?.find(
|
|
39
|
-
(i) => i.rule === "mandatory" || i.rule === "mandatoryselect"
|
|
40
|
-
)?.message || "Required")), { isValid: r, message: l };
|
|
41
|
-
}, k = (e) => {
|
|
42
|
-
S(e);
|
|
43
|
-
const r = j(e);
|
|
44
|
-
W(!r.isValid), z(r.message), $?.({ id: h, value: e, option: e });
|
|
45
|
-
}, q = (e, r) => {
|
|
46
|
-
k({ ...n, [e]: r });
|
|
47
|
-
}, H = (e, r, l) => {
|
|
48
|
-
const f = Array.isArray(n[e]) ? n[e] : [], m = l ? [...f, r] : f.filter((i) => i !== r);
|
|
49
|
-
k({ ...n, [e]: m });
|
|
50
|
-
}, A = (e, r) => {
|
|
51
|
-
const l = n[e];
|
|
52
|
-
return c ? Array.isArray(l) && l.includes(r) : l === r;
|
|
53
|
-
}, { sx: E, ...P } = F;
|
|
54
|
-
return /* @__PURE__ */ d(J, { required: p, error: C, component: "fieldset", fullWidth: !0, children: [
|
|
55
|
-
v && /* @__PURE__ */ a(K, { required: p, error: C, sx: { mb: 1, fontWeight: 600 }, children: v }),
|
|
56
|
-
/* @__PURE__ */ a(
|
|
57
|
-
L,
|
|
58
|
-
{
|
|
59
|
-
sx: Q(V, { width: "100%" }),
|
|
60
|
-
children: /* @__PURE__ */ d(w, { size: "small", ...P, sx: E, children: [
|
|
61
|
-
/* @__PURE__ */ a(U, { children: /* @__PURE__ */ d(
|
|
62
|
-
M,
|
|
63
|
-
{
|
|
64
|
-
sx: (e) => ({
|
|
65
|
-
backgroundColor: R(e.palette.primary.main, 0.06)
|
|
66
|
-
}),
|
|
67
|
-
children: [
|
|
68
|
-
/* @__PURE__ */ a(u, { sx: { fontWeight: 700 } }),
|
|
69
|
-
y.map((e) => /* @__PURE__ */ a(u, { align: "center", sx: { fontWeight: 700 }, children: e.label }, e.value))
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
) }),
|
|
73
|
-
/* @__PURE__ */ a(B, { children: x.map((e) => /* @__PURE__ */ d(
|
|
74
|
-
M,
|
|
75
|
-
{
|
|
76
|
-
hover: !0,
|
|
77
|
-
sx: (r) => ({
|
|
78
|
-
transition: "background-color .18s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
79
|
-
"&:hover": {
|
|
80
|
-
backgroundColor: R(r.palette.primary.main, 0.04)
|
|
81
|
-
}
|
|
82
|
-
}),
|
|
83
|
-
children: [
|
|
84
|
-
/* @__PURE__ */ a(u, { component: "th", scope: "row", sx: { fontWeight: 500 }, children: e.label }),
|
|
85
|
-
y.map((r) => /* @__PURE__ */ a(u, { align: "center", padding: "checkbox", children: c ? /* @__PURE__ */ a(
|
|
86
|
-
G,
|
|
87
|
-
{
|
|
88
|
-
checked: A(e.id, r.value),
|
|
89
|
-
onChange: (l) => H(e.id, r.value, l.target.checked),
|
|
90
|
-
slotProps: {
|
|
91
|
-
input: {
|
|
92
|
-
"aria-label": `${e.label} ${r.label}`
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
) : /* @__PURE__ */ a(
|
|
97
|
-
D,
|
|
98
|
-
{
|
|
99
|
-
name: `matrix-${h}-${e.id}`,
|
|
100
|
-
checked: A(e.id, r.value),
|
|
101
|
-
onChange: () => q(e.id, r.value),
|
|
102
|
-
slotProps: {
|
|
103
|
-
input: {
|
|
104
|
-
"aria-label": `${e.label} ${r.label}`
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
) }, r.value))
|
|
109
|
-
]
|
|
110
|
-
},
|
|
111
|
-
e.id
|
|
112
|
-
)) })
|
|
113
|
-
] })
|
|
114
|
-
}
|
|
115
|
-
),
|
|
116
|
-
T && /* @__PURE__ */ a(N, { children: T })
|
|
117
|
-
] });
|
|
118
|
-
}
|
|
119
|
-
export {
|
|
120
|
-
ce as default
|
|
121
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("react"),w=require("@mui/material/Table"),B=require("@mui/material/TableBody"),c=require("@mui/material/TableCell"),L=require("@mui/material/TableContainer"),O=require("@mui/material/TableHead"),A=require("@mui/material/TableRow"),U=require("@mui/material/Radio"),D=require("@mui/material/Checkbox"),G=require("@mui/material/FormControl"),J=require("@mui/material/FormLabel"),K=require("@mui/material/FormHelperText"),M=require("@mui/material/styles"),x=require("./AIForm-D204ogdw.js"),N=a=>(a||[]).map(s=>typeof s=="string"?{id:s,label:s}:{id:String(s.id),label:s.label??String(s.id)}),Q=a=>(a||[]).map(s=>typeof s=="string"?{value:s,label:s}:{value:String(s.value),label:s.label??String(s.value)});function V({attributes:a={},rules:s={},onChange:k}){const{MuiAttributes:R={},id:b="",rows:p=[],columns:g=[],multiple:d=!1,label:v=""}=a,f=o.useMemo(()=>N(p),[p]),y=o.useMemo(()=>Q(g),[g]),[i,q]=o.useState(a.value||{}),[j,F]=o.useState(!1),[S,$]=o.useState("");x.useUpdateEffect(()=>{q(a.value||{})},[a.value]);const m=s?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,W=e=>{let r=!0,n="";return m&&(f.every(u=>{const l=e[u.id];return d?Array.isArray(l)&&l.length>0:l!=null&&l!==""})||(r=!1,n=s?.validation?.find(l=>l.rule==="mandatory"||l.rule==="mandatoryselect")?.message||"Required")),{isValid:r,message:n}},C=e=>{q(e);const r=W(e);F(!r.isValid),$(r.message),k?.({id:b,value:e,option:e})},z=(e,r)=>{C({...i,[e]:r})},H=(e,r,n)=>{const h=Array.isArray(i[e])?i[e]:[],u=n?[...h,r]:h.filter(l=>l!==r);C({...i,[e]:u})},T=(e,r)=>{const n=i[e];return d?Array.isArray(n)&&n.includes(r):n===r},{sx:P,...E}=R;return t.jsxs(G,{required:m,error:j,component:"fieldset",fullWidth:!0,children:[v&&t.jsx(J,{required:m,error:j,sx:{mb:1,fontWeight:600},children:v}),t.jsx(L,{sx:x.mergeSx(x.premiumSurfaceSx,{width:"100%"}),children:t.jsxs(w,{size:"small",...E,sx:P,children:[t.jsx(O,{children:t.jsxs(A,{sx:e=>({backgroundColor:M.alpha(e.palette.primary.main,.06)}),children:[t.jsx(c,{sx:{fontWeight:700}}),y.map(e=>t.jsx(c,{align:"center",sx:{fontWeight:700},children:e.label},e.value))]})}),t.jsx(B,{children:f.map(e=>t.jsxs(A,{hover:!0,sx:r=>({transition:"background-color .18s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{backgroundColor:M.alpha(r.palette.primary.main,.04)}}),children:[t.jsx(c,{component:"th",scope:"row",sx:{fontWeight:500},children:e.label}),y.map(r=>t.jsx(c,{align:"center",padding:"checkbox",children:d?t.jsx(D,{checked:T(e.id,r.value),onChange:n=>H(e.id,r.value,n.target.checked),slotProps:{input:{"aria-label":`${e.label} ${r.label}`}}}):t.jsx(U,{name:`matrix-${b}-${e.id}`,checked:T(e.id,r.value),onChange:()=>z(e.id,r.value),slotProps:{input:{"aria-label":`${e.label} ${r.label}`}}})},r.value))]},e.id))})]})}),S&&t.jsx(K,{children:S})]})}exports.default=V;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import c, { Suspense as C } from "react";
|
|
3
|
-
import l from "@mui/material/Box";
|
|
4
|
-
import f from "@mui/material/CircularProgress";
|
|
5
|
-
const d = c.lazy(async () => {
|
|
6
|
-
const [
|
|
7
|
-
{ ChartsContainer: i },
|
|
8
|
-
{ LinePlot: s },
|
|
9
|
-
{ BarPlot: a },
|
|
10
|
-
{ ChartsXAxis: e },
|
|
11
|
-
{ ChartsYAxis: n },
|
|
12
|
-
{ axisClasses: r }
|
|
13
|
-
] = await Promise.all([
|
|
14
|
-
import("@mui/x-charts/ChartsContainer"),
|
|
15
|
-
import("@mui/x-charts/LineChart"),
|
|
16
|
-
import("@mui/x-charts/BarChart"),
|
|
17
|
-
import("@mui/x-charts/ChartsXAxis"),
|
|
18
|
-
import("@mui/x-charts/ChartsYAxis"),
|
|
19
|
-
import("@mui/x-charts/ChartsAxis")
|
|
20
|
-
]);
|
|
21
|
-
return { default: ({
|
|
22
|
-
MuiChartContainerAttributes: x = {},
|
|
23
|
-
MuiChartXAxisAttributes: m = {},
|
|
24
|
-
MuiChartYAxisAttributes: u = {},
|
|
25
|
-
MuiChartSX: h = {}
|
|
26
|
-
}) => /* @__PURE__ */ p(
|
|
27
|
-
i,
|
|
28
|
-
{
|
|
29
|
-
sx: {
|
|
30
|
-
[`.${r.left} .${r.label}`]: {
|
|
31
|
-
transform: "translate(-25px, 0)"
|
|
32
|
-
},
|
|
33
|
-
[`.${r.right} .${r.label}`]: {
|
|
34
|
-
transform: "translate(30px, 0)"
|
|
35
|
-
},
|
|
36
|
-
...h
|
|
37
|
-
},
|
|
38
|
-
...x,
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ t(a, {}),
|
|
41
|
-
/* @__PURE__ */ t(s, {}),
|
|
42
|
-
/* @__PURE__ */ t(e, { ...m }),
|
|
43
|
-
/* @__PURE__ */ t(n, { ...u })
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
) };
|
|
47
|
-
});
|
|
48
|
-
function P({ attributes: i = {} }) {
|
|
49
|
-
const {
|
|
50
|
-
id: s,
|
|
51
|
-
MuiBoxAttributes: a = {},
|
|
52
|
-
MuiChartContainerAttributes: e = {},
|
|
53
|
-
MuiChartXAxisAttributes: n = {},
|
|
54
|
-
MuiChartYAxisAttributes: r = {},
|
|
55
|
-
MuiChartSX: o = {}
|
|
56
|
-
} = i;
|
|
57
|
-
return /* @__PURE__ */ t(l, { sx: { width: "100%", maxWidth: 600 }, ...a, children: /* @__PURE__ */ t(
|
|
58
|
-
C,
|
|
59
|
-
{
|
|
60
|
-
fallback: /* @__PURE__ */ t(l, { sx: { display: "flex", justifyContent: "center", p: 2 }, children: /* @__PURE__ */ t(f, {}) }),
|
|
61
|
-
children: /* @__PURE__ */ t(
|
|
62
|
-
d,
|
|
63
|
-
{
|
|
64
|
-
MuiChartContainerAttributes: e,
|
|
65
|
-
MuiChartXAxisAttributes: n,
|
|
66
|
-
MuiChartYAxisAttributes: r,
|
|
67
|
-
MuiChartSX: o
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
) }, s);
|
|
72
|
-
}
|
|
73
|
-
export {
|
|
74
|
-
P as default
|
|
75
|
-
};
|
|
@@ -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[{ChartsContainer:t},{LinePlot:r},{BarPlot:e},{ChartsXAxis:n},{ChartsYAxis:i},{axisClasses:a}]=await Promise.all([import("@mui/x-charts/ChartsContainer"),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 s=require("react/jsx-runtime"),i=require("react"),a=require("@mui/material"),d=require("./AIForm-D204ogdw.js");function k({attributes:r={},rules:h={},onChange:f,submitTick:v,messages:m}){const{id:o=""}=r,x=m?.required||"Required",p=i.useRef(null),[l,u]=i.useState(()=>{if(r.value&&typeof r.value=="object"){const e=Object.entries(r.value).map(([n,t])=>({key:n,value:String(t)}));if(e.length>0)return e}return[{key:"t1",value:""}]}),c=h?.validation?.some(e=>e.rule==="mandatory")||!1;d.useUpdateEffect(()=>{v&&c&&!l[0]?.value&&p.current?.focus()},[v]),d.useUpdateEffect(()=>{if(r.value&&typeof r.value=="object"){const e=Object.entries(r.value).map(([n,t])=>({key:n,value:String(t)}));JSON.stringify(e)!==JSON.stringify(l)&&u(e.length>0?e:[{key:"t1",value:""}])}else r.value||u([{key:"t1",value:""}])},[r.value]),i.useEffect(()=>{const e=l.reduce((n,t)=>(n[t.key]=t.value,n),{});f&&f({id:o,value:e})},[l,o]);const y=()=>{const e=l.length+1;u([...l,{key:`t${e}`,value:""}])},g=e=>{const n=l.filter((t,I)=>I!==e);u(n)},j=(e,n)=>{const t=[...l];t[e].value=n,u(t)};return s.jsx(a.Stack,{spacing:2,sx:{width:"100%"},children:l.map((e,n)=>s.jsxs(a.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[s.jsx(a.TextField,{fullWidth:!0,id:n===0?o:`${o}_${e.key}`,inputRef:n===0?p:void 0,required:c,error:c&&!e.value,helperText:c&&!e.value?x:"",label:`Value ${e.key}`,value:e.value,onChange:t=>j(n,t.target.value),size:"small",sx:d.premiumInputSx}),n===l.length-1?s.jsx(a.Button,{variant:"contained",color:"primary",onClick:y,sx:{minWidth:"40px",p:1},children:s.jsx(a.Icon,{children:"add"})}):s.jsx(a.IconButton,{color:"error",onClick:()=>g(n),children:s.jsx(a.Icon,{children:"remove"})})]},n))})}exports.default=k;
|