@loopr-ai/craft 0.7.0 → 0.7.2
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/Box-8cd400c2.js +58 -0
- package/dist/{ButtonBase-c303b1df.js → ButtonBase-fc1e48eb.js} +3 -3
- package/dist/{Grow-d188a215.js → Grow-a906cda2.js} +5 -5
- package/dist/{TextField-b13f5aff.js → TextField-a534df29.js} +7 -7
- package/dist/{TransitionGroupContext-7cd3ef83.js → TransitionGroupContext-ba502e63.js} +1 -1
- package/dist/{Typography-c0106ed0.js → Typography-65e5f8a8.js} +8 -8
- package/dist/{ZoomControllers-2e737c18.js → ZoomControllers-8a147df0.js} +1065 -1114
- package/dist/components/cell/AvatarGroup/index.js +3 -3
- package/dist/components/cell/Button/index.js +3 -3
- package/dist/components/cell/Chip/index.js +5 -5
- package/dist/components/cell/ProgressBar/index.js +3 -3
- package/dist/components/cell/Search/index.js +2 -2
- package/dist/components/cell/Typography/index.js +1 -1
- package/dist/components/organ/Form/FieldInput.js +115 -113
- package/dist/components/organ/Form/Form.interfaces.d.ts +2 -0
- package/dist/components/organ/Form/Form.styles.d.ts +2 -2
- package/dist/components/organ/Form/Form.styles.js +1 -1
- package/dist/components/organ/Form/Form.utils.d.ts +1 -0
- package/dist/components/organ/Form/Form.utils.js +20 -15
- package/dist/components/organ/Form/index.d.ts +3 -1
- package/dist/components/organ/Form/index.js +84 -72
- package/dist/components/organ/ZoomControlWithDrag/ZoomControllers.js +3 -2
- package/dist/components/organ/ZoomControlWithDrag/index.js +18 -17
- package/dist/{createSvgIcon-78477fc1.js → createSvgIcon-8e5d9dc7.js} +6 -6
- package/dist/{createSvgIcon-5180e4db.js → createSvgIcon-bb3d4825.js} +5 -5
- package/dist/{createTheme-54078d82.js → createTheme-ca1567c6.js} +4 -4
- package/dist/{dividerClasses-68f129df.js → dividerClasses-0233db5a.js} +2 -2
- package/dist/{exactProp-893ad662.js → exactProp-3d9df1ae.js} +1 -1
- package/dist/{extendSxProp-8c660b3a.js → extendSxProp-fc2654e5.js} +1 -1
- package/dist/global/theme.js +1 -1
- package/dist/providers/CraftThemeProvider.js +2 -2
- package/dist/{styled-2bc0b59e.js → styled-80b57810.js} +38 -38
- package/dist/{useTheme-e2efed29.js → useTheme-16446f25.js} +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as h, jsxs as G } from "react/jsx-runtime";
|
|
2
|
-
import { g as I, a as l, _ as k, P as a } from "../../../createTheme-
|
|
2
|
+
import { g as I, a as l, _ as k, P as a } from "../../../createTheme-ca1567c6.js";
|
|
3
3
|
import * as g from "react";
|
|
4
|
-
import { g as D,
|
|
5
|
-
import { c as q } from "../../../createSvgIcon-
|
|
4
|
+
import { g as D, a as M, b as E, c as R, e as U, h as F } from "../../../styled-80b57810.js";
|
|
5
|
+
import { c as q } from "../../../createSvgIcon-bb3d4825.js";
|
|
6
6
|
import { c as V } from "../../../chainPropTypes-004bf492.js";
|
|
7
7
|
const B = q(/* @__PURE__ */ h("path", {
|
|
8
8
|
d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as C, jsxs as F } from "react/jsx-runtime";
|
|
2
2
|
import { getColorToHex as v } from "../../../global/colors.js";
|
|
3
|
-
import { g as U,
|
|
3
|
+
import { g as U, b as e, a as t, f as b, _ as D, P as a } from "../../../createTheme-ca1567c6.js";
|
|
4
4
|
import * as p from "react";
|
|
5
|
-
import { g as H,
|
|
6
|
-
import { B as Q } from "../../../ButtonBase-
|
|
5
|
+
import { g as H, a as y, r as A, f as q, b as J, c as R, e as K } from "../../../styled-80b57810.js";
|
|
6
|
+
import { B as Q } from "../../../ButtonBase-fc1e48eb.js";
|
|
7
7
|
function X(o) {
|
|
8
8
|
return U("MuiButton", o);
|
|
9
9
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as m, jsxs as Q } from "react/jsx-runtime";
|
|
2
2
|
import * as v from "react";
|
|
3
3
|
import { useMemo as L } from "react";
|
|
4
|
-
import { g as X,
|
|
5
|
-
import { g as Z,
|
|
6
|
-
import { c as ao } from "../../../createSvgIcon-
|
|
7
|
-
import { u as lo } from "../../../TransitionGroupContext-
|
|
8
|
-
import { B as M } from "../../../ButtonBase-
|
|
4
|
+
import { g as X, b as r, a as f, f as b, _ as Y, P as l } from "../../../createTheme-ca1567c6.js";
|
|
5
|
+
import { g as Z, a as U, b as w, c as k, e as oo } from "../../../styled-80b57810.js";
|
|
6
|
+
import { c as ao } from "../../../createSvgIcon-bb3d4825.js";
|
|
7
|
+
import { u as lo } from "../../../TransitionGroupContext-ba502e63.js";
|
|
8
|
+
import { B as M } from "../../../ButtonBase-fc1e48eb.js";
|
|
9
9
|
import { u as eo } from "../../../unsupportedProp-3dbf01f6.js";
|
|
10
10
|
const ro = ao(/* @__PURE__ */ m("path", {
|
|
11
11
|
d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as j, jsx as v } from "react/jsx-runtime";
|
|
2
2
|
import { getColorToHex as $ } from "../../../global/colors.js";
|
|
3
|
-
import { g as D,
|
|
3
|
+
import { g as D, b as n, a as l, _ as q, P as o, l as E, e as U } from "../../../createTheme-ca1567c6.js";
|
|
4
4
|
import * as z from "react";
|
|
5
|
-
import { g as w,
|
|
6
|
-
import { u as V } from "../../../useTheme-
|
|
5
|
+
import { g as w, a as h, b as A, c as F, e as K } from "../../../styled-80b57810.js";
|
|
6
|
+
import { u as V } from "../../../useTheme-16446f25.js";
|
|
7
7
|
import { k as P, c as x } from "../../../emotion-react.browser.esm-ff33c213.js";
|
|
8
8
|
function S(r) {
|
|
9
9
|
return D("MuiLinearProgress", r);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import f, { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { r as c, i as p } from "../../../createSvgIcon-
|
|
3
|
-
import { T as m } from "../../../TextField-
|
|
2
|
+
import { r as c, i as p } from "../../../createSvgIcon-8e5d9dc7.js";
|
|
3
|
+
import { T as m } from "../../../TextField-a534df29.js";
|
|
4
4
|
var e = {}, v = p;
|
|
5
5
|
Object.defineProperty(e, "__esModule", {
|
|
6
6
|
value: !0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { getColorToHex as e } from "../../../global/colors.js";
|
|
3
3
|
import { fontCustomizations as i } from "../../../global/theme.js";
|
|
4
|
-
import { M as f } from "../../../Typography-
|
|
4
|
+
import { M as f } from "../../../Typography-65e5f8a8.js";
|
|
5
5
|
const c = ({
|
|
6
6
|
type: o = "bodyText",
|
|
7
7
|
textColor: r = "black",
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
1
|
+
import { jsx as c, jsxs as q, Fragment as H } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "react";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { u as
|
|
5
|
-
import { g as
|
|
6
|
-
import { g as T,
|
|
7
|
-
import { M as
|
|
8
|
-
import { B as
|
|
9
|
-
import { d as
|
|
10
|
-
import { a as
|
|
11
|
-
function
|
|
12
|
-
return
|
|
3
|
+
import { useState as J, useCallback as K, useEffect as Q } from "react";
|
|
4
|
+
import { u as X, F as Y, L as A, T as Z } from "../../../TextField-a534df29.js";
|
|
5
|
+
import { g as B, a as b, _ as U, P as t, b as P, f as M } from "../../../createTheme-ca1567c6.js";
|
|
6
|
+
import { g as T, a as z, b as _, c as F, e as D, r as ee } from "../../../styled-80b57810.js";
|
|
7
|
+
import { M as te } from "../../../Typography-65e5f8a8.js";
|
|
8
|
+
import { B as oe } from "../../../ButtonBase-fc1e48eb.js";
|
|
9
|
+
import { d as j } from "../../../dividerClasses-0233db5a.js";
|
|
10
|
+
import { a as se, u as ne } from "../../../TransitionGroupContext-ba502e63.js";
|
|
11
|
+
function ae(e) {
|
|
12
|
+
return B("MuiInputAdornment", e);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
var
|
|
16
|
-
const
|
|
14
|
+
const re = T("MuiInputAdornment", ["root", "filled", "standard", "outlined", "positionStart", "positionEnd", "disablePointerEvents", "hiddenLabel", "sizeSmall"]), R = re;
|
|
15
|
+
var k;
|
|
16
|
+
const ie = ["children", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"], le = (e, o) => {
|
|
17
17
|
const {
|
|
18
18
|
ownerState: s
|
|
19
19
|
} = e;
|
|
20
|
-
return [o.root, o[`position${
|
|
21
|
-
},
|
|
20
|
+
return [o.root, o[`position${P(s.position)}`], s.disablePointerEvents === !0 && o.disablePointerEvents, o[s.variant]];
|
|
21
|
+
}, ce = (e) => {
|
|
22
22
|
const {
|
|
23
23
|
classes: o,
|
|
24
24
|
disablePointerEvents: s,
|
|
@@ -27,17 +27,17 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
|
|
|
27
27
|
size: d,
|
|
28
28
|
variant: l
|
|
29
29
|
} = e, m = {
|
|
30
|
-
root: ["root", s && "disablePointerEvents", r && `position${
|
|
30
|
+
root: ["root", s && "disablePointerEvents", r && `position${P(r)}`, l, a && "hiddenLabel", d && `size${P(d)}`]
|
|
31
31
|
};
|
|
32
|
-
return
|
|
33
|
-
},
|
|
32
|
+
return D(m, ae, o);
|
|
33
|
+
}, de = z("div", {
|
|
34
34
|
name: "MuiInputAdornment",
|
|
35
35
|
slot: "Root",
|
|
36
|
-
overridesResolver:
|
|
36
|
+
overridesResolver: le
|
|
37
37
|
})(({
|
|
38
38
|
theme: e,
|
|
39
39
|
ownerState: o
|
|
40
|
-
}) =>
|
|
40
|
+
}) => b({
|
|
41
41
|
display: "flex",
|
|
42
42
|
height: "0.01em",
|
|
43
43
|
// Fix IE11 flexbox alignment. To remove at some point.
|
|
@@ -47,7 +47,7 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
|
|
|
47
47
|
color: (e.vars || e).palette.action.active
|
|
48
48
|
}, o.variant === "filled" && {
|
|
49
49
|
// Styles applied to the root element if `variant="filled"`.
|
|
50
|
-
[`&.${
|
|
50
|
+
[`&.${R.positionStart}&:not(.${R.hiddenLabel})`]: {
|
|
51
51
|
marginTop: 16
|
|
52
52
|
}
|
|
53
53
|
}, o.position === "start" && {
|
|
@@ -59,8 +59,8 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
|
|
|
59
59
|
}, o.disablePointerEvents === !0 && {
|
|
60
60
|
// Styles applied to the root element if `disablePointerEvents={true}`.
|
|
61
61
|
pointerEvents: "none"
|
|
62
|
-
})),
|
|
63
|
-
const a =
|
|
62
|
+
})), G = /* @__PURE__ */ x.forwardRef(function(o, s) {
|
|
63
|
+
const a = _({
|
|
64
64
|
props: o,
|
|
65
65
|
name: "MuiInputAdornment"
|
|
66
66
|
}), {
|
|
@@ -69,33 +69,33 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
|
|
|
69
69
|
component: l = "div",
|
|
70
70
|
disablePointerEvents: m = !1,
|
|
71
71
|
disableTypography: u = !1,
|
|
72
|
-
position:
|
|
72
|
+
position: I,
|
|
73
73
|
variant: f
|
|
74
|
-
} = a, p =
|
|
75
|
-
let
|
|
76
|
-
f && i.variant && process.env.NODE_ENV !== "production" && f === i.variant && console.error("MUI: The `InputAdornment` variant infers the variant prop you do not have to provide one."), i && !
|
|
77
|
-
const
|
|
74
|
+
} = a, p = U(a, ie), i = X() || {};
|
|
75
|
+
let v = f;
|
|
76
|
+
f && i.variant && process.env.NODE_ENV !== "production" && f === i.variant && console.error("MUI: The `InputAdornment` variant infers the variant prop you do not have to provide one."), i && !v && (v = i.variant);
|
|
77
|
+
const g = b({}, a, {
|
|
78
78
|
hiddenLabel: i.hiddenLabel,
|
|
79
79
|
size: i.size,
|
|
80
80
|
disablePointerEvents: m,
|
|
81
|
-
position:
|
|
82
|
-
variant:
|
|
83
|
-
}),
|
|
84
|
-
return /* @__PURE__ */ c(
|
|
81
|
+
position: I,
|
|
82
|
+
variant: v
|
|
83
|
+
}), C = ce(g);
|
|
84
|
+
return /* @__PURE__ */ c(Y.Provider, {
|
|
85
85
|
value: null,
|
|
86
|
-
children: /* @__PURE__ */ c(
|
|
86
|
+
children: /* @__PURE__ */ c(de, b({
|
|
87
87
|
as: l,
|
|
88
|
-
ownerState:
|
|
89
|
-
className:
|
|
88
|
+
ownerState: g,
|
|
89
|
+
className: F(C.root, d),
|
|
90
90
|
ref: s
|
|
91
91
|
}, p, {
|
|
92
|
-
children: typeof r == "string" && !u ? /* @__PURE__ */ c(
|
|
92
|
+
children: typeof r == "string" && !u ? /* @__PURE__ */ c(te, {
|
|
93
93
|
color: "text.secondary",
|
|
94
94
|
children: r
|
|
95
|
-
}) : /* @__PURE__ */
|
|
96
|
-
children: [
|
|
95
|
+
}) : /* @__PURE__ */ q(x.Fragment, {
|
|
96
|
+
children: [I === "start" ? (
|
|
97
97
|
/* notranslate needed while Google Translate will not fix zero-width space issue */
|
|
98
|
-
|
|
98
|
+
k || (k = /* @__PURE__ */ c("span", {
|
|
99
99
|
className: "notranslate",
|
|
100
100
|
children: ""
|
|
101
101
|
}))
|
|
@@ -104,7 +104,7 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
|
|
|
104
104
|
}))
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
|
-
process.env.NODE_ENV !== "production" && (
|
|
107
|
+
process.env.NODE_ENV !== "production" && (G.propTypes = {
|
|
108
108
|
// ----------------------------- Warning --------------------------------
|
|
109
109
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
110
110
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -152,16 +152,16 @@ process.env.NODE_ENV !== "production" && (D.propTypes = {
|
|
|
152
152
|
*/
|
|
153
153
|
variant: t.oneOf(["filled", "outlined", "standard"])
|
|
154
154
|
});
|
|
155
|
-
const
|
|
156
|
-
function
|
|
157
|
-
return
|
|
155
|
+
const V = G, pe = T("MuiListItemIcon", ["root", "alignItemsFlexStart"]), w = pe, ue = T("MuiListItemText", ["root", "multiline", "dense", "inset", "primary", "secondary"]), S = ue;
|
|
156
|
+
function me(e) {
|
|
157
|
+
return B("MuiMenuItem", e);
|
|
158
158
|
}
|
|
159
|
-
const
|
|
159
|
+
const fe = T("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divider", "gutters", "selected"]), h = fe, be = ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"], ve = (e, o) => {
|
|
160
160
|
const {
|
|
161
161
|
ownerState: s
|
|
162
162
|
} = e;
|
|
163
163
|
return [o.root, s.dense && o.dense, s.divider && o.divider, !s.disableGutters && o.gutters];
|
|
164
|
-
},
|
|
164
|
+
}, ge = (e) => {
|
|
165
165
|
const {
|
|
166
166
|
disabled: o,
|
|
167
167
|
dense: s,
|
|
@@ -169,19 +169,19 @@ const me = T("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divid
|
|
|
169
169
|
disableGutters: r,
|
|
170
170
|
selected: d,
|
|
171
171
|
classes: l
|
|
172
|
-
} = e, u =
|
|
172
|
+
} = e, u = D({
|
|
173
173
|
root: ["root", s && "dense", o && "disabled", !r && "gutters", a && "divider", d && "selected"]
|
|
174
|
-
},
|
|
175
|
-
return
|
|
176
|
-
},
|
|
177
|
-
shouldForwardProp: (e) =>
|
|
174
|
+
}, me, l);
|
|
175
|
+
return b({}, l, u);
|
|
176
|
+
}, ye = z(oe, {
|
|
177
|
+
shouldForwardProp: (e) => ee(e) || e === "classes",
|
|
178
178
|
name: "MuiMenuItem",
|
|
179
179
|
slot: "Root",
|
|
180
|
-
overridesResolver:
|
|
180
|
+
overridesResolver: ve
|
|
181
181
|
})(({
|
|
182
182
|
theme: e,
|
|
183
183
|
ownerState: o
|
|
184
|
-
}) =>
|
|
184
|
+
}) => b({}, e.typography.body1, {
|
|
185
185
|
display: "flex",
|
|
186
186
|
justifyContent: "flex-start",
|
|
187
187
|
alignItems: "center",
|
|
@@ -207,57 +207,57 @@ const me = T("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divid
|
|
|
207
207
|
backgroundColor: "transparent"
|
|
208
208
|
}
|
|
209
209
|
},
|
|
210
|
-
[`&.${
|
|
210
|
+
[`&.${h.selected}`]: {
|
|
211
211
|
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : M(e.palette.primary.main, e.palette.action.selectedOpacity),
|
|
212
|
-
[`&.${
|
|
212
|
+
[`&.${h.focusVisible}`]: {
|
|
213
213
|
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : M(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
|
|
214
214
|
}
|
|
215
215
|
},
|
|
216
|
-
[`&.${
|
|
216
|
+
[`&.${h.selected}:hover`]: {
|
|
217
217
|
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : M(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
|
|
218
218
|
// Reset on touch devices, it doesn't add specificity
|
|
219
219
|
"@media (hover: none)": {
|
|
220
220
|
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : M(e.palette.primary.main, e.palette.action.selectedOpacity)
|
|
221
221
|
}
|
|
222
222
|
},
|
|
223
|
-
[`&.${
|
|
223
|
+
[`&.${h.focusVisible}`]: {
|
|
224
224
|
backgroundColor: (e.vars || e).palette.action.focus
|
|
225
225
|
},
|
|
226
|
-
[`&.${
|
|
226
|
+
[`&.${h.disabled}`]: {
|
|
227
227
|
opacity: (e.vars || e).palette.action.disabledOpacity
|
|
228
228
|
},
|
|
229
|
-
[`& + .${
|
|
229
|
+
[`& + .${j.root}`]: {
|
|
230
230
|
marginTop: e.spacing(1),
|
|
231
231
|
marginBottom: e.spacing(1)
|
|
232
232
|
},
|
|
233
|
-
[`& + .${
|
|
233
|
+
[`& + .${j.inset}`]: {
|
|
234
234
|
marginLeft: 52
|
|
235
235
|
},
|
|
236
|
-
[`& .${
|
|
236
|
+
[`& .${S.root}`]: {
|
|
237
237
|
marginTop: 0,
|
|
238
238
|
marginBottom: 0
|
|
239
239
|
},
|
|
240
|
-
[`& .${
|
|
240
|
+
[`& .${S.inset}`]: {
|
|
241
241
|
paddingLeft: 36
|
|
242
242
|
},
|
|
243
|
-
[`& .${
|
|
243
|
+
[`& .${w.root}`]: {
|
|
244
244
|
minWidth: 36
|
|
245
245
|
}
|
|
246
246
|
}, !o.dense && {
|
|
247
247
|
[e.breakpoints.up("sm")]: {
|
|
248
248
|
minHeight: "auto"
|
|
249
249
|
}
|
|
250
|
-
}, o.dense &&
|
|
250
|
+
}, o.dense && b({
|
|
251
251
|
minHeight: 32,
|
|
252
252
|
// https://m2.material.io/components/menus#specs > Dense
|
|
253
253
|
paddingTop: 4,
|
|
254
254
|
paddingBottom: 4
|
|
255
255
|
}, e.typography.body2, {
|
|
256
|
-
[`& .${
|
|
256
|
+
[`& .${w.root} svg`]: {
|
|
257
257
|
fontSize: "1.25rem"
|
|
258
258
|
}
|
|
259
|
-
}))),
|
|
260
|
-
const a =
|
|
259
|
+
}))), W = /* @__PURE__ */ x.forwardRef(function(o, s) {
|
|
260
|
+
const a = _({
|
|
261
261
|
props: o,
|
|
262
262
|
name: "MuiMenuItem"
|
|
263
263
|
}), {
|
|
@@ -266,39 +266,39 @@ const me = T("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divid
|
|
|
266
266
|
dense: l = !1,
|
|
267
267
|
divider: m = !1,
|
|
268
268
|
disableGutters: u = !1,
|
|
269
|
-
focusVisibleClassName:
|
|
269
|
+
focusVisibleClassName: I,
|
|
270
270
|
role: f = "menuitem",
|
|
271
271
|
tabIndex: p,
|
|
272
272
|
className: i
|
|
273
|
-
} = a,
|
|
274
|
-
dense: l ||
|
|
273
|
+
} = a, v = U(a, be), g = x.useContext(A), C = x.useMemo(() => ({
|
|
274
|
+
dense: l || g.dense || !1,
|
|
275
275
|
disableGutters: u
|
|
276
|
-
}), [
|
|
277
|
-
|
|
278
|
-
r && (
|
|
276
|
+
}), [g.dense, l, u]), y = x.useRef(null);
|
|
277
|
+
se(() => {
|
|
278
|
+
r && (y.current ? y.current.focus() : process.env.NODE_ENV !== "production" && console.error("MUI: Unable to set focus to a MenuItem whose component has not been rendered."));
|
|
279
279
|
}, [r]);
|
|
280
|
-
const E =
|
|
281
|
-
dense:
|
|
280
|
+
const E = b({}, a, {
|
|
281
|
+
dense: C.dense,
|
|
282
282
|
divider: m,
|
|
283
283
|
disableGutters: u
|
|
284
|
-
}),
|
|
285
|
-
let
|
|
286
|
-
return a.disabled || (
|
|
287
|
-
value:
|
|
288
|
-
children: /* @__PURE__ */ c(
|
|
289
|
-
ref:
|
|
284
|
+
}), $ = ge(a), N = ne(y, s);
|
|
285
|
+
let n;
|
|
286
|
+
return a.disabled || (n = p !== void 0 ? p : -1), /* @__PURE__ */ c(A.Provider, {
|
|
287
|
+
value: C,
|
|
288
|
+
children: /* @__PURE__ */ c(ye, b({
|
|
289
|
+
ref: N,
|
|
290
290
|
role: f,
|
|
291
|
-
tabIndex:
|
|
291
|
+
tabIndex: n,
|
|
292
292
|
component: d,
|
|
293
|
-
focusVisibleClassName:
|
|
294
|
-
className:
|
|
295
|
-
},
|
|
293
|
+
focusVisibleClassName: F($.focusVisible, I),
|
|
294
|
+
className: F($.root, i)
|
|
295
|
+
}, v, {
|
|
296
296
|
ownerState: E,
|
|
297
|
-
classes:
|
|
297
|
+
classes: $
|
|
298
298
|
}))
|
|
299
299
|
});
|
|
300
300
|
});
|
|
301
|
-
process.env.NODE_ENV !== "production" && (
|
|
301
|
+
process.env.NODE_ENV !== "production" && (W.propTypes = {
|
|
302
302
|
// ----------------------------- Warning --------------------------------
|
|
303
303
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
304
304
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -373,7 +373,7 @@ process.env.NODE_ENV !== "production" && (G.propTypes = {
|
|
|
373
373
|
*/
|
|
374
374
|
tabIndex: t.number
|
|
375
375
|
});
|
|
376
|
-
const
|
|
376
|
+
const Ie = W, Fe = ({
|
|
377
377
|
name: e,
|
|
378
378
|
label: o,
|
|
379
379
|
type: s,
|
|
@@ -383,58 +383,60 @@ const ye = G, Pe = ({
|
|
|
383
383
|
required: l,
|
|
384
384
|
disabled: m,
|
|
385
385
|
beforeField: u,
|
|
386
|
-
afterField:
|
|
386
|
+
afterField: I,
|
|
387
387
|
options: f,
|
|
388
388
|
optionsResponseHandler: p,
|
|
389
389
|
api_endpoint: i,
|
|
390
|
-
error:
|
|
391
|
-
helperText:
|
|
390
|
+
error: v,
|
|
391
|
+
helperText: g,
|
|
392
|
+
autofocus: C
|
|
392
393
|
}) => {
|
|
393
|
-
const [
|
|
394
|
-
function
|
|
394
|
+
const [y, E] = J([]);
|
|
395
|
+
function $(n) {
|
|
395
396
|
r(e, n.target.value);
|
|
396
397
|
}
|
|
397
|
-
const
|
|
398
|
+
const N = K(async () => {
|
|
398
399
|
var n;
|
|
399
|
-
return s !== "select" ? [] : f || (i && p ? (n = (await (await fetch(i)).json())[p.key]) == null ? void 0 : n.map((
|
|
400
|
-
name:
|
|
401
|
-
value:
|
|
400
|
+
return s !== "select" ? [] : f || (i && p ? (n = (await (await fetch(i)).json())[p.key]) == null ? void 0 : n.map((L) => ({
|
|
401
|
+
name: L[p.name],
|
|
402
|
+
value: L[p.value]
|
|
402
403
|
})) : []);
|
|
403
404
|
}, [s, p, i]);
|
|
404
|
-
return
|
|
405
|
-
|
|
405
|
+
return Q(() => {
|
|
406
|
+
N().then((n) => E(n));
|
|
406
407
|
}, []), s !== "custom" ? /* @__PURE__ */ c(
|
|
407
|
-
|
|
408
|
+
Z,
|
|
408
409
|
{
|
|
409
410
|
label: o,
|
|
411
|
+
autoFocus: C,
|
|
410
412
|
name: e,
|
|
411
413
|
type: s,
|
|
412
414
|
select: s === "select",
|
|
413
415
|
value: a,
|
|
414
|
-
onChange:
|
|
416
|
+
onChange: $,
|
|
415
417
|
placeholder: d,
|
|
416
418
|
required: l,
|
|
417
419
|
disabled: m,
|
|
418
|
-
error:
|
|
419
|
-
helperText:
|
|
420
|
+
error: v,
|
|
421
|
+
helperText: g,
|
|
420
422
|
InputProps: {
|
|
421
|
-
startAdornment: /* @__PURE__ */ c(
|
|
422
|
-
endAdornment: /* @__PURE__ */ c(
|
|
423
|
+
startAdornment: /* @__PURE__ */ c(V, { position: "start", children: u }),
|
|
424
|
+
endAdornment: /* @__PURE__ */ c(V, { position: "end", children: I })
|
|
423
425
|
},
|
|
424
|
-
children: s === "select" && (
|
|
425
|
-
const
|
|
426
|
+
children: s === "select" && (y == null ? void 0 : y.map((n) => {
|
|
427
|
+
const O = typeof n == "object";
|
|
426
428
|
return /* @__PURE__ */ c(
|
|
427
|
-
|
|
429
|
+
Ie,
|
|
428
430
|
{
|
|
429
|
-
value:
|
|
430
|
-
children:
|
|
431
|
+
value: O ? n.value : n,
|
|
432
|
+
children: O ? n.name : n
|
|
431
433
|
},
|
|
432
|
-
|
|
434
|
+
O ? n.name : n
|
|
433
435
|
);
|
|
434
436
|
}))
|
|
435
437
|
}
|
|
436
|
-
) : /* @__PURE__ */ c(
|
|
438
|
+
) : /* @__PURE__ */ c(H, {});
|
|
437
439
|
};
|
|
438
440
|
export {
|
|
439
|
-
|
|
441
|
+
Fe as default
|
|
440
442
|
};
|
|
@@ -11,6 +11,7 @@ export interface InputField {
|
|
|
11
11
|
beforeField?: string | React.ReactNode;
|
|
12
12
|
afterField?: string | React.ReactNode;
|
|
13
13
|
helperText?: string;
|
|
14
|
+
autofocus?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export interface Option {
|
|
16
17
|
name: string;
|
|
@@ -39,6 +40,7 @@ export interface ConfigField extends SelectField {
|
|
|
39
40
|
validation?: Validation;
|
|
40
41
|
customComponent?: string;
|
|
41
42
|
submitDataKey?: string;
|
|
43
|
+
preFillWithDateTime?: boolean;
|
|
42
44
|
}
|
|
43
45
|
export interface CustomFieldProps {
|
|
44
46
|
value: string;
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
for (let
|
|
5
|
-
const
|
|
6
|
-
let
|
|
7
|
-
|
|
1
|
+
function d(t, n, e) {
|
|
2
|
+
const o = t.split("."), c = o.length - 1;
|
|
3
|
+
let r = {};
|
|
4
|
+
for (let s = c; s >= 0; s--) {
|
|
5
|
+
const a = o[s];
|
|
6
|
+
let g = {};
|
|
7
|
+
s === c ? r[a] = n === "number" ? parseInt(e) : e : (g[a] = { ...r }, r = g);
|
|
8
8
|
}
|
|
9
|
-
return
|
|
9
|
+
return r;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const [e] = Object.keys(
|
|
11
|
+
function u(t, n) {
|
|
12
|
+
const [e] = Object.keys(n);
|
|
13
13
|
return t.hasOwnProperty(e) ? {
|
|
14
14
|
...t,
|
|
15
|
-
[e]:
|
|
15
|
+
[e]: u(
|
|
16
16
|
t[e],
|
|
17
|
-
|
|
17
|
+
n[e]
|
|
18
18
|
)
|
|
19
19
|
} : {
|
|
20
20
|
...t,
|
|
21
|
-
...
|
|
21
|
+
...n
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
+
function i() {
|
|
25
|
+
const t = /* @__PURE__ */ new Date(), n = t.getFullYear(), e = String(t.getMonth() + 1).padStart(2, "0"), o = String(t.getDate()).padStart(2, "0"), c = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), s = String(t.getSeconds()).padStart(2, "0");
|
|
26
|
+
return `${n}-${e}-${o} ${c}:${r}:${s}`;
|
|
27
|
+
}
|
|
24
28
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
d as createNestedObject,
|
|
30
|
+
u as deepMergeObjects,
|
|
31
|
+
i as getLocalDateTime
|
|
27
32
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SxProps } from "@mui/material";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { CraftFC } from "../../../global/interfaces";
|
|
3
4
|
import { ConfigField, CustomFields, InvalidData } from "./Form.interfaces";
|
|
@@ -10,7 +11,8 @@ interface FormProps {
|
|
|
10
11
|
handleCancel: () => void;
|
|
11
12
|
onChange?: (key: string, value: string) => void;
|
|
12
13
|
customFields?: CustomFields;
|
|
13
|
-
|
|
14
|
+
formStyles?: React.CSSProperties;
|
|
15
|
+
buttonWrapperStyles?: SxProps;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* Form component
|