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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { r as e } from "./validation-BRcYhhsT.mjs";
|
|
2
|
+
import { r as t, s as n, t as r } from "./useTextInput-Dr-ncTE8.mjs";
|
|
3
|
+
import { Icon as i } from "@mui/material";
|
|
4
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import c from "@mui/material/TextField";
|
|
6
|
+
import l from "@mui/material/Box";
|
|
7
|
+
import u from "@mui/material/Button";
|
|
8
|
+
// src/components/controls/LocationField/locationfield.tsx
|
|
9
|
+
function d({ attributes: d = {}, rules: f = {}, onChange: p, submitTick: m, messages: h }) {
|
|
10
|
+
let { id: g = "", MuiAttributes: _ = {}, InputProps: v = {}, buttonText: y = "Update Location", buttonIcon: b = "location_on", buttonDisplay: x = "both", MuiButtonAttributes: S = {}, disabled: C = !1 } = d, { textData: w, handleOnChange: T, handleOnBlur: E } = r({
|
|
11
|
+
attributes: d,
|
|
12
|
+
rules: f,
|
|
13
|
+
onChange: p,
|
|
14
|
+
submitTick: m,
|
|
15
|
+
messages: h
|
|
16
|
+
}), D = () => {
|
|
17
|
+
p && p({
|
|
18
|
+
id: g,
|
|
19
|
+
value: w.value,
|
|
20
|
+
option: "location_update_request"
|
|
21
|
+
});
|
|
22
|
+
}, O = () => {
|
|
23
|
+
let e = x, t = /* @__PURE__ */ o(i, { children: b });
|
|
24
|
+
switch (e) {
|
|
25
|
+
case "icon": return t;
|
|
26
|
+
case "text": return /* @__PURE__ */ o(a, { children: y });
|
|
27
|
+
default: return /* @__PURE__ */ s(a, { children: [t, /* @__PURE__ */ o(l, {
|
|
28
|
+
component: "span",
|
|
29
|
+
sx: { ml: .5 },
|
|
30
|
+
children: y
|
|
31
|
+
})] });
|
|
32
|
+
}
|
|
33
|
+
}, k = e(f), A = { ..._ }, j = _.inputProps || _.slotProps?.htmlInput || {}, M = {
|
|
34
|
+
..._.InputProps || _.slotProps?.input || {},
|
|
35
|
+
...n(v)
|
|
36
|
+
}, N = {
|
|
37
|
+
..._.slotProps || {},
|
|
38
|
+
input: M,
|
|
39
|
+
htmlInput: j
|
|
40
|
+
};
|
|
41
|
+
delete A.slotProps, delete A.inputProps, delete A.InputProps;
|
|
42
|
+
let P = _.variant || "outlined", F = _.size || "medium", I = F === "small" ? P === "outlined" ? 40 : 48 : 56;
|
|
43
|
+
return /* @__PURE__ */ s(l, {
|
|
44
|
+
sx: {
|
|
45
|
+
display: "flex",
|
|
46
|
+
gap: 1,
|
|
47
|
+
alignItems: "flex-start",
|
|
48
|
+
width: "100%"
|
|
49
|
+
},
|
|
50
|
+
children: [/* @__PURE__ */ o(l, {
|
|
51
|
+
sx: {
|
|
52
|
+
flex: 1,
|
|
53
|
+
minWidth: 0
|
|
54
|
+
},
|
|
55
|
+
children: /* @__PURE__ */ o(c, {
|
|
56
|
+
fullWidth: !0,
|
|
57
|
+
...A,
|
|
58
|
+
id: g,
|
|
59
|
+
required: k,
|
|
60
|
+
slotProps: N,
|
|
61
|
+
...t ? {
|
|
62
|
+
inputProps: j,
|
|
63
|
+
InputProps: M
|
|
64
|
+
} : {},
|
|
65
|
+
onChange: T,
|
|
66
|
+
onBlur: E,
|
|
67
|
+
value: w.value,
|
|
68
|
+
error: w.error,
|
|
69
|
+
helperText: w.helperText,
|
|
70
|
+
disabled: C
|
|
71
|
+
})
|
|
72
|
+
}), /* @__PURE__ */ o(u, {
|
|
73
|
+
variant: "outlined",
|
|
74
|
+
color: "primary",
|
|
75
|
+
size: F === "small" ? "small" : "medium",
|
|
76
|
+
onClick: D,
|
|
77
|
+
disabled: C,
|
|
78
|
+
...S,
|
|
79
|
+
sx: {
|
|
80
|
+
whiteSpace: "nowrap",
|
|
81
|
+
minWidth: "auto",
|
|
82
|
+
height: I,
|
|
83
|
+
flexShrink: 0,
|
|
84
|
+
...S?.sx
|
|
85
|
+
},
|
|
86
|
+
children: O()
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
export { d as default };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { r as e } from "./validation-BRcYhhsT.mjs";
|
|
2
|
+
import { B as t, U as n } from "./ai-UvDYQ30b.mjs";
|
|
3
|
+
import { n as r } from "./useSyncedState-CzAO4D1o.mjs";
|
|
4
|
+
import i from "react";
|
|
5
|
+
import { alpha as a } from "@mui/material/styles";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import c from "@mui/material/TextField";
|
|
8
|
+
import l from "@mui/material/FormControl";
|
|
9
|
+
import u from "@mui/material/Box";
|
|
10
|
+
import d from "@mui/material/FormLabel";
|
|
11
|
+
import f from "@mui/material/Button";
|
|
12
|
+
import p from "@mui/material/Stack";
|
|
13
|
+
// src/components/controls/MarkdownEditor/markdowneditor.tsx
|
|
14
|
+
function m(e) {
|
|
15
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
16
|
+
}
|
|
17
|
+
function h(e) {
|
|
18
|
+
let t = m(e || "");
|
|
19
|
+
return t = t.replace(/^###\s+(.*)$/gm, "<h3>$1</h3>"), t = t.replace(/^##\s+(.*)$/gm, "<h2>$1</h2>"), t = t.replace(/^#\s+(.*)$/gm, "<h1>$1</h1>"), t = t.replace(/(?:^-\s+.*(?:\n|$))+/gm, (e) => `<ul>${e.trimEnd().split("\n").map((e) => e.replace(/^-\s+(.*)$/, "<li>$1</li>")).join("")}</ul>`), t = t.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, "<a href=\"$2\">$1</a>"), t = t.replace(/`([^`]+)`/g, "<code>$1</code>"), t = t.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), t = t.replace(/\*([^*]+)\*/g, "<em>$1</em>"), t = t.split(/\n{2,}/).map((e) => {
|
|
20
|
+
let t = e.trim();
|
|
21
|
+
return t ? /^<(h1|h2|h3|ul|pre)/.test(t) ? t : `<p>${t.replace(/\n/g, "<br />")}</p>` : "";
|
|
22
|
+
}).join(""), t;
|
|
23
|
+
}
|
|
24
|
+
function g({ attributes: m = {}, rules: g = {}, onChange: _ }) {
|
|
25
|
+
let { id: v = "", label: y, rows: b = 6, MuiAttributes: x = {} } = m, { sx: S, ...C } = x, [w, T] = r(() => m.value || "", [m.value]), [E, D] = i.useState(!1), O = e(g);
|
|
26
|
+
return /* @__PURE__ */ s(l, {
|
|
27
|
+
required: O,
|
|
28
|
+
component: "fieldset",
|
|
29
|
+
fullWidth: !0,
|
|
30
|
+
children: [/* @__PURE__ */ s(p, {
|
|
31
|
+
direction: "row",
|
|
32
|
+
sx: {
|
|
33
|
+
justifyContent: "space-between",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
mb: 1
|
|
36
|
+
},
|
|
37
|
+
children: [y ? /* @__PURE__ */ o(d, {
|
|
38
|
+
component: "legend",
|
|
39
|
+
children: y
|
|
40
|
+
}) : /* @__PURE__ */ o("span", {}), /* @__PURE__ */ o(f, {
|
|
41
|
+
size: "small",
|
|
42
|
+
variant: "outlined",
|
|
43
|
+
onClick: () => D((e) => !e),
|
|
44
|
+
sx: {
|
|
45
|
+
borderRadius: "10px",
|
|
46
|
+
textTransform: "none"
|
|
47
|
+
},
|
|
48
|
+
children: E ? "Write" : "Preview"
|
|
49
|
+
})]
|
|
50
|
+
}), E ? /* @__PURE__ */ o(u, {
|
|
51
|
+
"data-testid": "markdown-preview",
|
|
52
|
+
dangerouslySetInnerHTML: { __html: h(w) },
|
|
53
|
+
sx: {
|
|
54
|
+
minHeight: (e) => e.spacing(b * 3),
|
|
55
|
+
p: 2,
|
|
56
|
+
borderRadius: "10px",
|
|
57
|
+
border: (e) => `1px solid ${a(e.palette.text.primary, .12)}`,
|
|
58
|
+
backgroundColor: (e) => e.palette.background.paper,
|
|
59
|
+
"& :first-of-type": { mt: 0 },
|
|
60
|
+
"& :last-child": { mb: 0 }
|
|
61
|
+
}
|
|
62
|
+
}) : /* @__PURE__ */ o(c, {
|
|
63
|
+
id: v || void 0,
|
|
64
|
+
value: w,
|
|
65
|
+
onChange: (e) => {
|
|
66
|
+
let t = e.target.value;
|
|
67
|
+
T(t), _?.({
|
|
68
|
+
id: v,
|
|
69
|
+
value: t
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
multiline: !0,
|
|
73
|
+
minRows: b,
|
|
74
|
+
fullWidth: !0,
|
|
75
|
+
placeholder: "Write markdown…",
|
|
76
|
+
...C,
|
|
77
|
+
sx: t(n, S),
|
|
78
|
+
slotProps: { htmlInput: { "aria-label": y || "markdown editor" } }
|
|
79
|
+
})]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export { g as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-5iZMYShA.js"),t=require("./ai-BFpA3uHx.js"),n=require("./validation-B7DPZ218.js"),r=require("./useSyncedState-DYNKkpDv.js");let i=require("react");i=e.n(i);let a=require("@mui/material/styles"),o=require("react/jsx-runtime"),s=require("@mui/material/TextField");s=e.n(s);let c=require("@mui/material/FormControl");c=e.n(c);let l=require("@mui/material/Box");l=e.n(l);let u=require("@mui/material/FormLabel");u=e.n(u);let d=require("@mui/material/Button");d=e.n(d);let f=require("@mui/material/Stack");f=e.n(f);function p(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function m(e){let t=p(e||``);return t=t.replace(/^###\s+(.*)$/gm,`<h3>$1</h3>`),t=t.replace(/^##\s+(.*)$/gm,`<h2>$1</h2>`),t=t.replace(/^#\s+(.*)$/gm,`<h1>$1</h1>`),t=t.replace(/(?:^-\s+.*(?:\n|$))+/gm,e=>`<ul>${e.trimEnd().split(`
|
|
2
|
+
`).map(e=>e.replace(/^-\s+(.*)$/,`<li>$1</li>`)).join(``)}</ul>`),t=t.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,`<a href="$2">$1</a>`),t=t.replace(/`([^`]+)`/g,`<code>$1</code>`),t=t.replace(/\*\*([^*]+)\*\*/g,`<strong>$1</strong>`),t=t.replace(/\*([^*]+)\*/g,`<em>$1</em>`),t=t.split(/\n{2,}/).map(e=>{let t=e.trim();return t?/^<(h1|h2|h3|ul|pre)/.test(t)?t:`<p>${t.replace(/\n/g,`<br />`)}</p>`:``}).join(``),t}function h({attributes:e={},rules:p={},onChange:h}){let{id:g=``,label:_,rows:v=6,MuiAttributes:y={}}=e,{sx:b,...x}=y,[S,C]=r.n(()=>e.value||``,[e.value]),[w,T]=i.default.useState(!1),E=n.r(p);return(0,o.jsxs)(c.default,{required:E,component:`fieldset`,fullWidth:!0,children:[(0,o.jsxs)(f.default,{direction:`row`,sx:{justifyContent:`space-between`,alignItems:`center`,mb:1},children:[_?(0,o.jsx)(u.default,{component:`legend`,children:_}):(0,o.jsx)(`span`,{}),(0,o.jsx)(d.default,{size:`small`,variant:`outlined`,onClick:()=>T(e=>!e),sx:{borderRadius:`10px`,textTransform:`none`},children:w?`Write`:`Preview`})]}),w?(0,o.jsx)(l.default,{"data-testid":`markdown-preview`,dangerouslySetInnerHTML:{__html:m(S)},sx:{minHeight:e=>e.spacing(v*3),p:2,borderRadius:`10px`,border:e=>`1px solid ${(0,a.alpha)(e.palette.text.primary,.12)}`,backgroundColor:e=>e.palette.background.paper,"& :first-of-type":{mt:0},"& :last-child":{mb:0}}}):(0,o.jsx)(s.default,{id:g||void 0,value:S,onChange:e=>{let t=e.target.value;C(t),h?.({id:g,value:t})},multiline:!0,minRows:v,fullWidth:!0,placeholder:`Write markdown…`,...x,sx:t.B(t.U,b),slotProps:{htmlInput:{"aria-label":_||`markdown editor`}}})]})}exports.default=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-5iZMYShA.js"),t=require("./ai-BFpA3uHx.js"),n=require("./validation-B7DPZ218.js"),r=require("./useSyncedState-DYNKkpDv.js");let i=require("react");i=e.n(i);let a=require("@mui/material/styles"),o=require("react/jsx-runtime"),s=require("@mui/material/Checkbox");s=e.n(s);let c=require("@mui/material/FormControl");c=e.n(c);let l=require("@mui/material/FormHelperText");l=e.n(l);let u=require("@mui/material/Radio");u=e.n(u);let d=require("@mui/material/FormLabel");d=e.n(d);let f=require("@mui/material/Table");f=e.n(f);let p=require("@mui/material/TableBody");p=e.n(p);let m=require("@mui/material/TableCell");m=e.n(m);let h=require("@mui/material/TableContainer");h=e.n(h);let g=require("@mui/material/TableHead");g=e.n(g);let _=require("@mui/material/TableRow");_=e.n(_);var v=e=>(e||[]).map(e=>typeof e==`string`?{id:e,label:e}:{id:String(e.id),label:e.label??String(e.id)}),y=e=>(e||[]).map(e=>typeof e==`string`?{value:e,label:e}:{value:String(e.value),label:e.label??String(e.value)});function b({attributes:e={},rules:b={},onChange:x,messages:S}){let{MuiAttributes:C={},id:w=``,rows:T=[],columns:E=[],multiple:D=!1,label:O=``}=e,k=i.default.useMemo(()=>v(T),[T]),A=i.default.useMemo(()=>y(E),[E]),[j,M]=r.n(()=>e.value||{},[e.value]),[N,P]=i.default.useState(!1),[F,I]=i.default.useState(``),L=n.r(b),R=e=>n.a(b,!k.every(t=>{let n=e[t.id];return D?Array.isArray(n)&&n.length>0:n!=null&&n!==``}),S),z=e=>{M(e);let t=R(e);P(!t.isValid),I(t.message),x?.({id:w,value:e,option:e})},B=(e,t)=>{z({...j,[e]:t})},V=(e,t,n)=>{let r=Array.isArray(j[e])?j[e]:[],i=n?[...r,t]:r.filter(e=>e!==t);z({...j,[e]:i})},H=(e,t)=>{let n=j[e];return D?Array.isArray(n)&&n.includes(t):n===t},{sx:U,...W}=C;return(0,o.jsxs)(c.default,{required:L,error:N,component:`fieldset`,fullWidth:!0,children:[O&&(0,o.jsx)(d.default,{required:L,error:N,sx:{mb:1,fontWeight:600},children:O}),(0,o.jsx)(h.default,{sx:t.B(t.W,{width:`100%`}),children:(0,o.jsxs)(f.default,{size:`small`,...W,sx:U,children:[(0,o.jsx)(g.default,{children:(0,o.jsxs)(_.default,{sx:e=>({backgroundColor:(0,a.alpha)(e.palette.primary.main,.06)}),children:[(0,o.jsx)(m.default,{sx:{fontWeight:700}}),A.map(e=>(0,o.jsx)(m.default,{align:`center`,sx:{fontWeight:700},children:e.label},e.value))]})}),(0,o.jsx)(p.default,{children:k.map(e=>(0,o.jsxs)(_.default,{hover:!0,sx:e=>({transition:`background-color .18s cubic-bezier(0.4, 0, 0.2, 1)`,"&:hover":{backgroundColor:(0,a.alpha)(e.palette.primary.main,.04)}}),children:[(0,o.jsx)(m.default,{component:`th`,scope:`row`,sx:{fontWeight:500},children:e.label}),A.map(t=>(0,o.jsx)(m.default,{align:`center`,padding:`checkbox`,children:D?(0,o.jsx)(s.default,{checked:H(e.id,t.value),onChange:n=>V(e.id,t.value,n.target.checked),slotProps:{input:{"aria-label":`${e.label} ${t.label}`}}}):(0,o.jsx)(u.default,{name:`matrix-${w}-${e.id}`,checked:H(e.id,t.value),onChange:()=>B(e.id,t.value),slotProps:{input:{"aria-label":`${e.label} ${t.label}`}}})},t.value))]},e.id))})]})}),F&&(0,o.jsx)(l.default,{children:F})]})}exports.default=b;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { a as e, r as t } from "./validation-BRcYhhsT.mjs";
|
|
2
|
+
import { B as n, W as r } from "./ai-UvDYQ30b.mjs";
|
|
3
|
+
import { n as i } from "./useSyncedState-CzAO4D1o.mjs";
|
|
4
|
+
import a from "react";
|
|
5
|
+
import { alpha as o } from "@mui/material/styles";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import l from "@mui/material/Checkbox";
|
|
8
|
+
import u from "@mui/material/FormControl";
|
|
9
|
+
import d from "@mui/material/FormHelperText";
|
|
10
|
+
import f from "@mui/material/Radio";
|
|
11
|
+
import p from "@mui/material/FormLabel";
|
|
12
|
+
import m from "@mui/material/Table";
|
|
13
|
+
import h from "@mui/material/TableBody";
|
|
14
|
+
import g from "@mui/material/TableCell";
|
|
15
|
+
import _ from "@mui/material/TableContainer";
|
|
16
|
+
import v from "@mui/material/TableHead";
|
|
17
|
+
import y from "@mui/material/TableRow";
|
|
18
|
+
// src/components/controls/MatrixField/matrixfield.tsx
|
|
19
|
+
var b = (e) => (e || []).map((e) => typeof e == "string" ? {
|
|
20
|
+
id: e,
|
|
21
|
+
label: e
|
|
22
|
+
} : {
|
|
23
|
+
id: String(e.id),
|
|
24
|
+
label: e.label ?? String(e.id)
|
|
25
|
+
}), x = (e) => (e || []).map((e) => typeof e == "string" ? {
|
|
26
|
+
value: e,
|
|
27
|
+
label: e
|
|
28
|
+
} : {
|
|
29
|
+
value: String(e.value),
|
|
30
|
+
label: e.label ?? String(e.value)
|
|
31
|
+
});
|
|
32
|
+
function S({ attributes: S = {}, rules: C = {}, onChange: w, messages: T }) {
|
|
33
|
+
let { MuiAttributes: E = {}, id: D = "", rows: O = [], columns: k = [], multiple: A = !1, label: j = "" } = S, M = a.useMemo(() => b(O), [O]), N = a.useMemo(() => x(k), [k]), [P, F] = i(() => S.value || {}, [S.value]), [I, L] = a.useState(!1), [R, z] = a.useState(""), B = t(C), V = (t) => e(C, !M.every((e) => {
|
|
34
|
+
let n = t[e.id];
|
|
35
|
+
return A ? Array.isArray(n) && n.length > 0 : n != null && n !== "";
|
|
36
|
+
}), T), H = (e) => {
|
|
37
|
+
F(e);
|
|
38
|
+
let t = V(e);
|
|
39
|
+
L(!t.isValid), z(t.message), w?.({
|
|
40
|
+
id: D,
|
|
41
|
+
value: e,
|
|
42
|
+
option: e
|
|
43
|
+
});
|
|
44
|
+
}, U = (e, t) => {
|
|
45
|
+
H({
|
|
46
|
+
...P,
|
|
47
|
+
[e]: t
|
|
48
|
+
});
|
|
49
|
+
}, W = (e, t, n) => {
|
|
50
|
+
let r = Array.isArray(P[e]) ? P[e] : [], i = n ? [...r, t] : r.filter((e) => e !== t);
|
|
51
|
+
H({
|
|
52
|
+
...P,
|
|
53
|
+
[e]: i
|
|
54
|
+
});
|
|
55
|
+
}, G = (e, t) => {
|
|
56
|
+
let n = P[e];
|
|
57
|
+
return A ? Array.isArray(n) && n.includes(t) : n === t;
|
|
58
|
+
}, { sx: K, ...q } = E;
|
|
59
|
+
return /* @__PURE__ */ c(u, {
|
|
60
|
+
required: B,
|
|
61
|
+
error: I,
|
|
62
|
+
component: "fieldset",
|
|
63
|
+
fullWidth: !0,
|
|
64
|
+
children: [
|
|
65
|
+
j && /* @__PURE__ */ s(p, {
|
|
66
|
+
required: B,
|
|
67
|
+
error: I,
|
|
68
|
+
sx: {
|
|
69
|
+
mb: 1,
|
|
70
|
+
fontWeight: 600
|
|
71
|
+
},
|
|
72
|
+
children: j
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ s(_, {
|
|
75
|
+
sx: n(r, { width: "100%" }),
|
|
76
|
+
children: /* @__PURE__ */ c(m, {
|
|
77
|
+
size: "small",
|
|
78
|
+
...q,
|
|
79
|
+
sx: K,
|
|
80
|
+
children: [/* @__PURE__ */ s(v, { children: /* @__PURE__ */ c(y, {
|
|
81
|
+
sx: (e) => ({ backgroundColor: o(e.palette.primary.main, .06) }),
|
|
82
|
+
children: [/* @__PURE__ */ s(g, { sx: { fontWeight: 700 } }), N.map((e) => /* @__PURE__ */ s(g, {
|
|
83
|
+
align: "center",
|
|
84
|
+
sx: { fontWeight: 700 },
|
|
85
|
+
children: e.label
|
|
86
|
+
}, e.value))]
|
|
87
|
+
}) }), /* @__PURE__ */ s(h, { children: M.map((e) => /* @__PURE__ */ c(y, {
|
|
88
|
+
hover: !0,
|
|
89
|
+
sx: (e) => ({
|
|
90
|
+
transition: "background-color .18s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
91
|
+
"&:hover": { backgroundColor: o(e.palette.primary.main, .04) }
|
|
92
|
+
}),
|
|
93
|
+
children: [/* @__PURE__ */ s(g, {
|
|
94
|
+
component: "th",
|
|
95
|
+
scope: "row",
|
|
96
|
+
sx: { fontWeight: 500 },
|
|
97
|
+
children: e.label
|
|
98
|
+
}), N.map((t) => /* @__PURE__ */ s(g, {
|
|
99
|
+
align: "center",
|
|
100
|
+
padding: "checkbox",
|
|
101
|
+
children: A ? /* @__PURE__ */ s(l, {
|
|
102
|
+
checked: G(e.id, t.value),
|
|
103
|
+
onChange: (n) => W(e.id, t.value, n.target.checked),
|
|
104
|
+
slotProps: { input: { "aria-label": `${e.label} ${t.label}` } }
|
|
105
|
+
}) : /* @__PURE__ */ s(f, {
|
|
106
|
+
name: `matrix-${D}-${e.id}`,
|
|
107
|
+
checked: G(e.id, t.value),
|
|
108
|
+
onChange: () => U(e.id, t.value),
|
|
109
|
+
slotProps: { input: { "aria-label": `${e.label} ${t.label}` } }
|
|
110
|
+
})
|
|
111
|
+
}, t.value))]
|
|
112
|
+
}, e.id)) })]
|
|
113
|
+
})
|
|
114
|
+
}),
|
|
115
|
+
R && /* @__PURE__ */ s(d, { children: R })
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
export { S as default };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { t as e } from "./chartControl-IQafKpDk.mjs";
|
|
2
|
+
import t, { Suspense as n } from "react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import a from "@mui/material/Box";
|
|
5
|
+
// src/components/charts/Mixchart/mixChart.tsx
|
|
6
|
+
var o = t.lazy(async () => {
|
|
7
|
+
let [{ ChartsContainer: e }, { LinePlot: t }, { BarPlot: n }, { ChartsXAxis: a }, { ChartsYAxis: o }, { axisClasses: s }] = await Promise.all([
|
|
8
|
+
import("@mui/x-charts/ChartsContainer"),
|
|
9
|
+
import("@mui/x-charts/LineChart"),
|
|
10
|
+
import("@mui/x-charts/BarChart"),
|
|
11
|
+
import("@mui/x-charts/ChartsXAxis"),
|
|
12
|
+
import("@mui/x-charts/ChartsYAxis"),
|
|
13
|
+
import("@mui/x-charts/ChartsAxis")
|
|
14
|
+
]);
|
|
15
|
+
return { default: ({ MuiChartContainerAttributes: c = {}, MuiChartXAxisAttributes: l = {}, MuiChartYAxisAttributes: u = {}, MuiChartSX: d = {} }) => /* @__PURE__ */ i(e, {
|
|
16
|
+
sx: {
|
|
17
|
+
[`.${s.left} .${s.label}`]: { transform: "translate(-25px, 0)" },
|
|
18
|
+
[`.${s.right} .${s.label}`]: { transform: "translate(30px, 0)" },
|
|
19
|
+
...d
|
|
20
|
+
},
|
|
21
|
+
...c,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ r(n, {}),
|
|
24
|
+
/* @__PURE__ */ r(t, {}),
|
|
25
|
+
/* @__PURE__ */ r(a, { ...l }),
|
|
26
|
+
/* @__PURE__ */ r(o, { ...u })
|
|
27
|
+
]
|
|
28
|
+
}) };
|
|
29
|
+
});
|
|
30
|
+
function s({ attributes: t = {} }) {
|
|
31
|
+
let { id: i, MuiBoxAttributes: s = {}, MuiChartContainerAttributes: c = {}, MuiChartXAxisAttributes: l = {}, MuiChartYAxisAttributes: u = {}, MuiChartSX: d = {} } = t;
|
|
32
|
+
return /* @__PURE__ */ r(a, {
|
|
33
|
+
sx: {
|
|
34
|
+
width: "100%",
|
|
35
|
+
maxWidth: 600
|
|
36
|
+
},
|
|
37
|
+
...s,
|
|
38
|
+
children: /* @__PURE__ */ r(n, {
|
|
39
|
+
fallback: e,
|
|
40
|
+
children: /* @__PURE__ */ r(o, {
|
|
41
|
+
MuiChartContainerAttributes: c,
|
|
42
|
+
MuiChartXAxisAttributes: l,
|
|
43
|
+
MuiChartYAxisAttributes: u,
|
|
44
|
+
MuiChartSX: d
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
}, i);
|
|
48
|
+
}
|
|
49
|
+
export { s as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-5iZMYShA.js"),t=require("./chartControl-ifHiG3nr.js");let n=require("react");n=e.n(n);let r=require("react/jsx-runtime"),i=require("@mui/material/Box");i=e.n(i);var a=n.default.lazy(async()=>{let[{ChartsContainer:e},{LinePlot:t},{BarPlot:n},{ChartsXAxis:i},{ChartsYAxis:a},{axisClasses:o}]=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:s={},MuiChartXAxisAttributes:c={},MuiChartYAxisAttributes:l={},MuiChartSX:u={}})=>(0,r.jsxs)(e,{sx:{[`.${o.left} .${o.label}`]:{transform:`translate(-25px, 0)`},[`.${o.right} .${o.label}`]:{transform:`translate(30px, 0)`},...u},...s,children:[(0,r.jsx)(n,{}),(0,r.jsx)(t,{}),(0,r.jsx)(i,{...c}),(0,r.jsx)(a,{...l})]})}});function o({attributes:e={}}){let{id:o,MuiBoxAttributes:s={},MuiChartContainerAttributes:c={},MuiChartXAxisAttributes:l={},MuiChartYAxisAttributes:u={},MuiChartSX:d={}}=e;return(0,r.jsx)(i.default,{sx:{width:`100%`,maxWidth:600},...s,children:(0,r.jsx)(n.Suspense,{fallback:t.t,children:(0,r.jsx)(a,{MuiChartContainerAttributes:c,MuiChartXAxisAttributes:l,MuiChartYAxisAttributes:u,MuiChartSX:d})})},o)}exports.default=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={};function t(t){t&&typeof t==`object`&&Object.assign(e,t)}function n(t){return e[t]}function r(){Object.keys(e).forEach(t=>delete e[t])}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./ai-BFpA3uHx.js"),t=require("./validation-B7DPZ218.js"),n=require("./useUpdateEffect-CNBo9hj8.js");let r=require("react"),i=require("@mui/material"),a=require("react/jsx-runtime");function o({attributes:o={},rules:s={},onChange:c,submitTick:l,messages:u}){let{id:d=``}=o,f=u?.required||`Required`,p=(0,r.useRef)(null),[m,h]=(0,r.useState)(()=>{if(o.value&&typeof o.value==`object`){let e=Object.entries(o.value).map(([e,t])=>({key:e,value:String(t)}));if(e.length>0)return e}return[{key:`t1`,value:``}]}),g=t.r(s);n.t(()=>{l&&g&&!m[0]?.value&&p.current?.focus()},[l]),n.t(()=>{if(o.value&&typeof o.value==`object`){let e=Object.entries(o.value).map(([e,t])=>({key:e,value:String(t)}));JSON.stringify(e)!==JSON.stringify(m)&&h(e.length>0?e:[{key:`t1`,value:``}])}else o.value||h([{key:`t1`,value:``}])},[o.value]),(0,r.useEffect)(()=>{let e=m.reduce((e,t)=>(e[t.key]=t.value,e),{});c&&c({id:d,value:e})},[m,d]);let _=()=>{let e=m.length+1;h([...m,{key:`t${e}`,value:``}])},v=e=>{let t=m.filter((t,n)=>n!==e);h(t)},y=(e,t)=>{let n=[...m];n[e].value=t,h(n)};return(0,a.jsx)(i.Stack,{spacing:2,sx:{width:`100%`},children:m.map((t,n)=>(0,a.jsxs)(i.Box,{sx:{display:`flex`,gap:1,alignItems:`center`},children:[(0,a.jsx)(i.TextField,{fullWidth:!0,id:n===0?d:`${d}_${t.key}`,inputRef:n===0?p:void 0,required:g,error:g&&!t.value,helperText:g&&!t.value?f:``,label:`Value ${t.key}`,value:t.value,onChange:e=>y(n,e.target.value),size:`small`,sx:e.U}),n===m.length-1?(0,a.jsx)(i.Button,{variant:`contained`,color:`primary`,onClick:_,sx:{minWidth:`40px`,p:1},children:(0,a.jsx)(i.Icon,{children:`add`})}):(0,a.jsx)(i.IconButton,{color:`error`,onClick:()=>v(n),children:(0,a.jsx)(i.Icon,{children:`remove`})})]},n))})}exports.default=o;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { r as e } from "./validation-BRcYhhsT.mjs";
|
|
2
|
+
import { U as t } from "./ai-UvDYQ30b.mjs";
|
|
3
|
+
import { t as n } from "./useUpdateEffect-CXAhttj7.mjs";
|
|
4
|
+
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
5
|
+
import { Box as o, Button as s, Icon as c, IconButton as l, Stack as u, TextField as d } from "@mui/material";
|
|
6
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
+
// src/components/controls/MultiTextbox/multitextbox.tsx
|
|
8
|
+
function m({ attributes: m = {}, rules: h = {}, onChange: g, submitTick: _, messages: v }) {
|
|
9
|
+
let { id: y = "" } = m, b = v?.required || "Required", x = i(null), [S, C] = a(() => {
|
|
10
|
+
if (m.value && typeof m.value == "object") {
|
|
11
|
+
let e = Object.entries(m.value).map(([e, t]) => ({
|
|
12
|
+
key: e,
|
|
13
|
+
value: String(t)
|
|
14
|
+
}));
|
|
15
|
+
if (e.length > 0) return e;
|
|
16
|
+
}
|
|
17
|
+
return [{
|
|
18
|
+
key: "t1",
|
|
19
|
+
value: ""
|
|
20
|
+
}];
|
|
21
|
+
}), w = e(h);
|
|
22
|
+
n(() => {
|
|
23
|
+
_ && w && !S[0]?.value && x.current?.focus();
|
|
24
|
+
}, [_]), n(() => {
|
|
25
|
+
if (m.value && typeof m.value == "object") {
|
|
26
|
+
let e = Object.entries(m.value).map(([e, t]) => ({
|
|
27
|
+
key: e,
|
|
28
|
+
value: String(t)
|
|
29
|
+
}));
|
|
30
|
+
JSON.stringify(e) !== JSON.stringify(S) && C(e.length > 0 ? e : [{
|
|
31
|
+
key: "t1",
|
|
32
|
+
value: ""
|
|
33
|
+
}]);
|
|
34
|
+
} else m.value || C([{
|
|
35
|
+
key: "t1",
|
|
36
|
+
value: ""
|
|
37
|
+
}]);
|
|
38
|
+
}, [m.value]), r(() => {
|
|
39
|
+
let e = S.reduce((e, t) => (e[t.key] = t.value, e), {});
|
|
40
|
+
g && g({
|
|
41
|
+
id: y,
|
|
42
|
+
value: e
|
|
43
|
+
});
|
|
44
|
+
}, [S, y]);
|
|
45
|
+
let T = () => {
|
|
46
|
+
let e = S.length + 1;
|
|
47
|
+
C([...S, {
|
|
48
|
+
key: `t${e}`,
|
|
49
|
+
value: ""
|
|
50
|
+
}]);
|
|
51
|
+
}, E = (e) => {
|
|
52
|
+
let t = S.filter((t, n) => n !== e);
|
|
53
|
+
C(t);
|
|
54
|
+
}, D = (e, t) => {
|
|
55
|
+
let n = [...S];
|
|
56
|
+
n[e].value = t, C(n);
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ f(u, {
|
|
59
|
+
spacing: 2,
|
|
60
|
+
sx: { width: "100%" },
|
|
61
|
+
children: S.map((e, n) => /* @__PURE__ */ p(o, {
|
|
62
|
+
sx: {
|
|
63
|
+
display: "flex",
|
|
64
|
+
gap: 1,
|
|
65
|
+
alignItems: "center"
|
|
66
|
+
},
|
|
67
|
+
children: [/* @__PURE__ */ f(d, {
|
|
68
|
+
fullWidth: !0,
|
|
69
|
+
id: n === 0 ? y : `${y}_${e.key}`,
|
|
70
|
+
inputRef: n === 0 ? x : void 0,
|
|
71
|
+
required: w,
|
|
72
|
+
error: w && !e.value,
|
|
73
|
+
helperText: w && !e.value ? b : "",
|
|
74
|
+
label: `Value ${e.key}`,
|
|
75
|
+
value: e.value,
|
|
76
|
+
onChange: (e) => D(n, e.target.value),
|
|
77
|
+
size: "small",
|
|
78
|
+
sx: t
|
|
79
|
+
}), n === S.length - 1 ? /* @__PURE__ */ f(s, {
|
|
80
|
+
variant: "contained",
|
|
81
|
+
color: "primary",
|
|
82
|
+
onClick: T,
|
|
83
|
+
sx: {
|
|
84
|
+
minWidth: "40px",
|
|
85
|
+
p: 1
|
|
86
|
+
},
|
|
87
|
+
children: /* @__PURE__ */ f(c, { children: "add" })
|
|
88
|
+
}) : /* @__PURE__ */ f(l, {
|
|
89
|
+
color: "error",
|
|
90
|
+
onClick: () => E(n),
|
|
91
|
+
children: /* @__PURE__ */ f(c, { children: "remove" })
|
|
92
|
+
})]
|
|
93
|
+
}, n))
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
export { m as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-5iZMYShA.js"),t=require("./ai-BFpA3uHx.js"),n=require("./validation-B7DPZ218.js"),r=require("./useUpdateEffect-CNBo9hj8.js"),i=require("./useSyncedState-DYNKkpDv.js");let a=require("react");a=e.n(a);let o=require("@mui/material/styles"),s=require("@mui/material/Typography");s=e.n(s);let c=require("react/jsx-runtime"),l=require("@mui/material/FormControl");l=e.n(l);let u=require("@mui/material/FormHelperText");u=e.n(u);let d=require("@mui/material/Box");d=e.n(d);let f=require("@mui/material/FormLabel");f=e.n(f);let p=require("@mui/material/Button");p=e.n(p);function m({attributes:e={},rules:m={},onChange:h,submitTick:g,messages:_}){let{id:v=``,label:y,min:b=0,max:x=10,lowLabel:S=`Not likely`,highLabel:C=`Very likely`,MuiAttributes:w={}}=e,[T,E]=i.n(()=>typeof e.value==`number`?e.value:``,[e.value]),[D,O]=a.default.useState(!1),[k,A]=a.default.useState(``),j=n.r(m),M=e=>n.a(m,typeof e!=`number`,_);r.t(()=>{if(g){let e=M(T);O(!e.isValid),A(e.message)}},[g]);let N=e=>{E(e);let t=M(e);O(!t.isValid),A(t.message),h?.({id:v,value:e})},P=[];for(let e=b;e<=x;e+=1)P.push(e);return(0,c.jsxs)(l.default,{id:v,required:j,error:D,component:`fieldset`,sx:{width:`100%`},children:[y&&(0,c.jsx)(f.default,{sx:{mb:1,fontWeight:500},component:`legend`,children:y}),(0,c.jsx)(d.default,{role:`radiogroup`,"aria-label":y||`nps scale`,sx:{display:`flex`,flexWrap:`wrap`,gap:.75},children:P.map(e=>{let n=T===e;return(0,c.jsx)(p.default,{role:`radio`,"aria-checked":n,variant:n?`contained`:`outlined`,color:`primary`,onClick:()=>N(e),...w,sx:e=>({minWidth:44,height:44,px:0,fontWeight:600,borderRadius:`10px`,transition:`transform .18s ${t.z}, box-shadow .18s ${t.z}, background-color .18s ${t.z}`,...n?{boxShadow:`0 4px 12px ${(0,o.alpha)(e.palette.primary.main,.35)}`}:{borderColor:(0,o.alpha)(e.palette.text.primary,.2),"&:hover":{borderColor:e.palette.primary.main,backgroundColor:(0,o.alpha)(e.palette.primary.main,.06)}},"&:hover":{transform:`translateY(-1px)`,...n?{boxShadow:`0 6px 16px ${(0,o.alpha)(e.palette.primary.main,.4)}`}:{borderColor:e.palette.primary.main,backgroundColor:(0,o.alpha)(e.palette.primary.main,.06)}},...w.sx||{}}),children:e},e)})}),(0,c.jsxs)(d.default,{sx:{display:`flex`,justifyContent:`space-between`,mt:.75},children:[(0,c.jsx)(s.default,{variant:`caption`,sx:{color:`text.secondary`},children:S}),(0,c.jsx)(s.default,{variant:`caption`,sx:{color:`text.secondary`},children:C})]}),k&&(0,c.jsx)(u.default,{children:k})]})}exports.default=m;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { a as e, r as t } from "./validation-BRcYhhsT.mjs";
|
|
2
|
+
import { z as n } from "./ai-UvDYQ30b.mjs";
|
|
3
|
+
import { t as r } from "./useUpdateEffect-CXAhttj7.mjs";
|
|
4
|
+
import { n as i } from "./useSyncedState-CzAO4D1o.mjs";
|
|
5
|
+
import a from "react";
|
|
6
|
+
import { alpha as o } from "@mui/material/styles";
|
|
7
|
+
import s from "@mui/material/Typography";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
import u from "@mui/material/FormControl";
|
|
10
|
+
import d from "@mui/material/FormHelperText";
|
|
11
|
+
import f from "@mui/material/Box";
|
|
12
|
+
import p from "@mui/material/FormLabel";
|
|
13
|
+
import m from "@mui/material/Button";
|
|
14
|
+
// src/components/controls/NpsScale/npsscale.tsx
|
|
15
|
+
function h({ attributes: h = {}, rules: g = {}, onChange: _, submitTick: v, messages: y }) {
|
|
16
|
+
let { id: b = "", label: x, min: S = 0, max: C = 10, lowLabel: w = "Not likely", highLabel: T = "Very likely", MuiAttributes: E = {} } = h, [D, O] = i(() => typeof h.value == "number" ? h.value : "", [h.value]), [k, A] = a.useState(!1), [j, M] = a.useState(""), N = t(g), P = (t) => e(g, typeof t != "number", y);
|
|
17
|
+
r(() => {
|
|
18
|
+
if (v) {
|
|
19
|
+
let e = P(D);
|
|
20
|
+
A(!e.isValid), M(e.message);
|
|
21
|
+
}
|
|
22
|
+
}, [v]);
|
|
23
|
+
let F = (e) => {
|
|
24
|
+
O(e);
|
|
25
|
+
let t = P(e);
|
|
26
|
+
A(!t.isValid), M(t.message), _?.({
|
|
27
|
+
id: b,
|
|
28
|
+
value: e
|
|
29
|
+
});
|
|
30
|
+
}, I = [];
|
|
31
|
+
for (let e = S; e <= C; e += 1) I.push(e);
|
|
32
|
+
return /* @__PURE__ */ l(u, {
|
|
33
|
+
id: b,
|
|
34
|
+
required: N,
|
|
35
|
+
error: k,
|
|
36
|
+
component: "fieldset",
|
|
37
|
+
sx: { width: "100%" },
|
|
38
|
+
children: [
|
|
39
|
+
x && /* @__PURE__ */ c(p, {
|
|
40
|
+
sx: {
|
|
41
|
+
mb: 1,
|
|
42
|
+
fontWeight: 500
|
|
43
|
+
},
|
|
44
|
+
component: "legend",
|
|
45
|
+
children: x
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ c(f, {
|
|
48
|
+
role: "radiogroup",
|
|
49
|
+
"aria-label": x || "nps scale",
|
|
50
|
+
sx: {
|
|
51
|
+
display: "flex",
|
|
52
|
+
flexWrap: "wrap",
|
|
53
|
+
gap: .75
|
|
54
|
+
},
|
|
55
|
+
children: I.map((e) => {
|
|
56
|
+
let t = D === e;
|
|
57
|
+
return /* @__PURE__ */ c(m, {
|
|
58
|
+
role: "radio",
|
|
59
|
+
"aria-checked": t,
|
|
60
|
+
variant: t ? "contained" : "outlined",
|
|
61
|
+
color: "primary",
|
|
62
|
+
onClick: () => F(e),
|
|
63
|
+
...E,
|
|
64
|
+
sx: (e) => ({
|
|
65
|
+
minWidth: 44,
|
|
66
|
+
height: 44,
|
|
67
|
+
px: 0,
|
|
68
|
+
fontWeight: 600,
|
|
69
|
+
borderRadius: "10px",
|
|
70
|
+
transition: `transform .18s ${n}, box-shadow .18s ${n}, background-color .18s ${n}`,
|
|
71
|
+
...t ? { boxShadow: `0 4px 12px ${o(e.palette.primary.main, .35)}` } : {
|
|
72
|
+
borderColor: o(e.palette.text.primary, .2),
|
|
73
|
+
"&:hover": {
|
|
74
|
+
borderColor: e.palette.primary.main,
|
|
75
|
+
backgroundColor: o(e.palette.primary.main, .06)
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"&:hover": {
|
|
79
|
+
transform: "translateY(-1px)",
|
|
80
|
+
...t ? { boxShadow: `0 6px 16px ${o(e.palette.primary.main, .4)}` } : {
|
|
81
|
+
borderColor: e.palette.primary.main,
|
|
82
|
+
backgroundColor: o(e.palette.primary.main, .06)
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
...E.sx || {}
|
|
86
|
+
}),
|
|
87
|
+
children: e
|
|
88
|
+
}, e);
|
|
89
|
+
})
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ l(f, {
|
|
92
|
+
sx: {
|
|
93
|
+
display: "flex",
|
|
94
|
+
justifyContent: "space-between",
|
|
95
|
+
mt: .75
|
|
96
|
+
},
|
|
97
|
+
children: [/* @__PURE__ */ c(s, {
|
|
98
|
+
variant: "caption",
|
|
99
|
+
sx: { color: "text.secondary" },
|
|
100
|
+
children: w
|
|
101
|
+
}), /* @__PURE__ */ c(s, {
|
|
102
|
+
variant: "caption",
|
|
103
|
+
sx: { color: "text.secondary" },
|
|
104
|
+
children: T
|
|
105
|
+
})]
|
|
106
|
+
}),
|
|
107
|
+
j && /* @__PURE__ */ c(d, { children: j })
|
|
108
|
+
]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
export { h as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-5iZMYShA.js"),t=require("./ai-BFpA3uHx.js"),n=require("./validation-B7DPZ218.js"),r=require("./useSyncedState-DYNKkpDv.js");let i=require("@mui/material/styles"),a=require("react/jsx-runtime"),o=require("@mui/material/FormControl");o=e.n(o);let s=require("@mui/material/FormHelperText");s=e.n(s);let c=require("@mui/material/FormLabel");c=e.n(c);let l=require("@mui/material/Stack");l=e.n(l);let u=require("@mui/material/IconButton");u=e.n(u);let d=require("@mui/icons-material/Add");d=e.n(d);let f=require("@mui/material/InputBase");f=e.n(f);let p=require("@mui/icons-material/Remove");p=e.n(p);var m=(e,t=0)=>{let n=Number(e);return Number.isFinite(n)?n:t};function h({attributes:e={},rules:h={},onChange:g}){let{MuiAttributes:_={},id:v=``,min:y,max:b,step:x=1,label:S}=e,{sx:C,...w}=_,T=y!=null,E=b!=null,D=e=>{let t=e;return T&&(t=Math.max(t,m(y))),E&&(t=Math.min(t,m(b))),t},[O,k]=r.n(()=>D(m(e.value,0)),[e.value]),[A,j]=r.n(()=>String(D(m(e.value,0))),[e.value]),M=n.r(h),N=e=>{let t=D(e);k(t),j(String(t)),g?.({id:v,value:t})},P=T&&O<=m(y),F=E&&O>=m(b),I=()=>{P||N(O-m(x,1))},L=()=>{F||N(O+m(x,1))},R=()=>{N(m(A,O))},z={borderRadius:0,px:1.25,color:`text.primary`,transition:`background-color .18s`,"&:hover":e=>({backgroundColor:(0,i.alpha)(e.palette.primary.main,.08)}),"&.Mui-disabled":{color:`text.disabled`}};return(0,a.jsxs)(o.default,{component:`fieldset`,error:!1,children:[S&&(0,a.jsx)(c.default,{component:`legend`,required:M,sx:{mb:1},children:S}),(0,a.jsxs)(l.default,{direction:`row`,sx:t.B(e=>({alignItems:`center`,display:`inline-flex`,width:`fit-content`,borderRadius:`10px`,overflow:`hidden`,border:`1px solid ${(0,i.alpha)(e.palette.text.primary,.16)}`,backgroundColor:e.palette.background.paper,transition:`box-shadow .2s, border-color .2s`,"&:hover":{borderColor:(0,i.alpha)(e.palette.primary.main,.5)},"&:focus-within":{borderColor:e.palette.primary.main,boxShadow:`0 0 0 3px ${(0,i.alpha)(e.palette.primary.main,.16)}`}}),C),children:[(0,a.jsx)(u.default,{"aria-label":`decrement`,onClick:I,disabled:P,size:`small`,sx:z,children:(0,a.jsx)(p.default,{fontSize:`small`})}),(0,a.jsx)(f.default,{...w,value:A,inputProps:{"aria-label":S||v||`value`,inputMode:`numeric`,style:{textAlign:`center`,width:56}},onChange:e=>j(e.target.value),onBlur:R,sx:{"& input":{py:.75}}}),(0,a.jsx)(u.default,{"aria-label":`increment`,onClick:L,disabled:F,size:`small`,sx:z,children:(0,a.jsx)(d.default,{fontSize:`small`})})]}),M&&(0,a.jsx)(s.default,{sx:{mx:0},children:``})]})}exports.default=h;
|