@fangzsx/component-library 0.0.14 → 0.0.16
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/{ButtonBase-qMhxbNdC.js → ButtonBase-DxZEqM87.js} +15 -14
- package/dist/{FormLabel-DKoCtSGZ.js → FormLabel-DLyFlUyL.js} +7 -6
- package/dist/{Paper-DyRh03We.js → Paper-DZg6u5tT.js} +50 -77
- package/dist/{SwitchBase-DStPyUhD.js → SwitchBase-BPRcMkqu.js} +23 -21
- package/dist/{Typography-B0rSrz7H.js → Typography-DMROEdKW.js} +5 -4
- package/dist/components/AppBarPublic/index.js +8 -7
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Checkbox/index.js +23 -22
- package/dist/components/CheckboxGroup/index.js +47 -34
- package/dist/components/MediaCardWithAction/index.js +7 -6
- package/dist/components/RadioButtonGroup/index.js +20 -18
- package/dist/components/Stepper/index.d.ts +11 -0
- package/dist/components/Stepper/index.js +607 -0
- package/dist/components/TextFieldInput/index.js +503 -482
- package/dist/{createSvgIcon-Dj0SJuc1.js → createSvgIcon-ChKzptBc.js} +2 -1
- package/dist/{index-o1i1vy-V.js → index-1CH5DDiw.js} +1 -1
- package/dist/{index-CoBGCD2e.js → index-B08hLYdM.js} +24 -23
- package/dist/integerPropType-BihGt2aU.js +31 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +7 -5
- package/dist/{mergeSlotProps-C-n2ing7.js → mergeSlotProps-CADAqXOb.js} +1 -1
- package/dist/{useTimeout-BWi4JTOH.js → useForkRef-gLJikozA.js} +170 -277
- package/dist/useFormControl-BGLuGvqS.js +38 -0
- package/dist/useSlot-jPRhj-MO.js +125 -0
- package/dist/useTimeout-DmOXPFt0.js +111 -0
- package/package.json +1 -1
- package/dist/useSlot-S2pEBHE8.js +0 -161
|
@@ -1,44 +1,57 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { FormControl as
|
|
3
|
-
import { useState as
|
|
4
|
-
function
|
|
5
|
-
options:
|
|
6
|
-
required:
|
|
7
|
-
minChecked:
|
|
1
|
+
import { jsxs as $, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl as x, FormGroup as G, FormControlLabel as I, Checkbox as B, FormHelperText as f } from "@mui/material";
|
|
3
|
+
import { useState as d } from "react";
|
|
4
|
+
function P({
|
|
5
|
+
options: s,
|
|
6
|
+
required: b = !1,
|
|
7
|
+
minChecked: o,
|
|
8
8
|
maxChecked: r,
|
|
9
9
|
errorMessage: c,
|
|
10
|
-
helperText:
|
|
11
|
-
onChange:
|
|
12
|
-
sx:
|
|
10
|
+
helperText: m,
|
|
11
|
+
onChange: i,
|
|
12
|
+
sx: p
|
|
13
13
|
}) {
|
|
14
|
-
const [
|
|
15
|
-
|
|
14
|
+
const [a, h] = d(
|
|
15
|
+
s.reduce((e, t) => ({
|
|
16
16
|
...e,
|
|
17
|
-
[
|
|
17
|
+
[t.name]: t.defaultChecked || !1
|
|
18
18
|
}), {})
|
|
19
|
-
), [g,
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
...
|
|
19
|
+
), [g, F] = d(!1), v = (e) => {
|
|
20
|
+
F(!0);
|
|
21
|
+
const t = {
|
|
22
|
+
...a,
|
|
23
23
|
[e.target.name]: e.target.checked
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
(
|
|
25
|
+
h(t);
|
|
26
|
+
const L = Object.keys(t).filter(
|
|
27
|
+
(M) => t[M]
|
|
28
28
|
);
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
29
|
+
i && i(L);
|
|
30
|
+
}, n = Object.values(a).filter(Boolean).length, u = g && (o !== void 0 && n < o || r !== void 0 && n > r), j = () => c || (o !== void 0 && n < o ? `Please select at least ${o} option${o > 1 ? "s" : ""}` : r !== void 0 && n > r ? `Please select no more than ${r} option${r > 1 ? "s" : ""}` : "");
|
|
31
|
+
return /* @__PURE__ */ $(
|
|
32
|
+
x,
|
|
33
33
|
{
|
|
34
|
-
required:
|
|
35
|
-
error:
|
|
34
|
+
required: b,
|
|
35
|
+
error: u,
|
|
36
36
|
component: "fieldset",
|
|
37
|
-
sx: {
|
|
37
|
+
sx: {
|
|
38
|
+
m: 0,
|
|
39
|
+
"& .MuiFormGroup-root": {
|
|
40
|
+
gap: 1
|
|
41
|
+
},
|
|
42
|
+
"& .MuiFormControlLabel-root": {
|
|
43
|
+
marginTop: "0 !important",
|
|
44
|
+
marginBottom: "0 !important"
|
|
45
|
+
},
|
|
46
|
+
"& .MuiFormControlLabel-label": {
|
|
47
|
+
margin: "0 !important"
|
|
48
|
+
},
|
|
49
|
+
...p
|
|
50
|
+
},
|
|
38
51
|
variant: "standard",
|
|
39
52
|
children: [
|
|
40
|
-
/* @__PURE__ */ l(G, { children:
|
|
41
|
-
|
|
53
|
+
/* @__PURE__ */ l(G, { children: s.map((e) => /* @__PURE__ */ l(
|
|
54
|
+
I,
|
|
42
55
|
{
|
|
43
56
|
sx: {
|
|
44
57
|
color: "#404A58",
|
|
@@ -47,10 +60,10 @@ function w({
|
|
|
47
60
|
}
|
|
48
61
|
},
|
|
49
62
|
control: /* @__PURE__ */ l(
|
|
50
|
-
|
|
63
|
+
B,
|
|
51
64
|
{
|
|
52
|
-
checked:
|
|
53
|
-
onChange:
|
|
65
|
+
checked: a[e.name] || !1,
|
|
66
|
+
onChange: v,
|
|
54
67
|
name: e.name
|
|
55
68
|
}
|
|
56
69
|
),
|
|
@@ -58,11 +71,11 @@ function w({
|
|
|
58
71
|
},
|
|
59
72
|
e.name
|
|
60
73
|
)) }),
|
|
61
|
-
|
|
74
|
+
u ? /* @__PURE__ */ l(f, { children: j() }) : m ? /* @__PURE__ */ l(f, { children: m }) : null
|
|
62
75
|
]
|
|
63
76
|
}
|
|
64
77
|
);
|
|
65
78
|
}
|
|
66
79
|
export {
|
|
67
|
-
|
|
80
|
+
P as CheckboxGroup
|
|
68
81
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as d, jsxs as x } from "react/jsx-runtime";
|
|
2
|
-
import { B as A } from "../../index-
|
|
2
|
+
import { B as A } from "../../index-B08hLYdM.js";
|
|
3
3
|
import * as u from "react";
|
|
4
4
|
import { g as m, a as f, P as e } from "../../generateUtilityClasses-BCID9NF1.js";
|
|
5
|
-
import { u as C, s as g, c as y, a as b
|
|
6
|
-
import { P as U } from "../../Paper-
|
|
7
|
-
import {
|
|
5
|
+
import { u as C, s as g, c as y, a as b } from "../../useForkRef-gLJikozA.js";
|
|
6
|
+
import { P as U } from "../../Paper-DZg6u5tT.js";
|
|
7
|
+
import { a as N } from "../../useTimeout-DmOXPFt0.js";
|
|
8
|
+
import { T as v } from "../../Typography-DMROEdKW.js";
|
|
8
9
|
function I(o) {
|
|
9
10
|
return m("MuiCard", o);
|
|
10
11
|
}
|
|
@@ -336,7 +337,7 @@ process.env.NODE_ENV !== "production" && (T.propTypes = {
|
|
|
336
337
|
*/
|
|
337
338
|
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
|
|
338
339
|
});
|
|
339
|
-
function
|
|
340
|
+
function ee({
|
|
340
341
|
image: o,
|
|
341
342
|
imageAlt: t = "Card image",
|
|
342
343
|
title: s,
|
|
@@ -368,5 +369,5 @@ function Z({
|
|
|
368
369
|
] });
|
|
369
370
|
}
|
|
370
371
|
export {
|
|
371
|
-
|
|
372
|
+
ee as MediaCardWithAction
|
|
372
373
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as l, jsxs as I } from "react/jsx-runtime";
|
|
2
2
|
import * as u from "react";
|
|
3
3
|
import { useState as Z } from "react";
|
|
4
|
-
import { f as X, c as lo, F as io, a as co, b as po } from "../../FormLabel-
|
|
4
|
+
import { f as X, c as lo, F as io, a as co, b as po } from "../../FormLabel-DLyFlUyL.js";
|
|
5
5
|
import { a as $, g as B, c as M, P as o } from "../../generateUtilityClasses-BCID9NF1.js";
|
|
6
|
-
import { u as _, c as G, s as N, a as L, m as V,
|
|
7
|
-
import { a as A,
|
|
6
|
+
import { u as _, c as G, s as N, a as L, m as V, r as Y, b as uo } from "../../useForkRef-gLJikozA.js";
|
|
7
|
+
import { a as A, u as fo } from "../../useFormControl-BGLuGvqS.js";
|
|
8
8
|
import { u as mo } from "../../useId-CK6Kn3Tn.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { c as
|
|
9
|
+
import { u as oo } from "../../useSlot-jPRhj-MO.js";
|
|
10
|
+
import { T as J } from "../../Typography-DMROEdKW.js";
|
|
11
|
+
import { r as eo, c as K } from "../../useTimeout-DmOXPFt0.js";
|
|
12
|
+
import { S as bo } from "../../SwitchBase-BPRcMkqu.js";
|
|
13
|
+
import { c as ro } from "../../createSvgIcon-ChKzptBc.js";
|
|
12
14
|
function yo(e) {
|
|
13
15
|
return B("MuiFormControlLabel", e);
|
|
14
16
|
}
|
|
@@ -140,13 +142,13 @@ const E = $("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlaceme
|
|
|
140
142
|
...p,
|
|
141
143
|
...F
|
|
142
144
|
}
|
|
143
|
-
}, [U, z] =
|
|
144
|
-
elementType:
|
|
145
|
+
}, [U, z] = oo("typography", {
|
|
146
|
+
elementType: J,
|
|
145
147
|
externalForwardedProps: q,
|
|
146
148
|
ownerState: v
|
|
147
149
|
});
|
|
148
150
|
let C = h;
|
|
149
|
-
return C != null && C.type !==
|
|
151
|
+
return C != null && C.type !== J && !m && (C = /* @__PURE__ */ l(U, {
|
|
150
152
|
component: "span",
|
|
151
153
|
...z,
|
|
152
154
|
className: G(T.label, z?.className),
|
|
@@ -206,7 +208,7 @@ process.env.NODE_ENV !== "production" && (to.propTypes = {
|
|
|
206
208
|
/**
|
|
207
209
|
* Pass a ref to the `input` element.
|
|
208
210
|
*/
|
|
209
|
-
inputRef:
|
|
211
|
+
inputRef: eo,
|
|
210
212
|
/**
|
|
211
213
|
* A text or an element to be used in an enclosing label element.
|
|
212
214
|
*/
|
|
@@ -260,7 +262,7 @@ const Ro = ro(/* @__PURE__ */ l("path", {
|
|
|
260
262
|
d: "M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
|
|
261
263
|
}), "RadioButtonChecked"), Po = N("span", {
|
|
262
264
|
name: "MuiRadioButtonIcon",
|
|
263
|
-
shouldForwardProp:
|
|
265
|
+
shouldForwardProp: Y
|
|
264
266
|
})({
|
|
265
267
|
position: "relative",
|
|
266
268
|
display: "flex"
|
|
@@ -353,7 +355,7 @@ const Q = $("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSe
|
|
|
353
355
|
...L(a, To, r)
|
|
354
356
|
};
|
|
355
357
|
}, No = N(bo, {
|
|
356
|
-
shouldForwardProp: (e) =>
|
|
358
|
+
shouldForwardProp: (e) => Y(e) || e === "classes",
|
|
357
359
|
name: "MuiRadio",
|
|
358
360
|
slot: "Root",
|
|
359
361
|
overridesResolver: (e, r) => {
|
|
@@ -380,7 +382,7 @@ const Q = $("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSe
|
|
|
380
382
|
backgroundColor: e.alpha((e.vars || e).palette.action.active, (e.vars || e).palette.action.hoverOpacity)
|
|
381
383
|
}
|
|
382
384
|
}
|
|
383
|
-
}, ...Object.entries(e.palette).filter(
|
|
385
|
+
}, ...Object.entries(e.palette).filter(K()).map(([r]) => ({
|
|
384
386
|
props: {
|
|
385
387
|
color: r,
|
|
386
388
|
disabled: !1,
|
|
@@ -391,7 +393,7 @@ const Q = $("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSe
|
|
|
391
393
|
backgroundColor: e.alpha((e.vars || e).palette[r].main, (e.vars || e).palette.action.hoverOpacity)
|
|
392
394
|
}
|
|
393
395
|
}
|
|
394
|
-
})), ...Object.entries(e.palette).filter(
|
|
396
|
+
})), ...Object.entries(e.palette).filter(K()).map(([r]) => ({
|
|
395
397
|
props: {
|
|
396
398
|
color: r,
|
|
397
399
|
disabled: !1
|
|
@@ -454,7 +456,7 @@ const Oo = /* @__PURE__ */ l(H, {
|
|
|
454
456
|
const D = lo(m, g && g.onChange);
|
|
455
457
|
let v = d;
|
|
456
458
|
g && (typeof O > "u" && (O = xo(g.value, s.value)), typeof v > "u" && (v = g.name));
|
|
457
|
-
const T = w.input ?? b, [q, U] =
|
|
459
|
+
const T = w.input ?? b, [q, U] = oo("root", {
|
|
458
460
|
ref: t,
|
|
459
461
|
elementType: No,
|
|
460
462
|
className: G(j.root, h),
|
|
@@ -550,7 +552,7 @@ process.env.NODE_ENV !== "production" && (so.propTypes = {
|
|
|
550
552
|
* Pass a ref to the `input` element.
|
|
551
553
|
* @deprecated Use `slotProps.input.ref` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
552
554
|
*/
|
|
553
|
-
inputRef:
|
|
555
|
+
inputRef: eo,
|
|
554
556
|
/**
|
|
555
557
|
* Name attribute of the `input` element.
|
|
556
558
|
*/
|
|
@@ -773,7 +775,7 @@ process.env.NODE_ENV !== "production" && (no.propTypes = {
|
|
|
773
775
|
*/
|
|
774
776
|
value: o.any
|
|
775
777
|
});
|
|
776
|
-
function
|
|
778
|
+
function Jo({
|
|
777
779
|
label: e,
|
|
778
780
|
options: r,
|
|
779
781
|
defaultValue: t,
|
|
@@ -832,5 +834,5 @@ function Wo({
|
|
|
832
834
|
);
|
|
833
835
|
}
|
|
834
836
|
export {
|
|
835
|
-
|
|
837
|
+
Jo as RadioButtonGroup
|
|
836
838
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface StepConfig {
|
|
2
|
+
label: string;
|
|
3
|
+
}
|
|
4
|
+
interface HorizontalLinearStepperProps {
|
|
5
|
+
steps: StepConfig[];
|
|
6
|
+
activeStep?: number;
|
|
7
|
+
sx?: any;
|
|
8
|
+
stepperSx?: any;
|
|
9
|
+
}
|
|
10
|
+
export declare function Stepper({ steps, activeStep, sx, stepperSx }: HorizontalLinearStepperProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|