@fangzsx/component-library 0.0.11 → 0.0.13
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-DPlM16yK.js +30 -0
- package/dist/ButtonBase-qMhxbNdC.js +878 -0
- package/dist/FormLabel-DKoCtSGZ.js +600 -0
- package/dist/{Paper-CAUsv8qs.js → Paper-DyRh03We.js} +54 -51
- package/dist/SwitchBase-DStPyUhD.js +311 -0
- package/dist/Typography-B0rSrz7H.js +253 -0
- package/dist/components/AppBarPublic/index.js +83 -105
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Checkbox/index.js +103 -607
- package/dist/components/CheckboxGroup/index.d.ts +17 -0
- package/dist/components/CheckboxGroup/index.js +68 -0
- package/dist/components/Dropdown/index.d.ts +22 -0
- package/dist/components/Dropdown/index.js +120 -0
- package/dist/components/LinearProgress/index.d.ts +3 -0
- package/dist/components/LinearProgress/index.js +19 -0
- package/dist/components/MediaCardWithAction/index.js +157 -436
- package/dist/components/RadioButtonGroup/index.d.ts +17 -0
- package/dist/components/RadioButtonGroup/index.js +836 -0
- package/dist/components/TextFieldInput/index.d.ts +15 -0
- package/dist/components/TextFieldInput/index.js +6578 -0
- package/dist/{createSvgIcon-DAI5icic.js → createSvgIcon-Dj0SJuc1.js} +8 -7
- package/dist/generateUtilityClasses-BCID9NF1.js +2806 -0
- package/dist/{index-DGepNtNg.js → index-CoBGCD2e.js} +143 -158
- package/dist/index-o1i1vy-V.js +73 -0
- package/dist/main.d.ts +5 -1
- package/dist/main.js +21 -13
- package/dist/mergeSlotProps-C-n2ing7.js +62 -0
- package/dist/useId-CK6Kn3Tn.js +21 -0
- package/dist/useSlot-S2pEBHE8.js +161 -0
- package/dist/useTimeout-BWi4JTOH.js +635 -0
- package/package.json +1 -1
- package/dist/ButtonBase-CAtBagnK.js +0 -4293
- package/dist/assets/index2.css +0 -1
- package/dist/components/Input/index.d.ts +0 -1
- package/dist/components/Input/index.js +0 -11
|
@@ -1,553 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as f from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
state: c = "value"
|
|
11
|
-
} = e, {
|
|
12
|
-
current: a
|
|
13
|
-
} = f.useRef(t !== void 0), [u, r] = f.useState(n), i = a ? t : u;
|
|
14
|
-
if (process.env.NODE_ENV !== "production") {
|
|
15
|
-
f.useEffect(() => {
|
|
16
|
-
a !== (t !== void 0) && console.error([`MUI: A component is changing the ${a ? "" : "un"}controlled ${c} state of ${s} to be ${a ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${s} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
|
|
17
|
-
`));
|
|
18
|
-
}, [c, s, t]);
|
|
19
|
-
const {
|
|
20
|
-
current: d
|
|
21
|
-
} = f.useRef(n);
|
|
22
|
-
f.useEffect(() => {
|
|
23
|
-
!a && JSON.stringify(n) !== JSON.stringify(d) && console.error([`MUI: A component is changing the default ${c} state of an uncontrolled ${s} after being initialized. To suppress this warning opt to use a controlled ${s}.`].join(`
|
|
24
|
-
`));
|
|
25
|
-
}, [JSON.stringify(n)]);
|
|
26
|
-
}
|
|
27
|
-
const l = f.useCallback((d) => {
|
|
28
|
-
a || r(d);
|
|
29
|
-
}, []);
|
|
30
|
-
return [i, l];
|
|
31
|
-
}
|
|
32
|
-
function me(e, t) {
|
|
33
|
-
const n = e.charCodeAt(2);
|
|
34
|
-
return e[0] === "o" && e[1] === "n" && n >= 65 && n <= 90 && typeof t == "function";
|
|
35
|
-
}
|
|
36
|
-
function he(e, t) {
|
|
37
|
-
if (!e)
|
|
38
|
-
return t;
|
|
39
|
-
function n(u, r) {
|
|
40
|
-
const i = {};
|
|
41
|
-
return Object.keys(r).forEach((l) => {
|
|
42
|
-
me(l, r[l]) && typeof u[l] == "function" && (i[l] = (...d) => {
|
|
43
|
-
u[l](...d), r[l](...d);
|
|
44
|
-
});
|
|
45
|
-
}), i;
|
|
46
|
-
}
|
|
47
|
-
if (typeof e == "function" || typeof t == "function")
|
|
48
|
-
return (u) => {
|
|
49
|
-
const r = typeof t == "function" ? t(u) : t, i = typeof e == "function" ? e({
|
|
50
|
-
...u,
|
|
51
|
-
...r
|
|
52
|
-
}) : e, l = I(u?.className, r?.className, i?.className), d = n(i, r);
|
|
53
|
-
return {
|
|
54
|
-
...r,
|
|
55
|
-
...i,
|
|
56
|
-
...d,
|
|
57
|
-
...!!l && {
|
|
58
|
-
className: l
|
|
59
|
-
},
|
|
60
|
-
...r?.style && i?.style && {
|
|
61
|
-
style: {
|
|
62
|
-
...r.style,
|
|
63
|
-
...i.style
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
...r?.sx && i?.sx && {
|
|
67
|
-
sx: [...Array.isArray(r.sx) ? r.sx : [r.sx], ...Array.isArray(i.sx) ? i.sx : [i.sx]]
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
const s = t, c = n(e, s), a = I(s?.className, e?.className);
|
|
72
|
-
return {
|
|
73
|
-
...t,
|
|
74
|
-
...e,
|
|
75
|
-
...c,
|
|
76
|
-
...!!a && {
|
|
77
|
-
className: a
|
|
78
|
-
},
|
|
79
|
-
...s?.style && e?.style && {
|
|
80
|
-
style: {
|
|
81
|
-
...s.style,
|
|
82
|
-
...e.style
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
...s?.sx && e?.sx && {
|
|
86
|
-
sx: [...Array.isArray(s.sx) ? s.sx : [s.sx], ...Array.isArray(e.sx) ? e.sx : [e.sx]]
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
const J = /* @__PURE__ */ f.createContext(void 0);
|
|
91
|
-
process.env.NODE_ENV !== "production" && (J.displayName = "FormControlContext");
|
|
92
|
-
function ye() {
|
|
93
|
-
return f.useContext(J);
|
|
94
|
-
}
|
|
95
|
-
function be(e) {
|
|
96
|
-
return q("PrivateSwitchBase", e);
|
|
97
|
-
}
|
|
98
|
-
D("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
|
|
99
|
-
function ge(e) {
|
|
100
|
-
return typeof e == "string";
|
|
101
|
-
}
|
|
102
|
-
function Ce(e, t, n) {
|
|
103
|
-
return e === void 0 || ge(e) ? t : {
|
|
104
|
-
...t,
|
|
105
|
-
ownerState: {
|
|
106
|
-
...t.ownerState,
|
|
107
|
-
...n
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function xe(e, t, n) {
|
|
112
|
-
return typeof e == "function" ? e(t, n) : e;
|
|
113
|
-
}
|
|
114
|
-
function ke(e, t = []) {
|
|
115
|
-
if (e === void 0)
|
|
116
|
-
return {};
|
|
117
|
-
const n = {};
|
|
118
|
-
return Object.keys(e).filter((s) => s.match(/^on[A-Z]/) && typeof e[s] == "function" && !t.includes(s)).forEach((s) => {
|
|
119
|
-
n[s] = e[s];
|
|
120
|
-
}), n;
|
|
121
|
-
}
|
|
122
|
-
function U(e) {
|
|
123
|
-
if (e === void 0)
|
|
124
|
-
return {};
|
|
125
|
-
const t = {};
|
|
126
|
-
return Object.keys(e).filter((n) => !(n.match(/^on[A-Z]/) && typeof e[n] == "function")).forEach((n) => {
|
|
127
|
-
t[n] = e[n];
|
|
128
|
-
}), t;
|
|
129
|
-
}
|
|
130
|
-
function ve(e) {
|
|
131
|
-
const {
|
|
132
|
-
getSlotProps: t,
|
|
133
|
-
additionalProps: n,
|
|
134
|
-
externalSlotProps: s,
|
|
135
|
-
externalForwardedProps: c,
|
|
136
|
-
className: a
|
|
137
|
-
} = e;
|
|
138
|
-
if (!t) {
|
|
139
|
-
const y = I(n?.className, a, c?.className, s?.className), b = {
|
|
140
|
-
...n?.style,
|
|
141
|
-
...c?.style,
|
|
142
|
-
...s?.style
|
|
143
|
-
}, m = {
|
|
144
|
-
...n,
|
|
145
|
-
...c,
|
|
146
|
-
...s
|
|
147
|
-
};
|
|
148
|
-
return y.length > 0 && (m.className = y), Object.keys(b).length > 0 && (m.style = b), {
|
|
149
|
-
props: m,
|
|
150
|
-
internalRef: void 0
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
const u = ke({
|
|
154
|
-
...c,
|
|
155
|
-
...s
|
|
156
|
-
}), r = U(s), i = U(c), l = t(u), d = I(l?.className, n?.className, a, c?.className, s?.className), g = {
|
|
157
|
-
...l?.style,
|
|
158
|
-
...n?.style,
|
|
159
|
-
...c?.style,
|
|
160
|
-
...s?.style
|
|
161
|
-
}, C = {
|
|
162
|
-
...l,
|
|
163
|
-
...n,
|
|
164
|
-
...i,
|
|
165
|
-
...r
|
|
166
|
-
};
|
|
167
|
-
return d.length > 0 && (C.className = d), Object.keys(g).length > 0 && (C.style = g), {
|
|
168
|
-
props: C,
|
|
169
|
-
internalRef: l.ref
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
function E(e, t) {
|
|
173
|
-
const {
|
|
174
|
-
className: n,
|
|
175
|
-
elementType: s,
|
|
176
|
-
ownerState: c,
|
|
177
|
-
externalForwardedProps: a,
|
|
178
|
-
internalForwardedProps: u,
|
|
179
|
-
shouldForwardComponentProp: r = !1,
|
|
180
|
-
...i
|
|
181
|
-
} = t, {
|
|
182
|
-
component: l,
|
|
183
|
-
slots: d = {
|
|
184
|
-
[e]: void 0
|
|
185
|
-
},
|
|
186
|
-
slotProps: g = {
|
|
187
|
-
[e]: void 0
|
|
188
|
-
},
|
|
189
|
-
...C
|
|
190
|
-
} = a, y = d[e] || s, b = xe(g[e], c), {
|
|
191
|
-
props: {
|
|
192
|
-
component: m,
|
|
193
|
-
...P
|
|
194
|
-
},
|
|
195
|
-
internalRef: w
|
|
196
|
-
} = ve({
|
|
197
|
-
className: n,
|
|
198
|
-
...i,
|
|
199
|
-
externalForwardedProps: e === "root" ? C : void 0,
|
|
200
|
-
externalSlotProps: b
|
|
201
|
-
}), v = ie(w, b?.ref, t.ref), x = e === "root" ? m || l : m, O = Ce(y, {
|
|
202
|
-
...e === "root" && !l && !d[e] && u,
|
|
203
|
-
...e !== "root" && !d[e] && u,
|
|
204
|
-
...P,
|
|
205
|
-
...x && !r && {
|
|
206
|
-
as: x
|
|
207
|
-
},
|
|
208
|
-
...x && r && {
|
|
209
|
-
component: x
|
|
210
|
-
},
|
|
211
|
-
ref: v
|
|
212
|
-
}, c);
|
|
213
|
-
return [y, O];
|
|
214
|
-
}
|
|
215
|
-
const Ne = (e) => {
|
|
216
|
-
const {
|
|
217
|
-
classes: t,
|
|
218
|
-
checked: n,
|
|
219
|
-
disabled: s,
|
|
220
|
-
edge: c
|
|
221
|
-
} = e, a = {
|
|
222
|
-
root: ["root", n && "checked", s && "disabled", c && `edge${B(c)}`],
|
|
223
|
-
input: ["input"]
|
|
224
|
-
};
|
|
225
|
-
return L(a, be, t);
|
|
226
|
-
}, Pe = j(le, {
|
|
227
|
-
name: "MuiSwitchBase"
|
|
228
|
-
})({
|
|
229
|
-
padding: 9,
|
|
230
|
-
borderRadius: "50%",
|
|
231
|
-
variants: [{
|
|
232
|
-
props: {
|
|
233
|
-
edge: "start",
|
|
234
|
-
size: "small"
|
|
235
|
-
},
|
|
236
|
-
style: {
|
|
237
|
-
marginLeft: -3
|
|
238
|
-
}
|
|
239
|
-
}, {
|
|
240
|
-
props: ({
|
|
241
|
-
edge: e,
|
|
242
|
-
ownerState: t
|
|
243
|
-
}) => e === "start" && t.size !== "small",
|
|
244
|
-
style: {
|
|
245
|
-
marginLeft: -12
|
|
246
|
-
}
|
|
247
|
-
}, {
|
|
248
|
-
props: {
|
|
249
|
-
edge: "end",
|
|
250
|
-
size: "small"
|
|
251
|
-
},
|
|
252
|
-
style: {
|
|
253
|
-
marginRight: -3
|
|
254
|
-
}
|
|
255
|
-
}, {
|
|
256
|
-
props: ({
|
|
257
|
-
edge: e,
|
|
258
|
-
ownerState: t
|
|
259
|
-
}) => e === "end" && t.size !== "small",
|
|
260
|
-
style: {
|
|
261
|
-
marginRight: -12
|
|
262
|
-
}
|
|
263
|
-
}]
|
|
264
|
-
}), we = j("input", {
|
|
265
|
-
name: "MuiSwitchBase",
|
|
266
|
-
shouldForwardProp: _
|
|
267
|
-
})({
|
|
268
|
-
cursor: "inherit",
|
|
269
|
-
position: "absolute",
|
|
270
|
-
opacity: 0,
|
|
271
|
-
width: "100%",
|
|
272
|
-
height: "100%",
|
|
273
|
-
top: 0,
|
|
274
|
-
left: 0,
|
|
275
|
-
margin: 0,
|
|
276
|
-
padding: 0,
|
|
277
|
-
zIndex: 1
|
|
278
|
-
}), W = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
279
|
-
const {
|
|
280
|
-
autoFocus: s,
|
|
281
|
-
checked: c,
|
|
282
|
-
checkedIcon: a,
|
|
283
|
-
defaultChecked: u,
|
|
284
|
-
disabled: r,
|
|
285
|
-
disableFocusRipple: i = !1,
|
|
286
|
-
edge: l = !1,
|
|
287
|
-
icon: d,
|
|
288
|
-
id: g,
|
|
289
|
-
inputProps: C,
|
|
290
|
-
inputRef: y,
|
|
291
|
-
name: b,
|
|
292
|
-
onBlur: m,
|
|
293
|
-
onChange: P,
|
|
294
|
-
onFocus: w,
|
|
295
|
-
readOnly: v,
|
|
296
|
-
required: x = !1,
|
|
297
|
-
tabIndex: O,
|
|
298
|
-
type: R,
|
|
299
|
-
value: S,
|
|
300
|
-
slots: G = {},
|
|
301
|
-
slotProps: K = {},
|
|
302
|
-
...Q
|
|
303
|
-
} = t, [A, X] = fe({
|
|
304
|
-
controlled: c,
|
|
305
|
-
default: !!u,
|
|
306
|
-
name: "SwitchBase",
|
|
307
|
-
state: "checked"
|
|
308
|
-
}), N = ye(), Y = (p) => {
|
|
309
|
-
w && w(p), N && N.onFocus && N.onFocus(p);
|
|
310
|
-
}, ee = (p) => {
|
|
311
|
-
m && m(p), N && N.onBlur && N.onBlur(p);
|
|
312
|
-
}, oe = (p) => {
|
|
313
|
-
if (p.nativeEvent.defaultPrevented || v)
|
|
314
|
-
return;
|
|
315
|
-
const h = p.target.checked;
|
|
316
|
-
X(h), P && P(p, h);
|
|
317
|
-
};
|
|
318
|
-
let F = r;
|
|
319
|
-
N && typeof F > "u" && (F = N.disabled);
|
|
320
|
-
const te = R === "checkbox" || R === "radio", T = {
|
|
321
|
-
...t,
|
|
322
|
-
checked: A,
|
|
323
|
-
disabled: F,
|
|
324
|
-
disableFocusRipple: i,
|
|
325
|
-
edge: l
|
|
326
|
-
}, H = Ne(T), M = {
|
|
327
|
-
slots: G,
|
|
328
|
-
slotProps: {
|
|
329
|
-
input: C,
|
|
330
|
-
...K
|
|
331
|
-
}
|
|
332
|
-
}, [ne, se] = E("root", {
|
|
333
|
-
ref: n,
|
|
334
|
-
elementType: Pe,
|
|
335
|
-
className: H.root,
|
|
336
|
-
shouldForwardComponentProp: !0,
|
|
337
|
-
externalForwardedProps: {
|
|
338
|
-
...M,
|
|
339
|
-
component: "span",
|
|
340
|
-
...Q
|
|
341
|
-
},
|
|
342
|
-
getSlotProps: (p) => ({
|
|
343
|
-
...p,
|
|
344
|
-
onFocus: (h) => {
|
|
345
|
-
p.onFocus?.(h), Y(h);
|
|
346
|
-
},
|
|
347
|
-
onBlur: (h) => {
|
|
348
|
-
p.onBlur?.(h), ee(h);
|
|
349
|
-
}
|
|
350
|
-
}),
|
|
351
|
-
ownerState: T,
|
|
352
|
-
additionalProps: {
|
|
353
|
-
centerRipple: !0,
|
|
354
|
-
focusRipple: !i,
|
|
355
|
-
disabled: F,
|
|
356
|
-
role: void 0,
|
|
357
|
-
tabIndex: null
|
|
358
|
-
}
|
|
359
|
-
}), [re, ce] = E("input", {
|
|
360
|
-
ref: y,
|
|
361
|
-
elementType: we,
|
|
362
|
-
className: H.input,
|
|
363
|
-
externalForwardedProps: M,
|
|
364
|
-
getSlotProps: (p) => ({
|
|
365
|
-
...p,
|
|
366
|
-
onChange: (h) => {
|
|
367
|
-
p.onChange?.(h), oe(h);
|
|
368
|
-
}
|
|
369
|
-
}),
|
|
370
|
-
ownerState: T,
|
|
371
|
-
additionalProps: {
|
|
372
|
-
autoFocus: s,
|
|
373
|
-
checked: c,
|
|
374
|
-
defaultChecked: u,
|
|
375
|
-
disabled: F,
|
|
376
|
-
id: te ? g : void 0,
|
|
377
|
-
name: b,
|
|
378
|
-
readOnly: v,
|
|
379
|
-
required: x,
|
|
380
|
-
tabIndex: O,
|
|
381
|
-
type: R,
|
|
382
|
-
...R === "checkbox" && S === void 0 ? {} : {
|
|
383
|
-
value: S
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
return /* @__PURE__ */ ae(ne, {
|
|
388
|
-
...se,
|
|
389
|
-
children: [/* @__PURE__ */ k(re, {
|
|
390
|
-
...ce
|
|
391
|
-
}), A ? a : d]
|
|
392
|
-
});
|
|
393
|
-
});
|
|
394
|
-
process.env.NODE_ENV !== "production" && (W.propTypes = {
|
|
395
|
-
/**
|
|
396
|
-
* If `true`, the `input` element is focused during the first mount.
|
|
397
|
-
*/
|
|
398
|
-
autoFocus: o.bool,
|
|
399
|
-
/**
|
|
400
|
-
* If `true`, the component is checked.
|
|
401
|
-
*/
|
|
402
|
-
checked: o.bool,
|
|
403
|
-
/**
|
|
404
|
-
* The icon to display when the component is checked.
|
|
405
|
-
*/
|
|
406
|
-
checkedIcon: o.node.isRequired,
|
|
407
|
-
/**
|
|
408
|
-
* Override or extend the styles applied to the component.
|
|
409
|
-
*/
|
|
410
|
-
classes: o.object,
|
|
411
|
-
/**
|
|
412
|
-
* @ignore
|
|
413
|
-
*/
|
|
414
|
-
className: o.string,
|
|
415
|
-
/**
|
|
416
|
-
* @ignore
|
|
417
|
-
*/
|
|
418
|
-
defaultChecked: o.bool,
|
|
419
|
-
/**
|
|
420
|
-
* If `true`, the component is disabled.
|
|
421
|
-
*/
|
|
422
|
-
disabled: o.bool,
|
|
423
|
-
/**
|
|
424
|
-
* If `true`, the keyboard focus ripple is disabled.
|
|
425
|
-
* @default false
|
|
426
|
-
*/
|
|
427
|
-
disableFocusRipple: o.bool,
|
|
428
|
-
/**
|
|
429
|
-
* If given, uses a negative margin to counteract the padding on one
|
|
430
|
-
* side (this is often helpful for aligning the left or right
|
|
431
|
-
* side of the icon with content above or below, without ruining the border
|
|
432
|
-
* size and shape).
|
|
433
|
-
* @default false
|
|
434
|
-
*/
|
|
435
|
-
edge: o.oneOf(["end", "start", !1]),
|
|
436
|
-
/**
|
|
437
|
-
* The icon to display when the component is unchecked.
|
|
438
|
-
*/
|
|
439
|
-
icon: o.node.isRequired,
|
|
440
|
-
/**
|
|
441
|
-
* The id of the `input` element.
|
|
442
|
-
*/
|
|
443
|
-
id: o.string,
|
|
444
|
-
/**
|
|
445
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
|
|
446
|
-
*/
|
|
447
|
-
inputProps: o.object,
|
|
448
|
-
/**
|
|
449
|
-
* Pass a ref to the `input` element.
|
|
450
|
-
*/
|
|
451
|
-
inputRef: de,
|
|
452
|
-
/*
|
|
453
|
-
* @ignore
|
|
454
|
-
*/
|
|
455
|
-
name: o.string,
|
|
456
|
-
/**
|
|
457
|
-
* @ignore
|
|
458
|
-
*/
|
|
459
|
-
onBlur: o.func,
|
|
460
|
-
/**
|
|
461
|
-
* Callback fired when the state is changed.
|
|
462
|
-
*
|
|
463
|
-
* @param {object} event The event source of the callback.
|
|
464
|
-
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
465
|
-
*/
|
|
466
|
-
onChange: o.func,
|
|
467
|
-
/**
|
|
468
|
-
* @ignore
|
|
469
|
-
*/
|
|
470
|
-
onFocus: o.func,
|
|
471
|
-
/**
|
|
472
|
-
* It prevents the user from changing the value of the field
|
|
473
|
-
* (not from interacting with the field).
|
|
474
|
-
*/
|
|
475
|
-
readOnly: o.bool,
|
|
476
|
-
/**
|
|
477
|
-
* If `true`, the `input` element is required.
|
|
478
|
-
*/
|
|
479
|
-
required: o.bool,
|
|
480
|
-
/**
|
|
481
|
-
* The props used for each slot inside.
|
|
482
|
-
* @default {}
|
|
483
|
-
*/
|
|
484
|
-
slotProps: o.shape({
|
|
485
|
-
input: o.oneOfType([o.func, o.object]),
|
|
486
|
-
root: o.oneOfType([o.func, o.object])
|
|
487
|
-
}),
|
|
488
|
-
/**
|
|
489
|
-
* The components used for each slot inside.
|
|
490
|
-
* @default {}
|
|
491
|
-
*/
|
|
492
|
-
slots: o.shape({
|
|
493
|
-
input: o.elementType,
|
|
494
|
-
root: o.elementType
|
|
495
|
-
}),
|
|
496
|
-
/**
|
|
497
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
498
|
-
*/
|
|
499
|
-
sx: o.object,
|
|
500
|
-
/**
|
|
501
|
-
* @ignore
|
|
502
|
-
*/
|
|
503
|
-
tabIndex: o.oneOfType([o.number, o.string]),
|
|
504
|
-
/**
|
|
505
|
-
* The input component prop `type`.
|
|
506
|
-
*/
|
|
507
|
-
type: o.string.isRequired,
|
|
508
|
-
/**
|
|
509
|
-
* The value of the component.
|
|
510
|
-
*/
|
|
511
|
-
value: o.any
|
|
512
|
-
});
|
|
513
|
-
const Oe = $(/* @__PURE__ */ k("path", {
|
|
3
|
+
import { a as j, g as w, c as l, P as e } from "../../generateUtilityClasses-BCID9NF1.js";
|
|
4
|
+
import { u as M, c as $, s as N, a as V, r as F, m as H, b as I } from "../../useTimeout-BWi4JTOH.js";
|
|
5
|
+
import { S as E } from "../../SwitchBase-DStPyUhD.js";
|
|
6
|
+
import { c as h } from "../../createSvgIcon-Dj0SJuc1.js";
|
|
7
|
+
import { b as U } from "../../useSlot-S2pEBHE8.js";
|
|
8
|
+
import { m as D } from "../../mergeSlotProps-C-n2ing7.js";
|
|
9
|
+
const L = h(/* @__PURE__ */ n("path", {
|
|
514
10
|
d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
|
515
|
-
}), "CheckBoxOutlineBlank"),
|
|
11
|
+
}), "CheckBoxOutlineBlank"), q = h(/* @__PURE__ */ n("path", {
|
|
516
12
|
d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
517
|
-
}), "CheckBox"),
|
|
13
|
+
}), "CheckBox"), _ = h(/* @__PURE__ */ n("path", {
|
|
518
14
|
d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
|
|
519
15
|
}), "IndeterminateCheckBox");
|
|
520
|
-
function
|
|
521
|
-
return
|
|
16
|
+
function A(o) {
|
|
17
|
+
return w("MuiCheckbox", o);
|
|
522
18
|
}
|
|
523
|
-
const
|
|
19
|
+
const b = j("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]), G = (o) => {
|
|
524
20
|
const {
|
|
525
21
|
classes: t,
|
|
526
|
-
indeterminate:
|
|
527
|
-
color:
|
|
22
|
+
indeterminate: s,
|
|
23
|
+
color: r,
|
|
528
24
|
size: c
|
|
529
|
-
} =
|
|
530
|
-
root: ["root",
|
|
531
|
-
},
|
|
25
|
+
} = o, a = {
|
|
26
|
+
root: ["root", s && "indeterminate", `color${l(r)}`, `size${l(c)}`]
|
|
27
|
+
}, p = V(a, A, t);
|
|
532
28
|
return {
|
|
533
29
|
...t,
|
|
534
30
|
// forward the disabled and checked classes to the SwitchBase
|
|
535
|
-
...
|
|
31
|
+
...p
|
|
536
32
|
};
|
|
537
|
-
},
|
|
538
|
-
shouldForwardProp: (
|
|
33
|
+
}, J = N(E, {
|
|
34
|
+
shouldForwardProp: (o) => F(o) || o === "classes",
|
|
539
35
|
name: "MuiCheckbox",
|
|
540
36
|
slot: "Root",
|
|
541
|
-
overridesResolver: (
|
|
37
|
+
overridesResolver: (o, t) => {
|
|
542
38
|
const {
|
|
543
|
-
ownerState:
|
|
544
|
-
} =
|
|
545
|
-
return [t.root,
|
|
39
|
+
ownerState: s
|
|
40
|
+
} = o;
|
|
41
|
+
return [t.root, s.indeterminate && t.indeterminate, t[`size${l(s.size)}`], s.color !== "default" && t[`color${l(s.color)}`]];
|
|
546
42
|
}
|
|
547
|
-
})(
|
|
548
|
-
theme:
|
|
43
|
+
})(H(({
|
|
44
|
+
theme: o
|
|
549
45
|
}) => ({
|
|
550
|
-
color: (
|
|
46
|
+
color: (o.vars || o).palette.text.secondary,
|
|
551
47
|
variants: [{
|
|
552
48
|
props: {
|
|
553
49
|
color: "default",
|
|
@@ -555,29 +51,29 @@ const z = D("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "col
|
|
|
555
51
|
},
|
|
556
52
|
style: {
|
|
557
53
|
"&:hover": {
|
|
558
|
-
backgroundColor:
|
|
54
|
+
backgroundColor: o.alpha((o.vars || o).palette.action.active, (o.vars || o).palette.action.hoverOpacity)
|
|
559
55
|
}
|
|
560
56
|
}
|
|
561
|
-
}, ...Object.entries(
|
|
57
|
+
}, ...Object.entries(o.palette).filter(I()).map(([t]) => ({
|
|
562
58
|
props: {
|
|
563
59
|
color: t,
|
|
564
60
|
disableRipple: !1
|
|
565
61
|
},
|
|
566
62
|
style: {
|
|
567
63
|
"&:hover": {
|
|
568
|
-
backgroundColor:
|
|
64
|
+
backgroundColor: o.alpha((o.vars || o).palette[t].main, (o.vars || o).palette.action.hoverOpacity)
|
|
569
65
|
}
|
|
570
66
|
}
|
|
571
|
-
})), ...Object.entries(
|
|
67
|
+
})), ...Object.entries(o.palette).filter(I()).map(([t]) => ({
|
|
572
68
|
props: {
|
|
573
69
|
color: t
|
|
574
70
|
},
|
|
575
71
|
style: {
|
|
576
|
-
[`&.${
|
|
577
|
-
color: (
|
|
72
|
+
[`&.${b.checked}, &.${b.indeterminate}`]: {
|
|
73
|
+
color: (o.vars || o).palette[t].main
|
|
578
74
|
},
|
|
579
|
-
[`&.${
|
|
580
|
-
color: (
|
|
75
|
+
[`&.${b.disabled}`]: {
|
|
76
|
+
color: (o.vars || o).palette.action.disabled
|
|
581
77
|
}
|
|
582
78
|
}
|
|
583
79
|
})), {
|
|
@@ -594,63 +90,63 @@ const z = D("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "col
|
|
|
594
90
|
}
|
|
595
91
|
}
|
|
596
92
|
}]
|
|
597
|
-
}))),
|
|
598
|
-
const
|
|
93
|
+
}))), K = /* @__PURE__ */ n(q, {}), Q = /* @__PURE__ */ n(L, {}), W = /* @__PURE__ */ n(_, {}), S = /* @__PURE__ */ f.forwardRef(function(t, s) {
|
|
94
|
+
const r = M({
|
|
599
95
|
props: t,
|
|
600
96
|
name: "MuiCheckbox"
|
|
601
97
|
}), {
|
|
602
|
-
checkedIcon: c =
|
|
98
|
+
checkedIcon: c = K,
|
|
603
99
|
color: a = "primary",
|
|
604
|
-
icon:
|
|
605
|
-
indeterminate:
|
|
606
|
-
indeterminateIcon:
|
|
607
|
-
inputProps:
|
|
100
|
+
icon: p = Q,
|
|
101
|
+
indeterminate: i = !1,
|
|
102
|
+
indeterminateIcon: k = W,
|
|
103
|
+
inputProps: O,
|
|
608
104
|
size: d = "medium",
|
|
609
|
-
disableRipple:
|
|
610
|
-
className:
|
|
611
|
-
slots:
|
|
612
|
-
slotProps:
|
|
613
|
-
...
|
|
614
|
-
} =
|
|
615
|
-
...
|
|
616
|
-
disableRipple:
|
|
105
|
+
disableRipple: y = !1,
|
|
106
|
+
className: g,
|
|
107
|
+
slots: C = {},
|
|
108
|
+
slotProps: v = {},
|
|
109
|
+
...T
|
|
110
|
+
} = r, x = i ? k : p, P = i ? k : c, u = {
|
|
111
|
+
...r,
|
|
112
|
+
disableRipple: y,
|
|
617
113
|
color: a,
|
|
618
|
-
indeterminate:
|
|
114
|
+
indeterminate: i,
|
|
619
115
|
size: d
|
|
620
|
-
},
|
|
621
|
-
ref:
|
|
622
|
-
elementType:
|
|
623
|
-
className:
|
|
116
|
+
}, z = G(u), m = v.input ?? O, [R, B] = U("root", {
|
|
117
|
+
ref: s,
|
|
118
|
+
elementType: J,
|
|
119
|
+
className: $(z.root, g),
|
|
624
120
|
shouldForwardComponentProp: !0,
|
|
625
121
|
externalForwardedProps: {
|
|
626
|
-
slots:
|
|
627
|
-
slotProps:
|
|
628
|
-
...
|
|
122
|
+
slots: C,
|
|
123
|
+
slotProps: v,
|
|
124
|
+
...T
|
|
629
125
|
},
|
|
630
|
-
ownerState:
|
|
126
|
+
ownerState: u,
|
|
631
127
|
additionalProps: {
|
|
632
128
|
type: "checkbox",
|
|
633
|
-
icon: /* @__PURE__ */ f.cloneElement(
|
|
634
|
-
fontSize:
|
|
129
|
+
icon: /* @__PURE__ */ f.cloneElement(x, {
|
|
130
|
+
fontSize: x.props.fontSize ?? d
|
|
635
131
|
}),
|
|
636
|
-
checkedIcon: /* @__PURE__ */ f.cloneElement(
|
|
637
|
-
fontSize:
|
|
132
|
+
checkedIcon: /* @__PURE__ */ f.cloneElement(P, {
|
|
133
|
+
fontSize: P.props.fontSize ?? d
|
|
638
134
|
}),
|
|
639
|
-
disableRipple:
|
|
640
|
-
slots:
|
|
135
|
+
disableRipple: y,
|
|
136
|
+
slots: C,
|
|
641
137
|
slotProps: {
|
|
642
|
-
input:
|
|
643
|
-
"data-indeterminate":
|
|
138
|
+
input: D(typeof m == "function" ? m(u) : m, {
|
|
139
|
+
"data-indeterminate": i
|
|
644
140
|
})
|
|
645
141
|
}
|
|
646
142
|
}
|
|
647
143
|
});
|
|
648
|
-
return /* @__PURE__ */
|
|
649
|
-
...
|
|
650
|
-
classes:
|
|
144
|
+
return /* @__PURE__ */ n(R, {
|
|
145
|
+
...B,
|
|
146
|
+
classes: z
|
|
651
147
|
});
|
|
652
148
|
});
|
|
653
|
-
process.env.NODE_ENV !== "production" && (
|
|
149
|
+
process.env.NODE_ENV !== "production" && (S.propTypes = {
|
|
654
150
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
655
151
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
656
152
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -658,50 +154,50 @@ process.env.NODE_ENV !== "production" && (Z.propTypes = {
|
|
|
658
154
|
/**
|
|
659
155
|
* If `true`, the component is checked.
|
|
660
156
|
*/
|
|
661
|
-
checked:
|
|
157
|
+
checked: e.bool,
|
|
662
158
|
/**
|
|
663
159
|
* The icon to display when the component is checked.
|
|
664
160
|
* @default <CheckBoxIcon />
|
|
665
161
|
*/
|
|
666
|
-
checkedIcon:
|
|
162
|
+
checkedIcon: e.node,
|
|
667
163
|
/**
|
|
668
164
|
* Override or extend the styles applied to the component.
|
|
669
165
|
*/
|
|
670
|
-
classes:
|
|
166
|
+
classes: e.object,
|
|
671
167
|
/**
|
|
672
168
|
* @ignore
|
|
673
169
|
*/
|
|
674
|
-
className:
|
|
170
|
+
className: e.string,
|
|
675
171
|
/**
|
|
676
172
|
* The color of the component.
|
|
677
173
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
678
174
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
679
175
|
* @default 'primary'
|
|
680
176
|
*/
|
|
681
|
-
color:
|
|
177
|
+
color: e.oneOfType([e.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), e.string]),
|
|
682
178
|
/**
|
|
683
179
|
* The default checked state. Use when the component is not controlled.
|
|
684
180
|
*/
|
|
685
|
-
defaultChecked:
|
|
181
|
+
defaultChecked: e.bool,
|
|
686
182
|
/**
|
|
687
183
|
* If `true`, the component is disabled.
|
|
688
184
|
* @default false
|
|
689
185
|
*/
|
|
690
|
-
disabled:
|
|
186
|
+
disabled: e.bool,
|
|
691
187
|
/**
|
|
692
188
|
* If `true`, the ripple effect is disabled.
|
|
693
189
|
* @default false
|
|
694
190
|
*/
|
|
695
|
-
disableRipple:
|
|
191
|
+
disableRipple: e.bool,
|
|
696
192
|
/**
|
|
697
193
|
* The icon to display when the component is unchecked.
|
|
698
194
|
* @default <CheckBoxOutlineBlankIcon />
|
|
699
195
|
*/
|
|
700
|
-
icon:
|
|
196
|
+
icon: e.node,
|
|
701
197
|
/**
|
|
702
198
|
* The id of the `input` element.
|
|
703
199
|
*/
|
|
704
|
-
id:
|
|
200
|
+
id: e.string,
|
|
705
201
|
/**
|
|
706
202
|
* If `true`, the component appears indeterminate.
|
|
707
203
|
* This does not set the native input element to indeterminate due
|
|
@@ -709,75 +205,75 @@ process.env.NODE_ENV !== "production" && (Z.propTypes = {
|
|
|
709
205
|
* However, we set a `data-indeterminate` attribute on the `input`.
|
|
710
206
|
* @default false
|
|
711
207
|
*/
|
|
712
|
-
indeterminate:
|
|
208
|
+
indeterminate: e.bool,
|
|
713
209
|
/**
|
|
714
210
|
* The icon to display when the component is indeterminate.
|
|
715
211
|
* @default <IndeterminateCheckBoxIcon />
|
|
716
212
|
*/
|
|
717
|
-
indeterminateIcon:
|
|
213
|
+
indeterminateIcon: e.node,
|
|
718
214
|
/**
|
|
719
215
|
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
|
|
720
216
|
* @deprecated Use `slotProps.input` 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.
|
|
721
217
|
*/
|
|
722
|
-
inputProps:
|
|
218
|
+
inputProps: e.object,
|
|
723
219
|
/**
|
|
724
220
|
* Callback fired when the state is changed.
|
|
725
221
|
*
|
|
726
222
|
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
727
223
|
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
728
224
|
*/
|
|
729
|
-
onChange:
|
|
225
|
+
onChange: e.func,
|
|
730
226
|
/**
|
|
731
227
|
* If `true`, the `input` element is required.
|
|
732
228
|
* @default false
|
|
733
229
|
*/
|
|
734
|
-
required:
|
|
230
|
+
required: e.bool,
|
|
735
231
|
/**
|
|
736
232
|
* The size of the component.
|
|
737
233
|
* `small` is equivalent to the dense checkbox styling.
|
|
738
234
|
* @default 'medium'
|
|
739
235
|
*/
|
|
740
|
-
size:
|
|
236
|
+
size: e.oneOfType([e.oneOf(["medium", "small"]), e.string]),
|
|
741
237
|
/**
|
|
742
238
|
* The props used for each slot inside.
|
|
743
239
|
* @default {}
|
|
744
240
|
*/
|
|
745
|
-
slotProps:
|
|
746
|
-
input:
|
|
747
|
-
root:
|
|
241
|
+
slotProps: e.shape({
|
|
242
|
+
input: e.oneOfType([e.func, e.object]),
|
|
243
|
+
root: e.oneOfType([e.func, e.object])
|
|
748
244
|
}),
|
|
749
245
|
/**
|
|
750
246
|
* The components used for each slot inside.
|
|
751
247
|
* @default {}
|
|
752
248
|
*/
|
|
753
|
-
slots:
|
|
754
|
-
input:
|
|
755
|
-
root:
|
|
249
|
+
slots: e.shape({
|
|
250
|
+
input: e.elementType,
|
|
251
|
+
root: e.elementType
|
|
756
252
|
}),
|
|
757
253
|
/**
|
|
758
254
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
759
255
|
*/
|
|
760
|
-
sx:
|
|
256
|
+
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
761
257
|
/**
|
|
762
258
|
* The value of the component. The DOM API casts this to a string.
|
|
763
259
|
* The browser uses "on" as the default value.
|
|
764
260
|
*/
|
|
765
|
-
value:
|
|
261
|
+
value: e.any
|
|
766
262
|
});
|
|
767
|
-
function
|
|
768
|
-
const { className: t, sx:
|
|
769
|
-
return /* @__PURE__ */
|
|
770
|
-
|
|
263
|
+
function ne(o) {
|
|
264
|
+
const { className: t, sx: s, disabled: r, color: c = "blue", ...a } = o;
|
|
265
|
+
return /* @__PURE__ */ n(
|
|
266
|
+
S,
|
|
771
267
|
{
|
|
772
268
|
className: t,
|
|
773
|
-
disabled:
|
|
269
|
+
disabled: r,
|
|
774
270
|
...a,
|
|
775
271
|
sx: {
|
|
776
|
-
...
|
|
272
|
+
...s
|
|
777
273
|
}
|
|
778
274
|
}
|
|
779
275
|
);
|
|
780
276
|
}
|
|
781
277
|
export {
|
|
782
|
-
|
|
278
|
+
ne as CheckBox
|
|
783
279
|
};
|